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:51 +0000 (UTC)	[thread overview]
Message-ID: <1403565074.1ebd03691dd96f3fe952ada0ecf301e9f731cfa5.zerochaos@gentoo> (raw)

commit:     1ebd03691dd96f3fe952ada0ecf301e9f731cfa5
Author:     Fernando Reyes (likewhoa) <design <AT> missionaccomplish <DOT> com>
AuthorDate: Thu May 29 01:55:05 2014 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Mon Jun 23 23:11:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=1ebd0369

Cleaner shutdown process preventing aufs related mounts from
being umounted along with mnt/{livecd,cdrom} and others.

Addition of a variable for aufs changes so that required
directory can be create upon successful creation of the livecd
image file.

---
 defaults/initrd.defaults |  3 +++
 defaults/initrd.scripts  |  1 +
 defaults/linuxrc         | 20 +++++++++++++++++---
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index 3d6fe7e..5245959 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -65,6 +65,9 @@ CDROOT_PATH='/mnt/cdrom'
 # This is the file that the cdroot will be checked for as a
 # marker. It must exist RELATIVE to the cdroot.
 CDROOT_MARKER='/livecd'
+
+# AUFS variables
+AUFS_CHANGES=false
 AUFS_CHANGESFILE=livecd.aufs
 
 LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index e81e5f2..dd3af37 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -285,6 +285,7 @@ create_changefs() {
 			then
 				good_msg "Creation of ${AUFS_CHANGESFILE}, ${size} Mb on ${CHANGESDEV} successful, formatting it ext2"
 				mke2fs -F ${CHANGESMNT}/${AUFS_CHANGESFILE} &>/dev/null
+                                AUFS_CHANGES=true
 				break
 			else
 				rm -f ${CHANGESMNT}/${AUFS_CHANGESFILE}

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 8620352..6d942a1 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -811,6 +811,15 @@ then
 		# TODO: remounting all tmpfs as RO seems weird, can we be more specific?
 		sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' /${UNION}/etc/fstab > /${UNION}/etc/fstab.new
 		mv /${UNION}/etc/fstab.new /${UNION}/etc/fstab
+
+                # RC_NO_UMOUNTS variable for a clean shutdown/reboot
+                test ! $(grep 'RC_NO_UMOUNTS="/newroot|/newroot/mnt/aufs|\
+/newroot/mnt/changesdev|/mnt/livecd|/mnt/cdrom|/.unions/\
+memory|/.unions/memory/xino"' "${UNION}"/etc/rc.conf) &&
+                        echo "RC_NO_UMOUNTS=\"/newroot|/newroot/mnt/aufs|"\
+"/newroot/mnt/changesdev|/mnt/livecd|/mnt/cdrom|"\
+"/.unions/memory|/.unions/memory/xino\"">> "${UNION}"/etc/rc.conf
+
 		warn_msg "Adding all modules in $MODULESD/modules/"
 		if [ -z "${MODULESD}" ]
 		then
@@ -820,6 +829,10 @@ then
 			mount "${MODULESD}" ${NEW_ROOT}/mnt/modulesd
 			union_insert_modules ${NEW_ROOT}/mnt/modulesd
 		fi
+
+                mkdir -p "${UNION}"/newroot/mnt/aufs
+                test ${AUFS_CHANGES} && test ! -d "${UNION}"/newroot/mnt/changesdev &&
+                        mkdir "${UNION}"/newroot/mnt/changesdev
 	fi
 
 	# Unpacking additional packages from NFS mount
@@ -975,9 +988,10 @@ verbose_kmsg
 
 if [ "${USE_AUFS_NORMAL}" -eq '1' ]
 then
-	mkdir -p /${CHROOT}/.unions/memory 2>/dev/null
-	mount -o move /memory /${CHROOT}/.unions/memory || echo '*: Failed to move aufs /memory into the system root!'
-	for i in mnt/gentoo mnt/livecd
+	mkdir -p /${CHROOT}/.unions/memory
+	mount -o move /memory /${CHROOT}/.unions/memory 
+        test_success "Failed to move aufs /memory into the system root"
+        for i in mnt/gentoo mnt/livecd ${CDROOT_PATH}
 	do
 		mkdir -p ${CHROOT}/$i
 		chmod 755 ${CHROOT}/$i


             reply	other threads:[~2014-09-05 16:09 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=1403565074.1ebd03691dd96f3fe952ada0ecf301e9f731cfa5.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