LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How to boot Slackware via PXE ? (http://www.linuxquestions.org/questions/slackware-14/how-to-boot-slackware-via-pxe-554021/)

Linux.tar.gz 05-15-2007 07:50 AM

How to boot Slackware via PXE ?
 
I just succeeded in booting the new Alien BOB's wonderful pxe installer :
ftp://ftp.slackware.com/pub/slackwar...README_PXE.TXT

And now i want to boot a diskless using a nfs root. I installpkg -root /nfsroot all needed files (/a /l /n package series).

And this is where i'm stuck. I think i have to do a new initrd, and make some changes to /tftpboot/slack/pxelinux.cfg/default
I already did that :
default linux initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 nfsroot=192.168.223.1:/nfsroot rw

But when i boot i got a kernel panic unable to mount rootfs blahblah.
So is the new initrd the answer ?
Do i have to compile a more generic kernel on my main machine, in order to mkinitrd/transfer it on the diskless ?

Keep on slackin'

Linux.tar.gz 05-15-2007 12:27 PM

From kernel configurator, nfs section :

If you are configuring a diskless machine which will mount its root
file system over NFS at boot time, say Y here and to "Kernel
level IP autoconfiguration" above and to "Root file system on NFS"
below. You cannot compile this driver as a module in this case.
There are two packages designed for booting diskless machines over
the net: netboot, available from
<http://ftp1.sourceforge.net/netboot/>, and Etherboot,
available from <http://ftp1.sourceforge.net/etherboot/>.



I wonder if netboot and etherboot are mandatory as the pxe installer booted the kernel more than fine.

EDIT : --------------------
Rectified links :
http://netboot.sourceforge.net/
http://www.etherboot.org/wiki/index.php

Alien_Hominid 05-15-2007 04:11 PM

Should they be compiled into the kernel some way? If not, I don't believe that they are required, because can't think of how kernel executes them.

Linux.tar.gz 05-16-2007 05:23 AM

Netboot and etherboot are "userspace" programs. And as the pxe installer works without them, maybe we can get rid of them.

Alien Bob 05-16-2007 08:48 AM

Quote:

Originally Posted by Linux.tar.gz
I just succeeded in booting the new Alien BOB's wonderful pxe installer :
http://slackware.mirrors.tds.net/pub...allers/pxe.txt

And now i want to boot a diskless using a nfs root. I installpkg -root /nfsroot all needed files (/a /l /n package series).

And this is where i'm stuck. I think i have to do a new initrd, and make some changes to /tftpboot/slack/pxelinux.cfg/default
I already did that :
default linux initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 nfsroot=192.168.223.1:/nfsroot rw

But when i boot i got a kernel panic unable to mount rootfs blahblah.
So is the new initrd the answer ?
Do i have to compile a more generic kernel on my main machine, in order to mkinitrd/transfer it on the diskless ?

Keep on slackin'

Nice of you to comment on the PXE installer. I always wonder who uses it.

To boot a diskless machine using a NFS filesystem, you will indeed have to rewrite the init script inside the initrd.img. This is not trivial but can be done.
An interesting Wiki article describing a way to use ZipSlack for a diskless client setup is available on Linux.Ars.
You'll find it covers the whole process of setting up the NFS server, the initrd and the linurc script (the actual script that does all the initialization inside the initrd).

Let me know if that Wiki article helped you - if so, I will try to adapt it for modern-day Slackware.

Cheers, Eric

Linux.tar.gz 05-16-2007 11:00 AM

Well this article is by far the most complete i've read. I'm going to put it in practice next week.
I don't understand (yet) why we have to use ZipSlack (maybe the system is already complete, no need to installpkg -root).

For your nice installer, i used it only for learning purpose, and i learnt well as i succeeded launching the Slack setup program. I may be using it in the near future as it avoid me to put a CD/DVD in the machines ^_^.
In fact, i used to install many Slack by nfs as the process is faster than CD/DVD (especially if the server got a SATA disk, or better if the install set mounted in a ram filesystem).

And it's very important for people who own a laptop with broken CD/DVD player and no floppy.

When using diskless machines, the price is lowered by ~120€. No CD/DVD drive, no floppy, no hard drive.
And when (it's currently my case) you have 15+ diskless machines, no need to draw a picture...
So maybe indeed it will be good to howtorize a Slackware diskless procedure.

Keep in touch.

onebuck 05-16-2007 12:29 PM

Quote:

Originally Posted by Alien Bob
Nice of you to comment on the PXE installer. I always wonder who uses it.

To boot a diskless machine using a NFS filesystem, you will indeed have to rewrite the init script inside the initrd.img. This is not trivial but can be done.
An interesting Wiki article describing a way to use ZipSlack for a diskless client setup is available on Linux.Ars.
You'll find it covers the whole process of setting up the NFS server, the initrd and the linurc script (the actual script that does all the initialization inside the initrd).

Let me know if that Wiki article helped you - if so, I will try to adapt it for modern-day Slackware.

Cheers, Eric

Hi,

Eric, I just went to the referenced wiki and read it. To adapt the technique to modern Slackware would be a great tool.

Linux.tar.gz 05-21-2007 04:56 AM

Back on it.
First, it seems that zipslack is now larger than 100M.
I had to enlarge the .img to 200M.
And now i can't mount umsdos. I have a custom kernel, and i don't see where to enable it in menuconfig.

So i rebooted to 2.4.33.3.
I completed the phase 1. Here's the ###beta### script, and don't forget to edit it :

#!/bin/sh
dd if=/dev/zero of=zipslack.img count=1 bs=200M
/sbin/mkdosfs -F 16 zipslack.img
su
mkdir -p /mnt/zipslack /var/clients/default
mount -t msdos -o loop zipslack.img /mnt/zipslack
cd /mnt/zipslack
##### Change to your username
unzip -qq /home/user/zipslack.zip
cd
umount /mnt/zipslack
##### Change to your username
mount -t umsdos -o loop /home/user/zipslack.img /mnt/zipslack
cd /mnt/zipslack
find . -xdev -print0 | cpio -pa0Vdmu --sparse /var/clients/default
cd
umount /mnt/zipslack
rmdir /mnt/zipslack

Linux.tar.gz 05-21-2007 06:15 AM

Phase 2 : I had to enlarge initrd to 40M and move all files in /var/clients/default/linux to /var/clients/default/

####this script is beta too####
#!/bin/sh
dd if=/dev/zero of=initrd count=1 bs=40M
su
mke2fs initrd
tune2fs -c0 -i0 initrd
#####Some people like i have already that :
mkdir -p /mnt/loop
mount -o loop -t ext2 initrd /mnt/loop
cd /var/clients/default

for pkg in aaa_base etc glibc-solibs bin coreutils util-linux \
sed gawk grep bash elflibs tcpip; do grep -A10000 \
'^FILE LIST:$' var/log/packages/${pkg}* | sed \
's/\/incoming\//\//' | grep -v '^FILE LIST:$' | sed \
's/\.new$//' | grep -v '^install\/' | cpio -paVdmu --sparse /mnt/loop; done

cp bin/bash /mnt/loop/bin
mkdir mnt/initrd
cd /mnt/loop
ln bin/bash bin/sh
ldconfig -r .
mkdir mnt/nfsroot

#####complete with adding linuxrc and chmod it. Umount loop and compress initrd.

Linux.tar.gz 05-21-2007 10:24 AM

I succeeded in booting the unzipped initrd, but :

RAMDISK: image too big! (40960/7777 blocks)
Freeing initrd memory: 40960k freed
....
....
Kernel panic blah blah


So i booted with the zipped initrd :

VFS: Mounted root (ext2 filesystem)
attempt to access beyond end of device
01:00: rw=0, want=16388, limit=7777
EXT2-fs error (device ramdisk(1,0)): ext2_read_inode: unable to read inode block - inode=4097, block=16387
....
....
Kernel panic blah blah

Linux.tar.gz 05-22-2007 07:41 AM

Now i used this option in pxeconfig.cfg/default : ramdisk_size=40960 and i can go further with compressed initrd.gz and uncompressed initrd.img.

But i'm blocked at the root filesystem mount. If i specify root=192.168.223.1:/var/clients/default/linux/

then i have :

VFS: Cannot open root device "192.168.223.1:/var/clients/default/linux/" or 00:00
Please append a correct "root=" boot option
Kernel panic...

and if i specify
nfsroot=192.168.223.1:/var/clients/default/linux/
i have :

kmod: failed to exec /sbin/modprobe -s -k block-major-3, errno = 2
VFS: Cannot open root device "" or 03:07
Please append a correct "root=" boot option
Kernel panic...

Linux.tar.gz 05-22-2007 08:39 AM

As said before I corrected some /var/clients stuff as zipslack is contained in a "linux" folder. So i had to put root system in /var/clients/default and change some stuff eveywhere else.

Now i have this error message, using root=/dev/ram0 :

Warning: unable to open an initial console

So, according to some info i googled around i did this in the loopbacked initrd, inside dev directory :
mknod console c 5 1

And the next error message is :

/bin/sh: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory

I begin to be confused and i wonder if the howto really works. If someone can help, i'll say "yes".

Linux.tar.gz 05-22-2007 11:33 AM

I now installpkg -root /mnt/loop libtermcap-1.2.3-i486-6.tgz and generated another initrd.

And the system goes further :) with more error messages :( about missing /proc/dev/net and many missing commands in linuxrc. I came to the conclusion that the script generating the initrd from zipslack is bloated.

1st question :
Which technique is better: the script extracting from zipslack, or a installpkg -root ?

2nd question :
Is it possible and viable :
Install a minimal system on the diskless (with a disk just for this moment) and making the initrd on it.

Linux.tar.gz 05-22-2007 12:18 PM

In the linuxrc script:
Changed CHROOT=/usr/bin/chroot to CHROOT=/bin/chroot
Put the MAC address grepping stuff on the same line as commented.

Because i saw a message complaining about libblkid.so.1
installpkg -root /mnt/loop e2fsprogs-1.39-i486-1.tgz

Less error messages now.
And no idea about missing /proc/dev/net

I installed module-init-tool because modprobe was missing in the initrd. That corrected the error message from missing /proc/dev/net to missing /proc/net/dev.

There's a nfsroot.txt in the document folder in the kernel sources.

I had to recompile kernel to enable the network card driver INSIDE the kernel.
I also enabled, in the networking options section, IP kernel level autoconfiguration for dhcp and bootp.
And also the root filesystem on nfs option.

Plus added this to /etc/dhcpd.conf :
option root-path "/var/clients/default";

Linux.tar.gz 05-23-2007 11:30 AM

And...

IT WORKS !!!!!


All times are GMT -5. The time now is 12:28 AM.