Light Linux with Slax

Introduction

Slax is a very light, multilingual Linux distribution based on Slackware. This article is based on release 7.0.5.

Information

Persistent changes are no longer made in /slax/changes/ but rather /live/memory/changes

Slax modules/bundles are rebuilt Slackware packages

If you need to save a file onto the USB keydrive while running Slax, save it in /mnt/live/memory/.

Temp Things to do

Install Slax on hard drive

Linux

We'll assume the hard drive is empty, so there's no need to multiboot to Windows:

  1. Boot Slax from a USB keydrive
  2. Create and format a Linux partition on the hard drive (eg. mkfs.ext4 /dev/sda1; "... is not a block special device." means the partition should be unmounted before formatting)
  3. From the Slax site, download the ZIP file, and unzip into the partition (eg. wget -c http://www.slax.org/download/7.0.5/slax-French-7.0.5-i486.zip; cd /mnt/sda1 ; unzip slax-French-7.0.5-i486.zip)
  4. Cd to /slax/boot, and run bootinst.bat (not bootinst.sh?), which will install Grub in the MBR
  5. Reboot while removing the USB keydrive

Windows

Slax doesn't require a Linux partition. The contents of its ZIP file can be unzipped in an NTFS partition. grub4dos will take care of booting up Slax without making changes to the MBR.

Kitty: Change colors for man pages

Error installing Chrome through Software Center

Booted from USB keydrive > Software Center.

"Error mounting of the bundle, perhaps corrupted download"

Tried again: "Slax bundle is already active as 2230-chrome.sb". Rebooted, "Slax bundle is already active as 2230-chrome.sb" but found in KDE Internet menu.

Switch between FR and US-EN interface

"US English" is included in all releases of Slax, even if you installed a different release. Go into KDE's System Configuration > Localization, click on the Languages tab, add US-EN to "Prefered Languages", and reboot.

How to remove a module (eg. Firefox) entirely?

The orthodox way is to run "slax info", followed by "slax deactivate <module>". If it fails because the app has some process running, just remove the .sb file located under /mnt/live/memory/data/slax/, and reboot.

Before removing Firefox, be aware that Software Center relies on it...

Load all mass storage devices (HD partitions + external drives)

Just add a script in /etc/rc.d/rc3.d/:

#!/bin/bash
/usr/libexec/udisks-daemon &
/usr/libexec/polkitd &

More infos:

Daemons such udisks or polkit can either be started by systemd at boot time or at session time by the display manager through D-Bus.

"Solid is a device integration framework for KDE 4; relies on udev/systemd."

# solid-hardware list

QStringList Solid::Backends::UDisks::UDisksManager::allDevicesInternal()  error:  "org.freedesktop.DBus.Error.ServiceUnknown"

virtual QStringList Solid::Backends::UPower::UPowerManager::allDevices()  error:  "org.freedesktop.DBus.Error.ServiceUnknown"

# udisks --dump

it is up to the distribution itself to ensure that UDisks is launched either before KDE is started - or is able to start itself automatically (via D-Bus autolaunching).

http://forum.kde.org/viewtopic.php?f=225&t=110110

Navigating the PolicyKit maze

www.freedesktop.org/wiki/Software/polkit

KDE Menu > Applications > System > System Setting > Hardware > Removeable Media > Check "Enable automatic mounting of removeable media" On Login / Once mounted + check all the items in the two columns (!), reboot. DOESN'T WORK: Works when booting off hard drive

"udisks provides an interface to enumerate storage devices and perform operations on them. Any application can access the org.freedesktop.UDisks service on the system message bus. On Linux, udisks relies on recent versions of udev(7) and the kernel."

"Udisks (formerly called DeviceKit-disks) is a replacement for part of the functionality which used be provided by the now deprecated HAL (Hardware Abstraction Layer). Essentially it is an abstraction for enumerating disk and storage devices and performing operations on them. Udisks provides:

Actions that a user can perform using udisks can be restricted using PolicyKit. Udisks relies on the kernel and udev where possible but does poll devices which do not publish their own details. Typically a DVD device is polled" http://www.scribd.com/doc/63425975/Introduction-to-Udisks

"The udisks daemon serves as an interface to system block devices, implemented via D-Bus. It handles operations such as querying, mounting, unmounting, formatting, or detaching storage devices such as hard disks or USB thumb drives.
This package also provides the udisks utility, which can be used to trigger these operations from the command line (if permitted by PolicyKit). External tools such as hdparm are used if available to implement extra operations, such as configuring disk spindown times."

http://askubuntu.com/questions/145706/what-does-udisks-daemon-do-and-do-i-need-it

What is D-Bus? "inter-process communication (IPC) system for software applications to communicate with one another."

Save customized hard drive Slax into ISO file, and test new USB keydrive

  1. Install Slax on the hard drive
  2. Customize to your heart's content
  3. Download and untar the Linux Live scripts into /tmp
  4. Run /tmp/build
  5. Run /boot/makeiso.sh to create the ISO

 

  1. Install on a hard drive, as it's easier than trying to customize an ISO file
  2. Add/remove modules, rearrange boot statements
  3. Boot to always fresh mode (?) and delete any changes.dat file
  4. Run /boot/makeiso.sh to create an ISO

http://old.slax.org/forum.php?action=view&parentID=32326 (from markds)

"By default, Slax detects if you run it from a writable device. If yes, then all the changes you make to the operating system itself are saved and restored next time you boot. If your device uses FAT filesystem, which is most common on USB flash drives, then all file modifications to Slax itself are saved into a special file changes.dat, which is created on your boot device in /slax/changes/ directory, and grows automatically in size up to 4GB. If your boot device uses a native Linux filesystem such as ext4, then the changed files are saved natively to /slax/changes/ directory without any need for intermediate changes.dat file. If you, for any reason, do not like persistent changes, simply uncheck the appropriate boot option and your Slax will start using the default 'fresh' configuration and won't save any modifications. It may be useful also in cases you'd like to test something system-wide, since you can always revert to the default state by simple reboot (in case things screw up).

The file changes.dat is designed to work even on FAT filesystems, which are commonly used on most USB flash drives. Unfortunately FAT is limited to 4GB file size; for that reason, persistent changes can't grow more. In case you need to save more, please format your storage drive with some Linux filesystem such as EXT4 or BTRFS and install Slax to it. Slax will be able to save changes natively and will be limited only by the actual capacity of your device. Persistent Changes functionality does not (of course) affect files on hard drives in your computer. If you modify these files, they will always be modified regardless of your persistent changes settings.

The empty directory /memory/changes is writable, thus the entire AUFS mount in /memory/union happens to be writable as well. All new or changed files inside the union are copied-up to this empty directory before the system creates or modifies them. Since the directory for changes resides on tmpfs (that is in RAM), all new and modified files are stored in RAM and thus are lost on reboot.

Yet if Slax is started from a writable media such as USB device or hard disk, it recognizes that and mounts the writable drive over /memory/changes before it is joined with the other branches in union, which effectively means that changed and new files will be stored on the boot device rather than in RAM, and reboot won't erase them. This feature is called Persistent Changes and can be turned on or off by a boot menu setting. " http://www.slax.org/en/documentation.php

Remove unneeded options in boot menu?

Boot menu: From boot menu, remove all options (Persistent changes, Graphical desktop, Copy to RAM, Act as PXE server) and replace with two options: "Start Slax" and "Run diagnostic" (to run either lshw or dmidecode and e-mail output)

Add option to boot into text mode and run lshw/lspci/dmidecode

Edit /slax/boot/syslinux.cfg

Also check /syslinux.cfg

http://www.syslinux.org/wiki/index.php/SYSLINUX

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

You can use an unused runlevel for that, for example runlevel 4 on non-Slackware systems or runlevel 5 on Slackware systems.

After you have configured a runlevel to behave in the way you want just change the option in the bootloader to boot into that specific runlevel.

Hide dmesg when booting

Modify bitmaps to own

Add "ll" alias" for both local and SSH access

Must add to /etc/profile (with persistence) and ~/.bashrc.

Q&A

How to find which version of Slax version I'm running?

cat /etc/slax-version

How to find which version of KDE I'm running?

kded4 --version

Is VESA a good way to minimize video issues? What options are available when booting Slax (vga=773, etc.)?

So-called "cheatcodes" can be changed by pressing ESC followed by TAB.

A few are listed in the "Cheatcodes for Slax" section, and more are available through "man bootparam".

How to add system-wide aliases?

Edit /etc/profile.d/slax.sh, and reboot.

When running off USB (in persistent mode), what is /mnt/live/?

http://old.slax.org/forum.php?action=view&parentID=75605&anchorid=84484#postid84484

What network (wifi/Ethernet), video, and data storage (SATA, USB, and external drives) drivers does Slax have as default?

How to add apps not part of a module/bundle?

Get a Slackware or Debian package, and convert it to a Slax module.

What is slax.sb?

What is /modules?

In the Modules section, what are "download", "add to build", and "activate"?

How to add/remove modules?

Add/remove modules, changes settings, save to ISO: Download module files from slax website, and put them into /slax/modules/ folder. Then you have to create the ISO image, using mkisofs. I didn't find how to remove modules in Utilities or System Configuration: What is the right way

Customizing SLAX: Part 1 - Giving SLAX your own look and flavor

Customizing SLAX: Part 2 - Customizing SLAX Core Modules

Run the Software Center. If the icon was removed from the desktop, /usr/bin/softcenter.

What is "slax activate"?

Activating = installing.

Per Slax modules: "Slax modules do not need unpacking. They are used in the packed form. Instead of installing, Slax modules are activated. In technical terms, that means mounted and added to aufs union as a new branch.

[...] Offline module activation is performed when Slax is not running. You can activate module (a file with .sb extension) by copying it to /slax/modules/ directory on your boot device. All modules copied there will be automatically activated during Slax startup. Removing the module (the file with .sb extension) from /slax/modules/ directory will uninstall it so it is not a part of Slax any longer.

Online module activation is performed when Slax is running, directly within Slax system. You can either use Software Center to activate and deactivate modules on the fly or you can use [command-line] commands" (slax search/info/download/activate.)

How to install an application not available as a Slax bundle?

If it's available as a Slackware package, open a console to convert it to a Slax bundle with "txz2sb", put the resulting .sb file into slax/modules, and reboot.

If it's not available as a Slackware package and it's only a script, http://old.slax.org/forum.php?action=view&parentID=25732

lshw is missing from Slax

  1. Get its Slackware package
  2. Convert it to a Slax bundle: txz2sb lshw.txz lshw.sb
  3. Copy lshw.sb into /slax/modules/ (or if already running from USB stick, /mnt/live/memory/data/slax/modules)
  4. slax activate /slax/modules/lshw.sb

How to install a driver not available in Slax?

http://old.slax.org/forum.php?action=view&parentID=32106

What is a hard drive frugal install?

"If an operating system is installed frugally, operating system files cannot be modified, so they cannot become corrupted. Personal files and settings can be saved, but operating system files are not modified."

http://gr8idea.info/os/tutorials/slax/index.html

It means installing Slax on a hard drive by copying the contents of a live CD/USB. If you don't need to multiboot with eg. Windows, end with running the Slax install scripts.

Wifi: What is ndiswrapper?

Third alternative to open-source driver and closed-source drivers?

Is an SSH Server available for Slax?

How to install Telnet Server and SSH server

It's part of the standard ISO but isn't started automatically.

  1. chmod +x /etc/rc.d/rc.sshd
  2. /etc/rc.d/rc.sshd start
  3. Log on as root/root
  1. sh /etc/rc.d/rc.sshd start
  2. chmod +x /etc/rc.d/rc.sshd
  3. default root/root

How to save files onto USB keydrive and make them available on Windows?

mkdir /mnt/usb; mount /dev/s??? /mnt/usb; copy files; umount /mnt/usb ; reboot

Changing volume labels on mass storage devices

Note: A label must not exceed 16 characters.

  1. If mounted,unmount volume
  2. To change the volume label on an NTFS partition:

    # ntfslabel /dev/sda1 "My NTFS partition"
     
  3. To change the volume label on a Linux partition:

    # e2label /dev/sda2 "My Linux partition"

Resources