From 9b64a9f76af317898b63c939e7afb92ccc7f297d Mon Sep 17 00:00:00 2001 From: Felix Endres Date: Sat, 21 Apr 2007 14:06:22 +0000 Subject: AUFS and UnionFS adjustments git-svn-id: http://svn.openslx.org/svn/openslx/trunk@913 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/etc/messages | 16 +++++++++++++--- initramfs/initrd-stuff/etc/messages.de | 14 ++++++++++++-- initramfs/initrd-stuff/init | 30 ++++++++++++++++++++++++------ 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/initramfs/initrd-stuff/etc/messages b/initramfs/initrd-stuff/etc/messages index e5e34195..768c4b59 100644 --- a/initramfs/initrd-stuff/etc/messages +++ b/initramfs/initrd-stuff/etc/messages @@ -51,10 +51,20 @@ mean:\n * The kernel was updated but mkdxsinitrd was not run afterwards.\n\ * The mounted filesystem does not contain the modules directory at all.\n\ You might want to check the list of mounted filesystems and if /mnt is\n\ not empty run 'ls /mnt/lib/modules' to check." -init_loadufs=" Loading of UnionFS or AUFS failed - Either modules are not present or \ -do \nnot match the running kernel. If you do not want to see this \ +init_loadaufs=" Loading of AUFS failed - Either the module is not present or \ +does \nnot match the running kernel. If you do not want to see this \ +\n message remove the token 'aufs' from kernel command line." +init_noaufs_butufs=" AUFS was chosen as Unification FS but is not available. \ +However UnionFS seems to be available. To put it to use append 'unionfs' to the \ +kernel command line" +init_noufs_butaufs=" UnionFS was chosen as Unification FS but is not available. \ +However AUFS seems to be available. To put it to use append 'aufs' to the \ +kernel command line" +init_loadufs=" Loading of UnionFS failed - Either the module is not present or \ +does \nnot match the running kernel. If you do not want to see this \ \n message remove the token 'unionfs' from kernel command line." -init_loadunions=" Stacking of directories failed, because UnionFS/AUFS is not loaded" +init_loadunions=" Stacking of directories failed, because UnionFS/AUFS is not \ +loaded" init_loadcow=" Loading of Copy On Write (COW - special block device) module \ 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 \ diff --git a/initramfs/initrd-stuff/etc/messages.de b/initramfs/initrd-stuff/etc/messages.de index 87617534..5bd8835e 100644 --- a/initramfs/initrd-stuff/etc/messages.de +++ b/initramfs/initrd-stuff/etc/messages.de @@ -53,10 +53,20 @@ der eingehaengten Dateisysteme pruefen und wenn /mnt\n nicht leer ist, \ 'ls /mnt/lib/modules' ausfuehren." init_loadunions=" Stapeln mehrerer Verzeichnisse nicht möglich, da kein UnionFS/AUFS \ Modul geladen ist" -init_loadufs=" Laden von UnionFS oder AUFS schlug fehl - entweder die Module sind \ -nicht vorhanden, oder\n sie passen nicht zum laufenden Kernel. Wenn Sie diese Meldung \ +init_loadaufs=" Laden von AUFS schlug fehl - entweder das Modul ist \ +nicht vorhanden, oder\n es passt nicht zum laufenden Kernel. Wenn Sie diese Meldung \ +nicht sehen wollen,\n entfernen Sie das Token 'aufs' von den Kernel Start \ +Optionen." +init_noaufs_butufs=" AUFS wurde als Unification FS angegeben, ist jedoch nicht \ +vorhanden. UnionFS steht aber scheinbar zu Verfügung. Wenn Sie dieses nutzen \ +möchten fügen Sie bitte 'unionfs' zu den Kernel Start Optionen hinzu" +init_loadufs=" Laden von UnionFS schlug fehl - entweder das Modul ist \ +nicht vorhanden, oder\n es passt nicht zum laufenden Kernel. Wenn Sie diese Meldung \ nicht sehen wollen,\n entfernen Sie das Token 'unionfs' von den Kernel Start \ Optionen." +init_noufs_butaufs=" UnionFS wurde als Unification FS angegeben, ist jedoch nicht \ +vorhanden. AUFS steht aber scheinbar zu Verfügung. Wenn Sie dieses nutzen \ +möchten fügen Sie bitte 'aufs' zu den Kernel Start Optionen hinzu" init_loadcow=" Laden von Copy On Write (COW - Spezielles Block Geraet) Modul \ schlug fehl -\n entweder das Modul nicht praesent oder es passt nicht zum \ laufenden\n Kernel. Wenn Sie diese Meldung nicht sehen wollen, entfernen sie \ diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index ffcb351f..a3e24a83 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -144,13 +144,21 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup noldsc) noldsc=yes;; # additional source to unify root filesystem with - union=*) + unionfs=*) unionfs=1 - uniondirs=${opts#union=} + uniondirs=${opts#unionfs=} ;; # if unionfs should be used over the complete root filesystem unionfs) unionfs=1;; + # Same for AUFS + aufs=*) + aufs=1 + uniondirs=${opts#aufs=} + ;; + # if unionfs should be used over the complete root filesystem + aufs) + aufs=1;; # if cowloop should be used, only ontop of network block device and in # combination with classical fs, like ext2 useful cowloop=*) @@ -452,17 +460,27 @@ $(sysup)" hwautocfg main & fi +union_type="" # try to use unionfs for rw access if available -if [ -n "${unionfs}" -o -n "${union}" ] ; then - union_type="" +if [ -n "${unionfs}" ]; then modprobe ${MODPRV} unionfs && union_type="unionfs" - modprobe ${MODPRV} aufs && union_type="aufs" if [ -z "$union_type" ]; then error "$init_loadufs" nonfatal unionfs=""; + # if unionfs is not available, check for aufs and inform user + modprobe ${MODPRV} -n aufs && error $init_noufs_butaufs + fi +fi +# try to use aufs for rw access if available +if [ -n "${aufs}" ]; then + modprobe ${MODPRV} aufs && union_type="aufs" + if [ -z "$union_type" ]; then + error "$init_loadaufs" nonfatal + aufs=""; + # if aufs is not available, check for unionfs and inform user + modprobe ${MODPRV} -n unionfs && error $init_noaufs_butufs fi fi - # setup of client root filesystem dependent on the availability of UnionFS if [ -n "${unionfs}" ] ; then echo "Using UnionFS for rw access" -- cgit v1.2.3-55-g7522