aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Reyes (likewhoa) <design@missionaccomplish.com>2014-06-03 19:48:14 +0200
committerRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2015-08-11 14:21:16 -0400
commit22fc4406486edd0f7a82b117d5884c8f2cf7487e (patch)
tree366fb37a2d1719beb862ef2eb90aa0aa3ae16904 /defaults/linuxrc
parentA new bootstrapFS function has been added to cut on duplicate code (diff)
downloadgenkernel-22fc4406486edd0f7a82b117d5884c8f2cf7487e.tar.gz
genkernel-22fc4406486edd0f7a82b117d5884c8f2cf7487e.tar.bz2
genkernel-22fc4406486edd0f7a82b117d5884c8f2cf7487e.zip
Better implementation which was originally done in 946918e & 7a38d63.
Diffstat (limited to 'defaults/linuxrc')
-rw-r--r--defaults/linuxrc38
1 files changed, 2 insertions, 36 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 0e40d165..a6c4806c 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -791,42 +791,8 @@ then
#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
- RC_MOUNTS=$(grep 'RC_NO_UMOUNTS' "${CHROOT}"/etc/rc.conf)
-
- # Iterate through ${RC_MOUNTS} to find our duplicate(s) and or remove obsolete lines when ever
- # our RC_NO_UMOUNTS variable changes.
- 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
-
- # 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
+ # Function to handle the RC_NO_UMOUNTS variable in ${CHROOT}/etc/rc.conf
+ conf_rc_no_umounts
# Fstab change for aufs
test ! $(grep -o ^aufs "${CHROOT}"/etc/fstab) &&