[Fedora-livecd-list] [PATCH] RFC: Use nash for root switch instead of run-init

Jane Dogalt jdogalt at yahoo.com
Thu Mar 22 20:09:11 UTC 2007


I agree with all of this.

I noticed some network bits in nash a while back that seemed new (as in
within the last 5 years).

I wonder, how hard would it be to do the http-fuse-knoppix hackage with
the current nash/initramfs infrastructure?  (i.e. bring up the network,
use fuse to mount an http exposed iso, and use it instead the media
iso)

http://unit.aist.go.jp/itri/knoppix/http-fuse/index-en.html

-dmc/jdog

--- Jeremy Katz <katzj at redhat.com> wrote:

> The attached patch switches so that we use nash instead of the
> run-init
> from the livecd-creator for switching to the real system root. 
> There's
> up and downsides to this, but I think that overall it's the right
> thing
> to do.
> 
> Pros:
> * Not using binaries from the "host" system when creating the live CD
> image.  Makes building x86 and x86_64 live CDs on the same box far
> easier
> * Makes creator bits all noarch
> * Uses infrastructure that we use on "real" systems for the live CD
> * Moves more in the direction so that hopefully we can use nash for
> all
> of the initramfs bits in the live CD eventually
> 
> Cons:
> * Might end up being a little bigger
> * nash is bigger and thus debugging it instead of run-init requires a
> little more poking/knowledge.
> 
> Other thoughts?
> 
> Jeremy
> > diff --git a/creator/livecd-creator b/creator/livecd-creator
> diff --git a/creator/mayflower b/creator/mayflower
> index b5062bf..a6b3dcc 100755
> --- a/creator/mayflower
> +++ b/creator/mayflower
> @@ -155,7 +155,7 @@ cp /sbin/insmod sbin
>  cp /sbin/modprobe sbin
>  cp /sbin/pidof sbin
>  cp /sbin/killall5 sbin
> -cp /sbin/run-init sbin
> +cp /sbin/nash sbin
>  
>  cp /lib/udev/vol_id lib/udev
>  
> @@ -181,6 +181,13 @@ for i in bin/* sbin/* lib/udev/*; do
>      done
>  done
>  
> +cat > sbin/run-init <<EOF
> +#!/sbin/nash
> +setuproot
> +switchroot
> +EOF
> +chmod 755 sbin/run-init
> +
>  # Write out init
>  cat > init <<EOF
>  #!/bin/bash
> @@ -639,21 +646,14 @@ fi
>  if [ -x /sysroot\$init ] ; then
>  
>      # Leave initramfs and transition to rootfs
> -    #
> -
>      kill \`pidof udevd\`
> -    echo "" > /etc/mtab
> -    umount -n /proc
> -    umount -n /sys
> -    mount -n --move /dev /sysroot/dev
> -
>      if [ "\$quiet" != "1" ] ; then
>          echo "transfering control to \$init"
>      fi
>  
> -    exec /sbin/run-init -c ./dev/console /sysroot \$init \$initargs
> +    exec /sbin/run-init
>      echo "---------------------------------"
> -    echo "WARNING: Error running run-init!"
> +    echo "WARNING: Error switching to real rootfs!"
>      echo "---------------------------------"
>      echo
>      echo "Dropping to a shell. Good luck!"
> > --
> Fedora-livecd-list mailing list
> Fedora-livecd-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-livecd-list
> 



 
____________________________________________________________________________________
TV dinner still cooling? 
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/




More information about the Fedora-livecd-list mailing list