WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

Re: [XenPPC] Question about netbooting with initrd/initramfs

To: David M Daly <dmdaly@xxxxxxxxxx>
Subject: Re: [XenPPC] Question about netbooting with initrd/initramfs
From: Amos Waterland <apw@xxxxxxxxxx>
Date: Sat, 27 Jan 2007 23:02:03 -0500
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 27 Jan 2007 20:01:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <OFE2932E97.2F1A20E6-ON8525726E.0075F256-8525726E.0076FDBA@xxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
References: <OFE2932E97.2F1A20E6-ON8525726E.0075F256-8525726E.0076FDBA@xxxxxxxxxx>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
On Thu, Jan 25, 2007 at 04:39:39PM -0500, David M Daly wrote:
> I've been having some trouble netbooting linux on a JS21 with an initramfs

Getting a builtin initramfs to work on PPC is tricky.  The only way I
have found to do it is a fragile two-stage process.  

I assume that you want to build an initramfs necessary and sufficient to
run xend and launch a domU, so in the following I describe one technique
that may prove useful for that attempt.  It attempts to find by
inspection on the NFS server the minimal set of files required to launch
a domU.

In the following, NFS denotes the host from which you serve your
nfsroot, and DEV denotes the machine on which you compile Linux and Xen.

   NFS: 
        cd ~/devel/nfsroots/
        touch TIMESTAMP
   DEV:
        cd xenppc-unstable.hg/xen
        net-boot -m VICTIM -f xen
   NFS: 
        cd sles10-rootfs-2006-11-20/
        sudo find * -anewer ../TIMESTAMP > ../xend.list
        cd ..
        sudo rsync -a --files-from=xend.list sles10-rootfs-2006-11-20/ xend/
   DEV:
        cd ../../linux-ppc-2.6.hg/
        sudo rsync -a root@NFS:/home/you/devel/nfsroots/xend/ xend/
        sudo chmod o+r xend/etc/ssh/ssh_host_dsa_key \
                       xend/etc/ssh/ssh_host_key     \
                       xend/etc/ssh/ssh_host_rsa_key \
                       xend/etc/ssh/sshd_config      \
                       xend/sbin/blogd xend/usr/sbin/klogconsole

At this point, you need to work around (what I think is) a bug in
Linux's initramfs build logic or in PPC Linux's boot logic.  First put
this in a file called xend.list:

 dir /dev 755 0 0
 nod /dev/console 644 0 0 c 5 1
 nod /dev/loop0 644 0 0 b 7 0
 dir /proc 755 0 0
 dir /sys 755 0 0
 dir /mnt 755 0 0
 file /init xend/sbin/quickinit 755 0 0

Then edit Linux's .config to have:

 CONFIG_INITRAMFS_SOURCE="xend.list"

Now you can resume the build process:

   DEV:
        scripts/gen_initramfs_list.sh xend >> xend.list
        make CROSS_COMPILE='distcc powerpc64-linux-' \
             CROSS_COMPILE32=powerpc-linux- ARCH=powerpc zImage
        cd ../xenppc-unstable.hg/xen/
        make CROSS_COMPILE=powerpc64-linux- XEN_TARGET_ARCH=powerpc64 \
             DOM0_IMAGE =~/devel/xen/linux-ppc-2.6.hg/arch/powerpc/boot/zImage
        net-boot -m VICTIM -f xen

So in theory, what we have now is a root filesystem sufficient to run
the regular quickinit script that does the automounts, launches sshd,
and starts xend.  However, the total netboot image size is 13 MB, so xen
boots properly and Linux starts fine, but hangs when unzipping the initramfs:

 gunzipping (0x1400000 <- 0x407000:0xeef729)...

You will have to figure how how to trim files from xend.list that, while
were accessed during our reference nfsroot boot process, are not
strictly necessary to run xend and launch domUs.  Alternatively, you can
take a look at what is going wrong with Linux's initramfs logic in which
it cannot handle an approximately 9MB compressed initramfs.

Just to make sure that we are on the right track, if you place the
5-tuples at the end of this email into xend.list, the resultant
initramfs will provide you with a basic libc6 environment with bash and
a few standard utilities.  The xen netboot image is 7.6 MB.

Note that after editing xend.list and before recompiling, you have to do
this to work around a problem in Linux's initramfs build deps:

        rm usr/initramfs_data.cpio*

Good luck.  I hope you are able to extend this technique, or discover a
better one, to build a minimal Xen dom0.

---

dir /dev 755 0 0
nod /dev/console 644 0 0 c 5 1
nod /dev/loop0 644 0 0 b 7 0
dir /proc 755 0 0
dir /sys 755 0 0
dir /mnt 755 0 0
slink /init /bin/bash 755 0 0
dir /bin 755 0 0
file /bin/bash xend/bin/bash 755 0 0
file /bin/cat xend/bin/cat 755 0 0
file /bin/cp xend/bin/cp 755 0 0
file /bin/ls xend/bin/ls 755 0 0
file /bin/mount xend/bin/mount 4755 0 0
file /bin/ps xend/bin/ps 555 0 0
file /bin/rm xend/bin/rm 755 0 0
file /bin/sync xend/bin/sync 755 0 0
file /bin/umount xend/bin/umount 4755 0 0
dir /lib 755 0 0
slink /lib/ld.so.1 ld-2.4.so 777 0 0
slink /lib/libacl.so.1 libacl.so.1.1.0 777 0 0
slink /lib/libattr.so.1 libattr.so.1.1.0 777 0 0
slink /lib/libbz2.so.1 libbz2.so.1.0.0 777 0 0
slink /lib/libcap.so.1 libcap.so.1.92 777 0 0
slink /lib/libcom_err.so.2 libcom_err.so.2.1 777 0 0
slink /lib/libcrypt.so.1 libcrypt-2.4.so 777 0 0
slink /lib/libdl.so.2 libdl-2.4.so 777 0 0
slink /lib/libgetconfig.so.1 libgetconfig.so.1.1.0 777 0 0
slink /lib/libhistory.so.5 libhistory.so.5.1 777 0 0
slink /lib/libncurses.so.5 libncurses.so.5.5 777 0 0
slink /lib/libnsl.so.1 libnsl-2.4.so 777 0 0
slink /lib/libnss_compat.so.2 libnss_compat-2.4.so 777 0 0
slink /lib/libnss_dns.so.2 libnss_dns-2.4.so 777 0 0
slink /lib/libnss_files.so.2 libnss_files-2.4.so 777 0 0
slink /lib/libnss_nis.so.2 libnss_nis-2.4.so 777 0 0
slink /lib/libpam.so.0 libpam.so.0.81.2 777 0 0
slink /lib/libreadline.so.5 libreadline.so.5.1 777 0 0
slink /lib/libresolv.so.2 libresolv-2.4.so 777 0 0
slink /lib/libsysfs.so.1 libsysfs.so.1.0.3 777 0 0
slink /lib/libutil.so.1 libutil-2.4.so 777 0 0
slink /lib/libwrap.so.0 libwrap.so.0.7.6 777 0 0
slink /lib/libz.so.1 libz.so.1.2.3 777 0 0
dir /lib/power4 755 0 0
slink /lib/power4/libc.so.6 libc-2.4.so 777 0 0
slink /lib/power4/libm.so.6 libm-2.4.so 777 0 0
slink /lib/power4/libpthread.so.0 libpthread-2.4.so 777 0 0
slink /lib/power4/librt.so.1 librt-2.4.so 777 0 0
file /lib/power4/libpthread-2.4.so xend/lib/power4/libpthread-2.4.so 755 0 0
file /lib/power4/libc-2.4.so xend/lib/power4/libc-2.4.so 755 0 0
file /lib/power4/libm-2.4.so xend/lib/power4/libm-2.4.so 755 0 0
file /lib/power4/librt-2.4.so xend/lib/power4/librt-2.4.so 755 0 0
dir /lib/udev 755 0 0
dir /lib/udev/devices 755 0 0
slink /lib/udev/devices/core /proc/kcore 777 0 0
slink /lib/udev/devices/fd /proc/self/fd 777 0 0
dir /lib/udev/devices/net 755 0 0
dir /lib/udev/devices/pts 755 0 0
dir /lib/udev/devices/shm 755 0 0
slink /lib/udev/devices/stderr /proc/self/fd/2 777 0 0
slink /lib/udev/devices/stdin /proc/self/fd/0 777 0 0
slink /lib/udev/devices/stdout /proc/self/fd/1 777 0 0
file /lib/udev/rename_netiface xend/lib/udev/rename_netiface 755 0 0
file /lib/udev/mount.sh xend/lib/udev/mount.sh 755 0 0
file /lib/libacl.so.1.1.0 xend/lib/libacl.so.1.1.0 755 0 0
file /lib/ld-2.4.so xend/lib/ld-2.4.so 755 0 0
file /lib/libcom_err.so.2.1 xend/lib/libcom_err.so.2.1 755 0 0
file /lib/libattr.so.1.1.0 xend/lib/libattr.so.1.1.0 755 0 0
file /lib/libbz2.so.1.0.0 xend/lib/libbz2.so.1.0.0 755 0 0
file /lib/libcap.so.1.92 xend/lib/libcap.so.1.92 755 0 0
file /lib/libgetconfig.so.1.1.0 xend/lib/libgetconfig.so.1.1.0 755 0 0
file /lib/libcrypt-2.4.so xend/lib/libcrypt-2.4.so 755 0 0
file /lib/libdl-2.4.so xend/lib/libdl-2.4.so 755 0 0
file /lib/libgcc_s.so.1 xend/lib/libgcc_s.so.1 755 0 0
file /lib/libhistory.so.5.1 xend/lib/libhistory.so.5.1 755 0 0
file /lib/libncurses.so.5.5 xend/lib/libncurses.so.5.5 755 0 0
file /lib/libnsl-2.4.so xend/lib/libnsl-2.4.so 755 0 0
file /lib/libnss_compat-2.4.so xend/lib/libnss_compat-2.4.so 755 0 0
file /lib/libnss_dns-2.4.so xend/lib/libnss_dns-2.4.so 755 0 0
file /lib/libnss_files-2.4.so xend/lib/libnss_files-2.4.so 755 0 0
file /lib/libnss_nis-2.4.so xend/lib/libnss_nis-2.4.so 755 0 0
file /lib/libpam.so.0.81.2 xend/lib/libpam.so.0.81.2 755 0 0
file /lib/libreadline.so.5.1 xend/lib/libreadline.so.5.1 755 0 0
file /lib/libresolv-2.4.so xend/lib/libresolv-2.4.so 755 0 0
file /lib/libsysfs.so.1.0.3 xend/lib/libsysfs.so.1.0.3 755 0 0
file /lib/libutil-2.4.so xend/lib/libutil-2.4.so 755 0 0
file /lib/libwrap.so.0.7.6 xend/lib/libwrap.so.0.7.6 755 0 0
file /lib/libz.so.1.2.3 xend/lib/libz.so.1.2.3 755 0 0
dir /lib64 755 0 0
slink /lib64/ld64.so.1 ld-2.4.so 777 0 0
dir /lib64/power4 755 0 0
slink /lib64/power4/libc.so.6 libc-2.4.so 777 0 0
file /lib64/power4/libc-2.4.so xend/lib64/power4/libc-2.4.so 755 0 0
file /lib64/ld-2.4.so xend/lib64/ld-2.4.so 755 0 0

---


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>