You do not even have to modify the Slackware installer, only the bootable ISO. Isolinux has a little known feature that it can use multiple initramfs image files and combine them on the fly when booting the kernel.
I once created a modified Slackware mini ISO for a friend who needed an installer that additionally needed to contain ethtool and tcpdump. Instead of modifying the initrd.img file (which contains the Slackware installer), I created a second initramfs file.
I extracted the binaries and libraries from the Slackware packages for ethtool and tcpdump into a temporary directory (dumping binaries in ./sbin and libraries in ./lib64) like this:
Code:
/path/to/initrd64_14.1_addon/
+-- etc
| +-- libnl
| +-- classid
| +-- pktloc
+-- lib64
| +-- libnl-3.so -> libnl-3.so.200.16.1
| +-- libnl-3.so.200 -> libnl-3.so.200.16.1
| +-- libnl-3.so.200.16.1
| +-- libnl-genl-3.so -> libnl-genl-3.so.200.16.1
| +-- libnl-genl-3.so.200 -> libnl-genl-3.so.200.16.1
| +-- libnl-genl-3.so.200.16.1
| +-- libnl.a
| +-- libnl.so -> libnl.so.1
| +-- libnl.so.1 -> libnl.so.1.1.4
| +-- libnl.so.1.1.4
| +-- libpcap.a
| +-- libpcap.so -> libpcap.so.1
| +-- libpcap.so.1 -> libpcap.so.1.4.0
| +-- libpcap.so.1.4.0
+-- sbin
+-- ethtool
+-- mii-tool
+-- tcpdump -> tcpdump.4.4.0
+-- tcpdump.4.4.0
I then packed that directory tree into a new initramfs file using my
initramfs generator script, like this:
Code:
# cd /usr/local/bin
# wget http://www.slackware.com/~alien/tools/extract_initramfs.sh
# ln -s extract_initramfs.sh create_initramfs.sh
# create_initramfs.sh /tmp/addons.img /path/to/initrd64_14.1_addon/
Then I modified my
standard mini ISO image as follows:
Loop-mount the ISO image and modify the isolinux configuration to take the addons.img into account:
Code:
#mkdir -p /mnt/iso
# mount -o loop slackware_x86_64-14.1-mini-install.iso /mnt/iso/
# mkdir ~/workdir
# cp -a /mnt/iso/* ~/workdir/
# cp -a tmp/addons.img ~/workdir/isolinux
# sed -i 's/initrd.img/&,addons.img/' ~/workdir/isolinux/isolinux.cfg
Which lets isolinux do its magic of combining two separate initramfs images into one filesystem for the kernel to boot with, thus making the addons part of the installer transparently.
Finally a new ISO needs to be created from that workdir, something like this:
Code:
# cd ~/workdir
# mkisofs -o ~/slackware-mini-install.iso \
-R -J -V "Slackware Mini Install" \
-hide-rr-moved -hide-joliet-trans-tbl \
-v -d -N -no-emul-boot -boot-load-size 4 -boot-info-table \
-b isolinux/isolinux.bin \
-c isolinux/isolinux.boot \
-sort isolinux/iso.sort \
-publisher "The Slackware Linux Project - http://www.slackware.com/" \
-A "Slackware-14.1 for x86_64 Mini Install CD - build $(date +Y%m%d)" \
.
After which you can collect the modified ISO in your homedirectory.
If you are using PXE boot then you do not even have to create new ISO images of course, just dump the addons.img file in the pxeboot directory and update the configuration file.
h
Edit: I should write a Wiki page for this.