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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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   ;; 
Note: See TracChangeset for help on using the changeset viewer.