Making a Slackware Linux Live Distro:
DISCLAIMER: You will likely wipe out your system drive MANY times experimenting with this. I recommend completely DISCONNECTING (using proper static discharge precautions) and BACKING UP ANY harddrive you do not want to lose the data on.
If you try to skip steps without understanding the inner workings of the Linux-Live scripts, the build.kernel script, or Linux itself, you will likely fail.
Thanks to TOMAS for an oustanding job with SLAX or the Linux-Live scripts. Thanks to skyhog99 for posting enough to help me with compiling the kernel.
Foreword: I’ll be honest, I am no Linux expert. I got here by perseverance. I am hoping to simplify the life of users coming after. There are some steps in here (such as using the entire drive in one partition using EXT2) that may not be needed.
This is gets you a distro around 350 megabytes. I’m going to keep working on it to get it smaller. I have also removed sound for my purposes.
When you are building your own Linux-Live Distro, I recommend you do this to a clean hard drive. You are likely to want to do this over and over again. I have found it best to have 2 or 3 hard drives to experiment with, so you can retain known working configurations easily.
Section 1: Building your Slackware Install
1. Have a blank hard drive installed in the system. In my case, I wanted to remove all traces of ATA drivers from the kernel, so I did this with a SCSI controller and SCSI drive. I also did this with a Silicon Image 3132 adapter and an SATA device hooked to it.
2. Download Slackware 12.1 from http://www.slackware.com/ and create a boot disk from the downloaded ISO’s. I downloaded the DVD ISO to make my installation easier. Please use mirrors or Torrent to download so that the sites are not bombarded. I had a little trouble even finding a mirror with the DVD ISO on it.
3. Boot the Slackware Disk
4. run fdisk to partition your device
a. fdisk /dev/sda (this would be typical for a SCSI drive) fdisk /dev/hda would be typical for an ATA device. Some ATA devices will also show up as /dev/sda if your BIOS is in AHCI or RAID mode.
b. Do a ‘p’ command to list the partition table for the device. If there are any partitions, delete them with the ‘d’ command.
c. Create a single partition of the entire device using the ‘n’ command in fdisk. Select Primary, partition 1. This will simplify life because your CD or USB key will most likely not have a swap partition.
d. Use the ‘a’ command and make the first partition active.
e. Use the ‘w’ command to write the partition table and exit.
5. Run mke2fs from the linux command prompt. We recommend an EXT2 partition for our install, because journaling file systems are not recommended for USB keys.
a. mke2fs /dev/sda1 (SCSI) or mke2fs /dev/hda1 (ATA)
6. Run setup from the linux command prompt.
7. This will bring up the Slackware Linux Setup TUI menu. Arrow down to TARGET and select Setup your target partitions
8. This will bring up the Select Slackware Linux installation partition menu. Select your device. This should match your device from the mke2fs step.
9. Arrow down to No, do not format the partition, as we have already finished this step. If you do this here, you will end up with an EXT3 partition instead of an EXT2 partition.
10. Select ‘OK’ on the Done Adding Linux Partitions To /etc/fstab menu.
11. On Source Media Selections, select ‘1’ Install from a Slackware CD or DVD.
12. Select ‘Auto’ for Scanning for CD or DVD drive. I had intermittent problems with this step and occasionally had to select manual and tell it my drive was /dev/sr0. I think this is somehow related to the power management on my DVD drive. When I had the problem it did not spin up during the scan. I also think this only happened if I aborted the install and restarted without a reboot. If I ever get an extra 4 or 5 hours I might narrow this in farther.
13. Under Package Series Selection I tried to mimic as closely as possible what I wanted my final Distro to look like.
a. Select ‘A’ – Base Linux system
b. Select ‘AP’ – Various Applications that do not need X
c. Select ‘D’ – Program Development
d. UNSELECT ‘E’ Gnu Emacs
e. UNSELECT ‘F’ FAQ lists, HOWTO documentation
f. UNSELECT ‘K’ Linux Kernel Source – We will be replacing this with a later kernel anyway.
g. Select ‘KDE’ Qt and the K Desktop Environment for X
h. UNSELECT ‘KDEI’ International language support for KDE
i. Select ‘L’ System Libraries
j. Select ‘N’Networking
k. UNSELECT ‘T’ TeX typesetting software
l. UNSELECT ‘TCL’ Tcl/Tk script languages
m. Select ‘X’ XWindow System
n. UNSELECT ‘XAP’ X Application
o. UNSELECT ‘Y’ Games
p. Select ‘OK’
14. At the Select Prompting Mode, choose “menu”. This will allow us to further eliminate apps we don’t need.
15. Under Selecting Packages from Series A, UNSELECT the following:
16. Under Selecting Packages from Series AP, UNSELECT EVERYTHING EXPECT:
17. Under Selecting Packages from Series D, UNSELECT the following:
18. Under Selecting Packages from Series KDE, UNSELECT the following:
19. Under Selecting Packages from Series L, unselect the following:
20. Under Selecting Packages from Series N, UNSELECT EVERYTHING EXCEPT:
e. I’m bettin I’m missing something here, but it works OK.
21. Under Selecting Packages from Series X, simply choose OK
22. This should start the installation process.
23. The next screen will be to make a USB Flash Boot. Your choice on this one.
24. On install LILO, select simple, then OK
25. On configure LIL to user FRAME BUFFER CONSOLE, choose standard. This will be safest. If your DISTRO is not going everywhere, you can choose one of the mode that you know works.
26. Under Optional LILO append, leave this line blank
27. Under Use UTF-8 Text Console, choose NO.
28. Under Select LILO Destination, choose MBR and select OK
29. Select your mouse and select OK
30. Under GPM configuration, choose YES to load the gpm program at boot time
31. Under Confirm Startup Services to Run, choose OK.
32. Under Console FONT Configuration, choose NO
33. Under Hardware Clock Set to UTC, do what you want. I chose NO and OK.
34. Under Timezone Configuration choose your timezone. Mine is US/Mountain.
35. Under Select Default Window Manager For X, chose xinitrc.kde and select OK
36. Under NO ROOT PASSWORD DETECTED, do what you want here. I chose NO
37. Under Setup Complete, choose OK.
38. Under Slackware Linux Setup, Choose Exit and OK.
39. Remove your Slackware CD/DVD and reboot with ctrl-alt-del.
Section 2: Running Slackware
1. Your system should boot to a LILO menu. Select Linux and press enter.
2. Login as root, using the password (if any) you entered during Section 1.
3. At the linux shell prompt, type the following:
5. Follow the on screen prompts for your preferred setup for KDE.
Section 3: Building your Kernel
1. For the next few downloads, I recommend putting all these files somewhere non-standard. I made a folder under / called SlackwareLive. The reasoning for this is when you run the Linux-Live scripts if you put them somewhere like /usr or /home, they will automatically be rolled into the lzm files.
a. cd /
b. mkdir SlackWareLive
2. Download your preferred kernel source. The slax kernel works well because it is already patched with aufs and squashfs. ftp://ftp.slax.org/SLAX-6.x/slax-6.0.9.tar
a. I downloaded 184.108.40.206 from ftp.slax.org/source/slax/kernel/220.127.116.11
b. I made a folder under SlackwareLive called 18.104.22.168 and put the kernel files there.
3. Download the Linux-Live scripts. I downloaded linux-live-6.2.9.tar.gz from ftp.slax.org/Linux-Live. This worked with my kernel. I made a folder under SlackwareLive called Linux-Live and put the files there.
4. Open a Linux Konsole. This is typically located under System – Konsole
6. Change to your directory kernel directory.
a. cd /SlackwareLive/22.214.171.124
7. Run the build.kernel script and stop it as soon as it says "compiling kernel". I personally modified this script to stop when I wanted it to so I wouldn't have to abort.
8. Change to /usr/src/linux folder
a. cd /usr/src/linux-126.96.36.199
9. Run your kernel config. I used:
a. make xconfig
10. Select all your Kernel Options. You are really on your own here. If you’re not sure, leave it alone.
11. Save and Exit the make xconfig program.
12. This will create a new .config file in the current folder. Copy this to your kernel source directory:
a. cp .config /SlackwareLive/188.8.131.52/config
b. **** NOTE **** It was called .config, in the source directory it needs to be called config. The kernel.build script counts on this.
13. BE CAREFUL HERE – You may wish to backup your /usr/src folder before doing this step, in case you need the data in it later. I didn’t care about my data in usr/src, so I deleted the entire contents of the /usr/src related to the kernel build.
a. cd /usr/src
b. rm –r *
14. Change back to your kernel source folder:
a. cd /SlackwareLive/184.108.40.206
Section 4: Installing your kernel
1. Install your kernel. If you are following all my steps so far, this is easy. If not, you are probably on your own.
IMPORTANT: This method will stomp on your current kernel. If someone has a better way that will allow both kernels, please email me. If I get time I’ll figure this out. I got this off of the slax forum in another post. It was posted by skyhog99.
a. cd /tmp/linux-220.127.116.11
b. tar –czf linux-18.104.22.168-i486-1.tgz *
c. You will likely get a message indicating that the file changed as we read it. I ignored this and went on. Seems to work.
d. mv linux-22.214.171.124-i486-1.tgz /
e. cd /
f. tar xvf linux-126.96.36.199-i486-1.tgz
g. depmod –a 188.8.131.52
2. Now configure lilo:
a. cd /etc
b. lilo –v
3. Reboot your machine. I prefer the command
Section 5: Running the Linux-Live Scripts
1. Once your machine has booted, start up X Windows:
2. Open a Konsole like we did in the previous section, and run
a. cd /usr/src
b. rm –r *
3. Change to your Linux-Live folder.
a. cd /Slackware/Linux-Live
4. Run the Linux-Live scripts
5. Give your Distro a name that is meaningful to you
6. Enter the path of your /boot/vmlinuz. If you followed my process EXACTLY, you can just hit Enter here.
7. If all went as planned, you now have a portable Slackware. Follow the onscreen instruction to make a CD or USB key. In my case, I was making a USB key, so I simply copied the files to my USB key, and ran liloinst.sh from the USB key. I really recommend making your USB Key an EXT2 partition, rather than a FAT32. If you insist on FAT32 you will need to run bootinst.sh or bootinst.bat, per the SLAX instructions.
1. I can literally do this entire process in about an hour, using a relatively recent dual-core machine and Slackware on DVD. The menu deselection goes quick. If you think about it, you can have your own Linux-Live distro in an afternoon.
2. Provided you get your kernel from ftp.slax.org, or patch in the aufs/squashfs stuff yourself, the process should be about the same. I'm thinking of starting a web site for people wanting to do things like this. Honestly, my next step-by-step was going to take apart the initrd for SLAX, put my kernel in its place, and then put it back together. Then I was going to work on a step-by-step for PXE boot. So many projects, so little time!
3. A friend mentioned I left out the man pages. I'll post an addendum for that when I find the slackware package.
And at the end we'll have yet another thinly-disguised slax distro. I'm amazed that so many egotists out there are willing to do all this work just to see their name on bootup instead of the guy's who did the real work. Is it really that much of a thrill?
Why on earth wouldn't you just add packages to standard slax to get this? What you listed above will easily fit onto a 700mb cdr, meaning there's no reason to strip out all that stuff. Or, you could just dl a blue-white or other distro that was already created for this exact purpose.
Because sometimes it's actually simpler to build the system you want from the ground up rather than rip apart
someone else's work.
Granted, the work Thomas puts into Slax provides you with a system that is better configured than just dumping a load of Slackware packages in a directory and running the build script. But, if everyone took your point of view no one would learn anything for themselves.
More to the point, if Thomas didn't want anyone to roll their own then why does linux-live.org exist at all.
Linux is about freedom, if I just wanted to follow the crowd then I'd just stick my brain in a jar and use Windows.
Yes, thanks I like this.
It would be nice to have a variation of this, like doing it all while running slax live+changes, installing slackware in a tmp subdir, then chroot there and rebuild slax from there. No partitioning. Use changes= to hold all the installation.
You could do this all without Sections 2, 3 and 4. After install in a subdir, just chroot to the tmpdir where slackware is installed and run some 'without-lzm-linux-live' scripts from there.
Really I see no point in using the lzm kernel patch, except for size which is the least of the problems, and doing without it is really a lot simpler, no d/l and recompile kernel from source, no kernel patch, a lot of problems less. Just use the kernel in the new distro. Any new kernel has squashfs and aufs already. To avoid lzm there's just a couple of lines to change in the linux-live scripts liblinuxlive,make_initrd and linuxrc and in activate/deactivate put back the old mo2dir dir2mo scripts...
I needed to modify the kernel. Since I had zero help modifying the kernel, I had to go this route. I would love to use SLAX AS IS, with a different kernel. That's it. I just needed to turn of ATA drivers in my kernel. I think with the knowledge of this process, I am now going to try to figure out how to do this with SLAX, however, these forums have not been useful in getting me there in the past.
there is a potential problem in the following command :
tar –czf linux-184.108.40.206-i486-1.tgz *
this command creates a tar archive of the current directory and places the tar file in the current directory.
The problem is that tar is trying to add the tarfile to itself, and this is not good.
you should put the resulting tar file in another place, outside the current dir
These forums have not been useful because the
gurus leave us for more stimulating challenges,
it seems... The remaining few probably feel a bit
unmotivated and will follow the others, eventually.
Why invest time into finding cures to some issues
if we all know that those cures will never integrate
the future releases?
Unfortunately, Sad but TRUE :(
The good, there are few loyal followers that take the time to still help and it is appreciated :)