Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 79381 Details for
Bug 99682
Halt.sh patch allows proper unionfs support on LiveCD
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
halt.sh-5 patch
halt.sh.patch (text/plain), 3.59 KB, created by
Jean-François Richard
on 2006-02-09 16:06:14 UTC
(
hide
)
Description:
halt.sh-5 patch
Filename:
MIME Type:
Creator:
Jean-François Richard
Created:
2006-02-09 16:06:14 UTC
Size:
3.59 KB
patch
obsolete
>--- halt.sh.orig 2008-09-30 06:35:57.000000000 +0000 >+++ halt.sh 2008-09-30 07:33:52.000000000 +0000 >@@ -7,6 +7,12 @@ > source /sbin/livecd-functions.sh && \ > livecd_read_commandline > >+# livecd-functions.sh should _ONLY_ set this differently if CDBOOT is >+# set, else the default one should be used for normal boots. >+# say: RC_NO_UMOUNTS="/newroot|/mnt/cdrom|/mnt/livecd" >+RC_NO_UMOUNTS=${RC_NO_UMOUNTS:-/newroot|/mnt/cdrom|/mnt/livecd} >+RC_NO_UMOUNT_FS="^(proc|devpts|sysfs|devfs|tmpfs|usb(dev)?fs|unionfs|rootfs)$" >+ > # Reset pam_console permissions if we are actually using it > if [[ -x /sbin/pam_console_apply && ! -c /dev/.devfsd && \ > -n $(grep -v -e '^[[:space:]]*#' /etc/pam.d/* | grep 'pam_console') ]]; then >@@ -45,7 +51,7 @@ halt -w &>/dev/null > # Remove loopback devices started by dm-crypt > > remaining=$(awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts | \ >- sort -r | grep -v '/newroot' | grep -v '/mnt/livecd') >+ sort -r | egrep -v "^(${RC_NO_UMOUNTS})$") > [[ -n ${remaining} ]] && { > sig= > retry=3 >@@ -62,7 +68,7 @@ remaining=$(awk '!/^#/ && $1 ~ /^\/dev\/ > fi > > remaining=$(awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts | \ >- sort -r | grep -v '/newroot' | grep -v '/mnt/livecd') >+ sort -r | egrep -v "^(${RC_NO_UMOUNTS})$") > [[ -z ${remaining} ]] && break > > /bin/fuser -k -m ${sig} ${remaining} &>/dev/null >@@ -76,17 +82,17 @@ remaining=$(awk '!/^#/ && $1 ~ /^\/dev\/ > # This is needed to make sure we dont have a mounted filesystem > # on a LVM volume when shutting LVM down ... > ebegin "Unmounting filesystems" >-unmounts=$( \ >- awk '{ \ >- if (($3 !~ /^(proc|devpts|sysfs|devfs|tmpfs|usb(dev)?fs)$/) && \ >+unmounts=$(awk -v NO_UMOUNT_FS="${RC_NO_UMOUNT_FS}" \ >+ '{ \ >+ if (($3 !~ NO_UMOUNT_FS) && \ > ($1 != "none") && \ > ($1 !~ /^(rootfs|\/dev\/root)$/) && \ > ($2 != "/")) \ >- print $2 }' /proc/mounts | sort -ur) >+ print $2 \ >+ }' /proc/mounts | sort -ur) > for x in ${unmounts}; do >- # Do not umount these if we are booting off a livecd >- if [[ -n ${CDBOOT} ]] && \ >- [[ ${x} == "/mnt/cdrom" || ${x} == "/mnt/livecd" ]] ; then >+ # Do not umount these ... will be different depending on value of CDBOOT >+ if [[ -n $(echo "${x}" | egrep "^(${RC_NO_UMOUNTS})$") ]] ; then > continue > fi > >@@ -140,8 +146,15 @@ mount_readonly() { > sync; sync > sleep 1 > >- for x in $(awk '$1 != "none" { print $2 }' /proc/mounts | sort -ur) ; do >+ for x in $(awk -v NO_UMOUNT_FS="${RC_NO_UMOUNT_FS}" \ >+ '{ \ >+ if (($1 != "none") && ($3 !~ NO_UMOUNT_FS)) \ >+ print $2 \ >+ }' /proc/mounts | sort -ur) ; do > x=${x//\\040/ } >+ if [[ -n $(echo "${x}" | egrep "^(${RC_NO_UMOUNTS})$") ]] ; then >+ continue >+ fi > if [[ ${cmd} == "u" ]]; then > umount -n -r "${x}" > else >@@ -154,6 +167,24 @@ mount_readonly() { > return ${retval} > } > >+if [ -x "$(which unionctl)" ] && grep unionfs /proc/mounts >/dev/null; then >+ ebegin "Remounting all remaining unionfs overlays readonly" >+ u_ro_worked=0 >+ u_remaining=$(cat /proc/mounts | awk \ >+ '{ \ >+ if ( $3 == "unionfs" ) \ >+ print $2 \ >+ }') >+ for dir in ${u_remaining}; do >+ for branch in $(unionctl --query $dir | grep '(rw)' | awk '{print $2}'); do >+ if ! unionctl $dir --mode ${branch} ro; then >+ u_ro_worked=1 >+ fi >+ done >+ done >+ eend ${u_ro_worked} >+fi >+ > # Since we use `mount` in mount_readonly(), but we parse /proc/mounts, we > # have to make sure our /etc/mtab and /proc/mounts agree > cp /proc/mounts /etc/mtab &>/dev/null
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 99682
:
63894
|
64565
|
64879
|
64883
|
64895
|
64897
|
64934
| 79381 |
79382