bootstrapping slackware on a memstick

also see bootstrapping slackware on xen and on kvm

descr

this is similar to the slackware KVM guest guide as it requires not only userland but also a kernel

it is also very similar to the hbamode hack for releasing the smart array lock

what’s specific here is that we point to a flash reader e.g.

device=/dev/sdb

and we are operating there

cd /mnt/

skeleton

cd /mnt/
mkdir lala/

(install pkgtools)

fdisk -l

create an empty DOS partition table

fdisk $device

o
w

create root and swap partitions

cfdisk $device

25GB or whatever fits   /           bootable
(whatever is left)      swap

ready to go

mkfs.ext4 ${device}1
mkswap ${device}2

in case you’re using a recent system (here ubuntu 25), you might need to downgrade the target filesystem, as e2fsck version is older on slackware

# memstick - /dev/sdbX
tune2fs -l ${device}1
tune2fs -O ^orphan_file ${device}1

# kvm - /dev/nbd0pX
tune2fs -l ${device}p1
tune2fs -O ^orphan_file ${device}p1

you might also want to hardcode a precise disk identifier in view to define PARTUUID

e.g. for node 99

fdisk $device
x
i
0xf9a43099
r
w

blkid ${device}1
blkid ${device}p1

==> check PARTUUID

and finally mount the thing

mount ${device}1 lala/

slackstart init

grab the scripts and sample conf file

wget https://pub.nethence.com/bin/slackstart/slackdisk.bash
wget https://pub.nethence.com/bin/slackstart/slacknet.bash
wget https://pub.nethence.com/bin/slackstart/slackprep.bash
wget https://pub.nethence.com/bin/slackstart/slackstart.conf.sample
wget https://pub.nethence.com/bin/slackstart/slackstrap.bash
chmod +x slack*bash

deploy slackware userland

vi slackstart.conf

mirror=http://mirror.rol.ru/slackware/slackware64-15.0/

and proceed

# https://pub.nethence.com/bin/slackstart/slackstrap.bash
time ./slackstrap.bash lala

if this is a REISER4 file-system, let the guest eventually fsck itself at boot time

    wget https://lab.nethence.com/slackpkgs/libaal-1.0.7-x86_64-2_SBo.tgz
    wget https://lab.nethence.com/slackpkgs/reiser4progs-1.2.2-x86_64-2_SBo.tgz

    ls -lF /root/slackpkgs/libaal-*_SBo.tgz
    ls -lF /root/slackpkgs/reiser4progs-*_SBo.tgz

    installpkg --terse --root lala/ /root/slackpkgs/libaal-*_SBo.tgz
    installpkg --terse --root lala/ /root/slackpkgs/reiser4progs-*_SBo.tgz

deploy custom linux kernel

you need a custom kernel in there and not necessarily the stock one

# todo - tweak that script to avoid installing the stock kernel
time ./slackstrap.bash lala kernel

here’s a few custom ones:

post-install

timezone, mount points and console

slackstrap is not enough for syslinux to be happy (probably fstab is required) – so the syslinux part comes within that script

vi slackstart.conf

tz=Europe/Moscow

fs=ext4

# kvm (don't worry it will find /dev/nbd0 by itself)
boot_partition=/dev/vda1
swap_partition=/dev/vda2

boot_uuid=f9a43099-01
swap_uuid=f9a43099-02

serial=ttyS0

swap=1

boot=syslinux

proceed

# https://pub.nethence.com/bin/slackstart/slackprep.bash
./slackprep.bash lala

eventually update the package repository cache

mv -i lala/etc/slackpkg/mirrors lala/etc/slackpkg/mirrors.dist

source slackstart.conf
echo $mirror
echo $mirror > lala/etc/slackpkg/mirrors

mount -o bind /dev lala/dev
mount -o bind /dev/pts lala/dev/pts
mount -o bind /proc lala/proc
mount -o bind /sys lala/sys
chroot lala/ bash

ping -c1 1.1.1.1
vi lala/etc/resolv.conf

...

ping -c1 opendns.com
slackpkg update gpg
slackpkg update
history -c
^D

rm -f lala/root/.bash_history

network setup

eventually proceed with a brutal network setup

vi slackstart.conf

host=slack150
cidr=192.168.122.99/24
gw=192.168.122.1
dns=192.168.122.1

# https://pub.nethence.com/bin/slackstart/slacknet.bash
./slacknet.bash lala

ready to go

du -sh lala/
cat lala/boot/syslinux/syslinux.cfg
cat lala/etc/fstab
sync
umount lala/
rmdir lala/
HOME | GUIDES | PLAYBOOKS | LECTURES | LAB | CONTACT | HTML | CSS
Licensed as MIT