public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Richard Farina" <zerochaos@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:aufs commit in: defaults/
Date: Fri,  5 Sep 2014 16:09:52 +0000 (UTC)	[thread overview]
Message-ID: <1407363663.d30bfb2e0028d37031b0a0c129cce7ced20d2cef.zerochaos@gentoo> (raw)

commit:     d30bfb2e0028d37031b0a0c129cce7ced20d2cef
Author:     Fernando Reyes (likewhoa) <design <AT> missionaccomplish <DOT> com>
AuthorDate: Mon Aug  4 01:23:02 2014 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Aug  6 22:21:03 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=d30bfb2e

Fixed a bug which prevented aufs.modules from functioning properly
and changed the variables names to reflect the actual logic.

---
 defaults/initrd.defaults |  1 +
 defaults/initrd.scripts  | 17 ++++++++---------
 defaults/linuxrc         | 22 +++++++++++++---------
 3 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index 94b45cc..818e3b1 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -72,6 +72,7 @@ CDROOT_MARKER='/livecd'
 # AUFS variables
 aufs=0
 aufs_union_file=/livecd.aufs
+aufs_modules_dir=mnt/cdrom
 
 LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'
 

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 5a01986..7d9497d 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -297,12 +297,12 @@ union_insert_dir() {
 union_insert_modules() {
         local module
 
-        for module in "$NEW_ROOT/$1/modules/"*.mo; do
-                union_mod "$module" || bad_msg "Unable to load module: '$module'"
+        for module in "$1/modules/"*.mo; do
+                union_mod "$module" || bad_msg "Unable to insert module: '$module'"
         done
 
-        for module in "$NEW_ROOT/$1/modules/"*.lzm; do
-                union_mod "$module" lzm || bad_msg "Unable to load module: '$module'"
+        for module in "$1/modules/"*.lzm; do
+                union_mod "$module" || bad_msg "Unable to insert module: '$module'"
         done
 }
 
@@ -315,13 +315,12 @@ union_mod() {
         mod=${1##*/}
         mod=${mod%.*}
 
-        mkdir -p "$aufs_memory/modules/$mod" || return
-
-        if [ lzm = "$2" ]; then
-                 mount -o loop,ro "$1" "$aufs_memory/modules/$mod"
+        if [ ! -d "$aufs_union"/mnt/"$mod" ]; then
+                mkdir -p "$aufs_union"/mnt/modules/"$mod" || return
         fi
 
-        union_insert_dir "$aufs_union" "$aufs_memory/modules/$mod"
+        mount -o loop,ro "$1" "$aufs_union"/mnt/modules/"$mod"
+        union_insert_dir "$aufs_union" "$aufs_union"/mnt/modules/"$mod"
 }
 
 # Implements RC_NO_UMOUNTS variable into $CHROOT/etc/rc.conf for a cleaner shutdown process

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 3098866..951f5e1 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -265,7 +265,7 @@ do
 		;;
 		# Allow user to specify the modules location
 		aufs.modules\=*)
-			aufs_modules_dev=${x#*=}
+			aufs_modules_dir=${x#*=}
                         aufs_modules=1
 		;;
 		unionfs)
@@ -786,16 +786,20 @@ distfiles       /usr/portage/distfiles          tmpfs   defaults        0 0
 FSTAB
                 fi
 
-                # When aufs.modules= is used
-                if [ 1 = "$aufs_modules" ]; then
-                        warn_msg "Adding all modules in $aufs_modules_dev/modules/"
+                # When aufs.modules= is used or $CDROOT_PATH/modules
+                # directory is available
+                if [[ 1 = "$aufs_modules" || -d $CDROOT_PATH/modules ]]; then
+                        warn_msg "Adding all modules in $aufs_modules_dir/modules/"
 
-                        if [ -z "$aufs_modules_dev" ]; then
+                        if [ mnt/cdrom = "$aufs_modules_dir" ]; then
 		                union_insert_modules "$CDROOT_PATH"
-		        else
-			        mkdir "$NEW_ROOT/mnt/modulesd"
-			        mount "$aufs_modules_dev" "$NEW_ROOT/mnt/modulesd"
-			        union_insert_modules "$NEW_ROOT/mnt/modulesd"
+                        elif [ ! -b "$aufs_modules_dir" ]; then
+                                bad_msg "$aufs_modules_dir is not a valid block device"
+                                bad_msg "aborting modules insert into $aufs_union"
+                        else
+                                mkdir /mnt/modules
+			        mount "$aufs_modules_dir" /mnt/modules
+			        union_insert_modules /mnt/modules
                         fi
                 fi
 


             reply	other threads:[~2014-09-05 16:10 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 16:09 Richard Farina [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-04-29 19:04 [gentoo-commits] proj/genkernel:aufs commit in: defaults/ Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2015-04-29 19:04 Richard Farina
2014-09-23  0:21 Richard Farina
2014-09-23  0:21 Richard Farina
2014-09-05 16:11 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-09-05 16:09 Richard Farina
2014-05-24 21:35 Richard Farina
2014-05-24 21:35 Richard Farina
2014-05-24 21:35 Richard Farina
2014-05-22 20:28 Richard Farina
2014-05-22 20:28 Richard Farina
2014-05-22 20:28 Richard Farina
2014-05-22 20:28 Richard Farina
2014-03-17 19:38 Robin H. Johnson
2014-03-17 19:32 Robin H. Johnson
2014-03-17 19:20 Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407363663.d30bfb2e0028d37031b0a0c129cce7ced20d2cef.zerochaos@gentoo \
    --to=zerochaos@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox