[Libguestfs] [PATCH v3 02/11] appliance: Move /proc/cmdline checks earlier.

Pino Toscano ptoscano at redhat.com
Wed Mar 23 09:31:54 UTC 2016


On Tuesday 22 March 2016 19:05:21 Richard W.M. Jones wrote:
> ---
>  appliance/init | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/appliance/init b/appliance/init
> index f4f6333..5d43c71 100755
> --- a/appliance/init
> +++ b/appliance/init
> @@ -75,21 +75,6 @@ $UDEVD --daemon #--debug
>  udevadm trigger
>  udevadm settle --timeout=600
>  
> -if grep -sq selinux=1 /proc/cmdline; then
> -  mount -t selinuxfs none /sys/fs/selinux
> -fi
> -
> -# Disk optimizations.
> -# Increase the SCSI timeout so we can read remote images.
> -shopt -s nullglob
> -for f in /sys/block/sd*/device/timeout; do echo 300 > $f; done
> -# https://access.redhat.com/site/solutions/5427
> -for f in /sys/block/{h,s,ub,v}d*/queue/scheduler; do echo noop > $f; done
> -shopt -u nullglob
> -
> -# Update the system clock.
> -hwclock -u -s
> -
>  # Parse the kernel command line.
>  if grep -sq guestfs_verbose=1 /proc/cmdline; then
>      guestfs_verbose=1
> @@ -106,6 +91,21 @@ if grep -sq guestfs_noreboot=1 /proc/cmdline; then
>  fi
>  eval `grep -Eo 'guestfs_channel=[^[:space:]]+' /proc/cmdline`
>  
> +if grep -sq selinux=1 /proc/cmdline; then
> +  mount -t selinuxfs none /sys/fs/selinux
> +fi
> +
> +# Disk optimizations.
> +# Increase the SCSI timeout so we can read remote images.
> +shopt -s nullglob
> +for f in /sys/block/sd*/device/timeout; do echo 300 > $f; done
> +# https://access.redhat.com/site/solutions/5427
> +for f in /sys/block/{h,s,ub,v}d*/queue/scheduler; do echo noop > $f; done
> +shopt -u nullglob
> +
> +# Update the system clock.
> +hwclock -u -s
> +
>  # Set up the network.
>  ip addr add 127.0.0.1/8 brd + dev lo scope host
>  ip link set dev lo up

Considering commit bb5d30ab2af5720775c63179afdec3ad9efd510d, these
checks (excluding the guestfs_channel one) could be moved ever earlier
than there, what do you think?  I'd say between the mount of the
filesystems and the static nodes setup.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160323/ac7e71c4/attachment.sig>


More information about the Libguestfs mailing list