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

2007-01-29 Thread David M Daly
[EMAIL PROTECTED] wrote on 01/27/2007 11:02:03 PM:

> 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. 
> 

Amos, thanks for the recipes. I've been able to get some initramfs 
functionality working using them, and I was able to netboot it. 

> 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

I want to do two things with the initramfs:
1. Run xend as you suggest
2. Boot a utility image to set some things up for a later boot (flash 
SLOF, configure HBA/SAN settings). This does not require xend running. 

I'll post a followup if I get xend working from an initramfs. 

Thanks again. 

David Daly
Research Staff Member
32-003 IBM T.J. Watson Research Center
Yorktown Heights, NY, 10958
(914) 945-1845, T/L 862-1845

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

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

2007-01-27 Thread Amos Waterland
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 [EMAIL PROTECTED]:/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 (0x140 <- 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 libresol

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

2007-01-26 Thread Yoder Stuart-B08248
David,
 
Could you provide a little more info-- error messages, build command
line.
 
You have confirmed that the init ramdisk itself is no corrupt through
yaboot, correct?
 
Stuart




From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David M
Daly
Sent: Thursday, January 25, 2007 3:40 PM
To: xen-ppc-devel@lists.xensource.com
Subject: [XenPPC] Question about netbooting with
initrd/initramfs



I've been having some trouble netbooting linux on a JS21 with an
initramfs, and wanted to see if there were any known issues, etc. Are
there any difficulties in netbooting as an image on a JS21 with an
initramfs/initrd? Any secret voodoo? I'm using Maria's branch of the
linux-ppc kernel both on bare-metal, and on Xen, and I netboot both.
Since I've successfully compiled the Dom0 kernel into Xen, so am just
concerned with the step of getting the initramfs into the linux kernel. 

I've followed the instructions straight from the xensource
powerpc wiki for building an initrd. I've also tried compiling using the
specify initramfs source config option in the build process. I can
successfully boot with an initramfs using yaboot, if I specify an option
for it, but I have not successfully booted with an initial image over
netboot, or through yaboot with all the bootargs compiled into the
kernel. 

Any help or pointers are appreciated. 
Thanks 

David Daly
Research Staff Member
32-003 IBM T.J. Watson Research Center
Yorktown Heights, NY, 10958
(914) 945-1845, T/L 862-1845

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