commit:     c33f10738a4880cd6d9cf2048df4809eaf04b19a
Author:     Fernando Reyes (likewhoa) <design <AT> missionaccomplish <DOT> com>
AuthorDate: Sun Aug 17 00:18:36 2014 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Sun Aug 17 00:18:36 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=c33f1073

restructure no_umounts from being set in /etc/rc.conf to /etc/conf.d/localmount

---
 defaults/initrd.defaults |  2 +-
 defaults/initrd.scripts  | 15 +++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index 818e3b1..7e4803a 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -60,7 +60,7 @@ KSUFF='.ko'
 REAL_ROOT=''
 CONSOLE='/dev/console'
 NEW_ROOT='/newroot'
-RC_NO_UMOUNTS='/newroot|/mnt/aufs-dev|/mnt/aufs-rw-branch|/mnt/livecd|/mnt/cdrom|/.unions/memory|/.unions/memory/xino'
+no_umounts='/newroot|/mnt/aufs-dev|/mnt/aufs-rw-branch|/mnt/livecd|/mnt/cdrom|/.unions/memory|/.unions/memory/xino'
 CDROOT='0'
 CDROOT_DEV=''
 CDROOT_TYPE='auto'

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 7d9497d..7b8e52f 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -323,13 +323,12 @@ union_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
-# This should really go into /etc/init.d/localmounts but until then we 
manually set this here
+# Implements no_umounts variable into $CHROOT/etc/conf.d/localmount for a 
cleaner shutdown process
 conf_rc_no_umounts() {
         local conf nomount fnd
-        conf=$CHROOT/etc/rc.conf fnd=0
+        conf=$CHROOT/etc/conf.d/localmount fnd=0
 
-        if nomount=$(grep -n '^[[:blank:]]*RC_NO_UMOUNTS=' $conf); then
+        if nomount=$(grep -n '^[[:blank:]]*no_umounts=' $conf); then
                 local i n data cmd IFS
                 IFS='
 '
@@ -341,20 +340,20 @@ conf_rc_no_umounts() {
                         data=${i#*=}
 
                         case $data in
-                                "\"$RC_NO_UMOUNTS\""|"'$RC_NO_UMOUNTS'") 
fnd=1;;
+                                "\"$no_umounts\""|"'$no_umounts'") fnd=1;;
                                 *) cmd="$cmd$n d;"
                         esac
                 done
 
                 if [ -n "$cmd" ]; then
                         sed -i "${cmd%;}" $conf
-                        test_success "Unable to edit rc.conf"
+                        test_success "Unable to edit /etc/conf.d/localmount"
                 fi
         fi
 
         if [ 0 -eq "$fnd" ]; then
-                printf 'RC_NO_UMOUNTS="%s"\n' "$RC_NO_UMOUNTS" >> $conf
-                test_success "Unable to write to rc.conf"
+                printf 'no_umounts="%s"\n' "$no_umounts" >> $conf
+                test_success "Unable to write to /etc/conf.d/localmount"
         fi
 }
 

Reply via email to