summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/etc/functions
diff options
context:
space:
mode:
authorFelix Endres2007-02-27 18:58:57 +0100
committerFelix Endres2007-02-27 18:58:57 +0100
commit1a90b05c1a91c90a37232c84c4efd5a61d3ecb3c (patch)
treed73daa07787d66fe1a0a9466d131d276391b08f3 /initramfs/initrd-stuff/etc/functions
parentUse appropriate start scripts (diff)
downloadcore-1a90b05c1a91c90a37232c84c4efd5a61d3ecb3c.tar.gz
core-1a90b05c1a91c90a37232c84c4efd5a61d3ecb3c.tar.xz
core-1a90b05c1a91c90a37232c84c4efd5a61d3ecb3c.zip
Rootfs stacking functionality for unionfs
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@730 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff/etc/functions')
-rw-r--r--initramfs/initrd-stuff/etc/functions80
1 files changed, 42 insertions, 38 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index d05c2c5d..9179973c 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -938,45 +938,49 @@ 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
+# This function gets an uri or a comma separated list of uris as parameter.
+# It will then try to mount these uris and add them to the union at /
+include_in_fsroot_union () {
+ union_id=0 # used to have guarantee differing names for the unions mount point
+ for ROOTFS in `echo $1 |sed 's/,/ /g'`; do
+ union_id=$(( $union_id + 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/${root_path}_${union_id}
+ nfsmnt $nfsserver:$root_path /mnt/tmp/${root_path}_${union_id} || error \
+ "Fehler beim mounten der zusatzunion (FIXME)"
+ ;;
+ *nbd)
+ echo "Not working yet"
+ 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/${root_path}_${union_id}
+ done
}
# kdmrc template started from distro specific functions files