From faf067f3761cfd290aa9aa3c69b896175dbaa5f9 Mon Sep 17 00:00:00 2001 From: Felix Endres Date: Mon, 26 Feb 2007 00:15:41 +0000 Subject: First draft of function to stack the root fs from different sources with unionfs git-svn-id: http://svn.openslx.org/svn/openslx/trunk@720 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/etc/functions | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'initramfs/initrd-stuff/etc/functions') diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index a193fb59..bba03f4a 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -932,6 +932,46 @@ for i in boot.ld ${D_INITSCRIPTS}; do #ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/K${revcnt}$i done } +# This function gets an uri as parameter. +# It will then try to mount this uri and add it to the union at / +include_in_fsroot_union () { + ROOTFS=$1 + srvproto=$(uri_token $ROOTFS prot) + case $srvproto in + nfs) + # nfsroot consists now of two different parts + root_path=/$(uri_token $ROOTFS path) + nfsserver=$(uri_token $ROOTFS server) + echo -e "NFS $ROOTFS parsed to $srvproto - $nfsserver - \ +$root_path" >> /tmp/felixtestlog + mkdir -p /mnt/tmp/rootunion + nfsmnt $nfsserver:$root_path /mnt/tmp/rootunion || error "Fehler beim mounten der zusatzunion (FIXME)" + ;; + *nbd) + nbdmod=$srvproto + # get settings for nbd-client, filesystem equals to path in URI + # notation + nbdhost=$(uri_token $ROOTFS server) + nbdport=$(uri_token $ROOTFS port) + nbdrfst=$(uri_token $ROOTFS path) + echo -e "(D)NBD $ROOTFS parsed to $srvproto - $nbdhost - \ +$nbdport - $nbdrfst" >> /tmp/felixtestlog + #FIXME: mount durchführen + ;; + aoe) + echo "Not implemented yet" + ;; + iscsi) + echo "Not implemented yet" + #iscsiserver=$(uri_token $ROOTFS server) + #iscsiport=$(uri_token $ROOTFS port) + #iscsitarget=$(uri_token $ROOTFS path) + ;; + esac + unionctl /mnt/ --add --after 1 --mode ro /mnt/tmp/rootunion + bash + +} # kdmrc template started from distro specific functions files config_kdm_template () { -- cgit v1.2.3-55-g7522