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: Wed, 29 Apr 2015 19:04:09 +0000 (UTC)	[thread overview]
Message-ID: <1430328784.4e55218f080fab85514112a38e6fe6aee6a922ba.zerochaos@gentoo> (raw)

commit:     4e55218f080fab85514112a38e6fe6aee6a922ba
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 23 00:07:28 2014 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 17:33:04 2015 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=4e55218f

aufs changes saving automation

The aufs code has the ability to save changes in a file, however, it
requires the user to manually tell us where the file is.  This code will
automatically check for the file on $CDROOT, as well as automatically
pick up the casper-rw file created by unetbooting for persistence.
Additionally we add the option for aufs=search which will search all
drives for livecd.aufs. Possible later enhancements include searching
other partitions on the CDROOT_DEV for livecd.aufs automatically instead
of needing aufs=search.  Then again, possible later enhancements also
include just always searching, it's shockingly fast to do the search...

 defaults/initrd.scripts | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index d8142a2..e05809c 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -123,7 +123,7 @@ findmediamount() {
 				fi
 				good_msg "Attempting to mount media: ${x}" ${CRYPT_SILENT}
 
-				mount -r -t ${CDROOT_TYPE} ${x} ${mntcddir} >/dev/null 2>&1
+				mount -t ${CDROOT_TYPE} ${x} ${mntcddir} >/dev/null 2>&1
 				if [ "$?" = '0' ]
 				then
 					if [ -n "${ISOBOOT}" ]; then
@@ -408,12 +408,29 @@ create_changefs() {
 setup_aufs() {
 	bootstrapCD
 
+        if [ "$aufs_dev" = "search" ]; then
+                findmediamount "aufs-dev" "$aufs_union_file" \
+                        "aufs_dev" "$aufs_dev_mnt" $(devicelist)
+                aufs_mounted="1"
+        elif [ -z $aufs_dev ] && [ -w "$CDROOT_PATH/$aufs_union_file" ]; then
+                aufs_dev="$REAL_ROOT"
+                aufs_dev_mnt="$CDROOT_PATH"
+                aufs_mounted="1"
+        fi
+        if [ -z $aufs_dev ] && [ -w "$CDROOT_PATH/casper-rw" ]; then
+                aufs_dev="$REAL_ROOT"
+                aufs_dev_mnt="$CDROOT_PATH"
+                aufs_union_file="/casper-rw"
+                aufs_mounted="1"
+        fi
+
         if [ -n "$aufs_dev" ]; then
                 if [ ! -b $aufs_dev ]; then
                         bad_msg "$aufs_dev is not a valid block device"
                         local invalidblk=1
                         unset aufs_dev
-                else
+		#skip this block when aufs_dev_mnt is already mounted
+                elif [ "$aufs_mounted" != "1" ]; then
                         good_msg "Mounting $aufs_dev to $aufs_memory for aufs support"
 
                         if ! mount -t auto "$aufs_dev" "$aufs_dev_mnt" &>/dev/null; then
@@ -428,6 +445,9 @@ setup_aufs() {
                 elif [ -n "$aufs_dev" ]; then
                         while :; do
                                 if mount -t auto "$aufs_dev_mnt$aufs_union_file" "$aufs_memory" &>/dev/null; then
+                                        if [ "$aufs_union_file" = "/casper-rw" ];then
+                                                bad_msg "Use of livecd.aufs preferred to casper-rw for changes saving, please rename the file."
+                                        fi
                                         break
                                 else
                                         bad_msg "Mounting of changes file failed, Running e2fsck"


             reply	other threads:[~2015-04-29 19:04 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 19:04 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
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-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=1430328784.4e55218f080fab85514112a38e6fe6aee6a922ba.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