Install Slackware ARM Linux On The Raspberry Pi
Notes for Pre-installation
In this guide we will be installing Slackware ARM 14.1 Linux on a Raspberry Pi. The version you've selected might not be the same but the procedure is very similar during all Slackware ARM installs, with few changes. The hostname 'slackware' is given to your Slackware ARM Linux system on the Raspberry Pi during the installation process.
We are using a Raspberry Pi model B 512MB (Samsung RAM), an 8Gb SD card (Kingston SD10G2/8GB), and a 16GB USB memory stick. Your own storage devices may be different so bear that in mind throughout this guide.
If you have a model B+ then you'll be using a microSD card but, as far as this guide is concerned, there's no difference. Just treat SD/microSD cards as the same thing.
Installing without a screen/monitor
In the event that you do not have a screen/monitor/tv to connect to your Raspberry Pi, it's possible to boot the Slackware ARM installer with networking enabled and a specified keyboard layout (locale) in order to login and perform the installation remotely (i.e. from another computer). It's just a matter of editing the 'cmdline.txt' file on the boot partition of the SD card before you boot with it (see this example) and connecting your Raspberry Pi to your network via an Ethernet cable. So, if you wanted to perform a remote installation and you have an American (US) keyboard layout, you would insert the following code into the existing code within the cmdline.txt file:
Alternatively, if your network does not have DHCP enabled you should specify an IP address and netmask. In this example the IP address is 192.168.10.100 and the netmask is 255.255.255.0 (a netmask of 24 bits):
Of course, you should specify your own IP address, netmask, and keyboard layout here. See this keymaps list for supported keyboard layouts and select one which suits your own keyboard configuration (e.g. kbd=es , kbd=fr , kbd=de , kbd=it , kbd=ru , etc.). So, when you boot the Slackware ARM installer on the Raspberry Pi you will not be required to enter a keyboard map and networking will already be configured. You can simply login remotely via SSH as 'root' user and just hit the enter key when asked for a password. If you're installing Slackware ARM remotely then some parts of this guide may not apply to you, so you'll have to work around those areas. ;)
To boot the Slackware ARM installer normally just leave the cmdline.txt file unmodified.
Powering on your Raspberry Pi...
If you haven't done so yet, now is the time to plug everything in and power-on your Raspberry Pi!
• Insert the SD card you've just configured into the slot on the underside of the Raspberry Pi.
• Connect the USB keyboard to one of the USB ports.
• Insert the USB memory stick into the other USB port (if you are using one for your source media).
• Plug in the relevant HDMI/RCA video cable.
• Attach the Ethernet cable to the Ethernet port on the Raspberry Pi - plug the other end of the cable into your Internet router/hub/switch.
• Turn on your screen/monitor.
• Connect the Micro USB power cable to the Raspberry Pi...
The red PWR (power) LED will illuminate. The green ACT (activity) LED starts to flash intermittently while the rainbow start image appears briefly on your screen, followed by the scrolling loader text. This tells you it's booting normally.
If the green ACT LED flashes a few times in quick succession and then pauses, then repeats this cycle forever, you have a misconfigured SD card and will have to go through the process of configuring it again. If there is no ACT LED activity at all, make sure your SD card is correctly inserted and also power off/on the Raspberry Pi again because it may simply be a glitch. If the problem persists try using a different SD card, or reconfigure the same card again. In testing we found that the Raspberry Pi with the "M" on the CPU often hangs on boot before, or on, the rainbow screen. Powering it off/on usually solves the problem, eventually. Copying the latest firmware to your /boot partition is reported to resolve the most recent "not booting" issues.
NB: On the Raspberry Pi model B+ only the ACT (activity) and PWR (power) LEDs are featured on the board itself, and they have been relocated next to the GPIO. The FDX/LNK/100 (Ethernet) LEDs have been moved and incorporated into the Ethernet port. If the supplied voltage drops below 4.7v the PWR (power) LED will turn off. This can be overcome by using shorter and thicker power cables - the thinner cables can sometimes act as resistors, which lowers the voltage carried within them.
If all else fails and your Raspberry Pi is still refusing to boot, there's a HOW TO: work around the problem by borrowing some stuff from Raspbian guide by Stuart Winter which you may wish to look into.
If all went according to plan, you will see the Raspberry Pi logo at the top of the screen with text scrolling down underneath it. When you see a message about setting up your keyboard you're ready to begin installing Slackware ARM Linux. :)
Install Slackware ARM Linux
After successfully booting your Raspberry Pi with the pre-configured SD card inserted, the first thing you will be presented with in the Slackware ARM installer is a choice of keyboard map which looks something similar to the following:
You can select a keyboard map by typing '1' and pressing the enter key, following the directions given. Then you will see this next screen:
You should type 'root' as the login and press the enter key.
Now you'll see the next screen and this is where you'll start to configure your system and install Slackware ARM Linux.
Setting the system date & time
IMPORTANT! : Before you do anything else, you need to set the correct time and date on the Linux system. This is done with the 'date' command using the following format:
The month (MM), day (DD), hour (HH), and minute (mm) values are always specified in 2 digits and have a leading zero '0' when applicable. The time is always specified as the 24 hour clock. The year (YYYY) is always specified with 4 digits.
Example: if the time is 8:50am on 05 December 2013 then the command would be as follows:
Configuring the NIC for Slackware ARM installation [optional]
You will require access to the network or the Internet (for example: if you wish to perform a remote installation from another computer, or you don't have a USB stick and wish to use a FTP/HTTP server as your source media) so you may want to setup the network interface card at this point. If not, you can safely skip this procedure and continue from the 'Information on available drives' section.
Before you can start configuring your NIC, you're going to need 2 pieces of information. • The IP address of your internet gateway • The IP address you want to assign to your Raspberry Pi
Assuming you have the correct network information required to setup your NIC, you are now going to type the following command:
ifconfig is a command line tool used to configure a network interface in Linux. eth0 (that's a ZERO on the end and not an "O" as in Orange) is the identity of the Ethernet interface on the Raspberry Pi. <Raspberry Pi IP address> is the IP address you want to assign to your Raspberry Pi. netmask 255.255.255.0 denotes the network mask which decides the potential size of your network. up is the flag which enables the Ethernet card and makes it ready to send and receive data.
Next you need to specify the default gateway IP address and you're going to set this up by typing the following command:
Next you need to add a Domain Name Server (DNS) which is for managing the names of Web sites. DNS technology allows you to use names (like fatdog.eu or slackware.com) and your computer automatically finds that address on the Internet and takes you to the Web site/page/file. Without DNS you would only be able to access Web sites by their IP address and that is something which we're not going to cover here.
You're going to create a file called resolv.conf and edit it by adding a single line of text. This will be done in one easy command using 'echo' and specifying an OpenDNS IP address. Type the following on the command line:
Now you should be able to access the Internet and you can test this by typing: ping -c 3 google.com
You should see 3 results of something like "64 bytes from lhr08s03-in-f4.1e100.net (126.96.36.199)". If you receive a timeout error then something is wrong and you need to check your settings (IP addresses) and go back to the ifconfig section and do it again. If all is good and you have a ping reply from google.com then your NIC and Internet connection have been setup successfully.
Remote Slackware setup, configuration & install [optional]
Now that you have successfully setup your NIC it is possible to carry on with the setup, configuration and installation of Slackware Arm Linux remotely, using putty for example, or any other SSH client.
In order to start a SSH server on your Raspberry Pi which allows you to login remotely all you have to do is start dropbear, a script already included in the Slackware ARM installer files. To do this type the following at the command prompt:
You are now able to log-in on your Raspberry Pi using 'root' as your username and just hit enter when asked for a password. If you're not already familiar with remotely logging in via SSH then it's probably not something you want to get into at this point.
Information on available drives
Now you're going to need some information about your Linux system and the available drives. The easiest way to do this is with the 'fdisk -l' command, like this:
The top part of the output is '/dev/mmcblk0' and this is our SD card. Notice that '/dev/mmcblk0p1' is the FAT32 partition where our boot files are located. The bottom part, '/dev/sda1' is the USB memory stick containing our Slackware ARM operating system files. In this example, our 16Gb USB memory stick containing the Slackware ARM 14.1 source is /dev/sda. On your own system it may be different (i.e. /dev/sdb).
Make a note of these settings:
• boot partition = /dev/mmcblk0p1
• Slackware ARM source = /dev/sda1 (or /dev/sdb1)
The cfdisk partition manager
Now you need to setup the required partitions on your SD card. You will do this using 'cfdisk' which is a command line partition manager in Linux. Remember your SD card is '/dev/mmcblk0' and this is the drive we tell cfdisk to use. So, go ahead and type the command:
On your SD card you will see a vfat (FAT32) partition already present in the 'cfdisk /dev/mmcblk0' user interface.
The vfat (FAT32) partition 'mmcblk0p1' is fine as it is. You're going to use that as your boot partition but you're also going to need additional partitions in order to house your Linux system. So, at this point you should create a swap partition and a root partition.
Create a swap partition like this:
• Move the highlight down to the Free Space, using the cursor keys on your keyboard.
• select [ New ] at the bottom, and then press the enter key.
• Select [ Primary ] and press the enter key.
• When asked to specify 'Size (in MB):' specify 512 and press the enter key. You can enter your own size if you prefer.
• Select [ Beginning ] and press the enter key.
Your new partition has been created. Now you need to tell cfdisk that this partition is going to be used as a swap file. At the bottom of the screen move the highlight to [ Type ] and press enter. At this point, make sure that the 512Mb partiton is the one still highlighted.
Press the enter key one more time and you will see the next screen below. You need to make sure '82' is specified as the filesystem type before pressing enter to save/close back to the cfdisk partition management screen.
This should have set the FS Type to Linux swap and if you can see that then all is good.
Now you need to create the root partition and we do it in much the same way as before:
• Move the highlight down to the Free Space
• select [ New ] at the bottom, and then press the enter key.
• Select [ Primary ] and press the enter key.
• When asked to specify 'Size (in MB):' just press the enter key to use the remaining free space.
So, if your screen is looking similar to the one above (given that you may have used a different size SD card) then the last thing you need to do is check that the boot partiton is 'bootable'. This is easier done than said by moving the highlight up to 'mmcblk0p1' (the vfat partition) and selecting [ Bootable ] at the bottom, then press the enter key.
As you can see above, the Boot flag has now been given to 'mmcblk0p1'. Make sure this boot flag is set as seen in our example (on Slackware ARM versions other than 14.1 this boot flag uses an '*' asterisk when it's set instead of the word 'Boot'). You should have a vfat boot partition, a 512Mb swap partition (if that's the size you selected), and the rest of your SD card for your root partition. On our system we have over 7Gb allocated on our root partition and this is adequate space on which to install Slackware ARM. Although, anything smaller and you might not complete the full install as it requires just over 6.5Gb of space.
So now you must write the new partition table to disk by selecting [ Write ] at the bottom and type 'yes' when asked to save the changes and press the enter key. Next, select [ Quit ] (or type 'Q') and exit the cfdisk partition manager.
Mount your USB memory stick
In order to read files from your USB memory stick it has to be mounted on the system. This process allocates a directory to the USB storage device so it can be accessed like any other drive or directory on a Linux system.
Those who are using a FTP/HTTP server as their source media don't have to mount a USB stick, obviously. ;)
Remember '/dev/sda1' is the partition where the Slackware ARM files are located on our USB memory stick. This is the partition we will need to mount in order to get access to those files. Note that /dev/sda1 is the designation of our USB memory stick, yours may be different. You should mount this partition in the existing '/floppy' directory by typing the following command:
root@slackware:~# ls /floppy
If you copied the Slackware ARM files onto the root of your USB storage device, you should get a list of files similar to the screenshot below. Otherwise you should see the name of the directory where you copied the files available in the /floppy directory now.
Running Slackware ARM setup
Type 'setup' at the command prompt.
This is the main setup interface you will use. Use the cursor keys to navigate in the menus.
Select 'ADDSWAP' and press enter.
The only partition which should be listed is '/dev/mmcblk0p2' and you can just press enter to accept this setting. Select < No > when asked to check swap partition for bad blocks. You will receive the following confirmation screen where you can just press the enter key:
You're now going to be asked which partition you want to use for your root. There should be only one partition listed - '/dev/mmcblk0p3' - so just select it by pressing the enter key.
On the next screen, select 'Quick format with no bad block checking' and press the enter key.
You want to format this partition 'ext4' so select it in the list and press the enter key.
Your partition is now being formatted.
Once formatting has completed:
Press the enter key to accept and write the new setting in your fstab.
On the Raspberry Pi, there's no RTC (real time clock) which causes fsck checks on the system at boot time. This can be annoying because it always happens as there's no RTC. It's recommended to turn off fsck checks. You have the opportunity to do so on this next screen.
Now you will see this next screen which tells you there are FAT or NTFS partitions found on your system.
Select < Yes > and proceed to the next screen:
With '/dev/mmcblk0p1' highlighted at the top and < Select > at the bottom, press the enter key.
Select 'Root has read/write access, users have no access' and press the enter key.
The next screen asks you where the partition is to be mounted. You want it mounted as your boot partition.
Type /boot in the text box and press the enter key. When this screen refreshes, select < Continue > and do not add any more FAT or NTFS partitions.
Slackware ARM source media - Install from USB stick
This next section is about telling the installer where the Slackware ARM source is located.
The easiest option here is to 'Install from a Slackware USB stick". Your USB memory stick is already plugged in, so just move the highlighter to option 2 and press the enter key.
Just press enter on the next screen to begin... and your USB memory stick should be detected. If this fails, try the 'Install from pre-mounted directory' method.
If your USB memory stick containing the Slackware ARM source was detected ok, you can now skip to Slackware ARM package selection.
Slackware ARM source media - Install from pre-mounted directory
If you mounted your USB stick earlier and made a note that they are on /dev/sda1, you'll remember you mounted that partition to the /floppy directory. So, all you have to do is tell the system it's in a pre-mounted directory.
Select the bottom option 'from a pre-mounted directory' and press the enter key.
In the text box type '/floppy/slackware' and press the enter key.
Slackware ARM source media - Install from FTP/HTTP server
It's also possible to install Slackware ARM from a FTP/HTTP server. This might be preferable for those who do not have a USB stick handy, or one of a large enough capacity on which to store the Slackware ARM source. This next section will show you how to achieve it.
Select the 'Install from FTP/HTTP server' option and press the enter key.
Enter the URL of your chosen FTP/HTTP server. We have selected 'ftp://ftp.arm.slackware.com/' as our server in the example below.
Now enter the source directory. We have specified 'slackwarearm/slackwarearm-14.1/slackware' because we're installing Slackware ARM 14.1 on our Raspberry Pi. You could just as effectively specify 'slackwarearm/slackwarearm-14.0/slackware' here to install Slackware ARM 14.0.
Next, you will see the following screen which informs you that the PACKAGES.TXT file will be downloaded. Make sure "OK" is selected and press [Enter] to continue.
When the PACKAGES.TXT file has been found you should select 'No' and press enter to continue.
Now you will see the following screen telling you that the available packages are being processed, with a progress bar.
When this process has completed you're ready to move onto the next step of the Slackware ARM installation.
Slackware ARM package selection
The next section deals with packages that will be installed on your Slackware ARM system. You can choose which packages to install or omit. If you're going for a full install you can pretty much select everything in the package list. In this guide we will not be installing packages E, KDEI, T, or Y. You may decide differently on which packages you want installed on your system.
Use the cursor keys to move up and down the list and the space bar to select/deselect the highlighted package. When you have finished selecting your packages press the enter key.
Unless you really have a reason not to, or you are very familiar with Slackware package management, now select 'Install everything' and press the enter key...
Sit back and relax for a while, put the kettle on, clean your room (students only), catch up with the latest news and developments from the Slackware ARM Linux Project, or the Foundation, while you're otherwise unoccupied...
And enjoy the view! This process took approx. 1 hour 25 mins to complete when installing Slackware ARM 14.1 with the packages which we previously selected. Your installation may take the same or a similar time, depending on your own choice of packages, and the speed of your SD card.
Final steps of installation
After all the packages have been installed you will be asked to select a mouse configuration.
Use the cursor keys to move down to 'USB Mouse' and press the enter key. Then, answer yes when asked to 'load gpm program at boot time?' by pressing the enter key. For those who don't already know, 'gpm' is a simple utility which enables you to copy and paste text on the command line.
You want to select yes and configure your network.
Specify a name (hostname) to give to your system. For the purpose of this guide we named ours 'myrasbox'. When you have chosen a suitable name for your system and entered it into the text box, press the enter key.
Enter a domain name. It does not have to be an existing or active domain name. For the purposes of this guide we selected 'slackarm.lan' for a domain name.
You want to select yes and configure your DHCP hostname.
Enter the same name you gave to your hostname. We selected 'myrasbox'. When asked if the DHCP settings are correct, select < Yes > and press the enter key.
Configure startup services
These are services which start when the system is booted. For example, you could have the apache web server running on startup, or you could run the samba file server too. If you want to login to your Raspberry Pi remotely it's imperative that you have the SSHD daemon service enabled.
When you are happy with your selection press the enter key.
Next, answer < No > when asked 'Would you like to try out some screen fonts?' and press the enter key.
Now you can set the hardware clock the system will use.
It's best if you select < Yes > and choose a location close to where you are situated, but not absolutely necessary.
For FatDog.eu we have selected the timezone of 'Europe/Amsterdam' because we are based in Holland. You should select your own timezone here and press the enter key.
Select your desktop environment
When installing a desktop environment it boils down to one thing, preference. From the options available, there are a few to choose from, each with their own benefits and drawbacks. KDE is very nice and streamlined, but takes a toll on the Raspberry Pi due to it being somewhat resource hungry. On the other hand, fluxbox is very light and speedy but a little basic in looks and the GUI isn't to everybody's liking. Xfce is quite lightweight and aims to be fast and low on system resources, while still being visually appealing and user friendly. Blackbox is similar to Windowmaker and is able to generate beautiful window decorations on the fly at high speed. It's probably worth your while reading up on some of the different desktop environments available before you select one.
For the purposes of this guide, we will install Xfce as our desktop environment. It's much lighter on system resources than KDE and perfect for our requirements on the Raspberry Pi. You may choose your own desktop environment here.
Setting a ROOT password
Next you are asked to set a root password. This password is VERY important because if you ever forget it or lose it, you will not be able to get 'root' access on your Slackware ARM Linux system.
Select < Yes >, press the enter key and type your password, then press the enter key again. You will be asked to repeat the password, now press the enter key one more time.
Press the enter key to continue.
Completing the install process
You have now completed the installation process. Before you reboot the system there are a few tasks left to do before you can actually reboot successfully. So, if the system tells you to reboot, don't do it yet.
Press the enter key and you'll find yourself back in the familiar Slackware ARM setup interface. DO NOT REBOOT!
Select EXIT at the bottom of the setup interface and press the enter key. DO NOT REBOOT!
Select < No > at the bottom of the 'Exit Slackware Linux Setup' menu and press the enter key. DO NOT REBOOT! You want to be dropped to the command prompt in a shell. If you reboot right now you would reload the Slackware ARM Linux installer/setup you have just completed!
The above screenshot is what you want to be looking at, with a waiting cursor at the command prompt. If you see this then we are good to continue.
To save space on our new Slackware ARM 14.1 Linux system we are going to remove some packages which are not required. At the command prompt type the following commands:
root@slackware:~# ROOT=/mnt removepkg kernel_armv7 kernel-modules-armv7
root@slackware:~# ROOT=/mnt removepkg kernel_versatile kernel-modules-versatile
After all of the superfluous kernel and module packages have been removed, you are now going to mount the '/dev/mmcblk0p1' boot partition (remember that one?) in the '/mnt/boot' directory. So, now type the following command:
Now that's done, you must do some necessary housekeeping on your boot partition before you install any new system files.
Configure your boot partition for future use
It's an important issue and one that you should address as soon as possible because right now you have a potentially terminal problem. Basically, the boot partition of your SD card is 50MB in size. Approx. 47MB is used with only a little over 2MB of free space remaining. This may not good when you need to install new files on the boot partition, such as firmware updates or new kernels. So, why is there only approx. 2MB of free space on your boot partition? It's because the /boot partition is optimised for the Slackware ARM installer and the initrd.gz RAM disk is still there, a left-over from the install. This file alone is responsible for over 35MB of the space taken up on your boot partition and it's not even required any longer! You are going to remove it, of course, with a simple 'rm' command.
Type the command below to remove the initrd.gz RAM disk file from the boot partition:
Next, type 'df -h' on the command line and you should receive the following output:
The output tells you that your boot partition '/dev/mmcblk0p1' now has quite a lot of free space. This is exactly what you needed to achieve.
Now, you need to install those new packages containing the raspi firmware and kernel data. To do this type the following command:
You should see the following screen on successful installation of the raspi firmware and kernel packages:
If you previously mounted your USB memory stick - mount /dev/sda1 /floppy - (i.e. you did not use the 'Install from Slackware USB stick' option during setup) you should now unmount it from the /floppy directory. To do this type the following command:
You are about to reboot the system. When it reboots you will be prompted for a login username and password. Until the Slackware ARM installation and update process has completed, and on any other occasion for which you need to use 'root' access, you should always login with the following credentials:
password: ** the password you specified for the root user account **
NOW YOU CAN REBOOT!
So, without further ado, type the following at the command prompt:
Once the green ACT LED has stopped flashing (momentarily), you can unplug/power off the Raspberry Pi and remove your USB memory stick, if required. Allow 10-15 seconds to pass before powering it back on.
After rebooting, go to the next section in this guide... Keep Updated.