Slackstart - Automated Slackware Installation

Introduction

We’re here installing tag ADD from A AP sets, a few packages from N and additional packages to make slackpkg work. We end-up with a system of 651MB on disk and using only around 47MB of RAM when ilding.

Prepare the RAMDISK

unpack the official installer

mkdir -p /tftpboot/ss/lala/
cd /tftpboot/ss/lala/
gzip -dc /tftpboot/slackware142/isolinux/initrd.img | cpio -id -H newc --no-absolute-filenames
ls -lF
wget http://pub.nethence.com/bin/slack/slackstart.bash.txt
wget http://pub.nethence.com/bin/slack/slackinst.bash.txt
cp slackstart.bash.txt slackstart.bash
cp slackinst.bash.txt slackinst.bash
chmod +x slackstart.bash slackinst.bash

define a local mirror and SSH public keys (variables are multi-line capable)

vi slackstart.bash

mirror=...
pubkeys="..."

vi slackinst.bash

mirror=...

check

diff -bu slackinst.bash.txt slackinst.bash
diff -bu slackstart.bash.txt slackstart.bash

warn about the shit

vi /tftpboot/ss/lala/etc/rc.d/rc.S

#echo -n "slackware login: "
#read BOGUS_LOGIN
#cat /etc/motd
echo | network
sleep 1
dhcpcd
sleep 2
ping -W1 -c1 opendns.com >/dev/null && echo network SUCCESS || echo network FAILURE
cat <<-EOF

now if you really wanna destroy /dev/sda

    ./slackstart.bash HOSTNAME

EOF

Package it up

package it back

cd /tftpboot/ss/lala/
find . -print | cpio -o -H newc | gzip -9 > ../slackstart.img

and eventually add a PXE entry for it

vi /tftpboot/pxelinux.cfg/default 

label slackware142 slackstart
    kernel slackware142/kernels/huge.s/bzImage
    append initrd=ss/slackstart.img mitigations=off vga=791

once the system is installed you can login as root w/o a password and get an IP through DHCP or use netconfig (SSH public keys are already in place if defined above)

Resources

Slackware automated or unattended installation https://www.linuxquestions.org/questions/slackware-14/slackware-automated-or-unattended-installation-4175547736/

Slackware install optimization https://flaterco.com/kb/slackware.html

Slackware initrd mini HOWTO https://ftp.riken.jp/Linux/slackware/slackware-current/README.initrd


Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml