diff options
author | Eric Hameleers <alien@slackware.com> | 2016-04-13 00:34:31 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2016-04-13 00:34:31 +0200 |
commit | 6dfb4058af8a59c17aeeb80b567ce521f6ace59b (patch) | |
tree | 868744a63ca8b7e03b218d060ae18c889fde5053 /make_slackware_live.sh | |
parent | 801f1f62b09c68a42c078b3a619539456b160f45 (diff) | |
download | liveslak-6dfb4058af8a59c17aeeb80b567ce521f6ace59b.tar.gz liveslak-6dfb4058af8a59c17aeeb80b567ce521f6ace59b.tar.xz |
Add NFS root support.
It is now possible to PXE-boot the Slackware Live Edition.
Extract the content of the ISO to (for instance) a new directory
called 'slackware-live' below your TFTP server's /tftproot directory
and then add lines like this to your pxelinux.cfg/default file:
label liveslak
kernel slackware-live/boot/generic
append initrd=slackware-live/boot/initrd.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 kbd=us tz=Europe/Amsterdam locale=us_EN.utf8 nfsroot=192.168.0.1:/tftpboot/slackware-live hostname=pxelive
Two new boot parameters have been added to support a NFS root:
* nfsroot => mandatory parameter defines the IP address of the NFS server
and the path to the extracted content of Slackware Live Edition.
* nic => parameter defining the driver for the network card (optional
and usually not needed because UDEV will figure out the driver for you),
the interface name (optional),
the IP configuration method (static IP or DHCP),
and in case of a static IP, the required parameters ipaddress, netmask
and an optional gateway.
Note that the 'nic' parameter is optional if you have a DHCP server in
your LAN: Slackware Live will figure out what the interface name is.
Syntax of these parameters:
nfsroot=ip.ad.dr.ess:/path/to/liveslak
nic=<driver>:<interface>:<dhcp|static>[:ipaddr:netmask[:gateway]]
Example use of these parameters:
nfsroot=192.168.1.1:/tftproot/slackware-live
nic=auto:eth0:static:10.0.0.21:24:
nic=:eth1:static:192.168.1.6:255.255.255.248:192.168.1.1
Diffstat (limited to 'make_slackware_live.sh')
-rwxr-xr-x | make_slackware_live.sh | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh index f3f82d7..6fe3b34 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -36,7 +36,7 @@ # ----------------------------------------------------------------------------- # Version of the Live OS generator: -VERSION="0.7.2" +VERSION="0.7.3" # Directory where our live tools are stored: LIVE_TOOLDIR=${LIVE_TOOLDIR:-"$(cd $(dirname $0); pwd)"} @@ -65,6 +65,9 @@ BOOTLOADSIZE=${BOOTLOADSIZE:-4} # Therefore we disable 32bit EFI by default. Enable at your own peril: EFI32=${EFI32:-"NO"} +# Include support for NFS root (PXE boot), will increase size of the initrd: +NFSROOTSUP=${NFSROOTSUP:-"YES"} + # Timestamp: THEDATE=$(date +%Y%m%d) @@ -163,6 +166,15 @@ SEQ_CIN="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap,xfce,y pkglist:slackextra,cinnamon # Lots of HID modules added to support keyboard input for LUKS password entry: KMODS=${KMODS:-"squashfs:overlay:loop:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:usb-storage:hid:usbhid:hid-generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:jbd:mbcache:ext3:ext4:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat"} +# Firmware for wired network cards required for NFS root support: +NETFIRMWARE="3com acenic adaptec bnx tigon e100 sun kaweth tr_smctr cxgb3" + +# Network kernel modules to include for NFS root support: +NETMODS="kernel/drivers/net" + +# Network kernel modules to exclude from above list: +NETEXCL="appletalk arcnet bonding can dummy.ko hamradio hippi ifb.ko irda macvlan.ko macvtap.ko pcmcia sb1000.ko team tokenring tun.ko usb veth.ko wan wimax wireless xen-netback.ko" + # # --------------------------------------------------------------------------- # @@ -1558,6 +1570,29 @@ cat $LIVE_TOOLDIR/liveinit | sed \ cat /dev/null > ${LIVE_ROOTDIR}/boot/initrd-tree/luksdev # We do not add openobex to the initrd and don't want to see irrelevant errors: rm ${LIVE_ROOTDIR}/boot/initrd-tree/lib/udev/rules.d/*openobex*rules 2>${DBGOUT} || true +if [ "$NFSROOTSUP" = "YES" ]; then + # Add dhcpcd for NFS root support: + DHCPD_PKG=$(find ${DEF_SL_PKGROOT}/../ -name "dhcpcd-*.t?z" |head -1) + tar -C ${LIVE_ROOTDIR}/boot/initrd-tree/ -xf ${DHCPD_PKG} \ + var/lib/dhcpcd lib/dhcpcd sbin/dhcpcd usr/lib${DIRSUFFIX}/dhcpcd \ + etc/dhcpcd.conf.new + mv ${LIVE_ROOTDIR}/boot/initrd-tree/etc/dhcpcd.conf{.new,} + # Add just the right kernel network modules by pruning unneeded stuff: + KMODS_PKG=$(find ${DEF_SL_PKGROOT}/../ -name "kernel-modules-*$(echo $KVER |tr - _)*.t?z" |head -1) + tar -C ${LIVE_ROOTDIR}/boot/initrd-tree/ -xf ${KMODS_PKG} \ + lib/modules/${KVER}/${NETMODS} + for KNETRM in ${NETEXCL} ; do + find ${LIVE_ROOTDIR}/boot/initrd-tree/lib/modules/${KVER}/${NETMODS} \ + -name $KNETRM -depth -exec rm -rf {} \; + done + # We added extra modules to the initrd, so we run depmod again: + chroot ${LIVE_ROOTDIR}/boot/initrd-tree /sbin/depmod $KVER + # Add the firmware for network cards that need them: + KFW_PKG=$(find ${DEF_SL_PKGROOT}/../ -name "kernel-firmware-*.t?z" |head -1) + tar tf ${KFW_PKG} |grep -E "($(echo $NETFIRMWARE |tr ' ' '|'))" \ + |xargs tar -C ${LIVE_ROOTDIR}/boot/initrd-tree/ -xf ${KFW_PKG} \ + 2>/dev/null || true +fi # Wrap up the initrd.img again: chroot ${LIVE_ROOTDIR} /sbin/mkinitrd 1>/dev/null 2>${DBGOUT} rm -rf ${LIVE_ROOTDIR}/boot/initrd-tree |