Slax USB GNU Linux
Slax GNU/Linux Live USB drive prepared for the R course taught at the OMD-AjBCN
1.1. Setup
1.1.1. Slax base iso
Slax 9.x: https://slax.org
(64 bits)
1.1.2. USB setup
- Get a 16Gb USB3 disk
- "SanDisk Ultra Flair USB 3.0 Flash drive" seems to be the fastest comapred to most usb 3.x usb disk brands, acording to IMI techs (Andreu T.).
- Make two partitions
leave4Mb ofNO free space at the beggining of usb disk (if you leave some empty space, windows doesn't search for the ntfs or fat32 partition, regardless of being the first or the second in sort order at the disk).- ~7.5Gb ntfs (labelled as
7gbntfs
, in our case; adapt to your preferences) - ~8.5Gb ext4 (labelled as
8gbext4
, in our case; adapt to your preferences)
- ~7.5Gb ntfs (labelled as
- uncompress slax.iso in your linux disk (with
isomaster
for instance) - create (with sudo) a folder slax in the new usb ext4 partition
- copy your slax folder to your usb ext4 partition
- run as root the file in your usb ext4 partition:
sudo bash ./slax/boot/bootinst.sh
to make your usb bootable - shutdown your computer, and boot it again this time from your usb stick. Slax should boot
- make your desired changes following guidelines on slax.org website (see more details below, also)
- change keyboard by hand tweaking a file in the persistent changes folder
- Edit this file
/root/.fluxbox/startup
and add there near the top a line such as
- Edit this file
- reboot slax to check that your changes were kept as desired. Power off the machine.
- test the usb disk in a computer booting MS Windows or Mac OSX, to double check that the disk is recognized by default and you can read and write to this partition from that OS.
- clone your usbdisk (with partitions and all) with dd.
- find your usb-disk device name (
/dev/sdc
in this example). You can find out with commandsudo lsblk
orsudo fdisk -l
- make image with dd. Example:
- clone back over another usb with dd again (or theoretically with a dd GUI, but gdiskdump fails for me on Kubuntu 16.04)
To restore the image to another USB drive just invert the process. Just make sure that the new USB drive (/dev/sdd
in this example) is as big or bigger than the original one
- find your usb-disk device name (
1.1.3. Customizations
1.1.3.1. Quick list
- Keyboard
- Add parcellite to systray (ideally run by default when booting in).
- Add kupfer to systray (ideally run by default when booting in). But fails to say when you clonse the konsole that is shown up when running it.
- Background
- Clock
- Installed programs
- firefox-esr
- R RStudio et al. (see bash script below)
- gnumeric (spreadshseet)
- abiword (text-processing program)
- clamTk (antiviryus for windows os and partitions)
- testdisk (in case of need)
- git-cola (git GUI)
- Associate through file manager "Pcmanfm":
- pdf with firefox web browser
- Rmd & R with RStudio
- xls & xlsx with gnumeric spreadsheet program
- csv, README.md & LICENSE to leafpad (plain text editor)
1.1.3.2. My Custom Directory
You can place new files in the usb disk so that they show up in the default "home" folder of the default root user once the usb is booted. Example:
- Custom directory (e.g. my_custom_dir) with files under the Documents folder of the default root user.
- You need to place the folder "my_custom_dir" at (adapt path to your case):
/media/xavi/8gbext4/slax/changes/home/guest/Documents/my_custom_dir/
- You need to place the folder "my_custom_dir" at (adapt path to your case):
- Alternatively, you can place those files under the ntfs partiton (
7gbntfs
), so that they are viewable from the slax system And from another computer with MS Windows (or Mac OSX) operating systems and operate with those files normally as with any other usbdisk.
1.1.3.3. Mount usb ntfs sister partition by default
To allow the user to mount both partitions when booted with slax linux, you can run a shell command to mount the ntfs partition at run time (it doesn't mount automatically at boot time for some unknown reason).
You can make a shell script with this command in a terminal window:
and add these contents inside:
And save the file to disk.
Then, change its perms so that it can be executable, with this command:
Later on, users will have to open the file manager, and click on the "munta_usb.sh" file in the default folder shown, and choose "Execute" (the button at the left of the pop-up window).
1.1.3.4. Fix RStudio 1.2.x launcher
RStudio 1.2.x in Slax 9.8+ doesn't seem to run by default, for unknown reasons, while it did run with no problems in Slax 9.2 and using Rstudio 1.1.x. The solution/workaround involves calling rstudio with --no-sandbox
argument. To make this change work for the menu entry in Slax, you need to edit the file holding the information of the menu entry in slax. Slax uses xlunch program to manage runnig programs from a nice and small UI (https://xlunch.org). Config file for rstudio is stored at:
/usr/share/applications/rstudio.desktop
. That file needs to get the call to rstudio tweaked to add that --no-sandbox parameter. Final version should be like:
In addition, and just in case this file is not added to the changes folder in slax usb, I also copied that rstudio.desktop
file to another folder, the folder where xlunch.org documentation says that a user can override the values from the systemwide configuration: /root/.local/share/applications/
1.1.3.5. https certs for imi and ajbcn related domains
Get these certs from the samba share at Ajuntament de Barcelona (See http://omd-gid.imi.bcn/Kubuntu#Certificat_del_navegador ) and import them to firefox browser certificate authorities:
- Certificat IMI arrel (IMICARaiz.crt)
- IMI Entitat certificadora (IMICAEmisora1V01.crt)
- FWIMICA.crt
1.1.3.6. https cert for gitlab.ajuntament.bcn through git
Trust the certificate from gitlab.ajuntament.bcn also through git command calls.
1.1.3.7. Pending
Pending to test/implement
- set parcellite to boot by default by means of tweaking whatever system file is needed?
- test synaptic instead of kupfer?
-
add some terminal window program that allows copy & paste (default one doesn't). Terminator didn't work (didn't install properly for some reason, in some tests I did in the early stages of customizing the usbdisk).geany did the trick (with the embedded terminal). And Rstudio terminal panel.
1.1.4. Troubleshooting
1.1.4.1. Your customized slax usbdisk can't enter the graphical mode
Setting up the slax-usb stick in one computer, might set the temp path under the "changes" directory as a symbolic link to a temp folder in a hard disk (e.g. +/dev/sda5/tmp/+- ) of the physical computer where you are testing or tweaking the usb disk in. The first time I saw this, the temp folder was set to reuse an ext4 partition on the host computer where the usbdisk was plugged in.
However, when you place your customized usbdisk into another computer, that tmp folder might no exist in that other computer, and therefore, your customized slax wouldn't be able to boot into the graphical mode, due to being unable to create temp files or folders for the Xorg graphic display, or others.
Therefore, if the customized slax usbdisk is not able to boot into the graphical mode but only in text mode, you can log in that text screen with the usual credentials (user root
, password: toor
, as indicated in that login screen itself), and attempt to start the graphical mode by hand by means of running the command startx
. See the error message that will be displayed in the screen. If it says anything related to being not able to create a file or folder under tmp, then you need to double check that the folder where the symbolic links points to does exist.
One quick workaround to solve this problem is to remove the tmp
symbolic link and create a real tmp
folder in the usbdisk instead. It might make things slower, but at least it will work.
1.1.5. Custom modules (.sb)
Following the guidelines on how to make custom slax modules:
https://www.slax.org/customize.php
- Background image:
/modules/slax_wallpaper_ajbcn.sb
- Firefox:
06-firefox.sb
1.1.6. Install extra system programs
1.1.7. Install R packages
Addins (not in CRAN but elsewhere):
- mapedit.addin
1.2. Screenshots
.
.
.
1.3. Pending
- nothing, afaik