summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/etc/functions
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-05-10 20:10:41 +0200
committerDirk von Suchodoletz2007-05-10 20:10:41 +0200
commit30c297c4b2f3f8f022e3b2dc52089dadd9bbfaee (patch)
tree13374e7867d0d0937b29eaa4e0092724cea0fcfb /initramfs/initrd-stuff/etc/functions
parentFurther additions/fix for WLAN support in stage3. (diff)
downloadcore-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/initrd-stuff/etc/functions')
-rw-r--r--initramfs/initrd-stuff/etc/functions41
1 files changed, 41 insertions, 0 deletions
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