Ignore:
Timestamp:
06/26/09 20:30:09 (3 years ago)
Author:
tschmitt
Message:
  • Paket: kexec-tools aus build dependencies entfernt.
  • Linbofs:
    • mount/umount jetzt von Ubuntu 9.04, nicht mehr von Busybox.
    • ext4-Unterstützung implementiert.
    • Rsync auf Version 3.0.6 aktualisiert.
    • linbo_cmd: o lokales menu.lst Handling verbessert: Eigene menu.lst-Dateien werden von LINBO

nicht mehr verändert, Menue-Position des Windows-Systems wird nun
ermittelt und beim Reboot als Default gesetzt (betr. nur Windows-Systeme, die
den Reboot-Workaround benötigen, zuvor wurde immer der 2. Eintrag gestartet).

o Verbessertes Patching der fstab bei Linuxclients:

Dateisystem-Typ wird der Rootpartition wird ermittelt und ggf. gepatcht, wenn er
in fstab nicht korrekt eingetragen ist; fstab wird nur gepatcht, falls Rootpartition
oder Dateisystem-Typ abweichen, nicht mehr praeventiv.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/linuxmuster-linbo/trunk/linbo/linbo_cmd.sh

    r496 r499  
    271271 # fix vanished cloop device 
    272272 if [ "$1" = "/dev/cloop" ]; then 
    273   [ -e "/dev/cloop" ] || ln -s /dev/cloop0 /dev/cloop 
     273  [ -e "/dev/cloop" ] || ln -sf /dev/cloop0 /dev/cloop 
    274274 fi 
    275275 for i in 1 2 3 4 5; do 
     
    315315  swap) mkswap "$1" ;; 
    316316  reiserfs) mkreiserfs -f -f  "$1" ;; 
    317   ext2) mke2fs -b 4096 -f 4096 -m 0 "$1" ;; 
    318   ext3) mke2fs -b 4096 -f 4096 -m 0 -j "$1" ;; 
     317  ext2|ext3|ext4) mkfs."$2" "$1" ;; 
    319318  [Nn][Tt][Ff][Ss]*) mkfs.ntfs -Q "$1" ;; 
    320319  *[Ff][Aa][Tt]*) mkdosfs -F 32 "$1" ;; 
     
    516515} 
    517516 
    518 # tschmitt 
    519 # patch fstab with root partition 
    520 patch_fstab(){ 
    521  echo -n "patch_fstab " ;  printargs "$@" 
    522  local appendstr="$1" 
    523  local line="" 
    524  local rootpart="" 
    525  local found="" 
    526  local item="" 
    527  for item in $appendstr; do 
    528   echo $item | grep -q ^root && rootpart=`echo $item | awk -F\= '{ print $2 }'` 
    529  done 
    530  [ -z "$rootpart" ] && return 1 
    531  [ -e /tmp/fstab ] && rm -f /tmp/fstab 
    532  while read line; do 
    533   mntpnt=`echo $line | awk '{ print $2 }'` 
    534   if [ "$mntpnt" = "/" -a "$found" = "" ] && ! echo "$line" | grep ^#; then 
    535    echo "$line" | sed -e 's,.* /,'"$rootpart"' /,' - >> /tmp/fstab 
    536    found=yes 
    537   else 
    538     echo "$line" >> /tmp/fstab 
    539   fi 
    540  done </mnt/etc/fstab 
    541  if [ -n "$found" ]; then 
    542   echo "Setze Rootpartition in fstab -> $rootpart." 
    543   mv -f /mnt/etc/fstab /mnt/etc/fstab.bak 
    544   mv -f /tmp/fstab /mnt/etc 
    545  fi 
    546 } 
    547  
    548 # compute grub menu.lst entry number: boot 
     517# compute grub menu.lst entry number: grubnr boot 
    549518grubnr(){ 
    550519 [ -s /cache/boot/grub/menu.lst ] || return 1 
     
    630599   # change bootloader for win98 systems 
    631600   APPEND="$(echo $APPEND | sed -e 's/ntldr/io.sys/')" 
    632   elif [ -e /mnt/etc/fstab ]; then 
    633    # tschmitt: patch fstab with root device 
    634    patch_fstab "$APPEND" 
    635601  fi 
    636602 else 
     
    1008974} 
    1009975 
     976# tschmitt 
     977# patch fstab with root partition and root fstype: patch_fstab rootdev 
     978patch_fstab(){ 
     979 echo -n "patch_fstab " ;  printargs "$@" 
     980 local rootdev="$1" 
     981 local line="" 
     982 local found="" 
     983 local fstype_mount="" 
     984 local fstype_fstab="" 
     985 local mntpnt="" 
     986 local changed="" 
     987 local rootdev_fstab="" 
     988 local options="" 
     989 local dump="" 
     990 local pass="" 
     991 [ -z "$rootdev" ] && return 1 
     992 [ -e "$rootdev" ] || return 1 
     993 [ -e /tmp/fstab ] && rm -f /tmp/fstab 
     994 while read line; do 
     995  if [ -n "$line" -a "${line:0:1}" != "#" ]; then 
     996   mntpnt="$(echo "$line" | awk '{ print $2 }')" 
     997   if [ "$mntpnt" = "/" -a -z "$found" ]; then 
     998    found=yes 
     999    rootdev_fstab="$(echo "$line" | awk '{ print $1 }')" 
     1000    [ -z "$rootdev_fstab" ] && return 1 
     1001    fstype_fstab="$(echo "$line" | awk '{ print $3 }')" 
     1002    [ -z "$fstype_fstab" ] && return 1 
     1003    options="$(echo "$line" | awk '{ print $4 }')" 
     1004    [ -z "$options" ] && return 1 
     1005    dump="$(echo "$line" | awk '{ print $5 }')" 
     1006    [ -z "$dump" ] && return 1 
     1007    pass="$(echo "$line" | awk '{ print $6 }')" 
     1008    [ -z "$pass" ] && return 1 
     1009    if [ "$rootdev_fstab" != "$rootdev" ]; then 
     1010     # change root partition if necessary 
     1011     echo "Setze Rootpartition: $rootdev." 
     1012     rootdev_fstab="$rootdev" 
     1013     line="$rootdev_fstab $mntpnt $fstype_fstab $options $dump $pass" 
     1014     changed=yes 
     1015    fi # rootdev 
     1016    # check for changed filesytem type if partition was formatted 
     1017    fstype_mount="$(cat /proc/mounts | grep "^$rootdev" | awk '{ print $3 }')" 
     1018    [ -z "$fstype_mount" ] && return 1 
     1019    if [ "$fstype_fstab" != "$fstype_mount" ]; then 
     1020     # change filesystem 
     1021     echo "Setze Dateisystem: $fstype_mount." 
     1022     fstype_fstab="$fstype_mount" 
     1023     line="$rootdev_fstab $mntpnt $fstype_fstab $options $dump $pass" 
     1024     changed=yes 
     1025    fi # fstype 
     1026   fi # mntpnt 
     1027  fi # line 
     1028  echo "$line" >> /tmp/fstab 
     1029 done </mnt/etc/fstab # reading fstab 
     1030 if [ -n "$changed" ]; then 
     1031  mv -f /mnt/etc/fstab /mnt/etc/fstab.bak 
     1032  mv -f /tmp/fstab /mnt/etc 
     1033 fi 
     1034} 
     1035 
    10101036# syncl cachedev baseimage image bootdev rootdev kernel initrd append [force] 
    10111037syncl(){ 
    10121038 local RC=1 
    10131039 local patchfile="" 
     1040 local rootdev="$5" 
    10141041 echo -n "syncl " ; printargs "$@" 
    10151042 mountcache "$1" || return "$?" 
     
    10641091    rm -f "$TMP" 
    10651092   fi 
     1093   # patching for linux systems 
     1094   # hostname 
    10661095   if [ -f /mnt/etc/hostname ]; then 
    10671096    if [ -n "$HOSTNAME" ]; then 
     
    10701099    fi 
    10711100   fi 
     1101   # fstab 
     1102   [ -f /mnt/etc/fstab ] && patch_fstab "$rootdev" 
    10721103   sync; sync; sleep 1 
    10731104   umount /mnt || umount -l /mnt 
Note: See TracChangeset for help on using the changeset viewer.