Install Slackware ARM Linux On The Raspberry Pi

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/SDHC card 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.
• 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 should start to flash intermittently, and the rainbow start image should appear briefly on your screen, followed by the scrolling loader text, which 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/SDHC card and will have to go through the process of configuring it again. If there is no ACT LED activity at all try using a different SD/SDHC card, or reconfigure the same card again.

FatDog says ... For further help with troubleshooting please read the R-Pi Troubleshooting page at elinux.org which lists the most common problems and suggests some solutions.

If all went according to plan, you will see the Raspberry Pi Raspberry Pi Foundation logo at the top of the screen with the boot text scrolling down underneath it. Now you're ready to begin installing Slackware ARM Linux.


Install Slackware ARM Linux

In this guide we will be installing Slackware ARM 14.0 Linux on a Raspberry Pi. The version you've selected might not be the same but the procedure is exactly the same for all Slackware ARM installs. 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, an 8Gb SDHC card and a 16GB USB memory stick. Your own storage devices may be different so bear that in mind throughout this guide.

After successfully booting your Raspberry Pi with the pre-configured SD/SDHC 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:


<OPTION TO LOAD SUPPORT FOR NON-US KEYBOARD>

If you are not using a US keyboard, you may now load a different
keyboard map.  To select a different keyboard map, please enter 1
now.  To continue using the US map, just hit enter.

Enter 1 to select a keyboard map: _

If required, select a keyboard map by typing '1' and pressing the enter key, following the directions given. Then you will see this next screen:



Welcome to the Slackware ARM Linux installation for Raspberry Pi!


This installer has been modified by FatDog.eu, March 22 2013. It
allows you to install either Slackware ARM 13.37, 14.0 or Current
from a USB storage device or the network.


Please read the step-by-step installation guide on:

   http://rpi.fatdog.eu


---


You may now login as 'root'.


slackware login: root

You should type 'root' as the login and press the enter key.

Now you'll see the next screen and this is the start of the main configuration to install Slackware ARM Linux.


Linux 3.1.9-20120801.

If you're upgrading an existing Slackware system, you might want to
remove old packages before you run 'setup' to install the new ones. If
you don't, your system will still work but there might be some old files
left laying around on your drive.

Just mount your Linux partitions under /mnt and type 'pkgtool'. If you
don't know how to mount your partitions, type 'pkgtool' and it will tell
you how it's done.

To partition your hard drive(s), use 'cfdisk' or 'fdisk' (or 'gdisk' for GPT).
To activate PCMCIA/Cardbus devices needed for installation, type 'pcmcia'.
To start the main installation (after partitioning), type 'setup'.

root@slackware:~#

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:
date MMDDHHmmYYYY

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) value is always specified by 4 digits.
Example: if the time is 9:57pm on March 23, 2013 then the command would be as follows:

root@slackware:~# date 032321572013

FatDog says ... If you do not set the correct time and date your Linux system will think it's 00:00 (midnight) on 01 January 1970, the date of the UNIX epoch.

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) 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

FatDog says ... The default gateway is a device on a network (i.e. your router), through which another device on the network (i.e. your Raspberry Pi) can access or send data packets to another device on a different network (i.e. a web server on the Internet). This may seem mind-boggling but it's relatively easy to setup, as long as you have the correct default gateway IP address. Linux users can type 'route -n' at the command prompt on any system already connected to the Internet to find out their default gateway IP address. Windows users can run the command 'ipconfig' within Windows Command Processor (cmd.exe) to find out their default gateway IP address.

Assuming you have the correct network information required to setup your NIC, you are now going to type the following command:

root@slackware:~# ifconfig eth0 <Raspberry Pi IP address> netmask 255.255.255.0 up

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:

root@slackware:~# route add default gw <Internet gateway IP address>

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:

root@slackware:~# echo nameserver 208.67.222.222 > /etc/resolv.conf

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 (173.194.41.132)". 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:

root@slackware:~# /etc/rc.d/rc.dropbear start

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/SDHC 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 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 data = /dev/sda1

The cfdisk partition manager

Now you need to setup the required partitions on your SD/SDHC card. You will do this using 'cfdisk' which is a command line partition manager in Linux. Remember your SD/SDHC card is '/dev/mmcblk0' and this is the drive we tell cfdisk to use. So, go ahead and type the command:

root@slackware:~# cfdisk /dev/mmcblk0

On your SD/SDHC card you will see a FAT32 partition already present in the 'cfdisk /dev/mmcblk0' user interface.

The 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):' you need to type 512 and press the enter key.
• 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.
• Select [ Beginning ] and press the enter key.

So, if your screen is looking similar to the one above (given that you may have used a different size card) then the last thing you need to do is make the boot partiton 'bootable'. This is easier done than said by moving the highlight up to 'mmcblk0p1' (the FAT32) 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 the example above. You should have a 50Mb FAT32 boot partition, a 512Mb swap partition, and the rest of your SD/SDHC 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. Next, select [ Quit ] 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.

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:~# mount /dev/sda1 /floppy
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.

FatDog says ... At FatDog.eu we have found that the formatting process is either quick (2-3 minutes) or it takes an hour, or so, to complete. We have no answers for why this is the case.

Once formatting has completed:

Press the enter key to accept and write the new setting in your fstab.

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, 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 of NTFS partitions.

Installing from Slackware ARM source

This next section is about telling the installer where the Slackware ARM files are located. Remember you made a note that they are on /dev/sda1 and 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.

FatDog says ... Note that if you copied your Slackware ARM files to another directory other than the root of your USB memory pen, the path to those files will be different! Specify your own correct path to the /slackware directory if needed.

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 done 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), have a good read about the latest and greatest from the Raspberry Pi Foundation Foundation website or what's happening with the Slackware ARM Linux Project, while you're otherwise unoccupied...

And enjoy the view! This process took approx. 2 hours 15 mins to complete when installing Slackware ARM 14.0 Linux with the packages which we previously selected. Your installation may take the same or a similar time, depending on your own choice of packages. Incidentally, Slackware ARM 13.37 is relatively quicker to install than Slackware ARM 14.0.

Final steps of installation

After all the packages have 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 simply 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 [desktop] 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 fluxbox as our desktop environment.

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.

FatDog says ... Make sure you remember the password you entered for the 'root' user. Write it down if you need to. It's very important.

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 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_kirkwood kernel-modules-kirkwood
root@slackware:~# ROOT=/mnt removepkg kernel_tegra kernel-modules-tegra
root@slackware:~# ROOT=/mnt removepkg kernel_versatile kernel-modules-versatile

FatDog says ... Note that Slackware ARM 13.37 Linux users will not need to remove the tegra kernel or modules. These packages do not exist by default on Slackware ARM 13.37.

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:

root@slackware:~# mount -t vfat /dev/mmcblk0p1 /mnt/boot

Now that's done, you must do some necessary housekeeping on your boot partition before you install new raspi-kernel 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/SDHC card is 50Mb in size. Approx. 47Mb is used with only a little over 2Mb of free space remaining. This is not good when you need to install new files on the boot partition, such as firmware updates or new kernels, because it would most likely corrupt any existing, and new files. So, why is there only a couple of Mb free on your boot partition? It's because the initrd.gz RAM disk is still there, a left-over from the Slackware ARM installer. This file alone is responsible for 40Mb 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.

FatDog says ... IMPORTANT! : BE VERY CAREFUL HERE! If you make an error and delete the wrong file(s) you will find yourself in seriously deep Linux doo-doo! 'rm' is a very powerful command when used by root and can irreparably delete, in the blink of an eye, that which took you eons to create! Your Raspberry Pi might not mind at all, but your Slackware ARM Linux system will certainly not be greeting you with a log-in prompt after you reboot if you have deleted the wrong file(s)!!!

Type the command below to remove the initrd.gz RAM disk file from the boot partition:

root@slackware:~# rm /boot/initrd.gz

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 over 40Mb of free space. This is perfect and exactly what you needed to achieve.

FatDog says ... If you're wondering why you needed to remove the RAM disk it's because when you install new firmware/kernel packages, or run rpi-update later on, a certain amount of free space is required on the boot partition in order to install those new firmware and/or kernel updates. With the initrd.gz RAM disk still present, and hardly any free space on the boot partition, the rpi-update will not complete successfully and you will most likely end up with a corrupt system which does not boot!

Now, you need to install those new packages containing the raspi firmware and kernel data. To do this type the following command:

root@slackware:~# ROOT=/mnt installpkg /raspi-extra/kernel* /raspi-extra/raspi*

You should see the following screen on successful installation of the raspi firmware and kernel packages:

You should now unmount your USB memory stick from the /floppy directory if you have finished accessing data on it. To do this type the following command:

root@slackware:~# umount /floppy

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:

login: root
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:

root@slackware:~# reboot

Once the green ACT LED has stopped flashing (momentarily), unplug/power off the Raspberry Pi and remove your USB memory stick. Now count to 10 before powering it back on.

After rebooting, go to the next section in this guide... Keep Updated.