diff options
author | Dirk von Suchodoletz | 2007-05-10 20:10:41 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-05-10 20:10:41 +0200 |
commit | 30c297c4b2f3f8f022e3b2dc52089dadd9bbfaee (patch) | |
tree | 13374e7867d0d0937b29eaa4e0092724cea0fcfb /initramfs | |
parent | Further additions/fix for WLAN support in stage3. (diff) | |
download | core-30c297c4b2f3f8f022e3b2dc52089dadd9bbfaee.tar.gz core-30c297c4b2f3f8f022e3b2dc52089dadd9bbfaee.tar.xz core-30c297c4b2f3f8f022e3b2dc52089dadd9bbfaee.zip |
Switched to much more flexible disk formatting for /tmp (starting with
xfs - thanks Olli for the hint!). Should be added to beta branch if
tested, appoved ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1040 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rwxr-xr-x | initramfs/initrd-stuff/bin/hwautocfg | 21 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 41 |
2 files changed, 51 insertions, 11 deletions
diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg index a9c4cebc..1f0e3429 100755 --- a/initramfs/initrd-stuff/bin/hwautocfg +++ b/initramfs/initrd-stuff/bin/hwautocfg @@ -402,8 +402,8 @@ done ) & [ $DEBUGLEVEL -eq 21 ] && echo "** starting hdd stuff at $(sysup)" if [ "${disk}" = "yes" ] ; then for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ - sed -n -e '/device:/p' | sed -e 's/device: //') ; do - fdisk -l /dev/$hd| sed -n "/^\/dev\//p" > /tmp/hd_part + sed -n -e '/device:/p'|sed -e 's/device: //') ; do + /mnt/sbin/fdisk -l /dev/$hd|sed -n "/^\/dev\//p" > /tmp/hd_part for hdpartnr in $(cat /tmp/hd_part | \ sed -n -e "/ 82 /p"|sed -e "s/[[:space:]].*//") ; do echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >> /tmp/fstab @@ -413,15 +413,14 @@ for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ # corrupted for hdpartnr in $(cat /tmp/hd_part | \ sed -n -e "/ 44 /p"|sed -e "s/[[:space:]].*//") ; do - # ext2fs_check_if_mount message supressed - ( LD_LIBRARY_PATH=/mnt/lib /mnt/sbin/mkfs.ext2 -Fq $hdpartnr 2>/dev/null - umount /mnt/tmp 2>/dev/null - # if mounting of temp partion fails fall back to tmpfs on /tmp - mount -t ext2 -n -o nocheck,noexec $hdpartnr /mnt/tmp 2>/dev/null || \ - mount -n -t tmpfs none /mnt/tmp - echo "$hdpartnr is mounted to /mnt/tmp at $(sysup)" > /tmp/tmpready ) & - echo -e "$hdpartnr\t/tmp\t\text2\t\tdefaults\t 0 0" >> /tmp/fstab - part44=yes + # check for supported filesystem and formatter + ( if diskfm $hdpartnr ; then + echo "$hdpartnr is mounted to /mnt/tmp at $(sysup)" > /tmp/tmpready + echo -e "$hdpartnr\t/tmp\t\tauto\t\tdefaults\t 0 0" >> /tmp/fstab + part44=yes + else + echo "formatting failed for some reason ($(sysup))" > /tmp/tmpready + fi ) & break done # put detected linux partitions into /etc/fstab with "noauto" diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 0c4751c4..39920e5d 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -241,6 +241,47 @@ mount -n -t nfs -o ro,nolock,tcp $nfsroot $dest || \ return $ret } ############################################################################# +# disk formatter and mounter +diskfm () { +local target=$1 +local fs +local path +for fs in xfs ext2 reiserfs ; do + if strinfile "$fs" /proc/filesystems || modprobe ${MODPRV} $fs ; then + unset $found + for path in /sbin /bin /usr/sbin /usr/bin ; do + if test -x /mnt/$path/mkfs.$fs ; then + found=yes + case mkfs.$fs in + mkfs.xfs) + fopt="-f" + mopt="-o noexec" + ;; + mkfs.ext2) + fopt="-Fq" + mopt="-o nocheck,noexec" + ;; + mkfs.reiserfs) + fopt="-f" + mopt="-o noexec" + ;; + esac + LD_LIBRARY_PATH=/mnt/lib /mnt/$path/mkfs.$fs $fopt $target \ + >/dev/null 2>&1 #|| error + umount /mnt/tmp 2>/dev/null + if mount -t $fs -n $mopt $target /mnt/tmp 2>/dev/null; then + return 0 + else + mount -n -t tmpfs none /mnt/tmp + fi + fi + done + [ -z $found ] && break + else break + fi +done +} +############################################################################# # create configuration file for dhclient mkdhclconf () { local vci=$1 |