28-mar-2016: Welcome to our new server! Faster and less prone to crashing.
Add this page to your book
Remove this page from your book
Table of Contents
Slackware installation using a serial terminal on an embedded system
I'll describe here what steps are required to install Slackware to a machine, using a serial terminal. The boot medium used here is a usb-key, but I think that these steps could be customized for booting from a CD-ROM (or PXE). I installed to a PC Engines APU (http://www.pcengines.ch/apu.htm), but most of these steps should be compatible for other systems. I've noted things special for this machine.
- Machine with a serial port you want to install to
- Machine with a serial port you use to install the other machine
- A cable betweeen them ;)
- usbboot.img from slackware(64)?-$version/usb-and-pxe-installers/
Preparation of the boot image
To install using a serial line, syslinux on the boot image must be configured to use the serial line for the menu itself and also append the right parameters to the booted kernel. To do this, mount the usbboot.img somewhere like this:
# mount -o loop usbboot.img /mnt/tmp
Now that the image is mounted, you can change the
syslinux.cfg found in
as a first line:
serial 0 115200
This enables the serial line for syslinux with 115200 bauds (parity and stopbit are hardcoded to n8). While the bootloader is now using the serial, the kernel still doesn't. Add
To the append-line of the first kernel image (huge.s).
When you are done with the changes, you can unmount the image as usual. Like recommended by Eric install the syslinux bootloader to the image:
$ syslinux -s usbboot.img
The image is ready now to be dd'd onto a usb-key:
# dd if=usbboot.img of=/dev/myusbkey
Connect the serial ports of your two machines with a null-modem cable, and run
minicom -D /dev/ttyS0 -b 115200
on the machine you will use as your terminal. Now boot the machine you are installing Slackware to from the usb-key. You should see the usual booting on the terminal screen including the key map selection. After you have logged in as root, partition your disks as you would normally do.
/dev/disk/by-label, it makes stuff a lot easier later e.g:
# mke2fs -L root /dev/sdb1
Don't let the Slackware installer format them then of course.
Before you run setup run this command to get a nicer looking output from dialog:
The rest of the installation should work as usual (“special” keys like page up don't seem to work correctly though..). But instead of rebooting after the installation has finished, we need to set the installed system to also use the serial line. Chroot into the installation:
# chroot /mnt
Now edit your
/etc/lilo.conf and insert a line
right at the top. The global append line needs the addition like the one
used for the
to let it come up before the init system tries to mount it.
The device order on the APU is likely to change. So you should
/dev/disk/by-uuid paths for your
root partition statements
Furthermore you'll have to generate an initrd so that the device drivers for the card reader are
avaiable at boot time. Here also use a
/dev/disk/by-uuid path cause of the
changing device order.
If you want to reinstall lilo after the installation, you probably also have to change the
Save the lilo configuration and reinstall lilo. But don't reboot now, one more step before we are finished!
Uncomment the line enabling serial login in your inittab and change the speed to 115200:
[...] # Local serial lines: s1:12345:respawn:/sbin/agetty -L ttyS0 115200 vt100 [...]
/dev/securettyor you will not be able to login as root from the serial line!
This should be all. Exit the chroot and reboot your system!