Changeset 510


Ignore:
Timestamp:
07/28/09 18:23:40 (3 years ago)
Author:
tschmitt
Message:
  • Kernel: Standardcodierung wieder auf iso8859-1 zurückgesetzt.
  • Linbofs:
    • patch_registry: o Code aufgeräumt. o test_key Funktion verbessert. o neue Funktion test_value ermöglicht das Patchen nur der Werte, die auch

tatsächlich geändert sind.

  • linbo_cmd: o rsync-Option --fake-super wieder entfernt. o secaudit wieder entfernt, sichern und restaurieren der NTFS-Attribute wird

nur noch mit get-/setfattr realisiert, als Workaround bis rsync das kann.

o Knoppers rsync xattr Patch hinzugefügt (im Moment noch ohne Wirkung).

Location:
main/linuxmuster-linbo/branches/testing
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • main/linuxmuster-linbo/branches/testing/conf/initramfs.conf

    r509 r510  
    3333file /lib/libgcc_s.so.1 /lib/libgcc_s.so.1 755 0 0 
    3434file /lib/ld-linux.so.2 /lib/ld-linux.so.2 755 0 0 
     35file /lib/libncurses.so.5 /lib/libncurses.so.5 755 0 0 
    3536file /lib/libnsl.so.1 /lib/libnsl.so.1 755 0 0 
    3637file /lib/libnss_compat.so.2 /lib/libnss_compat.so.2 755 0 0 
     
    105106 
    106107# ntfs-3g 
    107 #file /bin/ntfs-3g ../../src/ntfs-3g/ntfs-3g 755 0 0 
    108 #file /bin/ntfs-3g ../../src/ntfs-3g/src/ntfs-3g 755 0 0 
    109108file /bin/ntfs-3g ../../src/ntfs-3g/src/.libs/ntfs-3g 755 0 0 
    110 file /bin/secaudit ../../src/ntfs-3g/src/.libs/secaudit 755 0 0 
     109#file /bin/secaudit ../../src/ntfs-3g/src/.libs/secaudit 755 0 0 
    111110file /lib/libntfs-3g.so.4915 ../../src/ntfs-3g/libntfs-3g/.libs/libntfs-3g.so.4915 755 0 0 
    112111# ntfs-3g 1.2920 MUST have this. 
     
    116115 
    117116# attr 
    118 #file /bin/getfattr /usr/bin/getfattr 755 0 0 
     117file /bin/getfattr /usr/bin/getfattr 755 0 0 
    119118file /bin/setfattr /usr/bin/setfattr 755 0 0 
    120119 
     
    146145file /usr/lib/grub/i386-pc/xfs_stage1_5 ../../src/grub4dos/stage2/xfs_stage1_5 755 0 0 
    147146file /usr/lib/grub/i386-pc/stage2_eltorito ../../src/grub4dos/stage2/stage2_eltorito 755 0 0 
    148 file /lib/libncurses.so.5 /lib/libncurses.so.5 755 0 0 
    149147 
    150148# grub4dos 
  • main/linuxmuster-linbo/branches/testing/debian/changelog

    r509 r510  
    11linuxmuster-linbo (1.99.2-0) unstable; urgency=low 
    22 
    3   * kernel: new version 2.6.30.2 
     3  * kernel: 
     4    - new version 2.6.30.2 
     5    - setting default nls back to iso8859-1 
    46  * linbofs: 
    57    - moved from self compiled mkntfs to Ubuntu's mkntfs 
     8    - patch_registry:  
     9      o some code cleanup 
     10      o improved test_key function 
     11      o added test_value function to patch only values which have changed 
    612    - linbo_cmd: 
    7       o added option --fake-super to rsync command 
    8       o mounting linux partitions with acls and xattrs enabled 
    9       o added code to save and restore extended ntfs attributes 
    10         with setfattr, getfattr and secaudit (disabled for now to test rsync --fake-super) 
     13      o added acl and xattr rsync and mount options 
     14      o changed option name "incremental" to "differential" 
     15      o minor modifications to differential ntfs image support 
     16      o added code to save and restore ntfs extended attributes with 
     17        get- and setfattr as a workaround 
    1118    - ntfs-3g: 
    1219      o new version 2009.4.4AC.15 
    13       o added secaudit binary  
    1420    - busybox: 
    1521      o new version 1.14.2 
    1622      o removed few unneeded applets 
     23    - rsync: added Knopper's xattr patch 
    1724  
    18  -- Thomas Schmitt <schmitt@lmz-bw.de>  Sat, 25 Jul 2009 15:24:11 +0200 
     25 -- Thomas Schmitt <schmitt@lmz-bw.de>  Tue, 27 Jul 2009 17:06:11 +0200 
    1926 
    2027linuxmuster-linbo (1.99.1-0) unstable; urgency=low 
  • main/linuxmuster-linbo/branches/testing/debian/control

    r509 r510  
    44Maintainer: Thomas Schmitt <schmitt@lmz-bw.de> 
    55Build-Depends: debhelper (>=7.0.17ubuntu4), build-essential (>=11.4), fakeroot, wget, udev (>=141-1.1), udev-extras, 
    6                nasm, syslinux, ncurses-base, coreutils, sysvinit-utils, util-linux, attr, ntfsprogs, 
     6               nasm, syslinux, ncurses-base, coreutils, sysvinit-utils, util-linux, attr, ntfsprogs, registry-tools, 
    77               tetex-base, libstdc++6, reiserfsprogs, e2fsprogs, dosfstools, unzip, tar, gzip, gettext, zlib1g-dev, 
    88               libncurses5-dev, tetex-bin, tetex-extra, udpcast, perl, libpopt-dev, libacl1-dev, libattr1-dev, 
  • main/linuxmuster-linbo/branches/testing/debian/md5sums.src

    r509 r510  
    99e649dc2587954e1a55c4acf6667a96fc  qt-embedded-free-3.3.7.tar.bz2 
    1010e9865d093a18e4668b9d31b635dc8e99  rsync-3.0.6.tar.gz 
    11 e3735e51dfa47ac36ca8a872a5a4705f  rsync-patches-3.0.6.tar.gz 
    1211257ac04e62ab7e3616e220333a1140cb  ssmtp_2.62.orig.tar.gz 
    1312c9f4e73e385c86b3a8faf9b615a04836  syslinux-3.82.tar.bz2 
  • main/linuxmuster-linbo/branches/testing/debian/rules

    r509 r510  
    170170                echo "[1mUnpacking $(RSYNC_ARCHIVE)...[0m" ; \ 
    171171                tar xf cache/$(RSYNC_ARCHIVE) -C src; \ 
     172                echo "[1mPatching rsync sources...[0m" ; \ 
     173                ( cd $(RSYNC_DIR) && for i in ../../patches/rsync/*; do patch -p1 <$$i; done ); \ 
    172174                ln -sf ../$(RSYNC_DIR) src/rsync; \ 
    173175        fi 
  • main/linuxmuster-linbo/branches/testing/linbo/linbo_cmd.sh

    r509 r510  
    200200 .cloop - full block device (partition) image, cloop-compressed 
    201201          accompanied by a .list file for quicksync 
    202  .rsync - incremental rsync batch, cloop-compressed 
     202 .rsync - differential rsync batch, cloop-compressed 
    203203 " 1>&2 
    204204} 
     
    702702# saves advanced ntfs attributes of partition mounted in /mnt 
    703703save_ntfs_attr(){ 
    704  # disabled 
    705  return 0 
    706 # echo -n "Sichere erweiterte NTFS Attribute ..." 
    707  echo "Sichere erweiterte NTFS Attribute ..." 
     704 echo -n "Sichere erweiterte NTFS Attribute ..." 
    708705 local rootdev="$1" 
    709 # local i="" 
    710 # for i in acl attrib reparse_data; do 
    711 #  echo -n " ${i} ..." 
    712 #  (cd /mnt && getfattr -R -h -e hex -d -n "system.ntfs_${i}" * 2>/dev/null | gzip -c > ".${i}.gz") 
    713 #  set_ntfs_admin_attr "/mnt/.${i}.gz" 
    714 # done 
    715  # security attributes 
    716  if umount /mnt; then 
    717   secaudit -b "$rootdev" 2>/dev/null | gzip -c > /tmp/.sec.gz 
    718  else 
    719   echo "Kann Partition $rootdev nicht aushängen!" 
    720   return 1 
    721  fi 
    722  if mountpart "$rootdev" /mnt -w ; then 
    723   mv /tmp/.sec.gz /mnt 
    724   set_ntfs_admin_attr "/mnt/.sec.gz" 
    725  else 
    726   echo "Kann Partition $rootdev nicht einhängen!" 
    727   return 1 
    728  fi 
    729  echo 
     706 local i="" 
     707 for i in acl attrib reparse_data; do 
     708  (cd /mnt && getfattr -R -h -e hex -d -n "system.ntfs_${i}" * 2>>/tmp/image.log | gzip -c > ".${i}.gz") 
     709  set_ntfs_admin_attr "/mnt/.${i}.gz" 
     710 done 
     711 echo " fertig." 
    730712} 
    731713 
     
    742724    echo "Bereite Partition $2 (Größe=${size}K) für Komprimierung vor..." | tee -a /tmp/image.log 
    743725    cleanup_fs /mnt 
    744     [ "$(fstype "$2")" = "ntfs" ] && save_ntfs_attr "$2" 
     726    # save extended ntfs attributes 
     727    [ "$(fstype "$2")" = "ntfs" ] && save_ntfs_attr 
    745728    echo "Leeren Platz auffüllen mit 0en..." | tee -a /tmp/image.log 
    746729    # Create nulled files of size 1GB, should work on any FS. 
     
    776759   fi 
    777760  ;; 
    778   incremental) 
     761  differential) 
    779762   if mountpart "$2" /mnt -w ; then 
    780763    rmmod cloop >/dev/null 2>&1 
     
    784767     if mountpart /dev/cloop /cloop -r ; then 
    785768      cleanup_fs /mnt 
    786       [ "$(fstype "$2")" = "ntfs" ] && save_ntfs_attr "$2" 
     769      # save extended ntfs attributes 
     770      [ "$(fstype "$2")" = "ntfs" ] && save_ntfs_attr 
    787771      echo "Starte Kompression von $2 -> $3 (differentiell)." | tee -a /tmp/image.log 
    788772      mkexclude 
     
    794778      #rm -f "$TMP" 
    795779      #interruptible rsync "$ROPTS" --exclude="/.linbo" --exclude-from="/tmp/rsync.exclude" --delete --delete-excluded --partial --only-write-batch="$3" /mnt/ /cloop 
    796       interruptible rsync "$ROPTS" --fake-super --exclude="/.linbo" --exclude-from="/tmp/rsync.exclude" --delete --delete-excluded --partial --log-file=/tmp/image.log --log-file-format="" --only-write-batch="$3" /mnt/ /cloop 2>&1 >>/tmp/image.log 
     780      #interruptible rsync "$ROPTS" --fake-super --exclude="/.linbo" --exclude-from="/tmp/rsync.exclude" --delete --delete-excluded --partial --log-file=/tmp/image.log --log-file-format="" --only-write-batch="$3" /mnt/ /cloop 2>&1 >>/tmp/image.log 
     781      interruptible rsync "$ROPTS" --exclude="/.linbo" --exclude-from="/tmp/rsync.exclude" --delete --delete-excluded --partial --log-file=/tmp/image.log --log-file-format="" --only-write-batch="$3" /mnt/ /cloop 2>&1 >>/tmp/image.log 
    797782      RC="$?" 
    798783      umount /cloop 
     
    909894 
    910895 
    911 # INCREMENTAL/Synced 
     896# differential/Synced 
    912897# sync_cloop imagefile targetdev 
    913898sync_cloop(){ 
     
    916901 local RC=1 
    917902 local ROPTS="-HaAX" 
     903 #local ROPTS="-a" 
    918904 [ "$(fstype "$2")" = "vfat" ] && ROPTS="-rt" 
    919905 if mountpart "$2" /mnt -w ; then 
     
    922908    rm -f "$TMP" 
    923909    # tschmitt: added logging parameter 
    924     interruptible rsync "$ROPTS" --fake-super --compress --partial --delete --log-file=/tmp/image.log --log-file-format="" --read-batch="$1" /mnt >"$TMP" 2>&1 ; RC="$?" 
     910    #interruptible rsync "$ROPTS" --fake-super --compress --partial --delete --log-file=/tmp/image.log --log-file-format="" --read-batch="$1" /mnt >"$TMP" 2>&1 ; RC="$?" 
     911    interruptible rsync "$ROPTS" --compress --partial --delete --log-file=/tmp/image.log --log-file-format="" --read-batch="$1" /mnt >"$TMP" 2>&1 ; RC="$?" 
    925912    if [ "$RC" != "0" ]; then 
    926913     cat "$TMP" >&2 | tee -a /tmp/image.log 
     
    944931      #[ "$(fstype "$2")" = "vfat" ] && ROPTS="$ROPTS --inplace" 
    945932      # tschmitt: added logging parameter 
    946       interruptible rsync "$ROPTS" --fake-super --partial --exclude="/.linbo" --exclude-from="/tmp/rsync.exclude" --delete --delete-excluded --log-file=/tmp/image.log --log-file-format="" /cloop/ /mnt >"$TMP" 2>&1 ; RC="$?" 
     933      #interruptible rsync "$ROPTS" --fake-super --partial --exclude="/.linbo" --exclude-from="/tmp/rsync.exclude" --delete --delete-excluded --log-file=/tmp/image.log --log-file-format="" /cloop/ /mnt >"$TMP" 2>&1 ; RC="$?" 
     934      interruptible rsync "$ROPTS" --partial --exclude="/.linbo" --exclude-from="/tmp/rsync.exclude" --delete --delete-excluded --log-file=/tmp/image.log --log-file-format="" /cloop/ /mnt >"$TMP" 2>&1 ; RC="$?" 
    947935      umount /cloop 
    948936      if [ "$RC" != "0" ]; then 
     
    10801068# restore NTFS attributes: rootdev 
    10811069restore_ntfs_attr(){ 
    1082  # disabled 
    1083  return 0 
    1084  local rootdev="$1" 
    10851070 # don't restore attributes if a complete cloop restore without rsync afterwards was done 
    10861071 if [ -e /tmp/.cloop ]; then 
     
    10881073  return 0 
    10891074 fi 
    1090 # echo -n "Restauriere erweiterte NTFS Attribute ..." 
    1091 # local i="" 
    1092 # for i in acl attrib reparse_data; do 
    1093 #  [ -f "/mnt/.${i}.gz" ] || continue 
    1094 #  echo -n " $i ..." 
    1095 #  (cd /mnt && zcat ".${i}.gz" | setfattr --restore=- 2>> /tmp/image.log) 
    1096 #  set_ntfs_admin_attr "/mnt/.${i}.gz" 
    1097 # done 
    1098  # restore security attributes 
    1099  if [ -f "/mnt/.sec.gz" ]; then 
    1100   echo "Restauriere erweiterte NTFS Attribute ..." 
    1101   cp /mnt/.sec.gz /tmp || return 1 
    1102   if umount /mnt; then 
    1103    zcat /tmp/.sec.gz | secaudit -s "$rootdev" 2&1>> /tmp/image.log 
    1104    mountpart "$rootdev" /mnt -w 
    1105    rm -f /tmp/.sec.gz 
    1106    set_ntfs_admin_attr "/mnt/.sec.gz" 
    1107   else 
    1108    echo "Kann Partition $rootdev nicht aushängen!" 
    1109    return 1 
    1110   fi 
    1111  fi 
    1112  sync 
    1113 # echo 
     1075 echo -n "Restauriere erweiterte NTFS Attribute ..." 
     1076 local i="" 
     1077 for i in acl attrib reparse_data; do 
     1078  [ -f "/mnt/.${i}.gz" ] || continue 
     1079  (cd /mnt && zcat ".${i}.gz" | setfattr --restore=- 2>> /tmp/image.log) 
     1080  set_ntfs_admin_attr "/mnt/.${i}.gz" 
     1081 done 
     1082 echo " Fertig." 
    11141083} 
    11151084 
     
    11591128    if [ -e /mnt/[Nn][Tt][Ll][Dd][Rr] -o -e /mnt/[Bb][Oo][Oo][Tt][Mm][Gg][Rr] ]; then 
    11601129     # tschmitt: logging 
    1161      echo "Patche System mit $patchfile" >/tmp/patch.log 
     1130     echo -n "Patche System mit $patchfile ... " >/tmp/patch.log 
    11621131     cat "$TMP" >>/tmp/patch.log 
    11631132     patch_registry "$TMP" /mnt 2>&1 >>/tmp/patch.log 
    11641133     [ -e /tmp/output ] && cat /tmp/output >>/tmp/patch.log 
     1134     echo "Fertig." 
    11651135     [ "$(fstype "$5")" = "vfat" ] && ms-sys -2 "$5" 
    11661136    elif [ -e /mnt/[Ii][Oo].[Ss][Yy][Ss] ]; then 
     
    11711141    rm -f "$TMP" 
    11721142   fi 
    1173    # restore NTFS attributes 
    1174    [ "$(fstype "$rootdev")" = "ntfs" ] && restore_ntfs_attr "$rootdev" 
    11751143   # patching for linux systems 
    11761144   # hostname 
     
    11831151   # fstab 
    11841152   [ -f /mnt/etc/fstab ] && patch_fstab "$rootdev" 
     1153   # restore extended ntfs attributes 
     1154   [ "$(fstype "$5")" = "ntfs" ] && restore_ntfs_attr 
    11851155   sync; sync; sleep 1 
    11861156   umount /mnt || umount -l /mnt 
     
    12181188#    RC=1 
    12191189#   else 
    1220     mk_cloop incremental "$5" "$2" "$3" ; RC="$?" 
     1190    mk_cloop differential "$5" "$2" "$3" ; RC="$?" 
    12211191#   fi 
    12221192   ;; 
  • main/linuxmuster-linbo/branches/testing/linbo/patch_registry.sh

    r509 r510  
    2020# this generates a LOT of debugging messages 
    2121DEBUG="-v" 
    22 file="" 
    23 tmplog="/tmp/output" 
    24 tmpctrls="/tmp/controlsets" 
    25 tmptest="/tmp/keytest" 
     22hive="" 
     23logfile="/tmp/output" 
    2624 
    2725leftchop(){ 
     
    4543} 
    4644 
    47 do_reg() { 
     45exec_command() { 
    4846 local cmd="$1" 
    49  local logfile="$2" 
    50  [ -z "$logfile" ] && logfile="$tmplog" 
    51  chntpw $DEBUG -e "$file" >> $logfile <<. 
     47 chntpw $DEBUG -e "$hive" >> $logfile <<. 
    5248$(echo -e "$cmd") 
    5349. 
     
    5551 
    5652test_key() { 
    57  local path="$1" 
    58  local key="$2" 
    59  local RC=0 
    60  local cmd="ls ${path}\nq\ny\n" 
    61  [ -e "$tmptest" ] && rm $tmptest 
    62  do_reg "$cmd" "$tmptest" 
    63  grep -q "<${key}>" $tmptest || RC=1 
     53 local key="$1" 
     54 local RC=1 
     55 echo -e "cd $key\nq\ny\n" | chntpw -e "$hive" | grep -q "not found\!" || RC="0" 
    6456 return $RC 
    6557} 
    6658 
    6759create_key() { 
    68  local path="$1" 
    69  local key="$2" 
    70  local cmd="cd ${path}\nnk ${key}\nq\ny\n" 
    71  do_reg "$cmd" 
    72 } 
    73  
    74 create_cmd() { 
     60 local fpath="$1" 
     61 local tpath="" 
     62 local bpath="" 
     63 local cmd="" 
     64 local i="" 
     65 local OIFS="$IFS" 
     66 IFS="\\" 
     67 for i in $fpath; do 
     68  bpath="$tpath" 
     69  if [ -n "$tpath" ]; then tpath="${tpath}\\${i}"; else tpath="$i"; fi 
     70  if ! test_key "$tpath"; then 
     71   if [ "$bpath" = "" ]; then 
     72    cmd="nk ${i}\nq\ny\n" 
     73   else 
     74    cmd="cd ${bpath}\nnk ${i}\nq\ny\n" 
     75   fi 
     76   exec_command "$cmd" 
     77  fi 
     78 done 
     79 IFS="$OIFS" 
     80} 
     81 
     82create_keypath() { 
    7583 local key="$1" 
    7684 local ctrlset="$2" 
     
    8088 ##### 
    8189 
    82  [ -n "$DEBUG" ] && echo "5  key=$key" | tee -a $tmplog 
     90 [ -n "$DEBUG" ] && echo " 5 key=$key" | tee -a $logfile 
    8391 # remove right end and replace it with a backslash 
    8492 key=`rightchopend "$key"` 
    8593 fullpath="$key" 
    86  key="$key\\" 
    87  
    88  [ -n "$DEBUG" ] && echo "6  fullpath=$fullpath" | tee -a $tmplog 
    89  
    90  currentkey=`leftget "$key"` 
    91  [ -n "$DEBUG" ] && echo "7  currentkey=$currentkey" | tee -a $tmplog 
    92  
    93  key=`leftchop "$key"` 
    94  [ -n "$DEBUG" ] && echo "8  key=$key" | tee -a $tmplog 
    95  
    96  base_path="" 
    97  while [ "$currentkey" != "" ]; do 
    98  
    99   [ -z "$base_path" ] && base_path="." 
    100  
    101   [ -n "$DEBUG" ] && echo "9  base_path=$base_path" | tee -a $tmplog 
     94 
     95 [ -n "$DEBUG" ] && echo " 6 fullpath=$fullpath" | tee -a $logfile 
    10296 
    10397        # tschmitt: check if currentkey exists in registry, if not create it 
    104         if ! test_key "$base_path" "$currentkey"; then 
    105    if [ -n "$ctrlset" ]; then 
    106     # don't create new keys in supplemental controlsets 
    107     [ -n "$DEBUG" ] && echo "### Skipping creation of $currentkey in $ctrlset!" | tee -a $tmplog 
    108     return 1 
    109    fi 
    110          [ -n "$DEBUG" ] && echo "### Creating key $currentkey" | tee -a $tmplog 
    111          create_key "$base_path" "$currentkey" 
     98        if ! test_key "$fullpath"; then 
     99  if [ -n "$ctrlset" ]; then 
     100   # don't create new keys in supplemental controlsets 
     101   [ -n "$DEBUG" ] && echo "### Skipping $fullpath" | tee -a $logfile 
     102   return 1 
     103  fi 
     104         [ -n "$DEBUG" ] && echo "### Creating key $fullpath" | tee -a $logfile 
     105         create_key "$fullpath" 
    112106        fi 
    113  
    114         if [ "$base_path" = "." ]; then 
    115          base_path="${currentkey}" 
    116         else 
    117          base_path="${base_path}\\${currentkey}" 
    118         fi 
    119  
    120   currentkey=`leftget "$key"` 
    121   [ -n "$DEBUG" ] && echo "10 currentkey=$currentkey" | tee -a $tmplog 
    122  
    123   key=`leftchop "$key"` 
    124   [ -n "$DEBUG" ] && echo "11 key=$key" | tee -a $tmplog 
    125  
    126  done 
    127  
    128  base_command="cd ${fullpath}\n" 
    129 } 
    130  
    131 create_val() { 
     107} 
     108 
     109# returns success if old value is equal to new value 
     110test_value(){ 
     111 local fpath="$1" 
     112 local newval="$2" 
     113 local curval="$(echo -e "cat ${fpath}\nq\ny\n" | chntpw -e "$hive" | grep -Fi "$newval")" 
     114 if [ -n "$curval" ]; then 
     115  [ -n "$DEBUG" ] && echo "### $parameter is already set to $curval. Skipping." | tee -a $logfile 
     116  return 0 
     117 else 
     118  [ -n "$DEBUG" ] && echo "### $parameter is not equal to $newval. Patching." | tee -a $logfile 
     119  return 1 
     120 fi 
     121} 
     122 
     123create_command() { 
    132124 #### 
    133125 # parse value changes 
    134126 #### 
    135  [ -n "$DEBUG" ] && echo "12 change=$change" | tee -a $tmplog 
     127 [ -n "$DEBUG" ] && echo " 7 change=$change" | tee -a $logfile 
    136128 
    137129 if [ "$change" = "" ]; then  
     
    139131 fi 
    140132 
    141  command="${base_command}" 
    142  [ -n "$DEBUG" ] && echo "13 command=$command" | tee -a $tmplog 
     133 command="cd ${fullpath}\n" 
     134 [ -n "$DEBUG" ] && echo " 8 command=$command" | tee -a $logfile 
    143135 
    144136 parameter=`leftgetvalue "$change"` 
    145  [ -n "$DEBUG" ] && echo "14 parameter=$parameter" | tee -a $tmplog 
     137 [ -n "$DEBUG" ] && echo " 9 parameter=$parameter" | tee -a $logfile 
    146138 
    147139 parameter="$(echo "$parameter" | sed 's,\",,g')" 
    148  [ -n "$DEBUG" ] && echo "15 parameter=$parameter" | tee -a $tmplog 
     140 [ -n "$DEBUG" ] && echo "10 parameter=$parameter" | tee -a $logfile 
    149141 
    150142 value=`rightgetvalue "$change"` 
    151  [ -n "$DEBUG" ] && echo "16 value=$value" | tee -a $tmplog 
     143 [ -n "$DEBUG" ] && echo "11 value=$value" | tee -a $logfile 
    152144 
    153145 value="$(echo "$value" | sed 's,\",,g')" 
    154  [ -n "$DEBUG" ] && echo "17 value=$value" | tee -a $tmplog 
    155            
     146 [ -n "$DEBUG" ] && echo "12 value=$value" | tee -a $logfile 
     147 
    156148 value="$(echo "$value" | sed 's,$,,g')" 
    157  [ -n "$DEBUG" ] && echo "18 value=$value" | tee -a $tmplog 
     149 [ -n "$DEBUG" ] && echo "13 value=$value" | tee -a $logfile 
    158150 
    159151 # our standard type for strings is REG_SZ 
     
    166158 esac 
    167159 if [ -n "$DEBUG" ]; then 
    168   echo "19 type=$type" | tee -a $tmplog 
    169   echo "20 value=$value" | tee -a $tmplog 
     160  echo "14 type=$type" | tee -a $logfile 
     161  echo "15 value=$value" | tee -a $logfile 
     162 fi 
     163 
     164 # return if value is already set -> nothing to do 
     165 if [ -n "$value" ]; then 
     166  test_value "${fullpath}\\${parameter}" "$value" && return 1 
    170167 fi 
    171168 
    172169 command="${command}dv ${parameter}\n" 
     170 [ -n "$DEBUG" ] && echo "16 command=$command" | tee -a $logfile 
     171 
    173172 command="${command}nv ${type} ${parameter}\n" 
    174  [ -n "$DEBUG" ] && echo "21 command=$command" | tee -a $tmplog 
     173 [ -n "$DEBUG" ] && echo "17 command=$command" | tee -a $logfile 
    175174 
    176175 command="${command}ed ${parameter}\n" 
    177  [ -n "$DEBUG" ] && echo "22 command=$command" | tee -a $tmplog 
    178  
     176 [ -n "$DEBUG" ] && echo "18 command=$command" | tee -a $logfile 
     177 
     178 # out final command 
    179179 command="${command}$value\nq\ny\n" 
    180  [ -n "$DEBUG" ] && echo "23 command=$command" | tee -a $tmplog 
    181  
    182  # out final command 
    183  [ -n "$DEBUG" ] && echo "24 final command=$command" | tee -a $tmplog 
     180 [ -n "$DEBUG" ] && echo "19 final command=$command" | tee -a $logfile 
    184181} 
    185182 
    186183while read -r key; do 
    187  [ -n "$DEBUG" ] && echo "$key $((count++))" | tee -a $tmplog 
    188  
    189  # select file for patching 
     184 [ -n "$DEBUG" ] && echo "$key $((count++))" | tee -a $logfile 
     185 
     186 # select hive for patching 
    190187 case "$key" in  
    191188  \[HKEY_LOCAL_MACHINE*)  
    192189   key="$(leftchop "$key")" 
    193    [ -n "$DEBUG" ] && echo "1  key=$key" | tee -a $tmplog 
     190   [ -n "$DEBUG" ] && echo " 1 key=$key" | tee -a $logfile 
    194191 
    195192   case `leftget "$key"` in 
    196193    [Ss][Yy][Ss][Tt][Ee][Mm]*)  
    197      file="$(ls -1d $2/[Ww][Ii][Nn][Dd][Oo][Ww][Ss]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Yy][Ss][Tt][Ee][Mm] 2>/dev/null | tail -1)" 
    198      [ -z "$file" ] && file="$(ls -1d $2/[Ww][Ii][Nn][Nn][Tt]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Yy][Ss][Tt][Ee][Mm] 2>/dev/null | tail -1)" 
    199      # strip file 
     194     hive="$(ls -1d $2/[Ww][Ii][Nn][Dd][Oo][Ww][Ss]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Yy][Ss][Tt][Ee][Mm] 2>/dev/null | tail -1)" 
     195     [ -z "$hive" ] && hive="$(ls -1d $2/[Ww][Ii][Nn][Nn][Tt]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Yy][Ss][Tt][Ee][Mm] 2>/dev/null | tail -1)" 
     196     # strip hive 
    200197     key=`leftchop "$key"` 
    201      [ -n "$DEBUG" ] && echo "2  key=$key" | tee -a $tmplog 
     198     [ -n "$DEBUG" ] && echo " 2 key=$key" | tee -a $logfile 
    202199 
    203200     # change "CurrentControlSet" to "ControlSet001" 
    204201     key="$(echo "$key" | sed 's,CurrentControlSet,ControlSet001,')" 
    205      [ -n "$DEBUG" ] && echo "3  key=$key" | tee -a $tmplog 
     202     [ -n "$DEBUG" ] && echo " 3 key=$key" | tee -a $logfile 
    206203     ;; 
    207204    [Ss][Oo][Ff][Tt][Ww][Aa][Rr][Ee]*)  
    208      file="$(ls -1d $2/[Ww][Ii][Nn][Dd][Oo][Ww][Ss]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Oo][Ff][Tt][Ww][Aa][Rr][Ee] 2>/dev/null | tail -1)" 
    209      [ -z "$file" ] && file="$(ls -1d $2/[Ww][Ii][Nn][Nn][Tt]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Oo][Ff][Tt][Ww][Aa][Rr][Ee] 2>/dev/null | tail -1)" 
    210      # strip file 
     205     hive="$(ls -1d $2/[Ww][Ii][Nn][Dd][Oo][Ww][Ss]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Oo][Ff][Tt][Ww][Aa][Rr][Ee] 2>/dev/null | tail -1)" 
     206     [ -z "$hive" ] && hive="$(ls -1d $2/[Ww][Ii][Nn][Nn][Tt]/[Ss][Yy][Ss][Tt][Ee][Mm]32/[Cc][Oo][Nn][Ff][Ii][Gg]/[Ss][Oo][Ff][Tt][Ww][Aa][Rr][Ee] 2>/dev/null | tail -1)" 
     207     # strip hive 
    211208     key=`leftchop "$key"` 
    212      [ -n "$DEBUG" ] && echo "4  key=$key" | tee -a $tmplog 
     209     [ -n "$DEBUG" ] && echo " 4 key=$key" | tee -a $logfile 
    213210     ;; 
    214211   esac 
    215212 
    216    create_cmd "$key" 
     213   create_keypath "$key" 
    217214 
    218215   while read -r change; do 
    219216 
    220     create_val || break 
    221  
    222     do_reg "$command" 
    223  
    224           # tschmitt: patch other controlsets up to 9 
     217    create_command || break 
     218    exec_command "$command" 
     219 
     220          # tschmitt: patch other controlsets up to 3 
    225221    case "$command" in 
    226222     *ControlSet001*) 
    227                   if [ ! -s "$tmpctrls" ]; then 
    228                    [ -n "$DEBUG" ] && echo "### Writing $tmpctrls ..." | tee -a $tmplog 
    229                    controlcheck="ls\nq\ny\n" 
    230                    do_reg "$controlcheck" "$tmpctrls" 
    231                   fi 
    232                   n=2 
    233                   while [ $n -lt 10 ]; do 
    234                          ctrlset="ControlSet00$n" 
    235                          [ -n "$DEBUG" ] && echo "### Checking $ctrlset ..." | tee -a $tmplog 
    236                          if grep -q "<$ctrlset>" $tmpctrls; then 
    237                           key_new="$(echo "$key" | sed "s,ControlSet001,$ctrlset,")" 
    238                                 [ -n "$DEBUG" ] && echo "### Patching $ctrlset with new key: $key_new" | tee -a $tmplog 
    239                                 if create_cmd "$key_new" "$ctrlset"; then 
    240                                  create_val && do_reg "$command" 
    241                                 fi 
    242                          fi 
    243                          let n+=1 
    244                   done 
    245                   ;; 
     223                    n=2 
     224                    while [ $n -lt 4 ]; do 
     225                            ctrlset="ControlSet00$n" 
     226                            [ -n "$DEBUG" ] && echo "### Checking $ctrlset ..." | tee -a $logfile 
     227                            if test_key "$ctrlset"; then 
     228                             key_new="$(echo "$key" | sed "s,ControlSet001,$ctrlset,")" 
     229                                    [ -n "$DEBUG" ] && echo "### Patching $ctrlset with new key: $key_new" | tee -a $logfile 
     230                                    if create_keypath "$key_new" "$ctrlset"; then 
     231                                     create_command && exec_command "$command" 
     232                                    fi 
     233                            fi 
     234                            let n+=1 
     235                    done 
     236                    ;; 
    246237    esac 
    247238 
     
    252243done < "$1" # while read -r key 
    253244 
    254 # merge logfiles 
    255 cat $tmplog >> $tmpctrls 
    256 mv $tmpctrls $tmplog 
    257  
Note: See TracChangeset for help on using the changeset viewer.