From 30c297c4b2f3f8f022e3b2dc52089dadd9bbfaee Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Thu, 10 May 2007 18:10:41 +0000 Subject: 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 --- initramfs/initrd-stuff/etc/functions | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'initramfs/initrd-stuff/etc/functions') 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 -- cgit v1.2.3-55-g7522