Installing Slackware Linux from another GNU/Linux

abracarambar!

tested on scaleway dedibox with bionic as a rescue system

requirements from rescue mode

Start your machine in rescue mode

Eventually connect to the rescue mode DIRECTLY AS ROOT

vi ~/.ssh/known_hosts
ssh YOUR-DEDIBOX -l root -p 22

otherwise switch to root and use Online’s provided password

#sudo su -

English please

export LANG=C
export LC_ALL=C
export LC_MESSAGES=C
alias ll='ls -alhF --color=auto'
#echo 'syn off' >> ~/.vimrc

Requirements

apt update
export DEBIAN_FRONTEND=noninteractive
apt install -y wget ksh lftp man-db manpages mlocate xz-utils
apt install -y openssl # upgrades openssl and libssl1

Freaking Ubuntu — it mounts the swap space if it finds one,

swapon -s
swapoff -a

Prepare a partition e.g. for SATA 1TB

free -m
fdisk -l
fdisk /dev/sda
o
w
cfdisk /dev/sda
sda1 15G BOOTABLE FOR EXTLINUX
#sda2 8G TYPE SWAP
sda3 all remaining space for /data as GFS2 (type Linux)

ls -lF /dev/sda*
partprobe

Prepare the file-systems

mkfs.ext4 /dev/sda1
#mkswap /dev/sda2

#dd if=/dev/zero of=/dev/sdb bs=1M count=1
#pvcreate /dev/sdb

Choose a mirror

# FRANCE
#mirror=http://nephtys.lip6.fr/pub/linux/distributions/slackware/slackware64-14.2/
mirror=http://nephtys.lip6.fr/pub/linux/distributions/slackware/slackware64-current/

# RUSSIA
#mirror=https://mirror.yandex.ru/slackware/slackware64-14.2/
    mirror=https://mirror.yandex.ru/slackware/slackware64-current/
#https://mirrors.nxthost.com/slackware/slackware64-current/

# LAN
    #mirror=http://x.x.x.x/slackware142/

Prepare your rescue system (those are not available as patches/)

lftp -c "open $mirror/slackware64/a/; mget pkgtools-*.txz"
tar xJf pkgtools-*.txz -C /
rm -rf /install/

BEWARE THIS WORKS FINE ON XENIAL BUT SINCE FOCAL, /SBIN BECAME A SYMLINK

#/sbin/installpkg: 365: /sbin/installpkg: /bin/du: not found
#ln -s /usr/bin/du /bin/du
#ls -lF /bin/du

Now proceed with a Slackware Installation from the command-line

mount points

Mount the file-systems, incl. proc for LILO to run happily,

mkdir lala/
mount /dev/sda1 lala/
ls -alF lala/
mkdir lala/proc/ lala/dev lala/sys
mount -o bind /proc lala/proc
mount -o bind /dev lala/dev
mount -o bind /sys lala/sys

deploy userland

vi slackstart.conf

#mirror=http://ftp6.gwdg.de/pub/linux/slackware/slackware64-15.0/
#mirror=http://ftp.tu-chemnitz.de/pub/linux/slackware/slackware64-15.0/
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 kernel

since this is either bare-metal or a kvm guest, make sure you include a kernel in the disk image

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

finish-up

ls -lF lala/etc/fstab # no exist
cat > lala/etc/fstab <<-EOF
/dev/sda1        /                ext4        defaults         1   1
/dev/sda2        swap             swap        defaults         0   0
/dev/sda3        /data            ext4        defaults         1   2
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
EOF
mkdir lala/data/
touch lala/data/NOT_MOUNTED

Fix the timezone,

ls -lF lala/etc/localtime-copied-from lala/etc/localtime
rm -f lala/etc/localtime-copied-from

ln -s ../usr/share/zoneinfo/Europe/Moscow lala/etc/localtime
ln -s ../usr/share/zoneinfo/Europe/Paris lala/etc/localtime

Setup the boot loader,

ls -lF lala/etc/lilo.conf # no exist
sed '/^#/d; /^$/d' lala/etc/lilo.conf_example > lala/etc/lilo.conf
vi lala/etc/lilo.conf

timeout = 100
vga = 791

image = /boot/vmlinuz
        label = "Linux"
        append = "mitigations=off"
        read-only
    #vt.default_utf8=0
    #ipv6.disable=1

chroot lala/ ldconfig
chroot lala/ lilo

# LANGUAGE = (unset)
# LC_ALL = (unset),
chroot lala/ update-ca-certificates

#depmod ...

network setup

eventually proceed with a brutal network setup

vi slackstart.conf

host= 
cidr=
gw=
dns=

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

ready to go

and finally

sync
umount -R lala/
rmdir lala/

switch back to NORMAL mode and back to your workstation, restore known hosts

vi ~/.ssh/known_hosts

you can now connect remotely and proceed with post-installation

additional notes

debian/ubuntu lilo

untested

alternative way to get the boot loader ready (from the rescue system directly)

apt install lilo
vi /etc/lilo.conf

lba32
boot = /dev/sda
root = /dev/sda1
prompt
timeout = 100

#vga = normal
vga = 791

image = /boot/vmlinuz
        label = "Linux"
        read-only

resources

https://documentation.online.net/en/dedicated-server/network/dedibox-network

https://documentation.online.net/en/web/domain-name/tutorial/dns-server-management

https://wiki.archlinux.org/index.php/ext4

https://unix.stackexchange.com/questions/43102/largefile-feature-at-creating-file-system

https://serverfault.com/questions/404571/best-options-to-create-and-mount-an-ext4-volume-containing-10m-files-in-one-di

HOME | GUIDES | PLAYBOOKS | LECTURES | LAB | CONTACT | HTML | CSS
Licensed as MIT