View previous topic :: View next topic |
Author |
Message |
Vieri l33t
Joined: 18 Dec 2005 Posts: 882
|
Posted: Thu May 22, 2014 9:23 am Post subject: boot Gentoo minimal install image with PXE instead of CD |
|
|
Hi,
Is there a quick guide to booting Gentoo's official install image via PXE instead of a live CD? (hopefully without needing to mount it and modify it)
What is this for? http://distfiles.gentoo.org/releases/snapshots/current/squashfs/
Is it only for the portage tree?
Thanks |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3137
|
Posted: Thu May 22, 2014 10:01 am Post subject: |
|
|
you can boot gentoo with pxe, you need root in a squashfs, initramfs and kernel with builtin ethernet driver. I know genkernel has a command line option to make it put all modules in ramdisk, but when i trired this way, kernel didn't see network devices. Maybe something has changed after removing netifrc from openrc though.
My bootloader config located in $TFTP_ROOT/pxelinux.cfg/default goes like this
Code: | DEFAULT vesamenu.c32
TIMEOUT 300
PROMPT 0
MENU TITLE Select boot mode
LABEL Gentoo
MENU LABEL Gentoo Live on PXE
LINUX <path from tftp_root to kernel>
APPEND ip=dhcp root=/dev/ram0 cdroot=1 real_root=/dev/nfs nfsroot=<server ip>:/<nfs share containing squashed root image> initrd=<path from tftp_root to initramfs> loop=<root image filename.sqfs> looptype=squashfs |
If you don't want or can't use vesamenu, you can remove it from config, you won't be able to have your pick among several entries there anymore, but the default one will boot fine.
I couln't make it with grub, never managed to provide it with config file over network.
Also, you need options "next-server <tftp server IP>" and "filename <path to pxelinux.0>" in your dhcp server config file to let client know where to boot from.
Considering those files you linked are supposed to be gentoo releases, they should work just fine. Just make sure you really have network drivers compiled into kernel and not as modules, I suppose you can handle setting up your server. |
|
Back to top |
|
|
Vieri l33t
Joined: 18 Dec 2005 Posts: 882
|
Posted: Thu May 22, 2014 11:05 am Post subject: |
|
|
Here's my syslinux menu entry:
Code: |
LABEL gentooinstall
MENU LABEL Official Gentoo install
KERNEL gentoo/isolinux/gentoo
APPEND ip=dhcp root=/dev/ram0 cdroot=1 real_root=/dev/nfs nfsroot=10.215.144.7:/diskless/pxe/syslinux/gentoo/ dokeymap doscsi loop=image.squashfs looptype=squashfs
INITRD gentoo/isolinux/gentoo.igz
# exportfs
/diskless/pxe/syslinux/gentoo
10.215.0.0/255.255.0.0
|
From another client I can manually mount the share:
Code: |
# mount -t nfs 10.215.144.7:/diskless/pxe/syslinux/gentoo/ /mnt/gentoo -o ro,nolock,rsize=1024,wsize=1024
# ls /mnt/gentoo/
README.txt gentoo.efimg image.squashfs livecd
[BOOT] gentoo.efimg.mountPoint isolinux
|
However, when I PXE boot and right after setting the keymap, NFS mounting fails:
Code: |
>> Attempting to mount NFS CD image on 10.215.144.7:/diskless/pxe/syslinux/gentoo/ with options ro,nolock,rsize=1024,wsize=1024
mount: mounting 10.215.144.7:/diskless/pxe/syslinux/gentoo/ on /mnt/cdrom failed: Input/output error
|
Odd... |
|
Back to top |
|
|
Vieri l33t
Joined: 18 Dec 2005 Posts: 882
|
Posted: Thu May 22, 2014 11:46 am Post subject: |
|
|
OK, I found out what's wrong. Gentoo's minmal install CD kernel does not support my network card.
NFS mounting fails because it has no network access.
ifconfig -a shows nothing except for the loopback device.
Bad luck... |
|
Back to top |
|
|
Vieri l33t
Joined: 18 Dec 2005 Posts: 882
|
Posted: Thu May 22, 2014 12:11 pm Post subject: |
|
|
Is there an "easy" (as in "quick") way of adding a network module to initramfs or is there a Gentoo initramfs I can download that's bloated with all known kernel modules (I don't mind the extra size)?
Here's an alternative for the lazy people like myself:
In the syslinux PXE menu, use System Rescue CD's kernel and initramfs instead of Gentoo's.
eg.:
Code: |
LABEL gentooinstall
MENU LABEL Gentoo install (with System Rescue CD)
KERNEL systemrescuecd/isolinux/rescue32
APPEND ip=dhcp root=/dev/ram0 cdroot=1 real_root=/dev/nfs nfsboot=10.215.144.7:/diskless/pxe/syslinux/gentoo/ dokeymap doscsi loop=image.squashfs looptype=squashfs
INITRD systemrescuecd/isolinux/initram.igz
|
(some options passed are probably useless or nonsense but I haven't really dwelt on that yet - such as "loop=")
Then in your gentoo tftp directory (10.215.144.7:/diskless/pxe/syslinux/gentoo/ in this case) do:
Code: |
# cp image.squashfs sysrcd.dat
# md5sum sysrcd.dat > sysrcd.md5
|
You should now be able to boot this grafted Gentoo/SysResCD system.
It would be better though if Gentoo could publish a less-minimal install cd with all known modules (at least network modules). |
|
Back to top |
|
|
Vieri l33t
Joined: 18 Dec 2005 Posts: 882
|
Posted: Thu May 22, 2014 12:41 pm Post subject: |
|
|
My network card uses sky2 in system rescue cd and I believe it's quite common among network drivers. It sounds odd to me that it's not included in Gentoo's initramfs.
In fact Gentoo's /lib/modules/3.2.13-gentoo/kernel/drivers/net/ethernet directory only contains broadcom and intel modules.
Too slim for a pxe boot. |
|
Back to top |
|
|
|