Re: [Etherboot-users] /sbin/init hangs on boot
Brought to you by:
marty_connor,
stefanhajnoczi
From: Tiago A. da F. <ti...@kn...> - 2005-11-11 18:53:05
|
Hi! Thanks for replying! When I say PXE I mean that I am using newer motherboards that come with netboot built in the BIOS; I say Etherboot I mean I older motherboards with an EPROM extending the BIOS features (I designed an ISA card that works as a BIOS extension). My card is working fine with LTSP and Etherboot (it starts the NIC, downloads the kernel and load the OS) but when I tried to netboot the way I said before, even using Etherboot from floppy, the thinclient starts the NIC, download de ELF (or NBI), run the "init=/rd/bin/init0" script and hangs in the 2 last lines of init0: +++++ exec /sbin/init '#' <<<<<<<< exec /etc/rc.sysinit +++++ My thinclient is an old Pentium. When I use a newer PC, an HP Compaq whose BIOS has PXE, my implementation works fine. It follows my config files: RAMDISK, pxelinux.cfg/default, kernel .config, my RAMDISK tree and my mkelf-linux command line. Regards, Tiago Alves To create my RAMDISK I use "makerd": ------------------------- #!/bin/sh # makerd --- creates an initrd ramdisk file from an existing directory tree. # Copyright 2001 Jamie Zawinski <jw...@dn...> # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation. No representations are made about the suitability of this # software for any purpose. It is provided "as is" without express or # implied warranty. # # Created by jwz, 23-Dec-2000 verbose= dir= target= # Increase this if you get "No space left on device" errors. IMAGESIZE=4096 #2048 make_ramdisk() { IMAGE=$target.tmp dd if=/dev/zero of=$IMAGE bs=1k count=$IMAGESIZE 2> /dev/null for devnum in 0 1 2 3 4 5 6 7 8; do if losetup /dev/loop$devnum $IMAGE 2>/dev/null ; then break; fi done if [ "$devnum" = "8" ]; then rm -rf $IMAGE echo "All of your loopback devices are in use!" >&2 exit 1 fi LODEV=/dev/loop$devnum if [ -n "$verbose" ]; then echo "Using loopback device $LODEV" fi echo y | mke2fs $LODEV $IMAGESIZE >/dev/null 2>/dev/null MNTPOINT=$target.mnt rm -rf $MNTPOINT mkdir $MNTPOINT mount -t ext2 $LODEV $MNTPOINT || { echo "Can't get a loopback device" exit 1 } rmdir $MNTPOINT/lost+found cpio_v="" if [ -n "$verbose" ]; then echo "Copying $dir..." dash_v="-v" fi cwd=`pwd` ( cd $dir; find . -depth -print | cpio $dash_v --quiet -pdm $cwd/$MNTPOINT ) \ 2>&1 | sed "s@$cwd/$MNTPOINT/\./@/@g" | sed 's@^@ @' umount $MNTPOINT losetup -d $LODEV ( gzip $dash_v -9 < $IMAGE > $target ) 2>&1 | sed 's@^@Compression:@' rmdir $MNTPOINT rm -rf $IMAGE if [ -n "$verbose" ]; then echo "Wrote $target:" ls -ldGF $target fi } usage() { echo "usage: `basename $0` [-v] input-directory output-ramdisk-file" exit 1 } main() { while [ $# -gt 0 ]; do case $1 in -v) verbose=1 ;; *) if [ -z "$dir" ]; then dir=$1 elif [ -z "$target" ]; then target=$1 else usage fi ;; esac shift done if [ -z "$dir" -o -z "$target" ]; then usage fi make_ramdisk } main "$@" exit 0 ------------------------- My PXE config is (this works fine): pxelinux.cfg/default: ------------------------ prompt 0 label linux kernel kiosk.vmlinuz append initrd=kiosk2.rd root=/dev/ram0 init=/rd/bin/init0 ID=01 SERVER=192.168.100.1 vga=795 ip=dhcp ------------------------ My mkelf-linux command line is: ------------------------ mkelf-linux --ip=dhcp --append="root=/dev/ram0 init=/rd/bin/init0 rw ID=02 SERVER=192.168.100.1" kiosk.vmlinuz21 kiosk3.rd > kiosk.vmlinuz2 ------------------------ My init0 is (where the boot hangs, look at the 2 last lines): --------------------- #!/rd/bin/sh # # /sbin/init for diskless workstations # Copyright (c) 2000, 2003, 2004 by Jamie Zawinski <jw...@dn...> # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation. No representations are made about the suitability of this # software for any purpose. It is provided "as is" without express or # implied warranty. # # Created: 23-Dec-00, Jamie Zawinski <jw...@dn...> # # This file is run by the kernel from a ramdisk file system. The kernel # should invoke this as the first thing. It mounts stuff, then runs init. # # The root file system on this ramdisk will remain the kiosk's root # directory (read-only.) This script NFS mounts a few directories to # fill in the dangling symlinks, then invokes init to finish booting. # # expects SERVER=<ip> and ID=<n> to be passed on the kernel command line. # SERVER is IP of the NFS server to use; ID is the name of the sub-directory # to mount as this particular kiosk's writable (non-shared) file system. # The programs in /ro/bin are symlinks to busybox, an all-in-one shell # program. # First, make sure the boot ramdisk (root file system) is writable. # (/proc needs to be mounted first, in order for this to work) /rd/bin/mount -t proc proc /proc /rd/bin/mount -t rootfs rootfs -o remount,rw / # first mount various vital directories from the NFS server. # /ro is the root directory shared between the server and clients.. # /ro2 is the root directory shared between all clients (the pieces # where the clients differ from the server.) # /rw is the per-client writable directory; each client has its own. # /rd/bin/mount -t nfs -o nolock $SERVER:/opt/kiosk /ro /rd/bin/mount -t nfs -o nolock $SERVER:/home/guest/$ID /rw # We needed a handful of devices in /dev even before mounting anything. # Now that the mounts are up, we can use the server's fully-populated dev. # but devices are still open in our /dev, so just rename it out of the # way, and then turn /dev into a symlink to the server's version. # /rd/bin/mv /dev rd/dev /rd/bin/mkdir /dev /rd/bin/mount -t nfs -o nolock $SERVER:/home/guest/$ID/dev /dev # Now invoke "init" and complete the boot-up with server-loaded files. # The argument "#" is what the kernel passes as the runlevel to tell # init to read the "initdefault" entry in /etc/inittab. # exec /sbin/init '#' # <<<<<<<<<<<<<< HERE IT HANGS :( exec /etc/rc.sysinit --------------------- My rd_root look like this: ---------------------------- total 36 lrwxrwxrwx 1 root root 7 Nov 7 13:40 bin -> /ro/bin lrwxrwxrwx 1 root root 8 Nov 7 13:40 boot -> /ro/boot drwxr-xr-x 4 root root 4096 Nov 3 13:34 dev lrwxrwxrwx 1 root root 8 Nov 7 13:40 etc -> /rw/etc/ -rwxr-xr-x 1 root root 5769 Oct 28 14:18 fastboot lrwxrwxrwx 1 root root 9 Nov 7 13:40 home -> /rw/home/ lrwxrwxrwx 1 root root 7 Nov 7 13:40 lib -> /ro/lib lrwxrwxrwx 1 root root 10 Nov 7 13:40 media -> /rw/media/ drwxr-xr-x 2 root root 4096 Nov 11 10:41 mnt lrwxrwxrwx 1 root root 8 Nov 7 13:40 opt -> /rw/opt/ drwxr-xr-x 2 root root 4096 Oct 20 19:37 proc drwxr-xr-x 3 root root 4096 Oct 20 19:37 rd drwxr-xr-x 2 root root 4096 Oct 20 19:37 ro lrwxrwxrwx 1 root root 8 Nov 7 13:40 root -> /rw/root drwxr-xr-x 2 root root 4096 Oct 20 19:37 rw lrwxrwxrwx 1 root root 8 Nov 7 13:40 sbin -> /ro/sbin drwxr-xr-x 2 root root 4096 Oct 28 18:18 sys lrwxrwxrwx 1 root root 8 Nov 7 13:40 tmp -> /rw/tmp/ lrwxrwxrwx 1 root root 7 Nov 7 13:40 usr -> /ro/usr lrwxrwxrwx 1 root root 7 Nov 7 13:40 var -> /rw/var ---------------------------- > Tiago Alves da Fonseca wrote: > > Hi! > > I am working this last month with thinclients. It worked fine with PXE > > and Etherboot running LTSP. Based on a solution described in DNA Lounge > > (www.dnalounge.com -> kiosk project), I tried to run thinclients that > > boot from the network and execute all aplications locally. When I tried > > to load all the software via PXE, the machine booted correctly and all > > define "via PXE", cuz to me that is the same as "using Etherboot". > > > aplications runned fine but when I tried to implement the same solution > > using Etherboot (using mkelf-linux and the same ramdisk) the computer > > entered in a loop when the init script started the /sbin/init. > > What is the first and last line of the loop? (as in, how far did it get and where > did it loop back to?) > > Post your pxe config file. mainly the kernel and append. > > Here is what I use for a knoppix based TS: > label knoppix37 > kernel knoppix/vmlinuz > APPEND nfsdir=192.168.1.7:/mnt/knoppix37 nodhcp lang=us > ramdisk_size=100000 init=/etc/init apm=power-off nomce vga=791 > initrd=knoppix/miniroot.gz BOOT_IMAGE=knoppix noacpi > > wag#1: you need a bigger ramdisk_size=100000 > > ^Carl K > > -- NeoMail - Webmail that doesn't suck... as much. http://www.neomail.org > Tiago Alves da Fonseca wrote: > > Hi! > > I am working this last month with thinclients. It worked fine with PXE > > and Etherboot running LTSP. Based on a solution described in DNA Lounge > > (www.dnalounge.com -> kiosk project), I tried to run thinclients that > > boot from the network and execute all aplications locally. When I tried > > to load all the software via PXE, the machine booted correctly and all > > define "via PXE", cuz to me that is the same as "using Etherboot". > > > aplications runned fine but when I tried to implement the same solution > > using Etherboot (using mkelf-linux and the same ramdisk) the computer > > entered in a loop when the init script started the /sbin/init. > > What is the first and last line of the loop? (as in, how far did it get and where > did it loop back to?) > > Post your pxe config file. mainly the kernel and append. > > Here is what I use for a knoppix based TS: > label knoppix37 > kernel knoppix/vmlinuz > APPEND nfsdir=192.168.1.7:/mnt/knoppix37 nodhcp lang=us > ramdisk_size=100000 init=/etc/init apm=power-off nomce vga=791 > initrd=knoppix/miniroot.gz BOOT_IMAGE=knoppix noacpi > > wag#1: you need a bigger ramdisk_size=100000 > > ^Carl K > > -- NeoMail - Webmail that doesn't suck... as much. http://www.neomail.org |