summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff
diff options
context:
space:
mode:
authorFelix Endres2007-04-21 16:34:00 +0200
committerFelix Endres2007-04-21 16:34:00 +0200
commit2f0b206504e1421c78cd2630f62005b20a44afe0 (patch)
tree80b960a77d3aa5a3a88a85a7e0e1c526ac07c635 /initramfs/initrd-stuff
parentAUFS and UnionFS adjustments (diff)
downloadcore-2f0b206504e1421c78cd2630f62005b20a44afe0.tar.gz
core-2f0b206504e1421c78cd2630f62005b20a44afe0.tar.xz
core-2f0b206504e1421c78cd2630f62005b20a44afe0.zip
Bugfixing and fine-tuning last changes
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@914 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff')
-rw-r--r--initramfs/initrd-stuff/etc/functions8
-rw-r--r--initramfs/initrd-stuff/etc/messages4
-rwxr-xr-xinitramfs/initrd-stuff/init18
3 files changed, 16 insertions, 14 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 9a049c15..1fa21a35 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -981,12 +981,12 @@ include_in_fsroot_union () {
#iscsitarget=$(uri_token $ROOTFS path)
;;
esac
- if [ "X$union_type" == "Xunionfs" ]; then
- echo "Using unionctl to mount ${root_path}_${union_id} (type: $union_type)"
+ if [ "X$union_type" == "XUnionFS" ]; then
+ [ "$DEBUGLEVEL" -gt 2 -a "$DEBUGLEVEL" != 8 ] && echo "Using unionctl to mount ${root_path}_${union_id} (type: $union_type)"
unionctl /mnt/ --add --after 1 --mode ro /mnt/tmp/${root_path}_${union_id}
- elif [ "X$union_type" == "Xaufs" ]; then
+ elif [ "X$union_type" == "XAUFS" ]; then
#unionctl for aufs is a sh script needing tools not included in our initrd
- echo "Using aufs-mount to mount ${root_path}_${union_id} (type: $union_type)"
+ [ "$DEBUGLEVEL" -gt 2 -a "$DEBUGLEVEL" != 8 ] && echo "Using aufs-mount to mount ${root_path}_${union_id} (type: $union_type)"
mount -n -o remount,add:1:/mnt/tmp/${root_path}_${union_id}=ro none /mnt
else
error $init_loadunions nonfatal
diff --git a/initramfs/initrd-stuff/etc/messages b/initramfs/initrd-stuff/etc/messages
index 768c4b59..39f6c2bb 100644
--- a/initramfs/initrd-stuff/etc/messages
+++ b/initramfs/initrd-stuff/etc/messages
@@ -70,8 +70,8 @@ failed -\n Either module is not present or module does not match the \
running\n kernel. If you do not want to see this message remove the token \
'cowloop' from kernel command line."
init_cownonbd=" Loading of cow module is of no sense if no network block \
-device is used or\n UnionFS was specified as read write layer too. Remove \
-UnionFS token from\n kernel commandline if cowloop should be used instead."
+device is used or\n UnionFS/AUFS was specified as read write layer too. Remove \
+UnionFS/AUFS token from\n kernel commandline if cowloop should be used instead."
init_nfs=" Mount of root filesystem via NFS was requested via kernel command \
line\nbut failed. There might be the following reasons for that:\n\
* No nfs.ko module could be loaded and no NFS support was present in the\n\
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index a3e24a83..b9f828b8 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -389,9 +389,10 @@ if [ -n "${nbdmod}" ] ; then
[ -x /bin/mdev ] && mdev -s
fi
if [ -n "${cowloop}" ] ; then
- if [ -n "${unionfs}" ] ; then
+ if [ -n "${unionfs}" -o -n "${aufs}" ] ; then
error "$init_cownonbd"
unionfs="";
+ aufs="";
fi
echo "Using Copy-on-Write block device for rw access"
mount -n -t tmpfs -o size=${cowsize} ramfs ${rwdir}
@@ -463,7 +464,7 @@ fi
union_type=""
# try to use unionfs for rw access if available
if [ -n "${unionfs}" ]; then
- modprobe ${MODPRV} unionfs && union_type="unionfs"
+ modprobe ${MODPRV} unionfs && union_type="UnionFS"
if [ -z "$union_type" ]; then
error "$init_loadufs" nonfatal
unionfs="";
@@ -473,7 +474,7 @@ if [ -n "${unionfs}" ]; then
fi
# try to use aufs for rw access if available
if [ -n "${aufs}" ]; then
- modprobe ${MODPRV} aufs && union_type="aufs"
+ modprobe ${MODPRV} aufs && union_type="AUFS"
if [ -z "$union_type" ]; then
error "$init_loadaufs" nonfatal
aufs="";
@@ -482,16 +483,17 @@ if [ -n "${aufs}" ]; then
fi
fi
# setup of client root filesystem dependent on the availability of UnionFS
-if [ -n "${unionfs}" ] ; then
- echo "Using UnionFS for rw access"
+if [ -n "${unionfs}" -o -n "${aufs}" ] ; then
+ echo "Using ${union_type} for rw access"
mkdir -p ${rwdir}/union ${rwdir}/uniontmp /rorootfs
mount -n -t tmpfs none ${rwdir}/uniontmp
# hack for handling unionfs with patched run-init
mount -n --move /mnt /rorootfs
- if [ "$union_type" == "unionfs" ]; then
+ if [ "$union_type" == "UnionFS" ]; then
mount -n -t unionfs -o dirs=${rwdir}/uniontmp:/rorootfs=${nfsro}ro \
none /mnt
- else mount -n -t aufs -o br:/${rwdir}/uniontmp:/rorootfs=ro none /mnt
+ elif [ "$union_type" == "AUFS" ]; then
+ mount -n -t aufs -o br:/${rwdir}/uniontmp:/rorootfs=ro none /mnt
fi
mkdir -p /mnt/uniontmp
mount -n --move ${rwdir}/uniontmp /mnt/uniontmp
@@ -499,7 +501,7 @@ if [ -n "${unionfs}" ] ; then
# if additional sources should be used for a combined root filesystem
# probably more sources should be merged into union (${union} is defined)
# allow more than one union??
- if [ -n "${union}" ] ; then
+ if [ -n "${unionfs}" -o -n "${aufs}" ] ; then
# for dir in "${union}"; do
# testmkd /unionadd/$dir
# mount $dir unionadd/$dir