Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 925193 Details for
Bug 1128202
/usr/lib/systemd/fedora-readonly has poor indenting
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
indentation patch
fedora-readonly-indentation.patch (text/plain), 11.28 KB, created by
John Florian
on 2014-08-08 14:48:43 UTC
(
hide
)
Description:
indentation patch
Filename:
MIME Type:
Creator:
John Florian
Created:
2014-08-08 14:48:43 UTC
Size:
11.28 KB
patch
obsolete
>--- /usr/lib/systemd/fedora-readonly.orig 2014-01-14 07:34:09.000000000 -0500 >+++ /usr/lib/systemd/fedora-readonly 2014-08-08 10:40:34.245038499 -0400 >@@ -8,18 +8,18 @@ > # Check SELinux status > SELINUX_STATE= > if [ -e "/sys/fs/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then >- if [ -r "/sys/fs/selinux/enforce" ] ; then >- SELINUX_STATE=$(cat "/sys/fs/selinux/enforce") >- else >- # assume enforcing if you can't read it >- SELINUX_STATE=1 >- fi >+ if [ -r "/sys/fs/selinux/enforce" ] ; then >+ SELINUX_STATE=$(cat "/sys/fs/selinux/enforce") >+ else >+ # assume enforcing if you can't read it >+ SELINUX_STATE=1 >+ fi > fi > > selinux_fixup() { >- if [ -n "$SELINUX_STATE" ] && [ -e "$1" ]; then >- restorecon -R "$1" >- fi >+ if [ -n "$SELINUX_STATE" ] && [ -e "$1" ]; then >+ restorecon -R "$1" >+ fi > } > > # Only read this once. >@@ -27,170 +27,170 @@ > > READONLY= > if [ -f /etc/sysconfig/readonly-root ]; then >- . /etc/sysconfig/readonly-root >+ . /etc/sysconfig/readonly-root > fi > if strstr "$cmdline" readonlyroot ; then >- READONLY=yes >- [ -z "$RW_MOUNT" ] && RW_MOUNT=/var/lib/stateless/writable >- [ -z "$STATE_MOUNT" ] && STATE_MOUNT=/var/lib/stateless/state >+ READONLY=yes >+ [ -z "$RW_MOUNT" ] && RW_MOUNT=/var/lib/stateless/writable >+ [ -z "$STATE_MOUNT" ] && STATE_MOUNT=/var/lib/stateless/state > fi > if strstr "$cmdline" noreadonlyroot ; then >- READONLY=no >+ READONLY=no > fi > > MOUNTS=() > if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then > >- add_mount() { >- MOUNTS=("${MOUNTS[@]}" "$1") >- } >+ add_mount() { >+ MOUNTS=("${MOUNTS[@]}" "$1") >+ } >+ >+ cp_empty() { >+ if [ -e "$1" ]; then >+ echo "$1" | cpio -p -vd "$RW_MOUNT" &>/dev/null >+ add_mount $1 >+ fi >+ } > >- cp_empty() { >- if [ -e "$1" ]; then >- echo "$1" | cpio -p -vd "$RW_MOUNT" &>/dev/null >- add_mount $1 >- fi >- } >+ cp_dirs() { >+ if [ -e "$1" ]; then >+ mkdir -p "$RW_MOUNT$1" >+ find "$1" -type d -print0 | cpio -p -0vd "$RW_MOUNT" &>/dev/null >+ add_mount $1 >+ fi >+ } >+ >+ cp_files() { >+ if [ -e "$1" ]; then >+ cp -a --parents "$1" "$RW_MOUNT" >+ add_mount $1 >+ fi >+ } > >- cp_dirs() { >- if [ -e "$1" ]; then >- mkdir -p "$RW_MOUNT$1" >- find "$1" -type d -print0 | cpio -p -0vd "$RW_MOUNT" &>/dev/null >- add_mount $1 >- fi >- } >- >- cp_files() { >- if [ -e "$1" ]; then >- cp -a --parents "$1" "$RW_MOUNT" >- add_mount $1 >- fi >- } >- >- # Common mount options for scratch space regardless of >- # type of backing store >- mountopts= >- >- # Scan partitions for local scratch storage >- rw_mount_dev=$(blkid -t LABEL="$RW_LABEL" -l -o device) >- >- # First try to mount scratch storage from /etc/fstab, then any >- # partition with the proper label. If either succeeds, be sure >- # to wipe the scratch storage clean. If both fail, then mount >- # scratch storage via tmpfs. >- if mount $mountopts "$RW_MOUNT" > /dev/null 2>&1 ; then >- rm -rf "$RW_MOUNT" > /dev/null 2>&1 >- elif [ x$rw_mount_dev != x ] && mount $rw_mount_dev $mountopts "$RW_MOUNT" > /dev/null 2>&1; then >- rm -rf "$RW_MOUNT" > /dev/null 2>&1 >- else >- mount -n -t tmpfs $RW_OPTIONS $mountopts none "$RW_MOUNT" >- fi >- >- for file in /etc/rwtab /etc/rwtab.d/* /run/initramfs/rwtab ; do >- is_ignored_file "$file" && continue >- [ -f $file ] && while read type path ; do >- case "$type" in >- empty) >- cp_empty $path >- ;; >- files) >- cp_files $path >- ;; >- dirs) >- cp_dirs $path >- ;; >- *) >- ;; >- esac >- done < <(cat $file) >- done >- >- for m in "${MOUNTS[@]}"; do >- prefix=0 >- for mount_point in "${MOUNTS[@]}"; do >- [[ $m = $mount_point ]] && continue >- if [[ $m =~ ^$mount_point.* ]] ; then >- prefix=1 >- break >- fi >- done >- [[ $prefix -eq 1 ]] && continue >+ # Common mount options for scratch space regardless of >+ # type of backing store >+ mountopts= >+ >+ # Scan partitions for local scratch storage >+ rw_mount_dev=$(blkid -t LABEL="$RW_LABEL" -l -o device) >+ >+ # First try to mount scratch storage from /etc/fstab, then any >+ # partition with the proper label. If either succeeds, be sure >+ # to wipe the scratch storage clean. If both fail, then mount >+ # scratch storage via tmpfs. >+ if mount $mountopts "$RW_MOUNT" > /dev/null 2>&1 ; then >+ rm -rf "$RW_MOUNT" > /dev/null 2>&1 >+ elif [ x$rw_mount_dev != x ] && mount $rw_mount_dev $mountopts "$RW_MOUNT" > /dev/null 2>&1; then >+ rm -rf "$RW_MOUNT" > /dev/null 2>&1 >+ else >+ mount -n -t tmpfs $RW_OPTIONS $mountopts none "$RW_MOUNT" >+ fi >+ >+ for file in /etc/rwtab /etc/rwtab.d/* /run/initramfs/rwtab ; do >+ is_ignored_file "$file" && continue >+ [ -f $file ] && while read type path ; do >+ case "$type" in >+ empty) >+ cp_empty $path >+ ;; >+ files) >+ cp_files $path >+ ;; >+ dirs) >+ cp_dirs $path >+ ;; >+ *) >+ ;; >+ esac >+ done < <(cat $file) >+ done >+ >+ for m in "${MOUNTS[@]}"; do >+ prefix=0 >+ for mount_point in "${MOUNTS[@]}"; do >+ [[ $m = $mount_point ]] && continue >+ if [[ $m =~ ^$mount_point.* ]] ; then >+ prefix=1 >+ break >+ fi >+ done >+ [[ $prefix -eq 1 ]] && continue > >- mount -n --bind "$RW_MOUNT$m" "$m" >- selinux_fixup "$m" >+ mount -n --bind "$RW_MOUNT$m" "$m" >+ selinux_fixup "$m" >+ done >+ >+ # Use any state passed by initramfs >+ [ -d /run/initramfs/state ] && cp -a /run/initramfs/state/* $RW_MOUNT >+ >+ # In theory there should be no more than one network interface active >+ # this early in the boot process -- the one we're booting from. >+ # Use the network address to set the hostname of the client. This >+ # must be done even if we have local storage. >+ ipaddr= >+ if [ "$HOSTNAME" = "localhost" -o "$HOSTNAME" = "localhost.localdomain" ]; then >+ ipaddr=$(ip addr show to 0.0.0.0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }') >+ for ip in $ipaddr ; do >+ HOSTNAME= >+ eval $(ipcalc -h $ipaddr 2>/dev/null) >+ [ -n "$HOSTNAME" ] && { hostname ${HOSTNAME} ; break; } > done >+ fi > >- # Use any state passed by initramfs >- [ -d /run/initramfs/state ] && cp -a /run/initramfs/state/* $RW_MOUNT >+ # Clients with read-only root filesystems may be provided with a >+ # place where they can place minimal amounts of persistent >+ # state. SSH keys or puppet certificates for example. >+ # >+ # Ideally we'll use puppet to manage the state directory and to >+ # create the bind mounts. However, until that's all ready this >+ # is sufficient to build a working system. >+ >+ # First try to mount persistent data from /etc/fstab, then any >+ # partition with the proper label, then fallback to NFS >+ state_mount_dev=$(blkid -t LABEL="$STATE_LABEL" -l -o device) >+ if mount $mountopts $STATE_OPTIONS "$STATE_MOUNT" > /dev/null 2>&1 ; then >+ /bin/true >+ elif [ x$state_mount_dev != x ] && mount $state_mount_dev $mountopts "$STATE_MOUNT" > /dev/null 2>&1; then >+ /bin/true >+ elif [ ! -z "$CLIENTSTATE" ]; then >+ # No local storage was found. Make a final attempt to find >+ # state on an NFS server. >+ >+ mount -t nfs $CLIENTSTATE/$HOSTNAME $STATE_MOUNT -o rw,nolock >+ fi >+ >+ if [ -w "$STATE_MOUNT" ]; then >+ >+ mount_state() { >+ if [ -e "$1" ]; then >+ [ ! -e "$STATE_MOUNT$1" ] && cp -a --parents "$1" "$STATE_MOUNT" >+ mount -n --bind "$STATE_MOUNT$1" "$1" >+ fi >+ } > >- # In theory there should be no more than one network interface active >- # this early in the boot process -- the one we're booting from. >- # Use the network address to set the hostname of the client. This >- # must be done even if we have local storage. >- ipaddr= >- if [ "$HOSTNAME" = "localhost" -o "$HOSTNAME" = "localhost.localdomain" ]; then >- ipaddr=$(ip addr show to 0.0.0.0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }') >- for ip in $ipaddr ; do >- HOSTNAME= >- eval $(ipcalc -h $ipaddr 2>/dev/null) >- [ -n "$HOSTNAME" ] && { hostname ${HOSTNAME} ; break; } >- done >- fi >- >- # Clients with read-only root filesystems may be provided with a >- # place where they can place minimal amounts of persistent >- # state. SSH keys or puppet certificates for example. >- # >- # Ideally we'll use puppet to manage the state directory and to >- # create the bind mounts. However, until that's all ready this >- # is sufficient to build a working system. >- >- # First try to mount persistent data from /etc/fstab, then any >- # partition with the proper label, then fallback to NFS >- state_mount_dev=$(blkid -t LABEL="$STATE_LABEL" -l -o device) >- if mount $mountopts $STATE_OPTIONS "$STATE_MOUNT" > /dev/null 2>&1 ; then >- /bin/true >- elif [ x$state_mount_dev != x ] && mount $state_mount_dev $mountopts "$STATE_MOUNT" > /dev/null 2>&1; then >- /bin/true >- elif [ ! -z "$CLIENTSTATE" ]; then >- # No local storage was found. Make a final attempt to find >- # state on an NFS server. >- >- mount -t nfs $CLIENTSTATE/$HOSTNAME $STATE_MOUNT -o rw,nolock >- fi >- >- if [ -w "$STATE_MOUNT" ]; then >- >- mount_state() { >- if [ -e "$1" ]; then >- [ ! -e "$STATE_MOUNT$1" ] && cp -a --parents "$1" "$STATE_MOUNT" >- mount -n --bind "$STATE_MOUNT$1" "$1" >- fi >- } >- >- for file in /etc/statetab /etc/statetab.d/* ; do >- is_ignored_file "$file" && continue >- [ ! -f "$file" ] && continue >- >- if [ -f "$STATE_MOUNT/$file" ] ; then >- mount -n --bind "$STATE_MOUNT/$file" "$file" >- fi >- >- for path in $(grep -v "^#" "$file" 2>/dev/null); do >- mount_state "$path" >- selinux_fixup "$path" >- done >- done >- >- if [ -f "$STATE_MOUNT/files" ] ; then >- for path in $(grep -v "^#" "$STATE_MOUNT/files" 2>/dev/null); do >- mount_state "$path" >- selinux_fixup "$path" >- done >- fi >- fi >+ for file in /etc/statetab /etc/statetab.d/* ; do >+ is_ignored_file "$file" && continue >+ [ ! -f "$file" ] && continue >+ >+ if [ -f "$STATE_MOUNT/$file" ] ; then >+ mount -n --bind "$STATE_MOUNT/$file" "$file" >+ fi >+ >+ for path in $(grep -v "^#" "$file" 2>/dev/null); do >+ mount_state "$path" >+ selinux_fixup "$path" >+ done >+ done > >- if mount | grep -q /var/lib/nfs/rpc_pipefs ; then >- mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs >+ if [ -f "$STATE_MOUNT/files" ] ; then >+ for path in $(grep -v "^#" "$STATE_MOUNT/files" 2>/dev/null); do >+ mount_state "$path" >+ selinux_fixup "$path" >+ done > fi >+ fi >+ >+ if mount | grep -q /var/lib/nfs/rpc_pipefs ; then >+ mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs >+ fi > fi
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 1128202
: 925193