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:08 +0000 (UTC) [thread overview]
Message-ID: <1430328705.09cce549319068807b9e1dba7a3ad3160da3f160.zerochaos@gentoo> (raw)
commit: 09cce549319068807b9e1dba7a3ad3160da3f160
Author: Fernando Reyes (likewhoa) <design <AT> missionaccomplish <DOT> com>
AuthorDate: Mon Jun 2 15:19:23 2014 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 17:31:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=09cce549
This improves the way we handle RC_NO_UMOUNT variable in openrc so that
future changes can scale and fixes previous bugs which didn't actually
remove duplicates.
defaults/linuxrc | 43 +++++++++++++++++++++++++++++--------------
1 file changed, 29 insertions(+), 14 deletions(-)
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 42749d6..86b1954 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -816,24 +816,39 @@ then
# RC_NO_UMOUNTS variable for a clean shutdown/reboot
RC_MOUNTS=$(grep 'RC_NO_UMOUNTS' "${CHROOT}"/etc/rc.conf)
- RESULTS=false
# Iterate through ${RC_MOUNTS} to find our duplicate(s) and or remove obsolete lines when ever
# our RC_NO_UMOUNTS variable changes.
- printf '%s\n' ${RC_MOUNTS} | while read -r mount; do
- if [[ "${mount}" = "RC_NO_UMOUNTS=\"${RC_NO_UMOUNTS}\"" ]]; then
- RESULTS=true
- else
- # Escape characters in ${mounts} for use in sed
- mount_re=$(echo ${mount} | sed -e 's/\//\\\//g' -e 's/\&/\\\&/g')
-
- # Remove non matching pattern
- sed -i "/${mount_re}/d" "${CHROOT}"/etc/rc.conf
- fi
- done
+ if [ -n "${RC_MOUNTS}" ]; then
+ printf '%s\n' ${RC_MOUNTS} |
+ {
+ while read -r mount; do
+ # Remove double quotes from ${mount}
+ new_mount=$(echo ${mount} | sed 's/"//g')
+
+ if [[ "${new_mount}" = "RC_NO_UMOUNTS="${RC_NO_UMOUNTS}"" ]]; then
+ RESULTS=false
+ else
+ # Escape characters in ${mounts} for use in sed
+ mount_re=$(echo ${mount} | sed -e 's/\//\\\//g' -e 's/\&/\\\&/g')
+
+ # Remove non matching pattern
+ sed -i "/${mount_re}/d" "${CHROOT}"/etc/rc.conf
+
+ RESULTS=true
+ fi
+ done
+
+ # no RC_NO_UMOUNTS match found
+ if ${RESULTS}; then return 1;fi
+ }
+ else
+ echo "RC_NO_UMOUNTS=\"${RC_NO_UMOUNTS}\"">> "${CHROOT}"/etc/rc.conf
+ fi
- if ! ${RESULTS}; then
- echo 'RC_NO_UMOUNTS="/newroot|/newroot/mnt/changesdev|/mnt/overlay|/mnt/livecd|/mnt/cdrom|/.unions/memory|/.unions/memory/xino"'>> "${CHROOT}"/etc/rc.conf
+ # An RC_NO_UMOUNTS was not found that matches our current one
+ if [ $? -eq 1 ]; then
+ echo "RC_NO_UMOUNTS=\"${RC_NO_UMOUNTS}\"">> "${CHROOT}"/etc/rc.conf
fi
# Fstab change for aufs
next 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=1430328705.09cce549319068807b9e1dba7a3ad3160da3f160.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