summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--EFI/BOOT/grub-embedded.cfg3
-rw-r--r--EFI/BOOT/grub.cfg1
-rw-r--r--EFI/BOOT/help.txt36
-rw-r--r--EFI/BOOT/make-grub.sh8
-rw-r--r--README.txt441
-rw-r--r--contrib/scripts/makemod_nvidia45
-rw-r--r--contrib/scripts/makemod_wine38
-rw-r--r--grub.tpl15
-rw-r--r--iso2usb.sh381
-rw-r--r--isocomp.sh921
-rw-r--r--languages1
-rw-r--r--liveinit.tpl829
-rw-r--r--make_slackware_live.conf10
-rwxr-xr-xmake_slackware_live.sh1827
l---------media/daw/bg/background.png1
-rw-r--r--media/daw/bg/sc_stage_bw_1920x1080.pngbin0 -> 412994 bytes
-rw-r--r--media/daw/icons/SJack2.pngbin0 -> 36939 bytes
l---------media/daw/icons/default.png1
-rw-r--r--media/daw/menu/liveslak-daw.directory6
-rw-r--r--media/daw/menu/liveslak-daw.menu26
-rw-r--r--media/daw/menu/liveslak-daw.pngbin0 -> 76212 bytes
l---------media/ktown/bg/background.jpg1
-rw-r--r--media/ktown/bg/rauwven.jpgbin0 -> 646172 bytes
l---------media/lean/bg/background.jpg1
-rw-r--r--media/lean/bg/bretagnecancale.jpgbin0 -> 1087088 bytes
-rw-r--r--media/lean/bg/demortelen.jpgbin0 -> 984364 bytes
-rw-r--r--media/lean/bg/groedezeeland.jpgbin0 -> 313523 bytes
-rw-r--r--media/lean/bg/landgoedgrotebeek.jpgbin0 -> 843023 bytes
-rw-r--r--media/lean/bg/montsaintmichel.jpgbin0 -> 307962 bytes
-rw-r--r--media/lean/bg/montstmichelflats.jpgbin0 -> 572098 bytes
-rw-r--r--media/lean/bg/ruwenberg.jpgbin0 -> 486254 bytes
-rw-r--r--media/lean/bg/theme2
-rw-r--r--media/lean/bg/vijlen.jpgbin0 -> 383835 bytes
-rw-r--r--media/lean/bg/willibrordhaeghe.jpgbin0 -> 305255 bytes
-rw-r--r--media/slackware/icons/graySW_512px.pngbin0 -> 84067 bytes
-rw-r--r--menu.tpl11
-rw-r--r--patches/liloconfig.patch226
-rw-r--r--patches/liloconfig_14.2.patch819
-rw-r--r--pkglists/alien.lst21
-rw-r--r--pkglists/cinnamon.conf6
-rw-r--r--pkglists/cinnamon.lst16
-rw-r--r--pkglists/daw.lst46
-rw-r--r--pkglists/kde4add.lst116
-rw-r--r--pkglists/kde4base.lst284
-rw-r--r--pkglists/kde4plasma5.lst8
-rw-r--r--pkglists/ktown.conf (renamed from pkglists/plasma5wayland.conf)9
-rw-r--r--pkglists/ktown.lst (renamed from pkglists/plasma5.lst)526
-rw-r--r--pkglists/ktownalien.conf (renamed from pkglists/daw.conf)0
-rw-r--r--pkglists/ktownalien.lst5
-rw-r--r--pkglists/ktownslack.lst24
-rw-r--r--pkglists/mate.lst3
-rw-r--r--pkglists/min.lst51
-rw-r--r--pkglists/multilib.lst56
-rw-r--r--pkglists/noxbase.lst50
-rw-r--r--pkglists/plasma5wayland.lst30
-rw-r--r--pkglists/secureboot.conf (renamed from pkglists/lxqtdeps.conf)4
-rw-r--r--pkglists/secureboot.lst3
-rw-r--r--pkglists/slackextra.lst2
-rw-r--r--pkglists/slackpkgplus.conf10
-rw-r--r--pkglists/x_base.lst40
-rw-r--r--pkglists/xapbase.lst38
-rw-r--r--pkglists/xfcebase.lst9
-rw-r--r--pkglists/z00_plasma5supp.lst148
-rw-r--r--pkglists/z01_plasma5base.lst405
-rw-r--r--pkglists/z01_plasma5extra.lst6
-rw-r--r--pkglists/z01_swdev.lst30
-rw-r--r--pkglists/z02_alien4daw.conf (renamed from pkglists/plasma5.conf)7
-rw-r--r--pkglists/z02_alien4daw.lst15
-rw-r--r--pkglists/z02_alienrest4daw.conf12
-rw-r--r--pkglists/z02_alienrest4daw.lst3
-rw-r--r--pkglists/z03_daw.conf12
-rw-r--r--pkglists/z03_daw.lst144
-rwxr-xr-xpxeserver.tpl159
-rw-r--r--setup2hd.local.tpl (renamed from setup2hd.local)7
-rwxr-xr-xsetup2hd.tpl324
-rw-r--r--setup2hd/SeTfirewall.tpl704
-rw-r--r--setup2hd/SeTpasswd.tpl51
-rw-r--r--setup2hd/SeTuacct.tpl96
-rw-r--r--setup2hd/SeTudiskpart.tpl65
-rw-r--r--setup2hd/SeTumedia.tpl38
-rw-r--r--setup2hd/SeTupass.tpl55
-rw-r--r--setup2hd/rc.firewall.tpl141
-rw-r--r--setup2hd/setup.liveslak.tpl282
-rw-r--r--setup2hd/setup.slackware.tpl164
-rw-r--r--syslinux/f2.txt4
-rw-r--r--syslinux/f3.txt37
-rw-r--r--syslinux/f4.txt2
-rw-r--r--upslak.sh529
-rw-r--r--xdm/Xresources24
90 files changed, 8604 insertions, 1869 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..446abd8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+prep.sh
+
diff --git a/EFI/BOOT/grub-embedded.cfg b/EFI/BOOT/grub-embedded.cfg
index 917672f..cc2098e 100644
--- a/EFI/BOOT/grub-embedded.cfg
+++ b/EFI/BOOT/grub-embedded.cfg
@@ -1 +1,4 @@
search --file --no-floppy --set=root /EFI/BOOT/SLACKWARELIVE
+if [ -e ($root)/EFI/BOOT/grub.cfg ]; then
+ set prefix=($root)/EFI/BOOT
+fi
diff --git a/EFI/BOOT/grub.cfg b/EFI/BOOT/grub.cfg
deleted file mode 100644
index 63e7c80..0000000
--- a/EFI/BOOT/grub.cfg
+++ /dev/null
@@ -1 +0,0 @@
-source $prefix/menu/grub.cfg
diff --git a/EFI/BOOT/help.txt b/EFI/BOOT/help.txt
index dbfb5b2..ea24562 100644
--- a/EFI/BOOT/help.txt
+++ b/EFI/BOOT/help.txt
@@ -10,11 +10,15 @@ To boot with default values just press ENTER.
kbd=fr xkb=ch,fr => Example of custom X keyboard layout.
livepw="somestring" => Change the password for user "live".
+ The password is passed as a cleartext string.
+ You can pass an empty string (livepw=) to remove the password.
locale=nl_NL kbd=nl tz=Europe/Amsterdam => Example of language,
keyboard and/or timezone customization.
rootpw="somestring" => Change the password for user "root".
+ The password is passed as a cleartext string.
+ You can pass an empty string (rootpw=) to remove the password.
=== Custom software ===
@@ -52,8 +56,10 @@ localhd => initialize RAID/LVM on local hard drives.
tweaks=tweak1[,tweak2,[,...]] => Implemented tweaks:
nga - no glamor 2D acceleration, avoids error "EGL_MESA_drm_image required".
+ nsh - no sub-pixel hinting in freetype.
tpb - enable TrackPoint scrolling while holding down middle mouse button.
syn - start the syndaemon for better support of Synaptics touchpads.
+ ssh - start SSH daemon (disabled by default).
nomodeset => Boot without kernel mode setting, needed with
some machines.
@@ -71,6 +77,9 @@ cfg=[skip|write] =>
OS parameters; or specify 'write' to write current OS parameters
to disk.
+domain=your_custom_domain =>
+ Specify a custom domain name. Defaults to 'example.net'.
+
hostname=your_custom_hostname[,qualifier] =>
Specify a custom hostname. A qualifier 'fixed' can be appended
to prohibit hostname modification in case of network boot.
@@ -80,7 +89,8 @@ livemedia=/dev/sdX => Tell the init script which partition
become necessary if you have another copy of Slackware Live
installed in another partition.
-livemedia=/dev/sdX:/path/to/live.iso => Use this if you want to
+livemedia=/dev/sdX:/path/to/live.iso
+livemedia=scandev:/path/to/live.iso => Use this if you want to
load the live OS from an ISO file on a local harddisk partition.
livemain=directoryname => Use this if you copied the content
@@ -91,16 +101,36 @@ luksvol=file1[:/mountpoint1][,file1[:/mountpoint2],...] =>
Multiple files should be separated with comma.
Specify "luksvol=" to *prevent* mounting any LUKS container.
-nop => No persistence, i.e. boot the virgin installation in
- case your "persistence" directory got corrupted.
+nop => No persistence, i.e. boot the virgin installation in
+ case your "persistence" directory got corrupted.
+ If you want to ignore any persistent data during boot,
+ including LUKS data, specify "nop luksvol=" .
+
+nop=wipe => Wipe all data from persistence directory or container.
+ Useful in cases where your persistent data got corrupted.
persistence=directoryname => Use this if you want to use
a different directory than "persistence" for storing
persistent data.
+persistence=/dev/sdX:/path/to/mypersistence
+persistence=scandev:/path/to/mypersistence => Use this if
+ the persistence directory or container is not located on the USB stick,
+ but on a local hard disk partition. Useful for network (PXE) boot
+ where you still want to offer users persistence.
+
toram => copy the OS from the media to to RAM before running it.
You can remove the boot media after booting.
+toram=all => Prevent writes to disk since we are supposed to
+ run from RAM; equivalent to parameter "toram".
+
+toram=core => Load Console OS modules into RAM. Console-only Slackware
+ loads fast, contains 'setup2hd' and frees up your USB drive so you can
+ overwrite it with a Persistent Live OS.
+
+toram=os => Load OS modules into RAM, but write persistent data to USB.
+
=== Troubleshooting ===
blacklist=mod1[,mod2[...]] => Add one or more kernel modules
diff --git a/EFI/BOOT/make-grub.sh b/EFI/BOOT/make-grub.sh
index 6575ea7..ddf9f68 100644
--- a/EFI/BOOT/make-grub.sh
+++ b/EFI/BOOT/make-grub.sh
@@ -37,6 +37,9 @@ EFIFORM=${EFIFORM:-"x86_64"}
EFISUFF=${EFISUFF:-"x64"}
EFIDIR=${EFIDIR:-"/EFI/BOOT"}
+# Fix the path in grub-ebedded.cfg if needed:
+sed -e "s,/EFI/BOOT,${EFIDIR}," -i grub-embedded.cfg
+
echo
echo "Building ${EFIDIR}/boot${EFISUFF}.efi and /boot/syslinux/efiboot.img."
@@ -44,12 +47,13 @@ echo "Building ${EFIDIR}/boot${EFISUFF}.efi and /boot/syslinux/efiboot.img."
# works with mutiple grub releases (grub-2.02 added the 'disk' module):
GMODDIR="$(dirname $(LANG=C grub-mkimage -O ${EFIFORM}-efi -p ${EFIDIR} alienbob 2>&1 | cut -d\` -f2 |cut -d\' -f1) )"
GMODLIST=""
-for GMOD in part_gpt part_msdos fat ext2 iso9660 ntfs chain linux boot configfile normal regexp extcmd minicmd reboot halt search search_fs_file search_fs_uuid search_label gfxterm gfxmenu gfxterm_background efi_gop efi_uga all_video loadbios gzio echo true probe loadenv bitmap_scale font cat help ls png jpeg tga test at_keyboard usb_keyboard disk memdisk nativedisk file loopback tar tftp net efinet efifwsetup ; do
+# 'shim_lock' is built into grub, not a module anymore:
+for GMOD in part_gpt part_msdos fat btrfs ext2 f2fs jfs xfs iso9660 ntfs chain linux boot configfile normal regexp extcmd minicmd reboot halt search search_fs_file search_fs_uuid search_label gfxterm gfxmenu gfxterm_menu gfxterm_background efi_gop efi_uga all_video loadbios gzio echo true probe loadenv bitmap_scale font cat help ls png jpeg tga test at_keyboard usb_keyboard disk memdisk nativedisk file loopback tar tftp net efinet efifwsetup zstd ; do
[ -f ${GMODDIR}/${GMOD}.mod ] && GMODLIST="${GMODLIST} ${GMOD}" || echo ">> ${GMOD} not found"
done
# Build bootx64.efi/bootia32.efi, which will be installed here in ${EFIDIR}.
-grub-mkimage --format=${EFIFORM}-efi --output=boot${EFISUFF}.efi --config=grub-embedded.cfg --compression=xz --prefix=${EFIDIR} ${GMODLIST}
+grub-mkimage --format=${EFIFORM}-efi --output=boot${EFISUFF}.efi --config=grub-embedded.cfg --sbat=grub_sbat.csv --compression=xz --prefix=${EFIDIR} ${GMODLIST}
# Then, create a FAT formatted image that contains bootx64.efi in the
# ${EFIDIR} directory. This is used to bootstrap GRUB from the ISO image.
diff --git a/README.txt b/README.txt
index 9c5fff1..95bbf7b 100644
--- a/README.txt
+++ b/README.txt
@@ -5,7 +5,7 @@
===== Preface =====
-Welcome to the Slackware Live Edition! This is a version of Slackware 14.2 (and newer), that can be run from a DVD or a USB stick. It is an ISO image meant to be a showcase of what Slackware is about. You get the default install, no custom packages or kernel, but with all the power of Slackware. The ISO is created from scratch using a Slackware package mirror, by the "liveslak" scripts.
+Welcome to the Slackware Live Edition! All Slackware releases since 14.2, including the development version ''-current'', are supported versions for the ''liveslak'' project. The Live OS which liveslak creates from the Slackware Distro can be run from a DVD or a USB stick. It is an ISO image meant to be a showcase of what Slackware is about. You get the default install, no custom packages or kernel, but with all the power of Slackware. The ISO is created from scratch using a Slackware package mirror, by the "liveslak" scripts.
Slackware Live Edition does not have to be installed to a computer hard drive (however you do have that choice if you want to: using the setup2hd script). You can carry the USB stick version with you in your pocket. You'll have a pre-configured Slackware OS up & running in a minute wherever you can get your hands on a computer with a USB port.
@@ -13,6 +13,8 @@ The USB version is "persistent" - meaning that the OS stores your updates on the
In order to protect your sensitive private data in case you lose your USB stick (or in case it gets stolen) you can enhance your persistent USB Live OS with an encrypted homedirectory and/or an encrypted persistence file, to be unlocked on boot with a passphrase that only you know.
+And even booting directly from the ISO file (see chapter ''Boot from an ISO file on disk'') you can use persistence and enjoy an encrypted homedirectory, without the need for any modification to the ISO file.
+
===== Why yet another Slackware Live =====
@@ -31,13 +33,14 @@ The reasons I had for creating the Slackware Live Edition are as follows:
The "liveslak" scripts can generate a variety of Slackware flavors:
- - a complete 64bit Slackware-current Live Edition (in a 3.1 GB ISO);
- - a slimmed-down XFCE ISO (700 MB) with XDM as the graphical login manager. It fits on a CDROM medium or a 1 GB USB stick;
- - a ISO image (4.6 GB) of Slackware64-current containing Plasma 5 instead of KDE 4, with an addition of several other packages from the alienBOB repositories: vlc, libreoffice, calibre, qbittorrent, ffmpeg, chromium, openjdk, veracrypt.
- - a Mate variant (2.1 GB) where KDE 4 has been replaced by Mate (a Gnome 2 fork);
- - a Cinnamon flavour (a fork of the Gnome 3 Shell replacing Slackware's KDE 4).
- - a Dlackware variant, which is Gnome3 + PAM + systemd on top of Slackware and stripped of KDE4.
- - a StudioWare edition containing all the project's audio, video and photo editing software packages.
+ - a complete 64bit Slackware-current Live Edition (in a 4.5 GB ISO);
+ - a slimmed-down XFCE ISO (1100 MB) with XDM as the graphical login manager. It fits on a 1 GB USB stick;
+ - a LEAN ISO (2.5 GB) of Slackware-current with reduced package set and based on Plasma5 Desktop;
+ - A Digital Audio Workstation (DAW) based on a custom Slackware package set plus a basic Plasma5, containing a rich software collection for musicians, producers and live performance artists (3.6 GB).
+ - a Mate variant (4.2 GB) where KDE has been replaced by Mate (a Gnome 2 fork);
+ - a Cinnamon flavour (a fork of the Gnome 3 Shell replacing Slackware's KDE) in an ISO file of 4.2 GB;
+ - a Dlackware variant, which is Gnome3 + PAM + systemd on top of Slackware and stripped of KDE (no longer developed after Slackware 14.2);
+ - a StudioWare edition containing all the project's audio, video and photo editing software packages (no longer developed after Slackware 14.2);
- a "Custom" variant which you can give your own name, its own package list and custom post-install configuration.
@@ -45,11 +48,10 @@ The "liveslak" scripts can generate a variety of Slackware flavors:
Common download locations are:
- * Primary site: http://slackware.nl/slackware-live/ (%%rsync://slackware.nl/mirrors/slackware-live/%%)
- * Darren's http://slackware.uk/people/alien-slacklive/ (%%rsync://slackware.uk/people/alien-slacklive/%%)
+ * Primary site: https://download.liveslak.org/ (%%rsync://liveslak.org/liveslak/%%)
+ * My US mirror: https://us.liveslak.org/ (%%rsync://us.liveslak.org/liveslak/%%)
+ * Darren's https://slackware.uk/liveslak/ (%%rsync://slackware.uk/liveslak/%%)
* Willy's http://repo.ukdw.ac.id/slackware-live/
- * Ryan's https://seattleslack.ryanpcmcquen.org/mirrors/slackware-live/
- * Shasta's http://ftp.slackware.pl/pub/slackware-live/ (%%rsync://ftp.slackware.pl/slackware-live/%%)
===== Enduser Documentation =====
@@ -60,7 +62,7 @@ Common download locations are:
The ISO images are hybrid, which means you can either burn them to DVD, or use 'dd' or 'cp' to copy the ISO to a USB stick. Both methods will give you a live environment which will allow you to make changes and seemingly "write them to disk". The changes will actually be kept in a RAM disk, so a reboot will "reset" the live OS to its original default state. In other words, there is no persistence of data.
-Slackware Live Edition knows two user accounts: "root" and "live". They have passwords, and by default these are... you guessed: "root" and "live". Also by default, the ISOs will boot into runlevel 4, i.e. you will get a graphical login. The bootloader allows you to pick a non-US language and/or keyboard layout and (on boot of an UEFI system) a custom timezone.
+Slackware Live Edition knows two user accounts: "root" and "live". They have passwords, and by default these are... you guessed: "root" and "live". Also by default, the ISOs will boot into runlevel 4, i.e. you will get a graphical login. The bootloader allows you to pick a non-US language and/or keyboard layout and (on boot of an UEFI system) a custom timezone.
Slackware Live Edition deviates as little as possible from a regular Slackware boot. Once you have passed the initial Liveboot stage and brought up the actual OS, you login as user "live". From that moment onwards, you are in a regular Slackware environment.
@@ -71,13 +73,14 @@ Slackware Live Edition deviates as little as possible from a regular Slackware b
=== BIOS boot ===
-Slackware Live Edition uses syslinux to boot the Linux kernel on BIOS computers. To be precise, the "isolinux" variant is installed to the ISO image and the "extlinux" variant is installed into the Linux partition of the USB Live version.
+Slackware Live Edition uses syslinux to boot the Linux kernel on BIOS computers. To be precise, the "isolinux" variant is installed to the ISO image and the "extlinux" variant is installed into the ext4-formatted Linux partition of the USB Live version.
Syslinux shows a graphical boot menu with a nice Slackware-themed background and several options:
- * Start (SLACKWARE | PLASMA5 | XFCE | MATE) Live (depending on which of the ISOs you boot)
+ * Start (SLACKWARE | XFCE | MATE | CINNAMON | DAW | LEAN) Live (depending on which of the ISOs you boot)
* Non-US Keyboard selection
* Non-US Language selection
* Memory test with memtest86+
+ * Console OS in RAM
You can select a keyboard mapping that matches your computer's. Also you can boot Slackware in another language than US English.
If you stick to US English interface language you will probably still want to change the timezone because it will default to UTC. You have to specify a custom timezone manually by adding "tz=YourGeography/YourLocation" because the syslinux bootmenu does not offer you a selection of timezones. Syslinux allows you to edit the boot commandline by pressing <TAB>. Press <ENTER> to boot after you made your changes or <ESC> to discard your edit and return to the menu.
@@ -88,18 +91,66 @@ If you stick to US English interface language you will probably still want to ch
On UEFI computers, Grub2 handles the boot and it will show a menu similar (and similarly themed) to the Syslinux menu:
- * Start (SLACKWARE | PLASMA5 | XFCE | MATE) Live (depending on which of the ISOs you boot)
+ * Start (SLACKWARE | XFCE | MATE | CINNAMON | DAW | LEAN) Live (depending on which of the ISOs you boot)
* Non-US Keyboard selection
* Non-US Language selection
* Non-US Timezone selection
* Memory test with memtest86+
* Help on boot parameters
+ * Console OS in RAM
-Editing a Grub menu before booting it is possible by pressing the "e" key. After making your changes to the boot commandline, press <F10> to boot. To discard your changes, press <ESC>.
+Editing a Grub menu before booting it is possible by pressing the "e" key. After making your changes to the boot commandline, press <F10> or <Ctrl>-<x> to boot. To discard your changes, press <ESC>.
Another difference between Syslinux and Grub2 menus: in Grub2 you can select a non-US keyboard, language and/or timezone and you will return to the main menu every time. You still have to select "Start SLACKWARE Live" to boot the computer. In the Syslinux menu, only the keyboard selection menu will return you to the main menu. Any non-US *language* selection on the other hand will boot you into Slackware Live immediately; without returning to the main menu. This is a limitation of syslinux which would require exponentially more menu files to construct a menu with more choices. Grub2 supports variables which make it easy to modify a menu entry's characteristics.
+=== UEFI Secure Boot ===
+
+
+On computers with Secure Boot enabled, extra measures may be required to boot an Operating System. Slackware for instance, is unable to boot on a computer that has Secure Boot enabled. Historic liveslak based ISOs are also not able to boot there. From liveslak-1.5.0 and onwards, Secure Boot is supported for the 64-bit ISO images.
+
+Secure Boot enforces that the first-stage bootloader is signed with an encryption key known to Microsoft. For Linux based Operating Systems, the most widely used solution is to place an small single-purpose bootloader before the regular Linux bootloader. This EFI bootloader is called 'shim'. Shim must be cryptographically signed by Microsoft for it to successfully boot a computer. This is not a trivial process, Microsoft is very strict about the signing process because in essence your signed bootloader will boot anything on a Secure Boot enabled computer, including malware if that was signed by your 'distro key'. That would create a huge security hole and defy the purpose of Secure Boot.
+
+Signing your Grub bootloader and your kernel also becomes mandatory, because the 'shim' refuses to load un-signed binaries. This complicates the process of upgrading to a new kernel further.
+
+The Slackware Live OS boots on a Secure Boot enabled computer if created with liveslak-1.5.0 or newer, and only for the 64-bit liveslak ISO images. The Slackware Linux distro does not ship a 'shim' which is signed by Microsoft, so how to get around the dilemma of requiring a signed 'shim'?
+
+To realize this, the Slackware Live ISO 'borrows' a 3rd-party 'shim'. The binaryis actually called ''bootx64.efi'' in the ''/EFI/BOOT/'' directory and has been extracted from another distro's officially signed 'shim' package; Fedora by default but the Debian and openSUSE shim are also supported by the ''make_slackware_live.sh'' script. This 3rd-party 'shim' binary has been signed by 'Microsoft UEFI CA' which will allow it to boot on any computer. We just need to tell it that is OK to load Slackware's Grub and kernel into memory.
+
+A distro 'shim' like Fedora's contains an embedded distro SSL certificate and 'shim' will trust the signature of any binary (grub, kernel, etc) which has been signed using that certificate. Of course, 3rd-party 'shim' binaries do not embed a Slackware SSL certificate. Therefore, another means must be used to establish trust. Secure Boot recognizes additional SSL certificates in the computer's MOK (Machine Owner Key) database as valid. The 'shim' trusts custom SSL vertificates of signed binaries, if they are present in the MOK database. It is up to the user (the Machine Owner) to enroll a custom SSL certificate into that database.
+
+The Grub and kernel images of Slackware Live Edition are signed with an 'Alien BOB' SSL certificate and private key. This SSL certificate needs to be added to the MOK database of your Secure Boot enabled computer. All liveslak ISOs use this specific certificate plus its associated private key. The private key will of course never be distributed but a 'DER-encoded' version of the public certificate is distributed as part of the ISO. You can find it as ''/EFI/BOOT/liveslak.der'' inside the ISO. On a persistent USB stick which you created from the ISO, this will be on the second partition (the ESP).
+
+== Add the ''liveslak.der'' certificate to the MOK database ==
+
+There are two ways to add or enroll this certificate.
+ * When you boot a Secure Boot enabled liveslak ISO for the first time, the 'shim' will fail to validate the certificate of liveslak's Grub. It will then start the 'MokManager' showing you a nice blue screen with a dialog requesting you to enroll a public key (aka the SSL certificate) from disk. You can use the file selector to browse to the 'efi' partition and there to the ''./EFI/BOOT/'' directory. Select the ''liveslak.der'' and confirm that this is the correct certificate. The computer will then reboot and after reboot, you will automatically end up in the Grub boot menu without any further intervention.
+ * If you already have a Linux OS up and running on that computer, you can use the program ''mokutil'' to enroll the key before you boot a liveslak ISO:<code>
+# mokutil --import liveslak.der</code>. This command will schedule a request to shim, and the first time you boot a liveslak ISO the MokManager will ask confirmation to enroll the scheduled key. In other words, you won't have to 'enroll from disk'.
+
+Note that MOK key enrollment is a one-time action for the official liveslak based ISOs. All future liveslak ISOs will also be signed using this ''liveslak.der'' certificate and as long as it stays in your computer's MOK database, the 'shim' will load Grub and the kernel without complaint.
+
+Note that you can create your own SSL certificate plus private key and use those to generate custom liveslak ISO images with Secure Boot support. All you need to do is to enroll the public key (the DER-encoded version of your SSL certificate) into the MOK database of your computer. The MOK database has room for multiple keys so yours as well as liveslak's keys (and more) will fit there.
+
+
+=== Boot from an ISO file on disk ===
+
+
+If you downloaded a liveslak ISO file and want to boot that ISO directly from its location on your computer's hard drive, you can use the following Grub configuration block and add it to your ''/boot/grub/grub.cfg'' (the example code assumes you downloaded the XFCE ISO and stored it as ''/data/ISOS/slackware64-live-xfce-current.iso''):<code>
+menuentry " LIVESLAK ISO" --class gnu-linux --class os --class icon-linux {
+ set iso='/data/ISOS/slackware64-live-xfce-current.iso'
+ set bootparms='load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 kbd=us tz=Europe/Amsterdam lang=nl'
+
+ search -f $iso --set=root
+ loopback loop $iso
+ linux (loop)/boot/generic livemedia=scandev:$iso $bootparms
+ initrd (loop)/boot/initrd.img
+}</code>
+This example will add a 'LIVESLAK ISO' menu entry to your local computer's boot menu, through which you can start a XFCE Live ISO which you previously downloaded to directory ''/data/ISOS/'', pre-configured for a US keyboard, Dutch language and Amsterdam timezone. You should of course change the ''bootparms'' string so that it matches your requirements.
+
+Alternatively you could look into Ventoy, which is a tool to create a bootable USB drive containing multiple ISO files. Ventoy allows you to boot from any of these ISOs by automatically generating on every boot a Grub menu containing all the images found on disk. Liveslak is fully Ventoy-compatible. Website: https://www.ventoy.net/ .
+
+
==== Transfering ISO content to USB stick ====
@@ -110,26 +161,47 @@ The USB stick will be erased and re-formatted when running this script (except w
This script, called 'iso2usb.sh', accepts the following parameters: <code>
-c|--crypt size|perc Add a LUKS encrypted /home ; parameter is the
requested size of the container in kB, MB, GB,
- or as a percentage of free space.
- Examples: '-c 125M', '-c 1.3G', '-c 20%'.
+ or as a percentage of free space
+ (integer numbers only).
+ Examples: '-c 125M', '-c 2G', '-c 20%'.
-d|--devices List removable devices on this computer.
-f|--force Ignore most warnings (except the back-out).
-h|--help This help.
-i|--infile <filename> Full path to the ISO image file.
+ -l|--lukshome <name> Custom path to the containerfile for your LUKS
+ encrypted /home (slhome by default).
-o|--outdev <filename> The device name of your USB drive.
- -p|--persistence <name> Custom name of the 'persistence' directory/file.
+ -p|--persistence <name> Custom path to the 'persistence' directory
+ or containerfile (persistence by default).
-r|--refresh Refresh the USB stick with the ISO content.
No formatting, do not touch user content.
-s|--scan Scan for insertion of new USB device instead of
providing a devicename (using option '-o').
-u|--unattended Do not ask any questions.
-v|--verbose Show verbose messages.
- -w|--wait<number> Add <number> seconds wait time to initialize USB.
+ -w|--wait <number> Add <number> seconds wait time to initialize USB.
+ -y|--layout <x,x,x,x> Specify partition layout and sizes (in MB).
+ Default values: '1,100,-1,' for 3 partitions,
+ the '-1' value for partition 3 meaning
+ 'use all remaining space',
+ and an empty 4th value means 'do not reserve
+ free space for a custom 4th partition'.
-C|--cryptpersistfile size|perc
Use a LUKS-encrypted 'persistence' file instead
of a directory (for use on FAT filesystem).
+ Format for size/percentage is the same
+ as for the '-c' parameter.
+ -F|--filesystem <fs> Specify filesystem to create when formatting
+ devices/containers. Defaults to 'ext4',
+ Choices are btrfs,ext2,ext4,f2fs,jfs,xfs.
+ Note that the linux partition will always be
+ formatted as 'ext4' because extlinux is used
+ as the BIOS bootloader.
-P|--persistfile Use an unencrypted 'persistence' file instead
of a directory (for use on FAT filesystem).
+ Persistent data will not be migrated
+ when switching from directory to container file.
+
</code>
Examples:
@@ -139,14 +211,107 @@ Examples:
# ./iso2usb.sh -i slackware64-live-current.iso -o /dev/sdX -c 750M -w 15
* Create a USB Live with an encrypted /home (allocating 30% of the stick's free space for /home) and where the persistent data will be stored in a container file instead of a directory:
# ./iso2usb.sh -i slackware64-live-current.iso -o /dev/sdX -c 30% -P
- * Create a USB Live with both the /home and the persistent data encrypted (the persistence filesystem will be 300 MB in size):
- # ./iso2usb.sh -i slackware64-live-current.iso -o /dev/sdX -c 30% -C 300M
+ * Create a USB Live with both the /home and the persistent data encrypted (the persistence filesystem will be 300 MB in size) using a btrfs filesystem:
+ # ./iso2usb.sh -i slackware64-live-current.iso -o /dev/sdX -F btrfs -c 30% -C 300M
+ * Create a 32bit USB Live but use a custom partition layout: create a 1 MB BIOS boot partition and a 200 MB EFI partition, add a 4th un-used $ GB partition at the end, and allocate all remaining disk space to the main Linux partition:
+ # iso2usb.sh -i slackware-live-current.iso -o /dev/sdX -y 1,200,-1,4096
* Refresh the system modules on a USB Live using a Live ISO as the source. Let the script scan for insertion of a USB stick instead of specifying the device name on the commandline. Note that the addons and optional modules will not be touched by this action:
# ./iso2usb.sh -i slackware64-live-current.iso -r -s
You might have noticed that the "-P" parameter does not accept a size parameter. This is because the unencrypted container file is created as a 'sparse' file that starts at zero size and is allowed to grow dynmically to a maximum of 90% of the initial free space on the Linux partition of the USB stick.
+==== Adding functionality when booting directly off an ISO on disk ====
+
+
+An ISO companion script is available which enables you to add functionality in cases where you want to boot directly from an ISO file. For instance, when having added the ISO file as a selection in your Grub menu, or when using a 3rd-party boot manager like Ventoy. Typically, a Live ISO is immutable (its ISO-9660 filesystem is read-only) and when you boot off it, the Live OS does not have persistence. The system starts in a virgin state, every boot.
+
+The ISO companion script can create encrypted containers for persistence and your homedirectory on the disk partition; that partition can be formatted as VFAT or EXFAT if you want. It also can create a directory structure on-disk from which liveslak can load additional live modules that are not present inside the ISO (both 'addons' and 'optional').
+
+The script is called 'isocomp.sh', and it accepts the following parameters: <code>
+ -d|--directory <path> Create a liveslak directory structure to store
+ additional modules. The parameter value is
+ used as the root path below which the
+ liveslak/{addons,optional} subdirectories
+ will be created.
+ -e|--examples Show some common usage examples.
+ -f|--force Force execution in some cases where the script
+ reports an issue.
+ -h|--help This help text.
+ -i|--iso <fullpath> Full path to your liveslak ISO image.
+ -l|--lukscontainer <fullpath> Full path to encrypted container file to be
+ created by this script, and to be mounted
+ in the live OS under /home
+ (or any other mountpoint you supply).
+ (filename needs to end in '.icc'!).
+ -p|--persistence <fullpath > Full path to encrypted persistence container
+ file to be created in the filesystem
+ (filename extension must be '.icc'!).
+ -x|--extend <fullpath> Full path to existing (encrypted) container
+ file that you want to extend in size.
+ Limitations:
+ - container needs to be LUKS encrypted.
+ - filename needs to end in '.icc'.
+ Supported filesystems inside container:
+ - btrfs,ext2,ext4,f2fs,jfs,xfs.
+ -F|--filesystem <fs> Specify filesystem to create when formatting
+ devices/containers. Defaults to 'ext4',
+ Choices are btrfs,ext2,ext4,f2fs,jfs,xfs.
+ -L|--lcsize <size|perc> Size of LUKS encrypted /home ; value is the
+ requested size of the container in kB, MB, GB,
+ or as a percentage of free space
+ (integer numbers only).
+ Examples: '-L 125M', '-L 2G', '-L 20%'.
+ -P|--perssize <size|perc> Size of persistence container ; value is the
+ requested size of the container in kB, MB, GB,
+ or as a percentage of free space
+ (integer numbers only).
+ Examples: '-P 125M', '-P 2G', '-P 20%'.
+ -X|--extendsize <size|perc> Extend size of existing container; value
+ is the requested extension of the container
+ in kB, MB, GB, or as percentage of free space
+ (integer numbers only).
+ Examples: '-X 125M', '-X 2G', '-X 20%'.
+</code>
+Some examples of what the script can do, are given when you run the script with the '-e' or '--examples' parameter. Here is an overview of those example commands. First, mount your USB partition, for instance a Ventoy disk will be mounted for you at /run/media/<user>/Ventoy/. Then:
+
+ * Create a 1GB encrypted persistence container:
+ # ./isocomp.sh -p /run/media/<user>/Ventoy/myfiles/persistence.icc -P 1G
+ * Create a 4GB encrypted home with btrfs filesystem:
+ # ./isocomp.sh -l /run/media/<user>/Ventoy/somedir/lukscontainers.icc -L 4000M -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+ * Increase the size of that encrypted home container with another 2GB:
+ # ./isocomp.sh -x /run/media/<user>/Ventoy/somedir/lukscontainers.icc -X 2G -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+ * Create a 10GB encrypted container to be mounted on /data in the Live OS:
+ # ./isocomp.sh -l /run/media/<user>/Ventoy/somedir/mydata.icc:/data -L 10G -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+ * Create a liveslak directory structure for adding extra live modules:
+ # ./isocomp.sh -d /run/media/<user>/Ventoy/myliveslak -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+
+These enhancements are recorded in a configuration file next to the ISO, with the exact same name as that ISO but with extension '.cfg' instead of '.iso'. You can manually edit this configuration file if you want; the script will not change, remove or overwrite your customizations.
+
+Here is an example configuration file content: <code>
+# Liveslak ISO configuration file for SLACKWARE-CURRENT FOR X86_64 (LEAN LIVE 1.5.4)
+# Generated by isocomp.sh on 20220814_1554
+LIVESLAKROOT=/liveslak
+LUKSVOL=/liveslak/myhome.icc:/home
+ISOPERSISTENCE=/liveslak/persistence.icc
+TZ=Europe/Amsterdam
+</code>
+Note that this configuration file example is not complete; you can manually add custom values for the following additional liveslak parameters which avoids having to enter the corresponding boot parameters manually every time: BLACKLIST, KEYMAP, LIVE_HOSTNAME, LIVESLAKROOT, LOAD, LOCALE, LUKSVOL, NOLOAD, ISOPERSISTENCE, RUNLEVEL, TWEAKS, TZ and XKB.
+
+
+==== Using the Live OS to install Slackware to hard disk ====
+
+
+All variants of Slackware Live Edition contain a script "setup2hd", a tweaked version of the regular Slackware setup program.
+The "setup2hd" script supports regular Slackware network installations. In addition it allows you to install the Slackware release on which the Live OS is based, to the computer's local hard disk. You must boot the Live OS first, and then start ''setup2hd'' either in an X Terminal in your graphical Desktop Environment (aka Runlevel 4), or from the console in Runlevel 3. The fact that you can start "setup2hd" from a graphical terminal means that during installation, you can continue browsing, listening to music, watching video, reading an e-book or whatever else makes you pass the time.
+
+The 'setup2hd' program has some capabilities that the original Slackware 'setup' lacks:
+ * It will launch fdisk/gdisk if you forgot to create Linux partitions in advance;
+ * It will optionally install a firewall for which the configuration is based on your answers to a few questions;
+ * It will allow you to create a regular user account and set its password;
+ * It will prompt you to set the root password in a graphical dialog.
+
+
==== Updating the kernel (and more) on a USB stick ====
@@ -157,6 +322,7 @@ Specifically, the script is able to:
* Restore the backed-up kernel and modules if the new kernel is not working.
* Add network support modules for PXE boot (if missing).
* Increase (or decrease) USB wait time during boot.
+ * Extend the size of any of the encrypted containers on the USB Live stick, in case such a container is running out of storage space and there's still room on the USB disk partition for the expansion.
* Replace the Live init script inside the initrd image with a new script that you supply.
* Move current persistence data to a new squashfs module in 'addons' afther which the persistence store will be re-initialized. The new module's name is time-stamped (/liveslak/addons/0099-slackware__customchanges-yymmddHHMMSS.sxz) so that this action can be repeated many times.
@@ -167,6 +333,7 @@ Before making any modifications, the script will show you a prompt at which poin
This script, called 'upslak.sh', accepts the following parameters: <code>
-b|--nobackup Do not try to backup original kernel and modules.
-d|--devices List removable devices on this computer.
+ -e|--examples Show some common usage examples.
-h|--help This help.
-i|--init <filename> Replacement init script.
-k|--kernel <filename> The kernel file (or package).
@@ -179,6 +346,26 @@ This script, called 'upslak.sh', accepts the following parameters: <code>
providing a devicename (using option '-o').
-v|--verbose Show verbose messages.
-w|--wait<number> Add <number> seconds wait time to initialize USB.
+ -x|--extend <fullpath> Full path (either in your filesystem or else
+ relative to the USB partition root)
+ to an existing (encrypted) container file,
+ whose size you want to extend.
+ Limitations:
+ - container needs to be LUKS encrypted.
+ - filename extension needs to be '.img'.
+ Supported filesystems inside container:
+ - btrfs,ext2,ext4,f2fs,jfs,xfs.
+ -N|--nolivemods Don't create an addon live module containing
+ the new kernelmodules. Normally you *will* need
+ this addon module, *unless* you have already
+ installed these kernel-modules in the Live OS.
+ FYI: the kernel and module upgrade applies only
+ to the USB boot kernel and its initrd.
+ -X|--extendsize <size|perc> Extend size of existing container; value
+ is the requested extension of the container
+ in kB, MB, GB, or as percentage of free space
+ (integer numbers only).
+ Examples: '-X 125M', '-X 2G', '-X 20%'.
</code>
Examples:
@@ -189,7 +376,10 @@ Examples:
* Restore the previous kernel and modules after a failed update, and let the script scan your computer for the insertion of your USB stick:
# ./upslak.sh -s -r
* Replace the Live init script with the latest template taken from the git repository:
- # ./upslak.sh -o /dev/sdX -i liveslak/liveinit.tpl
+ # wget https://git.liveslak.org/liveslak/plain/liveinit.tpl
+ # ./upslak.sh -o /dev/sdX -i liveinit.tpl
+ * Extend the size of the pre-existing LUKS container for your homedirectory with 3 GB, and let the script scan for the insertion of your USB stick:
+ # ./upslak.sh -s -x /slhome.img -X 3G
==== PXE booting the Live OS ====
@@ -234,7 +424,7 @@ How to start the PXE server?
When you boot the Live OS you can then start a script "pxeserver" from the console in runlevel 3 or from an X terminal in runlevel 4. The script will gather all required information and if it is unable to figure something out by itself it will ask you. If it is unable to figure out the wired network interface that it should use, you can add the name of your interface (for instance, eth1) as a single parameter to the script when you start it.
-The PXE server uses dnsmasq to offer DNS to the PXE clients. The dnsmasq program will enable its internal DHCP server capabilities if your LAN does not have its own DHCP server. Dnsmasq will also start a TFTP server which the PXE clients will connect to in order to retrieve the boot files (kernel and initrd). The ''pxeserver'' script also starts a NFS server which will be used by the Live initrd to obtain the squashfs modules and boot the Live OS. If your PXE server has multiple network interfaces, for instance a wireless interface which is connected to the outside world and a wired interface connected to another computer which will become a PXE client (or indeed connected to a switch with a whole bunch of prospective PXE clients behind that) then the PXE server will setup packet forwarding so that the PXE clients will be able to access the outside world through the wired interface and out to that other interface.
+The PXE server uses dnsmasq to offer DNS to the PXE clients. The dnsmasq program will enable its internal DHCP server capabilities if your LAN does not have its own DHCP server. Dnsmasq will also start a TFTP server which the PXE clients will connect to in order to retrieve the boot files (kernel and initrd). The ''pxeserver'' script also starts a NFS server which will be used by the Live initrd to obtain the squashfs modules and boot the Live OS. If your PXE server has multiple network interfaces, for instance a wireless interface which is connected to the outside world and a wired interface connected to another computer which will become a PXE client (or indeed connected to a switch with a whole bunch of prospective PXE clients behind that) then the PXE server will setup packet forwarding so that the PXE clients will be able to access the outside world through the wired interface and out to that other interface. If the PXE clients are unable to access the Internet using this default IP packet forwarding configuration, you may want to answer with 'YES' to the question during pxeserver's configuration when it asks you if you want to hide the PXE clients behind a NAT router.
If you have multiple network interfaces, it is important to know that dnsmasq will only bind to the interface where you want PXE clients to connect to. In a multi-NIC situation where a second NIC is connected to the outside world (your local network), this means that the DHCP/DNS server started by dnsmasq will not interfere with an existing DHCP server in your local network.
@@ -271,12 +461,14 @@ You can still set just the XkbVariant by adding something like "kbd=ch xkb=,fr"
livepw="somestring" => Change the password for user "live".
The password is passed as a cleartext string.
+ You can pass an empty string (livepw=) to remove the password.
locale=nl_NL kbd=nl tz=Europe/Amsterdam => Example of language,
keyboard and/or timezone customization.
rootpw="somestring" => Change the password for user "root".
The password is passed as a cleartext string.
+ You can pass an empty string (rootpw=) to remove the password.
=== Custom software ===
@@ -335,6 +527,9 @@ cfg=[skip|write] =>
OS parameters; or specify 'write' to write current OS parameters
to disk.
+domain=your_custom_domain =>
+ Specify a custom domain name. Defaults to 'home.arpa'.
+
hostname=your_custom_hostname[,qualifier] =>
Specify a custom hostname. A qualifier 'fixed' can be appended
to prohibit hostname modification in case of network boot.
@@ -370,9 +565,24 @@ nop=wipe => Wipe all data from persistence directory or container.
persistence=name => Use this if you are using a different
directory/file than "persistence" for storing persistent data.
+persistence=/dev/sdX:/path/to/mypersistence
+persistence=scandev:/path/to/mypersistence => Use this if
+ the persistence directory or container is not located on the USB stick,
+ but on a local hard disk partition. Useful for network (PXE) boot
+ where you still want to offer users persistence.
+
toram => copy the OS from the media to to RAM before running it.
You can remove the boot media after booting.
+toram=all => Prevent writes to disk since we are supposed to run from RAM;
+ equivalent to parameter "toram".
+
+toram=core => Load Console OS modules into RAM. Console-only Slackware
+ loads fast, contains 'setup2hd' and frees up your USB drive so you can
+ overwrite it with a Persistent Live OS.
+
+toram=os => Load OS modules into RAM, but write persistent data to USB.
+
=== Troubleshooting ===
blacklist=mod1[,mod2[...]] => Add one or more kernel modules
@@ -381,9 +591,12 @@ blacklist=mod1[,mod2[...]] => Add one or more kernel modules
debug => During init, pause at strategic locations while
assembling the overlay filesystem and show mount information.
+ Equivalent to 'debug=1'.
-debug=<number> => '2' enables verbose script execution;
- '4' dumps you into a debug shell right before the switch_root.
+debug=<number> => '2' and higher enable verbose script execution;
+ '3' adds pauses like '1' or '2' but won't show blkid/mount info;
+ '4' dumps you into a debug shell right before the switch_root;
+ '5' saves verbose init execution output to 'debug_init.log'
rescue => After initialization, you will be dropped in a
rescue shell to perform lowlevel maintenance.
@@ -421,7 +634,7 @@ The USB variant with persistence may have an additional directory in the root:
The first script:
The script "make_slackware_live.sh" creates an ISO file as its output which contains the Live OS.
-Thanks to Linux kernel 4.x and the squashfs-tools package in Slackware, the process of creating a Slackware Live ISO requires **no** (re)compilation of Slackware content or installing 3rd party packages.
+Thanks to Linux kernel >= 4.x and the squashfs-tools package in Slackware, the process of creating a Slackware Live ISO requires **no** (re)compilation of Slackware content or installing 3rd party packages.
The script's inner workings can be subdivided into several distinct stages. For the full Slackware ISO the process stages are as follows:
@@ -451,8 +664,8 @@ Stage two:
* 'root' and 'live' user accounts are created,
* an initial environment for the accounts is configured,
* the desktop environment is pre-configured for first use,
- * the liveslak scripts "makemod", "iso2usb.sh" and "upslak.sh" are copied to "/usr/local/sbin/" in the ISO for your convenience,
- * if the Live system contains a huge kernel (all ISO variants except XFCE) then the "setup2hd" script and the Slackware installer files are copied to "/usr/local/sbin" and "/usr/share/liveslak" respectively,
+ * the liveslak scripts "makemod", "iso2usb.sh", "isocomp.sh", "upslak.sh" and "pxeserver" are copied to "/usr/local/sbin/" in the ISO for your convenience,
+ * The "setup2hd" script and the Slackware installer files are copied to "/usr/local/sbin" and "/usr/share/liveslak" respectively.
* slackpkg is configured,
* a locate database is created,
* etc...
@@ -473,7 +686,7 @@ Stage three:
Stage four:
- * a bootable ISO file is created using mkisofs.
+ * a bootable ISO file is created using mkisofs or xorriso.
* the "isohybrid" command is run on the ISO so that you can "dd" or "cp" the ISO to a USB stick and thus create a bootable USB media.
Done! You can find the ISO file and its MD5 checksum in the /tmp directory.
@@ -494,9 +707,10 @@ The "iso2usb.sh" script wipes and re-partitions the USB stick unless the "-r" or
* First partition: a small (1 MB in size) FAT partition which is not used for Slackware Live Edition. It can be used by an alternative bootloader if needed. You can also store your LUKS keyfile on it to unlock a LUKS-encrypted Slackware Linux computer (see the README_CRYPT.TXT file on your Slackware DVD for more information on LUKS keyfiles).
* Second partition: a 100 MB VFAT partition containing the kernel, initrd and all the other stuff required by syslinux and grub2 to boot Slackware Live Edition.
- * Third partition: a Linux partition taking up all of the remaining space. It contains the actual liveslak modules, the persistent live storage and optionally your encrypted homedirectory. You can use the remainder of this Linux ext4 filesystem's free space to store anything you like.
+ * Third partition: a Linux partition which by default takes up all of the remaining space. It contains the actual liveslak modules, the persistent live storage and optionally your encrypted homedirectory. You can use the remainder of this Linux ext4 filesystem's free space to store anything you like.
+ * Fourth partition is optional: using the ''-y|--layout'' commandline parameter you can create a un-used partition at the end of the USB disk which is all yours to format and use. This layout parameter allows you to specify partition sizes.
-Note that this script is the only supported method of transfering the liveslak ISO content to a USB stick and make that USB stick into a persistent live OS. Several 3rd party tools (like multibootusb, rufus, unetbootin) that claim to be able to mix several Live OS'es on a single USB stick and make them all work in a multi-boot setup, are not currently supporting liveslak.
+Note that this script extracts the ISO contents to transform a USB stick into into a persistent live OS. This is a destructive process, erasing all previously available content on that stick. Several 3rd party tools (like multibootusb, rufus, unetbootin) that claim to be able to mix several Live OS'es on a single USB stick and make them all work in a multi-boot setup, are not currently supporting liveslak. Ventoy on the other hand, is fully supported by liveslak and therefore your best bet if you don't want to wipe your data off your USB stick. As a bonus, the ''isocomp.sh'' script is able to add persistence to a liveslak ISO on a Ventoy boot disk.
== Mounting a filesystem in an encrypted container ==
@@ -517,11 +731,48 @@ A second type of encrypted container exists, which can be used for storing your
For slow USB media, the default 5 seconds wait time during boot are sometimes insufficient to allow the kernel to detect the partitions on your USB device. The script can optionally add more wait time. It does this by editing the file "wait-for-root" in the initrd and updating the value which is stored there (by default "5" is written there by the "make_slackware_live.sh" script).
-=== makemod ===
+=== isocomp.sh ===
The third script:
+The "isocomp.sh" script's runtime usage is explained in detail in a previous paragraph "Adding functionality when booting directly off an ISO on disk".
+
+This section explains the inner workings of the script to enhance the functionality of booting directly from ISO.
+
+== Secondary liveslak root directory ==
+
+A secondary liveslak root directory can be created by the 'isocomp.sh' script: in the same filsystem where the ISO file is also present. The ISO contains the primary liveslak root, below which you will find directories 'system', 'addons', 'optional', 'core2ram' and so on. The secondary liveslak root can not contain a 'system' subdirectory but it can contain 'addons', 'optional', 'core2ram'.
+
+Additional Live modules can be placed in these directories. These will be loaded by the Live init after processing corresponding module locations below the primary liveslak root. Meaning, you can load all kinds of additional software without having to modify the official Live ISO.
+
+== Using container files for persistence or homedirectory ==
+
+Two types of encrypted container are supported by 'isocomp.sh', just like with the 'iso2usb.sh' script: to be used either for storing the Live OS persistence data, or for providing (additional) persistent storage space at a mount point such as ''/home''. Also, the functionality of the Live init has been extended to deal with all this.
+
+The sequence is as follows:
+ - Live init checks if the OS was booted from an ISO file.
+ - If yes, init will additionally check for the existence of an ISO configuration file with the same name as the ISO except its extension (which needs to be '.cfg' instead of '.iso').
+ - If the configuration file defines the ISOPERSISTENCE variable, Live init expects its value to be a container file which will be used to store the modifications to the Live OS persistently, instead of writing those to a RAM disk.
+ - If the configuration file defines the LUKSVOL variable, Live init parses it and mounts all container files defined in there at the mountpoints specified (or ''/home'' if not specified).
+ - If init determines that it deals with a LUKS-encrypted container, init asks you for its unlock passphrase.
+
+== Creating an encrypted container ==
+
+The script will create a file of requested size in the same disk partition that also contains the Live ISO, using the 'dd' command. A new loopback device is requested from the OS and the freshly created container file is mapped to the loop device using 'losetup'. The 'cryptsetup luksCreate' command initializes the encryption on this loop device, which causes the script to prompt you with "are you sure, type uppercase YES". After receiving your confirmation, cryptsetup requests you to enter an encryption passphrase three times (two for intializing, and one for unlocking the container subsequently).
+
+If the container is used for an encrypted /home, the script will copy the existing content of the ISO's /home into the container's filesystem which will later be mounted on top of the ISO's /home (thereby masking the existing /home).
+
+== Extending the size of an existing container file ==
+
+The 'isocomp.sh' script is able to extend your encrypted containers if you are running out of space on their enclosed filesystems. It does this by appending random bytes to the end of the file, unlocking and mounting the filesystem inside, and then resizing that filesystem so it grows to the new size of the container.
+
+
+=== makemod ===
+
+
+The fourth script:
+
The "makemod" script allows you to create a Slackware Live module easily, with a Slackware package or a directory tree as its input parameter.
Usage:
@@ -529,7 +780,7 @@ Usage:
* The first parameter is either the full path to a Slackware package, or else a directory.
* If a packagename is supplied as first parameter, it will be installed into a temporary directory using Slackware's "installpkg". The content of the temporary directory will be squashed into a module by the "squashfs" program.
- * If a directoryname is supplied, its content will be squashed into a module by the "squashfs" program..
+ * If a directoryname is supplied, its content will be squashed into a module by the "squashfs" program.
* The second parameter is the full pathname of the output module which will be created.
You can copy the module you just created (minding the filename conventions for a Slackware Live module, see paragraph "Slackware Live module format") to either the optional/ or to the addon/ directory of your Live OS. If you copy it to the optional/ or addon/ directory of the liveslak sources then "make_slackware_live.sh" will use the module when creating the ISO image.
@@ -538,15 +789,17 @@ You can copy the module you just created (minding the filename conventions for a
=== setup2hd ===
-The fourth script:
+The fifth script:
-The "setup2hd" script enables you to install the running Live OS to the computer's local hard disk. The "setup2hd" is a modified Slackware installer, so you will be comfortable with the process. There is no 'SOURCE' selection because the script knows where to find the squashfs modules. After you select the target partition(s), every active module of the Live OS variant (SLACKWARE, PLASMA5, MATE, ...) is extracted to the hard drive. After extraction has completed, the script summarizes how many modules have been extracted. It will also show an example command to extract any remaining inactive or disabled modules manually. The final step in the installation is again the stock Slackware installer which kicks off the Slackware configuration scripts.
+The "setup2hd" script is a modified Slackware installer, so you will be comfortable with the process. The 'SOURCE' section offers two types of choices: a regular Slackware network installation using a NFS, HTTP, FTP or Samba server, as well as a choice of installing the Live OS which you are running. The script knows where to find the squashfs modules, so the "Install Live OS" selection will not prompt further inputs.
+ * The Slackware network installation is identical to that of the official Slackware installation medium.
+ * If you chose to install the Live OS, then after you select the target partition(s), every active module of the Live OS variant (SLACKWARE, KTOWN, MATE, ...) is extracted to the hard drive. After extraction has completed, the script summarizes how many modules have been extracted. It will also show an example command to extract any remaining inactive or disabled modules manually. The final step in the installation is again the stock Slackware installer which kicks off the Slackware configuration scripts.
=== pxeserver ===
-The fifth script:
+The sixth script:
The ''pxeserver'' script works as follows:
* It requires a wired network; wireless PXE boot is impossible.
@@ -559,6 +812,7 @@ The ''pxeserver'' script works as follows:
* dnsmasq providing DNS, DHCP and BOOTP;
* NFS and RPC daemons;
* The script will detect if you have an outside network connection on another interface and will enable IP forwarding if needed, so that the PXE clients will also have network access.
+ * The script can optionally setup NAT routing - masquerading the PXE clients from the outside world - if regular IP packet forwarding is not making the outside network accessible to PXE clients.
* The Live OS booted via pxelinux is configured with additional boot parameters: <code>
nfsroot=<server_ip_address>:/mnt/livemedia
luksvol=
@@ -574,7 +828,7 @@ kbd=<server_kbd_layout>
=== upslak.sh ===
-The sixth script:
+The seventh script:
The "upslak.sh" script's runtime usage is explained in detail in a previous paragraph "Updating the kernel (and more) on a USB stick".
@@ -586,14 +840,18 @@ When the script is started, it will do some sanity checks and then extracts the
* the current USB wait time is checked.
Depending on the parameters passed to the script, it will then perform one or more of the following actions:
-== Update the kernel and moules ==
+== Update the kernel and modules ==
You can provide a new kernel and its modules in two ways. The '-k' option accepts a kernel image file or else a Slackware package contaning a kernel. The '-m' option accepts a directory tree of modules below "/lib/modules/, or else a Slackware package containing kernel modules.
If there is sufficient space on the Linux and EFI partitions, the script will make a backup of the current kernel and modules by renaming the kernel and the module directory with a ".prev" suffix. Sufficient space means that at least 10 MB of free space must remain on the partition(s) after making the backup and installing the new kernel plus modules. If space is an issue, you can skip making a backup by providing the '-b' parameter to the script (a possibly unsafe choice).
+Note that these new kernel-modules will be added to the initrd image (they are needed when booting the new kernel). In order for the Live OS to keep working with the new kernel however, these new kernel-modules must also be made available to the Live OS. The script achieves this by creating a '''kernelmodules''' squashfs module and copying the module into the '''addons''' directory of the liveslak installation on your USB stick. When the Live OS boots, the kernelmodules will then automatically be merged into the live filesystem.
+It is possible to skip the creation of this squashfs module via the '-N' switch to the script.
+
== Restore backed-up kernel and modules ==
If a backup was made of kernel and modules, the upslak.sh script is able to restore these using the '-r' option, thereby removing the replacements. This comes in handy when the replacement kernel turns out to be non-functional.
+Note that restoring the old kernel and its modules will leave an orphaned squashfs kernelmodule in liveslak's '''addons''' directory. You can safely delete that file.
== Add network support modules ==
@@ -607,6 +865,10 @@ Similar to the functionality of the "iso2usb.sh" script, the "upslak.sh" script
The init script inside the initrd image is the core of liveslak. The init script prepares the Live filesystem and configures several run-time OS parameters. If you have made modifications to this init script you can easily replace the default init script with your own script using the '-i' option. The "upslak.sh" script is smart enough to recognize a iveslak template as input. The ".tpl" extension of some liveslak files means that these are templates. They are not usable as-is, because they contain placeholder strings like "@VERSION@" or "@DISTRO@" that first need to be replaced with real values. The "upslak.sh" script will take care of these substitutions.
+== Extend the size of an existing LUKS container ==
+
+Your Slackware Live USB stick will probably have two LUKS containers: one for your ''/home'' directory and the other to store persistent data. If space is running out inside such a container, you can use the '-x' and '-X' parameters to the script to indicate the relevant container and provide a size increase for it. Your data inside the container is safe; the filesystem inside it will be extended and this does not touch existing file data.
+
== Wrap persistence data into a new squashfs module ==
Persistence data will accumulate over time on the USB stick. That is perfectly OK, and you can wipe it on boot if that is needed. But sometimes you want to capture the packages you installed into the persistent storage, and create a new squashfs module out of them. The "upslak.sh" script is able to move your persistence data into a new squashfs module using the '-p' option. The new module will be created in the "/liveslak/addons/" directory so that it will be loaded into the Live OS everytime your USB Live boots up. After creating the new module, the persistence store will be re-initialized (i.e. its content will be erased on the next boot). The new module's name is time-stamped (/liveslak/addons/0099-slackware__customchanges-yyyymmddHHMMSS.sxz where yyyymmddHHMMSS is the timestamp) so that this action can be repeated as many times as you want.
@@ -619,7 +881,7 @@ Creating an ISO image of Slackware Live Edition requires that you are running Sl
You also need the "liveslak" script collection which can be downloaded from any of the links at the bottom of this page.
-Liveslak is a directory tree containing scripts, bitmaps and configuration files. Only 6 scripts are meant to be run by you, the user. These scripts ("make_slackware_live.sh", "iso2usb.sh", "makemod", "setup2hd", "pxeserver" and "upslak.sh) are explained in more detail in the section "Scripts and tools" higher up. When creating a Live ISO from scratch, you only need to run the "make_slackware_live.sh" script.
+Liveslak is a directory tree containing scripts, bitmaps and configuration files. Only 7 scripts are meant to be run by you, the user. These scripts ("make_slackware_live.sh", "iso2usb.sh", "isocomp.sh", "makemod", "setup2hd", "pxeserver" and "upslak.sh) are explained in more detail in the section "Scripts and tools" higher up. When creating a Live ISO from scratch, you only need to run the "make_slackware_live.sh" script.
=== Liveslak sources layout ===
@@ -629,10 +891,14 @@ The toplevel 'liveslak' directory contains the following subdirectories:
* EFI/ - contains the skeleton for boot support on UEFI computers. Some of the UEFI configuration files are dynamically generated by the "make_slackware_live.sh" script.
* README.txt - this documentation.
* addons/ - squashfs modules placed in this directory will be loaded into the Live filesystem when the OS boots.
+ * contrib/ - contributed scripts that are not used directly for the creation and usage of a Live ISO.
* graphics/ - squashfs modules for proprietary GPU support (Nvidia) can be placed here. The module(s) will be copied to addons/ by the "make_slackware_live.sh" script for any Live Desktop Environment (except pure Slackware) that might profit from proprietary driver support.
* local64/ , local/ - these directories can contain Slackware packages considered 'local' i.e. not belonging to any repository. The package(s) will be converted to squashfs module(s) by the "make_slackware_live.sh" script, copied to the "addons/" subdirectory in the ISO and loaded into the Live filesystem when the OS boots.
+ * media/ - scripts and images that are specific to a Live variant.
* optional/ - squashfs modules placed in this directory will not automatically be loaded into the Live filesystem when the OS boots. You need to pass "load=[mod]" boot parameter to load any of these.
+ * patches/ - patches for Slackware scripts that need modifications to run inside a Live OS.
* pkglists/ - definition files of 3rd party repositories (*.conf) and the package lists to be used from those repositories (*.lst) must be placed in this directory.
+ * setup2hd/ - script templates used by the ''setup2hd'' disk installer.
* skel/ - contains compressed tarballs (whose filenames must match wildcard "skel*.txz"). These files will be extracted to the "/etc/skel" directory in the Live filesystem.
* syslinux/ - contains the skeleton for boot support on BIOS computers. Some of its files are dynamically generated by the "make_slackware_live.sh" script.
* xdm/ - graphical Slackware theme for the XDM graphical session manager for those ISO variants which do not ship with GDM, KDM or SDDM.
@@ -641,6 +907,7 @@ The toplevel 'liveslak' directory contains the following files:
* blueSW-128px.png , blueSW-64px.png - these are bitmaps of the Slackware "Blue S" logo, used for the "live" user icon and in the XDM theme.
* grub.tpl - the template file which is used to generate the grub menu for UEFI boot.
* iso2usb.sh - this script creates a bootable USB version wih persistence from a Slackware Live ISO.
+ * isocomp.sh - when you boot directly from a Slackware Live ISO using Grub or a multi-boot manager like Ventoy, this script adds capabilities like persistence, an encrypted home, and the ability to load further live modules from disk.
* languages - this file contains the input configuration for language support. One language per line contains the following fields: "code:name:kbd:tz:locale:xkb". Example: "nl:nederlands:nl:Europe/Amsterdam:nl_NL.utf8:"
* code = 2-letter language code
* name = descriptive name of the language
@@ -655,7 +922,8 @@ The toplevel 'liveslak' directory contains the following files:
* menu.tpl - template which is used to generate the syslinux boot menu for BIOS computers.
* pxeserver.tpl - template to generate the script that starts a PXE server allowing other computers to boot Slackware Live over the network.
* setup2hd.tpl - template to generate the script you use to install your Slackware Live to a harddisk.
- * setup2hd.local - here a developer of a custom Live OS can override the default post-installation routine by (re-)defining the function "live_post_install()" in the ''setup2hd'' script.
+ * setup2hd.local.tpl - here a developer of a custom Live OS can override the default post-installation routine by (re-)defining the function "live_post_install()" in the ''setup2hd'' script.
+ * upslak.sh - a script which allows you to tweak the content of a USB Live stick.
=== Generate the ISO ===
@@ -668,27 +936,34 @@ The script's parameters are:
Use i586 for a 32bit ISO, x86_64 for 64bit.
-c comp Squashfs compression (default: xz).
Can be any of 'gzip lzma lzo xz zstd'.
- -d desktoptype SLACKWARE (full Slack), KDE4 (basic KDE4),
- XFCE (basic XFCE), PLASMA5 (KDE Plasma5 replaces KDE4),
- MATE (Gnome2 fork replaces KDE4), CINNAMON (fork of Gnome3
- Shell replaces KDE4), DLACK (adds Gnome3, PAM and systemd).
+ -d desktoptype SLACKWARE (full Slack), LEAN (basic Plasma5/XFCE),
+ DAW (Digital Audio Workstation), XFCE (basic XFCE,
+ stripped), KTOWN (ktown Plasma5 replacement), MATE
+ (Gnome2 fork replaces KDE), CINNAMON (fork of Gnome3 Shell
+ replaces KDE), DLACK (Gnome3 replaces KDE),
+ STUDIOWARE (Multimedia Studio).
-e Use ISO boot-load-size of 32 for computers
where the ISO won't boot otherwise (default: 4).
-f Forced re-generation of all squashfs modules,
custom configurations and new initrd.img.
-l <localization> Enable a different default localization
- (script-default is 'us').
+ (script-default is 'en').
-m pkglst[,pkglst] Add modules defined by pkglists/<pkglst>,...
-r series[,series] Refresh only one or a few package series.
-s slackrepo_dir Directory containing Slackware repository.
- -t <doc|mandoc> Trim the ISO (remove man and/or doc).
+ -t <none|doc|mandoc|waste|bloat>
+ Trim the ISO (remove man, doc, waste and/or bloat).
-v Show debug/error output.
-z version Define your Slackware version (default: current).
- -G Generate ISO file from existing directory tree
+ -C Add RAM-based Console OS to boot menu.
+ -G Generate ISO file from existing directory tree.
-H hostname Hostname of the Live OS (default: darkstar).
-M Add multilib (x86_64 only).
-O outfile Custom filename for the ISO.
-R runlevel Runlevel to boot into (default: 4).
+ -S privkey:cert Enable SecureBoot support and sign binaries
+ using the full path to colon-separated
+ private key and certificate files.
-X Use xorriso instead of mkisofs/isohybrid.
</code>
@@ -703,6 +978,9 @@ When all pre-reqs are met, you issue a single command to generate the ISO. The
Another example which creates a MATE variant, configuring runlevel '3' as default and specifying a custom path for the Slackware package repository root (note that the script will look for a subdirectory "slackware64-current" below this directory if you are generating this ISO for slackware64-current):
# ./make_slackware_live.sh -d MATE -R 3 -s ~ftp/pub/Slackware
+An example on how to create a DAW Live ISO which supports UEFI SecureBoot (since liveslak 1.5.0 and only for 64-bit), is compressed using 'zstd' instead of the default 'xz' and is generated using xorriso instead of mkisofs. You need to provide the full path to a SSL private key and certificate file:
+ # ./make_slackware_live.sh -d DAW -c zstd -X -S /root/liveslak.key:/root/liveslak.pem
+
If you want to know what package sets are included in any of these Desktop Environments, run the following command:
# grep ^SEQ_ make_slackware_live.sh
for MATE, you will find:
@@ -710,12 +988,16 @@ for MATE, you will find:
Which means that most of the Slackware package series (excepting kde and kdei) will be installed from their tagfiles, and on top of that two package lists are installed from the pkglists/ subdirectory: slackextra and mate. Lastly, "slackpkg+" will be installed from a local directory.
-==== Using the Customization Feature of the Live OS ====
+==== Using the Customization Features of the Live OS ====
+
+
+=== Master configuration file ===
You can create your own custom Live OS by changing its characteristics in the configuration file "make_slackware_live.conf". Among the things you can change are:
- * The name of the Desktop variant (the script itself knows SLACKWARE, PLASMA5, XFCE, MATE, CINNAMON, STUDIOWARE and DLACK),
+ * The name of the Desktop variant (the script itself knows SLACKWARE, LEAN, KTOWN, DAW, XFCE, MATE, CINNAMON, STUDIOWARE and DLACK),
* The list(s) of packages used for your custom distribution,
+ * The full name of the user (by default that is "Slackware Live User"),
* The name of the useraccount (by default that is "live"),
* The name of the distribution (by default that is "slackware"),
* And finally you can define a function "custom_config()" where you can add all your costom post-installation steps that are not covered in the "make_slackware_live.sh" script itself.
@@ -764,6 +1046,29 @@ This is the section in ''make_slackware_live.conf'' which deals with these custo
#}
</code>
+=== Customizing the list of used packages ===
+
+Any liveslak ISO variant contains a specific set of Slackware packages, as defined in the various ''SEQ_*'' variables used in the ''make_slackware_live.sh'' script. Your customized Live OS will be using variable "''SEQ_CUSTOM''".
+
+Let's breakdown the definition of such a variable to explain how to customize the package set for your own live ISO.
+
+The list of packages in the MATE ISO for instance, is defined by the ''SEQ_MSB'' variable (//MSB// stands for //Mate Slack Build//). Its value is as follows: <code>
+# grep ^SEQ_MSB make_slackware_live.sh
+SEQ_MSB="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap,xfce,y pkglist:slackextra,mate local:slackpkg+"</code>
+
+Three keywords can be identified in the value of a ''SEQ_*'' variable, and these determine where the packages to be installed are going to be searched for:
+ * tagfile - this is an Slackware tagfile for a complete package series. For instance, using "tagfile:ap" means: install all packages in the **AP** series.
+ * pkglist - this is a list of packages to be installed from the Slackware distro itself or from a Slackware-compatible 3rd-party repository. The file containing that package list is searched in the ''./pkglists/'' subdirectory of the liveslak toplevel directory. For instance, using "pkglist:mate" means: install all packages mentioned in the file ''./pkglists/mate.lst''. If there is no matching ''./pkglists/mate.conf'' file then the packages are assumed to be present in the Slackware distro directory. Else the ".conf" file is parsed and the variables that are defined in the ".conf" file will be used while generating the ISO. Most importantly, "''SL_REPO_URL''" will contain the rsync URI pointing to the 3rd-party repository where the requested packages can be downloaded.
+ * local - some packages can not be found in Slackware-compatible repositories. The "local" keyword alows you to install packages from a subdirectory of the liveslak toplevel directory. For instance, using "local:slackpkg+" means: install all packages found in subdirectory ''./local/slackpkg+/'' or if you are generating a 64bit live ISO, install all packages found in directory ''./local64/slackpkg+/''.
+
+For the value of a ''SEQ_*'' variable, any combination of these keywords can be used. Every keyword is followed by a colon, and that is followed by a comma-separated list of relevant package definitions. They are all separated by spaces.
+
+=== Custom background images ===
+
+The Plasma5 based Live variants allow customization of the background image used for the login greeter, the desktop wallpaper and the lock screen. The image you want to use for this purpose, must have a 16:9 aspect ratio and its dimensions should at least be 1920x1080 pixels. You must store the custom image inside the liveslak source tree: in the subdirectory ''./media/<variant>/bg/'' where "<variant>" is the lower-case name of the Live variant (variant 'KTOWN' equals directory 'ktown', 'DAW' becomes 'daw', etc).
+
+The "make_slackware_live.sh" script will look there for a file named either "background.jpg" or "background.png". If you want, that file can be a symlink to the actual bitmap file. The image will be converted into a set of wallpaper images of different aspect ratios and sizes. The different aspect ratios like 16:9, 16:10 and 4:3 will be achieved by cropping the images if needed, to avoid distortion. The image set will be installed as a Plasma5 wallpaper called "Slackware Live", and configured to be the default Live OS background.
+
==== Internals of Slackware Live Edition ====
@@ -800,12 +1105,14 @@ What does the 'liveslak' init script do?
* The complete RAM filesystem which underpins the overlay is made available to the user of the Live OS as "/mnt/live"
* The filesystem of the Live media is made available to the user of the Live OS as "/mnt/livemedia". If the media is a USB stick then you will have write access to "/mnt/livemedia".
* With the root filesystem assembled, the Live OS is configured before it actually boots:
+ * If a OS-specific configuration file (by default ''/liveslak/slackware_os.cfg'') exists, its contents will be parsed. Values of the variables defined in this file overrule any default liveslak or boot commandline values.
* if you specified "swap" on the boot commandline, any available swap partition will be added to "/etc/fstab" in the Live OS.
* if you specified a custom keyboard layout for the console (and optionally another for X) by using the "kbd" and "xkb" boot parameters then these will be confifured in "/etc/rc.d/rc.keymap" and "/etc/X11/xorg.conf.d/30-keyboard.conf" in the Live OS.
* Same for any custom locale which was specified with the "locale" parameter, this will get added to "/etc/profile.d/lang.sh".
* If timezone and hardware clock were specified in the "tz" parameter, these will be configured in "/etc/localtime" and "/etc/hardwareclock".
- * The boot parameters "livepw" and "rootpw" allow you to specify custom passwords for the 'live' and 'root' users; the defaults for these two are simply 'live' and 'root'. This is achieved by running the "chpasswd" command in the chrooted overlay so that a plain text password can be given as input.
- * The "hostname" boot parameter can be used to change the Live OS' hostname from its default "darkstar". Configuration is written to "/etc/HOSTNAME" and "/etc/NetworkManager/NetworkManager.conf".
+ * The boot parameters "livepw" and "rootpw" allow you to specify custom passwords for the 'live' and 'root' users; the defaults for these two are simply 'live' and 'root'. This is achieved by running the "chpasswd" command in the chrooted overlay so that a plain text password can be given as input. If you would rather avoid a password completely, you can just pass an empty string ("livepw=" or "rootpw=").
+ * The "hostname" and "domain" boot parameters can be used to change the Live OS' hostname from its default "darkstar" and the domain to something else than "home.arpa". Configuration is written to "/etc/hosts", "/etc/HOSTNAME" and "/etc/NetworkManager/NetworkManager.conf".
+ * If the "nfshost" boot parameter was specified, the Live OS is going through a network (PXE) boot. Appropriate network drivers will be loaded and network configuration will be applied so that the squashfs modules can be loaded via NFS.
* If the "blacklist" boot parameter was specified, then the kernel modules mentioned as argument(s) will be added to a modprobe blacklist file "/etc/modprobe.d/BLACKLIST-live.conf".
* The "/var/lib/alsa/asound.state" file in the Live OS is removed to allow correct sound configuration on any computer where the Live media is booted.
* The complete content of the /liveslak/rootcopy directory on the Live partition (may be empty) is copied to the filesystem root of the Live OS, potentially 'overwriting' files in the Live OS. Use the /liveslak/rootcopy to add customization to your Live OS when you run it off a USB stick.
@@ -814,6 +1121,25 @@ What does the 'liveslak' init script do?
* From this moment onward, you are booting a 'normal' Slackware system and the fact that this is actually running in RAM and not from your local harddisk is not noticeable.
+=== OS configuration file for persistent media ===
+
+If present, the liveslak init will load a OS config file from a persistent Live medium such as a USB stick. In the case of 'Slackware Live Edition' this file is called "/liveslak/slackware_os.cfg" - i.e. is placed in the "liveslak" directory of your USB drive. For custom non-Slackware Live OS-es based on liveslak, the filename may be different.
+This file contains one or more "VARIABLE=value" lines, where VARIABLE is one of the following variables that are used in the live init script:
+ * BLACKLIST, KEYMAP, LIVE_HOSTNAME, LOAD, LOCALE, LUKSVOL, NOLOAD, RUNLEVEL, TWEAKS, TZ, XKB.
+Values for the variables defined in this configuration file override the values already set via liveslak's own defaults or via boot-up command-line parameters.
+
+When booting your persistent //Slackware Live Edition//, the optional boot-time parameter "cfg" deals with this OS configuration file. The "cfg" parameter understands two possible argument values:
+ * "cfg=write" will (over)write the OS configuration file to your USB drive, using the values for all of the above variables that are valid for that particular boot. So if your timezone is "PST" then one of the lines in that file will read "TZ=PST".
+ * "cfg=skip" will skip processing of an existing "/liveslak/slackware_os.cfg" file.
+
+The OS configuration file is not present by default. You either create it at boot-time using "cfg=write" (which is a persistent change) or you create it manually using an ASCII text editor, after mounting theUSB partition on a computer. As an example, here is the content of ''/liveslak/slackware_os.cfg'' on my own USB stick: <code>
+KEYMAP=nl
+LIVE_HOSTNAME=zelazny
+LOCALE=nl_NL.utf8
+TWEAKS=tpb,syn
+TZ=Europe/Amsterdam</code>
+
+
=== Slackware Live module format ===
@@ -825,6 +1151,7 @@ Slackware Live Edition expects its modules to adhere to a particularly loose fil
* Anything may be part of the '*' but most commonly used is "${VERSION}-${ARCH}". The core modules in Slackware Live use the Slackware release as ${VERSION} and the Slackware architecture as ${ARCH}. For the modules in addons/ and optional/ subdirectories, ${VERSION} would commonly be the version of the program that is being made available in the module.
* The four digits of a modulename have a meaning. Some ranges are claimed by the core OS, so please do not use them. Their prefixes are based on the package source: <code>
0000 = contains the Slackware /boot directory
+ 0005 = Console OS modules when explicitly enabled for a regular ISO installed otherwise from Slackware tagfiles
0010-0019 = packages installed from a Slackware tagfile (a,ap,d, ... , y series)
0020-0029 = packages installed from a package list as found in the ./pkglists subdirectory of the liveslak sources (min, noxbase, x_base, xapbase, xfcebase etc)
0030-0039 = a 'local' package, i.e. a package found in subdirectory ./local or ./local64 (depending on architecture)
@@ -846,7 +1173,7 @@ Naturally, there have been many who went before me, and since I started as a n00
Website: https://www.slax.org/
-SLAX was the original Live variant of Slackware. The linux-live scripts which are used to create a SLAX ISO were generalized so that they can create a Live version of any OS that is already installed to a harddrive. SLAX development stalled a couple of years ago but its creator seems to have warmed up recently. However, the current SLAX is no longer based on Slackware - Debian is its base now.
+SLAX was the original Live variant of Slackware. The linux-live scripts which are used to create a SLAX ISO were generalized so that they can create a Live version of any OS that is already installed to a harddrive. SLAX development stalled a couple of years ago but its creator seems to have warmed up recently. New versions of SLAX were no longer based on Slackware but used Debian as its base. In 2022, a new SLAX variant emerged which is again based on Slackware.
The Live functionality of SLAX is based on aufs and unionfs which requires a custom-built kernel with aufs support compiled-in. It is small and has its boot scripts tweaked for startup speed.
@@ -888,8 +1215,8 @@ A website offering Live versions based on many regular Linux distributions. The
Slackware Live Edition is created by the 'liveslak' scripts developed and maintained by Eric Hameleers aka Alien BOB [[alien@slackware.com]].
- * Git repository: %%git://slackware.nl/liveslak.git%%
- * Git repository (browsable): http://git.slackware.nl/liveslak/
+ * Git repository: %%git://git.liveslak.org/liveslak.git%%
+ * Git repository (browsable): http://git.liveslak.org/liveslak/
* Download mirror: http://www.slackware.com/~alien/liveslak/
-
+ * Project landing page: https://liveslak.org/
diff --git a/contrib/scripts/makemod_nvidia b/contrib/scripts/makemod_nvidia
new file mode 100644
index 0000000..508b299
--- /dev/null
+++ b/contrib/scripts/makemod_nvidia
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+MAKEMOD=${MAKEMOD:-"/usr/local/sbin/makemod"}
+SLACKARCH=${SLACKARCH:-"x86_64"}
+SLACKVER=${SLACKVER:-"current"}
+
+TEMPDIR=$(mktemp -d -t alienmod.XXXXXX)
+if [ ! -d ${TEMPDIR} ]; then
+ echo "**Failed to create temporary directory for installation of packages!"
+ exit 1
+fi
+
+# Install the nvidia-kernel and nvidia driver packages which were passed
+# as arguments to the commandline:
+for PKG in $* ; do
+ /sbin/installpkg -root ${TEMPDIR} ${PKG}
+done
+
+# Prevent loading of the kernel's 'nouveau' driver:
+mkdir -p ${TEMPDIR}/etc/modprobe.d
+cat <<EOT > ${TEMPDIR}/etc/modprobe.d/BLACKLIST-nouveau.conf
+# Do not load the kernel nouveau dri module, since it interferes with both
+# the nv and binary nvidia drivers.
+blacklist nouveau
+EOT
+
+STAMP=$(ls ${TEMPDIR}/var/log/packages/nvidia-kernel-* |rev |cut -d- -f3 |rev)
+PKGVER=$(echo $STAMP |cut -d_ -f1)
+PKGMAJ=$(echo $PKGVER |cut -d. -f1)
+KVER=$(echo $STAMP |cut -d_ -f2)
+
+# Generate the squashfs module:
+${MAKEMOD} ${TEMPDIR} /tmp/0060-nvidia-${STAMP}-${SLACKVER}-${SLACKARCH}.sxz
+
+# Generate list of PCI IDS for supported GPUs, sed magic taken from
+# https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/rules?view=markup :
+sed \
+ -e '0,/A. Supported\|APPENDIX A: SUPPORTED/d' \
+ -e '0,/Appendix A. Supported\|APPENDIX A: SUPPORTED/d' \
+ -e '0,/^Below\|APPENDIX B/{/ 0x/s/.* 0x\([0-9a-fA-F]\{4\}\).*/10de\1/p; /^.\{41\} [0-9a-fA-F]\{4\} /s/^.\{41\} \([0-9a-fA-F]\{4\}\) .*/10de\1/p};d' \
+ ${TEMPDIR}/usr/doc/nvidia-driver-*/README.txt \
+ | tr 'a-f' 'A-F' | sort -u \
+ > /tmp/nvidia-${PKGMAJ}xx.ids
+
+rm -r ${TEMPDIR}
diff --git a/contrib/scripts/makemod_wine b/contrib/scripts/makemod_wine
new file mode 100644
index 0000000..a253cdd
--- /dev/null
+++ b/contrib/scripts/makemod_wine
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Root of all my slackbuilds:
+SBROOT=${SBROOT:-"/home/slackbuilds"}
+
+# The makemod script:
+MAKEMOD=${MAKEMOD:-"/usr/local/sbin/makemod"}
+
+# Current directory:
+CWD=$(pwd)
+
+# Package versions for wine and FAudio/vkd3d:
+WINEREL=$(ls ${SBROOT}/wine/pkg64/current/wine-*.t?z |rev |cut -f3 -d- |rev)
+FAUDIOREL=$(ls ${SBROOT}/FAudio/pkg/current/FAudio-*.t?z |rev |cut -f3 -d- |rev)
+#VKD3DREL=$(ls ${SBROOT}/vkd3d/pkg/current/vkd3d-*.t?z |rev |cut -f3 -d- |rev)
+
+# Package locations for wine vkd3d and FAudio:
+WINEPKG=$(ls ${SBROOT}/wine/pkg64/current/wine-*.t?z)
+FAUDIOPKG=$(ls ${SBROOT}/FAudio/pkg64/current/FAudio-*.t?z)
+FAUDIOPKG32=$(ls ${SBROOT}/FAudio/pkg/current/FAudio-*.t?z)
+#VKD3DPKG=$(ls ${SBROOT}/vkd3d/pkg64/current/vkd3d-*.t?z)
+#VKD3DPKG32=$(ls ${SBROOT}/vkd3d/pkg/current/vkd3d-*.t?z)
+
+# Convert the 32bit FAudio into a 'compat32' package:
+convertpkg-compat32 -i ${FAUDIOPKG32} -d /tmp
+
+## Convert the 32bit vkd3d into a 'compat32' package:
+#convertpkg-compat32 -i ${VKD3DPKG32} -d /tmp
+
+# Create the SXZ module:
+SCRATCHDIR=$(mktemp -t -d makesxz.XXXXXX)
+installpkg --root $SCRATCHDIR ${WINEPKG}
+installpkg --root $SCRATCHDIR ${FAUDIOPKG}
+#installpkg --root $SCRATCHDIR ${VKD3DPKG}
+installpkg --root $SCRATCHDIR /tmp/FAudio-compat32-${FAUDIOREL}-x86_64-*compat32.txz
+#installpkg --root $SCRATCHDIR /tmp/vkd3d-compat32-${VKD3DREL}-x86_64-*compat32.txz
+$MAKEMOD $SCRATCHDIR $CWD/0060-wine-${WINEREL}-current-x86_64.sxz
+rm -r $SCRATCHDIR
diff --git a/grub.tpl b/grub.tpl
index 6b28e0f..d87c50b 100644
--- a/grub.tpl
+++ b/grub.tpl
@@ -22,9 +22,17 @@ if [ -z "$sl_locale" ]; then
export sl_locale
fi
+# Check whether we are in a Secure Boot scenario:
+if [ "x$lockdown" != "x" ]; then
+ set check_signatures=enforce
+ export check_signatures
+fi
+
# Determine whether we can show a graphical themed menu:
insmod font
if loadfont $prefix/theme/dejavusansmono12.pf2 ; then
+ loadfont $prefix/theme/dejavusansmono24.pf2
+ loadfont $prefix/theme/dejavusansmono20.pf2
loadfont $prefix/theme/dejavusansmono10.pf2
loadfont $prefix/theme/dejavusansmono5.pf2
set gfxmode=1024x768,800x600,640x480,auto
@@ -40,7 +48,7 @@ if loadfont $prefix/theme/dejavusansmono12.pf2 ; then
export theme
fi
-menuentry "Start @CDISTRO@@DIRSUFFIX@ @SL_VERSION@ @LIVEDE@ Live @VERSION@ ($sl_lang)" --hotkey b {
+menuentry "Start @CDISTRO@@DIRSUFFIX@ @SL_VERSION@ @LIVEDE@ liveslak-@VERSION@ ($sl_lang)" --hotkey b {
linux ($root)/boot/generic @KAPPEND@ load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 kbd=$sl_kbd tz=$sl_tz locale=$sl_locale xkb=$sl_xkb
initrd ($root)/boot/initrd.img
}
@@ -67,3 +75,8 @@ menuentry "Help on boot parameters" --hotkey h {
unset pager
}
+@C2RMS@menuentry "Console OS in RAM ($sl_lang)" --hotkey c {
+@C2RMS@ linux ($root)/boot/generic @KAPPEND@ load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 kbd=$sl_kbd tz=$sl_tz locale=$sl_locale xkb=$sl_xkb toram=core 3
+@C2RMS@ initrd ($root)/boot/initrd.img
+@C2RMS@}
+
diff --git a/iso2usb.sh b/iso2usb.sh
index ed9be53..dfe1eec 100644
--- a/iso2usb.sh
+++ b/iso2usb.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright 2015, 2016, 2017, 2019 Eric Hameleers, Eindhoven, NL
+# Copyright 2015, 2016, 2017, 2019, 2020, 2021, 2022, 2023 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -29,6 +29,23 @@ export PATH="/usr/sbin:/sbin:/usr/bin:/bin"
# Set to '1' if you want to ignore all warnings:
FORCE=0
+# The default layout of the USB stick is:
+# partition 1 (1MB),
+# partition 2 (100 MB)
+# partition 3 (claim all free space - specified as -1 MB).
+# The script allows for an amount of free space to be left at the end
+# (partition 4, un-used by liveslak) in case you need this:
+DEF_LAYOUT="1,100,-1,"
+
+# The extension for containerfiles accompanying an ISO is '.icc',
+# whereas the persistent USB stick created with iso2usb.sh uses '.img'.
+DEFEXT=".img"
+CNTEXT="${DEFEXT}"
+
+# Default filesystem for devices/containers:
+DEF_FS="ext4"
+FSYS="${DEF_FS}"
+
# By default, we use 'slhome.img' as the name of the LUKS home containerfile.
DEF_SLHOME="slhome"
SLHOME="${DEF_SLHOME}"
@@ -72,7 +89,7 @@ DOLUKS=0
REFRESH=0
# These tools are required by the script, we will check for their existence:
-REQTOOLS="blkid cpio extlinux fdisk gdisk isoinfo lsblk mkdosfs sgdisk syslinux"
+REQTOOLS="blkid cpio cryptsetup extlinux fdisk find gdisk gzip isoinfo losetup lsblk lzip mkdosfs sgdisk syslinux wipefs xz"
# Path to syslinux files:
if [ -d /usr/share/syslinux ]; then
@@ -89,9 +106,7 @@ else
fi
# Initialize more variables:
-CNTBASE=""
CNTDEV=""
-CNTFILE=""
HLUKSSIZE=""
LUKSHOME=""
LODEV=""
@@ -103,6 +118,11 @@ CNTMNT=""
USBMNT=""
US2MNT=""
+# Minimim free space (in MB) we want to have left in any partition
+# after we are done.
+# The default value can be changed from the environment:
+MINFREE=${MINFREE:-10}
+
# Compressor used on the initrd ("gzip" or "xz --check=crc32");
# Note that the kernel's XZ decompressor does not understand CRC64:
COMPR="xz --check=crc32"
@@ -112,7 +132,7 @@ COMPR="xz --check=crc32"
#
# Clean up in case of failure:
-cleanup() {
+function cleanup() {
# Clean up by unmounting our loopmounts, deleting tempfiles:
echo "--- Cleaning up the staging area..."
# During cleanup, do not abort due to non-zero exit code:
@@ -122,7 +142,7 @@ cleanup() {
# In case of failure, only the most recent device should still be open:
if mount |grep -q ${CNTDEV} ; then
umount -f ${CNTDEV}
- cryptsetup luksClose $(basename ${CNTBASE})
+ cryptsetup luksClose $(basename ${CNTDEV})
losetup -d ${LODEV}
fi
fi
@@ -132,10 +152,10 @@ cleanup() {
[ -n "${US2MNT}" ] && ( umount -f ${US2MNT} 2>/dev/null; rmdir $US2MNT 2>/dev/null )
[ -n "${IMGDIR}" ] && ( rm -rf $IMGDIR )
set -e
-}
+} # End of cleanup()
trap 'echo "*** $0 FAILED at line $LINENO ***"; cleanup; exit 1' ERR INT TERM
-showhelp() {
+function showhelp() {
cat <<EOT
#
# Purpose: to transfer the content of Slackware's Live ISO image
@@ -148,8 +168,9 @@ cat <<EOT
# $(basename $0) accepts the following parameters:
# -c|--crypt size|perc Add LUKS encrypted /home ; parameter is the
# requested size of the container in kB, MB, GB,
-# or as a percentage of free space.
-# Examples: '-c 125M', '-c 1.3G', '-c 20%'.
+# or as a percentage of free space
+# (integer numbers only).
+# Examples: '-c 125M', '-c 2G', '-c 20%'.
# -d|--devices List removable devices on this computer.
# -f|--force Ignore most warnings (except the back-out).
# -h|--help This help.
@@ -165,41 +186,106 @@ cat <<EOT
# providing a devicename (using option '-o').
# -u|--unattended Do not ask any questions.
# -v|--verbose Show verbose messages.
-# -w|--wait<number> Add <number> seconds wait time to initialize USB.
+# -w|--wait <number> Add <number> seconds wait time to initialize USB.
+# -y|--layout <x,x,x,x> Specify partition layout and sizes (in MB).
+# Default values: '$DEF_LAYOUT' for 3 partitions,
+# the '-1' value for partition 3 meaning
+# 'use all remaining space',
+# and an empty 4th value means 'do not reserve
+# free space for a custom 4th partition'.
# -C|--cryptpersistfile size|perc
# Use a LUKS-encrypted 'persistence' file instead
-# of a directory (for use on FAT filesystem).
+# of a directory (for use on FAT filesystem)
+# Format for size/percentage is the same
+# as for the '-c' parameter.
+# -F|--filesystem <fs> Specify filesystem to create when formatting
+# devices/containers. Defaults to '${DEF_FS}',
+# Choices are $(createfs).
+# Note that the linux partition will always be
+# formatted as 'ext4' because extlinux is used
+# as the BIOS bootloader.
# -P|--persistfile Use a 'persistence' container file instead of
# a directory (for use on FAT filesystem).
+# Persistent data will not be migrated
+# when switching from directory to container file.
#
# Examples:
#
# $(basename $0) -i ~/download/slackware64-live-14.2.iso -o /dev/sdX
# $(basename $0) -i slackware64-live-xfce-current.iso -o /dev/mmcblkX -c 750M -w 15
+# $(basename $0) -i slackware-live-current.iso -o /dev/sdX -y 1,200,-1,4096
#
EOT
-}
+} # End of showhelp()
+
+# Create a filesystem on a partition with optional label:
+function createfs () {
+ MYDEV="${1}"
+ MYFS="${2:-'ext4'}"
+ MYLABEL="${3}"
+
+ if [ -z "${MYDEV}" ]; then
+ # Without arguments given, reply with list of supported fs'es:
+ echo "btrfs,ext2,ext4,f2fs,jfs,xfs"
+ return
+ fi
+
+ if [ -n "${MYLABEL}" ]; then
+ case "${MYFS}" in
+ fs2s) MYLABEL="-l ${MYLABEL}" ;;
+ *) MYLABEL="-L ${MYLABEL}" ;;
+ esac
+ fi
+
+ case "${MYFS}" in
+ btrfs) mkfs.btrfs -f -d single -m single ${MYLABEL} ${MYDEV}
+ ;;
+ ext2) mkfs.ext2 -F -F ${MYLABEL} ${MYDEV}
+ # Tune the ext2 filesystem:
+ tune2fs -m 0 -c 0 -i 0 ${MYDEV}
+ ;;
+ ext4) mkfs.ext4 -F -F ${MYLABEL} ${MYDEV}
+ # Tune the ext4 filesystem:
+ tune2fs -m 0 -c 0 -i 0 ${MYDEV}
+ ;;
+ f2fs) mkfs.f2fs ${MYLABEL} -f ${MYDEV}
+ ;;
+ jfs) mkfs.jfs -q ${MYDEV}
+ ;;
+ xfs) mkfs.xfs -f ${MYDEV}
+ ;;
+ *) echo "*** Unsupported filesystem '${MYFS}'!"; exit 1
+ ;;
+ esac
+} # End of createfs()
# Uncompress the initrd based on the compression algorithm used:
-uncompressfs () {
- if $(file "${1}" | grep -qi ": gzip"); then
- gzip -cd "${1}"
- elif $(file "${1}" | grep -qi ": XZ"); then
- xz -cd "${1}"
+function uncompressfs () {
+ local IMGFILE="$1"
+ # Content is streamed to STDOUT:
+ if $(file "${IMGFILE}" | grep -qi ": gzip"); then
+ gzip -cd "${IMGFILE}"
+ elif $(file "${IMGFILE}" | grep -qi ": XZ"); then
+ xz -cd "${IMGFILE}"
+ elif $(file "${IMGFILE}" | grep -qi ": LZMA"); then
+ lzma -cd "${IMGFILE}"
+ elif $(file "${IMGFILE}" | grep -qi ": lzip"); then
+ lzip -cd "${IMGFILE}"
fi
-}
+} # End of uncompressfs()
# Scan for insertion of a USB device:
-scan_devices() {
+function scan_devices() {
+ local MYSCANWAIT="${1}"
local BD
# Inotifywatch does not trigger on symlink creation,
# so we can not watch /sys/block/
- BD=$(inotifywait -q -t ${SCANWAIT} -e create /dev 2>/dev/null |cut -d' ' -f3)
+ BD=$(inotifywait -q -t ${MYSCANWAIT} -e create /dev 2>/dev/null |cut -d' ' -f3)
echo ${BD}
} # End of scan_devices()
# Show a list of removable devices detected on this computer:
-show_devices() {
+function show_devices() {
local MYDATA="${*}"
if [ -z "${MYDATA}" ]; then
MYDATA="$(ls --indicator-style=none /sys/block/ |grep -Ev '(ram|loop|dm-)')"
@@ -215,16 +301,16 @@ show_devices() {
} # End of show_devices()
# Read configuration data from old initrd:
-read_initrd() {
+function read_initrd() {
IMGFILE="$1"
OLDPERSISTENCE=$(uncompressfs ${IMGFILE} |cpio -i --to-stdout init |grep "^PERSISTENCE" |cut -d '"' -f2 2>/dev/null)
OLDWAIT=$(uncompressfs ${IMGFILE} |cpio -i --to-stdout wait-for-root 2>/dev/null)
OLDLUKS=$(uncompressfs ${IMGFILE} |cpio -i --to-stdout luksdev 2>/dev/null)
-}
+} # End of read_initrd()
# Add longer USB WAIT to the initrd:
-update_initrd() {
+function update_initrd() {
IMGFILE="$1"
# USB boot medium needs a few seconds boot delay else the overlay will fail.
@@ -292,93 +378,133 @@ update_initrd() {
rm -rf $IMGDIR/*
} # End of update_initrd()
+# Determine size of a mounted partition (in MB):
+function get_part_mb_size() {
+ local MYPART="${1}"
+ local MYSIZE
+ MYSIZE=$(df -P -BM ${MYPART} |tail -n -1 |tr -s '\t' ' ' |cut -d' ' -f2)
+ echo "${MYSIZE%M}"
+} # End of get_part_mb_size()
+
+# Determine free space of a mounted partition (in MB):
+function get_part_mb_free() {
+ local MYPART="${1}"
+ local MYSIZE
+ MYSIZE=$(df -P -BM ${MYPART} |tail -n -1 |tr -s '\t' ' ' |cut -d' ' -f4)
+ echo "${MYSIZE%M}"
+} # End of get_part_mb_free()
+
+# Determine requested container size in MB (allow for '%|k|K|m|M|g|G' suffix):
+function cont_mb() {
+ # Uses global variables: PARTFREE
+ local MYSIZE="$1"
+ case "${MYSIZE: -1}" in
+ "%") MYSIZE="$(( $PARTFREE * ${MYSIZE%\%} / 100 ))" ;;
+ "k") MYSIZE="$(( ${MYSIZE%k} / 1024 ))" ;;
+ "K") MYSIZE="$(( ${MYSIZE%K} / 1024 ))" ;;
+ "m") MYSIZE="${MYSIZE%m}" ;;
+ "M") MYSIZE="${MYSIZE%M}" ;;
+ "g") MYSIZE="$(( ${MYSIZE%g} * 1024 ))" ;;
+ "G") MYSIZE="$(( ${MYSIZE%G} * 1024 ))" ;;
+ *) MYSIZE=-1 ;;
+ esac
+ echo "$MYSIZE"
+} # End of cont_mb()
+
# Create a container file in the empty space of the partition
-create_container() {
- CNTPART=$1
- CNTSIZE=$2
- CNTBASE=$3
- CNTENCR=$4 # 'none' or 'luks'
- CNTUSED=$5 # '/home' or 'persistence'
+function create_container() {
+ local CNTPART=$1 # partition containing the ISO
+ local CNTSIZE=$2 # size of the container file to create
+ local CNTFILE=$3 # ${CNTEXT} filename with full path
+ local CNTENCR=$4 # 'none' or 'luks'
+ local CNTUSED=$5 # '/home' or 'persistence'
+ local MYMAP
+ local MYMNT
+
+ # If containerfile extension is missing, add it now:
+ if [ "${CNTFILE%${CNTEXT}}" == "${CNTFILE}" ]; then
+ CNTFILE="${CNTFILE}${CNTEXT}"
+ fi
# Create a container file or re-use previously created one:
- if [ -f $USBMNT/${CNTBASE}.img ]; then
- CNTFILE="${CNTBASE}.img"
- CNTSIZE=$(( $(du -sk $USBMNT/${CNTFILE} |tr '\t' ' ' |cut -f1 -d' ') / 1024 ))
- echo "--- Keeping existing '${CNTFILE}' (size ${CNTSIZE} MB)."
+ if [ -f ${CNTFILE} ]; then
+ # Where are we mounted?
+ MYMNT=$(cd "$(dirname "${CNTFILE}")" ; df --output=target . |tail -1)
+ CNTSIZE=$(( $(du -sk ${CNTFILE} |tr '\t' ' ' |cut -f1 -d' ') / 1024 ))
+ echo "--- Keeping existing '${CNTFILE#${MYMNT}}' (size ${CNTSIZE} MB)."
return
fi
# Determine size of the target partition (in MB), and the free space:
- PARTSIZE=$(df -P -BM ${CNTPART} |tail -1 |tr -s '\t' ' ' |cut -d' ' -f2)
- PARTSIZE=${PARTSIZE%M}
- PARTFREE=$(df -P -BM ${CNTPART} |tail -1 |tr -s '\t' ' ' |cut -d' ' -f4)
- PARTFREE=${PARTFREE%M}
+ PARTSIZE=$(get_part_mb_size ${CNTPART})
+ PARTFREE=$(get_part_mb_free ${CNTPART})
- if [ $PARTFREE -lt 10 ]; then
- echo "*** Free space on USB partition is less than 10 MB;"
+ if [ $PARTFREE -lt ${MINFREE} ]; then
+ echo "*** Free space on USB partition is less than ${MINFREE} MB;"
echo "*** Not creating a container file!"
+ cleanup
exit 1
fi
- # Determine requested container size (allow for '%|k|K|m|M|g|G' suffix):
- case "${CNTSIZE: -1}" in
- "%") CNTSIZE="$(( $PARTFREE * ${CNTSIZE%\%} / 100 ))" ;;
- "k") CNTSIZE="$(( ${CNTSIZE%k} / 1024 ))" ;;
- "K") CNTSIZE="$(( ${CNTSIZE%K} / 1024 ))" ;;
- "m") CNTSIZE="${CNTSIZE%m}" ;;
- "M") CNTSIZE="${CNTSIZE%M}" ;;
- "g") CNTSIZE="$(( ${CNTSIZE%g} * 1024 ))" ;;
- "G") CNTSIZE="$(( ${CNTSIZE%G} * 1024 ))" ;;
- *) ;;
- esac
+ # Determine requested container size in MB (allow for '%|k|K|m|M|g|G' suffix):
+ CNTSIZE=$(cont_mb ${CNTSIZE})
if [ $CNTSIZE -le 0 ]; then
echo "*** Container size must be larger than ZERO!"
echo "*** Check your '-c' commandline parameter."
+ cleanup
exit 1
elif [ $CNTSIZE -ge $PARTFREE ]; then
echo "*** Not enough free space for container file!"
echo "*** Check your '-c' commandline parameter."
+ cleanup
exit 1
fi
echo "--- Creating ${CNTSIZE} MB container file using 'dd if=/dev/urandom', patience please..."
- mkdir -p $USBMNT/$(dirname "${CNTBASE}")
- CNTFILE="${CNTBASE}.img"
- # Create a sparse file (not allocating any space yet):
- dd of=$USBMNT/${CNTFILE} bs=1M count=0 seek=$CNTSIZE
+ mkdir -p $(dirname "${CNTFILE}")
+ if [ $? ]; then
+ # Create a sparse file (not allocating any space yet):
+ dd of=${CNTFILE} bs=1M count=0 seek=$CNTSIZE 2>/dev/null
+ else
+ echo "*** Failed to create directory for the container file!"
+ cleanup
+ exit 1
+ fi
# Setup a loopback device that we can use with cryptsetup:
LODEV=$(losetup -f)
- losetup $LODEV $USBMNT/${CNTFILE}
+ losetup $LODEV ${CNTFILE}
+ MYMAP=$(basename ${CNTFILE} ${CNTEXT})
if [ "${CNTENCR}" = "luks" ]; then
# Format the loop device with LUKS:
- echo "--- Encrypting the container file with LUKS; enter 'YES' and a passphrase..."
+ echo "--- Encrypting the container file with LUKS via '${LODEV}'"
+ echo "--- This takes SOME time, please be patient..."
+ echo "--- enter 'YES' and a passphrase:"
until cryptsetup -y luksFormat $LODEV ; do
echo ">>> Did you type two different passphrases?"
read -p ">>> Press [ENTER] to try again or Ctrl-C to abort ..." REPLY
done
# Unlock the LUKS encrypted container:
echo "--- Unlocking the LUKS container requires your passphrase again..."
- until cryptsetup luksOpen $LODEV $(basename ${CNTBASE}) ; do
+ until cryptsetup luksOpen $LODEV ${MYMAP} ; do
echo ">>> Did you type an incorrect passphrases?"
read -p ">>> Press [ENTER] to try again or Ctrl-C to abort ..." REPLY
done
- CNTDEV=/dev/mapper/$(basename ${CNTBASE})
+ CNTDEV=/dev/mapper/${MYMAP}
# Now we allocate blocks for the LUKS device. We write encrypted zeroes,
# so that the file looks randomly filled from the outside.
# Take care not to write more bytes than the internal size of the container:
+ echo "--- Writing ${CNTSIZE} MB of random data to encrypted container; takes LONG time..."
CNTIS=$(( $(lsblk -b -n -o SIZE $(readlink -f ${CNTDEV})) / 512))
- dd if=/dev/zero of=${CNTDEV} bs=512 count=${CNTIS} || true
+ dd if=/dev/zero of=${CNTDEV} bs=512 count=${CNTIS} status=progress || true
else
- CNTDEV=$LODEV
# Un-encrypted container files remain sparse.
+ CNTDEV=$LODEV
fi
# Format the now available block device with a linux fs:
- mkfs.ext4 ${CNTDEV}
- # Tune the ext4 filesystem:
- tune2fs -m 0 -c 0 -i 0 ${CNTDEV}
+ createfs ${CNTDEV} ${FSYS}
if [ "${CNTUSED}" != "persistence" ]; then
# Create a mount point for the unlocked container:
@@ -392,7 +518,7 @@ create_container() {
fi
# Copy the original /home (or whatever mount) content into the container:
echo "--- Copying '${CNTUSED}' from LiveOS to container..."
- HOMESRC=$(find ${USBMNT} -name "0099-slackware_zzzconf*" |tail -1)
+ HOMESRC=$(find ${ISOMNT} -name "0099-slackware_zzzconf*" |tail -1)
mount ${CNTDEV} ${CNTMNT}
unsquashfs -n -d ${CNTMNT}/temp ${HOMESRC} ${CNTUSED}
mv ${CNTMNT}/temp/${CNTUSED}/* ${CNTMNT}/
@@ -402,10 +528,9 @@ create_container() {
# Don't forget to clean up after ourselves:
if [ "${CNTENCR}" = "luks" ]; then
- cryptsetup luksClose $(basename ${CNTBASE})
+ cryptsetup luksClose ${MYMAP}
fi
losetup -d ${LODEV} || true
-
} # End of create_container() {
#
@@ -474,12 +599,20 @@ while [ ! -z "$1" ]; do
WAIT="$2"
shift 2
;;
+ -y|--layout)
+ LAYOUT="$2"
+ shift 2
+ ;;
-C|--cryptpersistfile)
DOLUKS=1
PLUKSSIZE="$2"
PERSISTTYPE="file"
shift 2
;;
+ -F|--filesystem)
+ FSYS="$2"
+ shift 2
+ ;;
-P|--persistfile)
PERSISTTYPE="file"
shift
@@ -507,7 +640,7 @@ fi
if [ -z "$TARGET" ]; then
if [ $SCAN -eq 1 ]; then
echo "-- Waiting ${SCANWAIT} seconds for a USB stick to be inserted..."
- TARGET=$(scan_devices)
+ TARGET=$(scan_devices ${SCANWAIT})
if [ -z "$TARGET" ]; then
echo "*** No new USB device detected during $SCANWAIT seconds scan."
exit 1
@@ -528,6 +661,16 @@ if [ $FORCE -eq 0 -a ! -f "$SLISO" ]; then
exit 1
fi
+if [ "${HLUKSSIZE%.*}" != "${HLUKSSIZE}" ] ; then
+ echo "*** Integer value required in '-c $HLUKSSIZE' !"
+ exit 1
+fi
+
+if [ "${PLUKSSIZE%.*}" != "${PLUKSSIZE}" ] ; then
+ echo "*** Integer value required in '-C $PLUKSSIZE' !"
+ exit 1
+fi
+
if [ $FORCE -eq 0 ]; then
if [ ! -e /sys/block/$(basename $TARGET) ]; then
echo "*** Not a block device: '$TARGET' !"
@@ -540,6 +683,9 @@ if [ $FORCE -eq 0 ]; then
fi
fi
+# Add required filesystem tools:
+REQTOOLS="${REQTOOLS} mkfs.${FSYS}"
+
# Are all the required not-so-common add-on tools present?
PROG_MISSING=""
for PROGN in ${REQTOOLS} ; do
@@ -618,12 +764,54 @@ if [ $REFRESH -eq 0 ]; then
# - Make the Linux partition "legacy BIOS bootable"
# Make sure that there is no MBR nor a partition table anymore:
dd if=/dev/zero of=$TARGET bs=512 count=1 conv=notrunc
- # The first sgdisk command is allowed to have non-zero exit code:
+
+ # We have to use wipefs before sgdisk or else traces of an old 'cp' or 'dd'
+ # of a Live ISO image to the device will not be erased.
+ # The sgdisk wipe command is allowed to have non-zero exit code:
+ wipefs -af $TARGET
sgdisk -og $TARGET || true
+
+ # After the wipe, get the value of the last usable sector:
+ ENDSECT=$(sgdisk -E $TARGET)
+
+ # Calculate partition layout in MB.
+ # User may specify custom non-zero sizes, also for keeping some free space:
+ if [ -z "$LAYOUT" ]; then LAYOUT=${DEF_LAYOUT}; fi
+
+ # Let's first determine whether the user wanted space for a 4th partition:
+ LP4=$(echo $LAYOUT |cut -d, -f4)
+ if [ -z "$LP4" ]; then LP4=$(echo $DEF_LAYOUT |cut -d, -f4) ; fi
+
+ LP1=$(echo $LAYOUT |cut -d, -f1)
+ if [ -z "$LP1" ]; then LP1=$(echo $DEF_LAYOUT |cut -d, -f1) ; fi
+ LP1_START=2048
+ LP1_END=$(( ${LP1_START} + ( ${LP1} *2048 ) - 1 ))
+
+ LP2=$(echo $LAYOUT |cut -d, -f2)
+ if [ -z "$LP2" ]; then LP2=$(echo $DEF_LAYOUT |cut -d, -f2) ; fi
+ LP2_START=$(( ${LP1_END} + 1 ))
+ LP2_END=$(( ${LP2_START} + ( $LP2 *2048 ) - 1 ))
+
+ LP3=$(echo $LAYOUT |cut -d, -f3)
+ if [ -z "$LP3" ]; then LP3=$(echo $DEF_LAYOUT |cut -d, -f3) ; fi
+ LP3_START=$(( ${LP2_END} + 1 ))
+ # The end of partition 3 depends on both values of LP3 and LP4:
+ if [ -n "${LP4}" ] && [ ${LP4} -gt 0 ]; then
+ LP3_END=$(( $ENDSECT - ( $LP4 * 2048 ) -1 ))
+ elif [ -n "${LP3}" ] && [ ${LP3} -gt 0 ]; then
+ LP3_END=$(( ${LP3_START} + ( $LP3 *2048 ) - 1 ))
+ else
+ # Give all remaining space to partition 3:
+ LP3_END=0
+ fi
+
+ # END calculating partition layout in MB.
+
+ # Setup the disk partitions:
sgdisk \
- -n 1:2048:4095 -c 1:"BIOS Boot Partition" -t 1:ef02 \
- -n 2:4096:208895 -c 2:"EFI System Partition" -t 2:ef00 \
- -n 3:208896:0 -c 3:"Slackware Linux" -t 3:8300 \
+ -n 1:${LP1_START}:${LP1_END} -c 1:"BIOS Boot Partition" -t 1:ef02 \
+ -n 2:${LP2_START}:${LP2_END} -c 2:"EFI System Partition" -t 2:ef00 \
+ -n 3:${LP3_START}:${LP3_END} -c 3:"Slackware Linux" -t 3:8300 \
$TARGET
sgdisk -A 3:set:2 $TARGET
# Show what we did to the USB stick:
@@ -637,25 +825,34 @@ if [ $REFRESH -eq 0 ]; then
# Create filesystems:
# Not enough clusters for a 32 bit FAT:
mkdosfs -s 2 -n "DOS" ${TARGETP1}
- mkdosfs -F32 -s 2 -n "EFI" ${TARGETP2}
+ mkdosfs -F32 -s 2 -n "ESP" ${TARGETP2}
# KDE tends to automount.. so try an umount:
if mount |grep -qw ${TARGETP3} ; then
umount ${TARGETP3} || true
fi
+ # We use extlinux to boot the stick, so other filesystems are not accepted:
+ createfs ${TARGETP3} ext4 "${LIVELABEL}"
# http://www.syslinux.org/wiki/index.php?title=Filesystem
- # As of Syslinux 6.03, "pure 64-bits" compression/encryption is not supported.
+ # As of Syslinux 6.03, "pure 64-bits" compression/encryption is unsupported.
# Modern mke2fs creates file systems with the metadata_csum and 64bit
# features enabled by default.
# Explicitly disable 64bit feature in the mke2fs command with '-O ^64bit';
# otherwise, the syslinux bootloader (>= 6.03) will fail.
# Note: older 32bit OS-es will trip over the '^64bit' feature so be gentle.
- mkfs.ext4 -F -F -L "${LIVELABEL}" ${TARGETP3}
- if ! tune2fs -O ^64bit ${TARGETP3} 1>/dev/null 2>/dev/null ; then
- FEAT_64BIT=""
- else
- FEAT_64BIT="-O ^64bit"
+ UNWANTED_FEAT=""
+ if tune2fs -O ^64bit ${TARGETP3} 1>/dev/null 2>/dev/null ; then
+ UNWANTED_FEAT="^64bit,"
+ fi
+ # Grub 2.0.6 stumbles over metadata_csum_seed which is enabled by default
+ # since e2fsprogs 1.47.0, so let's disable that too:
+ if tune2fs -O ^metadata_csum_seed ${TARGETP3} 1>/dev/null 2>/dev/null ; then
+ UNWANTED_FEAT="${UNWANTED_FEAT}^metadata_csum_seed,"
fi
- tune2fs -c 0 -i 0 -m 0 ${FEAT_64BIT} ${TARGETP3}
+ if [ -n "${UNWANTED_FEAT}" ]; then
+ # We found unwanted feature(s), get rid of trailing comma:
+ UNWANTED_FEAT="-O ${UNWANTED_FEAT::-1}"
+ fi
+ tune2fs -c 0 -i 0 -m 0 ${UNWANTED_FEAT} ${TARGETP3}
else
# Determine partition names independently of storage architecture:
TARGETP1=$(fdisk -l $TARGET |grep ^$TARGET |cut -d' ' -f1 |grep -E '[^0-9]1$')
@@ -753,9 +950,13 @@ if [ -n "$VERSION" ]; then
fi
if [ -n "${HLUKSSIZE}" ]; then
- # Create LUKS container file for /home:
- create_container ${TARGETP3} ${HLUKSSIZE} ${SLHOME} luks /home
- LUKSHOME=${CNTFILE}
+ # If file extension is missing in the containername, add it now:
+ if [ "${SLHOME%${CNTEXT}}" == "${SLHOME}" ]; then
+ SLHOME="${SLHOME}${CNTEXT}"
+ fi
+ # Create LUKS container file for /home ;
+ LUKSHOME="${SLHOME}"
+ create_container ${TARGETP3} ${HLUKSSIZE} "${USBMNT}/${LUKSHOME}" luks /home
fi
# Update the initrd with regard to USB wait time, persistence and LUKS.
@@ -771,15 +972,15 @@ if [ $REFRESH -eq 1 ]; then
# The user specified a nonstandard persistence, so move the old one first;
# hide any errors if it did not *yet* exist:
mkdir -p ${USBMNT}/$(dirname ${PERSISTENCE})
- mv ${USBMNT}/${OLDPERSISTENCE}.img ${USBMNT}/${PERSISTENCE}.img 2>/dev/null
+ mv ${USBMNT}/${OLDPERSISTENCE}${CNTEXT} ${USBMNT}/${PERSISTENCE}${CNTEXT} 2>/dev/null
mv ${USBMNT}/${OLDPERSISTENCE} ${USBMNT}/${PERSISTENCE} 2>/dev/null
fi
- if [ -f ${USBMNT}/${PERSISTENCE}.img ]; then
+ if [ -f ${USBMNT}/${PERSISTENCE}${CNTEXT} ]; then
# If a persistence container exists, we re-use it:
PERSISTTYPE="file"
- if cryptsetup isLuks ${USBMNT}/${PERSISTENCE}.img ; then
+ if cryptsetup isLuks ${USBMNT}/${PERSISTENCE}${CNTEXT} ; then
# If the persistence file is LUKS encrypted we need to record its size:
- PLUKSSIZE=$(( $(du -sk $USBMNT/${PERSISTENCE}.img |tr '\t' ' ' |cut -f1 -d' ') / 1024 ))
+ PLUKSSIZE=$(( $(du -sk $USBMNT/${PERSISTENCE}${CNTEXT} |tr '\t' ' ' |cut -f1 -d' ') / 1024 ))
fi
elif [ -d ${USBMNT}/${PERSISTENCE} -a "${PERSISTTYPE}" = "file" ]; then
# A persistence directory exists but the user wants a container now;
@@ -800,10 +1001,10 @@ elif [ "${PERSISTTYPE}" = "file" ]; then
# Note: the word "persistence" below is a keyword for create_container:
if [ -z "${PLUKSSIZE}" ]; then
# Un-encrypted container:
- create_container ${TARGETP3} 90% ${PERSISTENCE} none persistence
+ create_container ${TARGETP3} 90% ${USBMNT}/${PERSISTENCE} none persistence
else
# LUKS-encrypted container:
- create_container ${TARGETP3} ${PLUKSSIZE} ${PERSISTENCE} luks persistence
+ create_container ${TARGETP3} ${PLUKSSIZE} ${USBMNT}/${PERSISTENCE} luks persistence
fi
else
echo "*** Unknown persistence type '${PERSISTTYPE}'!"
diff --git a/isocomp.sh b/isocomp.sh
new file mode 100644
index 0000000..ddb431b
--- /dev/null
+++ b/isocomp.sh
@@ -0,0 +1,921 @@
+#!/bin/bash
+#
+# Copyright 2022, 2023 Eric Hameleers, Eindhoven, NL
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# -----------------------------------------------------------------------------
+#
+# This script can perform some specific changes on the USB stick
+# containing an ISO of Slackware Live Edition,
+# when you boot from that ISO using a multi-boot manager.
+# - create a directory structure on the USB partition to add more
+# functionality to the ISO (e.g. load extra addons/optional modules).
+# - create an encrypted container file for storing persistence data.
+# - create an encrypted container file to mount on /home .
+# - write all the above information into a configuration file for the ISO.
+#
+# -----------------------------------------------------------------------------
+
+# Be careful:
+set -e
+
+# Limit the search path:
+export PATH="/usr/sbin:/sbin:/usr/bin:/bin"
+
+# Use of force is sometimes needed:
+FORCE=0
+
+# Version is obtained from the ISO metadata:
+VERSION=""
+
+# The extension for containerfiles accompanying an ISO is '.icc',
+# whereas the persistent USB stick created with iso2usb.sh uses '.img'.
+DEFEXT=".icc"
+CNTEXT="${DEFEXT}"
+
+# Default filesystem for devices/containers:
+DEF_FS="ext4"
+FSYS="${DEF_FS}"
+
+# Default mount point for a LUKS container if not specified:
+DEFMNT="/home"
+LUKSMNT=""
+
+# Values for container sizes:
+PERSSIZE=""
+LUKSSIZE=""
+INCSIZE=""
+LUKSVOL=""
+
+# Associative array to capture LUKSVOL definitions:
+declare -A CONTAINERS=()
+
+# Values obtained from a pre-existing .cfg file:
+ISOPERSISTENCE=""
+LUKSCNT=""
+LIVESLAKROOT=""
+
+# Define ahead of time, so that cleanup knows about them:
+IMGDIR=""
+ISOMNT=""
+CNTDEV=""
+CNTMNT=""
+EXTENSION=""
+LODEV=""
+PERSISTENCE=""
+
+# Minimim free space (in MB) we want to have left in any partition
+# after we are done.
+# The default value can be changed from the environment:
+MINFREE=${MINFREE:-10}
+
+# Compressor used on the initrd ("gzip" or "xz --check=crc32");
+# Note that the kernel's XZ decompressor does not understand CRC64:
+COMPR="xz --check=crc32"
+
+# These tools are required by the script, we will check for their existence:
+REQTOOLS="cpio cryptsetup fsck gzip isoinfo lsblk unsquashfs xz zstd"
+
+#
+# -- function definitions --
+#
+
+# Clean up in case of failure:
+function cleanup() {
+ # Clean up by unmounting our loopmounts, deleting tempfiles:
+ echo "--- Cleaning up the staging area..."
+ # During cleanup, do not abort due to non-zero exit code:
+ set +e
+ sync
+
+ if [ -n "$CNTDEV" ]; then
+ # In case of failure, only most recent LUKS mapped device is still open:
+ if mount | grep -q ${CNTDEV} ; then
+ umount -f ${CNTDEV}
+ cryptsetup luksClose $(basename ${CNTDEV})
+ losetup -d ${LODEV}
+ fi
+ fi
+ [ -n "${ISOMNT}" ] && ( umount -f ${ISOMNT} 2>/dev/null; rmdir $ISOMNT 2>/dev/null )
+ [ -n "${CNTMNT}" ] && ( umount -f ${CNTMNT} 2>/dev/null; rmdir $CNTMNT 2>/dev/null )
+ [ -n "${IMGDIR}" ] && ( rm -rf $IMGDIR )
+ set -e
+} # End of cleanup()
+
+trap 'echo "*** $0 FAILED at line $LINENO ***"; cleanup; exit 1' ERR INT TERM
+
+# Show the help text for this script:
+function showhelp() {
+cat <<EOT
+#
+# Purpose: enhance the functionality when booting a Slackware Live ISO file.
+# When supplying pathnames as parameter values below, use full pathnames in
+# your local filesystem. The script will figure out where your USB disk
+# partition is mounted and will adjust the path names accordingly
+# in the USB configuration.
+#
+# $(basename $0) accepts the following parameters:
+# -d|--directory <path> Create a liveslak directory structure to store
+# additional modules. The parameter value is
+# used as the root path below which the
+# liveslak/{addons,optional} subdirectories
+# will be created.
+# -e|--examples Show some common usage examples.
+# -f|--force Force execution in some cases where the script
+# reports an issue.
+# -h|--help This help text.
+# -i|--iso <fullpath> Full path to your liveslak ISO image.
+# -l|--lukscontainer <fullpath> Full path to encrypted container file to be
+# created by this script, and to be mounted
+# in the live OS under /home
+# (or any other mountpoint you supply).
+# (filename needs to end in '${CNTEXT}'!).
+# -p|--persistence <fullpath > Full path to encrypted persistence container
+# file to be created in the filesystem
+# (filename extension must be '${CNTEXT}'!).
+# -x|--extend <fullpath> Full path to existing (encrypted) container
+# file that you want to extend in size
+# Limitations:
+# - container needs to be LUKS encrypted.
+# - filename extension needs to be '${CNTEXT}'.
+# Supported filesystems inside container:
+# - $(resizefs).
+# -F|--filesystem <fs> Specify filesystem to create when formatting
+# devices/containers. Defaults to '${DEF_FS}',
+# Choices are $(createfs).
+# -L|--lcsize <size|perc> Size of LUKS encrypted /home ; value is the
+# requested size of the container in kB, MB, GB,
+# or as a percentage of free space
+# (integer numbers only).
+# Examples: '-L 125M', '-L 2G', '-L 20%'.
+# -P|--perssize <size|perc> Size of persistence container ; value is the
+# requested size of the container in kB, MB, GB,
+# or as a percentage of free space
+# (integer numbers only).
+# Examples: '-P 125M', '-P 2G', '-P 20%'.
+# -X|--extendsize <size|perc> Extend size of existing container; value
+# is the requested extension of the container
+# in kB, MB, GB, or as percentage of free space
+# (integer numbers only).
+# Examples: '-X 125M', '-X 2G', '-X 20%'.
+#
+EOT
+} # End of showhelp()
+
+# Show some common usage examples:
+function showexamples() {
+cat <<EOT
+#
+# Some common usage examples for $(basename $0)
+# ---------------------------------------------------------------------------
+# First, mount your USB partition, for instance
+# a Ventoy disk will be mounted for you at /run/media/<user>/Ventoy/.
+# Then:
+# ---------------------------------------------------------------------------
+# Create a 1GB encrypted persistence container:
+# ./$(basename $0) -p /run/media/<user>/Ventoy/myfiles/persistence.icc -P 1G
+#
+# Create a 4GB encrypted home with btrfs filesystem:
+# ./$(basename $0) -l /run/media/<user>/Ventoy/somedir/lukscontainers.icc -L 4000M -F btrfs -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+#
+# Increase the size of that encrypted home container with another 2GB:
+# ./$(basename $0) -x /run/media/<user>/Ventoy/somedir/lukscontainers.icc -X 2G -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+#
+# Create a 10GB encrypted container to be mounted on /data in the Live OS:
+# ./$(basename $0) -l /run/media/<user>/Ventoy/somedir/mydata.icc:/data -L 10G -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+#
+# Create a liveslak directory structure for adding extra live modules:
+# ./$(basename $0) -d /run/media/<user>/Ventoy/myliveslak -i /run/media/<user>/Ventoy/slackware64-live-current.iso
+#
+EOT
+} # End of showexamples()
+
+# Create a filesystem on a partition with optional label:
+function createfs () {
+ MYDEV="${1}"
+ MYFS="${2:-'ext4'}"
+ MYLABEL="${3}"
+
+ if [ -n "${MYLABEL}" ]; then
+ case "${MYFS}" in
+ fs2s) MYLABEL="-l ${MYLABEL}" ;;
+ *) MYLABEL="-L ${MYLABEL}" ;;
+ esac
+ fi
+
+ if [ -z "${MYDEV}" ]; then
+ # Without arguments given, reply with list of supported fs'es:
+ echo "btrfs,ext2,ext4,f2fs,jfs,xfs"
+ return
+ fi
+ case "${MYFS}" in
+ btrfs) mkfs.btrfs -f -d single -m single ${MYLABEL} ${MYDEV}
+ ;;
+ ext2) mkfs.ext2 -F -F ${MYLABEL} ${MYDEV}
+ # Tune the ext2 filesystem:
+ tune2fs -m 0 -c 0 -i 0 ${MYDEV}
+ ;;
+ ext4) mkfs.ext4 -F -F ${MYLABEL} ${MYDEV}
+ # Tune the ext4 filesystem:
+ tune2fs -m 0 -c 0 -i 0 ${MYDEV}
+ ;;
+ f2fs) mkfs.f2fs ${MYLABEL} -f ${MYDEV}
+ ;;
+ jfs) mkfs.jfs -q ${MYDEV}
+ ;;
+ xfs) mkfs.xfs -f ${MYDEV}
+ ;;
+ *) echo "*** Unsupported filesystem '${MYFS}'!"
+ cleanup
+ exit 1
+ ;;
+ esac
+} # End of createfs()
+
+# Resize the filesystem on a block device:
+function resizefs() {
+ local MYDEV="${1}"
+
+ if [ -z "${MYDEV}" ]; then
+ # Without arguments given, reply with list of supported fs'es:
+ echo "btrfs,ext2,ext4,f2fs,jfs,xfs"
+ return
+ fi
+
+ # Determine the current filesystem for the block device:
+ local MYFS=$(lsblk -n -o FSTYPE ${MYDEV})
+ if [ -z "${MYFS}" ]; then
+ echo "*** Failed to resize filesystem on device '${MYDEV}'!"
+ echo "*** No filesystem found."
+ cleanup
+ exit 1
+ fi
+
+ local TMPMNT=$(mktemp -d -p /tmp -t alienres.XXXXXX)
+ if [ ! -d $TMPMNT ]; then
+ echo "*** Failed to create temporary mount for the filesystem resize!"
+ cleanup
+ exit 1
+ else
+ chmod 711 ${TMPMNT}
+ fi
+
+ # Mount the block device prior to the resize
+ # (btrfs, jfs and xfs do not support offline resize):
+ mount -o rw -t ${MYFS} ${MYDEV} ${TMPMNT}
+
+ # Resize the filesystem to occupy the full new device capacity:
+ case "${MYFS}" in
+ btrfs) btrfs filesystem resize max ${TMPMNT}
+ ;;
+ ext*) resize2fs ${MYDEV}
+ ;;
+ f2fs) resize.f2fs ${MYDEV}
+ ;;
+ jfs) mount -o remount,resize,rw ${TMPMNT}
+ ;;
+ xfs) xfs_growfs -d ${TMPMNT}
+ ;;
+ *) echo "*** Unsupported filesystem '${MYFS}'!"; exit 1
+ ;;
+ esac
+
+ if [ ! $? ]; then
+ echo "*** Failed to resize '${MYFS}'filesystem on device '${MYDEV}'!"
+ cleanup
+ exit 1
+ else
+ # Un-mount the device again:
+ sync
+ umount ${TMPMNT}
+ rmdir ${TMPMNT}
+ fi
+} # End of checkfs()
+
+# Uncompress the initrd based on the compression algorithm used:
+function uncompressfs () {
+ if $(file "${1}" | grep -qi ": gzip"); then
+ gzip -cd "${1}"
+ elif $(file "${1}" | grep -qi ": XZ"); then
+ xz -cd "${1}"
+ fi
+} # End of uncompressfs()
+
+# Read configuration data from the initrd inside the ISO,
+# after it has been extracted into a directory:
+function read_initrddir() {
+ local IMGDIR="$1"
+ local INITVARS="$2"
+ cd ${IMGDIR}
+
+ # Read the values of liveslak template variables in the init script:
+ for TEMPLATEVAR in ${INITVARS} ; do
+ eval $(grep "^ *${TEMPLATEVAR}=" ./init |head -1)
+ done
+} # End of read_initrddir()
+
+# Extract the initrd:
+function extract_initrd() {
+ local IMGFILE="$1"
+ local IMGDIR=$(mktemp -d -p /tmp -t alienimg.XXXXXX)
+ if [ ! -d $IMGDIR ]; then
+ echo "*** Failed to create temporary extraction directory for the initrd!"
+ cleanup
+ exit 1
+ else
+ chmod 711 $IMGDIR
+ fi
+
+ cd ${IMGDIR}
+ uncompressfs ${IMGFILE} 2>/dev/null \
+ | cpio -i -d -m -H newc 2>/dev/null
+ echo "$IMGDIR"
+} # End of extract_initrd()
+
+# Determine size of a mounted partition (in MB):
+function get_part_mb_size() {
+ local MYSIZE
+ MYSIZE=$(df -P -BM ${1} |tail -n -1 |tr -s '\t' ' ' |cut -d' ' -f2)
+ echo "${MYSIZE%M}"
+} # End of get_part_mb_size()
+
+# Determine free space of a mounted partition (in MB):
+function get_part_mb_free() {
+ local MYSIZE
+ MYSIZE=$(df -P -BM ${1} |tail -n -1 |tr -s '\t' ' ' |cut -d' ' -f4)
+ echo "${MYSIZE%M}"
+} # End of get_part_mb_free()
+
+# Determine requested container size in MB (allow for '%|k|K|m|M|g|G' suffix):
+function cont_mb() {
+ local MYSIZE="$1"
+ case "${MYSIZE: -1}" in
+ "%") MYSIZE="$(( $PARTFREE * ${MYSIZE%\%} / 100 ))" ;;
+ "k") MYSIZE="$(( ${MYSIZE%k} / 1024 ))" ;;
+ "K") MYSIZE="$(( ${MYSIZE%K} / 1024 ))" ;;
+ "m") MYSIZE="${MYSIZE%m}" ;;
+ "M") MYSIZE="${MYSIZE%M}" ;;
+ "g") MYSIZE="$(( ${MYSIZE%g} * 1024 ))" ;;
+ "G") MYSIZE="$(( ${MYSIZE%G} * 1024 ))" ;;
+ *) MYSIZE=-1 ;;
+ esac
+ echo "$MYSIZE"
+} # End of cont_mb()
+
+# Expand existing encrypted container file:
+function expand_container() {
+ local MYPART="$1" # disk partition
+ local MYINC="$2" # requested increase ('%|k|K|m|M|g|G' suffix)
+ local MYFILE="$3" # full path to ${CNTEXT} containerfile
+ local MYMAP="" # Name of the device-mapped file
+
+ # Determine requested container increase in MB:
+ MYINC=$(cont_mb ${MYINC})
+
+ # Determine size of the target partition (in MB), and the free space:
+ PARTSIZE=$(get_part_mb_size ${MYPART})
+ PARTFREE=$(get_part_mb_free ${MYPART})
+
+ if [ $PARTFREE -lt $(( ${MYINC} + ${MINFREE} )) ]; then
+ echo "*** Free space on USB partition after file-resizing would be less than ${MINFREE} MB;"
+ echo "*** Not resizing the container file!"
+ cleanup
+ exit 1
+ fi
+
+ # Append random bytes to the end of the container file:
+ dd if=/dev/urandom of=${MYFILE} bs=1M count=${MYINC} oflag=append conv=notrunc 2>/dev/null
+
+ # Setup a loopback device that we can use with or without cryptsetup:
+ LODEV=$(losetup -f)
+ losetup $LODEV ${MYFILE}
+
+ if cryptsetup isLuks ${LODEV} ; then
+ # Unlock LUKS encrypted container first:
+ MYMAP=$(basename ${MYFILE} ${CNTEXT})
+ CNTDEV=/dev/mapper/${MYMAP}
+ echo "--- Unlocking the LUKS container requires your passphrase..."
+ until cryptsetup luksOpen ${LODEV} ${MYMAP} ; do
+ echo ">>> Did you type an incorrect passphrases?"
+ read -p ">>> Press [ENTER] to try again or Ctrl-C to abort ..." REPLY
+ done
+ else
+ # The loopmounted block device for the un-encrypted container:
+ CNTDEV=${LODEV}
+ fi
+
+ # Run fsck so the filesystem is clean before we resize it:
+ fsck -fvy ${CNTDEV}
+ # Resize the filesystem to occupy the full new size:
+ resizefs ${CNTDEV}
+ # Just to be safe:
+ fsck -fvy ${CNTDEV}
+
+ # Don't forget to clean up after ourselves:
+ if cryptsetup isLuks ${LODEV} ; then
+ cryptsetup luksClose ${MYMAP}
+ fi
+ losetup -d ${LODEV} || true
+
+} # End of expand_container()
+
+# Create container file in the empty space of the partition
+function create_container() {
+ local CNTPART=$1 # partition containing the ISO
+ local CNTSIZE=$2 # size of the container file to create
+ local CNTFILE=$3 # ${CNTEXT} filename with full path
+ local CNTENCR=$4 # 'none' or 'luks'
+ local CNTUSED=$5 # 'persistence', '/home' or custom mountpoint
+ local MYMAP
+
+ # Create a container file or re-use previously created one:
+ if [ -f ${CNTFILE} ]; then
+ CNTSIZE=$(( $(du -sk ${CNTFILE} |tr '\t' ' ' |cut -f1 -d' ') / 1024 ))
+ echo "--- Keeping existing '${CNTFILE}' (size ${CNTSIZE} MB)."
+ return
+ fi
+
+ # Determine size of the target partition (in MB), and the free space:
+ PARTSIZE=$(get_part_mb_size ${CNTPART})
+ PARTFREE=$(get_part_mb_free ${CNTPART})
+
+ if [ $PARTFREE -lt ${MINFREE} ]; then
+ echo "*** Free space on USB partition is less than ${MINFREE} MB;"
+ echo "*** Not creating a container file!"
+ cleanup
+ exit 1
+ fi
+
+ # Determine requested container size in MB (allow for '%|k|K|m|M|g|G' suffix):
+ CNTSIZE=$(cont_mb ${CNTSIZE})
+
+ if [ $CNTSIZE -le 0 ]; then
+ echo "*** Container size must be larger than ZERO!"
+ echo "*** Check your commandline parameter."
+ cleanup
+ exit 1
+ elif [ $CNTSIZE -ge $PARTFREE ]; then
+ echo "*** Not enough free space for container file!"
+ echo "*** Check your commandline parameter."
+ cleanup
+ exit 1
+ fi
+
+ echo "--- Creating ${CNTSIZE} MB container file '$(basename =${CNTFILE})' using 'dd if=/dev/urandom', patience please..."
+ mkdir -p $(dirname "${CNTFILE}")
+ if [ $? ]; then
+ # Create a sparse file (not allocating any space yet):
+ dd of=${CNTFILE} bs=1M count=0 seek=$CNTSIZE 2>/dev/null
+ else
+ echo "*** Failed to create directory for the container file!"
+ cleanup
+ exit 1
+ fi
+
+ # Setup a loopback device that we can use with cryptsetup:
+ LODEV=$(losetup -f)
+ losetup $LODEV ${CNTFILE}
+ MYMAP=$(basename ${CNTFILE} ${CNTEXT})
+ if [ "${CNTENCR}" = "luks" ]; then
+ # Format the loop device with LUKS:
+ echo "--- Encrypting the container file with LUKS; takes SOME time..."
+ echo "--- enter 'YES' and a passphrase:"
+ until cryptsetup -y luksFormat $LODEV ; do
+ echo ">>> Did you type two different passphrases?"
+ read -p ">>> Press [ENTER] to try again or Ctrl-C to abort ..." REPLY
+ done
+ # Unlock the LUKS encrypted container:
+ echo "--- Unlocking the LUKS container requires your passphrase again..."
+ until cryptsetup luksOpen $LODEV ${MYMAP} ; do
+ echo ">>> Did you type an incorrect passphrases?"
+ read -p ">>> Press [ENTER] to try again or Ctrl-C to abort ..." REPLY
+ done
+ CNTDEV=/dev/mapper/${MYMAP}
+ # Now we allocate blocks for the LUKS device. We write encrypted zeroes,
+ # so that the file looks randomly filled from the outside.
+ # Take care not to write more bytes than the internal size of the container:
+ echo "--- Writing ${CNTSIZE} MB of random data to encrypted container; takes LONG time..."
+ CNTIS=$(( $(lsblk -b -n -o SIZE $(readlink -f ${CNTDEV})) / 512))
+ dd if=/dev/zero of=${CNTDEV} bs=512 count=${CNTIS} status=progress || true
+ else
+ # Un-encrypted container files remain sparse.
+ CNTDEV=$LODEV
+ fi
+
+ # Format the now available block device with a linux fs:
+ createfs ${CNTDEV} ${FSYS}
+
+ if [ "${CNTUSED}" == "${DEFMNT}" ]; then
+ # Copy the original /home content into the container.
+ # NOTE: we only do this for /home, not for any other mountpoint!
+
+ # Create a mount point for the unlocked container:
+ CNTMNT=$(mktemp -d -p /var/tmp -t aliencnt.XXXXXX)
+ if [ ! -d $CNTMNT ]; then
+ echo "*** Failed to create temporary mount point for the LUKS container!"
+ cleanup
+ exit 1
+ else
+ chmod 711 $CNTMNT
+ fi
+ echo "--- Copying '${CNTUSED}' from ISO to container..."
+ HOMESRC=$(find ${ISOMNT} -name "0099-slackware_zzzconf*" |tail -1)
+ mount ${CNTDEV} ${CNTMNT}
+ unsquashfs -n -d ${CNTMNT}/temp ${HOMESRC} ${CNTUSED}
+ mv ${CNTMNT}/temp/${CNTUSED}/* ${CNTMNT}/
+ rm -rf ${CNTMNT}/temp
+ umount ${CNTDEV}
+ fi
+
+ # Don't forget to clean up after ourselves:
+ if [ "${CNTENCR}" = "luks" ]; then
+ cryptsetup luksClose $(basename ${CNTFILE} ${CNTEXT})
+ fi
+ losetup -d ${LODEV} || true
+
+} # End of create_container()
+
+function read_isoconfig() {
+ local MYISO="${1}"
+ # Read ISO customization from the .cfg file if it exists:
+ if [ -f "${MYISO%.iso}.cfg" ]; then
+ for LIVEPARM in \
+ BLACKLIST KEYMAP LIVE_HOSTNAME LIVESLAKROOT LOAD LOCALE LUKSVOL \
+ NOLOAD ISOPERSISTENCE RUNLEVEL TWEAKS TZ XKB ;
+ do
+ # Read values from disk only if the variable has not been set yet:
+ if [ -z "$(eval echo \$${LIVEPARM})" ]; then
+ eval $(grep -w ^${LIVEPARM} ${MYISO%.iso}.cfg)
+ fi
+ done
+ fi
+} # End of read_isoconfig()
+
+function write_isoconfig() {
+ local MYISO="${1}"
+ # Write updated customization into the ISO .cfg:
+ echo "# Liveslak ISO configuration file for ${VERSION}" > ${MYISO%.iso}.cfg 2>/dev/null
+ echo "# Generated by $(basename $0) on $(date +%Y%m%d_%H%M)" >> ${MYISO%.iso}.cfg 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "*** Media '${USBPART}' read-only, cannot write config file."
+ else
+ for LIVEPARM in \
+ BLACKLIST KEYMAP LIVE_HOSTNAME LIVESLAKROOT LOAD LOCALE LUKSVOL \
+ NOLOAD ISOPERSISTENCE RUNLEVEL TWEAKS TZ XKB ;
+ do
+ if [ -n "$(eval echo \$$LIVEPARM)" ]; then
+ echo $LIVEPARM=$(eval echo \$$LIVEPARM) >> ${MYISO%.iso}.cfg
+ fi
+ done
+ fi
+} # End of write_isoconfig()
+
+#
+# -- end of function definitions --
+#
+
+# ===========================================================================
+
+# Parse the commandline parameters:
+if [ -z "$1" ]; then
+ showhelp
+ exit 1
+fi
+while [ ! -z "$1" ]; do
+ case $1 in
+ -d|--directory)
+ LIVESLAKROOT="$2"
+ [[ ${LIVESLAKROOT::1} != "/" ]] && LIVESLAKROOT="$(pwd)/${LIVESLAKROOT}"
+ shift 2
+ ;;
+ -e|--examples)
+ showexamples
+ exit
+ ;;
+ -f|--force)
+ FORCE=1
+ shift
+ ;;
+ -h|--help)
+ showhelp
+ exit
+ ;;
+ -i|--iso)
+ SLISO="$(cd "$(dirname "$2")"; pwd)/$(basename "$2")"
+ shift 2
+ ;;
+ -l|--lukscontainer)
+ LUKSMNT="$(echo "$2" |cut -f2 -d:)"
+ LUKSCNT="$(echo "$2" |cut -f1 -d:)"
+ # If no mountpoint was specified, use the default mountpoint (/home):
+ [ "$LUKSMNT" == "$LUKSCNT" ] && LUKSMNT=${DEFMNT}
+ LUKSCNT="$(cd "$(dirname "$LUKSCNT")"; pwd)/$(basename "$LUKSCNT")"
+ shift 2
+ ;;
+ -p|--persistence)
+ PERSISTENCE="$(cd "$(dirname "$2")"; pwd)/$(basename "$2")"
+ shift 2
+ ;;
+ -x|--extend)
+ EXTENSION="$(cd "$(dirname "$2")"; pwd)/$(basename "$2")"
+ shift 2
+ ;;
+ -F|--filesystem)
+ FSYS="$2"
+ shift 2
+ ;;
+ -L|--lcsize)
+ LUKSSIZE="$2"
+ shift 2
+ ;;
+ -P|--perssize)
+ PERSSIZE="$2"
+ shift 2
+ ;;
+ -X|--extendsize)
+ INCSIZE="$2"
+ shift 2
+ ;;
+ *)
+ echo "*** Unknown parameter '$1'!"
+ exit 1
+ ;;
+ esac
+done
+
+#
+# Sanity checks:
+#
+
+if [ "$(id -u)" != "0" ]; then
+ echo "*** You need to be root to run $(basename $0)."
+ exit 1
+fi
+
+# Add required filesystem tools:
+REQTOOLS="${REQTOOLS} mkfs.${FSYS}"
+
+# Are all the required tools present?
+PROG_MISSING=""
+for PROGN in ${REQTOOLS} ; do
+ if ! which $PROGN 1>/dev/null 2>/dev/null ; then
+ PROG_MISSING="${PROG_MISSING}-- $PROGN\n"
+ fi
+done
+if [ ! -z "$PROG_MISSING" ] ; then
+ echo "--- Required program(s) not found in search path '$PATH'!"
+ echo -e ${PROG_MISSING}
+ if [ $FORCE -eq 0 ]; then
+ echo "--- Exiting."
+ exit 1
+ fi
+fi
+
+if [ -z "${SLISO}" ]; then
+ echo "*** You must specify the path to the Live ISO (option '-i')!"
+ exit 1
+fi
+
+if [ ! -f "$SLISO" ]; then
+ echo "*** This is not a useable file: '$SLISO' !"
+ exit 1
+fi
+
+if [ -z "${LIVESLAKROOT}${LUKSCNT}${PERSISTENCE}${EXTENSION}" ]; then
+ echo "*** No action requested!"
+ exit 1
+fi
+
+if [ -n "${PERSISTENCE}" ]; then
+ if [ -z "${PERSSIZE}" ]; then
+ echo "*** Persistence filename '${PERSISTENCE}' defined but no filesize provided!"
+ echo "*** Not enabling persistence, please use '-P' parameter."
+ exit 1
+ elif [ "$(basename ${PERSISTENCE} ${CNTEXT})" == "$(basename ${PERSISTENCE})" ]; then
+ echo "*** File '${PERSISTENCE}' does not have an '${CNTEXT}' extension!"
+ if [ $FORCE -eq 0 ]; then
+ exit 1
+ else
+ CNTEXT=$(basename ${PERSISTENCE})
+ if [ "${CNTEXT}" != "${CNTEXT##*.}" ]; then
+ # File has a different extension:
+ echo "--- Accepting '${CNTEXT##*.}' extension for '${PERSISTENCE}'."
+ CNTEXT=${CNTEXT##*.}
+ else
+ # File does not have an extension at all, so we add one:
+ echo "--- Adding '${DEFEXT}' extension to '${PERSISTENCE}'."
+ PERSISTENCE="${PERSISTENCE}${DEFEXT}"
+ fi
+ fi
+ fi
+fi
+
+if [ -n "${LUKSCNT}" ]; then
+ if [ -z "${LUKSSIZE}" ]; then
+ echo "*** LUKS container '${LUKSCNT}' defined but no filesize provided!"
+ echo "*** Not adding encrypted ${LUKSMNT}, please use '-L' parameter."
+ exit 1
+ elif [ "$(basename ${LUKSCNT} ${CNTEXT})" == "$(basename ${LUKSCNT})" ]; then
+ echo "*** File '${LUKSCNT}' does not have an '${CNTEXT}' extension!"
+ if [ $FORCE -eq 0 ]; then
+ exit 1
+ else
+ CNTEXT=$(basename ${LUKSCNT})
+ if [ "${CNTEXT}" != "${CNTEXT##*.}" ]; then
+ # File has a different extension:
+ echo "--- Accepting '${CNTEXT##*.}' extension for '${LUKSCNT}'."
+ CNTEXT=${CNTEXT##*.}
+ else
+ # File does not have an extension at all, so we add one:
+ echo "--- Adding '${DEFEXT}' extension to '${LUKSCNT}'."
+ LUKSCNT="${LUKSCNT}${DEFEXT}"
+ fi
+ fi
+ fi
+fi
+
+if [ -n "${EXTENSION}" ]; then
+ if [ -z "${INCSIZE}" ]; then
+ echo "*** LUKS container '${EXTENSION}' defined but no extansion size provided!"
+ echo "*** Not extending encrypted ${EXTENSION}, please use '-X' parameter."
+ exit 1
+ elif [ "$(basename ${EXTENSION} ${CNTEXT})" == "$(basename ${EXTENSION})" ]; then
+ echo "*** File '${EXTENSION}' does not have an '${CNTEXT}' extension!"
+ if [ $FORCE -eq 0 ]; then
+ exit 1
+ else
+ CNTEXT=$(basename ${EXTENSION})
+ if [ "${CNTEXT}" != "${CNTEXT##*.}" ]; then
+ # File has a different extension:
+ echo "--- Accepting '${CNTEXT##*.}' extension for '${EXTENSION}'."
+ CNTEXT=${CNTEXT##*.}
+ else
+ # File does not have an extension at all, so we add one:
+ echo "--- Adding '${DEFEXT}' extension to '${EXTENSION}'."
+ EXTENSION="${EXTENSION}${DEFEXT}"
+ fi
+ fi
+ fi
+fi
+
+# Determine name and mountpoint of the partition containing the ISO:
+USBPART=$(cd $(dirname ${SLISO}) ; df . |tail -n -1 |tr -s ' ' |cut -d' ' -f1)
+USBMNT=$(cd $(dirname ${SLISO}) ; df . |tail -n -1 |tr -s ' ' |cut -d' ' -f6)
+
+# Determine size of the USB partition (in MB), and the free space:
+USBPSIZE=$(get_part_mb_size ${USBMNT})
+USBPFREE=$(get_part_mb_free ${USBMNT})
+
+# Report the Slackware Live version:
+VERSION=$(isoinfo -d -i "${SLISO}" 2>/dev/null |grep Application |cut -d: -f2-)
+echo "--- The ISO on medium '${USBPART}' is '${VERSION}'"
+
+# Try a write to the partition:
+if touch ${USBMNT}/.rwtest 2>/dev/null && rm ${USBMNT}/.rwtest 2>/dev/null
+then
+ echo "--- The medium '${USBPART}' is writable."
+else
+ echo "--- Trying to remount readonly medium '${USBPART}' as writable..."
+ mount -o remount,rw ${USBMNT}
+ if [ $? -ne 0 ]; then
+ echo "*** Failed to remount '${USBPART}' writable, unable to continue!"
+ cleanup
+ exit 1
+ fi
+fi
+
+# Create a mount point for the ISO:
+ISOMNT=$(mktemp -d -p /var/tmp -t alieniso.XXXXXX)
+if [ ! -d $ISOMNT ]; then
+ echo "*** Failed to create temporary mount point for the ISO!"
+ cleanup
+ exit 1
+else
+ chmod 711 $ISOMNT
+ mount -o loop ${SLISO} ${ISOMNT}
+fi
+
+# Collect data from the USB initrd:
+IMGDIR=$(extract_initrd ${ISOMNT}/boot/initrd.img)
+read_initrddir ${IMGDIR} "DISTRO LIVEMAIN MARKER MEDIALABEL"
+
+# Collect customization parameters for the ISO:
+read_isoconfig ${SLISO}
+
+# Determine where in LUKSVOL the /home is defined.
+# The LUKSVOL value looks like:
+# "/path/to/cntner1.icc:/mountpoint1,[/path/to/cntner2.icc:/mountpoint2,[...]]"
+# Break down the LUKSVOL value into container/mountpoint combo's:
+if [ -n "$LUKSVOL" ]; then
+ _container=""
+ _mount=""
+ for _luksvol in $(echo $LUKSVOL |tr ',' ' '); do
+ _container="$(echo $_luksvol |cut -d: -f1)"
+ _mount="$(echo $_luksvol |cut -d: -f2)"
+ if [ "$_mount" == "$_container" ]; then
+ # No optional mount point specified, so we use the default:
+ CONTAINERS["${DEFMNT}"]="$_container"
+ else
+ CONTAINERS["$_mount"]="$_container"
+ fi
+ done
+fi
+
+# Normalize paths on USB partition (remove mountpoint):
+if [ -n "${PERSISTENCE}" ]; then
+ PERSISTENCE="${PERSISTENCE#$USBMNT}"
+fi
+if [ -n "${LUKSCNT}" ]; then
+ LUKSCNT="${LUKSCNT#$USBMNT}"
+fi
+if [ -n "${EXTENSION}" ]; then
+ EXTENSION="${EXTENSION#$USBMNT}"
+fi
+
+# Should we create a liveslak root directory?
+if [ -n "${LIVESLAKROOT}" ]; then
+ # The directory may already exist, in which case we obtained its name
+ # from the configfile. But creating directory tree is harmless:
+ mkdir -p ${LIVESLAKROOT}/${LIVEMAIN}/{addons,optional,core2ram}
+ # Normalize the path, removing the mount point:
+ LIVESLAKROOT="$(cd "$(dirname "$LIVESLAKROOT")"; pwd)$(basename "$LIVESLAKROOT")"
+ LIVESLAKROOT="${LIVESLAKROOT#$USBMNT}"
+fi
+
+# Should we create a persistence container?
+if [ -n "${PERSISTENCE}" ]; then
+ # Create LUKS persistence container file (or re-use it if existing):
+ create_container ${USBPART} ${PERSSIZE} ${USBMNT}${PERSISTENCE} luks persistence
+ ISOPERSISTENCE="${PERSISTENCE}"
+fi
+
+# Should we add a LUKS container to mount at /home or specified other mount?
+if [ -n "${LUKSCNT}" ]; then
+ if [ -v 'CONTAINERS["${LUKSMNT}"]' ] && [ "${LUKSCNT}" != "${CONTAINERS["${LUKSMNT}"]}" ]; then
+ # The configfile specifies a different mount for container:
+ echo "*** On-disk configuration defines an existing mountpoint ${LUKSMNT}"
+ echo "*** at '${USBMNT}${CONTAINERS["${LUKSMNT}"]}',"
+ echo "*** which is different from your '-l ${USBMNT}${LUKSCNT}'."
+ if [ $FORCE -eq 0 ]; then
+ echo "*** Not adding encrypted container for ${LUKSMNT} , please fix the entry"
+ echo "*** in '${SLISO%.iso}.cfg',"
+ echo "*** or supply the correct value for the '-l' parameter!"
+ cleanup
+ exit 1
+ else
+ echo "--- Accepting new mountpoint '${LUKSMNT}' for encrypted container ${LUKSMNT}"
+ fi
+ fi
+ # Create LUKS container file for the mount point (or re-use it if existing):
+ create_container ${USBPART} ${LUKSSIZE} ${USBMNT}${LUKSCNT} luks ${LUKSMNT}
+ CONTAINERS["${LUKSMNT}"]="${LUKSCNT}"
+fi
+
+# Should we extend the size of a container?
+if [ -n "${EXTENSION}" ]; then
+ # Expand existing container file:
+ expand_container ${USBPART} ${INCSIZE} ${USBMNT}/${EXTENSION}
+fi
+
+if [ ${#CONTAINERS[@]} -gt 0 ]; then
+ # CONTAINERS array is non-empty; (re-)assemble the LUKSVOL variable.
+ # First zap the LUKSVOL value:
+ LUKSVOL=""
+ # Write the CONTAINERS array back into LUKSVOL in the correct format:
+ for _mount in "${!CONTAINERS[@]}"; do
+ LUKSVOL="${LUKSVOL}${CONTAINERS[$_mount]}:${_mount},"
+ done
+ # Remove the trailing ',':
+ LUKSVOL="${LUKSVOL::-1}"
+fi
+
+# Write customization parameters for the ISO to disk:
+write_isoconfig ${SLISO}
+
+# Write ISO version to the liveslak rootdir if that exists:
+if [ -d "${USBMNT}/${LIVESLAKROOT}" ]; then
+ echo "$VERSION" > ${USBMNT}/${LIVESLAKROOT}/.isoversion
+fi
+
+# Unmount/remove stuff:
+cleanup
+
+# THE END
+
diff --git a/languages b/languages
index baefba9..23ef114 100644
--- a/languages
+++ b/languages
@@ -5,6 +5,7 @@ da:dansk:dk-latin1:Europe/Copenhagen:da_DK.utf8:
gb:british:uk:Etc/GMT:en_GB.utf8:
de:deutsch:de-latin1-nodeadkeys:Europe/Berlin:de_DE@euro:de,nodeadkeys
de_ch:deutsch (schweiz):de-latin1:Europe/Zurich:de_CH.utf8:ch,
+en:english:us:UTC:en_US.utf8:
es:espanol:es:Europe/Madrid:es_ES.utf8:
fr:francais:fr-latin9:Europe/Paris:fr_FR.utf8:
fr_ch:francais (suisse):fr-latin9:Europe/Zurich:fr_CH.utf8:ch,fr
diff --git a/liveinit.tpl b/liveinit.tpl
index 3ac0782..c4fd29a 100644
--- a/liveinit.tpl
+++ b/liveinit.tpl
@@ -1,8 +1,8 @@
-#!/bin/ash
+#!/bin/sh
#
# Copyright 2004 Slackware Linux, Inc., Concord, CA, USA
# Copyright 2007, 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA
-# Copyright 2015, 2016, 2017, 2018 Eric Hameleers, Eindhoven, NL
+# Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -38,12 +38,18 @@ MEDIALABEL="@MEDIALABEL@"
LIVEMAIN="@LIVEMAIN@"
MARKER="@MARKER@"
+
PERSISTENCE="@PERSISTENCE@"
+PERSISTPART=""
+PERSISTPATH="."
DISTRO="@DISTRO@"
CDISTRO="@CDISTRO@"
VERSION="@VERSION@"
+CORE2RAMMODS="@CORE2RAMMODS@"
+CORE2RAM=0
+
LIVEUID="@LIVEUID@"
LIVEMEDIA=""
@@ -61,16 +67,20 @@ DEF_LOCALE=@DEF_LOCALE@
DEF_TZ=@DEF_TZ@
# By default, let the media determine if we can write persistent changes:
-# However, if we define TORAM=1, we will also set VIRGIN=1 since we want
-# to avoid anything that writes to disk after we copy the OS to RAM.
+# However, if we define TORAM=1, we will also set VIRGIN=1 when we want
+# to avoid anything that writes to disk after we copy the OS to RAM;
+# unless we explicitly use a persistence directory on the computer's local disk.
VIRGIN=0
# If set to '1', existing persistent data will be wiped:
WIPE_PERSISTENCE=0
# Used for debugging the init;
-# Set DEBUG to '1' to enable explicit pauses; '2' enables verbose script exec;
-# and '4' dumps you into a debug shell right before the switch_root:
+# Set DEBUG to '1' to enable explicit pauses showing blkid/mount info;
+# '2' and higher enable verbose script execution;
+# '3' pauses like '1' or '2' but won't show blkid/mount info;
+# '4' dumps you into a debug shell right before the switch_root;
+# '5' additionally saves the verbose init execution output to 'debug_init.log':
DEBUG=0
DEBUGV=" "
@@ -103,6 +113,40 @@ HNMAC_ALLOWED="YES"
INTERFACE=""
NFSHOST=""
+# Assume the default to be a readonly media - we write to RAM:
+UPPERDIR=/mnt/live/changes
+OVLWORK=/mnt/live/.ovlwork
+
+# Persistence directory on writable media gets mounted below /mnt/media.
+# If the user specifies a system partition instead,
+# then the mount point will be a subdirectory of /mnt/live instead:
+PPATHINTERNAL=/mnt/media
+
+# Where will we mount the partition containing the ISO we are booting?
+SUPERMNT=/mnt/super
+
+# LUKS containers on writable media are found below /mnt/media,
+# unless liveslak boots off an ISO image, in which case the container files
+# are found below /mnt/super - the filesystem of the USB partition containing
+# our ISO:
+CPATHINTERNAL=/mnt/media
+
+# If we boot directly off the ISO file, we want to know to enable extras.
+# Possible values for ISOBOOT are 'diskpart','ventoy':
+ISOBOOT=""
+# The configuration file with customization for an ISO boot.
+# Defaults to full pathname of the ISO, with extension 'cfg' instead of 'iso'.
+ISOCFG=""
+
+# The extension for containerfiles accompanying an ISO is '.icc',
+# for a persistent USB stick the extension is '.img' and this is the default:
+CNTEXT=".img"
+
+# Password handling, assign random initialization:
+DEFPW="7af0aed2-d900-4ed8-89f0"
+ROOTPW=$DEFPW
+LIVEPW=$DEFPW
+
# Max wait time for DHCP client to configure an interface:
DHCPWAIT=20
@@ -117,13 +161,18 @@ PATH="/sbin:/bin:/usr/sbin:/usr/bin"
# Mount /proc and /sys:
mount -n proc /proc -t proc
mount -n sysfs /sys -t sysfs
-mount -n tmpfs /run -t tmpfs -o mode=0755
+mount -n tmpfs /run -t tmpfs -o mode=0755,size=32M,nodev,nosuid,noexec
if grep devtmpfs /proc/filesystems 1>/dev/null 2>/dev/null ; then
DEVTMPFS=1
- mount -n devtmpfs /dev -t devtmpfs
+ mount -n devtmpfs /dev -t devtmpfs -o size=8M
fi
+# Mount if this directory exists (so the kernel supports efivarfs):
+if [ -d /sys/firmware/efi/efivars ]; then
+ mount -o rw -t efivarfs none /sys/firmware/efi/efivars
+fi
+
# Parse command line
for ARG in $(cat /proc/cmdline); do
case $ARG in
@@ -143,9 +192,18 @@ for ARG in $(cat /proc/cmdline); do
dhcpwait=*)
DHCPWAIT=$(echo $ARG | cut -f2 -d=)
;;
+ domain=*)
+ # generic syntax: sub.domain.some
+ LIVE_DOMAIN=$(echo $ARG | cut -f2 -d=)
+ ;;
hostname=*)
# generic syntax: hostname=newname[,qualifier]
LIVE_HOSTNAME=$(echo $ARG | cut -f2 -d= | cut -f1 -d,)
+ # Allow for the user to (mistakenly) add a domain component:
+ if [ -n "$(echo "$LIVE_HOSTNAME". |cut -d. -f2-)" ]; then
+ LIVE_DOMAIN=$(echo $LIVE_HOSTNAME |cut -d. -f2-)
+ LIVE_HOSTNAME=$(echo $LIVE_HOSTNAME |cut -d. -f1)
+ fi
if [ "$(echo $ARG | cut -f2 -d= | cut -f2 -d,)" = "fixed" ]; then
Keep hostname fixed i.e. never add a MAC address suffix:
HNMAC_ALLOWED="NO"
@@ -163,6 +221,7 @@ for ARG in $(cat /proc/cmdline); do
livemedia=*)
# generic syntax: livemedia=/dev/sdX
# ISO syntax: livemedia=/dev/sdX:/path/to/slackwarelive.iso
+ # Scan partitions for ISO: livemedia=scandev:/path/to/slackwarelive.iso
LM=$(echo $ARG | cut -f2 -d=)
LIVEMEDIA=$(echo $LM | cut -f1 -d:)
LIVEPATH=$(echo $LM | cut -f2 -d:)
@@ -212,7 +271,22 @@ for ARG in $(cat /proc/cmdline); do
fi
;;
persistence=*)
- PERSISTENCE=$(echo $ARG | cut -f2 -d=)
+ # Generic syntax: persistence=/path/to/persistencedir
+ # Dir on harddisk partition: persistence=/dev/sdX:/path/to/persistencedir
+ # Instead of device name, the value of its LABEL or UUID can be used too.
+ PD=$(echo $ARG | cut -f2 -d=)
+ PERSISTPART=$(echo $PD | cut -f1 -d:)
+ PERSISTPATH=$(dirname $(echo $PD | cut -f2 -d:))
+ PERSISTENCE=$(basename $(echo $PD | cut -f2 -d:))
+ unset PD
+ if [ "${PERSISTENCE})" = "changes" ]; then
+ echo "${MARKER}: Persistence directory cannot be called 'changes'."
+ echo "${MARKER}: Disabling persistence and recording changes in RAM."
+ PERSISTPART=""
+ PERSISTPATH="."
+ PERSISTENCE="@PERSISTENCE@"
+ VIRGIN=1
+ fi
;;
rescue)
RESCUE=1
@@ -227,6 +301,32 @@ for ARG in $(cat /proc/cmdline); do
TORAM=1
VIRGIN=1 # prevent writes to disk since we are supposed to run from RAM
;;
+ toram=*)
+ # Generic syntax: toram=type[,memperc]
+ # type: string value; os,core,all,none
+ # memperc: integer value, percentage RAM to reserve for liveslak
+ # You can use this parameter to change the percentage RAM
+ # used by liveslak, which is 50% for normal operation.
+ # For instance when you have an insane amount of RAM, you can specify
+ # a much lower percentage to be reserved for liveslak:
+ # toram=none,12
+ TORAM=1
+ TRTYPE="$(echo $ARG |cut -f2 -d= |cut -f1 -d,)"
+ if [ "$TRTYPE" = "os" ]; then
+ VIRGIN=0 # load OS modules into RAM, write persistent data to disk
+ elif [ "$TRTYPE" = "core" ]; then
+ CORE2RAM=1 # load Core OS modules into RAM
+ elif [ "$TRTYPE" = "all" ]; then
+ VIRGIN=1 # prevent writes to disk since we are supposed to run from RAM
+ elif [ "$TRTYPE" = "none" ]; then
+ TORAM=0 # we only want to change the percentage reserved memory
+ fi
+ RAMSIZE="$(echo $ARG |cut -f2 -d= |cut -f2 -d,)"
+ if [ "$RAMSIZE" = "$TRTYPE" ]; then
+ # memperc was not supplied on commandline:
+ unset RAMSIZE
+ fi
+ ;;
tweaks=*)
# Comma-separated set of usability tweaks.
# nga: no glamor 2d acceleration.
@@ -249,7 +349,17 @@ for ARG in $(cat /proc/cmdline); do
done
# Verbose boot script execution:
-[ $DEBUG -ge 2 ] && set -x
+if [ $DEBUG -ge 2 ]; then
+ if [ $DEBUG -ge 5 ]; then
+ # We save (verbose) shell output to local file;
+ # These busybox compile options make it possible:
+ # CONFIG_SH_IS_ASH=y
+ # CONFIG_ASH_BASH_COMPAT=y
+ exec 5> debug_init.log
+ export BASH_XTRACEFD="5"
+ fi
+ set -x
+fi
debugit () {
if [ $DEBUG -eq 0 -o $DEBUG -gt 3 ]; then
@@ -312,6 +422,7 @@ fi
# Sometimes the devices need extra time to be available.
# A root filesystem on USB is a good example of that.
+echo "${MARKER}: Sleeping $WAIT seconds to give slow USB devices some time."
sleep $WAIT
# Fire at least one blkid:
blkid 1>/dev/null 2>/dev/null
@@ -370,6 +481,8 @@ if [ "$RESCUE" = "" ]; then
echo "/run/dhcpcd-${MYDEV}.pid"
elif [ -s /run/dhcpcd-${MYDEV}-4.pid ]; then
echo "/run/dhcpcd-${MYDEV}-4.pid"
+ elif [ -s /run/${MYDEV}.pid ]; then
+ echo "/run/${MYDEV}.pid"
else
echo UNKNOWNLOC
fi
@@ -472,7 +585,7 @@ if [ "$RESCUE" = "" ]; then
find_loop() {
# The losetup of busybox is different from the real losetup - watch out!
- lodev=$(losetup -f)
+ lodev=$(losetup -f 2>/dev/null)
if [ -z "$lodev" ]; then
# We exhausted the available loop devices, so create the block device:
for NOD in $(seq 0 ${MAXLOOPS}); do
@@ -487,22 +600,35 @@ if [ "$RESCUE" = "" ]; then
mknod -m660 $lodev b 7 $(echo $lodev |sed 's%/dev/loop%%')
fi
echo "$lodev"
- }
+ } # End find_loop()
mod_base() {
MY_MOD="$1"
echo $(basename ${MY_MOD}) |rev |cut -d. -f2- |rev
- }
+ } # End mod_base()
find_mod() {
MY_LOC="$1"
-
- ( for MY_EXT in ${SQ_EXT_AVAIL} ; do
- echo "$(find ${MY_LOC} -name "*.${MY_EXT}" 2>/dev/null)"
- done
- ) | sort
- }
+ MY_SUBSYS=$(basename "$1")
+ MY_SYSROOT=$(dirname "$1")
+ MY_COREMODS="$(echo boot ${CORE2RAMMODS} zzzconf |tr ' ' '|')"
+
+ # For all except core2ram, this is a simple find & sort, but for core2ram
+ # we have to search two locations (system and core2ram) and filter the
+ # results to return only the Core OS modules:
+ if [ "${MY_SUBSYS}" = "core2ram" ]; then
+ ( for MY_EXT in ${SQ_EXT_AVAIL} ; do
+ echo "$(find ${MY_SYSROOT}/core2ram/ ${MY_SYSROOT}/system/ -name "*.${MY_EXT}" 2>/dev/null |grep -Ew ${DISTRO}_"(${MY_COREMODS})")"
+ done
+ ) | sort
+ else
+ ( for MY_EXT in ${SQ_EXT_AVAIL} ; do
+ echo "$(find ${MY_LOC} -name "*.${MY_EXT}" 2>/dev/null)"
+ done
+ ) | sort
+ fi
+ } # End find_mod()
find_modloc() {
MY_LOC="$1"
@@ -520,14 +646,19 @@ if [ "$RESCUE" = "" ]; then
fi
echo "${MY_LOC}"
- }
+ } # End find_modloc()
load_modules() {
- # SUBSYS can be 'system', 'addons', 'optional':
+ # SUBSYS can be 'system', 'addons', 'optional', 'core2ram':
SUBSYS="$1"
# Find all supported modules:
- for MODULE in $(find_mod /mnt/media/${LIVEMAIN}/${SUBSYS}/) ; do
+ SUBSYSSET="$(find_mod /mnt/media/${LIVEMAIN}/${SUBSYS}/) $(find_mod ${SUPERMNT}/${LIVESLAKROOT}/${LIVEMAIN}/${SUBSYS}/)"
+ if [ "$SUBSYS" = "optional" ]; then
+ # We need to load any core2ram modules first:
+ SUBSYSSET="$(find_mod /mnt/media/${LIVEMAIN}/core2ram/) $(find_mod ${SUPERMNT}/${LIVESLAKROOT}/${LIVEMAIN}/core2ram/ ${SUBSYSSET})"
+ fi
+ for MODULE in ${SUBSYSSET} ; do
# Strip path and extension from the modulename:
MODBASE="$(mod_base ${MODULE})"
if [ "$SUBSYS" = "optional" ]; then
@@ -563,13 +694,22 @@ if [ "$RESCUE" = "" ]; then
else
echo "${MARKER}: Failed to mount $SUBSYS module '${MODBASE}', excluding it from the overlay."
echo "$MODBASE" >> /mnt/live/modules/failed
+ rmdir /mnt/live/modules/${MODBASE} 2>/dev/null
fi
fi
done
- }
+
+ # Warn if Core OS modules were requested but none were found/mounted;
+ if [ "$SUBSYS" = "core2ram" ]; then
+ MY_COREMODS="$(echo ${CORE2RAMMODS} |tr ' ' '|')"
+ if [ -z "$(ls -1 /mnt/live/modules/ |grep -Ew ${DISTRO}_"(${MY_COREMODS})")" ] ; then
+ echo "${MARKER}: '$SUBSYS' modules were not found. Trouble ahead..."
+ fi
+ fi
+ } # End load_modules()
# Function input is a series of device node names. Return all block devices:
- ret_blockdev () {
+ ret_blockdev() {
local OUTPUT=""
for IDEV in $* ; do
if [ -e /sys/block/$(basename $IDEV) ]; then
@@ -579,10 +719,10 @@ if [ "$RESCUE" = "" ]; then
done
# Trim trailing space:
echo $OUTPUT |cat
- }
+ } # End ret_blockdev()
# Function input is a series of device node names. Return all partitions:
- ret_partition () {
+ ret_partition() {
local OUTPUT=""
for IDEV in $* ; do
if [ -e /sys/class/block/$(basename $IDEV)/partition ]; then
@@ -592,22 +732,178 @@ if [ "$RESCUE" = "" ]; then
done
# Trim trailing space:
echo $OUTPUT |cat
- }
+ } # End ret_partition()
+
+ # Return device node of Ventoy partition if found:
+ # Function input:
+ # (param 1) Ventoy OS parameter block (512 bytes file).
+ # (param 2) action
+ # 'isopath' request: return full path to the ISO on the USB filesystem;
+ # 'devpartition' request:
+ # return the device node for the partition containing the ISO file;
+ # 'diskuuid' request: return the UUID for the disk;
+ # 'partnr' request: return the number of the partition containing the ISO;
+ ret_ventoy() {
+ local VOSPARMS="$1"
+ local VACTION="$2"
+ local DISKSIZE=""
+ local BDEV=""
+ local IPART=""
+ local VENTPART=""
+
+ if [ "$VACTION" == "isopath" ]; then
+ echo $(hexdump -s 45 -n 384 -e '384/1 "%01c""\n"' $VOSPARMS)
+ elif [ "$VACTION" == "diskuuid" ]; then
+ echo $(hexdump -s 481 -n 4 -e '4/1 "%02x "' ${VOSPARMS} \
+ | awk '{ for (i=NF; i>1; i--) printf("%s",$i); print $i; }' )
+ elif [ "$VACTION" == "partnr" ]; then
+ echo $(( 0x$(hexdump -s 41 -n 2 -e '2/1 "%02x "' ${VOSPARMS} \
+ | awk '{ for (i=NF; i>1; i--) printf("%s",$i); print $i; }' )
+ ))
+ elif [ "$VACTION" == "devpartition" ]; then
+ PARTNR=$(( 0x$(hexdump -s 41 -n 2 -e '2/1 "%02x "' ${VOSPARMS} \
+ | awk '{ for (i=NF; i>1; i--) printf("%s",$i); print $i; }' )
+ ))
+ DISKSIZE=$(( 0x$(hexdump -s 33 -n 8 -e '8/1 "%02x "' ${VOSPARMS} \
+ | awk '{ for (i=NF; i>1; i--) printf("%s",$i); print $i; }' )
+ ))
+ # Determine which block device (only one!) reports this disk size (bytes):
+ for BDEV in $(find /sys/block/* |grep -Ev '(ram|loop)') ; do
+ BDEV=$(basename $BDEV)
+ # The 'size' value is sectors, not bytes!
+ # Logical block size in Linux is commonly 512 bytes:
+ BDEVSIZE=$(( $(cat /sys/block/${BDEV}/size) * $(cat /sys/block/${BDEV}/queue/logical_block_size) ))
+ if [ $BDEVSIZE -eq $DISKSIZE ]; then
+ # Found a block device with matching size in bytes:
+ for IPART in $(ret_partition $(blkid |cut -d: -f1) | grep -v loop) ;
+ do
+ if [ -e /sys/block/$BDEV/$(basename $IPART)/partition ]; then
+ if [ $(cat /sys/block/$BDEV/$(basename $IPART)/partition) -eq $PARTNR ]; then
+ # Found the correct partition number on matching disk:
+ VENTPART="$IPART $VENTPART"
+ fi
+ fi
+ done
+ fi
+ done
+ if [ $(echo $VENTPART |wc -w) -eq 1 ]; then
+ # We found the Ventoy ISO-containing partition.
+ # Trim leading/trailing spaces:
+ echo $VENTPART |xargs
+ else
+ # Zero or multiple matching block devices found, fall back to 'scandev':
+ echo scandev
+ fi
+ fi
+ } # End ret_ventoy()
+
+ # Find partition on which a file resides:
+ # Function input:
+ # (param 1) Full path to the file we are looking for
+ # (param 2) Directory to mount the partition containing our file
+ # Use $(df $MYMNT |tail -1 |tr -s ' ' |cut -d' ' -f1) to find that partition,
+ # it will remain mounted on the provided mountpoint upon function return.
+ scan_part() {
+ local FILEPATH="$1"
+ local MYMNT="$2"
+ local ISOPART=""
+ local PARTFS=""
+ echo "${MARKER}: Scanning for '$FILEPATH'..."
+ for ISOPART in $(ret_partition $(blkid |cut -d: -f1)) $(ret_blockdev $(blkid |cut -d: -f1)) ; do
+ PARTFS=$(blkid $ISOPART |rev |cut -d'"' -f2 |rev)
+ mount -t $PARTFS -o ro $ISOPART ${MYMNT}
+ if [ -f "${MYMNT}/${FILEPATH}" ]; then
+ # Found our file!
+ unset ISOPART
+ break
+ else
+ umount $ISOPART
+ fi
+ done
+ if [ -n "$ISOPART" ]; then
+ echo "${MARKER}: Partition scan unable to find $(basename $FILEPATH), trouble ahead."
+ return 1
+ else
+ return 0
+ fi
+ } # End scan_part()
## End support functions ##
# We need a mounted filesystem here to be able to do a switch_root later,
# so we create one in RAM:
if [ $TORAM -eq 1 ]; then
- RAMSIZE=90% # need to be able to load the entire OS in RAM
+ RAMSIZE="${RAMSIZE:-90}%" # 90% by default to load the entire OS in RAM
else
- RAMSIZE=50% # the default value.
+ RAMSIZE="${RAMSIZE:-50}%" # 50% is the default value.
fi
mount -t tmpfs -o defaults,size=${RAMSIZE} none /mnt
# Find the Slackware Live media.
# TIP: Increase WAIT to give USB devices a chance to be seen by the kernel.
mkdir /mnt/media
+
+ # Multi ISO boot managers first.
+
+ # --- Ventoy ---
+ # If we boot an ISO via Ventoy, this creates a device-mapped file
+ # '/dev/mapper/ventoy' which liveslak could use to mount that ISO,
+ # but specifying '-t iso9660' will fail to mount it.
+ # Omitting the '-t iso9660' makes the mount succceed.
+ # liveslak is 'Ventoy compatible':
+ # Ventoy will not execute its hooks and leaves all the detection to us.
+ # It will create the device-mapped file /dev/mapper/ventoy still.
+ VENTID="VentoyOsParam-77772020-2e77-6576-6e74-6f792e6e6574"
+ VENTVAR="/sys/firmware/efi/vars/${VENTID}"
+ if [ ! -d "${VENTVAR}" ]; then
+ # Newer Slackware will use 'efivars' rather than 'vars' directory;
+ VENTVAR="/sys/firmware/efi/efivars/${VENTID}"
+ fi
+ if [ -d "${VENTVAR}" ]; then
+ echo "${MARKER}: (UEFI) Ventoy ISO boot detected..."
+ ISOBOOT="ventoy"
+ VENTOSPARM="${VENTVAR}/data"
+ elif [ -f "${VENTVAR}" ]; then
+ # Kernel >= 6.x does not offer a clean data sctructure, so we need to
+ # find the offset of the data block in the efivars file:
+ cat "${VENTVAR}" > /vent.dmp
+ else
+ # Detect Ventoy in memory (don't use the provided hooks), see
+ # https://www.ventoy.net/en/doc_compatible_format.html:
+ dd if=/dev/mem of=/vent.dmp bs=1 skip=$((0x80000)) count=$((0xA0000-0x80000)) 2>/dev/null
+ fi
+ if [ -f /vent.dmp ]; then
+ # Use 'strings' to find the decimal offset of the magic string;
+ # With 'xargs' we remove leading and ending spaces:
+ if strings -t d /vent.dmp 1>/dev/null 2>/dev/null ; then
+ # Busybox in Slackware 15.0 or newer:
+ OFFSET=$(strings -t d /vent.dmp |grep ' www.ventoy.net' |xargs |cut -d' ' -f1)
+ else
+ # Busybox in Slackware 14.2 or older:
+ OFFSET=$(strings -o /vent.dmp |grep ' www.ventoy.net' |xargs |cut -d' ' -f1)
+ fi
+ if [ -n "${OFFSET}" ]; then
+ echo "${MARKER}: (BIOS) Ventoy ISO boot detected..."
+ ISOBOOT="ventoy"
+ # Save the 512-byte Ventoy OS Parameter block:
+ dd if=/vent.dmp of=/vent_os_parms bs=1 count=512 skip=$OFFSET 2>/dev/null
+ VENTOSPARM="/vent_os_parms"
+ fi
+ fi
+ if [ "$ISOBOOT" == "ventoy" ]; then
+ LIVEPATH=$(ret_ventoy $VENTOSPARM isopath)
+ if [ -e /dev/mapper/ventoy ]; then
+ LIVEMEDIA=$(dmsetup table /dev/mapper/ventoy |tr -s ' ' |cut -d' ' -f 4)
+ LIVEMEDIA=$(readlink -f /dev/block/${LIVEMEDIA})
+ # Having the ISO device-mapped to /dev/dm-0 prevents liveslak from
+ # mounting the underlying partition, so we delete the mapped device:
+ dmsetup remove /dev/mapper/ventoy
+ else
+ # Return Ventoy device partition (or 'scandev'):
+ LIVEMEDIA=$(ret_ventoy $VENTOSPARM devpartition)
+ fi
+ fi
+
if [ -n "$NFSHOST" ]; then
# NFS root. First configure our network interface:
setnet
@@ -623,6 +919,7 @@ if [ "$RESCUE" = "" ]; then
VIRGIN=1
elif [ -z "$LIVEMEDIA" ]; then
# LIVEMEDIA not specified on the boot commandline using "livemedia="
+ # Start digging:
# Filter out the block devices, only look at partitions at first:
# The blkid function in busybox behaves differently than the regular blkid!
# It will return all devices with filesystems and list LABEL UUID and TYPE.
@@ -641,6 +938,7 @@ if [ "$RESCUE" = "" ]; then
# We found a block device with the correct label (non-UEFI media).
# Determine filesystem type ('iso9660' means we found a CDROM/DVD)
LIVEFS=$(blkid $LIVEMEDIA |rev |cut -d'"' -f2 |rev)
+ [ "$LIVEFS" = "swap" ] && continue
mount -t $LIVEFS -o ro $LIVEMEDIA /mnt/media
else
# Bummer.. label not found; the ISO was extracted to a different device.
@@ -648,8 +946,10 @@ if [ "$RESCUE" = "" ]; then
for SLDEVICE in $(ret_partition $(blkid |cut -d: -f1)) $(ret_blockdev $(blkid |cut -d: -f1)) ; do
# We rely on the fact that busybox blkid puts TYPE"..." at the end:
SLFS=$(blkid $SLDEVICE |rev |cut -d'"' -f2 |rev)
+ [ "$SLFS" = "swap" ] && continue
mount -t $SLFS -o ro $SLDEVICE /mnt/media
- if [ -d /mnt/media/${LIVEMAIN} ]; then
+ if [ -f /mnt/media/${LIVEMAIN}/system/0099-${DISTRO}_zzzconf-*.s* ];
+ then
# Found our media!
LIVEALL=$SLDEVICE
LIVEMEDIA=$SLDEVICE
@@ -668,7 +968,8 @@ if [ "$RESCUE" = "" ]; then
fi
sleep 1
else
- # LIVEMEDIA was specified on the boot commandline using "livemedia="
+ # LIVEMEDIA was specified on the boot commandline using "livemedia=",
+ # or ISO was booted by a compatible multi ISO bootmanager:
if [ "$LIVEMEDIA" != "scandev" -a ! -b "$LIVEMEDIA" ]; then
# Passed a UUID or LABEL?
LIVEALL=$(findfs UUID=$LIVEMEDIA 2>/dev/null) || LIVEALL=$(findfs LABEL=$LIVEMEDIA 2>/dev/null)
@@ -685,39 +986,31 @@ if [ "$RESCUE" = "" ]; then
# instead of just: "livemedia=/dev/sdX".
#
# First mount the partition and then loopmount the ISO:
- SUPERMNT=/mnt/super_$(od -An -N1 -tu1 /dev/urandom |tr -d ' ')
mkdir -p ${SUPERMNT}
#
if [ "$LIVEMEDIA" = "scandev" ]; then
- # Scan partitions to find the one with the ISO and set LIVEMEDIA:
- echo "${MARKER}: Scanning for '$LIVEPATH'..."
- for ISOPART in $(ret_partition $(blkid |cut -d: -f1)) $(ret_blockdev $(blkid |cut -d: -f1)) ; do
- PARTFS=$(blkid $ISOPART |rev |cut -d'"' -f2 |rev)
- # Abuse the $SUPERMNT a bit, we will actually use it later:
- mount -t $PARTFS -o ro $ISOPART ${SUPERMNT}
- if [ -f ${SUPERMNT}/${LIVEPATH} ]; then
- # Found our ISO!
- LIVEMEDIA=$ISOPART
- umount $ISOPART
- unset ISOPART
- break
- else
- umount $ISOPART
- fi
- done
- if [ -n "$ISOPART" ]; then
- echo "${MARKER}: Partition scan unable to find ISO, trouble ahead."
- fi
+ # Scan partitions to find the one with the ISO and set LIVEMEDIA.
+ # Abuse the $SUPERMNT a bit, we will actually use it later.
+ # TODO: proper handling of scan_part return code.
+ scan_part ${LIVEPATH} ${SUPERMNT}
+ LIVEMEDIA="$(df ${SUPERMNT} 2>/dev/null |tail -1 |tr -s ' ' |cut -d' ' -f1)"
+ umount ${SUPERMNT}
fi
# At this point we know $LIVEMEDIA - either because the bootparameter
- # specified it or else because the 'scandev' found it for us:
+ # specified it or else because the 'scandev' found it for us.
+ # Next we will re-define LIVEMEDIA to point to the actual ISO file
+ # on the mounted live media:
SUPERFS=$(blkid $LIVEMEDIA |rev |cut -d'"' -f2 |rev)
- mount -t $SUPERFS -o ro $LIVEMEDIA ${SUPERMNT}
- if [ -f "${SUPERMNT}/$LIVEPATH" ]; then
- LIVEFS=$(blkid "${SUPERMNT}/$LIVEPATH" |rev |cut -d'"' -f2 |rev)
- LIVEALL="${SUPERMNT}/$LIVEPATH"
+ SUPERPART=$LIVEMEDIA
+ mount -t ${SUPERFS} -o ro ${SUPERPART} ${SUPERMNT}
+ if [ -f "${SUPERMNT}/${LIVEPATH}" ]; then
+ LIVEFS=$(blkid "${SUPERMNT}/${LIVEPATH}" |rev |cut -d'"' -f2 |rev)
+ LIVEALL="${SUPERMNT}/${LIVEPATH}"
LIVEMEDIA="$LIVEALL"
MOUNTOPTS="loop"
+ if [ -z "$ISOBOOT" ]; then
+ ISOBOOT="diskpart"
+ fi
fi
fi
LIVEFS=$(blkid $LIVEMEDIA |rev |cut -d'"' -f2 |rev)
@@ -725,11 +1018,23 @@ if [ "$RESCUE" = "" ]; then
fi
fi
- # Finished determining the media availability, it should be mounted now.
+ if [ -n "${ISOBOOT}" ]; then
+ # Containerfiles used in conjunction with ISO files have '.icc' extension,
+ # aka 'ISO Container Companion' ;-)
+ CNTEXT=".icc"
+ # Search for containers in another place than the default /mnt/media:
+ CPATHINTERNAL=${SUPERMNT}
+ fi
+
+ # ---------------------------------------------------------------------- #
+ # #
+ # Finished determining the media availability, it should be mounted now. #
+ # #
+ # ---------------------------------------------------------------------- #
if [ ! -z "$LIVEMEDIA" ]; then
echo "${MARKER}: Live media found at ${LIVEMEDIA}."
- if [ ! -d /mnt/media/${LIVEMAIN} ]; then
+ if [ ! -f /mnt/media/${LIVEMAIN}/system/0099-${DISTRO}_zzzconf-*.s* ]; then
echo "${MARKER}: However, live media was not mounted... trouble ahead."
fi
if [ "$LIVEMEDIA" != "$LIVEALL" ]; then
@@ -759,8 +1064,8 @@ if [ "$RESCUE" = "" ]; then
BLACKLIST KEYMAP LIVE_HOSTNAME LOAD LOCALE LUKSVOL \
NOLOAD RUNLEVEL TWEAKS TZ XKB ;
do
- if [ -n "${LIVEPARM}" ]; then
- eval $(grep -w ${LIVEPARM} /mnt/media/${LIVEMAIN}/${DISTROCFG})
+ if [ -z "$(eval echo \$${LIVEPARM})" ]; then
+ eval $(grep -w ^${LIVEPARM} /mnt/media/${LIVEMAIN}/${DISTROCFG})
fi
done
fi
@@ -782,6 +1087,32 @@ if [ "$RESCUE" = "" ]; then
fi
fi
+ # When booted from an ISO, liveslak optionally reads parameters
+ # from a file with the same full filename as the ISO,
+ # but with '.cfg' extension instead of '.iso':
+ if [ -n "$ISOBOOT" ] && [ -z "$CFGACTION" ]; then
+ # The partition's filesystem containing the ISO is mounted at ${SUPERMNT}:
+ ISOCFG="${SUPERMNT}/$(dirname ${LIVEPATH})/$(basename ${LIVEPATH} .iso).cfg"
+ if [ -f "$ISOCFG" ]; then
+ # Read ISO live customization from disk file if present,
+ # and set any variable from that file:
+ echo "${MARKER}: Reading ISO boot config from ${ISOCFG#$SUPERMNT})"
+ for LISOPARM in \
+ BLACKLIST KEYMAP LIVE_HOSTNAME LIVESLAKROOT LOAD LOCALE LUKSVOL \
+ NOLOAD ISOPERSISTENCE RUNLEVEL TWEAKS TZ XKB ;
+ do
+ eval $(grep -w ^${LISOPARM} ${ISOCFG})
+ done
+ # Handle any customization.
+ if [ -n "${ISOPERSISTENCE}" ]; then
+ # Persistence container located on the USB stick - strip the extension:
+ PERSISTENCE=$(basename ${ISOPERSISTENCE%.*})
+ PERSISTPATH=$(dirname ${ISOPERSISTENCE})
+ PERSISTPART=${SUPERPART}
+ fi
+ fi
+ fi
+
# Some variables require a value before continuing, so if they were not set
# on the boot commandline nor in a config file, we take care of it now:
if [ -z "$KEYMAP" ]; then
@@ -796,7 +1127,7 @@ if [ "$RESCUE" = "" ]; then
# Load a custom keyboard mapping:
if [ -n "$KEYMAP" ]; then
- echo "${MARKER}: Loading '$KEYMAP' keyboard mapping:"
+ echo "${MARKER}: Loading '$KEYMAP' keyboard mapping."
tar xzOf /etc/keymaps.tar.gz ${KEYMAP}.bmap | loadkmap
fi
@@ -816,88 +1147,223 @@ if [ "$RESCUE" = "" ]; then
RODIRS=""
FS2HD=""
- # First, the base Slackware system components:
- load_modules system
-
- # Next, the add-on (3rd party etc) components, if any:
- # Remember, module name must adhere to convention: "NNNN-modname-*.sxz"
- # where 'N' is a digit and 'modname' must not contain a dash '-'.
- load_modules addons
-
- # And finally any explicitly requested optionals (like nvidia drivers):
- # Remember, module name must adhere to convention: "NNNN-modname-*.sxz"
- # where 'N' is a digit and 'modname' must not contain a dash '-'.
- load_modules optional
+ if [ $CORE2RAM -eq 1 ]; then
+ # Only load the Core OS modules:
+ echo "${MARKER}: Loading Core OS into RAM."
+ load_modules core2ram
+ else
+ # First, the base Slackware system components:
+ load_modules system
+
+ # Next, the add-on (3rd party etc) components, if any:
+ # Remember, module name must adhere to convention: "NNNN-modname-*.sxz"
+ # where 'N' is a digit and 'modname' must not contain a dash '-'.
+ load_modules addons
+
+ # And finally any explicitly requested optionals (like nvidia drivers):
+ ## TODO:
+ ## Automatically load the nvidia driver if we find a supported GPU:
+ # NVPCIID=$(lspci -nn|grep NVIDIA|grep VGA|rev|cut -d'[' -f1|rev|cut -d']' -f1|tr -d ':'|tr [a-z] [A-Z])
+ # if cat /mnt/media/${LIVEMAIN}/optional/nvidia-*xx.ids |grep -wq $NVPCIID ;
+ # then
+ # LOAD="nvidia,${LOAD}"
+ # fi
+ ## END TODO:
+ # Remember, module name must adhere to convention: "NNNN-modname-*.sxz"
+ # where 'N' is a digit and 'modname' must not contain a dash '-'.
+ load_modules optional
+ fi
# Get rid of the starting colon:
RODIRS=$(echo $RODIRS |cut -c2-)
FS2HD=$(echo $FS2HD |cut -c2-)
if [ $TORAM -ne 0 ]; then
- echo "${MARKER}: Live OS copied to RAM, you can remove the Live medium."
+ echo "${MARKER}: Live OS has been copied to RAM."
+ # Inform user in case we won't do persistent writes and the medium
+ # does not contain LUKS-encrypted containers to mount:
+ if [ $VIRGIN -ne 0 -a -z "$LUKSVOL" ]; then
+ echo "${MARKER}: You can now safely remove the live medium."
+ fi
if [ "LIVEFS" = "iso9660" ]; then
eject ${LIVEMEDIA}
fi
fi
- # Setup persistence in case our media is writable, *and* the user
- # has created a directory "persistence" in the root of the media.
- # otherwise we let the block changes accumulate in RAM only.
-
- # Create the mount point for the writable upper directory of the overlay:
- # Assume the default to be a readonly media - we write to RAM:
- UPPERDIR=/mnt/live/changes
- OVLWORK=/mnt/live/.ovlwork
- if [ "$VIRGIN" = "0" ]; then
- if [ "LIVEFS" != "iso9660" -a -d /mnt/media/${PERSISTENCE} ]; then
- # Looks OK, but we need to remount the media in order to write
- # to the persistence directory:
- mount -o remount,rw /mnt/media
+ # --------------------------------------------------------------- #
+ # #
+ # Setup persistence in case our media is writable, *and* the user #
+ # has created a persistence directory or container on the media, #
+ # otherwise we let the block changes accumulate in RAM only. #
+ # #
+ # --------------------------------------------------------------- #
+
+ # Was a partition specified containing a persistence directory,
+ # and is it different from the live medium?
+ if [ -n "${PERSISTPART}" ]; then
+ # If partition was specified as UUID/LABEL, or as 'scandev',
+ # we need to figure out the partition device ourselves:
+ if [ "${PERSISTPART}" != "scandev" -a ! -b "${PERSISTPART}" ]; then
+ TEMPP=$(findfs UUID=${PERSISTPART} 2>/dev/null) || TEMPP=$(findfs LABEL=${PERSISTPART} 2>/dev/null)
+ if [ -n "${TEMPP}" ]; then
+ PERSISTPART=${TEMPP}
+ else
+ echo "${MARKER}: Partition '${PERSISTPART}' needed for persistence was not found."
+ echo "${MARKER}: Falling back to recording changes in RAM."
+ PERSISTPART=""
+ VIRGIN=1
+ fi
+ unset TEMPP
+ elif [ "${PERSISTPART}" = "scandev" ]; then
+ # Scan partitions to find the one with the persistence directory:
+ echo "${MARKER}: Scanning for partition with '${PERSISTENCE}'..."
+ ppartdir=".persistence_$(od -An -N1 -tu1 /dev/urandom|tr -d ' ')"
+ mkdir -p /mnt/live/${ppartdir}
+ for PPART in $(ret_partition $(blkid |cut -d: -f1)) ; do
+ PPARTFS=$(blkid $PPART |rev |cut -d'"' -f2 |rev)
+ # Mount the partition and peek inside for a directory or container:
+ mount -t $PPARTFS -o ro ${PPART} /mnt/live/${ppartdir}
+ if [ -d /mnt/live/${ppartdir}/${PERSISTPATH}/${PERSISTENCE} ] || [ -f /mnt/live/${ppartdir}/${PERSISTPATH}/${PERSISTENCE}${CNTEXT} ]; then
+ # Found our persistence directory/container!
+ PERSISTPART=$PPART
+ unset PPART
+ umount /mnt/live/${ppartdir}
+ break
+ else
+ umount /mnt/live/${ppartdir}
+ fi
+ done
+ rmdir /mnt/live/${ppartdir}
+ if [ -n "$PPART" ]; then
+ echo "${MARKER}: Partition scan unable to find persistence."
+ echo "${MARKER}: Falling back to recording changes in RAM."
+ PERSISTPART=""
+ VIRGIN=1
+ fi
+ fi
+ fi
+
+ debugit
+
+ # ------------------------------------------------------------------ #
+ # #
+ # At this point, we either have determined the persistence partition #
+ # via UUID/LABEL/scandev, or else we failed to find one, #
+ # and then VIRGIN has been set to '1' and PERSISTPART to "". #
+ # #
+ # ------------------------------------------------------------------ #
+
+ if [ -n "${PERSISTPART}" ]; then
+ # Canonicalize the input and the media devices,
+ # to ensure that we are talking about two different devices:
+ MPDEV=$(df /mnt/media |tail -1 |tr -s ' ' |cut -d' ' -f1)
+ REALMP=$(readlink -f ${MPDEV})
+ REALPP=$(readlink -f ${PERSISTPART})
+ if [ "${REALMP}" != "${REALPP}" ]; then
+ # The liveslak media is different from the persistence partition.
+ # Mount the partition readonly to access the persistence directory:
+ ppdir=".persistence_$(od -An -N1 -tu1 /dev/urandom|tr -d ' ')"
+ mkdir -p /mnt/live/${ppdir}
+ mount -o ro ${PERSISTPART} /mnt/live/${ppdir}
+ if [ $? -ne 0 ]; then
+ echo "${MARKER}: Failed to mount persistence partition '${PERSISTPART}' readonly."
+ echo "${MARKER}: Falling back to recording changes in RAM."
+ rmdir /mnt/live/${ppdir}
+ VIRGIN=1
+ else
+ # Explicitly configured persistence has priority over regular
+ # persistence settings, and also overrides the boot parameter 'nop':
+ if [ -n "${ISOBOOT}" ]; then
+ # Boot from ISO, persistence is on the filesystem containing the ISO:
+ PPATHINTERNAL=${SUPERMNT}
+ else
+ # We use the above created directory:
+ PPATHINTERNAL=/mnt/live/${ppdir}
+ fi
+ VIRGIN=0
+ fi
+ fi
+ fi
+
+ debugit
+
+ # At this point, if we use persistence then its partition is either
+ # the live media (mounted on /mnt/media), a system partition
+ # (mounted on /mnt/live/${ppdir}) or the partition containing the ISO if we
+ # booted off that.
+ # The variable ${PPATHINTERNAL} points to its mount point,
+ # and the partition is mounted read-only.
+
+ # Create the mount point for the writable upper directory of the overlay.
+ # First, we deal with the case of persistence (VIRGIN=0) and then we
+ # deal with a pure Live system without persistence (VIRGIN=1):
+
+ if [ $VIRGIN -eq 0 ]; then
+ if [ -d ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE} ] || [ -f ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}${CNTEXT} ]; then
+ # Remount the partition r/w - we need to write to the persistence area.
+ # The value of PPATHINTERNAL will be different for USB stick or harddisk:
+ mount -o remount,rw ${PPATHINTERNAL}
+ if [ $? -ne 0 ]; then
+ echo "${MARKER}: Failed to mount persistence partition '${PERSISTPART}' read/write."
+ echo "${MARKER}: Falling back to recording changes in RAM."
+ VIRGIN=1
+ fi
+ fi
+ fi
+
+ # We have now checked whether the persistence area is actually writable.
+
+ if [ $VIRGIN -eq 0 ]; then
+ # Persistence directory (either on writable USB or else on system harddisk):
+ if [ -d ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE} ]; then
# Try a write... just to be dead sure:
- if touch /mnt/media/${PERSISTENCE}/.rwtest 2>/dev/null && rm /mnt/media/${PERSISTENCE}/.rwtest 2>/dev/null ; then
+ if touch ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}/.rwtest 2>/dev/null && rm ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}/.rwtest 2>/dev/null ; then
# Writable media and we are allowed to write to it.
- if [ "$WIPE_PERSISTENCE" = "1" -o -f /mnt/media/${PERSISTENCE}/.wipe ]; then
- echo "${MARKER}: Wiping existing persistent data in '/${PERSISTENCE}'."
- rm -f /mnt/media/${PERSISTENCE}/.wipe 2>/dev/null
- find /mnt/media/${PERSISTENCE}/ -mindepth 1 -exec rm -rf {} \; 2>/dev/null
+ if [ "$WIPE_PERSISTENCE" = "1" -o -f ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}/.wipe ]; then
+ echo "${MARKER}: Wiping existing persistent data in '${PERSISTPATH}/${PERSISTENCE}'."
+ rm -f ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}/.wipe 2>/dev/null
+ find ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}/ -mindepth 1 -exec rm -rf {} \; 2>/dev/null
fi
- echo "${MARKER}: Writing persistent changes to media directory '/${PERSISTENCE}'."
- UPPERDIR=/mnt/media/${PERSISTENCE}
- OVLWORK=/mnt/media/.ovlwork
+ echo "${MARKER}: Writing persistent changes to media directory '${PERSISTENCE}'."
+ UPPERDIR=${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}
+ OVLWORK=${PPATHINTERNAL}/${PERSISTPATH}/.ovlwork
+ else
+ echo "${MARKER}: Failed to write to persistence directory '${PERSISTENSE}'."
+ echo "${MARKER}: Falling back to recording changes in RAM."
+ VIRGIN=1
fi
- elif [ "LIVEFS" != "iso9660" -a -f /mnt/media/${PERSISTENCE}.img ]; then
- # Use a container file; the filesystem needs to be writable:
- mount -o remount,rw /mnt/media
+ # Use a container file instead of a directory for persistence:
+ elif [ -f ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}${CNTEXT} ]; then
# Find a free loop device to mount the persistence container file:
prdev=$(find_loop)
- prdir=$(basename ${PERSISTENCE})_$(od -An -N1 -tu1 /dev/urandom |tr -d ' ')
+ prdir=persistence_$(od -An -N1 -tu1 /dev/urandom |tr -d ' ')
mkdir -p /mnt/live/${prdir}
- losetup $prdev /mnt/media/${PERSISTENCE}.img
+ losetup $prdev ${PPATHINTERNAL}/${PERSISTPATH}/${PERSISTENCE}${CNTEXT}
# Check if the persistence container is LUKS encrypted:
if cryptsetup isLuks $prdev 1>/dev/null 2>/dev/null ; then
- echo "Unlocking LUKS encrypted persistence file '/${PERSISTENCE}.img'"
- cryptsetup luksOpen $prdev $(basename ${PERSISTENCE}) </dev/tty0 >/dev/tty0 2>&1
+ echo "${MARKER}: Unlocking LUKS encrypted persistence file '${PERSISTPATH}/${PERSISTENCE}${CNTEXT}'"
+ cryptsetup luksOpen $prdev ${PERSISTENCE} </dev/tty0 >/dev/tty0 2>&1
if [ $? -ne 0 ]; then
- echo "${MARKER}: Failed to unlock persistence file '/${PERSISTENCE}.img'."
+ echo "${MARKER}: Failed to unlock persistence file '${PERSISTPATH}/${PERSISTENCE}${CNTEXT}'."
echo "${MARKER}: Falling back to RAM."
else
# LUKS properly unlocked; from now on use the mapper device instead:
- prdev=/dev/mapper/$(basename ${PERSISTENCE})
+ prdev=/dev/mapper/${PERSISTENCE}
fi
fi
- prfs=$(blkid $prdev |rev |cut -d'"' -f2 |rev)
+ prfs=$(blkid $prdev 2>/dev/null |rev |cut -d'"' -f2 |rev)
mount -t $prfs $prdev /mnt/live/${prdir} 2>/dev/null
if [ $? -ne 0 ]; then
- echo "${MARKER}: Failed to mount persistence file '/${PERSISTENCE}.img'."
+ echo "${MARKER}: Failed to mount persistence file '${PERSISTPATH}/${PERSISTENCE}${CNTEXT}'."
echo "${MARKER}: Falling back to RAM."
else
- if [ "$WIPE_PERSISTENCE" = "1" -o -f /mnt/live/${prdir}/$(basename ${PERSISTENCE})/.wipe ]; then
- echo "${MARKER}: Wiping existing persistent data in '/${PERSISTENCE}.img'."
- rm -f /mnt/live/${prdir}/$(basename ${PERSISTENCE})/.wipe 2>/dev/null
- find /mnt/live/${prdir}/$(basename ${PERSISTENCE})/ -mindepth 1 -exec rm -rf {} \; 2>/dev/null
+ if [ "$WIPE_PERSISTENCE" = "1" -o -f /mnt/live/${prdir}/${PERSISTENCE}/.wipe ]; then
+ echo "${MARKER}: Wiping existing persistent data in '${PERSISTPATH}/${PERSISTENCE}${CNTEXT}'."
+ rm -f /mnt/live/${prdir}/${PERSISTENCE}/.wipe 2>/dev/null
+ find /mnt/live/${prdir}/${PERSISTENCE}/ -mindepth 1 -exec rm -rf {} \; 2>/dev/null
fi
- echo "${MARKER}: Writing persistent changes to file '/${PERSISTENCE}.img'."
- UPPERDIR=/mnt/live/${prdir}/$(basename ${PERSISTENCE})
+ echo "${MARKER}: Writing persistent changes to file '${PERSISTPATH}/${PERSISTENCE}${CNTEXT}'."
+ UPPERDIR=/mnt/live/${prdir}/${PERSISTENCE}
OVLWORK=/mnt/live/${prdir}/.ovlwork
fi
fi
@@ -906,7 +1372,13 @@ if [ "$RESCUE" = "" ]; then
if [ ! -z "$LUKSVOL" ]; then
# Even without persistence, we need to be able to write to the partition
# if we are using a LUKS container file:
- mount -o remount,rw /mnt/media
+ if [ -n "$ISOBOOT" ]; then
+ mount -o remount,rw ${SUPERMNT}
+ else
+ mount -o remount,rw /mnt/media
+ fi
+ else
+ mount -o remount,ro /mnt/media
fi
fi
@@ -926,7 +1398,7 @@ if [ "$RESCUE" = "" ]; then
# And this is the actual Live overlay:
mount -t overlay -o workdir=${OVLWORK},upperdir=${UPPERDIR},lowerdir=${RODIRS} overlay /mnt/overlay
MNTSTAT=$?
- if [ "$VIRGIN" = "0" ]; then
+ if [ $VIRGIN -eq 0 ]; then
if [ $MNTSTAT -ne 0 ]; then
# Failed to create the persistent overlay - try without persistence:
echo "${MARKER}: Failed to create persistent overlay, attempting to continue in RAM."
@@ -972,6 +1444,12 @@ if [ "$RESCUE" = "" ]; then
mount --bind /mnt/live/toram /mnt/overlay/mnt/livemedia
fi
+ if [ -n "$ISOBOOT" ]; then
+ # Expose the filesystem on the USB stick when we booted off an ISO there:
+ mkdir -p /mnt/overlay/mnt/supermedia
+ mount --bind ${SUPERMNT} /mnt/overlay/mnt/supermedia
+ fi
+
if [ ! -z "$USE_SWAP" ]; then
# Use any available swap device:
for SWAPD in $(blkid |grep TYPE="\"swap\"" |cut -d: -f1) ; do
@@ -980,6 +1458,44 @@ if [ "$RESCUE" = "" ]; then
done
fi
+ if [ ! -z "$LUKSVOL" ]; then
+ # Bind any LUKS container into the Live filesystem:
+ for luksvol in $(echo $LUKSVOL |tr ',' ' '); do
+ luksfil="$(echo $luksvol |cut -d: -f1)"
+ luksmnt="$(echo $luksvol |cut -d: -f2)"
+ luksnam="$(echo $(basename $luksfil) |tr '.' '_')"
+ if [ "$luksmnt" = "$luksfil" ]; then
+ # No optional mount point specified, so we use the default: /home/
+ luksmnt="/home"
+ fi
+
+ # Find a free loop device:
+ lodev=$(find_loop)
+
+ losetup $lodev ${CPATHINTERNAL}/$luksfil
+ echo "Unlocking LUKS encrypted container '$luksfil' at mount point '$luksmnt'"
+ cryptsetup luksOpen $lodev $luksnam </dev/tty0 >/dev/tty0 2>&1
+ if [ $? -ne 0 ]; then
+ echo "${MARKER}: Failed to unlock LUKS container '$luksfil'... trouble ahead."
+ else
+ # Create the mount directory if it does not exist (unlikely):
+ mkdir -p /mnt/overlay/$luksmnt
+
+ # Let Slackware mount the unlocked container:
+ luksfs=$(blkid /dev/mapper/$luksnam |rev |cut -d'"' -f2 |rev)
+ if ! grep -q "^/dev/mapper/$luksnam" /mnt/overlay/etc/fstab ; then
+ echo "/dev/mapper/$luksnam $luksmnt $luksfs defaults 1 1" >> /mnt/overlay/etc/fstab
+ fi
+ # On shutdown, ensure that the container gets locked again:
+ if ! grep -q "$luksnam $luksmnt" /mnt/overlay/etc/crypttab ; then
+ echo "$luksnam $luksmnt" >> /mnt/overlay/etc/crypttab
+ fi
+ fi
+ done
+ fi
+
+ debugit
+
if [ ! -z "$KEYMAP" ]; then
# Configure custom keyboard mapping in console and X:
echo "${MARKER}: Switching live console to '$KEYMAP' keyboard"
@@ -1074,9 +1590,9 @@ EOT
if [ ! -z "$TZ" -a -f /mnt/overlay/usr/share/zoneinfo/${TZ} ]; then
# Configure custom timezone:
echo "${MARKER}: Configuring timezone '$TZ'"
- cp /mnt/overlay/usr/share/zoneinfo/${TZ} /mnt/overlay/etc/localtime
+ rm -f /mnt/overlay/etc/localtime
+ ln -s /usr/share/zoneinfo/${TZ} /mnt/overlay/etc/localtime
rm -f /mnt/overlay/etc/localtime-copied-from
- ln -s /usr/share/zoneinfo/${TZ} /mnt/overlay/etc/localtime-copied-from
# Configure the hardware clock to be interpreted as localtime and not UTC:
cat <<EOT > /mnt/overlay/etc/hardwareclock
# /etc/hardwareclock
@@ -1089,7 +1605,7 @@ EOT
# file so QT5 fails to determine the timezone and falls back to UTC. Fix:
echo ${TZ} > /mnt/overlay/etc/timezone
- # KDE4 and PLASMA5 user timezone re-configuration:
+ # KDE4 and Plasma5 user timezone re-configuration:
if [ -f /mnt/overlay/home/${LIVEUID}/.kde/share/config/ktimezonedrc ]; then
sed -i -e "s%^LocalZone=.*%LocalZone=${TZ}%" \
/mnt/overlay/home/${LIVEUID}/.kde/share/config/ktimezonedrc
@@ -1100,20 +1616,28 @@ EOT
fi
fi
- if [ ! -z "$LIVEPW" ]; then
+ if [ -n "$LIVEPW" ] && [ "$LIVEPW" != "${DEFPW}" ]; then
# User entered a custom live password on the boot commandline:
echo "${MARKER}: Changing password for user '${LIVEUID}'."
chroot /mnt/overlay /usr/sbin/chpasswd <<EOPW
${LIVEUID}:${LIVEPW}
EOPW
+ elif [ -z "$LIVEPW" ]; then
+ # User requested an empty live password:
+ echo "${MARKER}: Removing password for user '${LIVEUID}'."
+ chroot /mnt/overlay /usr/bin/passwd -d ${LIVEUID}
fi
- if [ ! -z "$ROOTPW" ]; then
+ if [ -n "$ROOTPW" ] && [ "$ROOTPW" != "${DEFPW}" ]; then
# User entered a custom root password on the boot commandline:
echo "${MARKER}: Changing password for user 'root'."
chroot /mnt/overlay /usr/sbin/chpasswd <<EOPW
root:${ROOTPW}
EOPW
+ elif [ -z "$ROOTPW" ]; then
+ # User requested an empty root password:
+ echo "${MARKER}: Removing password for user 'root'."
+ chroot /mnt/overlay /usr/bin/passwd -d root
fi
if [ ! -z "$HNMAC" -a "$HNMAC_ALLOWED" = "YES" ]; then
@@ -1125,15 +1649,20 @@ EOPW
fi
fi
+ if [ -z "$LIVE_DOMAIN" ]; then
+ # No custom domain on the boot commandline:
+ LIVE_DOMAIN="home.arpa"
+ fi
+
if [ ! -z "$LIVE_HOSTNAME" ]; then
# User entered a custom hostname on the boot commandline:
echo "${MARKER}: Changing hostname to '$LIVE_HOSTNAME'."
- echo "${LIVE_HOSTNAME}.example.net" > /mnt/overlay/etc/HOSTNAME
+ echo "${LIVE_HOSTNAME}.${LIVE_DOMAIN}" > /mnt/overlay/etc/HOSTNAME
if [ -f /mnt/overlay/etc/NetworkManager/NetworkManager.conf ]; then
sed -i -e "s/^hostname=.*/hostname=${LIVE_HOSTNAME}/" \
/mnt/overlay/etc/NetworkManager/NetworkManager.conf
fi
- sed -i -e "s/^\(127.0.0.1\t*\)@DARKSTAR@.*/\1${LIVE_HOSTNAME}.example.net ${LIVE_HOSTNAME}/" /mnt/overlay/etc/hosts
+ sed -i -e "s/^\(127.0.0.1\t*\)@DARKSTAR@.*/\1${LIVE_HOSTNAME}.${LIVE_DOMAIN} ${LIVE_HOSTNAME}/" /mnt/overlay/etc/hosts
fi
if [ -n "$NFSHOST" ]; then
@@ -1144,7 +1673,7 @@ EOPW
mkdir -p /mnt/overlay/run/dhcpcd
mount --bind /run/dhcpcd /mnt/overlay/run/dhcpcd
fi
- cp -a /run/dhcpcd* /mnt/overlay/run/
+ cp -a /run/dhcpcd* /run/${INTERFACE}.pid /mnt/overlay/run/
cat /etc/resolv.conf > /mnt/overlay/etc/resolv.conf
# Disable NetworkManager:
@@ -1266,6 +1795,7 @@ Xft.lcdfilter: lcddefault
Xft.rgba: rgb
Xft.autohint: 0
EOT
+ chroot /mnt/overlay/ chown ${LIVEUID}:users /home/${LIVEUID}/.Xresources
elif [ -f /mnt/overlay/etc/profile.d/freetype.sh ]; then
# Explicitly configure the non-default old v35 interpreter in freetype:
cat <<EOT >> /mnt/overlay/etc/profile.d/freetype.sh
@@ -1297,7 +1827,7 @@ EOT
done
if [ $RUN_DEPMOD -eq 1 ]; then
# This costs a few seconds in additional boot-up time unfortunately:
- echo "${MARKER}: Additional kernel module(s) found... need a bit"
+ echo "${MARKER}: Additional kernel module(s) found... need a bit"
chroot /mnt/overlay /sbin/depmod -a
fi
unset RUN_DEPMOD
@@ -1308,52 +1838,19 @@ EOT
# In case of network boot, do not kill the network, umount NFS prematurely
# or stop udevd on shutdown:
if [ -n "$NFSHOST" ]; then
- sed -i /mnt/overlay/etc/rc.d/rc.0 \
- -e "/on \/ type nfs/s%grep -q 'on / type nfs'%egrep -q 'on / type (nfs|tmpfs)'%" \
- -e '/umount.*nfs/s/nfs,//' \
- -e 's/rc.udev force-stop/rc.udev stop/' \
- -e 's/$(pgrep mdmon)/& $(pgrep udevd)/'
+ for RUNLVL in 0 6 ; do
+ sed -i /mnt/overlay/etc/rc.d/rc.${RUNLVL} \
+ -e "/on \/ type nfs/s%grep -q 'on / type nfs'%egrep -q 'on / type (nfs|tmpfs)'%" \
+ -e "s%'on / type nfs4'%& -e 'on / type overlay'%" \
+ -e '/umount.*nfs/s/nfs,//' \
+ -e 's/rc.udev force-stop/rc.udev stop/' \
+ -e 's/$(pgrep mdmon)/& $(pgrep udevd)/'
+ done
fi
# Copy contents of rootcopy directory (may be empty) to overlay:
cp -af /mnt/media/${LIVEMAIN}/rootcopy/* /mnt/overlay/ 2>/dev/null
- # Bind any LUKS container into the Live filesystem:
- if [ ! -z "$LUKSVOL" ]; then
- for luksvol in $(echo $LUKSVOL |tr ',' ' '); do
- luksfil="$(echo $luksvol |cut -d: -f1)"
- luksmnt="$(echo $luksvol |cut -d: -f2)"
- luksnam="$(echo $(basename $luksfil) |tr '.' '_')"
- if [ "$luksmnt" = "$luksfil" ]; then
- # No optional mount point specified, so we use the default: /home/
- luksmnt="/home"
- fi
-
- # Find a free loop device:
- lodev=$(find_loop)
-
- losetup $lodev /mnt/media/$luksfil
- echo "Unlocking LUKS encrypted container '$luksfil' at mount point '$luksmnt'"
- cryptsetup luksOpen $lodev $luksnam </dev/tty0 >/dev/tty0 2>&1
- if [ $? -ne 0 ]; then
- echo "${MARKER}: Failed to unlock LUKS container '$luksfil'... trouble ahead."
- else
- # Create the mount directory if it does not exist (unlikely):
- mkdir -p /mnt/overlay/$luksmnt
-
- # Let Slackware mount the unlocked container:
- luksfs=$(blkid /dev/mapper/$luksnam |rev |cut -d'"' -f2 |rev)
- if ! grep -q /dev/mapper/$luksnam /mnt/overlay/etc/fstab ; then
- echo "/dev/mapper/$luksnam $luksmnt $luksfs defaults 1 1" >> /mnt/overlay/etc/fstab
- fi
- # On shutdown, ensure that the container gets locked again:
- if ! grep -q "$luksnam $luksmnt" /mnt/overlay/etc/crypttab ; then
- echo "$luksnam $luksmnt" >> /mnt/overlay/etc/crypttab
- fi
- fi
- done
- fi
-
[ $DEBUG -gt 3 ] && rescue "DEBUG SHELL"
# --------------------------------------------------------------------- #
@@ -1385,8 +1882,8 @@ fi
/sbin/udevadm control --exit
unset ERR
-umount /proc
-umount /sys
+umount /proc 2>/dev/null
+umount /sys 2>/dev/null
umount /run 2>/dev/null
echo "${MARKER}: Slackware Live system is ready."
diff --git a/make_slackware_live.conf b/make_slackware_live.conf
index beb0480..2979098 100644
--- a/make_slackware_live.conf
+++ b/make_slackware_live.conf
@@ -22,9 +22,15 @@
# What type of Live image?
#LIVEDE="SLACKWARE"
-# What runlevel to use if adding a DE like: XFCE, KDE4, PLASMA5 etc...
+# What runlevel to use if adding a DE like: XFCE, KDE4, KTOWN etc...
#RUNLEVEL=4
+# Number of the 'live' user account in the Live image:
+#LIVEUIDNR="1000"
+
+# Full name of the live user:
+#LIVEUIDFN="Slackware Live User"
+
# Name of the 'live' user account in the Live image:
#LIVEUID="live"
@@ -63,7 +69,7 @@
# In this example you would need to create two files "pkglists/cinelerra.conf"
# and "pkglists/cinelerra.lst" defining the package location and package list
# respectively):
-#SEQ_CUSTOM="min,xbase,xapbase,xfcebase,cinelerra"
+#SEQ_CUSTOM="min,noxbase,x_base,xapbase,xfcebase,cinelerra"
# OPTIONAL:
# Use something else than the name "min",
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index a4c133d..6611e4f 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2014, 2015, 2016, 2017, 2018, 2019 Eric Hameleers, Eindhoven, NL
+# Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -35,7 +35,10 @@
# -----------------------------------------------------------------------------
# Version of the Live OS generator:
-VERSION="1.3.3"
+VERSION="1.8.1.1"
+
+# Timestamp:
+THEDATE=$(date +%Y%m%d)
# Directory where our live tools are stored:
LIVE_TOOLDIR=${LIVE_TOOLDIR:-"$(cd $(dirname $0); pwd)"}
@@ -64,50 +67,81 @@ BOOTLOADSIZE=${BOOTLOADSIZE:-4}
# Therefore we disable 32bit EFI by default. Enable at your own peril:
EFI32=${EFI32:-"NO"}
-# Set to YES if you want to use the SMP kernel on 32bit Slackware:
+# Set to '1' using the "-S" parameter to the script,
+# if the liveslak ISO should support SecureBoot-enabled computers:
+SECUREBOOT=0
+
+# Which shim to download and install?
+# Supported are 'debian' 'fedora' 'opensuse'.
+SHIM_3RDP=${SHIM_3RDP:-"fedora"}
+
+# When enabling SecureBoot support, we need a MOK certificate plus private key,
+# which we use to sign grub and kernel.
+# MOKCERT contains the location of the certificate,
+# to be defined through the '-S' parameter:
+MOKCERT=""
+# MOKPRIVKEY points to the location of the private key,
+# to be defined through the '-S' parameter:
+MOKPRIVKEY=""
+
+# Set to YES if you want to use a SMP-tagged kernel package
+# on 32bit Slackware 15.0 or earlier.
+# In 32bit Slackware > 15.0 all kernels support preemption and the '-smp'
+# tag has been removed.
SMP32=${SMP32:-"NO"}
# Include support for NFS root (PXE boot), will increase size of the initrd:
NFSROOTSUP=${NFSROOTSUP:-"YES"}
+# This variable can be set to a comma-separated list of package series.
+# The squashfs module(s) for these package series will then be re-generated.
+# Example commandline parameter: "-r l,kde,kdei"
+REFRESH=""
+
# Use xorriso instead of mkisofs/isohybrid to create the ISO:
USEXORR=${USEXORR:-"NO"}
-# Timestamp:
-THEDATE=$(date +%Y%m%d)
-
#
# ---------------------------------------------------------------------------
#
+# Distribution name:
+DISTRO=${DISTRO:-"slackware"}
+
+# What type of Live image?
+# Choices are: SLACKWARE, XFCE, LEAN, DAW, KTOWN, MATE, CINNAMON, DLACK, STUDIOWARE
+LIVEDE=${LIVEDE:-"SLACKWARE"}
+
# The live username of the image:
LIVEUID=${LIVEUID:-"live"}
+# The number of the live account in the image:
+LIVEUIDNR=${LIVEUIDNR:-"1000"}
+
+# The full name of the live account in the image can be set per Live variant,
+# and will always be overridden by a LIVEUIDFN definition in the .conf file.
+# The LIVEUIDFN defaults to '${DISTRO^} Live User' if not set explicitly:
+LIVEUIDFN_DAW="${DISTRO^} Live Musician"
+
# The root and live user passwords of the image:
ROOTPW=${ROOTPW:-"root"}
LIVEPW=${LIVEPW:-"live"}
-# Distribution name:
-DISTRO=${DISTRO:-"slackware"}
+# The nvidia persistence account:
+NVUID=${NVUID:-"nvidia"}
+NVUIDNR=${NVUIDNR:-"365"}
+NVGRP=${NVFRP:-"nvidia"}
+NVGRPNR=${NVUIDNR:-"365"}
# Custom name for the host:
LIVE_HOSTNAME=${LIVE_HOSTNAME:-"darkstar"}
-# What type of Live image?
-# Choices are: SLACKWARE, XFCE, KDE4, PLASMA5, MATE, CINNAMON, DLACK, STUDIOWARE
-LIVEDE=${LIVEDE:-"SLACKWARE"}
-
-# What runlevel to use if adding a DE like: XFCE, KDE4, PLASMA5 etc...
+# What runlevel to use if adding a DE like: XFCE, DAW, KTOWN etc...
RUNLEVEL=${RUNLEVEL:-4}
# Use the graphical syslinux menu (YES or NO)?
SYSMENU=${SYSMENU:-"YES"}
-# This variable can be set to a comma-separated list of package series.
-# The squashfs module(s) for these package series will then be re-generated.
-# Example commandline parameter: "-r l,kde,kdei"
-REFRESH=""
-
# The amount of seconds we want the init script to wait to give the kernel's
# USB subsystem time to settle. The default value of mkinitrd is "1" which
# is too short for use with USB sticks but "1" is fine for CDROM/DVD.
@@ -147,6 +181,11 @@ ONLY_ISO="NO"
# The name of the directory used for storing persistence data:
PERSISTENCE=${PERSISTENCE:-"persistence"}
+# Add a Core OS to load into RAM (value can be 'NO', 'YES' or 'NATIVE'):
+CORE2RAM=${CORE2RAM:-"NO"}
+# The MINLIST module must always be the first in CORE2RAMMODS:
+CORE2RAMMODS="${MINLIST} noxbase"
+
# Slackware version to use (note: this won't work for Slackware <= 14.1):
SL_VERSION=${SL_VERSION:-"current"}
@@ -164,29 +203,39 @@ SL_REPO_URL=${SL_REPO_URL:-"rsync.osuosl.org::slackware"}
DEF_SL_REPO_URL=${SL_REPO_URL}
# List of Slackware package series - each will become a squashfs module:
-SEQ_SLACKWARE="tagfile:a,ap,d,e,f,k,kde,kdei,l,n,t,tcl,x,xap,xfce,y pkglist:slackextra"
+if [ "$(echo ${SL_VERSION}|cut -d. -f1)" == "14" ]; then
+ # Slackware up and until 14.2 has KDE4 which includes the 'kdei' package set:
+ SEQ_SLACKWARE="tagfile:a,ap,d,e,f,k,kde,kdei,l,n,t,tcl,x,xap,xfce,y pkglist:slackextra"
+else
+ # Exclude Emacs to keep the ISO size below DVD size:
+ SEQ_SLACKWARE="tagfile:a,ap,d,f,k,kde,l,n,t,tcl,x,xap,xfce,y pkglist:slackextra"
+fi
# Stripped-down Slackware with XFCE as the Desktop Environment:
# - each series will become a squashfs module:
-SEQ_XFCEBASE="${MINLIST},noxbase,x_base,xapbase,xfcebase"
+SEQ_XFCEBASE="pkglist:${MINLIST},noxbase,x_base,xapbase,xfcebase local:mcpp"
-# Stripped-down Slackware with KDE4 as the Desktop Environment:
-# - each series will become a squashfs module:
-SEQ_KDE4BASE="pkglist:${MINLIST},noxbase,x_base,xapbase,kde4base"
+# Stripped-down Base Slackware:
+SEQ_LEAN="pkglist:${MINLIST},noxbase,x_base,xapbase,xfcebase,slackpkgplus,z00_plasma5supp,z01_plasma5base,z01_swdev"
+
+# Stripped-down Slackware DAW with Plasma5 as the Desktop Environment:
+# - each series will become a squashfs module.
+# Note that loading the modules needs a specific order, which we force:
+SEQ_DAW="pkglist:${MINLIST},noxbase,x_base,xapbase,slackpkgplus,z00_plasma5supp,z01_plasma5base,z01_plasma5extra,z01_swdev,z02_alien4daw,z02_alienrest4daw,z03_daw"
-# List of Slackware package series with Plasma5 instead of KDE 4 (full install):
+# Slackware with 'ktown' Plasma5 instead of its own KDE (full install):
# - each will become a squashfs module:
-SEQ_PLASMA5="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap,xfce,y pkglist:alien,alienrest,plasma5,slackextra,slackpkgplus"
+SEQ_KTOWN="tagfile:a,ap,d,f,k,l,n,t,tcl,x,xap,xfce,y pkglist:ktownslack,ktown,ktownalien,slackextra,slackpkgplus"
-# List of Slackware package series with MSB instead of KDE 4 (full install):
+# List of Slackware package series with MSB instead of KDE (full install):
# - each will become a squashfs module:
SEQ_MSB="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap,xfce,y pkglist:mate,slackextra,slackpkgplus"
-# List of Slackware package series with Cinnamon instead of KDE4 (full install):
+# List of Slackware package series with Cinnamon instead of KDE (full install):
# - each will become a squashfs module:
SEQ_CIN="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap,xfce,y pkglist:cinnamon,slackextra,slackpkgplus"
-# Slackware package series with Gnome3/systemd instead of KDE4 (full install):
+# Slackware package series with Gnome3/systemd instead of KDE (full install):
# - each will become a squashfs module:
SEQ_DLACK="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap pkglist:dlackware,slackextra,systemd"
@@ -194,10 +243,21 @@ SEQ_DLACK="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap pkglist:dlackware,slackextra,sys
# - each will become a squashfs module:
SEQ_STUDW="tagfile:a,ap,d,e,f,k,kde,l,n,t,tcl,x,xap,xfce,y pkglist:slackextra,slackpkgplus,studioware"
+# Package blacklists for variants:
+#BLACKLIST_DAW="seamonkey"
+#BLACKLIST_LEAN="seamonkey"
+BLACKLIST_SLACKWARE="calligra calligraplan gcc-gdc gcc-gfortran gcc-gnat gcc-objc krita kstars seamonkey"
+#BLACKLIST_XFCE="gst-plugins-bad-free lynx mc motif mozilla-firefox pidgin xlockmore"
+
+# Potentially we will use package(s) from 'testing' instead of regular repo:
+#TESTINGLIST_DAW="kernel-generic kernel-modules kernel-headers kernel-source"
+TESTINGLIST_DAW=""
+
# -- START: Used verbatim in upslak.sh -- #
# List of kernel modules required for a live medium to boot properly;
-# Lots of HID modules added to support keyboard input for LUKS password entry:
-KMODS=${KMODS:-"squashfs:overlay:loop:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:mmc-core:mmc-block:sdhci:sdhci-pci:sdhci-acpi:usb-storage:hid:usbhid:i2c-hid:hid-generic:hid-apple:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd:mbcache:ext3:ext4:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat:ntfs"}
+# Lots of HID modules added to support keyboard input for LUKS password entry;
+# Virtio modules added to experiment with liveslak in a VM.
+KMODS=${KMODS:-"squashfs:overlay:loop:efivarfs:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:mmc-core:mmc-block:sdhci:sdhci-pci:sdhci-acpi:rtsx_pci:rtsx_pci_sdmmc:usb-storage:uas:hid:usbhid:i2c-hid:hid-generic:hid-apple:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd:mbcache:ext3:ext4:zstd_compress:lz4hc_compress:lz4_compress:btrfs:f2fs:jfs:xfs:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat:exfat:ntfs:virtio_ring:virtio:virtio_blk:virtio_balloon:virtio_pci:virtio_pci_modern_dev:virtio_net"}
# Network kernel modules to include for NFS root support:
NETMODS="kernel/drivers/net kernel/drivers/virtio"
@@ -207,20 +267,22 @@ NETEXCL="appletalk arcnet bonding can dummy.ko hamradio hippi ifb.ko irda macvla
# -- END: Used verbatim in upslak.sh -- #
# Firmware for wired network cards required for NFS root support:
-NETFIRMWARE="3com acenic adaptec bnx tigon e100 sun kaweth tr_smctr cxgb3"
+NETFIRMWARE="3com acenic adaptec bnx tigon e100 sun kaweth tr_smctr cxgb3 rtl_nic"
# If any Live variant needs additional 'append' parameters, define them here,
# either using a variable name 'KAPPEND_<LIVEDE>', or by defining 'KAPPEND' in the .conf file:
KAPPEND_SLACKWARE=""
-KAPPEND_PLASMA5="threadirqs"
-KAPPEND_STUDIOWARE="threadirqs"
+KAPPEND_KTOWN="threadirqs loglevel=3 audit=0"
+KAPPEND_DAW="threadirqs preempt=full loglevel=3 audit=0"
+KAPPEND_LEAN="threadirqs preempt=full loglevel=3 audit=0"
+KAPPEND_STUDIOWARE="threadirqs preempt=full loglevel=3 audit=0"
# Add CACert root certificates yes/no?
-ADD_CACERT=${ADD_CACERT:-"YES"}
+ADD_CACERT=${ADD_CACERT:-"NO"}
-# Default language selection for the Live OS; this can be changed with the
-# coomandline switch "-l":
-DEF_LANG="us"
+# Default language selection for the Live OS; 'en' means generic English.
+# This can be changed with the commandline switch "-l":
+DEF_LANG="en"
#
# ---------------------------------------------------------------------------
@@ -249,7 +311,7 @@ SQ_COMP_PARAMS_OPT[gzip]=""
SQ_COMP_PARAMS_OPT[lzma]=""
SQ_COMP_PARAMS_OPT[lzo]=""
SQ_COMP_PARAMS_OPT[xz]="-b 1M"
-SQ_COMP_PARAMS_OPT[zstd]="-b 1M -Xcompression-level 19"
+SQ_COMP_PARAMS_OPT[zstd]="-b 1M -Xcompression-level 22"
# What compression to use for the squashfs modules?
# Default is xz, alternatives are gzip, lzma, lzo, zstd:
@@ -282,13 +344,14 @@ LIVE_BOOT=${LIVE_BOOT:-"${LIVE_STAGING}/${LIVEMAIN}/bootinst"}
LIVE_MOD_SYS=${LIVE_MOD_SYS:-"${LIVE_STAGING}/${LIVEMAIN}/system"}
LIVE_MOD_ADD=${LIVE_MOD_ADD:-"${LIVE_STAGING}/${LIVEMAIN}/addons"}
LIVE_MOD_OPT=${LIVE_MOD_OPT:-"${LIVE_STAGING}/${LIVEMAIN}/optional"}
+LIVE_MOD_COS=${LIVE_MOD_COS:-"${LIVE_STAGING}/${LIVEMAIN}/core2ram"}
# ---------------------------------------------------------------------------
# Define some functions.
# ---------------------------------------------------------------------------
# Clean up in case of failure:
-cleanup() {
+function cleanup() {
# Clean up by unmounting our loopmounts, deleting tempfiles:
echo "--- Cleaning up the staging area..."
sync
@@ -301,24 +364,26 @@ cleanup() {
rmdir ${LIVE_ROOTDIR} 2>${DBGOUT}
rmdir ${LIVE_WORK}/*_$$ 2>${DBGOUT}
+ rm ${LIVE_MOD_COS}/* 2>${DBGOUT} || true
rm ${LIVE_MOD_OPT}/* 2>${DBGOUT} || true
rm ${LIVE_MOD_ADD}/* 2>${DBGOUT} || true
-}
+} # End of cleanup()
+
trap 'echo "*** $0 FAILED at line $LINENO ***"; cleanup; exit 1' ERR INT TERM
# Uncompress the initrd based on the compression algorithm used:
-uncompressfs () {
+function uncompressfs() {
if $(file "${1}" | grep -qi ": gzip"); then
gzip -cd "${1}"
elif $(file "${1}" | grep -qi ": XZ"); then
xz -cd "${1}"
fi
-}
+} # End of uncompressfs()
#
# Return the full pathname of first package found below $2 matching exactly $1:
#
-full_pkgname() {
+function full_pkgname() {
PACK=$1
if [ -e $2 ]; then
TOPDIR=$2
@@ -336,7 +401,7 @@ full_pkgname() {
else
echo ""
fi
-}
+} # End of full_pkgname()
#
# Find packages and install them into the temporary root:
@@ -366,8 +431,8 @@ function install_pkgs() {
if [ "$3" = "local" -a -d ${LIVE_TOOLDIR}/local${DIRSUFFIX}/$1 ]; then
echo "-- Installing local packages from subdir 'local${DIRSUFFIX}/$1'."
- #installpkg --terse --root "$2" "local${DIRSUFFIX}/$1/*.t?z"
- ROOT="$2" upgradepkg --install-new --reinstall "local${DIRSUFFIX}/$1/*.t?z"
+ #installpkg --terse --root "$2" "${LIVE_TOOLDIR}/local${DIRSUFFIX}/$1/*.t?z"
+ ROOT="$2" upgradepkg --install-new --reinstall "${LIVE_TOOLDIR}"/local${DIRSUFFIX}/"$1"/*.t?z
else
# Load package list and (optional) custom repo info:
if [ "$3" = "tagfile" ]; then
@@ -383,7 +448,9 @@ function install_pkgs() {
fi
if [ "${SL_REPO}" = "${DEF_SL_REPO}" ]; then
- # We need only one release from the Slackware package mirror;
+ # SL_REPO was not re-defined in ${PKGCONF},
+ # so we are dealing with an actual Slackware repository rootdir.
+ # We select only the requested release in the Slackware package mirror;
# This must *not* end with a '/' :
SELECTION="${DISTRO}${DIRSUFFIX}-${SL_VERSION}"
else
@@ -425,21 +492,62 @@ function install_pkgs() {
# REP equal to PKG.
# - If PKG is empty then this is a request to remove the package.
REP=$(echo $PKGPAT |cut -d% -f1)
+ if [ "$CORE2RAM" != "NO" ] && [ -z "$(echo $CORE2RAMMODS |grep -w $(basename $PKGFILE .lst))" ]; then
+ # If we are adding core2ram modules,
+ # prevent re-installing their packages in another module:
+ PKGC2R="$(for MYLST in ${CORE2RAMMODS}; do grep "^${PKG}$" ${LIVE_TOOLDIR}/pkglists/${MYLST}.lst ; done)"
+ unset MYLST
+ if [ -n "${PKGC2R}" ]; then
+ # Found a package that is listed as a core2ram module:
+ continue
+ fi
+ fi
+ # Skip installation on detecting a blacklisted package:
+ for BLST in ${BLACKLIST} BLNONE; do
+ if [ "$PKG" == "$BLST" ]; then
+ # Found a blacklisted package.
+ break
+ fi
+ done
+ # Sometimes we want to use a package in 'testing' instead:
+ for PTST in ${TESTINGLIST} TSTNONE; do
+ if [ "$PKG" == "$PTST" ]; then
+ # Found a package to install from 'testing'.
+ break
+ fi
+ done
+ # Install a SMP kernel/modules if requested:
+ if [ "${PKG}" = "kernel-generic" ] && [ "$SL_ARCH" != "x86_64" -a "$SMP32" = "YES" ]; then
+ PKG="kernel-generic-smp"
+ elif [ "${PKG}" = "kernel-modules" ] && [ "$SL_ARCH" != "x86_64" -a "$SMP32" = "YES" ]; then
+ PKG="kernel-modules-smp"
+ fi
+ # Now decide what to do:
if [ -z "${PKG}" ]; then
# Package removal:
ROOT="$2" removepkg "${REP}"
+ elif [ "${PKG}" == "${BLST}" ]; then
+ echo "-- Not installing blacklisted package '$PKG'."
else
+ if [ "${PKG}" == "${PTST}" ]; then
+ echo "-- Installing package '$PKG' from 'testing'."
+ FULLPKG=$(full_pkgname ${PKG} $(dirname ${SL_PKGROOT})/testing)
+ else
+ FULLPKG=""
+ fi
# Package install/upgrade:
# Look in ./patches ; then ./${DISTRO}$DIRSUFFIX ; then ./extra
# Need to escape any '+' in package names such a 'gtk+2'.
- if [ ! -z "${SL_PATCHROOT}" ]; then
- FULLPKG=$(full_pkgname ${PKG} ${SL_PATCHROOT})
- else
- FULLPKG=""
+ if [ "x${FULLPKG}" = "x" ]; then
+ if [ ! -z "${SL_PATCHROOT}" ]; then
+ FULLPKG=$(full_pkgname ${PKG} ${SL_PATCHROOT})
+ else
+ FULLPKG=""
+ fi
fi
if [ "x${FULLPKG}" = "x" ]; then
FULLPKG=$(full_pkgname ${PKG} ${SL_PKGROOT})
- else
+ elif [ "${PKG}" != "${PTST}" ]; then
echo "-- $PKG found in patches"
fi
if [ "x${FULLPKG}" = "x" ]; then
@@ -471,39 +579,45 @@ function install_pkgs() {
done
fi
- if [ "$TRIM" = "doc" -o "$TRIM" = "mandoc" -o "$LIVEDE" = "XFCE" ]; then
+ if [ "$TRIM" = "doc" -o "$TRIM" = "mandoc" -o "$TRIM" = "waste" -o "$TRIM" = "bloat" ]; then
# Remove undesired (too big for a live OS) document subdirectories,
# but leave cups alone because it contains the CUPS service's web page:
- mv "${2}"/usr/doc/cups-* "${2}"/usr/ 2>/dev/null
- (cd "${2}/usr/doc" && find . -type d -mindepth 2 -maxdepth 2 -exec rm -rf {} \;)
+ (cd "${2}/usr/doc" && find . -type d -mindepth 2 -maxdepth 2 |grep -v /cups- |xargs rm -rf)
rm -rf "$2"/usr/share/gtk-doc
rm -rf "$2"/usr/share/help
find "$2"/usr/share/ -type d -name doc |xargs rm -rf
# Remove residual bloat:
rm -rf "${2}"/usr/doc/*/html
- rm -f "${2}"/usr/doc/*/*.{html,css,xml,pdf,db,gz,bz2,xz,txt,TXT}
+ rm -f "${2}"/usr/doc/*/*.{pdf,db,gz,bz2,xz,txt,TXT}
# This will remove more bloat but won't touch the license texts:
- find "${2}"/usr/doc/ -type f -size +50k |xargs rm -f
+ find "${2}"/usr/doc/ -type f -size +50k |grep -v /cups- |xargs rm -f
# Remove info pages:
rm -rf "$2"/usr/info
- # Move cups documentation back in place:
- mv "${2}"/usr/cups-* "${2}"/usr/doc/ 2>/dev/null
fi
- if [ "$TRIM" = "mandoc" -o "$LIVEDE" = "XFCE" ]; then
+ if [ "$TRIM" = "mandoc" -o "$TRIM" = "waste" -o "$TRIM" = "bloat" ]; then
# Also remove man pages:
rm -rf "$2"/usr/man
fi
- if [ "$LIVEDE" = "XFCE" ]; then
+ if [ "$TRIM" = "bloat" ]; then
# By pruning stuff that no one likely needs anyway,
# we make room for packages we would otherwise not be able to add.
+ # We do this only if your ISO needs to be the smallest possible:
# MySQL embedded is only used by Amarok:
rm -f "$2"/usr/bin/mysql*embedded*
- # I am against torture:
- rm -f "$2"/usr/bin/smbtorture
# Also remove the big unused/esoteric static libraries:
rm -f "$2"/usr/lib${DIRSUFFIX}/*.a
# This was inadvertantly left in the gcc package:
rm -f "$2"/usr/libexec/gcc/*/*/cc1objplus
+ # From samba we mostly want the shared runtime libraries:
+ rm -rf "$2"/usr/share/samba
+ rm -rf "$2"/usr/lib${DIRSUFFIX}/python*/site-packages/samba
+ # Guile library is all we need to satisfy make:
+ rm -f "$2"/usr/bin/guil*
+ rm -rf "$2"/usr/include/guile
+ rm -rf "$2"/usr/lib64/guile
+ rm -rf "$2"/usr/share/guile
+ # I am against torture:
+ rm -f "$2"/usr/bin/smbtorture
# From llvm we only want the shared runtime libraries so wipe the rest:
rm -f "$2"/usr/lib${DIRSUFFIX}/lib{LLVM,lldb}*.a
rm -rf "$2"/usr/lib${DIRSUFFIX}/libclang*
@@ -521,19 +635,28 @@ function install_pkgs() {
rm -rf "$2"/usr/lib${DIRSUFFIX}/d3d
rm -rf "$2"/usr/lib${DIRSUFFIX}/guile
rm -rf "$2"/usr/share/icons/HighContrast
- # Nor these datacenter NIC firmwares and drivers:
+ fi
+ if [ "$TRIM" = "waste" -o "$TRIM" = "bloat" ]; then
+ # Get rid of these datacenter NIC firmwares and drivers:
rm -rf "$2"/lib/firmware/{bnx*,cxgb4,libertas,liquidio,mellanox,netronome,qed}
rm -rf "$2"/lib/modules/*/kernel/drivers/infiniband
rm -rf "$2"/lib/modules/*/kernel/drivers/net/ethernet/{broadcom/bnx*,chelsio,mellanox,netronome,qlogic}
# Old wireless cards that eat space:
rm -rf "$2"/lib/firmware/mrvl
rm -rf "$2"/lib/modules/*/kernel/drivers/net/wireless/marvell
+ # Qualcomm GPU firmware (Android phone/tablet)
+ rm -rf "$2"/lib/firmware/qcom
+ # Texas Instruments ARM firmware:
+ rm -rf "$2"/lib/firmware/ti-connectivity
# Mediatek ARM firmware:
+ rm -rf "$2"/lib/firmware/mediatek
rm -rf "$2"/lib/firmware/vpu*.bin
+ # Firmware for Data Path Acceleration Architecture NICs:
+ rm -rf "$2"/lib/firmware/dpaa2
# Not needed:
rm -rf "$2"/boot/System.map*
# Depends on Qt:
- rm -f /usr/bin/wpa_gui /usr/share/applications/wpa_gui.desktop
+ rm -f "$2"/usr/bin/wpa_gui "$2"/usr/share/applications/wpa_gui.desktop
# Replace 3.2 MB splash with a symlink to a 33 kB file:
if [ -e "$2"/usr/share/gimp/2.0/images/gimp-splash.png -a ! -L "$2"/usr/share/gimp/2.0/images/gimp-splash.png ]; then
rm -rf "$2"/usr/share/gimp/2.0/images/gimp-splash.png
@@ -553,38 +676,41 @@ function install_pkgs() {
find "$2"/usr/ -type d -iname test |xargs rm -rf
find "$2"/usr/ -type d -iname "example*" |xargs rm -rf
# Get rid of most of the screensavers:
- KEEPXSCR="julia xflame xjack"
+ KEEPXSCR="julia|xflame|xjack"
if [ -d "${2}"/usr/libexec/xscreensaver ]; then
cd "${2}"/usr/libexec/xscreensaver
- mkdir .keep
- for XSCR in ${KEEPXSCR} ; do
- mv ${XSCR} .keep/ 2>/dev/null
- done
- rm -rf [A-Za-z]*
- mv .keep/* . 2>/dev/null
- rm -rf .keep
+ find . -type f | grep -Ev "($KEEPXSCR)" |xargs rm -f
cd - 1>/dev/null
fi
- # Remove unneeded languages from glibc:
- KEEPLANG="$(cat ${LIVE_TOOLDIR}/languages|grep -Ev "(^ *#|^$)"|cut -d: -f5)"
- for LOCALEDIR in /usr/lib${DIRSUFFIX}/locale /usr/share/i18n/locales /usr/share/locale ; do
- if [ -d "${2}"/${LOCALEDIR} ]; then
- cd "${2}"/${LOCALEDIR}
- mkdir .keep
- for KL in C ${KEEPLANG} ; do
- mv ${KL%%.utf8}* .keep/ 2>/dev/null # en_US.utf8 -> en_US*
- mv ${KL%%_*} .keep/ 2>/dev/null # en_US.utf8 -> en
- done
- rm -rf [A-Za-z]*
- mv .keep/* . 2>/dev/null
- rm -rf .keep
- cd - 1>/dev/null
- fi
- done
+ if [ "$3" != "local" ] && echo "$(cat ${PKGFILE} |grep -v -E '^ *#|^$' |cut -d: -f1)" |grep -wq glibc ; then
+ # Remove unneeded languages from glibc:
+ KEEPLANG="$(cat ${LIVE_TOOLDIR}/languages|grep -Ev "(^ *#|^$)"|cut -d: -f5)"
+ for LOCALEDIR in /usr/lib${DIRSUFFIX}/locale /usr/share/i18n/locales /usr/share/locale ; do
+ if [ -d "${2}"/${LOCALEDIR} ]; then
+ cd "${2}"/${LOCALEDIR}
+ mkdir ${LIVE_WORK}/.keep
+ for KL in C ${KEEPLANG} ; do
+ # en_US.utf8 -> en_US*
+ mv ${KL%%.utf8}* ${LIVE_WORK}/.keep/ 2>/dev/null
+ # en_US.utf8 -> en
+ mv ${KL%%_*} ${LIVE_WORK}/.keep/ 2>/dev/null
+ done
+ rm -rf [A-Za-z]*
+ mv ${LIVE_WORK}/.keep/* . 2>/dev/null
+ rm -rf ${LIVE_WORK}/.keep
+ cd - 1>/dev/null
+ fi
+ done
+ fi
+ # Remove big old ICU libraries that are not needed for the XFCE image:
+ if [ -e "$2"/var/log/packages/aaa_elflibs-[0-9]* ]; then
+ for ICUFILE in $(grep /libicu "$2"/var/log/packages/aaa_elflibs-[0-9]*) ; do
+ rm -f "$2"/$ICUFILE ;
+ done
+ fi
fi
- # End install_pkgs
-}
+} # End install_pkgs()
#
@@ -601,12 +727,13 @@ function gen_bootmenu() {
rm -f ${MENUROOTDIR}/kbd.cfg
rm -f ${MENUROOTDIR}/lang*.cfg
- # Generate main (US) vesamenu.cfg:
+ # Generate main (EN) vesamenu.cfg:
cat ${LIVE_TOOLDIR}/menu.tpl | sed \
-e "s/@KBD@/${DEF_KBD}/g" \
-e "s/@LANG@/${DEF_LANG}/g" \
-e "s/@ULANG@/${DEF_LANG^^}/g" \
-e "s,@LOCALE@,${DEF_LOCALE},g" \
+ -e "s,@TZ@,${DEF_TZ},g" \
-e "s/@CONSFONT@/$CONSFONT/g" \
-e "s/@DIRSUFFIX@/$DIRSUFFIX/g" \
-e "s/@DISTRO@/$DISTRO/g" \
@@ -619,6 +746,8 @@ function gen_bootmenu() {
-e "s/@SL_VERSION@/$SL_VERSION/g" \
-e "s/@VERSION@/$VERSION/g" \
-e "s/@KAPPEND@/$KAPPEND/g" \
+ -e "s/@C2RMH@/$C2RMH/g" \
+ -e "s/@C2RSH@/$C2RMS/g" \
> ${MENUROOTDIR}/vesamenu.cfg
for LANCOD in $(cat ${LIVE_TOOLDIR}/languages |grep -Ev "(^ *#|^$)" |cut -d: -f1)
@@ -633,6 +762,11 @@ function gen_bootmenu() {
cat <<EOL >> ${MENUROOTDIR}/kbd.cfg
label ${LANCOD}
menu label ${LANDSC}
+EOL
+ if [ "${KBD}" == "${DEF_KBD}" ]; then
+ echo " menu default" >> ${MENUROOTDIR}/kbd.cfg
+ fi
+ cat <<EOL >> ${MENUROOTDIR}/kbd.cfg
kbdmap menu/${KBD}.ktl
kernel vesamenu.c32
append menu/menu_${LANCOD}.cfg
@@ -645,6 +779,7 @@ EOL
-e "s/@LANG@/$LANCOD/g" \
-e "s/@ULANG@/${DEF_LANG^^}/g" \
-e "s,@LOCALE@,${DEF_LOCALE},g" \
+ -e "s,@TZ@,${DEF_TZ},g" \
-e "s/@CONSFONT@/$CONSFONT/g" \
-e "s/@DIRSUFFIX@/$DIRSUFFIX/g" \
-e "s/@DISTRO@/$DISTRO/g" \
@@ -657,6 +792,8 @@ EOL
-e "s/@SL_VERSION@/$SL_VERSION/g" \
-e "s/@VERSION@/$VERSION/g" \
-e "s/@KAPPEND@/$KAPPEND/g" \
+ -e "s/@C2RMH@/$C2RMH/g" \
+ -e "s/@C2RMS@/$C2RMS/g" \
> ${MENUROOTDIR}/menu_${LANCOD}.cfg
# Generate custom language selection submenu for selected keyboard:
@@ -677,7 +814,8 @@ EOL
done
done
-}
+
+} # End of gen_bootmenu()
#
# Create the grub menu file for UEFI boot:
@@ -686,7 +824,7 @@ function gen_uefimenu() {
GRUBDIR="$1"
- # Generate the grub menu structure - many files because of the selection tree.
+ # Generate the grub menu structure.
# I expect the directory to exist... but you never know.
mkdir -p ${GRUBDIR}
@@ -715,12 +853,14 @@ function gen_uefimenu() {
-e "s/@SL_VERSION@/$SL_VERSION/g" \
-e "s/@VERSION@/$VERSION/g" \
-e "s/@KAPPEND@/$KAPPEND/g" \
+ -e "s/@C2RMH@/$C2RMH/g" \
+ -e "s/@C2RMS@/$C2RMS/g" \
> ${GRUBDIR}/grub.cfg
# Set a default keyboard selection:
cat <<EOL > ${GRUBDIR}/kbd.cfg
# Keyboard selection:
-set default = $sl_lang
+set default = $sl_kbd
EOL
@@ -766,6 +906,9 @@ EOL
done
# Create the timezone selection menu:
+ # Code used from Slackware script:
+ # source/a/glibc-zoneinfo/timezone-scripts/output-updated-timeconfig.sh
+ # Author: Patrick Volkerding <volkerdi@slackware.com>
TZDIR="/usr/share/zoneinfo"
TZLIST=$(mktemp -t alientz.XXXXXX)
if [ ! -f $TZLIST ]; then
@@ -773,41 +916,177 @@ EOL
cleanup
exit 1
fi
- # First, create a list of timezones:
- # This code taken from Slackware script:
- # source/a/glibc-zoneinfo/timezone-scripts/output-updated-timeconfig.sh
- # Author: Patrick Volkerding <volkerdi@slackware.com>
- # US/ first:
- ( cd $TZDIR
- find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep "^US/" | while read zone ; do
- echo "${zone}" >> $TZLIST
- done
- )
- # Don't list right/ and posix/ zones:
- ( cd $TZDIR
- find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | grep -v "^US/" | grep -v "^posix/" | grep -v "^right/" | while read zone ; do
- echo "${zone}" >> $TZLIST
- done
- )
- for TZ in $(cat $TZLIST); do
- # Add this entry to the keyboard selection menu:
+
+ # Structured tz select instead of dumping them all in one menu:
+ for TZ in US Africa America Asia Atlantic Australia Etc Europe Pacific; do
+ # First the submenu for this zone:
cat <<EOL >> ${GRUBDIR}/tz.cfg
-menuentry "${TZ}" {
- set sl_tz="$TZ"
+submenu "${TZ} >" {
+ configfile \$prefix/${TZ}/tz.cfg
+}
+
+EOL
+ # Then the locations for this zone:
+ mkdir ${GRUBDIR}/${TZ}
+ ( cd $TZDIR/$TZ
+ find . -type f | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f2- -d / | sort | while read LOCN ; do
+ # Add this entry to the keyboard selection menu:
+ cat <<EOL >> ${GRUBDIR}/${TZ}/tz.cfg
+menuentry "${TZ}/${LOCN}" {
+ set sl_tz="${TZ}/${LOCN}"
export sl_tz
configfile \$prefix/grub.cfg
}
EOL
- rm -f $TZLIST
-
+ done
+ )
done
+ # Timezone data in rootdirectory follows:
+ ( cd $TZDIR
+ find . -type f -mindepth 1 -maxdepth 1 | xargs file | grep "timezone data" | cut -f 1 -d : | cut -f 2- -d / | sort | while read ZONE ; do
+ # Add this entry to the keyboard selection menu:
+ cat <<EOL >> ${GRUBDIR}/tz.cfg
+menuentry "${ZONE}" {
+ set sl_tz="$ZONE"
+ export sl_tz
+ configfile \$prefix/grub.cfg
}
+EOL
+ done
+ )
+
+} # End of gen_uefimenu()
+
+
+#
+# Add UEFI SecureBoot support:
+#
+function secureboot() {
+ # Liveslak uses Fedora's shim (for now), which is signed by
+ # 'Microsoft UEFI CA' and contains Fedora's CA certificate.
+ # We sign liveslak's grub and kernel with our own key/certificate pair.
+ # This means that the user of liveslak will have to enroll liveslak's
+ # public certificate via MokManager. This needs to be done only once.
+
+ # Note that we use the generic fallback directory /EFI/BOOT/ for the Live ISO
+ # instead of a custom distro entry for UEFI such as /EFI/BOOT/Slackware/
+ # When shim is booted with path /EFI/BOOT/bootx64.efi, and there is a
+ # Fallback binary (fbx64.efi) , shim will load that one instead of grub,
+ # so Fallback can create a NVRAM boot entry for a custom distro directory
+ # (which we do not have) causing a reset boot loop.
+ # This is why liveslak does not install fbx64.efi. A regular distro should
+ # install that file in its distro subdirectory!
+
+ SHIM_VENDOR="$1"
+ [ -z "${SHIM_VENDOR}" ] && SHIM_VENDOR="fedora"
+
+ case $SHIM_VENDOR in
+ opensuse) GRUB_SIGNED="grub.efi"
+ ;;
+ *) GRUB_SIGNED="grubx64.efi"
+ ;;
+ esac
+ mkdir -p ${LIVE_WORK}/shim
+ cd ${LIVE_WORK}/shim
+
+ echo "-- Signing grub+kernel with '${LIVE_STAGING}/EFI/BOOT/liveslak.pem'."
+ # Sign grub:
+ # The Grub EFI image must be renamed appropriately for shim to find it,
+ # since some distros change the default 'grubx64.efi' filename:
+ mv -i ${LIVE_STAGING}/EFI/BOOT/bootx64.efi \
+ ${LIVE_WORK}/shim/grubx64.efi.unsigned
+ sbsign --key ${MOKPRIVKEY} --cert ${MOKCERT} \
+ --output ${LIVE_STAGING}/EFI/BOOT/${GRUB_SIGNED} \
+ ${LIVE_WORK}/shim/grubx64.efi.unsigned
+ # Sign the kernel:
+ mv ${LIVE_STAGING}/boot/generic ${LIVE_WORK}/shim/generic.unsigned
+ sbsign --key ${MOKPRIVKEY} --cert ${MOKCERT} \
+ --output ${LIVE_STAGING}/boot/generic \
+ ${LIVE_WORK}/shim/generic.unsigned
+
+ if [ "${SHIM_VENDOR}" = "fedora" ]; then
+ # The version of Fedora's shim package - always use the latest!
+ SHIM_MAJVER=15.6
+ SHIM_MINVER=2
+ SHIMSRC="https://kojipkgs.fedoraproject.org/packages/shim/${SHIM_MAJVER}/${SHIM_MINVER}/x86_64/shim-x64-${SHIM_MAJVER}-${SHIM_MINVER}.x86_64.rpm"
+ echo "-- Downloading/installing the SecureBoot signed shim from Fedora."
+ wget -q --progress=dot:mega --show-progress ${SHIMSRC} -O - \
+ | rpm2cpio - | cpio -dim
+ echo ""
+ # Install signed efi files into UEFI BOOT directory of the esp partition:
+ # The name of the shim in the ISO, *must* be 'bootx64.efi':
+ install -D -m0644 boot/efi/EFI/fedora/shimx64.efi \
+ ${LIVE_STAGING}/EFI/BOOT/bootx64.efi
+ install -D -m0644 boot/efi/EFI/fedora/mmx64.efi \
+ ${LIVE_STAGING}/EFI/BOOT/mmx64.efi
+ #install -D -m0644 boot/efi/EFI/BOOT/fbx64.efi \
+ # ${LIVE_STAGING}/EFI/BOOT/fbx64.efi
+ elif [ "${SHIM_VENDOR}" = "opensuse" ]; then
+ SHIM_MAJVER=15.4
+ SHIM_MINVER=6.1
+ SHIMSRC="https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/shim-${SHIM_MAJVER}-${SHIM_MINVER}.x86_64.rpm"
+ echo "-- Downloading/installing the SecureBoot signed shim from openSUSE."
+ wget -q --progress=dot:mega --show-progress ${SHIMSRC} -O - \
+ | rpm2cpio - | cpio -dim
+ echo ""
+ # Install signed efi files into UEFI BOOT directory of the esp partition:
+ # The name of the shim in the ISO, *must* be 'bootx64.efi':
+ install -D -m0644 usr/share/efi/x86_64/shim-opensuse.efi \
+ ${LIVE_STAGING}/EFI/BOOT/bootx64.efi
+ install -D -m0644 usr/share/efi/x86_64/MokManager.efi \
+ ${LIVE_STAGING}/EFI/BOOT/MokManager.efi
+ #install -D -m0644 usr/share/efi/x86_64/fallback.efi \
+ # ${LIVE_STAGING}/EFI/BOOT/fallback.efi
+ elif [ "${SHIM_VENDOR}" = "debian" ]; then
+ DEBSHIM_VER=1.40
+ DEBMOKM_VER=1
+ SHIM_MAJVER=15.7
+ SHIM_MINVER=1
+ SHIMSRC="http://ftp.de.debian.org/debian/pool/main/s/shim-signed/shim-signed_${DEBSHIM_VER}+${SHIM_MAJVER}-${SHIM_MINVER}_amd64.deb"
+ MOKMSRC="http://ftp.de.debian.org/debian/pool/main/s/shim-helpers-amd64-signed/shim-helpers-amd64-signed_${DEBMOKM_VER}+${SHIM_MAJVER}+${SHIM_MINVER}_amd64.deb"
+ echo "-- Downloading the SecureBoot signed shim from Debian."
+ wget -q --progress=dot:mega --show-progress ${SHIMSRC}
+ echo ""
+ echo "-- Installing the SecureBoot signed shim to the ESP."
+ # Extract discarding any directory structure:
+ ar p $(basename ${SHIMSRC}) data.tar.xz | tar --xform='s#^.+/##x' -Jxf - \
+ ./usr/lib/shim/shimx64.efi.signed
+ echo "-- Downloading the SecureBoot signed mokmanager from Debian."
+ wget -q --progress=dot:mega --show-progress ${MOKMSRC}
+ echo ""
+ echo "-- Installing the SecureBoot signed mokmanager to the ESP."
+ # Extract discarding any directory structure:
+ ar p $(basename ${MOKMSRC}) data.tar.xz | tar --xform='s#^.+/##x' -Jxf - \
+ ./usr/lib/shim/fbx64.efi.signed ./usr/lib/shim/mmx64.efi.signed
+ # Install signed efi files into UEFI BOOT directory of the esp partition:
+ # The name of the shim in the ISO, *must* be 'bootx64.efi':
+ install -D -m0644 ./shimx64.efi.signed \
+ ${LIVE_STAGING}/EFI/BOOT/bootx64.efi
+ install -D -m0644 ./mmx64.efi.signed \
+ ${LIVE_STAGING}/EFI/BOOT/mmx64.efi
+ #install -D -m0644 ./fbx64.efi.signed \
+ # ${LIVE_STAGING}/EFI/BOOT/fbx64.efi
+ else
+ echo ">> A '${SHIM_VENDOR}' shim was requested, but only 'opensuse' 'fedora' or 'debian' shim/mokmanager are supported."
+ echo ">> Expect trouble ahead."
+ fi
+ cd - 1>/dev/null
+
+ ## Write CSV file for the Fallback EFI program so that it knows what to boot:
+ #echo -n "bootx64.efi,SHIM,,SecureBoot UEFI entry for liveslak" \
+ # | iconv -t UCS-2 > ${LIVE_STAGING}/EFI/BOOT/BOOT.CSV
+
+ # Cleanup:
+ rm -rf ${LIVE_WORK}/shim
+
+} # End of secureboot()
+
#
# Create an ISO file from a directory's content:
#
-create_iso() {
+function create_iso() {
TOPDIR=${1:-"${LIVE_STAGING}"}
cd "$TOPDIR"
@@ -893,17 +1172,130 @@ create_iso() {
} # End of create_iso()
+#
+# Configure a custom background image in Plasma5:
+#
+function plasma5_custom_bg() {
+ # The function expects a background image file of JPG or PNG format.
+ # The bitmap must be present in the liveslak source tree as:
+ # media/<variant>/bg/background.png or media/<variant>/bg/background.jpg ,
+ # where <variant> is the lowercase name of the liveslak variant (such as
+ # cinnamon, daw, slackware, etc).
+ # The file background.{jpg,png} can be a symlink to an actual JPG or PNG.
+ # Aspect ratio of the image *must* be 16:9 (1920x1080 px or higher res).
+
+ # Exit immediately if the image file is not found:
+ if ! readlink -f ${LIVE_TOOLDIR}/media/${LIVEDE,,}/bg/background.* 1>/dev/null 2>&1 ; then
+ echo "-- No ${LIVEDE} custom wallpaper image."
+ return
+ fi
+
+ echo "-- Configuring ${LIVEDE} custom background image."
+ # First convert our image into a JPG in the liveslak directory:
+ mkdir -p ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}
+ convert ${LIVE_TOOLDIR}/media/${LIVEDE,,}/bg/background.* ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg
+
+ # Create a Plasma5 desktop wallpaper set with a lowercase LIVEDE name:
+ mkdir -p ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images
+
+ # Create set of images for common aspect ratios like 16:9, 16:10 and 4:3:
+ # Aspect Ratio 16:9 :
+ convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \
+ -resize 1920x1080 \
+ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1920x1080.jpg
+ convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \
+ -resize 5120x2880 \
+ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/5120x2880.jpg
+ # Aspect Ratio 16:10 :
+ convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \
+ -resize 5120x - | \
+ convert - -geometry 1920x1200^ -gravity center -crop 1920x1200+0+0 \
+ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1920x1200.jpg
+ convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \
+ -resize 5120x - | \
+ convert - -geometry 1280x800^ -gravity center -crop 1280x800+0+0 \
+ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1280x800.jpg
+ # Aspect Ratio 4:3 :
+ convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \
+ -resize 5120x - | \
+ convert - -geometry 1024x768^ -gravity center -crop 1024x768+0+0 \
+ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/images/1024x768.jpg
+
+ # Create the required wallpaper screenshot of 400x225 px (16:9 aspect ratio):
+ convert ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg \
+ -resize 400x225 \
+ ${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/contents/screenshot.png
+
+ # Add wallpaper description:
+ cat <<EOT >${LIVE_ROOTDIR}/usr/share/wallpapers/${LIVEDE,,}/metadata.desktop
+[Desktop Entry]
+Name=${DISTRO^} Live
+
+X-KDE-PluginInfo-Name=${LIVEDE,,}
+X-KDE-PluginInfo-Author=Eric Hameleers
+X-KDE-PluginInfo-Email=alien@slackware.com
+X-KDE-PluginInfo-License=CC-BY-SA-4.0
+EOT
+
+ # Now set our wallpaper to be the default. For this to work, we need to link
+ # the name of the default theme to ours, so find out what the default is:
+ if [ -f "${LIVE_ROOTDIR}/usr/share/plasma/desktoptheme/default/metadata.desktop" ]; then
+ # Frameworks before 5.94.0:
+ THEMEFIL=/usr/share/plasma/desktoptheme/default/metadata.desktop
+ else
+ # Frameworks 5.94.0 and newer:
+ THEMEFIL=/usr/share/plasma/desktoptheme/default/plasmarc
+ fi
+ DEF_THEME="$(grep ^defaultWallpaperTheme ${LIVE_ROOTDIR}/${THEMEFIL} |cut -d= -f2-)"
+ mv ${LIVE_ROOTDIR}/usr/share/wallpapers/${DEF_THEME}{,.orig}
+ ln -s ${LIVEDE,,} ${LIVE_ROOTDIR}/usr/share/wallpapers/${DEF_THEME}
+
+ # Custom background for the SDDM login greeter:
+ mkdir -p ${LIVE_ROOTDIR}/usr/share/sddm/themes/breeze
+ cp ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg ${LIVE_ROOTDIR}/usr/share/sddm/themes/breeze/${LIVEDE,,}_background.jpg
+ cat <<EOT > ${LIVE_ROOTDIR}/usr/share/sddm/themes/breeze/theme.conf.user
+[General]
+background=${LIVEDE,,}_background.jpg
+EOT
+
+ # Screenlocker:
+ mkdir -p ${LIVE_ROOTDIR}/home/${LIVEUID}/.config
+cat <<EOT > ${LIVE_ROOTDIR}/home/${LIVEUID}/.config/kscreenlockerrc
+[$Version]
+update_info=kscreenlocker.upd:0.1-autolock
+
+[Greeter]
+WallpaperPlugin=org.kde.image
+[Greeter][Wallpaper][org.kde.image][General]
+FillMode=2
+Image=file:///usr/share/${LIVEMAIN}/${LIVEDE,,}/background.jpg
+EOT
+
+# Is a dark theme requested to match the background atmosphere?
+if [ -f ${LIVE_TOOLDIR}/media/${LIVEDE,,}/bg/theme ]; then
+ if [ "$(grep -v '^#' ${LIVE_TOOLDIR}/media/${LIVEDE,,}/bg/theme)" == "dark" ]
+ then
+ mkdir -p ${LIVE_ROOTDIR}/home/${LIVEUID}/.config
+ cat <<EOT > ${LIVE_ROOTDIR}/home/${LIVEUID}/.config/plasmarc
+[Theme]
+name=breeze-dark
+EOT
+ fi
+fi
+
+} # End of plasma5_custom_bg()
+
# ---------------------------------------------------------------------------
# Action!
# ---------------------------------------------------------------------------
-while getopts "a:c:d:efhl:m:r:s:t:vz:GH:MO:R:X" Option
+while getopts "a:c:d:efhl:m:r:s:t:vz:CGH:MO:R:S:X" Option
do
case $Option in
h )
- echo "----------------------------------------------------------------"
- echo "make_slackware_live.sh $VERSION"
- echo "----------------------------------------------------------------"
+ echo "----------------------------------------------------------------"
+ echo "make_slackware_live.sh $VERSION"
+ echo "----------------------------------------------------------------"
echo "Usage:"
echo " $0 [OPTION] ..."
echo "or:"
@@ -919,10 +1311,11 @@ do
echo " Use i586 for a 32bit ISO, x86_64 for 64bit."
echo " -c comp Squashfs compression (default: ${SQ_COMP})."
echo " Can be any of '${SQ_COMP_AVAIL}'."
- echo " -d desktoptype SLACKWARE (full Slack), KDE4 basic,"
- echo " XFCE basic, PLASMA5, MATE, CINNAMON, DLACK."
+ echo " -d desktoptype SLACKWARE (full Slack),XFCE basic, LEAN, DAW,"
+ echo " KTOWN, MATE, CINNAMON, DLACK, STUDIOWARE."
echo " -e Use ISO boot-load-size of 32 for computers."
echo " where the ISO won't boot otherwise."
+ echo " Default value is ${BOOTLOADSIZE}."
echo " -f Forced re-generation of all squashfs modules,"
echo " custom configurations and new initrd.img."
echo " -l <localization> Enable a different default localization"
@@ -930,14 +1323,19 @@ do
echo " -m pkglst[,pkglst] Add modules defined by pkglists/<pkglst>,..."
echo " -r series[,series] Refresh only one or a few package series."
echo " -s slackrepo_dir Directory containing ${DISTRO^} repository."
- echo " -t <doc|mandoc> Trim the ISO (remove man and/or doc)."
+ echo " -t <none|doc|mandoc|waste|bloat>"
+ echo " Trim the ISO (remove man and/or doc and/or bloat)."
echo " -v Show debug/error output."
echo " -z version Define your ${DISTRO^} version (default: $SL_VERSION)."
- echo " -G Generate ISO file from existing directory tree"
+ echo " -C Add RAM-based Console OS to boot menu."
+ echo " -G Generate ISO file from existing directory tree."
echo " -H hostname Hostname of the Live OS (default: $LIVE_HOSTNAME)."
echo " -M Add multilib (x86_64 only)."
echo " -O outfile Custom filename for the ISO."
echo " -R runlevel Runlevel to boot into (default: $RUNLEVEL)."
+ echo " -S privkey:cert Enable SecureBoot support and sign binaries"
+ echo " using the full path to colon-separated"
+ echo " private key and certificate files"
echo " -X Use xorriso instead of mkisofs/isohybrid."
exit
;;
@@ -958,6 +1356,7 @@ do
r ) REFRESH="${OPTARG}"
;;
s ) SL_REPO="${OPTARG}"
+ DEF_SL_REPO="${SL_REPO}"
;;
t ) TRIM="${OPTARG}"
;;
@@ -965,6 +1364,8 @@ do
;;
z ) SL_VERSION="${OPTARG}"
;;
+ C ) CORE2RAM="YES"
+ ;;
G ) ONLY_ISO="YES"
;;
H ) LIVE_HOSTNAME="${OPTARG}"
@@ -976,6 +1377,12 @@ do
;;
R ) RUNLEVEL=${OPTARG}
;;
+ S ) MOKPRIVKEY=$(readlink -f $(echo ${OPTARG} |cut -d: -f1))
+ MOKCERT=$(readlink -f $(echo ${OPTARG} |cut -d: -f2))
+ TEMP_3RDP=$(echo ${OPTARG} |cut -d: -f3)
+ [ -n "${TEMP_3RDP}" ] && SHIM_3RDP=${TEMP_3RDP}
+ unset TEMP_3RDP
+ ;;
X ) USEXORR="YES"
;;
* ) echo "You passed an illegal switch to the program!"
@@ -1020,6 +1427,50 @@ if [ "$SL_ARCH" != "x86_64" -a "$MULTILIB" = "YES" ]; then
exit 1
fi
+if [ -n "${MOKPRIVKEY}" ] && [ -n "${MOKCERT}" ]; then
+ if [ -f ${MOKPRIVKEY} ] && [ -f ${MOKCERT} ]; then
+ echo "-- Enabling SecureBoot support (${SHIM_3RDP} shim)."
+ SECUREBOOT=1
+ else
+ echo ">> SecureBoot can not be enabled; MOK key and/or cert not found."
+ exit 1
+ fi
+fi
+
+# Determine which module sequence we have to build:
+case "$LIVEDE" in
+ SLACKWARE) MSEQ="${SEQ_SLACKWARE}" ;;
+ XFCE) MSEQ="${SEQ_XFCEBASE}" ;;
+ LEAN) MSEQ="${SEQ_LEAN}" ;;
+ DAW) MSEQ="${SEQ_DAW}" ;;
+ KTOWN) MSEQ="${SEQ_KTOWN}" ;;
+ MATE) MSEQ="${SEQ_MSB}" ;;
+ CINNAMON) MSEQ="${SEQ_CIN}" ;;
+ DLACK) MSEQ="${SEQ_DLACK}" ;;
+ STUDIOWARE) MSEQ="${SEQ_STUDW}" ;;
+ *) if [ -n "${SEQ_CUSTOM}" ]; then
+ # Custom distribution with a predefined package list:
+ MSEQ="${SEQ_CUSTOM}"
+ else
+ echo "** Unsupported configuration '$LIVEDE'"; exit 1
+ fi
+ ;;
+esac
+
+if [ "${MSEQ#pkglist:${CORE2RAMMODS/ /,}}" != "${MSEQ}" ]; then
+ # This live ISO contains core2ram modules out of the box:
+ echo "-- Native core2ram."
+ CORE2RAM="NATIVE"
+fi
+if [ "${CORE2RAM}" != "NO" ]; then
+ # Whether to show the Core OS menu in syslinux/grub on boot yes/no:
+ C2RMH="#" # syslinux
+ C2RMS="" # grub
+else
+ C2RMH="" # syslinux
+ C2RMS="#" # grub
+fi
+
if ! cat ${LIVE_TOOLDIR}/languages |grep -Ev '(^ *#|^$)' |grep -q ^${DEF_LANG}:
then
echo ">> Unsupported language '${DEF_LANG}', select a supported language:"
@@ -1034,7 +1485,7 @@ else
# Select sane defaults in case the language file lacks info:
DEF_LANDSC="${DEF_LANDSC:-'us american'}"
DEF_KBD="${DEF_KBD:-'us'}"
- DEF_TZ="${DEF_TZ:-'US/Pacific'}"
+ DEF_TZ="${DEF_TZ:-'UTC'}"
DEF_LOCALE="${DEF_LOCALE:-'en_US.utf8'}"
fi
@@ -1060,7 +1511,11 @@ DEF_SL_PATCHROOT=${SL_PATCHROOT}
# Are all the required add-on tools present?
[ "$USEXORR" = "NO" ] && ISOGEN="mkisofs isohybrid" || ISOGEN="xorriso"
PROG_MISSING=""
-for PROGN in mksquashfs unsquashfs grub-mkfont grub-mkimage syslinux $ISOGEN installpkg upgradepkg keytab-lilo rsync mkdosfs ; do
+REQTOOLS="mksquashfs unsquashfs grub-mkfont grub-mkimage syslinux $ISOGEN installpkg upgradepkg keytab-lilo rsync wget mkdosfs"
+if [ $SECUREBOOT -eq 1 ]; then
+ REQTOOLS="${REQTOOLS} openssl sbsign"
+fi
+for PROGN in ${REQTOOLS} ; do
if ! which $PROGN 1>/dev/null 2>/dev/null ; then
PROG_MISSING="${PROG_MISSING}-- $PROGN\n"
fi
@@ -1104,6 +1559,30 @@ else
RSYNCREP=" "
fi
+# What to trim from the ISO file (none, doc, mandoc, waste, bloat):
+if [ "${LIVEDE}" == "XFCE" ] ; then
+ TRIM=${TRIM:-"waste"}
+elif [ "${LIVEDE}" == "LEAN" ] ; then
+ TRIM=${TRIM:-"doc"}
+else
+ TRIM=${TRIM:-"none"}
+fi
+
+# Determine additional boot parameters to be added:
+if [ -z "${KAPPEND}" ]; then
+ eval KAPPEND=\$KAPPEND_${LIVEDE}
+fi
+
+# Determine possible blacklist to use:
+if [ -z "${BLACKLIST}" ]; then
+ eval BLACKLIST=\$BLACKLIST_${LIVEDE}
+fi
+
+# Determine possible package list from 'testing' to use:
+if [ -z "${TESTINGLIST}" ]; then
+ eval TESTINGLIST=\$TESTINGLIST_${LIVEDE}
+fi
+
# Create output directory for image file:
mkdir -p "${OUTPUT}"
if [ $? -ne 0 ]; then
@@ -1130,7 +1609,7 @@ if [ "$FORCE" = "YES" ]; then
fi
# Create temporary directories for building the live filesystem:
-for LTEMP in $LIVE_OVLDIR $LIVE_BOOT $LIVE_MOD_SYS $LIVE_MOD_ADD $LIVE_MOD_OPT ; do
+for LTEMP in $LIVE_OVLDIR $LIVE_BOOT $LIVE_MOD_SYS $LIVE_MOD_ADD $LIVE_MOD_OPT $LIVE_MOD_COS ; do
umount ${LTEMP} 2>${DBGOUT} || true
mkdir -p ${LTEMP}
if [ $? -ne 0 ]; then
@@ -1163,24 +1642,17 @@ RODIRS="${LIVE_BOOT}"
# Create the verification file for the install_pkgs function:
echo "${THEDATE} (${BUILDER})" > ${LIVE_BOOT}/${MARKER}
-# Determine which module sequence we have to build:
-case "$LIVEDE" in
- SLACKWARE) MSEQ="${SEQ_SLACKWARE}" ;;
- XFCE) MSEQ="${SEQ_XFCEBASE}" ;;
- KDE4) MSEQ="${SEQ_KDE4BASE}" ;;
- PLASMA5) MSEQ="${SEQ_PLASMA5}" ;;
- MATE) MSEQ="${SEQ_MSB}" ;;
- CINNAMON) MSEQ="${SEQ_CIN}" ;;
- DLACK) MSEQ="${SEQ_DLACK}" ;;
- STUDIOWARE) MSEQ="${SEQ_STUDW}" ;;
- *) if [ -n "${SEQ_CUSTOM}" ]; then
- # Custom distribution with a predefined package list:
- MSEQ="${SEQ_CUSTOM}"
- else
- echo "** Unsupported configuration '$LIVEDE'"; exit 1
- fi
- ;;
-esac
+# Do we need to add core2ram modules:
+if [ "$CORE2RAM" == "YES" ]; then
+ echo "-- Adding core2ram."
+ MSEQ="pkglist:${CORE2RAMMODS/ /,} ${MSEQ}"
+fi
+
+# Do we need to include secureboot module?
+if [ $SECUREBOOT -eq 1 ]; then
+ echo "-- Adding secureboot module."
+ MSEQ="${MSEQ} pkglist:secureboot"
+fi
# Do we need to create/include additional module(s) defined by a pkglist:
if [ -n "$SEQ_ADDMOD" ]; then
@@ -1191,8 +1663,10 @@ fi
# Do we need to include multilib?
# Add these last so we can easily distribute the module separately.
if [ "$MULTILIB" = "YES" ]; then
- echo "-- Adding multilib."
- MSEQ="${MSEQ} pkglist:multilib"
+ if ! echo ${MSEQ} |grep -qw multilib ; then
+ echo "-- Adding multilib."
+ MSEQ="${MSEQ} pkglist:multilib"
+ fi
fi
echo "-- Creating liveslak ${VERSION} '${LIVEDE}' image (based on ${DISTRO^}-${SL_VERSION} ${SL_ARCH})."
@@ -1213,6 +1687,10 @@ for MSUBSEQ in ${MSEQ} ; do
local) MNUM="0030" ;;
*) echo "** Unknown package source '$MTYPE'"; exit 1 ;;
esac
+ # For an explicitly added core2ram module, re-assign a lower prefix:
+ if [ "$CORE2RAM" == "YES" ] && [ "${SL_SERIES}" == "${CORE2RAMMODS}" ]; then
+ MNUM="0005"
+ fi
for SPS in ${SL_SERIES} ; do
@@ -1237,7 +1715,7 @@ for SPS in ${SL_SERIES} ; do
install_pkgs ${SPS} ${LIVE_ROOTDIR} ${MTYPE}
umount ${LIVE_ROOTDIR} || true
- if [ "$SPS" = "a" -o "$SPS" = "${MINLIST}" ]; then
+ if [ "$SPS" = "a" -a "$CORE2RAM" = "NO" ] || [ "$SPS" = "${MINLIST}" ]; then
# We need to take care of a few things first:
if [ "$SL_ARCH" = "x86_64" -o "$SMP32" = "NO" ]; then
@@ -1317,18 +1795,19 @@ else
fi
# Configure hostname and network:
-echo "${LIVE_HOSTNAME}.example.net" > ${LIVE_ROOTDIR}/etc/HOSTNAME
+echo "${LIVE_HOSTNAME}.home.arpa" > ${LIVE_ROOTDIR}/etc/HOSTNAME
if [ -f ${LIVE_ROOTDIR}/etc/NetworkManager/NetworkManager.conf ]; then
sed -i -e "s/^hostname=.*/hostname=${LIVE_HOSTNAME}/" \
${LIVE_ROOTDIR}/etc/NetworkManager/NetworkManager.conf
fi
-sed -e "s/^\(127.0.0.1\t*\)darkstar.*/\1${LIVE_HOSTNAME}.example.net ${LIVE_HOSTNAME}/" \
+sed -e "s/^\(127.0.0.1\t*\)darkstar.*/\1${LIVE_HOSTNAME}.home.arpa ${LIVE_HOSTNAME}/" \
-i ${LIVE_ROOTDIR}/etc/hosts
# Make sure we can access DNS straight away:
cat <<EOT >> ${LIVE_ROOTDIR}/etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8
+nameserver 1.1.1.1
EOT
@@ -1346,16 +1825,14 @@ echo "LANG=${DEF_LOCALE}" > ${LIVE_ROOTDIR}/etc/locale.conf
echo "KEYMAP=${DEF_KBD}" > ${LIVE_ROOTDIR}/etc/vconsole.conf
# Set timezone to UTC, mimicking the 'timeconfig' script in Slackware:
-cp -a ${LIVE_ROOTDIR}/usr/share/zoneinfo/UTC ${LIVE_ROOTDIR}/etc/localtime
+ln -sf /usr/share/zoneinfo/UTC ${LIVE_ROOTDIR}/etc/localtime
# Could be absent so 'rm -f' to avoid script aborts:
rm -f ${LIVE_ROOTDIR}/etc/localtime-copied-from
-ln -s /usr/share/zoneinfo/UTC ${LIVE_ROOTDIR}/etc/localtime-copied-from
-# Qt5 expects '/etc/localtime' to be a symlink, but in Slackware this is a
-# real file. This causes Qt5 timezone detection to fail so that "UTC"
-# will be returned always. However if a file '/etc/timezone' exists, Qt5
-# will use that. Until this is fixed (either in Slackware or in Qt5) we
-# add the file and update the 'timeconfig' script accordingly:
+# Qt5 expects '/etc/localtime' to be a symlink. If this is a real file,
+# it causes Qt5 timezone detection to fail so that "UTC" will be returned
+# always. However if a file '/etc/timezone' exists, Qt5 will use that.
+# We add the file and update the 'timeconfig' script accordingly:
echo "UTC" > ${LIVE_ROOTDIR}/etc/timezone
sed -i -n "p;s/^\( *\)rm -f localtime$/\1echo \$TZ > timezone/p" \
${LIVE_ROOTDIR}/usr/sbin/timeconfig
@@ -1389,19 +1866,20 @@ chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.font
cat <<"EOM" > ${LIVE_ROOTDIR}/etc/rc.d/rc.gpm
#!/bin/sh
# Start/stop/restart the GPM mouse server:
-[ ! -x /usr/sbin/gpm ] && return
-MTYPE="imps2"
-if [ "$1" = "stop" ]; then
- echo "Stopping gpm..."
- /usr/sbin/gpm -k
-elif [ "$1" = "restart" ]; then
- echo "Restarting gpm..."
- /usr/sbin/gpm -k
- sleep 1
- /usr/sbin/gpm -m /dev/mouse -t ${MTYPE}
-else # assume $1 = start:
- echo "Starting gpm: /usr/sbin/gpm -m /dev/mouse -t ${MTYPE}"
- /usr/sbin/gpm -m /dev/mouse -t ${MTYPE}
+if [ -x /usr/sbin/gpm ]; then
+ MTYPE="imps2"
+ if [ "$1" = "stop" ]; then
+ echo "Stopping gpm..."
+ /usr/sbin/gpm -k
+ elif [ "$1" = "restart" ]; then
+ echo "Restarting gpm..."
+ /usr/sbin/gpm -k
+ sleep 1
+ /usr/sbin/gpm -m /dev/mouse -t ${MTYPE}
+ else # assume $1 = start:
+ echo "Starting gpm: /usr/sbin/gpm -m /dev/mouse -t ${MTYPE}"
+ /usr/sbin/gpm -m /dev/mouse -t ${MTYPE}
+ fi
fi
EOM
chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.gpm
@@ -1422,6 +1900,16 @@ none / tmpfs defaults 1 1
EOT
+# Pipewire 1.0.0 is capable of replacing pulseaudio and jack2:
+if chroot ${LIVE_ROOTDIR} /usr/bin/pkg-config libpipewire-0.3 --atleast-version=1
+then
+ # Make pipewire the default, kill pulseaudio:
+ if [ -x ${LIVE_ROOTDIR}/usr/sbin/pipewire-enable.sh ]; then
+ echo "-- Enabling pipewire"
+ chroot ${LIVE_ROOTDIR} /usr/sbin/pipewire-enable.sh
+ fi
+fi
+
# Prevent loop devices (sxz modules) from appearing in filemanagers:
mkdir -p ${LIVE_ROOTDIR}/etc/udev/rules.d
cat <<EOL > ${LIVE_ROOTDIR}/etc/udev/rules.d/11-local.rules
@@ -1435,25 +1923,179 @@ KERNEL=="loop*", ENV{UDISKS_PRESENTATION_HIDE}="1"
KERNEL=="loop*", ENV{UDISKS_IGNORE}="1"
EOL
-# Set a root password.
-echo "root:${ROOTPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+# Set a root password. Note 'chpasswd' sometimes segfaults in the first form.
+if ! echo "root:${ROOTPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null; then
+ echo "root:${ROOTPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+fi
+
+# Create group and user for the nvidia persistence daemon:
+if ! chroot ${LIVE_ROOTDIR} /usr/bin/getent passwd ${NVUID} > /dev/null 2>&1 ;
+then
+ chroot ${LIVE_ROOTDIR} /usr/sbin/groupadd -g ${NVGRPNR} ${NVGRP}
+ chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Nvidia persistence" -u ${NVUIDNR} -g ${NVGRPNR} -d /dev/null -s /bin/false ${NVUID}
+ if ! echo "${NVUID}:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null ; then
+ echo "${NVUID}:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+ fi
+fi
+
+# Determine the full name of the live account in the image:
+if [ -z "${LIVEUIDFN}" ]; then
+ eval LIVEUIDFN=\$LIVEUIDFN_${LIVEDE}
+ if [ -z "${LIVEUIDFN}" ]; then
+ LIVEUIDFN="${DISTRO^} Live User"
+ fi
+fi
# Create a nonprivileged user account (called "live" by default):
-chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Slackware Live User" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,kmem,dialout,games,disk,input -u 1000 -d /home/${LIVEUID} -m -s /bin/bash ${LIVEUID}
-echo "${LIVEUID}:${LIVEPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "${LIVEUIDFN}" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,kmem,dialout,games,disk,input -u ${LIVEUIDNR} -d /home/${LIVEUID} -m -s /bin/bash ${LIVEUID}
+if ! echo "${LIVEUID}:${LIVEPW}" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null ; then
+ echo "${LIVEUID}:${LIVEPW}" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+fi
-# Configure suauth:
-cat <<EOT >${LIVE_ROOTDIR}/etc/suauth
+# Configure suauth if we are not on a PAM system (where this does not work):
+if [ ! -L ${LIVE_ROOTDIR}/lib${DIRSUFFIX}/libpam.so.? ]; then
+ cat <<EOT >${LIVE_ROOTDIR}/etc/suauth
root:${LIVEUID}:OWNPASS
root:ALL EXCEPT GROUP wheel:DENY
EOT
-chmod 600 ${LIVE_ROOTDIR}/etc/suauth
+ chmod 600 ${LIVE_ROOTDIR}/etc/suauth
+fi
# Configure sudoers:
chmod 640 ${LIVE_ROOTDIR}/etc/sudoers
+# Slackware 14.2:
sed -i ${LIVE_ROOTDIR}/etc/sudoers -e 's/# *\(%wheel\sALL=(ALL)\sALL\)/\1/'
+# Slackware 15.0:
+sed -i ${LIVE_ROOTDIR}/etc/sudoers -e 's/# *\(%wheel\sALL=(ALL:ALL)\sALL\)/\1/'
chmod 440 ${LIVE_ROOTDIR}/etc/sudoers
+# Also treat members of the 'wheel' group as admins next to root:
+mkdir -p ${LIVE_ROOTDIR}/etc/polkit-1/rules.d
+cat <<EOT > ${LIVE_ROOTDIR}/etc/polkit-1/rules.d/10-wheel-admin.rules
+polkit.addAdminRule(function(action, subject) {
+ return ["unix-group:wheel"];
+});
+EOT
+
+# Add some convenience to the bash shell:
+mkdir -p ${LIVE_ROOTDIR}/etc/skel/
+cat << "EOT" > ${LIVE_ROOTDIR}/etc/skel/.bashrc
+# If not running interactively, don't do anything
+[ -z "$PS1" ] && return
+# Check the window size after each command and, if necessary,
+# update the values of LINES and COLUMNS.
+shopt -s checkwinsize
+EOT
+cat << "EOT" > ${LIVE_ROOTDIR}/etc/skel/.profile
+# Source a .bashrc if it exists:
+[[ -r ~/.bashrc ]] && . ~/.bashrc
+
+# Define some useful aliases:
+alias ll="ls -la $LS_OPTIONS"
+lsp() { basename $(ls -1 "/var/log/packages/$@"*) ; }
+alias md="mkdir"
+alias tarview="tar -tvf"
+# GREP_OPTIONS="--color=auto" is deprecated, use alias to enable colored output:
+alias grep="grep --color=auto"
+alias fgrep="fgrep --color=auto"
+alias egrep="egrep --color=auto"
+
+# Ctrl-D should not log us off immediately; now it needs 10 times:
+set -o ignoreeof
+EOT
+
+# Do the root account the same favor:
+cat ${LIVE_ROOTDIR}/etc/skel/.profile > ${LIVE_ROOTDIR}/root/.profile
+chown root:root ${LIVE_ROOTDIR}/root/.profile
+
+# If the 'vi' symlink doees not exist, add it:
+if [ ! -e ${LIVE_ROOTDIR}/usr/bin/vi ]; then
+ if [ -x ${LIVE_ROOTDIR}/usr/bin/elvis ]; then
+ ln -s elvis ${LIVE_ROOTDIR}/usr/bin/vi
+ else
+ ln -s vim ${LIVE_ROOTDIR}/usr/bin/vi
+ fi
+fi
+
+# Add a screen configuration:
+cat <<"EOT" > ${LIVE_ROOTDIR}/etc/skel/.screenrc
+vbell on
+autodetach on
+startup_message off
+pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
+defscrollback 3000
+attrcolor b ".I"
+defbce "on"
+term xterm-256color
+shell -$SHELL
+
+# xterm:
+termcap xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
+terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
+termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l
+termcapinfo xterm* OL=10000
+termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l'
+termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
+termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
+termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
+termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l'
+termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
+termcapinfo xterm* be
+termcapinfo xterm* ti@:te@
+termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
+
+# vt100:
+termcap vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
+terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC
+termcapinfo linux C8
+
+# Tabbed colored hardstatus line
+hardstatus alwayslastline
+hardstatus string '%{= Kd} %{= Kd}%-w%{= Kr}[%{= KW}%n %t%{= Kr}]%{= Kd}%+w %-= %{KG} %H%{KW}|%{KY}%101`%{KW}|%D %M %d %Y%{= Kc} %C%A%{-}'
+# Hide hardstatus: ctrl-a f
+bind f eval "hardstatus ignore"
+# Show hardstatus: ctrl-a F
+bind F eval "hardstatus alwayslastline"
+EOT
+# Give root a copy:
+cat ${LIVE_ROOTDIR}/etc/skel/.screenrc > ${LIVE_ROOTDIR}/root/.screenrc
+
+if [ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.networkmanager ]; then
+ # Enable NetworkManager if present:
+ chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.networkmanager
+ # And disable Slackware's own way of configuring eth0:
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/rc.d/rc.inet1.conf
+IFNAME[0]="eth0"
+IPADDR[0]=""
+NETMASK[0]=""
+USE_DHCP[0]=""
+DHCP_HOSTNAME[0]=""
+
+GATEWAY=""
+DEBUG_ETH_UP="no"
+EOT
+
+ # Ensure that NetworkManager uses its internal DHCP client - seems to give
+ # better compliancy:
+ sed -e "s/^dhcp=dhcpcd/#&/" -e "s/^#\(dhcp=internal\)/\1/" \
+ -i ${LIVE_ROOTDIR}/etc/NetworkManager/conf.d/00-dhcp-client.conf
+
+else
+ # Use Slackware's own network configuration routing for eth0 in base image:
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/rc.d/rc.inet1.conf
+IFNAME[0]="eth0"
+IPADDR[0]=""
+NETMASK[0]=""
+USE_DHCP[0]="yes"
+DHCP_HOSTNAME[0]="${LIVE_HOSTNAME}"
+
+GATEWAY=""
+DEBUG_ETH_UP="no"
+EOT
+fi
+
+# First disable any potentially incorrect mirror for slackpkg:
+sed -e "s/^ *\([^#]\)/#\1/" -i ${LIVE_ROOTDIR}/etc/slackpkg/mirrors
# Enable a Slackware mirror for slackpkg:
cat <<EOT >> ${LIVE_ROOTDIR}/etc/slackpkg/mirrors
#http://mirrors.slackware.com/slackware/slackware${DIRSUFFIX}-${SL_VERSION}/
@@ -1474,6 +2116,10 @@ EOT
echo "-- Creating slackpkg cache, takes a few seconds..."
chroot "${LIVE_ROOTDIR}" /bin/bash <<EOSL 2>${DBGOUT}
+# Rebuild SSL certificate database to prevent GPG verification errors
+# which are in fact triggered by SSL certificate errors:
+/usr/sbin/update-ca-certificates --fresh 1>/dev/null
+
if [ -f var/log/packages/slackpkg+-* ] ; then
cat <<EOPL > etc/slackpkg/slackpkgplus.conf
SLACKPKGPLUS=on
@@ -1484,23 +2130,23 @@ WGETOPTS="--timeout=20 --tries=2"
GREYLIST=on
PKGS_PRIORITY=( restricted alienbob ktown mate )
REPOPLUS=( slackpkgplus restricted alienbob ktown mate )
-MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
+MIRRORPLUS['slackpkgplus']=https://slackware.nl/slackpkgplus/
MIRRORPLUS['restricted']=http://slackware.nl/people/alien/restricted_sbrepos/${SL_VERSION}/${SL_ARCH}/
MIRRORPLUS['alienbob']=http://slackware.nl/people/alien/sbrepos/${SL_VERSION}/${SL_ARCH}/
MIRRORPLUS['mate']=http://slackware.uk/msb/${SL_VERSION}/latest/${SL_ARCH}/
#MIRRORPLUS['studioware']=http://slackware.uk/studioware/${SL_VERSION}/
EOPL
# Use the appropriate ktown variant:
- eval $( grep "^ *VARIANT=" ${LIVE_TOOLDIR}/pkglists/plasma5.conf)
- if [ "$VARIANT" = "latest" ]; then
+ eval $( grep "^ *VARIANT=" ${LIVE_TOOLDIR}/pkglists/ktown.conf)
+ if [ "$VARIANT" = "testing" ]; then
cat <<EOPL >> etc/slackpkg/slackpkgplus.conf
-#MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/testing/${SL_ARCH}/
-MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/latest/${SL_ARCH}/
+#MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/latest/${SL_ARCH}/
+MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/testing/${SL_ARCH}/
EOPL
else
cat <<EOPL >> etc/slackpkg/slackpkgplus.conf
-#MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/latest/${SL_ARCH}/
-MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/testing/${SL_ARCH}/
+#MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/testing/${SL_ARCH}/
+MIRRORPLUS['ktown']=http://slackware.nl/alien-kde/${SL_VERSION}/latest/${SL_ARCH}/
EOPL
fi
fi
@@ -1511,50 +2157,16 @@ if [ "${SL_VERSION}" = "current" ]; then
touch /var/lib/slackpkg/current
fi
-ARCH=${SL_ARCH} /usr/sbin/slackpkg -batch=on update gpg
-ARCH=${SL_ARCH} /usr/sbin/slackpkg -batch=on update
+ARCH=${SL_ARCH} /usr/sbin/slackpkg -batch=on -default_answer=y update gpg
+ARCH=${SL_ARCH} /usr/sbin/slackpkg -batch=on -default_answer=y update
# Let any lingering .new files replace their originals:
yes o | ARCH=${SL_ARCH} /usr/sbin/slackpkg new-config
EOSL
-if [ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.networkmanager ]; then
- # Enable NetworkManager if present:
- chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.networkmanager
- # And disable Slackware's own way of configuring eth0:
- cat <<EOT > ${LIVE_ROOTDIR}/etc/rc.d/rc.inet1.conf
-IFNAME[0]="eth0"
-IPADDR[0]=""
-NETMASK[0]=""
-USE_DHCP[0]=""
-DHCP_HOSTNAME[0]=""
-
-GATEWAY=""
-DEBUG_ETH_UP="no"
-EOT
-
- # Ensure that NetworkManager uses its internal DHCP client - seems to give
- # better compliancy:
- sed -e "s/^dhcp=dhcpcd/#&/" -e "s/^#\(dhcp=internal\)/\1/" \
- -i ${LIVE_ROOTDIR}/etc/NetworkManager/NetworkManager.conf
-
-else
- # Use Slackware's own network configurion routing for eth0 in the base image:
- cat <<EOT > ${LIVE_ROOTDIR}/etc/rc.d/rc.inet1.conf
-IFNAME[0]="eth0"
-IPADDR[0]=""
-NETMASK[0]=""
-USE_DHCP[0]="yes"
-DHCP_HOSTNAME[0]="${LIVE_HOSTNAME}"
-
-GATEWAY=""
-DEBUG_ETH_UP="no"
-EOT
-fi
-
# Add our scripts to the Live OS:
mkdir -p ${LIVE_ROOTDIR}/usr/local/sbin
-install -m0755 ${LIVE_TOOLDIR}/makemod ${LIVE_TOOLDIR}/iso2usb.sh ${LIVE_TOOLDIR}/upslak.sh ${LIVE_ROOTDIR}/usr/local/sbin/
+install -m0755 ${LIVE_TOOLDIR}/makemod ${LIVE_TOOLDIR}/iso2usb.sh ${LIVE_TOOLDIR}/isocomp.sh ${LIVE_TOOLDIR}/upslak.sh ${LIVE_ROOTDIR}/usr/local/sbin/
# Add PXE Server infrastructure:
mkdir -p ${LIVE_ROOTDIR}/var/lib/tftpboot/pxelinux.cfg
@@ -1573,19 +2185,21 @@ cat ${LIVE_TOOLDIR}/pxeserver.tpl | sed \
-e "s/@LIVEDE@/$LIVEDE/g" \
-e "s/@LIVEMAIN@/$LIVEMAIN/g" \
-e "s/@MARKER@/$MARKER/g" \
+ -e "s/@KAPPEND@/$KAPPEND/g" \
-e "s/@SL_VERSION@/$SL_VERSION/g" \
-e "s/@VERSION@/$VERSION/g" \
> ${LIVE_ROOTDIR}/usr/local/sbin/pxeserver
chmod 755 ${LIVE_ROOTDIR}/usr/local/sbin/pxeserver
-# Only when we find a huge kernel, we will add a harddisk installer
-# to the ISO. The huge kernel does not require an initrd and installation
-# to the hard drive will not be complicated.
-if ls ${LIVE_ROOTDIR}/boot/vmlinuz-huge-* 1>/dev/null 2>/dev/null; then
- if [ -f ${DEF_SL_PKGROOT}/../isolinux/initrd.img ]; then
+# Add a harddisk installer to the ISO.
+# The huge kernel does not require an initrd and installation to the
+# hard drive will not be complicated, so a liveslak install is recommended
+# for newbies only if the ISO contains huge kernel...
+if [ -f ${DEF_SL_PKGROOT}/../isolinux/initrd.img ]; then
+ echo "-- Adding 'setup2hd' hard disk installer to /usr/share/${LIVEMAIN}/."
# Extract the 'setup' files we need from the Slackware installer
# and move them to a single directory in the ISO:
- mkdir -p ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}
+ mkdir -p ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}
cd ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}
uncompressfs ${DEF_SL_PKGROOT}/../isolinux/initrd.img | cpio -i -d -m -H newc usr/lib/setup/* sbin/probe sbin/fixdate
mv -i usr/lib/setup/* sbin/probe sbin/fixdate .
@@ -1599,6 +2213,10 @@ if ls ${LIVE_ROOTDIR}/boot/vmlinuz-huge-* 1>/dev/null 2>/dev/null; then
-e 's, /mnt, ${T_PX},g' \
-e 's,=/mnt$,=${T_PX},g' \
-e 's,=/mnt/,=${T_PX}/,g'
+ # Allow a choice of dialog:
+ sed -i ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/* \
+ -e '1a \\nDIALOG=${DIALOG:-dialog}\n' \
+ -e 's/dialog -/${DIALOG} -/'
# If T_PX is used in a script, it should be defined first:
for FILE in ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/* ; do
if grep -q T_PX $FILE ; then
@@ -1638,7 +2256,28 @@ if ls ${LIVE_ROOTDIR}/boot/vmlinuz-huge-* 1>/dev/null 2>/dev/null; then
fi
# Fix some occurrences of '/usr/lib/setup/' that are covered by $PATH:
sed -i -e 's,/usr/lib/setup/,,g' -e 's,:/usr/lib/setup,:/usr/share/${LIVEMAIN},g' ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/*
- # Add the Slackware Live HD installer:
+ # Prevent SeTconfig from asking redundant questions after a Live OS install:
+ sed -i ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/SeTconfig \
+ -e '/.\/var\/log\/setup\/$SCRIPT $T_PX $ROOT_DEVICE/i # Skip stuff that was taken care of by liveslak\nif [ -f $TMP/SeTlive ] && echo $SCRIPT |grep -qE "(make-bootdisk|mouse|setconsolefont|xwmconfig)"; then true; else' \
+ -e '/.\/var\/log\/setup\/$SCRIPT $T_PX $ROOT_DEVICE/a fi'
+ # Add the Slackware Live HD installer scripts:
+ for USCRIPT in SeTuacct SeTudiskpart SeTumedia SeTupass SeTpasswd SeTfirewall rc.firewall setup.liveslak setup.slackware ; do
+ cat ${LIVE_TOOLDIR}/setup2hd/${USCRIPT}.tpl | sed \
+ -e "s/@DIRSUFFIX@/$DIRSUFFIX/g" \
+ -e "s/@DISTRO@/$DISTRO/g" \
+ -e "s/@CDISTRO@/${DISTRO^}/g" \
+ -e "s/@UDISTRO@/${DISTRO^^}/g" \
+ -e "s/@KVER@/$KVER/g" \
+ -e "s/@LIVEDE@/$LIVEDE/g" \
+ -e "s/@LIVEMAIN@/$LIVEMAIN/g" \
+ -e "s/@LIVEUID@/$LIVEUID/g" \
+ -e "s/@LIVEUIDNR@/$LIVEUIDNR/g" \
+ -e "s/@MARKER@/$MARKER/g" \
+ -e "s/@SL_VERSION@/$SL_VERSION/g" \
+ -e "s/@VERSION@/$VERSION/g" \
+ > ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${USCRIPT}
+ chmod 755 ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/${USCRIPT}
+ done
mkdir -p ${LIVE_ROOTDIR}/usr/local/sbin
cat ${LIVE_TOOLDIR}/setup2hd.tpl | sed \
-e "s/@DIRSUFFIX@/$DIRSUFFIX/g" \
@@ -1648,15 +2287,17 @@ if ls ${LIVE_ROOTDIR}/boot/vmlinuz-huge-* 1>/dev/null 2>/dev/null; then
-e "s/@KVER@/$KVER/g" \
-e "s/@LIVEDE@/$LIVEDE/g" \
-e "s/@LIVEMAIN@/$LIVEMAIN/g" \
+ -e "s/@LIVEUID@/$LIVEUID/g" \
+ -e "s/@LIVEUIDNR@/$LIVEUIDNR/g" \
-e "s/@MARKER@/$MARKER/g" \
-e "s/@SL_VERSION@/$SL_VERSION/g" \
-e "s/@VERSION@/$VERSION/g" \
> ${LIVE_ROOTDIR}/usr/local/sbin/setup2hd
chmod 755 ${LIVE_ROOTDIR}/usr/local/sbin/setup2hd
# Slackware Live HD post-install customization hook:
- if [ -f ${LIVE_TOOLDIR}/setup2hd.local ]; then
+ if [ -f ${LIVE_TOOLDIR}/setup2hd.local.tpl ]; then
# The '.local' suffix means: install it as a sample file only:
- HOOK_SRC="${LIVE_TOOLDIR}/setup2hd.local"
+ HOOK_SRC="${LIVE_TOOLDIR}/setup2hd.local.tpl"
HOOK_DST="${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/setup2hd.$DISTRO.sample"
elif [ -f ${LIVE_TOOLDIR}/setup2hd.$DISTRO ]; then
# Install the hook; the file will be sourced by "setup2hd".
@@ -1678,7 +2319,6 @@ if ls ${LIVE_ROOTDIR}/boot/vmlinuz-huge-* 1>/dev/null 2>/dev/null; then
chmod 644 ${HOOK_DST}
else
echo "-- Could not find ${DEF_SL_PKGROOT}/../isolinux/initrd.img - not adding 'setup2hd'!"
- fi
fi
# Add the documentation:
@@ -1686,7 +2326,7 @@ mkdir -p ${LIVE_ROOTDIR}/usr/doc/liveslak-${VERSION}
install -m0644 ${LIVE_TOOLDIR}/README* ${LIVE_ROOTDIR}/usr/doc/liveslak-${VERSION}/
mkdir -p ${LIVE_ROOTDIR}/usr/doc/${DISTRO}${DIRSUFFIX}-${SL_VERSION}
install -m0644 \
- ${DEF_SL_PKGROOT}/../{CHANGES_AND_HINTS,COPY,README,RELEASE_NOTES,*HOWTO}* \
+ ${DEF_SL_PKGROOT}/../{ANNOUNCE,CHANGES_AND_HINTS,COPY,CRYPTO,README,RELEASE_NOTES,SPEAK,*HOWTO,UPGRADE}* \
${DEF_SL_PKGROOT}/../usb-and-pxe-installers/README* \
${LIVE_ROOTDIR}/usr/doc/${DISTRO}${DIRSUFFIX}-${SL_VERSION}/
@@ -1698,35 +2338,18 @@ echo "-- Configuring the X base system."
sed -i -e '/^c3\|^c4\|^c5\|^c6/s/^/# /' ${LIVE_ROOTDIR}/etc/inittab
# Give the 'live' user a face:
-cp ${LIVE_TOOLDIR}/blueSW-64px.png ${LIVE_ROOTDIR}/home/${LIVEUID}/.face.icon
+if [ -f "${LIVE_TOOLDIR}/media/${LIVEDE,,}/icons/default.png" ]; then
+ # Use custom face icon if available for the Live variant:
+ FACE_ICON="${LIVE_TOOLDIR}/media/${LIVEDE,,}/icons/default.png"
+else
+ # Use the default Slackware blue 'S':
+ FACE_ICON="${LIVE_TOOLDIR}/blueSW-64px.png"
+fi
+convert ${FACE_ICON} -resize 64x64 - >${LIVE_ROOTDIR}/home/${LIVEUID}/.face.icon
chown --reference=${LIVE_ROOTDIR}/home/${LIVEUID} ${LIVE_ROOTDIR}/home/${LIVEUID}/.face.icon
( cd ${LIVE_ROOTDIR}/home/${LIVEUID}/ ; ln .face.icon .face )
mkdir -p ${LIVE_ROOTDIR}/usr/share/apps/kdm/pics/users
-cp ${LIVE_TOOLDIR}/blueSW-64px.png ${LIVE_ROOTDIR}/usr/share/apps/kdm/pics/users/blues.icon
-
-# Add some convenience to the bash shell:
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/
-cat << "EOT" > ${LIVE_ROOTDIR}/etc/skel/.profile
-# Source a .bashrc if it exists:
-[[ -r ~/.bashrc ]] && . ~/.bashrc
-
-# Define some useful aliases:
-alias ll="ls -la $LS_OPTIONS"
-lsp() { basename $(ls -1 "/var/log/packages/$@"*) ; }
-alias md="mkdir"
-alias tarview="tar -tvf"
-# GREP_OPTIONS="--color=auto" is deprecated, use alias to enable colored output:
-alias grep="grep --color=auto"
-alias fgrep="fgrep --color=auto"
-alias egrep="egrep --color=auto"
-
-# Ctrl-D should not log us off immediately; now it needs 10 times:
-set -o ignoreeof
-EOT
-
-# Do the root account the same favor:
-cat ${LIVE_ROOTDIR}/etc/skel/.profile > ${LIVE_ROOTDIR}/root/.profile
-chown root:root ${LIVE_ROOTDIR}/root/.profile
+convert ${FACE_ICON} -resize 64x64 - >${LIVE_ROOTDIR}/usr/share/apps/kdm/pics/users/blues.icon
# Give XDM a nicer look:
mkdir -p ${LIVE_ROOTDIR}/etc/X11/xdm/liveslak-xdm
@@ -1736,13 +2359,22 @@ sed -i ${LIVE_ROOTDIR}/etc/rc.d/rc.4 -e 's,bin/xdm -nodaemon,& -config /etc/X11/
# Adapt xdm configuration to target architecture:
sed -i "s/@LIBDIR@/lib${DIRSUFFIX}/g" ${LIVE_ROOTDIR}/etc/X11/xdm/liveslak-xdm/xdm-config
+# XDM needs a C preprocessor to calculate the login box position, and if
+# the ISO contains mcpp instead of the cpp contained in full gcc, we will
+# create a symlink (don't forget to install mcpp of course!):
+if [ ! -e ${LIVE_ROOTDIR}/usr/bin/cpp ] && [ -x ${LIVE_ROOTDIR}/usr/bin/mcpp ];
+then
+ ln -s mcpp ${LIVE_ROOTDIR}/usr/bin/cpp
+fi
+
# The Xscreensaver should show a blank screen only, to prevent errors about
# missing modules:
echo "mode: blank" > ${LIVE_ROOTDIR}/home/${LIVEUID}/.xscreensaver
-# Make the EmojiOne TTF font universally available:
-mkdir -p ${LIVE_ROOTDIR}/etc/fonts
-cat << EOT > ${LIVE_ROOTDIR}/etc/fonts/local.conf
+if [ -x ${LIVE_ROOTDIR}/usr/bin/fc-cache ]; then
+ # Make the EmojiOne TTF font universally available:
+ mkdir -p ${LIVE_ROOTDIR}/etc/fonts
+ cat << EOT > ${LIVE_ROOTDIR}/etc/fonts/local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to customize system font access -->
@@ -1751,7 +2383,62 @@ cat << EOT > ${LIVE_ROOTDIR}/etc/fonts/local.conf
<dir>/usr/lib${DIRSUFFIX}/firefox/fonts</dir>
</fontconfig>
EOT
-chroot ${LIVE_ROOTDIR} fc-cache -f
+ chroot ${LIVE_ROOTDIR} fc-cache -f
+fi
+
+# Allow direct scanning via xsane (no temporary intermediate files) in Gimp:
+if [ ! -L ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/gimp/2.0/plug-ins/xsane ]; then
+ mkdir -p ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/gimp/2.0/plug-ins
+ ln -s /usr/bin/xsane \
+ ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/gimp/2.0/plug-ins/xsane
+fi
+
+## Enable this only after we checked all dialog calls for compatibility ##
+## If Xdialog is installed, set DIALOG environment variable: ##
+mkdir -p ${LIVE_ROOTDIR}/etc/profile.d
+cat <<EOT > ${LIVE_ROOTDIR}/etc/profile.d/dialog.sh
+#!/bin/sh
+if [ -x /usr/bin/Xdialog ]; then
+ DIALOG=Xdialog
+ XDIALOG_HIGH_DIALOG_COMPAT=1
+ XDIALOG_FORCE_AUTOSIZE=1
+ export DIALOG XDIALOG_HIGH_DIALOG_COMPAT XDIALOG_FORCE_AUTOSIZE
+fi
+EOT
+cat <<EOT > ${LIVE_ROOTDIR}/etc/profile.d/dialog.csh
+#!/bin/csh
+if (-x /usr/bin/Xdialog) then
+ setenv DIALOG Xdialog
+ setenv XDIALOG_HIGH_DIALOG_COMPAT 1
+ setenv XDIALOG_FORCE_AUTOSIZE 1
+endif
+EOT
+# Once we are certain this works, make the scripts executable:
+chmod 0644 ${LIVE_ROOTDIR}/etc/profile.d/dialog.{c,}sh
+
+# Add a shortcut to 'setup2hd' on the user's desktop:
+mkdir -p ${LIVE_ROOTDIR}/usr/share/pixmaps
+install -m 0644 ${LIVE_TOOLDIR}/media/slackware/icons/graySW_512px.png \
+ ${LIVE_ROOTDIR}/usr/share/pixmaps/liveslak.png
+mkdir -p ${LIVE_ROOTDIR}/home/${LIVEUID}/Desktop
+cat <<EOT > ${LIVE_ROOTDIR}/home/${LIVEUID}/Desktop/.directory
+[Desktop Entry]
+Encoding=UTF-8
+Icon=user-desktop
+Type=Directory
+EOT
+cat <<EOT > ${LIVE_ROOTDIR}/home/${LIVEUID}/Desktop/setup2hd.desktop
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Type=Application
+Terminal=true
+Name=Install ${DISTRO^}
+Comment=Install ${DISTRO^} (live or regular) to Harddisk
+Icon=/usr/share/pixmaps/liveslak.png
+Exec=sudo -i /usr/local/sbin/setup2hd
+EOT
+# Let Plasma5 trust the desktop shortcut:
+chmod 0544 ${LIVE_ROOTDIR}/home/${LIVEUID}/Desktop/setup2hd.desktop
# -------------------------------------------------------------------------- #
@@ -1766,53 +2453,90 @@ for SKEL in ${LIVE_TOOLDIR}/skel/skel*.txz ; do
tar -xf ${SKEL} -C ${LIVE_ROOTDIR}/etc/skel/
done
-# -------------------------------------------------------------------------- #
-echo "-- Configuring KDE4."
-# -------------------------------------------------------------------------- #
-
-# Adjust some usability issues with the default desktop layout:
-if [ -f ${LIVE_ROOTDIR}/usr/share/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js ]; then
- # Only apply to an unmodified file (Slackware 14.2 already implements it):
- if grep -q 'tasks.writeConfig' ${LIVE_ROOTDIR}/usr/share/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js ; then
- sed -i \
- -e '/showActivityManager/a konsole = panel.addWidget("quicklaunch")' \
- -e '/showActivityManager/a dolphin = panel.addWidget("quicklaunch")' \
- -e '/showActivityManager/a firefox = panel.addWidget("quicklaunch")' \
- -e '$a firefox.writeConfig("iconUrls","file:///usr/share/applications/mozilla-firefox.desktop")' \
- -e '$a dolphin.writeConfig("iconUrls","file:////usr/share/applications/kde4/dolphin.desktop")' \
- -e '$a konsole.writeConfig("iconUrls","file:///usr/share/applications/kde4/konsole.desktop")' \
- -e '/tasks.writeConfig/d' \
- ${LIVE_ROOTDIR}/usr/share/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js
+if [ "$LIVEDE" = "XFCE" ]; then
+ # Since the XFCE ISO no longer has xpdf, use Firefox as the PDF viewer
+ # if that is present:
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config
+ if [ -f ${LIVE_ROOTDIR}/usr/bin/firefox ]; then
+ cat << EOF > ${LIVE_ROOTDIR}/etc/skel/.config/mimeapps.list
+[Default Applications]
+application/pdf=mozilla-firefox.desktop
+EOF
+ else
+ # If firefox is not present, we hope that seamonkey is there;
+ # you won't have a PDF viewer in that case unfortunately, but you could
+ # download https://github.com/IsaacSchemm/pdf.js-seamonkey :
+ cat << EOF > ${LIVE_ROOTDIR}/etc/skel/.config/mimeapps.list
+[Default Applications]
+x-scheme-handler/http=seamonkey.desktop
+x-scheme-handler/https=seamonkey.desktop
+x-scheme-handler/ftp=seamonkey.desktop
+x-scheme-handler/chrome=seamonkey.desktop
+x-scheme-handler/mailto=seamonkey-mail.desktop
+text/html=seamonkey.desktop
+
+[Added Associations]
+x-scheme-handler/http=xfce4-web-browser.desktop;seamonkey.desktop;
+x-scheme-handler/https=xfce4-web-browser.desktop;seamonkey.desktop;
+x-scheme-handler/ftp=seamonkey.desktop;
+x-scheme-handler/chrome=seamonkey.desktop;
+x-scheme-handler/mailto=seamonkey.desktop;
+text/html=seamonkey.desktop;
+EOF
fi
fi
-# Prepare some KDE4 defaults for the 'live' user and any new users.
-# Preselect the user 'live' in KDM:
-mkdir -p ${LIVE_ROOTDIR}/var/lib/kdm
-cat <<EOT > ${LIVE_ROOTDIR}/var/lib/kdm/kdmsts
+# Only configure for KDE4 if it is actually installed:
+if [ -d ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/kde4/libexec ]; then
+
+ # -------------------------------------------------------------------------- #
+ echo "-- Configuring KDE4."
+ # -------------------------------------------------------------------------- #
+
+ # Adjust some usability issues with the default desktop layout:
+ if [ -f ${LIVE_ROOTDIR}/usr/share/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js ]; then
+ # Only apply to an unmodified file (Slackware 14.2 already implements it):
+ if grep -q 'tasks.writeConfig' ${LIVE_ROOTDIR}/usr/share/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js ; then
+ sed -i \
+ -e '/showActivityManager/a konsole = panel.addWidget("quicklaunch")' \
+ -e '/showActivityManager/a dolphin = panel.addWidget("quicklaunch")' \
+ -e '/showActivityManager/a firefox = panel.addWidget("quicklaunch")' \
+ -e '$a firefox.writeConfig("iconUrls","file:///usr/share/applications/mozilla-firefox.desktop")' \
+ -e '$a dolphin.writeConfig("iconUrls","file:////usr/share/applications/kde4/dolphin.desktop")' \
+ -e '$a konsole.writeConfig("iconUrls","file:///usr/share/applications/kde4/konsole.desktop")' \
+ -e '/tasks.writeConfig/d' \
+ ${LIVE_ROOTDIR}/usr/share/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js
+ fi
+ fi
+
+ # Prepare some KDE4 defaults for the 'live' user and any new users.
+
+ # Preselect the user 'live' in KDM:
+ mkdir -p ${LIVE_ROOTDIR}/var/lib/kdm
+ cat <<EOT > ${LIVE_ROOTDIR}/var/lib/kdm/kdmsts
[PrevUser]
:0=${LIVEUID}
EOT
-chmod 600 ${LIVE_ROOTDIR}/var/lib/kdm/kdmsts
+ chmod 600 ${LIVE_ROOTDIR}/var/lib/kdm/kdmsts
-# Set default GTK+ theme for Qt applications:
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/
-cat << EOF > ${LIVE_ROOTDIR}/etc/skel/.gtkrc-2.0
+ # Set default GTK+ theme for Qt applications:
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/
+ cat << EOF > ${LIVE_ROOTDIR}/etc/skel/.gtkrc-2.0
include "/usr/share/themes/Adwaita/gtk-2.0/gtkrc"
include "/usr/share/gtk-2.0/gtkrc"
include "/etc/gtk-2.0/gtkrc"
gtk-theme-name="Adwaita"
EOF
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config/gtk-3.0
-cat << EOF > ${LIVE_ROOTDIR}/etc/skel/.config/gtk-3.0/settings.ini
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config/gtk-3.0
+ cat << EOF > ${LIVE_ROOTDIR}/etc/skel/.config/gtk-3.0/settings.ini
[Settings]
gtk-theme-name = Adwaita
EOF
-# Be gentle to low-performance USB media and limit disk I/O:
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde/share/config
-cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.kde/share/config/nepomukserverrc
+ # Be gentle to low-performance USB media and limit disk I/O:
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde/share/config
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.kde/share/config/nepomukserverrc
[Basic Settings]
Configured repositories=main
Start Nepomuk=false
@@ -1826,15 +2550,15 @@ Used Soprano Backend=redlandbackend
rebuilt index for type indexing=true
EOT
-# Disable baloo:
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde4/share/apps/config
-cat <<EOT >${LIVE_ROOTDIR}/etc/skel/.kde4/share/apps/config/baloofilerc
+ # Disable baloo:
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde4/share/apps/config
+ cat <<EOT >${LIVE_ROOTDIR}/etc/skel/.kde4/share/apps/config/baloofilerc
[Basic Settings]
Indexing-Enabled=false
EOT
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config
-cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.config/kwalletrc
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.config/kwalletrc
[Auto Allow]
kdewallet=Network Management,KDE Daemon,KDE Control Module
@@ -1845,24 +2569,24 @@ First Use=true
Use One Wallet=true
EOT
-# Start Konsole with a login shell:
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde/share/apps/konsole
-cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.kde/share/apps/konsole/Shell.profile
+ # Start Konsole with a login shell:
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde/share/apps/konsole
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.kde/share/apps/konsole/Shell.profile
[General]
Command=/bin/bash -l
Name=Shell
Parent=FALLBACK/
EOT
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config
-cat <<EOT >> ${LIVE_ROOTDIR}/etc/skel/.config/konsolerc
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config
+ cat <<EOT >> ${LIVE_ROOTDIR}/etc/skel/.config/konsolerc
[Desktop Entry]
DefaultProfile=Shell.profile
EOT
-# Configure (default) UTC timezone so we can change it during boot:
-mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde/share/config
-cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.kde/share/config/ktimezonedrc
+ # Configure (default) UTC timezone so we can change it during boot:
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.kde/share/config
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.kde/share/config/ktimezonedrc
[TimeZones]
LocalZone=UTC
ZoneinfoDir=/usr/share/zoneinfo
@@ -1870,24 +2594,44 @@ Zonetab=/usr/share/zoneinfo/zone.tab
ZonetabCache=
EOT
-if [ "$LIVEDE" = "PLASMA5" ]; then
+fi # End KDE4
+
+
+# Only configure for KDE Plasma if it is actually installed:
+if [ -d ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/libexec/kf5 ] || [ -d ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/libexec/kf6 ] ; then
# -------------------------------------------------------------------------- #
- echo "-- Configuring PLASMA5."
+ echo "-- Configuring Plasma Desktop."
# -------------------------------------------------------------------------- #
+ # This section is for any Plasma based variant.
+
+ # Install a custom login/desktop/lock background if an image is present:
+ plasma5_custom_bg
+
# Remove the confusing openbox session if present:
rm -f ${LIVE_ROOTDIR}/usr/share/xsessions/openbox-session.desktop || true
# Remove the buggy mediacenter session:
rm -f ${LIVE_ROOTDIR}/usr/share/xsessions/plasma-mediacenter.desktop || true
- # Remove non-functional wayland session:
+ # Remove non-functional Qt5 wayland session:
if [ ! -f ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/qt5/bin/qtwaylandscanner ];
then
rm -f ${LIVE_ROOTDIR}/usr/share/wayland-sessions/plasmawayland.desktop || true
fi
+ # Remove broken/unwanted shortcuts (discover and konqueror) from taskbar:
+ sed -i ${LIVE_ROOTDIR}/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml \
+ -e 's#,applications:org.kde.discover.desktop##' \
+ -e s'#,preferred://browser##'
+
# Set the OS name to "Slackware Live" in "System Information":
echo "Name=${DISTRO^} Live" >> ${LIVE_ROOTDIR}/etc/kde/xdg/kcm-about-distrorc
+ # Use os-release's VERSION (default=false means: use VERSION_ID)
+ echo "UseOSReleaseVersion=true" >> ${LIVE_ROOTDIR}/etc/kde/xdg/kcm-about-distrorc
+ if [ "${SL_VERSION}" = "current" ]; then
+ # Some more detail on development release:
+ echo "Variant=Post-stable development (-current)" >> ${LIVE_ROOTDIR}/etc/kde/xdg/kcm-about-distrorc
+ fi
# Set sane SDDM defaults on first boot (root-owned file):
mkdir -p ${LIVE_ROOTDIR}/var/lib/sddm
@@ -1915,13 +2659,25 @@ EOT
super-user-command=sudo
KDESU_EOF
+ # For the above to work in Plasma with newer versions of sudo (since 2022),
+ # we need the following also. KDE fixed this in git on 04-aug-2023, see
+ # https://bugs.kde.org/show_bug.cgi?id=452532 but it does not hurt to have
+ # it here, and it helps to support older KDE releases:
+ if [ -x ${LIVE_ROOTDIR}/usr/lib*/libexec/kf5/kdesu_stub ]; then
+ mkdir -p ${LIVE_ROOTDIR}/etc/sudoers.d
+ chmod 750 ${LIVE_ROOTDIR}/etc/sudoers.d
+ cat <<KDESU_EOF2 >${LIVE_ROOTDIR}/etc/sudoers.d/kdesu
+Defaults!/usr/lib*/libexec/kf5/kdesu_stub !use_pty
+KDESU_EOF2
+ fi
+
# Set akonadi backend:
cat <<AKONADI_EOF >${LIVE_ROOTDIR}/etc/skel/.config/akonadi/akonadiserverrc
[%General]
Driver=QSQLITE
[QSQLITE]
-Name=/home/live/.local/share/akonadi/akonadi.db
+Name=/home/${LIVEUID}/.local/share/akonadi/akonadi.db
AKONADI_EOF
# Disable baloo:
@@ -1943,6 +2699,30 @@ alreadyMigrated=true
KWALLET_EOL
+ # Start Konsole with a login shell:
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.local/share/konsole
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/skel/.local/share/konsole/Shell.profile
+[Appearance]
+ColorScheme=BlackOnWhite
+
+[General]
+Command=/bin/bash -l
+Name=Shell
+Parent=FALLBACK/
+TerminalColumns=80
+TerminalRows=25
+
+[Interaction Options]
+AutoCopySelectedText=true
+TrimTrailingSpacesInSelectedText=true
+EOT
+ mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config
+ cat <<EOT >> ${LIVE_ROOTDIR}/etc/skel/.config/konsolerc
+[Desktop Entry]
+DefaultProfile=Shell.profile
+
+EOT
+
# Configure (default) UTC timezone so we can change it during boot:
mkdir -p ${LIVE_ROOTDIR}/etc/skel/.config
cat <<EOTZ > ${LIVE_ROOTDIR}/etc/skel/.config/ktimezonedrc
@@ -1953,8 +2733,9 @@ Zonetab=/usr/share/zoneinfo/zone.tab
EOTZ
# Make sure that Plasma and SDDM work on older GPUs,
- # by forcing Qt5 to use software GL rendering:
- cat <<"EOGL" >> ${LIVE_ROOTDIR}/usr/share/sddm/scripts/Xsetup
+ # by forcing Qt to use software GL rendering:
+ if ! grep -q QT_XCB_FORCE_SOFTWARE_OPENGL ${LIVE_ROOTDIR}/usr/share/sddm/scripts/Xsetup ; then
+ cat <<"EOGL" >> ${LIVE_ROOTDIR}/usr/share/sddm/scripts/Xsetup
OPENGL_VERSION=$(LANG=C glxinfo |grep '^OpenGL version string: ' |head -n 1 |sed -e 's/^OpenGL version string: \([0-9]\).*$/\1/g')
if [ "$OPENGL_VERSION" -lt 2 ]; then
@@ -1963,11 +2744,24 @@ if [ "$OPENGL_VERSION" -lt 2 ]; then
fi
EOGL
+ fi
+
+ # Make Wayland instead of X11 the default for SDDM;
+ # leave commented-out for now:
+ mkdir -p ${LIVE_ROOTDIR}/etc/sddm.conf.d
+ cat << EOW > ${LIVE_ROOTDIR}/etc/sddm.conf.d/plasma-wayland.conf
+#[General]
+#DisplayServer=wayland
+#GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell
+#
+#[Wayland]
+#CompositorCommand=kwin_wayland --drm --inputmethod qtvirtualkeyboard --no-global-shortcuts --no-lockscreen --locale1
+EOW
# Workaround a bug where SDDM does not always use the configured keymap:
echo "setxkbmap" >> ${LIVE_ROOTDIR}/usr/share/sddm/scripts/Xsetup
- # Do not show the blueman applet, Plasma5 has its own BlueTooth widget:
+ # Do not show the blueman applet, Plasma has its own BlueTooth widget:
echo "NotShowIn=KDE;" >> ${LIVE_ROOTDIR}/etc/xdg/autostart/blueman.desktop
# Set QtWebkit as the Konqueror rendering engine if available:
@@ -1981,7 +2775,57 @@ text/html=kwebkitpart.desktop;
EOT
fi
-fi # End LIVEDE = PLASMA5
+ # Requirement for Plasma Wayland sessions:
+ mkdir -p ${LIVE_ROOTDIR}/etc/profile.d
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/profile.d/kwayland.sh
+#!/bin/sh
+# Force the usage of XCB platform on Qt applications:
+export QT_QPA_PLATFORM=xcb
+# Force the usage of X11 platform for GDK applications:
+export GDK_BACKEND=x11
+EOT
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/profile.d/kwayland.csh
+#!/bin/csh
+# Force the usage of XCB platform on Qt applications:
+setenv QT_QPA_PLATFORM xcb
+# Force the usage of X11 platform for GDK applications:
+setenv GDK_BACKEND x11
+EOT
+ chmod 755 ${LIVE_ROOTDIR}/etc/profile.d/kwayland.*
+
+# Ensure that color Emojis work in Qt applications:
+mkdir -p ${LIVE_ROOTDIR}/usr/share/fontconfig/conf.avail
+cat <<EOT >${LIVE_ROOTDIR}/usr/share/fontconfig/conf.avail/99-noto-mono-color-emoji.conf:
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+ <alias>
+ <family>serif</family>
+ <prefer>
+ <family>Noto Color Emoji</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>sans-serif</family>
+ <prefer>
+ <family>Noto Color Emoji</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>monospace</family>
+ <prefer>
+ <family>Noto Color Emoji</family>
+ </prefer>
+ </alias>
+</fontconfig>
+EOT
+
+ if [ "$LIVEDE" = "DAW" ] || [ "$LIVEDE" = "LEAN" ]; then
+ # These lean installations do not support Wayland graphical sessions:
+ rm -rf ${LIVE_ROOTDIR}/usr/share/wayland-sessions
+ fi
+
+fi # End Plasma
if [ "$LIVEDE" = "DLACK" ]; then
@@ -2006,6 +2850,133 @@ if [ "$LIVEDE" = "DLACK" ]; then
fi # End LIVEDE = DLACK
+if [ "$LIVEDE" = "DAW" ]; then
+
+ # -------------------------------------------------------------------------- #
+ echo "-- Configuring DAW."
+ # -------------------------------------------------------------------------- #
+
+ # Stream ALSA through Pulse and all through Jack. This is achieved by
+ # having pulseaudio-jack module installed and starting jack-dbus:
+
+ # We default to using a 48000 Hz sample rate throughout, assuming that
+ # modern sound hardware will support this, and it lowers the latency:
+ if [ -f ${LIVE_ROOTDIR}/etc/pulse/daemon.conf ]; then
+ cat <<EOT >> ${LIVE_ROOTDIR}/etc/pulse/daemon.conf
+; Run 'pulseaudio --dump-resample-methods' for all possible options.
+; We want higher-quality resampling than the default:
+resample-method = speex-float-9
+; Jack is configured for 48KHz so let's make pulseaudio use it too:
+default-sample-rate = 48000
+alternate-sample-rate = 44100
+EOT
+ fi
+
+ mkdir -p ${LIVE_ROOTDIR}/home/${LIVEUID}/.config/rncbc.org
+ cat <<EOT > ${LIVE_ROOTDIR}/home/${LIVEUID}/.config/rncbc.org/QjackCtl.conf
+[Options]
+DBusEnabled=true
+GraphButton=true
+JackDBusEnabled=true
+KeepOnTop=false
+PostShutdownScript=true
+PostShutdownScriptShell=killall a2jmidid &
+PostStartupScript=true
+PostStartupScriptShell=/usr/bin/a2jmidid -e &
+ServerConfig=true
+ServerConfigName=.jackdrc
+ShutdownScript=false
+ShutdownScriptShell=
+Singleton=true
+StartJack=true
+StartMinimized=true
+StartupScript=false
+StartupScriptShell=
+StopJack=true
+SystemTray=true
+SystemTrayQueryClose=false
+XrunRegex=xrun of at least ([0-9|\\.]+) msecs
+
+[Presets]
+DefPreset=(default)
+
+[Settings]
+Driver=alsa
+Frames=256
+MidiDriver=seq
+Periods=2
+PortMax=256
+Priority=5
+Realtime=true
+SampleRate=48000
+Server=jackd
+StartDelay=2
+Sync=true
+EOT
+
+ # Add a default jackd configuration:
+ cat <<EOT > ${LIVE_ROOTDIR}/home/${LIVEUID}/.jackdrc
+/usr/bin/jackd -dalsa -dhw:0 -r48000 -p1024 -n2
+EOT
+
+ # Autostart qjackctl:
+ mkdir -p ${LIVE_ROOTDIR}/home/${LIVEUID}/.config/autostart
+ if [ -f ${LIVE_ROOTDIR}/usr/share/applications/org.rncbc.qjackctl.desktop ]; then
+ QJCDF=/usr/share/applications/org.rncbc.qjackctl.desktop
+ else
+ QJCDF=/usr/share/applications/qjackctl.desktop
+ fi
+ cp -a ${LIVE_ROOTDIR}/${QJCDF} \
+ ${LIVE_ROOTDIR}/home/${LIVEUID}/.config/autostart/
+
+ # Add all our programs into their own submenu Applications>Multimedia>DAW
+ # to avoid clutter in the Multimedia menu. We will use a custom category
+ # "X-DAW" to decide what goes into the new submenu.
+ # Also move the X42 and LSP Plugin submenus below the new DAW submenu.
+ # see https://specifications.freedesktop.org/menu-spec/menu-spec-1.0.html
+ # We overwrite the menu entries from the 'daw_base' package,
+ # since we want the slightly different liveslak contents instead:
+ install -Dm 644 ${LIVE_TOOLDIR}/media/${LIVEDE,,}/menu/liveslak-daw.menu \
+ $LIVE_ROOTDIR/etc/xdg/menus/applications-merged/${DISTRO}-daw.menu
+ install -Dm 644 \
+ ${LIVE_TOOLDIR}/media/${LIVEDE,,}/menu/liveslak-daw.directory \
+ $LIVE_ROOTDIR/usr/share/desktop-directories/liveslak-daw.directory
+ install -Dm 644 ${LIVE_TOOLDIR}/media/${LIVEDE,,}/menu/liveslak-daw.png \
+ -t $LIVE_ROOTDIR/usr/share/icons/hicolor/512x512/apps/
+
+ # Any menu entry that does not yet have a Category "X-DAW" will now have to
+ # get that added so that our mew submenu will be populated:
+ for DAWPKG in $(cat ${LIVE_TOOLDIR}/pkglists/z03_daw.lst |grep -v x42 |grep -Ev '(^ *#)' ) ; do
+ # Find the installed full package name belonging to the DAW package:
+ PKGINST=$( ls -1 ${LIVE_ROOTDIR}/var/log/packages/${DAWPKG}* 2>/dev/null |grep -E "/var/log/packages/${DAWPKG}-[^-]+-[^-]+-[^-]+$" || true)
+ if [ -n "${PKGINST}" ]; then
+ for DESKTOPF in $(grep 'usr/share/applications/.*.desktop' ${PKGINST})
+ do
+ if ! grep -q X-DAW ${LIVE_ROOTDIR}/${DESKTOPF} ; then
+ sed -i ${LIVE_ROOTDIR}/${DESKTOPF} \
+ -e "s/^Categories=\(.*\)/Categories=X-DAW;\1/"
+ fi
+ ## Hide the application in Multimedia (which is based on the AudioVideo
+ ## category) to prevent them from getting listed twice:
+ #sed -i ${LIVE_ROOTDIR}/${DESKTOPF} -e "/^Categories=/s/AudioVideo;//"
+ done
+ fi
+ done
+
+ # VCV Rack plugins need to be linked into the user-directory to be seen:
+ mkdir -p ${LIVE_ROOTDIR}/home/${LIVEUID}/.Rack/plugins-v1
+ for PLUGIN in $(find ${LIVE_ROOTDIR}/usr/share/vcvrack/ -type f -name "*.zip" -mindepth 1 -maxdepth 1); do
+ ln -s /usr/share/vcvrack/$(basename ${PLUGIN}) ${LIVE_ROOTDIR}/home/${LIVEUID}/.Rack/plugins-v1/
+ done
+
+ # The new Kickoff application launcher that replaced the old Kickoff,
+ # does not adhere to the XDG Desktop standards.
+ # Therefore we will switch the DAW desktop to Kicker instead, to preserve
+ # our 'Slackware DAW' menu structure in the 'Multimedia' menu:
+ sed -e 's/kickoff/kicker/g' -i ${LIVE_ROOTDIR}/usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js
+
+fi # End LIVEDE = DAW
+
if [ "$LIVEDE" = "STUDIOWARE" ]; then
# -------------------------------------------------------------------------- #
@@ -2015,18 +2986,42 @@ if [ "$LIVEDE" = "STUDIOWARE" ]; then
# Create group and user for the Avahi service:
chroot ${LIVE_ROOTDIR} /usr/sbin/groupadd -g 214 avahi
chroot ${LIVE_ROOTDIR} /usr/sbin/useradd -c "Avahi Service Account" -u 214 -g 214 -d /dev/null -s /bin/false avahi
- echo "avahi:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+ if ! echo "avahi:$(openssl rand -base64 12)" | /usr/sbin/chpasswd -R ${LIVE_ROOTDIR} 2>/dev/null ; then
+ echo "avahi:$(openssl rand -base64 12)" | chroot ${LIVE_ROOTDIR} /usr/sbin/chpasswd
+ fi
-fi # End LIVEDE = STUDIOWARE
+fi # End LIVEDE = STUDIOWARE
-if [ "$LIVEDE" = "PLASMA5" -o "$LIVEDE" = "STUDIOWARE" ]; then
+if [ "$LIVEDE" = "DAW" -o "$LIVEDE" = "STUDIOWARE" ];
+then
# -------------------------------------------------------------------------- #
- echo "-- Configuring $LIVEDE (RT beaviour)."
+ echo "-- Configuring $LIVEDE (RT behaviour)."
# -------------------------------------------------------------------------- #
+ # Install real-time configuration in case the OS-installed packages
+ # have not yet done this for us ('daw_base' for instance).
+ # The script looks for specific filenames as used in 'daw_base':
+ # /etc/security/limits.d/rt_audio.conf
+ # /etc/sysctl.d/daw.conf
+ # /etc/udev/rules.d/40-timer-permissions.rules
+
# RT Scheduling and Locked Memory:
- cat << "EOT" > ${LIVE_ROOTDIR}/etc/initscript
+ # Implementation depends on whether PAM is installed:
+ if [ -L ${LIVE_ROOTDIR}/lib${DIRSUFFIX}/libpam.so.? ]; then
+ if [ ! -f ${LIVE_ROOTDIR}/etc/security/limits.d/rt_audio.conf ]; then
+ # On PAM based OS, allow user in 'audio' group to invoke rt capability:
+ mkdir -p ${LIVE_ROOTDIR}/etc/security/limits.d
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/security/limits.d/rt_audio.conf
+# Realtime capability allowed for user in the 'audio' group:
+# Use 'unlimited' with care, you can lock up your system when app misbehaves:
+#@audio - memlock 2097152
+@audio - memlock unlimited
+@audio - rtprio 95
+EOT
+ fi
+ else
+ cat << "EOT" > ${LIVE_ROOTDIR}/etc/initscript
# Set umask to safe level:
umask 022
# Disable core dumps:
@@ -2034,13 +3029,46 @@ ulimit -c 0
# Allow unlimited size to be locked into memory:
ulimit -l unlimited
# Address issue of jackd failing to start with realtime scheduling:
-ulimit -r 65
+ulimit -r 95
# Execute the program.
eval exec "$4"
EOT
+ chmod +x ${LIVE_ROOTDIR}/etc/initscript
+ fi
+
+ if [ ! -f ${LIVE_ROOTDIR}/etc/udev/rules.d/40-timer-permissions.rules ]; then
+ # Allow access for 'audio' group to the high precision event timer,
+ # which may benefit a DAW which relies on ALSA MIDI;
+ # Also grant write access to /dev/cpu_dma_latency to prevent CPU's
+ # from going into idle state:
+ mkdir -p ${LIVE_ROOTDIR}/etc/udev/rules.d
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/udev/rules.d/40-timer-permissions.rules
+KERNEL=="rtc0", GROUP="audio"
+KERNEL=="hpet", GROUP="audio"
+KERNEL=="cpu_dma_latency", GROUP="audio"
+EOT
+ fi
+
+ if [ ! -f ${LIVE_ROOTDIR}/etc/sysctl.d/daw.conf ]; then
+ # Audio related sysctl settings for better realtime performance:
+ mkdir -p ${LIVE_ROOTDIR}/etc/sysctl.d
+ cat <<EOT > ${LIVE_ROOTDIR}/etc/sysctl.d/daw.conf
+# https://wiki.linuxaudio.org/wiki/system_configuration
+dev.hpet.max-user-freq = 3072
+fs.inotify.max_user_watches = 524288
+vm.swappiness = 10
+EOT
+ fi
+
+ # # This would benefit a DAW, but if the user runs the Live OS on a laptop,
+ # # she might want to decide about this herself:
+ # mkdir -p ${LIVE_ROOTDIR}/etc/default
+ #cat <<EOT > ${LIVE_ROOTDIR}/etc/default/cpufreq
+ #SCALING_GOVERNOR=performance
+ #EOT
-fi # End LIVEDE = PLASMA5/STUDIOWARE
+fi # End LIVEDE = DAW/STUDIOWARE
# You can define the function 'custom_config()' by uncommenting it in
# the configuration file 'make_slackware_live.conf'.
@@ -2153,18 +3181,14 @@ echo "-- Tweaking system startup."
# -------------------------------------------------------------------------- #
# Configure the default DE when running startx:
-if [ "$LIVEDE" = "SLACKWARE" ]; then
- ln -sf xinitrc.kde ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
-elif [ "$LIVEDE" = "KDE4" ]; then
- ln -sf xinitrc.kde ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
-elif [ "$LIVEDE" = "PLASMA5" ]; then
- ln -sf xinitrc.plasma ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
-elif [ "$LIVEDE" = "MATE" ]; then
+if [ "$LIVEDE" = "MATE" ]; then
ln -sf xinitrc.mate-session ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
elif [ "$LIVEDE" = "CINNAMON" ]; then
ln -sf xinitrc.cinnamon-session ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
elif [ "$LIVEDE" = "DLACK" ]; then
ln -sf xinitrc.gnome ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
+elif [ -f ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc.kde ]; then
+ ln -sf xinitrc.kde ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
elif [ -f ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc.xfce ]; then
ln -sf xinitrc.xfce ${LIVE_ROOTDIR}/etc/X11/xinit/xinitrc
fi
@@ -2181,8 +3205,12 @@ sed -i ${LIVE_ROOTDIR}/etc/inittab -e "s/\(id:\).\(:initdefault:\)/\1${RUNLEVEL}
# But enable NFS client support and CUPS:
[ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.rpc ] && chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.rpc
-[ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.cups ] && chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.cups
-[ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.cups-browsed ] && chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.cups-browsed
+if [ -x ${LIVE_ROOTDIR}/usr/sbin/cupsd ] && [ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.cups ]; then
+ chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.cups
+fi
+if [ -x ${LIVE_ROOTDIR}/usr/sbin/cupsd ] && [ -f ${LIVE_ROOTDIR}/etc/rc.d/rc.cups-browsed ]; then
+ chmod +x ${LIVE_ROOTDIR}/etc/rc.d/rc.cups-browsed
+fi
# Add a softvol pre-amp to ALSA - some computers have too low volumes.
# If etc/asound.conf exists it's configuring ALSA to use Pulse,
@@ -2217,12 +3245,14 @@ touch ${LIVE_ROOTDIR}/etc/fastboot
# We will not write to the hardware clock:
sed -i -e '/systohc/s/^/# /' ${LIVE_ROOTDIR}/etc/rc.d/rc.6
+# Don't try to re-mount our squashfs and overlay filesystems:
+sed -e 's/^ *SKIPFS="no/&squashfs,nooverlay,no/' \
+ -i ${LIVE_ROOTDIR}/etc/rc.d/rc.S
+
# Run some package setup scripts (usually run by the slackware installer),
# as well as some of the delaying commands in rc.M and rc.modules:
-chroot ${LIVE_ROOTDIR} /bin/bash <<EOCR
-# Rebuild SSL certificate database:
-/usr/sbin/update-ca-certificates --fresh 1>/dev/null 2>${DBGOUT}
+chroot ${LIVE_ROOTDIR} /bin/bash <<EOCR
# Run bits from rc.M so we won't need to run them again in the live system:
/sbin/depmod $KVER
/sbin/ldconfig
@@ -2286,37 +3316,32 @@ sed -e "s% /usr/bin/update.*verbose%#&%" -i ${LIVE_ROOTDIR}/etc/rc.d/rc.M
sed -e '/^ *\/usr\/bin\/glib-c/ s, /usr/bin/glib-c,#&,' -i ${LIVE_ROOTDIR}/etc/rc.d/rc.M
sed -e "s% /sbin/depmod -%#&%" -i ${LIVE_ROOTDIR}/etc/rc.d/rc.modules
-# If we detect a NVIDIA driver, then run the nvidia install routine:
+# Start/stop the NVIDIA persistence daemon if a NVIDIA driver is loaded;
+# Note that this assumes the nvidia-driver and nvidia-kernel packages
+# from slackbuilds.org are being used:
cat <<EOT >> ${LIVE_ROOTDIR}/etc/rc.d/rc.local
-# Deal with the presence of NVIDIA drivers:
-if [ -x /usr/sbin/nvidia-switch ]; then
- if [ -f /usr/lib${DIRSUFFIX}/xorg/modules/extensions/libglx.so.*-nvidia -a -f /usr/lib${DIRSUFFIX}/xorg/modules/drivers/nvidia_drv.so ]; then
- echo "-- Installing binary Nvidia drivers: /usr/sbin/nvidia-switch --install"
- /usr/sbin/nvidia-switch --install
- fi
- # For CUDA/OpenCL to work after reboot, create missing nvidia device nodes:
+# For CUDA/OpenCL to work after reboot, create missing nvidia device nodes:
+if [ -x /usr/bin/nvidia-modprobe ]; then
+ echo "Creating missing nvidia device nodes..."
/usr/bin/nvidia-modprobe -c 0 -u
-else
- # Take care of a reboot where nvidia drivers disappeared
- # afer being used earlier, by restoring the original libraries:
- if ls /usr/lib${DIRSUFFIX}/xorg/modules/extensions/libglx.so-xorg 1>/dev/null 2>/dev/null ; then
- mv /usr/lib${DIRSUFFIX}/xorg/modules/extensions/libglx.so{-xorg,} 2>/dev/null
- mv /usr/lib${DIRSUFFIX}/xorg/modules/extensions/libglx.la{-xorg,} 2>/dev/null
- fi
- if ls /usr/lib${DIRSUFFIX}/libGL.so.*-xorg 1>/dev/null 2>/dev/null ; then
- LIBGL=\$(ls -1 /usr/lib${DIRSUFFIX}/libGL.so.*-xorg |rev |cut -d/ -f1 |cut -d- -f2- |rev)
- mv /usr/lib${DIRSUFFIX}/\${LIBGL}-xorg /usr/lib${DIRSUFFIX}/\${LIBGL} 2>/dev/null
- ln -sf \${LIBGL} /usr/lib${DIRSUFFIX}/libGL.so.1 2>/dev/null
- ln -sf \${LIBGL} /usr/lib${DIRSUFFIX}/libGL.so 2>/dev/null
- mv /usr/lib${DIRSUFFIX}/libGL.la-xorg /usr/lib${DIRSUFFIX}/libGL.la 2>/dev/null
- fi
- if ls /usr/lib${DIRSUFFIX}/libEGL.so.*-xorg 1>/dev/null 2>/dev/null ; then
- LIBEGL=\$(ls -1 /usr/lib${DIRSUFFIX}/libEGL.so.*-xorg |rev |cut -d/ -f1 |cut -d- -f2- |rev)
- mv /usr/lib${DIRSUFFIX}/\${LIBEGL}-xorg /usr/lib${DIRSUFFIX}/\${LIBEGL} 2>/dev/null
- ln -sf \${LIBEGL} /usr/lib${DIRSUFFIX}/libEGL.so.1 2>/dev/null
- ln -sf \${LIBEGL} /usr/lib${DIRSUFFIX}/libEGL.so 2>/dev/null
- fi
+fi
+
+# Start the nvidia-persistenced daemon:
+if [ -x /etc/rc.d/rc.nvidia-persistenced ] && [ -d /var/run/nvidia-persistenced ]; then
+ echo "Starting nvidia persistence daemon..."
+ sed -e "s/NVPD_USER=.*/NVPD_USER=${NVUID}/" -i /etc/rc.d/rc.nvidia-persistenced
+ chown ${NVUID}:${NVGRP} /var/run/nvidia-persistenced 2>/dev/null
+ /etc/rc.d/rc.nvidia-persistenced start
+fi
+EOT
+
+cat <<EOT >> ${LIVE_ROOTDIR}/etc/rc.d/rc.local_shutdown
+
+# Stop the nvidia-persistenced daemon:
+if [ -x /etc/rc.d/rc.nvidia-persistenced ]; then
+ echo "Stopping nvidia persistence daemon..."
+ /etc/rc.d/rc.nvidia-persistenced stop
fi
EOT
@@ -2377,6 +3402,10 @@ else
KVER=$(ls --indicator-style=none ${LIVE_ROOTDIR}/lib/modules/ |grep smp |head -1)
fi
+# Determine Slackware's GRUB version and build (we will use this later):
+GRUBVER=$(find ${DEF_SL_PKGROOT}/../ -name "grub-*.t?z" |rev |cut -d- -f3 |rev)
+GRUBBLD=$(find ${DEF_SL_PKGROOT}/../ -name "grub-*.t?z" |rev |cut -d- -f1 |cut -d. -f2 |rev)
+
# Create an initrd for the generic kernel, using a modified init script:
echo "-- Creating initrd for kernel-generic $KVER ..."
chroot ${LIVE_ROOTDIR} /sbin/mkinitrd -c -w ${WAIT} -l us -o /boot/initrd_${KVER}.img -k ${KVER} -m ${KMODS} -L -C dummy 1>${DBGOUT} 2>${DBGOUT}
@@ -2392,7 +3421,8 @@ cat $LIVE_TOOLDIR/liveinit.tpl | sed \
-e "s/@DISTRO@/$DISTRO/g" \
-e "s/@CDISTRO@/${DISTRO^}/g" \
-e "s/@UDISTRO@/${DISTRO^^}/g" \
- -e "s/@VERSION@/$VERSION/g" \
+ -e "s/@CORE2RAMMODS@/${CORE2RAMMODS}/g" \
+ -e "s/@VERSION@/${VERSION}/g" \
-e "s/@SQ_EXT_AVAIL@/${SQ_EXT_AVAIL}/g" \
-e "s,@DEF_KBD@,${DEF_KBD},g" \
-e "s,@DEF_LOCALE@,${DEF_LOCALE},g" \
@@ -2407,28 +3437,28 @@ tar -C ${LIVE_ROOTDIR}/boot/initrd-tree/ -xf ${DHCPD_PKG} \
var/lib/dhcpcd lib/dhcpcd sbin/dhcpcd usr/lib${DIRSUFFIX}/dhcpcd \
etc/dhcpcd.conf.new
mv ${LIVE_ROOTDIR}/boot/initrd-tree/etc/dhcpcd.conf{.new,}
+# Create the dhcpcd account because we added the package to the initrd:
+if ! grep -q dhcpcd ${LIVE_ROOTDIR}/boot/initrd-tree/etc/passwd; then
+ echo "dhcpcd:x:68:68:User for dhcpcd:/var/lib/dhcpcd:/bin/false" >> ${LIVE_ROOTDIR}/boot/initrd-tree/etc/passwd
+ echo "dhcpcd:x:68:" >> ${LIVE_ROOTDIR}/boot/initrd-tree/etc/group
+fi
+
+# Add getfattr to read extended attributes (even if we won't need it):
+ATTR_PKG=$(find ${DEF_SL_PKGROOT}/../ -name "attr-*.t?z" |head -1)
+tar --wildcards -C ${LIVE_ROOTDIR}/boot/initrd-tree/ -xf ${ATTR_PKG} \
+ lib${DIRSUFFIX}/libattr.so.* usr/bin/getfattr
+# Generate library symlinks for libattr (getfattr depends on them):
+( cd ${LIVE_ROOTDIR}/boot/initrd-tree/lib${DIRSUFFIX} ; ldconfig -n . )
# Stamp the Slackware version into the initrd (at least dhcpcd needs this):
mkdir -p ${LIVE_ROOTDIR}/boot/initrd-tree/etc/rc.d
cp -a ${LIVE_ROOTDIR}/etc/slackware-version ${LIVE_ROOTDIR}/etc/os-release \
${LIVE_ROOTDIR}/boot/initrd-tree/etc/
if [ "$NFSROOTSUP" = "YES" ]; then
# Add just the right kernel network modules by pruning unneeded stuff:
- if [ "$SL_ARCH" = "x86_64" -o "$SMP32" = "NO" ]; then
- KMODS_PKG=$(find ${DEF_SL_PKGROOT}/../ -name "kernel-modules-*$(echo $KGEN |tr - _)*.t?z" |grep -v smp |head -1)
- else
- KMODS_PKG=$(find ${DEF_SL_PKGROOT}/../ -name "kernel-modules-*$(echo $KGEN |tr - _)*.t?z" |grep smp |head -1)
- fi
- KMODS_TEMP=$(mktemp -d -p /mnt -t liveslak.XXXXXX)
- if [ ! -d $KMODS_TEMP ]; then
- echo "*** Failed to create a temporary extraction directory for the initrd!"
- cleanup
- exit 1
- fi
- # We need to extract the full kernel-modules package for deps resolving:
- tar -C ${KMODS_TEMP} -xf ${KMODS_PKG}
+ # We need the full kernel-modules package for deps resolving:
# Get the kernel modules:
for NETMODPATH in ${NETMODS} ; do
- cd ${KMODS_TEMP}
+ cd ${LIVE_ROOTDIR}
cp -a --parents lib/modules/${KVER}/${NETMODPATH} \
${LIVE_ROOTDIR}/boot/initrd-tree/
cd - 1>/dev/null
@@ -2439,19 +3469,17 @@ if [ "$NFSROOTSUP" = "YES" ]; then
done
# Add any dependency modules:
for MODULE in $(find ${LIVE_ROOTDIR}/boot/initrd-tree/lib/modules/${KVER}/${NETMODPATH} -type f -exec basename {} .ko \;) ; do
- /sbin/modprobe --dirname ${KMODS_TEMP} --set-version $KVER --show-depends --ignore-install $MODULE 2>/dev/null |grep "^insmod " |cut -f 2 -d ' ' |while read SRCMOD; do
+ /sbin/modprobe --dirname ${LIVE_ROOTDIR} --set-version $KVER --show-depends --ignore-install $MODULE 2>/dev/null |grep "^insmod " |cut -f 2 -d ' ' |while read SRCMOD; do
if [ "$(basename $SRCMOD .ko)" != "$MODULE" ]; then
- cd ${KMODS_TEMP}
- # Need to strip ${KMODS_TEMP} from the start of ${SRCMOD}:
- cp -a --parents $(echo $SRCMOD |sed 's|'${KMODS_TEMP}'/|./|' ) \
+ cd ${LIVE_ROOTDIR}
+ # Need to strip ${LIVE_ROOTDIR} from the start of ${SRCMOD}:
+ cp -a --parents $(echo $SRCMOD |sed 's|'${LIVE_ROOTDIR}'/|./|' ) \
${LIVE_ROOTDIR}/boot/initrd-tree/
cd - 1>/dev/null
fi
done
done
done
- # Remove the temporary tree:
- rm -rf ${KMODS_TEMP}
# We added extra modules to the initrd, so we run depmod again:
chroot ${LIVE_ROOTDIR}/boot/initrd-tree /sbin/depmod $KVER
# Add the firmware for network cards that need them:
@@ -2482,11 +3510,6 @@ mv ${LIVE_BOOT}/boot/initrd_${KVER}.img ${LIVE_STAGING}/boot/initrd.img
# Squash the boot directory into its own module:
mksquashfs ${LIVE_BOOT} ${LIVE_MOD_SYS}/0000-${DISTRO}_boot-${SL_VERSION}-${SL_ARCH}.sxz -noappend -comp ${SQ_COMP} ${SQ_COMP_PARAMS}
-# Determine additional boot parameters to be added:
-if [ -z ${KAPPEND} ]; then
- eval KAPPEND=\$KAPPEND_${LIVEDE}
-fi
-
# Copy the syslinux configuration.
# The next block checks here for a possible UEFI grub boot image:
cp -a ${LIVE_TOOLDIR}/syslinux ${LIVE_STAGING}/boot/
@@ -2494,8 +3517,13 @@ cp -a ${LIVE_TOOLDIR}/syslinux ${LIVE_STAGING}/boot/
# EFI support always for 64bit architecture, but conditional for 32bit.
if [ "$SL_ARCH" = "x86_64" -o "$EFI32" = "YES" ]; then
# Copy the UEFI boot directory structure:
+ rm -rf ${LIVE_STAGING}/EFI/BOOT
mkdir -p ${LIVE_STAGING}/EFI/BOOT
cp -a ${LIVE_TOOLDIR}/EFI/BOOT/{grub-embedded.cfg,make-grub.sh,*.txt,theme} ${LIVE_STAGING}/EFI/BOOT/
+ if [ ${SECUREBOOT} -eq 1 ]; then
+ # User needs a DER-encoded copy of the signing cert for MOK enrollment:
+ openssl x509 -outform der -in ${MOKCERT} -out ${LIVE_STAGING}/EFI/BOOT/liveslak.der
+ fi
if [ "$LIVEDE" = "XFCE" ]; then
# We do not use the unicode font, so it can be removed to save space:
rm -f ${LIVE_STAGING}/EFI/BOOT/theme/unicode.pf2
@@ -2503,7 +3531,7 @@ if [ "$SL_ARCH" = "x86_64" -o "$EFI32" = "YES" ]; then
# Create the grub fonts used in the theme.
# Command outputs string like this: "Font name: DejaVu Sans Mono Regular 5".
- for FSIZE in 5 10 12 20 ; do
+ for FSIZE in 5 10 12 20 24 ; do
grub-mkfont -s ${FSIZE} -av \
-o ${LIVE_STAGING}/EFI/BOOT/theme/dejavusansmono${FSIZE}.pf2 \
/usr/share/fonts/TTF/DejaVuSansMono.ttf \
@@ -2516,6 +3544,12 @@ if [ "$SL_ARCH" = "x86_64" -o "$EFI32" = "YES" ]; then
# Generate the UEFI grub boot image if needed:
if [ ! -f ${LIVE_STAGING}/EFI/BOOT/boot${EFISUFF}.efi -o ! -f ${LIVE_STAGING}/boot/syslinux/efiboot.img ]; then
( cd ${LIVE_STAGING}/EFI/BOOT
+ # Create a SBAT file 'grub_sbat.csv' to be used by make-grub.sh :
+ cat <<HSBAT > ${LIVE_STAGING}/EFI/BOOT/grub_sbat.csv
+sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
+grub,1,Free Software Foundation,grub,2.06,https://www.gnu.org/software/grub/
+grub.liveslak,1,The liveslak project,grub,${GRUBVER}-${GRUBBLD},https://download.liveslak.org/
+HSBAT
sed -i -e "s/SLACKWARELIVE/${MARKER}/g" grub-embedded.cfg
sh make-grub.sh EFIFORM=${EFIFORM} EFISUFF=${EFISUFF}
)
@@ -2523,6 +3557,12 @@ if [ "$SL_ARCH" = "x86_64" -o "$EFI32" = "YES" ]; then
# Generate the grub configuration for UEFI boot:
gen_uefimenu ${LIVE_STAGING}/EFI/BOOT
+
+ # Add SecureBoot support if requested:
+ if [ ${SECUREBOOT} -eq 1 ]; then
+ secureboot ${SHIM_3RDP}
+ fi
+
fi # End EFI support menu.
if [ "$SYSMENU" = "NO" ]; then
@@ -2581,7 +3621,8 @@ if [ "$LIVEDE" != "XFCE" ]; then
fi
fi
-if [ "$LIVEDE" != "XFCE" -a "$LIVEDE" != "SLACKWARE" ]; then
+if [ "$LIVEDE" != "XFCE" -a "$LIVEDE" != "LEAN" -a "$LIVEDE" != "SLACKWARE" ]
+then
# KDE/PLASMA etc will profit from accelerated graphics support;
# however the SLACKWARE ISO should not have any non-Slackware content.
# You can 'cheat' when building the SLACKWARE ISO by copying the graphics
@@ -2590,6 +3631,9 @@ if [ "$LIVEDE" != "XFCE" -a "$LIVEDE" != "SLACKWARE" ]; then
# Add custom (proprietary) graphics drivers:
echo "-- Adding binary GPU drivers supporting kernel ${KVER}."
cp ${LIVE_TOOLDIR}/graphics/*${KVER}-${SL_VERSION}-${SL_ARCH}.sxz ${LIVE_MOD_OPT}/
+ if ls ${LIVE_TOOLDIR}/graphics/nvidia-*xx.ids 1>/dev/null 2>&1 ; then
+ cp ${LIVE_TOOLDIR}/graphics/nvidia-*xx.ids ${LIVE_MOD_OPT}/
+ fi
fi
fi
@@ -2597,6 +3641,9 @@ fi
# verbatim into the overlay root):
mkdir -p ${LIVE_STAGING}/${LIVEMAIN}/rootcopy
+# Mark our ISO as 'ventoy-compatible':
+echo "This ISO is compatible with Ventoy. See https://www.ventoy.net/en/compatible.html" >${LIVE_STAGING}/ventoy.dat
+
# Create an ISO file from the directories found below ${LIVE_STAGING}:
create_iso ${LIVE_STAGING}
diff --git a/media/daw/bg/background.png b/media/daw/bg/background.png
new file mode 120000
index 0000000..6e72df9
--- /dev/null
+++ b/media/daw/bg/background.png
@@ -0,0 +1 @@
+sc_stage_bw_1920x1080.png \ No newline at end of file
diff --git a/media/daw/bg/sc_stage_bw_1920x1080.png b/media/daw/bg/sc_stage_bw_1920x1080.png
new file mode 100644
index 0000000..b0b5d31
--- /dev/null
+++ b/media/daw/bg/sc_stage_bw_1920x1080.png
Binary files differ
diff --git a/media/daw/icons/SJack2.png b/media/daw/icons/SJack2.png
new file mode 100644
index 0000000..d664eb2
--- /dev/null
+++ b/media/daw/icons/SJack2.png
Binary files differ
diff --git a/media/daw/icons/default.png b/media/daw/icons/default.png
new file mode 120000
index 0000000..2bbd526
--- /dev/null
+++ b/media/daw/icons/default.png
@@ -0,0 +1 @@
+SJack2.png \ No newline at end of file
diff --git a/media/daw/menu/liveslak-daw.directory b/media/daw/menu/liveslak-daw.directory
new file mode 100644
index 0000000..074d67a
--- /dev/null
+++ b/media/daw/menu/liveslak-daw.directory
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=Slackware Live DAW
+Icon=liveslak-daw
+Type=Directory
+Keywords=audio;sound;jackd;studio;
+Comment=Slackware Digital Audio Workstation
diff --git a/media/daw/menu/liveslak-daw.menu b/media/daw/menu/liveslak-daw.menu
new file mode 100644
index 0000000..9158cf8
--- /dev/null
+++ b/media/daw/menu/liveslak-daw.menu
@@ -0,0 +1,26 @@
+<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
+<Menu>
+ <Name>Applications</Name>
+ <Menu>
+ <Name>Multimedia</Name>
+ <Exclude>
+ <Category>X-DAW</Category>
+ </Exclude>
+ <Move>
+ <Old>X42 Plugins</Old>
+ <New>Slackware Live Daw/X42 Plugins</New>
+ </Move>
+ <Move>
+ <Old>lsp-plugins</Old>
+ <New>Slackware Live Daw/lsp-plugins</New>
+ </Move>
+ <Menu>
+ <Name>Slackware Live Daw</Name>
+ <Directory>liveslak-daw.directory</Directory>
+ <Include>
+ <Category>X-DAW</Category>
+ </Include>
+ </Menu>
+ </Menu>
+</Menu>
+
diff --git a/media/daw/menu/liveslak-daw.png b/media/daw/menu/liveslak-daw.png
new file mode 100644
index 0000000..51bf3a6
--- /dev/null
+++ b/media/daw/menu/liveslak-daw.png
Binary files differ
diff --git a/media/ktown/bg/background.jpg b/media/ktown/bg/background.jpg
new file mode 120000
index 0000000..06b955d
--- /dev/null
+++ b/media/ktown/bg/background.jpg
@@ -0,0 +1 @@
+rauwven.jpg \ No newline at end of file
diff --git a/media/ktown/bg/rauwven.jpg b/media/ktown/bg/rauwven.jpg
new file mode 100644
index 0000000..f1d4a6e
--- /dev/null
+++ b/media/ktown/bg/rauwven.jpg
Binary files differ
diff --git a/media/lean/bg/background.jpg b/media/lean/bg/background.jpg
new file mode 120000
index 0000000..2094cf4
--- /dev/null
+++ b/media/lean/bg/background.jpg
@@ -0,0 +1 @@
+willibrordhaeghe.jpg \ No newline at end of file
diff --git a/media/lean/bg/bretagnecancale.jpg b/media/lean/bg/bretagnecancale.jpg
new file mode 100644
index 0000000..f3ccc91
--- /dev/null
+++ b/media/lean/bg/bretagnecancale.jpg
Binary files differ
diff --git a/media/lean/bg/demortelen.jpg b/media/lean/bg/demortelen.jpg
new file mode 100644
index 0000000..b7677fb
--- /dev/null
+++ b/media/lean/bg/demortelen.jpg
Binary files differ
diff --git a/media/lean/bg/groedezeeland.jpg b/media/lean/bg/groedezeeland.jpg
new file mode 100644
index 0000000..84020cb
--- /dev/null
+++ b/media/lean/bg/groedezeeland.jpg
Binary files differ
diff --git a/media/lean/bg/landgoedgrotebeek.jpg b/media/lean/bg/landgoedgrotebeek.jpg
new file mode 100644
index 0000000..d041de8
--- /dev/null
+++ b/media/lean/bg/landgoedgrotebeek.jpg
Binary files differ
diff --git a/media/lean/bg/montsaintmichel.jpg b/media/lean/bg/montsaintmichel.jpg
new file mode 100644
index 0000000..5a3891e
--- /dev/null
+++ b/media/lean/bg/montsaintmichel.jpg
Binary files differ
diff --git a/media/lean/bg/montstmichelflats.jpg b/media/lean/bg/montstmichelflats.jpg
new file mode 100644
index 0000000..404040a
--- /dev/null
+++ b/media/lean/bg/montstmichelflats.jpg
Binary files differ
diff --git a/media/lean/bg/ruwenberg.jpg b/media/lean/bg/ruwenberg.jpg
new file mode 100644
index 0000000..94bff59
--- /dev/null
+++ b/media/lean/bg/ruwenberg.jpg
Binary files differ
diff --git a/media/lean/bg/theme b/media/lean/bg/theme
new file mode 100644
index 0000000..37a6131
--- /dev/null
+++ b/media/lean/bg/theme
@@ -0,0 +1,2 @@
+# either 'dark' or 'light'
+dark
diff --git a/media/lean/bg/vijlen.jpg b/media/lean/bg/vijlen.jpg
new file mode 100644
index 0000000..96c6e7d
--- /dev/null
+++ b/media/lean/bg/vijlen.jpg
Binary files differ
diff --git a/media/lean/bg/willibrordhaeghe.jpg b/media/lean/bg/willibrordhaeghe.jpg
new file mode 100644
index 0000000..f10685a
--- /dev/null
+++ b/media/lean/bg/willibrordhaeghe.jpg
Binary files differ
diff --git a/media/slackware/icons/graySW_512px.png b/media/slackware/icons/graySW_512px.png
new file mode 100644
index 0000000..0885932
--- /dev/null
+++ b/media/slackware/icons/graySW_512px.png
Binary files differ
diff --git a/menu.tpl b/menu.tpl
index 4d7cc8d..c5ca327 100644
--- a/menu.tpl
+++ b/menu.tpl
@@ -4,7 +4,7 @@ ui vesamenu.c32
default live
font @CONSFONT@
menu background swlogov.png
-menu title @CDISTRO@@DIRSUFFIX@-@SL_VERSION@ Live @VERSION@
+menu title @CDISTRO@@DIRSUFFIX@-@SL_VERSION@ liveslak-@VERSION@
menu clear
f2 f2.txt #00000000
f3 f3.txt #00000000
@@ -12,7 +12,7 @@ f4 f4.txt #00000000
menu hshift 1
menu vshift 9
-menu width 45
+menu width 55
menu margin 1
menu rows 10
menu helpmsgrow 14
@@ -75,3 +75,10 @@ menu label Memory test with memtest86+
label localboot
menu label Boot from local drive
localboot -1
+
+label core2ram
+ @C2RMH@menu hide
+ menu label Console OS in RAM
+ kernel /boot/generic
+ append initrd=/boot/initrd.img @KAPPEND@ load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 kbd=@KBD@ locale=@LOCALE@ tz=@TZ@ toram=core 3
+
diff --git a/patches/liloconfig.patch b/patches/liloconfig.patch
index 6a0e96c..d82a824 100644
--- a/patches/liloconfig.patch
+++ b/patches/liloconfig.patch
@@ -1,22 +1,208 @@
---- liloconfig.orig 2016-07-12 01:21:03.000000000 +0200
-+++ liloconfig 2016-11-12 11:57:41.585974417 +0100
-@@ -767,7 +767,7 @@
+--- testing/liloconfig.20201223 2020-12-23 22:01:43.268714126 +0100
++++ testing/liloconfig.20201226 2020-12-26 22:31:01.070803743 +0100
+@@ -22,6 +22,11 @@
+ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
++# This script installs the lilo boot loader.
++# The kernel used will be whatever the symlink /boot/vmlinuz points to,
++# and if /boot/initrd.gz exists, that will be installed as the initrd.
++#
++
+ TMP=/var/log/setup/tmp
+ CONSOLETYPE=standard
+ unset UTFVT
+@@ -249,6 +254,45 @@
+ return $RETVAL
+ }
- # If we're installing from the umsdos.gz rootdisk, suggest skipping LILO:
- if [ ! "$T_PX" = "/" ]; then
-- if mount | grep " on /mnt " | grep umsdos 1> /dev/null 2> /dev/null ; then
-+ if mount | grep " on $T_PX " | grep umsdos 1> /dev/null 2> /dev/null ; then
- dialog --title "SKIP LILO CONFIGURATION? (RECOMMENDED)" --yesno "Since \
- you are installing to a FAT partition, it's suggested that you do not \
- configure LILO at this time. (Instead, use your bootdisk. For booting \
-@@ -1236,8 +1236,8 @@
- if [ -r $TMP/lilo.conf ]; then
- dialog --title "YOUR NEW /etc/lilo.conf" --textbox "$TMP/lilo.conf" 22 70
++# This function scans for the Master Boot Record,
++# if we are going to install lilo to the MBR.
++# The output will be a file "$TMP/LILOMBR" with the device name written to it.
++find_mbr()
++{
++ MBR_TARGET=/dev/sda
++ echo $MBR_TARGET > $TMP/LILOMBR
++ cat /proc/partitions | while read LINE ; do
++ MAJOR="$(echo $LINE | cut -f 1 -d ' ')"
++ MINOR="$(echo $LINE | cut -f 2 -d ' ')"
++ if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
++ if [ "$MAJOR" = "3" ]; then
++ MBR_TARGET=/dev/hda
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
++ MBR_TARGET=/dev/hdc
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
++ MBR_TARGET=/dev/hde
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
++ MBR_TARGET=/dev/hdg
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "259" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" -a ! "$MBR_TARGET" = "/dev/hdg" ]; then
++ if [ "$(echo $LINE | cut -f 4 -d ' ' | cut -b 1-4)" = "nvme" ]; then
++ MBR_TARGET="/dev/$(echo $LINE | cut -f 4 -d ' ' | cut -f 1 -d p)"
++ echo $MBR_TARGET > $TMP/LILOMBR
++ fi
++ fi
++ if dmidecode 2> /dev/null | grep -q QEMU 2> /dev/null ; then
++ if [ -r /dev/vda ]; then
++ MBR_TARGET=/dev/vda
++ echo $MBR_TARGET > $TMP/LILOMBR
++ fi
++ fi
++ fi
++ done
++}
++
+ # This function scans for bootable partitions (making some assumptions along
+ # the way which may or may not be correct, but usually work), and sets up
+ # LILO in either the superblock, or the MBR.
+@@ -289,38 +333,7 @@
+ dialog --infobox "\nScanning partitions and generating /etc/lilo.conf..." 5 57
+ sleep 1
+ if [ "$TG" = "MBR" ]; then
+- MBR_TARGET=/dev/sda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- cat /proc/partitions | while read LINE ; do
+- MAJOR="$(echo $LINE | cut -f 1 -d ' ')"
+- MINOR="$(echo $LINE | cut -f 2 -d ' ')"
+- if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
+- if [ "$MAJOR" = "3" ]; then
+- MBR_TARGET=/dev/hda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
+- MBR_TARGET=/dev/hdc
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
+- MBR_TARGET=/dev/hde
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
+- MBR_TARGET=/dev/hdg
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "259" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" -a ! "$MBR_TARGET" = "/dev/hdg" ]; then
+- if [ "$(echo $LINE | cut -f 4 -d ' ' | cut -b 1-4)" = "nvme" ]; then
+- MBR_TARGET="/dev/$(echo $LINE | cut -f 4 -d ' ' | cut -f 1 -d p)"
+- echo $MBR_TARGET > $TMP/LILOMBR
+- fi
+- fi
+- if dmidecode 2> /dev/null | grep -q QEMU 2> /dev/null ; then
+- if [ -r /dev/vda ]; then
+- MBR_TARGET=/dev/vda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- fi
+- fi
+- fi
+- done
++ find_mbr
+ LILO_TARGET=$(cat $TMP/LILOMBR)
+ elif [ "$TG" = "Root" ]; then
+ LILO_TARGET=$(echo $ROOT_DEVICE)
+@@ -338,7 +351,6 @@
+ echo "append=\"$APPEND $UTFVT\"" >> $T_PX/etc/lilo.conf
+ echo >> $T_PX/etc/lilo.conf
+ #fi
+-
+ if echo $LILO_TARGET | grep -q vda 2>/dev/null ; then
+ echo "disk = /dev/vda bios=0x80 max-partitions=7" >> $T_PX/etc/lilo.conf
+ fi
+@@ -452,7 +464,18 @@
+ LNXP="$(PROBE -l | grep "Linux$")"
+ LNXP="$(echo $LNXP | cut -f 1 -d ' ' | sort)"
+ if [ ! "$LNXP" = "" ]; then
+- cat << EOF >> $T_PX/etc/lilo.conf
++ if [ -r $T_PX/boot/initrd.gz ]; then
++ cat << EOF >> $T_PX/etc/lilo.conf
++# Linux bootable partition config begins
++image = $KERNEL
++ initrd = /boot/initrd.gz
++ #root = $ROOT_DEVICE
++ label = Linux
++ read-only
++# Linux bootable partition config ends
++EOF
++ else
++ cat << EOF >> $T_PX/etc/lilo.conf
+ # Linux bootable partition config begins
+ image = $KERNEL
+ root = $ROOT_DEVICE
+@@ -460,6 +483,7 @@
+ read-only
+ # Linux bootable partition config ends
+ EOF
++ fi
+ echo "Linux - (Linux partition)" >> $T_PX/boot/boot_message.txt
+ fi
+ # DEAD CODE, BUT IN CASE OS/2 MAKES A COMEBACK!
+@@ -668,6 +692,8 @@
+ ARCHTYPE=i386
+ if [ -r $T_PX/vmlinuz ]; then
+ KERNEL=/vmlinuz
++elif [ -r $T_PX/boot/vmlinuz-generic ] && [ -r $T_PX/boot/initrd.gz ]; then
++ KERNEL=/boot/vmlinuz-generic
+ elif [ -r $T_PX/boot/vmlinuz ]; then
+ KERNEL=/boot/vmlinuz
+ elif [ -r $T_PX/usr/src/linux/arch/$ARCHTYPE/boot/bzImage ]; then
+@@ -763,33 +789,7 @@
+ fi
+ rm -r $TMP/reply
+ if [ "$TG" = "MBR" ]; then
+- MBR_TARGET=/dev/sda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- cat /proc/partitions | while read LINE ; do
+- MAJOR="$(echo $LINE | cut -f 1 -d ' ')"
+- MINOR="$(echo $LINE | cut -f 2 -d ' ')"
+- if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
+- if [ "$MAJOR" = "3" ]; then
+- MBR_TARGET=/dev/hda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
+- MBR_TARGET=/dev/hdc
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
+- MBR_TARGET=/dev/hde
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
+- MBR_TARGET=/dev/hdg
+- echo $MBR_TARGET > $TMP/LILOMBR
+- fi
+- if dmidecode 2> /dev/null | grep -q QEMU 2> /dev/null ; then
+- if [ -r /dev/vda ]; then
+- MBR_TARGET=/dev/vda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- fi
+- fi
+- fi
+- done
++ find_mbr
+ LILO_TARGET=$(cat $TMP/LILOMBR)
+ dialog --title "CONFIRM LOCATION TO INSTALL LILO" --inputbox \
+ "The auto-detected location to install the LILO boot block is shown below. \
+@@ -965,7 +965,18 @@
+ continue
+ fi
+ LABEL="$(cat $TMP/reply)"
+- cat << EOF >> $TMP/lilo.conf
++ if [ -r $T_PX/boot/initrd.gz ]; then
++ cat << EOF >> $TMP/lilo.conf
++# Linux bootable partition config begins
++image = $KERNEL
++ initrd = /boot/initrd.gz
++ #root = $LINUX_PART
++ label = $LABEL
++ read-only # Partitions should be mounted read-only for checking
++# Linux bootable partition config ends
++EOF
++ else
++ cat << EOF >> $TMP/lilo.conf
+ # Linux bootable partition config begins
+ image = $KERNEL
+ root = $LINUX_PART
+@@ -973,6 +984,7 @@
+ read-only # Partitions should be mounted read-only for checking
+ # Linux bootable partition config ends
+ EOF
++ fi
else
-- if [ -r /mnt/etc/lilo.conf ]; then
-- dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/mnt/etc/lilo.conf" 22 70
-+ if [ -r $T_PX/etc/lilo.conf ]; then
-+ dialog --title "YOUR OLD /etc/lilo.conf" --textbox "$T_PX/etc/lilo.conf" 22 70
- elif [ "$T_PX" = "/" -a -r /etc/lilo.conf ]; then
- dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/etc/lilo.conf" 22 70
- else
+ dialog --title "CAN'T ADD LINUX PARTITION" --msgbox "You can't add \
+ partitions unless you start over with a new LILO header." 6 60
diff --git a/patches/liloconfig_14.2.patch b/patches/liloconfig_14.2.patch
new file mode 100644
index 0000000..47cae65
--- /dev/null
+++ b/patches/liloconfig_14.2.patch
@@ -0,0 +1,819 @@
+--- liloconfig.orig 2015-02-20 02:48:51.000000000 +0100
++++ liloconfig 2020-12-05 12:48:42.535216766 +0100
+@@ -1,8 +1,8 @@
+ #!/bin/sh
+ #
+-# Copyright 1994, 1998, 1999 Patrick Volkerding, Moorhead, Minnesota USA
++# Copyright 1994, 1998, 1999 Patrick Volkerding, Moorhead, Minnesota USA
+ # Copyright 2002, 2003 Slackware Linux, Inc, Concord, CA
+-# Copyright 2007, 2008, 2011, 2013 Patrick Volkerding, Sebeka, Minnesota, USA
++# Copyright 2007, 2008, 2011, 2013, 2018, 2020 Patrick Volkerding, Sebeka, Minnesota, USA
+ # All rights reserved.
+ #
+ # Redistribution and use of this script, with or without modification, is
+@@ -22,14 +22,19 @@
+ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
++# This script installs the lilo boot loader.
++# The kernel used will be whatever the symlink /boot/vmlinuz points to,
++# and if /boot/initrd.gz exists, that will be installed as the initrd.
++#
++
+ TMP=/var/log/setup/tmp
+ CONSOLETYPE=standard
+ unset UTFVT
+
+ # Most of the time LILO is not used on UEFI machines (in fact, it is useless
+-# unless the machine is running in legacy BIOS mode). So, we'll detect if
++# unless the machine is running in legacy BIOS mode). So, we'll detect if
+ # this is a machine running UEFI and suggest skipping LILO installation.
+-# We'll still allow it if the user wants it, though. It won't hurt anything,
++# We'll still allow it if the user wants it, though. It won't hurt anything,
+ # and might be useful for booting in Legacy BIOS mode later.
+ if [ -d /sys/firmware/efi ]; then
+ dialog --title "UEFI FIRMWARE DETECTED" \
+@@ -37,7 +42,7 @@
+ --menu \
+ "Since LILO (the traditional Linux Loader) does not work with machines \
+ running UEFI firmware (except in Legacy BIOS mode), you probably do not \
+-need to install it. Instead, you'll need ELILO, which is a version of \
++need to install it. Instead, you'll need ELILO, which is a version of \
+ LILO designed to work with EFI/UEFI systems." \
+ 12 70 2 \
+ "skip" "Skip installing LILO and proceed to ELILO installation" \
+@@ -45,7 +50,7 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ exit
+ fi
+- REPLY="`cat $TMP/reply`"
++ REPLY="$(cat $TMP/reply)"
+ rm -f $TMP/reply
+ if [ "$REPLY" = "skip" ]; then
+ exit
+@@ -54,7 +59,7 @@
+
+ # Set the OS root directory (called T_PX for some unknown reason).
+ # If an argument is given to this script and it is a directory, it
+-# is taken to be the root directory. First though, we check for a
++# is taken to be the root directory. First though, we check for a
+ # directory named $T_PX, and that gets the first priority.
+ if [ ! -d "$T_PX" ]; then
+ if [ ! "$1" = "" ]; then
+@@ -79,7 +84,7 @@
+ fi
+
+ # If os-prober is availible, we will use it to filter out unbootable
+-# FAT/NTFS partitions. If it is not availble, we'll use /bin/true
++# FAT/NTFS partitions. If it is not availble, we'll use /bin/true
+ # instead to avoid filtering.
+ if which os-prober > /dev/null ; then
+ OSPROBER=os-prober
+@@ -100,7 +105,7 @@
+ Welcome to the LILO Boot Loader!
+
+ Please enter the name of the partition you would like to boot
+-at the prompt below. The choices are:
++at the prompt below. The choices are:
+
+ EOF
+ fi
+@@ -143,7 +127,7 @@
+ dialog --title "OPTIONAL SLACKWARE LOGO BOOT SCREEN" \
+ --yesno \
+ "Would you like to use a boot screen with the Slackware logo \
+-against a black background? If you answer no here, the standard \
++against a black background? If you answer no here, the standard \
+ LILO menu will be used.\n\
+ " 7 65 2> $TMP/reply
+ RETVAL=$?
+@@ -161,7 +145,7 @@
+ # Location of the option table: location x, location y, number of
+ # columns, lines per column (max 15), "spill" (this is how many
+ # entries must be in the first column before the next begins to
+-# be used. We don't specify it here, as there's just one column.
++# be used. We don't specify it here, as there's just one column.
+ bmp-table = 60,6,1,16
+ # Timer location x, timer location y, foreground color,
+ # background color, shadow color.
+@@ -175,12 +159,12 @@
+ dialog --title "CONFIGURE LILO TO USE FRAME BUFFER CONSOLE?" \
+ --default-item standard \
+ --menu "Looking at /proc/devices, it seems your kernel has support for \
+-the VESA frame buffer console. If we enable this in /etc/lilo.conf, it \
++the VESA frame buffer console. If we enable this in /etc/lilo.conf, it \
+ will allow more rows and columns of text on the screen and give you a cool \
+-penguin logo at boot time. However, the frame buffer text console is \
+-slower than a standard text console. In addition, not every video card \
++penguin logo at boot time. However, the frame buffer text console is \
++slower than a standard text console. In addition, not every video card \
+ or monitor supports all of these video modes, and some X drivers could be \
+-confused by them. Would you like to use the frame buffer console, \
++confused by them. Would you like to use the frame buffer console, \
+ or the standard Linux console?" 0 0 0 \
+ "standard" "Use the standard Linux console (the safe choice)" \
+ "ask" "Ask about using VESA modes at boot; time out to standard" \
+@@ -198,7 +182,7 @@
+ exit
+ fi
+ # Frame buffer modes above 1024x768 look terrible except
+-# on LCD panels, and 32 bit color is slow. Since we don't
++# on LCD panels, and 32 bit color is slow. Since we don't
+ # even need to run a framebuffer console to run framebuffer
+ # X anymore, these modes aren't of much real use.
+ # "1280x1024x256" "Frame buffer console, 1280x1024x256" \
+@@ -212,7 +196,7 @@
+ # "1024x768x16m" "Frame buffer console, 1024x768x16.8m" \
+ # "1280x1024x16m" "Frame buffer console, 1280x1024x16.8m" \
+ # "1600x1200x16m" "Frame buffer console, 1600x1200x16.8m"
+- CONSOLETYPE="`cat $TMP/reply`"
++ CONSOLETYPE="$(cat $TMP/reply)"
+ if [ "$CONSOLETYPE" = "1600x1200x16m" ]; then
+ CONSOLENUM=799
+ elif [ "$CONSOLETYPE" = "1600x1200x64k" ]; then
+@@ -262,21 +246,51 @@
+ dialog --title "OPTIONAL LILO append=\"<kernel parameters>\" LINE" --inputbox \
+ "Some systems might require extra parameters to be passed to the kernel. \
+ If you needed to pass parameters to the kernel when you booted the Slackware \
+-bootdisk, you'll probably want to enter the same ones here. Most \
+-systems won't require any extra parameters. If you don't need any, just \
++bootdisk, you'll probably want to enter the same ones here. Most \
++systems won't require any extra parameters. If you don't need any, just \
+ hit ENTER to continue.\n\
+ " 12 72 2> $TMP/reply
+ RETVAL=$?
+ return $RETVAL
+ }
+
+-ask_utf() {
+- dialog --defaultno --title "USE UTF-8 TEXT CONSOLE?" --yesno \
+-"Beginning with the 2.6.24 kernel, the text consoles default to UTF-8 mode. \
+-Unless you are using a UTF-8 locale (\$LANG setting), using the old default \
+-of a non-UTF text console is safer until some issues with various console \
+-programs are addressed. This option has no effect on the use of UTF-8 with X. \
+-\"No\" is the safe choice here." 10 70
++# This function scans for the Master Boot Record,
++# if we are going to install lilo to the MBR.
++# The output will be a file "$TMP/LILOMBR" with the device name written to it.
++find_mbr()
++{
++ MBR_TARGET=/dev/sda
++ echo $MBR_TARGET > $TMP/LILOMBR
++ cat /proc/partitions | while read LINE ; do
++ MAJOR="$(echo $LINE | cut -f 1 -d ' ')"
++ MINOR="$(echo $LINE | cut -f 2 -d ' ')"
++ if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
++ if [ "$MAJOR" = "3" ]; then
++ MBR_TARGET=/dev/hda
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
++ MBR_TARGET=/dev/hdc
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
++ MBR_TARGET=/dev/hde
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
++ MBR_TARGET=/dev/hdg
++ echo $MBR_TARGET > $TMP/LILOMBR
++ elif [ "$MAJOR" = "259" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" -a ! "$MBR_TARGET" = "/dev/hdg" ]; then
++ if [ "$(echo $LINE | cut -f 4 -d ' ' | cut -b 1-4)" = "nvme" ]; then
++ MBR_TARGET="/dev/$(echo $LINE | cut -f 4 -d ' ' | cut -f 1 -d p)"
++ echo $MBR_TARGET > $TMP/LILOMBR
++ fi
++ fi
++ if dmidecode 2> /dev/null | grep -q QEMU 2> /dev/null ; then
++ if [ -r /dev/vda ]; then
++ MBR_TARGET=/dev/vda
++ echo $MBR_TARGET > $TMP/LILOMBR
++ fi
++ fi
++ fi
++ done
+ }
+
+ # This function scans for bootable partitions (making some assumptions along
+@@ -290,89 +304,14 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ APPEND=""
+ fi
+- APPEND="`cat $TMP/reply`"
+-
+- ask_utf;
+- if [ $? = 1 -o $? = 255 ]; then
+- UTFVT="vt.default_utf8=0"
+- else
+- UTFVT="vt.default_utf8=1"
+- fi
++ APPEND="$(cat $TMP/reply)"
+
+- if PROBE -l | grep 'OS/2 Boot Manager' 1> /dev/null 2> /dev/null ; then
+- dialog --title "OS/2 BOOT MANAGER FOUND" --yesno \
+- "Your system appears to have Boot Manager, a boot menu system provided \
+-with OS/2 and Partition Magic. If you like, we can install a very simple \
+-LILO boot block at the start of your Linux partition. Then, you can \
+-add the partition to the Boot Manager menu, and you'll be able to use \
+-Boot Manager to boot Linux. Would you like to install LILO in a Boot \
+-Manager compatible way?" 11 65
+- FLAG=$?
+- if [ ! $FLAG = 0 -a ! $FLAG = 1 ]; then
+- exit 1
+- fi
+- if [ $FLAG = 0 ]; then # yes, use BM
+- if [ -r $T_PX/etc/lilo.conf ]; then
+- mv $T_PX/etc/lilo.conf $T_PX/etc/lilo.conf.orig
+- fi
+- cat << EOF > $T_PX/etc/lilo.conf
+-# LILO configuration file
+-# generated by 'liloconfig'
+-#
+-# Start LILO global section
+-#
+-EOF
+- if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
+- echo "# Append any additional kernel parameters:" >> $T_PX/etc/lilo.conf
+- echo "append=\"$APPEND $UTFVT\"" >> $T_PX/etc/lilo.conf
+- fi
+- cat << EOF >> $T_PX/etc/lilo.conf
+-boot = $ROOT_DEVICE
+-#delay = 5
+-#compact # faster, but won't work on all systems.
+-EOF
+- if [ $CONSOLETYPE = standard ]; then
+- cat << EOF >> $T_PX/etc/lilo.conf
+-# Normal VGA console
+-vga = normal
+-# Ask for video mode at boot (time out to normal in 30s)
+-#vga = ask
+-EOF
+- elif [ $CONSOLETYPE = ask ]; then
+- cat << EOF >> $T_PX/etc/lilo.conf
+-# Ask for video mode at boot (time out to normal in 30s)
+-vga = ask
+-# Normal VGA console
+-#vga = normal
+-EOF
+- else
+- cat << EOF >> $T_PX/etc/lilo.conf
+-# VESA framebuffer at $CONSOLETYPE
+-vga = $CONSOLENUM
+-# Ask for video mode at boot (time out to normal in 30s)
+-#vga = ask
+-# Normal VGA console
+-#vga = normal
+-EOF
+- fi
+- cat << EOF >> $T_PX/etc/lilo.conf
+-# End LILO global section
+-# Linux root partition section
+-image = $KERNEL
+- root = $ROOT_DEVICE
+- label = Linux
+- read-only
+-# End root Linux partition section
+-EOF
+- installcolor;
+- return
+- fi # Use Boot Manager
+- fi # Boot Manager detected
+ # If we got here, we either don't have boot manager or don't want to use it
++ # Note 3/2018: or OS/2 Boot Manager cruft was removed ;-)
+ dialog --title "SELECT LILO DESTINATION" $DEFAULT --menu \
+ "LILO can be installed to a variety of places:\n\
+ \n\
+- 1. The superblock of your root Linux partition. (which could\n\
++ 1. The superblock of your root Linux partition. (which could\n\
+ be made the bootable partition with Windows or Linux fdisk, or\n\
+ booted with a program like OS/2 Boot Manager)\n\
+ 2. A formatted floppy disk.\n\
+@@ -389,33 +328,15 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ exit
+ fi
+- TG="`cat $TMP/reply`"
++ TG="$(cat $TMP/reply)"
+ rm -r $TMP/reply
++ dialog --infobox "\nScanning partitions and generating /etc/lilo.conf..." 5 57
++ sleep 1
+ if [ "$TG" = "MBR" ]; then
+- MBR_TARGET=/dev/sda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- cat /proc/partitions | while read LINE ; do
+- MAJOR="`echo $LINE | cut -f 1 -d ' '`"
+- MINOR="`echo $LINE | cut -f 2 -d ' '`"
+- if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
+- if [ "$MAJOR" = "3" ]; then
+- MBR_TARGET=/dev/hda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
+- MBR_TARGET=/dev/hdc
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
+- MBR_TARGET=/dev/hde
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
+- MBR_TARGET=/dev/hdg
+- echo $MBR_TARGET > $TMP/LILOMBR
+- fi
+- fi
+- done
+- LILO_TARGET=`cat $TMP/LILOMBR`
++ find_mbr
++ LILO_TARGET=$(cat $TMP/LILOMBR)
+ elif [ "$TG" = "Root" ]; then
+- LILO_TARGET=`echo $ROOT_DEVICE`
++ LILO_TARGET=$(echo $ROOT_DEVICE)
+ elif [ "$TG" = "Floppy" ]; then
+ LILO_TARGET="/dev/fd0"
+ fi
+@@ -425,14 +346,19 @@
+ #
+ # Start LILO global section
+ EOF
+- if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
++ #if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
+ echo "# Append any additional kernel parameters:" >> $T_PX/etc/lilo.conf
+ echo "append=\"$APPEND $UTFVT\"" >> $T_PX/etc/lilo.conf
++ echo >> $T_PX/etc/lilo.conf
++ #fi
++
++ if echo $LILO_TARGET | grep -q vda 2>/dev/null ; then
++ echo "disk = /dev/vda bios=0x80 max-partitions=7" >> $T_PX/etc/lilo.conf
+ fi
+ cat << EOF >> $T_PX/etc/lilo.conf
+ boot = $LILO_TARGET
+-
+-#compact # faster, but won't work on all systems.
++# This option loads the kernel and initrd much faster:
++compact
+
+ # Boot BMP Image.
+ # Bitmap in BMP format: 640x480x8
+@@ -443,7 +369,7 @@
+ # Location of the option table: location x, location y, number of
+ # columns, lines per column (max 15), "spill" (this is how many
+ # entries must be in the first column before the next begins to
+-# be used. We don't specify it here, as there's just one column.
++# be used. We don't specify it here, as there's just one column.
+ bmp-table = 60,6,1,16
+ # Timer location x, timer location y, foreground color,
+ # background color, shadow color.
+@@ -514,7 +440,7 @@
+ # OK, now let's look for Windows partitions:
+ # If we have os-prober, use the Windows partition list from that:
+ if which os-prober > /dev/null ; then
+- DOSP="$(os-prober 2> /dev/null | grep Windows | cut -f 1 -d :)"
++ DOSP="$(os-prober 2> /dev/null | grep :Windows: | cut -f 1 -d :)"
+ else # use PROBE output:
+ DOSP="$(PROBE -l | grep "DOS
+ Win
+@@ -522,10 +448,10 @@
+ FAT12
+ FAT16
+ HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort )"
+- DOSP="`echo $DOSP | cut -f 1 -d ' '`"
++ DOSP="$(echo $DOSP | cut -f 1 -d ' ')"
+ fi
+ if [ ! "$DOSP" = "" ]; then
+- TABLE="`echo $DOSP | cut -b1-8`"
++ TABLE="$(echo $DOSP | cut -b1-8)"
+ cat << EOF >> $T_PX/etc/lilo.conf
+ # Windows bootable partition config begins
+ other = $DOSP
+@@ -536,10 +462,21 @@
+ echo "Windows - (Windows FAT/NTFS partition)" >> $T_PX/boot/boot_message.txt
+ fi
+ # Next, we search for Linux partitions:
+- LNXP="`PROBE -l | grep "Linux$"`"
+- LNXP="`echo $LNXP | cut -f 1 -d ' ' | sort`"
++ LNXP="$(PROBE -l | grep "Linux$")"
++ LNXP="$(echo $LNXP | cut -f 1 -d ' ' | sort)"
+ if [ ! "$LNXP" = "" ]; then
+- cat << EOF >> $T_PX/etc/lilo.conf
++ if [ -r $T_PX/boot/initrd.gz ]; then
++ cat << EOF >> $T_PX/etc/lilo.conf
++# Linux bootable partition config begins
++image = $KERNEL
++ initrd = /boot/initrd.gz
++ #root = $ROOT_DEVICE
++ label = Linux
++ read-only
++# Linux bootable partition config ends
++EOF
++ else
++ cat << EOF >> $T_PX/etc/lilo.conf
+ # Linux bootable partition config begins
+ image = $KERNEL
+ root = $ROOT_DEVICE
+@@ -547,14 +484,15 @@
+ read-only
+ # Linux bootable partition config ends
+ EOF
++ fi
+ echo "Linux - (Linux partition)" >> $T_PX/boot/boot_message.txt
+ fi
+ # DEAD CODE, BUT IN CASE OS/2 MAKES A COMEBACK!
+ # # OK, hopefully we can remember how to deal with OS/2 :^)
+-# OS2P="`PROBE -l | grep "HPFS"`"
+-# OS2P="`echo $OS2P | cut -f 1 -d ' ' | sort`"
++# OS2P="$(PROBE -l | grep "HPFS")"
++# OS2P="$(echo $OS2P | cut -f 1 -d ' ' | sort)"
+ # if [ ! "$OS2P" = "" ]; then
+-# TABLE="`echo $OS2P | cut -b1-8`"
++# TABLE="$(echo $OS2P | cut -b1-8)"
+ # if [ "$TABLE" = "/dev/hda" ]; then
+ # cat << EOF >> $T_PX/etc/lilo.conf
+ ## OS/2 bootable partition config begins
+@@ -636,7 +574,7 @@
+ installcolor()
+ {
+ checkbootsplash;
+- dialog --infobox "\nInstalling the Linux Loader..." 5 40
++ dialog --infobox "\nInstalling the Linux Loader..." 5 35
+ if [ "$T_PX" = "/" ]; then
+ lilo 1> /dev/null 2> /etc/lilo-error.$$
+ SUCCESS=$?
+@@ -665,11 +603,11 @@
+ echo >> /etc/lilo-error.$$
+ cat << EOF >> /etc/lilo-error.$$
+ Sorry, but the attempt to install LILO has returned an error, so LILO \
+-has not been correctly installed. You'll have to use a bootdisk \
++has not been correctly installed. You'll have to use a bootdisk \
+ to start your \
+-machine instead. It should still be possible to get LILO working by \
+-editing the /etc/lilo.conf and reinstalling LILO manually. See the \
+-LILO man page and documentation in $LILODOCDIR for more help. \
++machine instead. It should still be possible to get LILO working by \
++editing the /etc/lilo.conf and reinstalling LILO manually. See the \
++LILO man page and documentation in $LILODOCDIR for more help. \
+ The error message may be seen above.
+ EOF
+ dialog --msgbox "$(cat /etc/lilo-error.$$)" 0 0
+@@ -710,8 +648,8 @@
+ LILO INSTALL ERROR # $SUCCESS
+
+ Sorry, but the attempt to install LILO has returned an error, so LILO
+-has not been correctly installed. You'll have to use a bootdisk to
+-start your machine instead. It should still be possible to get LILO
++has not been correctly installed. You'll have to use a bootdisk to
++start your machine instead. It should still be possible to get LILO
+ working by editing the /etc/lilo.conf and reinstalling LILO manually.
+ See the LILO man page and documentation in $LILODOCDIR for more
+ help.
+@@ -723,13 +661,13 @@
+ # 'probe()' borrowed from LILO QuickInst.
+ probe()
+ {
+- [ ! -z "`dd if=$1 bs=1 count=1 2>/dev/null | tr '\0' x`" ]
++ [ ! -z "$(dd if=$1 bs=1 count=1 2>/dev/null | tr '\0' x)" ]
+ return
+ }
+
+ # Figure out if we're installing from the hard drive
+ if [ -r $TMP/SeTT_PX ]; then
+- T_PX="`cat $TMP/SeTT_PX`"
++ T_PX="$(cat $TMP/SeTT_PX)"
+ else
+ if [ "$T_PX" = "" -a ! "$1" = "" ]; then
+ T_PX=$1
+@@ -746,15 +684,17 @@
+ ROOT_DEVICE=$2
+ if [ "$ROOT_DEVICE" = "" ]; then
+ if [ -r $TMP/SeTrootdev ]; then
+- ROOT_DEVICE="`cat $TMP/SeTrootdev`"
++ ROOT_DEVICE="$(cat $TMP/SeTrootdev)"
+ else
+- ROOT_DEVICE="`mount | cut -f 1 -d " " | sed -n "1 p"`"
++ ROOT_DEVICE="$(mount | grep " on $T_PX " | cut -f 1 -d " " | head -n 1)"
+ fi
+ fi
+ # Figure out where the kernel is:
+ ARCHTYPE=i386
+ if [ -r $T_PX/vmlinuz ]; then
+ KERNEL=/vmlinuz
++elif [ -r $T_PX/boot/vmlinuz-generic ] && [ -r $T_PX/boot/initrd.gz ]; then
++ KERNEL=/boot/vmlinuz-generic
+ elif [ -r $T_PX/boot/vmlinuz ]; then
+ KERNEL=/boot/vmlinuz
+ elif [ -r $T_PX/usr/src/linux/arch/$ARCHTYPE/boot/bzImage ]; then
+@@ -767,11 +707,11 @@
+
+ # If we're installing from the umsdos.gz rootdisk, suggest skipping LILO:
+ if [ ! "$T_PX" = "/" ]; then
+- if mount | grep " on /mnt " | grep umsdos 1> /dev/null 2> /dev/null ; then
++ if mount | grep " on $T_PX " | grep umsdos 1> /dev/null 2> /dev/null ; then
+ dialog --title "SKIP LILO CONFIGURATION? (RECOMMENDED)" --yesno "Since \
+ you are installing to a FAT partition, it's suggested that you do not \
+-configure LILO at this time. (Instead, use your bootdisk. For booting \
+-off the hard drive from MS-DOS, you can use Loadlin. You'll find \
++configure LILO at this time. (Instead, use your bootdisk. For booting \
++off the hard drive from MS-DOS, you can use Loadlin. You'll find \
+ Loadlin on your hard drive in \LINUX\ROOT) Skip LILO configuration \
+ (highly recommended)?" 10 70
+ if [ $? = 0 ]; then
+@@ -781,13 +721,13 @@
+ fi
+ # OK, now let's see if we should automate things:
+ dialog --title "INSTALL LILO" --menu "LILO (Linux Loader) is a generic \
+-boot loader. There's a simple installation which tries to automatically \
+-set up LILO to boot Linux (also Windows if found). For \
++boot loader. There's a simple installation which tries to automatically \
++set up LILO to boot Linux (also Windows if found). For \
+ more advanced users, the expert option offers more control over the \
+-installation process. Since LILO does not work in all cases (and can \
++installation process. Since LILO does not work in all cases (and can \
+ damage partitions if incorrectly installed), there's the third (safe) \
+-option, which is to skip installing LILO for now. You can always install \
+-it later with the 'liloconfig' command. Which option would you like?" \
++option, which is to skip installing LILO for now. You can always install \
++it later with the 'liloconfig' command. Which option would you like?" \
+ 18 67 3 \
+ "simple" "Try to install LILO automatically" \
+ "expert" "Use expert lilo.conf setup menu" \
+@@ -795,7 +735,7 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ exit
+ fi
+- REPLY="`cat $TMP/reply`"
++ REPLY="$(cat $TMP/reply)"
+ rm -f $TMP/reply
+ if [ "$REPLY" = "skip" ]; then
+ exit
+@@ -825,7 +765,7 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ REPLY="Skip"
+ else
+- REPLY="`cat $TMP/reply`"
++ REPLY="$(cat $TMP/reply)"
+ fi
+ rm -r $TMP/reply
+ if [ "$REPLY" = "Begin" ]; then
+@@ -835,22 +775,22 @@
+ HDR="no"
+ continue;
+ else
+- APPEND="`cat $TMP/reply`"
+- fi
+- ask_utf;
+- if [ $? = 1 -o $? = 255 ]; then
+- UTFVT="vt.default_utf8=0"
+- else
+- UTFVT="vt.default_utf8=1"
++ APPEND="$(cat $TMP/reply)"
+ fi
++ #ask_utf;
++ #if [ $? = 1 -o $? = 255 ]; then
++ # UTFVT="vt.default_utf8=0"
++ #else
++ # UTFVT="vt.default_utf8=1"
++ #fi
+ use_framebuffer;
+ dialog --title "SELECT LILO TARGET LOCATION" $DEFAULT --menu "LILO can be installed \
+ to a variety of places: \
+ the superblock of your root Linux partition (which could then be made the \
+ bootable partition with fdisk), a formatted floppy disk, \
+-or the master boot record of your first hard drive. If you're using \
++or the master boot record of your first hard drive. If you're using \
+ a boot system such as Boot Manager, you should use the "Root" \
+-selection. Please pick a target location:" 15 65 3 \
++selection. Please pick a target location:" 15 65 3 \
+ "Root" "Install to superblock (not for use with XFS)" \
+ "Floppy" "Use a formatted floppy disk in the boot drive" \
+ "MBR" "Use the Master Boot Record (possibly unsafe)" \
+@@ -860,42 +800,22 @@
+ continue;
+ else
+ LNX="no"
+- TG="`cat $TMP/reply`"
++ TG="$(cat $TMP/reply)"
+ fi
+ rm -r $TMP/reply
+ if [ "$TG" = "MBR" ]; then
+- MBR_TARGET=/dev/sda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- cat /proc/partitions | while read LINE ; do
+- MAJOR="`echo $LINE | cut -f 1 -d ' '`"
+- MINOR="`echo $LINE | cut -f 2 -d ' '`"
+- if [ ! "$MINOR" = "0" -a ! "$MINOR" = "64" ]; then # ignore whole devices to weed out CD drives
+- if [ "$MAJOR" = "3" ]; then
+- MBR_TARGET=/dev/hda
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "22" -a ! "$MBR_TARGET" = "/dev/hda" ]; then
+- MBR_TARGET=/dev/hdc
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "33" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" ]; then
+- MBR_TARGET=/dev/hde
+- echo $MBR_TARGET > $TMP/LILOMBR
+- elif [ "$MAJOR" = "34" -a ! "$MBR_TARGET" = "/dev/hda" -a ! "$MBR_TARGET" = "/dev/hdc" -a ! "$MBR_TARGET" = "/dev/hde" ]; then
+- MBR_TARGET=/dev/hdg
+- echo $MBR_TARGET > $TMP/LILOMBR
+- fi
+- fi
+- done
+- LILO_TARGET=`cat $TMP/LILOMBR`
++ find_mbr
++ LILO_TARGET=$(cat $TMP/LILOMBR)
+ dialog --title "CONFIRM LOCATION TO INSTALL LILO" --inputbox \
+-"The auto-detected location to install the LILO boot block is shown below. \
+-If you need to make any changes, you can make them below. Otherwise, hit \
++"The auto-detected location to install the LILO boot block is shown below. \
++If you need to make any changes, you can make them below. Otherwise, hit \
+ ENTER to accept the target location shown." 11 60 $LILO_TARGET 2> $TMP/reply
+ if [ $? = 0 ]; then
+- LILO_TARGET="`cat $TMP/reply`"
++ LILO_TARGET="$(cat $TMP/reply)"
+ fi
+ rm -f $TMP/reply
+ elif [ "$TG" = "Root" ]; then
+- LILO_TARGET=`echo $ROOT_DEVICE`
++ LILO_TARGET=$(echo $ROOT_DEVICE)
+ elif [ "$TG" = "Floppy" ]; then
+ LILO_TARGET="/dev/fd0"
+ else
+@@ -903,7 +823,7 @@
+ continue;
+ fi
+ dialog --title "CHOOSE LILO TIMEOUT" --menu "At boot time, how long would \
+-you like LILO to wait for you to select an operating system? If you \
++you like LILO to wait for you to select an operating system? If you \
+ let LILO time out, it will boot the first OS in the configuration file by \
+ default." 13 74 4 \
+ "None" "Don't wait at all - boot straight into the first OS" \
+@@ -914,7 +834,7 @@
+ HDR="no"
+ continue;
+ else
+- TIMEOUT="`cat $TMP/reply`"
++ TIMEOUT="$(cat $TMP/reply)"
+ fi
+ rm -r $TMP/reply
+ if [ "$TIMEOUT" = "None" ]; then
+@@ -939,8 +859,13 @@
+ #
+ # Start LILO global section
+ boot = $LILO_TARGET
+-
+-#compact # faster, but won't work on all systems.
++EOF
++ if echo $LILO_TARGET | grep -q vda 2>/dev/null ; then
++ echo "disk = /dev/vda bios=0x80 max-partitions=7" >> $TMP/lilo.conf
++ fi
++ cat << EOF >> $TMP/lilo.conf
++# This option loads the kernel and initrd much faster:
++compact
+
+ EOF
+ # Boot splash
+@@ -962,10 +887,10 @@
+
+ EOF
+ fi
+- if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
++ #if [ ! "$APPEND" = "" -o ! "$UTFVT" = "" ]; then
+ echo "# Append any additional kernel parameters:" >> $TMP/lilo.conf
+ echo "append=\"$APPEND $UTFVT\"" >> $TMP/lilo.conf
+- fi
++ #fi
+ cat << EOF >> $TMP/lilo.conf
+ $PROMPT
+ $TIMEOUT
+@@ -1020,6 +945,8 @@
+ EOF
+ HDR="yes"
+ elif [ "$REPLY" = "Linux" ]; then
++ dialog --infobox "\nScanning for Linux partitions..." 5 37
++ sleep 1
+ if [ "$HDR" = "yes" ]; then
+ if [ "$ROOT_DEVICE" != "" ]; then
+ DEFROOT="--default-item $ROOT_DEVICE"
+@@ -1040,7 +967,7 @@
+ continue
+ fi
+ rm $TMP/tmpmsg
+- LINUX_PART="`cat $TMP/reply`"
++ LINUX_PART="$(cat $TMP/reply)"
+ checkp_dialog $LINUX_PART
+ if [ ! $? = 0 ]; then
+ continue;
+@@ -1053,8 +980,19 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ continue
+ fi
+- LABEL="`cat $TMP/reply`"
+- cat << EOF >> $TMP/lilo.conf
++ LABEL="$(cat $TMP/reply)"
++ if [ -r $T_PX/boot/initrd.gz ]; then
++ cat << EOF >> $TMP/lilo.conf
++# Linux bootable partition config begins
++image = $KERNEL
++ initrd = /boot/initrd.gz
++ #root = $LINUX_PART
++ label = $LABEL
++ read-only # Partitions should be mounted read-only for checking
++# Linux bootable partition config ends
++EOF
++ else
++ cat << EOF >> $TMP/lilo.conf
+ # Linux bootable partition config begins
+ image = $KERNEL
+ root = $LINUX_PART
+@@ -1062,6 +1000,7 @@
+ read-only # Partitions should be mounted read-only for checking
+ # Linux bootable partition config ends
+ EOF
++ fi
+ else
+ dialog --title "CAN'T ADD LINUX PARTITION" --msgbox "You can't add \
+ partitions unless you start over with a new LILO header." 6 60
+@@ -1081,13 +1020,13 @@
+ echo >> $TMP/tmpmsg
+ echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
+ dialog --title "SELECT OS/2 PARTITION" --no-collapse --inputbox \
+-"`cat $TMP/tmpmsg`" 20 74 2> $TMP/reply
++"$(cat $TMP/tmpmsg)" 20 74 2> $TMP/reply
+ if [ $? = 1 -o $? = 255 ]; then
+ rm $TMP/tmpmsg
+ continue
+ fi
+ rm $TMP/tmpmsg
+- OS_2_PART="`cat $TMP/reply`"
++ OS_2_PART="$(cat $TMP/reply)"
+ checkp_dialog $OS_2_PART
+ if [ ! $? = 0 ]; then
+ continue;
+@@ -1100,9 +1039,9 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ continue
+ fi
+- LABEL="`cat $TMP/reply`"
+- TABLE="`echo $OS_2_PART | cut -b1-8`"
+- if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
++ LABEL="$(cat $TMP/reply)"
++ TABLE="$(echo $OS_2_PART | cut -b1-8)"
++ if [ "$(echo $TABLE | cut -b6-8)" = "hda" ]; then
+ cat << EOF >> $TMP/lilo.conf
+ # OS/2 bootable partition config begins
+ other = $OS_2_PART
+@@ -1131,9 +1070,11 @@
+ fi
+ LNX="yes"
+ elif [ "$REPLY" = "Windows" ]; then
++ dialog --infobox "\nScanning for Windows partitions..." 5 39
++ sleep 1
+ if [ "$HDR" = "yes" ]; then
+- echo "These are possibly Windows or DOS partitions. They will be treated" > $TMP/tmpmsg
+- echo "as such if you install them using this menu." >> $TMP/tmpmsg
++ echo "These are possibly Windows partitions. They will be treated as" > $TMP/tmpmsg
++ echo "such if you install them using this menu." >> $TMP/tmpmsg
+ echo >> $TMP/tmpmsg
+ echo " Device Boot Start End Blocks Id System" >> $TMP/tmpmsg
+ PROBE -l | grep "DOS
+@@ -1141,17 +1082,17 @@
+ W95
+ FAT12
+ FAT16
+-HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort | grep "$($OSPROBER 2> /dev/null | grep Windows | cut -f 1 -d :)" >> $TMP/tmpmsg
++HPFS" | grep -v "Ext'd" | grep -v "Extend" | sort | grep "$($OSPROBER 2> /dev/null | grep :Windows: | cut -f 1 -d :)" >> $TMP/tmpmsg
+ echo >> $TMP/tmpmsg
+ echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
+ dialog --title "SELECT WINDOWS PARTITION" --no-collapse --inputbox \
+-"`cat $TMP/tmpmsg`" 20 74 2> $TMP/reply
++"$(cat $TMP/tmpmsg)" 20 74 2> $TMP/reply
+ if [ $? = 1 -o $? = 255 ]; then
+ rm $TMP/tmpmsg
+ continue
+ fi
+ rm $TMP/tmpmsg
+- DOSPART="`cat $TMP/reply`"
++ DOSPART="$(cat $TMP/reply)"
+ checkp_dialog $DOSPART
+ if [ ! $? = 0 ]; then
+ continue;
+@@ -1164,13 +1105,13 @@
+ if [ $? = 1 -o $? = 255 ]; then
+ continue
+ fi
+- LABEL="`cat $TMP/reply`"
++ LABEL="$(cat $TMP/reply)"
+ unset USE_LOADER
+- TABLE="`echo $DOSPART | cut -b1-8`"
+- if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
++ TABLE="$(echo $DOSPART | cut -b1-8)"
++ if [ "$(echo $TABLE | cut -b6-8)" = "hda" ]; then
+ USE_LOADER="no"
+ fi
+- if [ "`echo $TABLE | cut -b6-8`" = "sda" ]; then
++ if [ "$(echo $TABLE | cut -b6-8)" = "sda" ]; then
+ if probe /dev/hda; then
+ USE_LOADER="yes"
+ else
+@@ -1236,8 +1177,8 @@
+ if [ -r $TMP/lilo.conf ]; then
+ dialog --title "YOUR NEW /etc/lilo.conf" --textbox "$TMP/lilo.conf" 22 70
+ else
+- if [ -r /mnt/etc/lilo.conf ]; then
+- dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/mnt/etc/lilo.conf" 22 70
++ if [ -r $T_PX/etc/lilo.conf ]; then
++ dialog --title "YOUR OLD /etc/lilo.conf" --textbox "$T_PX/etc/lilo.conf" 22 70
+ elif [ "$T_PX" = "/" -a -r /etc/lilo.conf ]; then
+ dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/etc/lilo.conf" 22 70
+ else
diff --git a/pkglists/alien.lst b/pkglists/alien.lst
index 30b6ada..c5ba85b 100644
--- a/pkglists/alien.lst
+++ b/pkglists/alien.lst
@@ -1,24 +1,25 @@
# Showcases for using with Slackware Live:
-NetworkManager-openconnect
-NetworkManager-openvpn
+#NetworkManager-openconnect
+#NetworkManager-openvpn
acpilight
-#boost-compat
+boost-compat
calibre
chromium
chromium-pepperflash-plugin
chromium-widevine-plugin
+#cmark
dropbox-client
#ffmpeg
-freerdp
+#freerdp
#gcc5
#gecko-mediaplayer
#gmtk
#gnome-mplayer
gst-plugins-ffmpeg0
gst-plugins-libav
-#icedtea-web
-#icu4c-compat
-keepassx
+icedtea-web
+icu4c-compat
+keepassxc
#lame
libreoffice
#libreoffice-dict-af
@@ -68,13 +69,13 @@ libstatgrab
#libtinfo
libtorrent-rasterbar
#lumina
-mkvtoolnix
+#mkvtoolnix
muparser
netsurf
nodejs
-nvme-cli
+#nvme-cli
openconnect
-openjdk
+openjdk11
#oxygen-gtk2
p7zip
#palemoon
diff --git a/pkglists/cinnamon.conf b/pkglists/cinnamon.conf
index 5e78bd3..d0e95a3 100644
--- a/pkglists/cinnamon.conf
+++ b/pkglists/cinnamon.conf
@@ -2,10 +2,8 @@
# or empty directory, then the content of 'SL_REPO_URL' will be rsync-ed
# to the local directory 'SL_REPO'.
-#SL_REPO_URL="rsync://slackware.uk/csb/${SL_VERSION}/${SL_ARCH}"
-#SL_REPO="/var/cache/liveslak/csb/${SL_VERSION}/${SL_ARCH}"
-SL_REPO_URL="rsync://slackware.uk/csb/14.2/${SL_ARCH}"
-SL_REPO="/var/cache/liveslak/csb/14.2/${SL_ARCH}"
+SL_REPO_URL="rsync://slackware.uk/csb/${SL_VERSION}/${SL_ARCH}"
+SL_REPO="/var/cache/liveslak/csb/${SL_VERSION}/${SL_ARCH}"
# Package root directory:
SL_PKGROOT=${SL_REPO}
diff --git a/pkglists/cinnamon.lst b/pkglists/cinnamon.lst
index 4fb14d8..752fe73 100644
--- a/pkglists/cinnamon.lst
+++ b/pkglists/cinnamon.lst
@@ -18,13 +18,21 @@ cracklib
dbus-python3
gnome-menus
graphviz
+gsound
json-glib
krb5
+libcroco
+libdbusmenu
libgee
libgnomekbd
libgtop
libgusb
+libtimezonemap
+libsass
metacity
+mint-cursor-themes
+mint-themes
+mint-l-icons
mint-y-icons
mint-y-theme
mozjs
@@ -35,14 +43,22 @@ pangox-compat
pexpect
pia-manager
polib
+psutil
ptyprocess
py3cairo
pygobject3-python3
python-pam
python3
+python3-xapp
+python3-webencodings
+pytz
+sassc
setproctitle
speex
tinycss
+tinycss2
vala
+xapp
xapps
+xdotool
zenity
diff --git a/pkglists/daw.lst b/pkglists/daw.lst
deleted file mode 100644
index 411d2d1..0000000
--- a/pkglists/daw.lst
+++ /dev/null
@@ -1,46 +0,0 @@
-# A collection of packages for the digital musician.
-a2jmidid
-alsa-plugins-jack
-amsynth
-ardour
-aubio
-avldrums.lv2
-calf
-cuetools
-drumkit
-drumstick
-eq10q
-helm
-jack2
-ladspa_sdk
-lash
-libconfig
-liblo
-liblrdf
-libmpdclient
-lilv
-lsp-plugins
-lv2
-mac
-mpc
-musescore
-mxml
-ntk
-portaudio
-portmidi
-pulseaudio-jack
-qjackctl
-qsynth
-rubberband
-serd
-shntool
-sord
-sratom
-suil
-supercollider
-vamp-aubio-plugins
-vamp-plugin-sdk
-vmpk
-wxGTK3
-yaml-cpp
-zynaddsubfx
diff --git a/pkglists/kde4add.lst b/pkglists/kde4add.lst
deleted file mode 100644
index 64d68e3..0000000
--- a/pkglists/kde4add.lst
+++ /dev/null
@@ -1,116 +0,0 @@
-# kdesdk:
-cervisia
-dolphin-plugins
-kapptemplate
-kcachegrind
-kde-dev-scripts
-kde-dev-utils
-kdesdk-kioslaves
-kdesdk-strigi-analyzers
-kdesdk-thumbnailers
-okteta
-poxml
-umbrello
-
-# kdebindings:
-smokegen
-smokeqt
-qtruby
-perlqt
-smokekde
-korundum
-perlkde
-pykde4
-kross-interpreters
-
-# kdeutils:
-kremotecontrol
-
-# kdemultimedia:
-juk
-
-# kdenetwork:
-krdc
-
-# kdegames:
-klickety
-kpat
-klines
-ksnakeduel
-kollision
-kshisen
-kblocks
-lskat
-bovo
-kajongg
-granatier
-kiriki
-kigo
-bomber
-kolf
-kbounce
-konquest
-kapman
-killbots
-kubrick
-kgoldrunner
-knetwalk
-kbreakout
-ksirk
-kfourinline
-kblackbox
-palapeli
-katomic
-ktuberling
-kjumpingcube
-kspaceduel
-
-# kdetoys:
-amor
-kteatime
-ktux
-
-# kdepim:
-kdepim
-kdepim-runtime
-
-# kdeedu:
-artikulate
-blinken
-cantor
-kalzium
-kanagram
-kgeography
-khangman
-kig
-kiten
-klettres
-kstars
-kqtquickcharts
-ktouch
-kturtle
-kwordquiz
-marble
-parley
-pairs
-rocs
-step
-
-# kdewebdev:
-kdewebdev
-
-# extragear:
-kaudiocreator
-oxygen-gtk2
-kdevplatform
-kdevelop-pg-qt
-kdevelop
-kdev-python
-kdevelop-php
-kdevelop-php-docs
-#wicd-kde
-amarok
-calligra
-partitionmanager
-k3b
-
diff --git a/pkglists/kde4base.lst b/pkglists/kde4base.lst
deleted file mode 100644
index 9ae964a..0000000
--- a/pkglists/kde4base.lst
+++ /dev/null
@@ -1,284 +0,0 @@
-# deps:
-LibRaw
-PyQt
-akonadi
-attica
-boost
-clucene
-eigen3
-grantlee
-gsl
-libbluedevil
-libcanberra
-libdbusmenu-qt
-libodfgen
-librevenge
-libtasn1
-libvisio
-libwpd
-libwpg
-phonon
-phonon-gstreamer
-qca
-qca-cyrus-sasl
-qca-gnupg
-qca-ossl
-qimageblitz
-qjson
-qt
-qt-gstreamer
-shared-desktop-ontologies
-sip
-soprano
-strigi
-virtuoso-ose
-xapian-core
-
-# kdebase:
-kfilemetadata
-baloo
-baloo-widgets
-nepomuk-core
-nepomuk-widgets
-kde-baseapps
-kactivities
-konsole
-kate
-kde-wallpapers
-kde-workspace
-kde-runtime
-kde-base-artwork
-
-# kdelibs:
-kdelibs
-
-# kdepimlibs.
-kdepimlibs
-
-# kdesdk:
-#cervisia
-#dolphin-plugins
-#kapptemplate
-#kcachegrind
-#kde-dev-scripts
-#kde-dev-utils
-#kdesdk-kioslaves
-#kdesdk-strigi-analyzers
-#kdesdk-thumbnailers
-libkomparediff2
-kompare
-lokalize
-#okteta
-#poxml
-#umbrello
-
-# kdegraphics:
-libkipi
-libkexiv2
-libkdcraw
-libksane
-kdegraphics-mobipocket
-okular
-kdegraphics-strigi-analyzer
-kdegraphics-thumbnailers
-gwenview
-kamera
-kcolorchooser
-kgamma
-kolourpaint
-kruler
-ksaneplugin
-ksnapshot
-svgpart
-
-# kdebindings:
-#smokegen
-#smokeqt
-#qtruby
-#perlqt
-#smokekde
-#korundum
-#perlkde
-#pykde4
-#kross-interpreters
-
-# kdeaccessibility:
-kaccessible
-kmouth
-kmousetool
-kmag
-
-# kdeutils:
-ark
-filelight
-kcalc
-kcharselect
-kdf
-kfloppy
-kgpg
-print-manager
-#kremotecontrol
-ktimer
-kwalletmanager
-superkaramba
-sweeper
-
-# kdemultimedia:
-libkcddb
-libkcompactdisc
-audiocd-kio
-dragon
-mplayerthumbs
-#juk
-kmix
-
-# kdenetwork:
-kdenetwork-filesharing
-kdenetwork-strigi-analyzers
-zeroconf-ioslave
-kget
-kopete
-kppp
-#krdc
-krfb
-
-# oxygen-icons:
-oxygen-icons
-
-# kdeadmin:
-kcron
-ksystemlog
-kuser
-
-# kdeartwork:
-kdeartwork
-
-# kdegames:
-libkdegames
-libkmahjongg
-#klickety
-ksudoku
-ksquares
-#kpat
-#klines
-#ksnakeduel
-#kollision
-#kshisen
-#kblocks
-#lskat
-kreversi
-#bovo
-#kajongg
-#granatier
-kmines
-#kiriki
-#kigo
-#bomber
-#kolf
-kdiamond
-#kbounce
-#konquest
-#kapman
-knavalbattle
-#killbots
-#kubrick
-#kgoldrunner
-#knetwalk
-#kbreakout
-#ksirk
-#kfourinline
-picmi
-#kblackbox
-#palapeli
-#katomic
-#ktuberling
-#kjumpingcube
-kmahjongg
-#kspaceduel
-
-# kdetoys:
-#amor
-#kteatime
-#ktux
-
-# kdepim:
-#kdepim
-#kdepim-runtime
-
-# kdeedu:
-libkdeedu
-analitza
-#artikulate
-#blinken
-#cantor
-kalgebra
-#kalzium
-#kanagram
-kbruch
-#kgeography
-#khangman
-#kig
-#kiten
-#klettres
-kmplot
-#kstars
-#kqtquickcharts
-#ktouch
-#kturtle
-#kwordquiz
-#marble
-#parley
-#pairs
-#rocs
-#step
-
-# kdewebdev:
-#kdewebdev
-
-# kdeplasma-addons:
-kdeplasma-addons
-
-# polkit-kde:
-polkit-kde-agent-1
-polkit-kde-kcmodules-1
-
-# extragear:
-bluedevil
-#kaudiocreator
-kplayer
-kwebkitpart
-#oxygen-gtk2
-#kdevplatform
-#kdevelop-pg-qt
-#kdevelop
-#kdev-python
-#kdevelop-php
-#kdevelop-php-docs
-#wicd-kde
-libmm-qt
-libnm-qt
-plasma-nm
-skanlite
-kio-mtp
-libktorrent
-ktorrent
-#amarok
-#calligra
-libkscreen
-kscreen
-kdeconnect-kde
-#partitionmanager
-#k3b
-
-# Supported languages in the ISO:
-kde-l10n-da
-kde-l10n-de
-kde-l10n-en_GB
-kde-l10n-es
-kde-l10n-fr
-kde-l10n-ja
-kde-l10n-it
-kde-l10n-nl
-kde-l10n-pt_BR
-kde-l10n-pt_PT
-kde-l10n-ru
diff --git a/pkglists/kde4plasma5.lst b/pkglists/kde4plasma5.lst
deleted file mode 100644
index aee96a9..0000000
--- a/pkglists/kde4plasma5.lst
+++ /dev/null
@@ -1,8 +0,0 @@
-# Slackware's KDE4:
-amarok
-kaudiocreator
-kdev-python
-kplayer
-kwebkitpart
-#oxygen-gtk2
-
diff --git a/pkglists/plasma5wayland.conf b/pkglists/ktown.conf
index 0b5bc41..cd37cae 100644
--- a/pkglists/plasma5wayland.conf
+++ b/pkglists/ktown.conf
@@ -2,9 +2,16 @@
# or empty directory, then the content of 'SL_REPO_URL' will be rsync-ed
# to the local directory 'SL_REPO'.
+# Either 'latest' or 'testing':
VARIANT=testing
-SL_REPO_URL="rsync://slackware.uk/people/alien-kde/${SL_VERSION}/${VARIANT}/${SL_ARCH}"
+if [ "${SL_ARCH}" == "x86_64" ]; then
+ LIBSUFFIX="64"
+else
+ LIBSUFFIX=""
+fi
+
+SL_REPO_URL="rsync://slackware.nl/mirrors/alien-kde/${SL_VERSION}/${VARIANT}/${SL_ARCH}"
SL_REPO="/var/cache/liveslak/ktown/${SL_VERSION}/${VARIANT}/${SL_ARCH}"
# Package root directory:
diff --git a/pkglists/plasma5.lst b/pkglists/ktown.lst
index 1cf9613..18d8c74 100644
--- a/pkglists/plasma5.lst
+++ b/pkglists/ktown.lst
@@ -1,150 +1,111 @@
-# Create a rough version of this file using:
-# cd current/testing/x86_64 ; find -name *.t?z |rev |cut -d- -f4- |rev |sort
-#
-# deps:
-ConsoleKit2
-LibRaw
-OpenAL
-PyQt
-PyQt5
-QScintilla
-SDL_sound
-accountsservice
-brotli
-cfitsio
-cracklib
-cryfs
-cryptopp
-ddcutil
-dotconf
-drumstick
-dvdauthor
-elogind
-espeak-ng
-exiv2
-flite
-freecell-solver
-frei0r-plugins
+# Slackware Plasma6 deps:
+futuresql
gpgme
-grantlee
-grantlee-qt4
-hack-font-ttf
-hyphen
-id3lib
-json-glib
-lensfun
-libappindicator
-libburn
-libdbusmenu-gtk
-libdbusmenu-qt5
-libdmtx
-libindicator
-libinput
-libpwquality
-libsass
-libwacom
-libxkbcommon
-lmdb
-mesa
-mlt
-ninja
-#noto-cjk-font-ttf
-noto-font-ttf
+kdsoap
+libQuotient
+libdisplay-info
+libfprint
+olm
opencv
-pcaudiolib
-perl-path-tiny
-perl-template-toolkit
phonon
-phonon-gstreamer
-phonon-vlc
-polkit-qt5-1
+polkit-qt-1
poppler
-python-enum34
-python3-random2
-pyxdg
+python-html5lib
+python-webencodings
+qca
+qcoro
+qt6
+qtkeychain
quazip
-qca-qt5
-qrencode
-qt-gstreamer
-qt5
-qt5-webkit
-qtav
-rttr
-sassc
-sip
-sni-qt
-speech-dispatcher
-vid.stab
-wayland
-wayland-protocols
-woff2
-xorg-server
-
-# telepathy deps:
-farstream
-libaccounts-glib
-libaccounts-qt5
-libnice
-libotr
-libsignon-glib
-signon
-signon-plugin-oauth2
-signon-ui
-telegram-qt
-telepathy-accounts-signon
-telepathy-farstream
-telepathy-gabble
-telepathy-glib
-telepathy-haze
-telepathy-logger
-telepathy-logger-qt5
-telepathy-mission-control
-telepathy-morse
-telepathy-qt5
-
-# kde4 based:
-akonadi4
+wayland-utils
+#
+# Slackware Plasma6:
+#
+# Frameworks 5:
+attica-5
+baloo-5
+frameworkintegration-5
+kactivities-5
+kactivities-stats-5
+kapidox-5
+karchive-5
+kauth-5
+kbookmarks-5
+kcalendarcore-5
+kcmutils-5
+kcodecs-5
+kcompletion-5
+kconfig-5
+kconfigwidgets-5
+kcontacts-5
+kcoreaddons-5
+kcrash-5
+kdav-5
+kdbusaddons-5
+kdeclarative-5
+kded-5
+kdesignerplugin-5
+kdesu-5
+kdewebkit-5
+kdnssd-5
+kdoctools-5
+kemoticons-5
+kfilemetadata-5
+kglobalaccel-5
+kguiaddons-5
+kholidays-5
+khtml-5
+ki18n-5
+kiconthemes-5
+kidletime-5
+kimageformats-5
+kinit-5
+kio-5
+kirigami-5
+kitemmodels-5
+kitemviews-5
+kjobwidgets-5
+kjs-5
+kjsembed-5
+kmediaplayer-5
+knewstuff-5
+knotifications-5
+knotifyconfig-5
+kpackage-5
+kparts-5
+kpeople-5
+kplotting-5
+kpty-5
+kquickcharts-5
+kross-5
+krunner-5
+kservice-5
+ktexteditor-5
+ktextwidgets-5
+kunitconversion-5
+kwallet-5
+kwayland-5
+kwidgetsaddons-5
+kwindowsystem-5
+kxmlgui-5
+kxmlrpcclient-5
+plasma-framework-5
+prison-5
+purpose-5
+qqc2-breeze5-style
+qqc2-desktop-style-5
+solid-5
+sonnet-5
+syndication-5
+syntax-highlighting-5
+threadweaver-5
+# Frameworks:
+attica
baloo
-baloo-widgets
-kactivities
-katepart4
-kdelibs
-kdepimlibs4
-kfilemetadata
-konsolepart4
-korundum
-kross-interpreters
-libkdegames4
-libkexiv2_4
-libkmahjongg4
-libksane4
-nepomuk-core
-nepomuk-widgets
-oktetapart4
-perlkde
-perlqt
-pykde4
-qtruby
-smokegen
-smokekde
-smokeqt
-
-# kde4 extragear:
-audiocd-kio4
-kio-mtp
-libkcddb4
-libkcompactdisc4
-oxygen-gtk2
-
-# frameworks:
-attica-framework
-baloo5
bluez-qt
breeze-icons
extra-cmake-modules
frameworkintegration
-kactivities-framework
-kactivities-stats
kapidox
karchive
kauth
@@ -152,40 +113,33 @@ kbookmarks
kcalendarcore
kcmutils
kcodecs
+kcolorscheme
kcompletion
kconfig
kconfigwidgets
kcontacts
kcoreaddons
kcrash
+kdav
kdbusaddons
kdeclarative
kded
-kdelibs4support
-kdesignerplugin
kdesu
-kdewebkit
kdnssd
kdoctools
-kemoticons
-kfilemetadata5
+kfilemetadata
kglobalaccel
kguiaddons
kholidays
-khtml
ki18n
kiconthemes
kidletime
kimageformats
-kinit
kio
-kirigami2
+kirigami
kitemmodels
kitemviews
kjobwidgets
-kjs
-kjsembed
-kmediaplayer
knewstuff
knotifications
knotifyconfig
@@ -194,21 +148,23 @@ kparts
kpeople
kplotting
kpty
-kross
+kquickcharts
krunner
kservice
+kstatusnotifieritem
+ksvg
ktexteditor
+ktexttemplate
ktextwidgets
kunitconversion
+kuserfeedback
kwallet
kwidgetsaddons
kwindowsystem
kxmlgui
-kxmlrpcclient
modemmanager-qt
networkmanager-qt
-oxygen-icons5
-plasma-framework
+oxygen-icons
prison
purpose
qqc2-desktop-style
@@ -217,8 +173,7 @@ sonnet
syndication
syntax-highlighting
threadweaver
-
-# kdepim:
+# KDEPIM:
akonadi
akonadi-calendar
akonadi-calendar-tools
@@ -229,7 +184,6 @@ akonadi-notes
akonadi-search
akonadiconsole
akregator
-blogilo
calendarsupport
eventviews
grantlee-editor
@@ -237,13 +191,10 @@ grantleetheme
incidenceeditor
kaddressbook
kalarm
-kalarmcal
-kblog
kcalutils
-kdav
kdepim-addons
-kdepim-apps-libs
kdepim-runtime
+khealthcertificate
kidentitymanagement
kimap
kitinerary
@@ -257,6 +208,7 @@ kmime
knotes
kontact
kontactinterface
+kopeninghours
korganizer
kpimtextedit
kpkpass
@@ -271,91 +223,151 @@ mailcommon
mailimporter
mbox-importer
messagelib
+mimetreeparser
pim-data-exporter
pim-sieve-editor
-pim-storage-service-manager
pimcommon
-
-# plasma:
+# Plasma:
+#breeze-plymouth
+#discover
+#ksysguard
+#lancelot
+#plasma-mobile
+#plasma-nano
+#plasma-tests
+#plasma-thunderbolt
+#plasma-welcome
+#plymouth-kcm
bluedevil
breeze
-breeze-gtk
breeze-grub
+breeze-gtk
drkonqi
kactivitymanagerd
kde-cli-tools
kde-gtk-config
kdecoration
kdeplasma-addons
-kgamma5
-khelpcenter
-khotkeys
+kgamma
+kglobalacceld
kinfocenter
kmenuedit
-kscreen2
+kpipewire
+kscreen
kscreenlocker
ksshaskpass
-ksysguard
+ksystemstats
kwallet-pam
kwayland
kwayland-integration
kwin
kwrited
-libkscreen2
+layer-shell-qt
+libkscreen
libksysguard
+libplasma
milou
+ocean-sound-theme
oxygen
+oxygen-sounds
+plasma-activities
+plasma-activities-stats
plasma-browser-integration
plasma-desktop
+plasma-disks
+plasma-firewall
plasma-integration
-plasma-mediacenter
+plasma-nm
plasma-pa
plasma-sdk
+plasma-systemmonitor
plasma-vault
+plasma-workspace
plasma-workspace-wallpapers
-plasma5-nm
-polkit-kde-framework
+plasma5support
+polkit-kde-agent-1
powerdevil
+print-manager
+qqc2-breeze-style
sddm-kcm
systemsettings
-user-manager
+wacomtablet
xdg-desktop-portal-kde
-
-# plasma-extra:
-#kde-wallpapers
-kdeconnect-framework
-latte-dock
+# Plasma Extra:
+##latte-dock
+kirigami-addons
+kmoretools
+kpeoplevcard
+ktextaddons
+libqaccessibilityclient
oxygen-fonts
-polkit-kde-kcmodules-framework
-sddm-qt5
-wacomtablet
-
-# applications:
+plasma-wayland-protocols
+pulseaudio-qt
+sddm
+xwaylandvideobridge
+# Applications:
+#kajongg
+# Still Qt5 based:
+artikulate
+cantor
+cervisia
+juk
+kamoso
+kde-dev-utils
+kdesdk-thumbnailers
+kdev-php
+kdev-python
+kdevelop
+kgpg
+kig
+kio-gdrive
+kipi-plugins
+kmix
+konversation
+kqtquickcharts
+krfb
+ktouch
+kwave
+libkipi
+lokalize
+marble
+poxml
+rocs
+umbrello
+# End Qt5 based
+#kaccounts-integration
+#kaccounts-providers
+#kalendar
+#kalk
+#kfloppy
+#libkgeomap
+#tokodon
+alligator
analitza
ark
-artikulate
audiocd-kio
-baloo5-widgets
+baloo-widgets
blinken
bomber
bovo
-cantor
-cervisia
+colord-kde
dolphin
dolphin-plugins
dragon
+elisa
+falkon
ffmpegthumbs
filelight
+ghostwriter
granatier
gwenview
-juk
+isoimagewriter
+itinerary
k3b
-kaccessible
-kajongg
kalgebra
+kalk
kalzium
kamera
-kamoso
kanagram
kapman
kapptemplate
@@ -373,37 +385,33 @@ kcharselect
kcolorchooser
kcron
kde-dev-scripts
-kde-dev-utils
-kde-runtime
+kde-inotify-survey
kdebugsettings
+kdeconnect-kde
kdeedu-data
kdegraphics-mobipocket
-kdegraphics-strigi-analyzer
kdegraphics-thumbnailers
kdenetwork-filesharing
-kdenetwork-strigi-analyzers
kdenlive
-kdesdk-kioslaves
-kdesdk-strigi-analyzers
-kdesdk-thumbnailers
+kdesdk-kio
kdf
kdialog
kdiamond
keditbookmarks
-kfilereplace
+keysmith
kfind
-kfloppy
kfourinline
kgeography
kget
kgoldrunner
-kgpg
khangman
-kig
+khelpcenter
kigo
killbots
kimagemapeditor
+kio-admin
kio-extras
+kio-zeroconf
kirigami-gallery
kiriki
kiten
@@ -411,11 +419,9 @@ kjumpingcube
klettres
klickety
klines
-klinkstatus
kmag
kmahjongg
kmines
-kmix
kmousetool
kmouth
kmplot
@@ -425,21 +431,19 @@ knights
kolf
kollision
kolourpaint
-kommander
kompare
konqueror
konquest
konsole
-kopete
+kontrast
+kosmindoormap
kpat
-kppp
-kqtquickcharts
+kpmcore
+kpublictransport
krdc
-kremotecontrol
kreversi
-krfb
kruler
-ksaneplugin
+ksanecore
kshisen
ksirk
ksnakeduel
@@ -449,104 +453,60 @@ ksudoku
ksystemlog
kteatime
ktimer
-ktouch
-#ktuberling
+ktorrent
+ktuberling
kturtle
kubrick
kwalletmanager
-kwave
kwordquiz
libkcddb
libkcompactdisc
libkdcraw
-libkdeedu
libkdegames
libkeduvocdocument
libkexiv2
-libkface
-libkgeomap
-libkipi
libkmahjongg
libkomparediff2
libksane
-lokalize
+libktorrent
lskat
-marble
+markdownpart
+merkuro
minuet
-mplayerthumbs
-okteta
okular
palapeli
parley
+partitionmanager
picmi
-poxml
-print-manager
-rocs
+skanlite
+skanpage
spectacle
step
svgpart
sweeper
-umbrello
-zeroconf-ioslave
-
-# applications-extra:
-alkimia
-#calligra
-#calligraplan
+yakuake
+zanshin
+# Applications Extra:
+##kstars
+##labplot
+#kuser
+##alkimia
+##calligra
+##calligraplan
digikam
-falkon
-kaudiocreator
-krita
-#kdev-php
-#kdev-python
-#kdevelop
-#kdevelop-pg-qt
-#kdevplatform
+##kaudiocreator
+kdevelop-pg-qt
kdiagram
-kile
+kdsoap-ws-discovery-client
+kid3
+##kile
kjots
kmymoney
-kpmcore
krename
+krita
krusader
-kstars
-#ktorrent
-kuser
-kwebkitpart
-libktorrent
-partitionmanager
-skanlite
-
-# telepathy:
-kaccounts-integration
-kaccounts-providers
-ktp-accounts-kcm
-ktp-approver
-ktp-auth-handler
-ktp-common-internals
-ktp-contact-list
-ktp-contact-runner
-ktp-desktop-applets
-ktp-filetransfer-handler
-ktp-kded-module
-ktp-send-file
-ktp-text-ui
-ktp-call-ui
-signon-kwallet-extension
-
-# Supported languages in the ISO:
-kde-l10n-da
-kde-l10n-de
-kde-l10n-en_GB
-kde-l10n-es
-kde-l10n-fr
-kde-l10n-ja
-kde-l10n-it
-kde-l10n-nl
-kde-l10n-pt_BR
-kde-l10n-pt
-kde-l10n-sv
-kde-l10n-ru
-
-# Issues with 3 files in the squashfs module missing the last character:
-plasma-workspace
+ktimetracker
+##okteta
+oxygen-gtk2
+libkgapi-5
+# ------
diff --git a/pkglists/daw.conf b/pkglists/ktownalien.conf
index a81a7c2..a81a7c2 100644
--- a/pkglists/daw.conf
+++ b/pkglists/ktownalien.conf
diff --git a/pkglists/ktownalien.lst b/pkglists/ktownalien.lst
new file mode 100644
index 0000000..57bedaa
--- /dev/null
+++ b/pkglists/ktownalien.lst
@@ -0,0 +1,5 @@
+# Alien's packages that enrich the Plasma5 experience:
+NetworkManager-openconnect
+openconnect
+vlc
+
diff --git a/pkglists/ktownslack.lst b/pkglists/ktownslack.lst
new file mode 100644
index 0000000..048f93d
--- /dev/null
+++ b/pkglists/ktownslack.lst
@@ -0,0 +1,24 @@
+alkimia
+#calligra
+#calligraplan
+fcitx5-configtool
+fcitx5-theme-breeze
+kColorPicker
+kImageAnnotator
+kaudiocreator
+kdevelop
+kdev-php
+kdev-python
+kile
+kmymoney
+kquickimageeditor
+krita
+kstars
+labplot
+latte-dock
+libindi
+libnova
+okteta
+stellarsolver
+wcslib
+
diff --git a/pkglists/mate.lst b/pkglists/mate.lst
index e534504..bb90716 100644
--- a/pkglists/mate.lst
+++ b/pkglists/mate.lst
@@ -5,8 +5,10 @@ glade
graphviz
gssdp
gtk-engines
+gtk-layer-shell
gtksourceview
gtksourceview3
+gtksourceview4
gupnp
libgksu
libgtop
@@ -15,6 +17,7 @@ libpeas
libunique
libunique3
libwnck3
+lxml
murrine
pangox-compat
pygtksourceview
diff --git a/pkglists/min.lst b/pkglists/min.lst
index da65091..3e19584 100644
--- a/pkglists/min.lst
+++ b/pkglists/min.lst
@@ -1,5 +1,7 @@
aaa_base
aaa_elflibs
+aaa_glibc-solibs
+aaa_libraries
aaa_terminfo
acl
attr
@@ -8,11 +10,13 @@ bin
binutils
# Add 'bind' at the end because it does a chroot:
#bind
-#bsd-games
+bsd-games
+btrfs-progs
bzip2
ca-certificates
coreutils
cpio
+cracklib
cryptsetup
cxxlibs
cyrus-sasl
@@ -26,19 +30,20 @@ dmidecode
dnsmasq
e2fsprogs
ed
-#elvis
+elilo
+elvis
etc
eudev
+exfatprogs
+f2fs-tools
file
findutils
floppy
fuse3
gawk
gc
-#ghostscript
-#ghostscript-fonts-std
-glibc
-#glibc-solibs
+##glibc
+glibc-solibs
glibc-zoneinfo
gnupg
gnupg2
@@ -47,21 +52,25 @@ gpgme
gpm
gptfdisk
grep
-groff
gzip
haveged
hostname
idnkit
infozip
+inih
+inotify-tools
iproute2
iptables
iputils
+jemalloc
+jfsutils
kbd
kernel-generic
kernel-firmware
kernel-headers
kernel-modules
kmod
+krb5
less
libassuan
libedit
@@ -72,23 +81,28 @@ libgudev
libidn2
libksba
libmnl
-libmpc
+##libmpc
+libpwquality
+libseccomp
libtermcap
libunistring
-#lilo
-links
+libuv
+lilo
logrotate
lvm2
+lz4
+lzip
lzlib
-man
-man-db
-man-pages
mc
mdadm
mkinitrd
mlocate
mozjs52
-mpfr
+mozjs60
+mozjs68
+mozjs78
+mozjs102
+##mpfr
mtr
nano
ncurses
@@ -97,19 +111,24 @@ netkit-ftp
netkit-routed
network-scripts
npth
+openldap
openldap-client
openssh
openssl
openssl10-solibs
+pam
parted
pciutils
perl
+pinentry
pkgtools
plzip
polkit
procps-ng
pth
python
+#python2
+#python2-module-collection
python3
quota
rsync
@@ -129,14 +148,18 @@ sysvinit
sysvinit-scripts
tar
terminus-font
+tmux
traceroute
usbutils
+userspace-rcu
utempter
util-linux
wget
which
whois
zstd
+xfsprogs
+xxHash
xz
# Bind needs to run at the end:
python-ply
diff --git a/pkglists/multilib.lst b/pkglists/multilib.lst
index dfe20e6..171377e 100644
--- a/pkglists/multilib.lst
+++ b/pkglists/multilib.lst
@@ -1,4 +1,5 @@
# The core multilib packages:
+aaa_glibc-solibs
compat32-tools
gcc
gcc-g++
@@ -15,20 +16,25 @@ glibc-solibs
# You can find this list embedded in the 'massconvert32.sh' script.
# The A/ series:
aaa_elflibs-compat32
+aaa_libraries-compat32
attr-compat32
bzip2-compat32
-cups-compat32
+cracklib-compat32
dbus-compat32
e2fsprogs-compat32
+elogind-compat32
eudev-compat32
libgudev-compat32
+libpwquality-compat32
lzlib-compat32
openssl10-solibs-compat32
openssl-solibs-compat32
+pam-compat32
plzip-compat32
util-linux-compat32
xz-compat32
# The AP/ series:
+cdparanoia-compat32
cups-compat32
cups-filters-compat32
flac-compat32
@@ -41,8 +47,15 @@ libtool-compat32
llvm-compat32
opencl-headers-compat32
# The L/ series:
+Imath-compat32
Mako-compat32
SDL2-compat32
+SDL2_gfx-compat32
+SDL2_image-compat32
+SDL2_mixer-compat32
+SDL2_net-compat32
+SDL2_ttf-compat32
+aalib-compat32
alsa-lib-compat32
alsa-oss-compat32
alsa-plugins-compat32
@@ -50,6 +63,7 @@ at-spi2-atk-compat32
at-spi2-core-compat32
atk-compat32
audiofile-compat32
+brotli-compat32
cairo-compat32
dbus-glib-compat32
elfutils-compat32
@@ -57,19 +71,23 @@ esound-compat32
expat-compat32
ffmpeg-compat32
fftw-compat32
+fluidsynth-compat32
freetype-compat32
fribidi-compat32
gamin-compat32
gc-compat32
gdk-pixbuf2-compat32
+gdk-pixbuf2-xlib-compat32
giflib-compat32
glib2-compat32
gmp-compat32
gnome-keyring-compat32
gobject-introspection-compat32
+graphene-compat32
graphite2-compat32
gtk+2-compat32
gtk+3-compat32
+gst-plugins-bad-free-compat32
gst-plugins-base-compat32
gst-plugins-base0-compat32
gst-plugins-good-compat32
@@ -79,9 +97,12 @@ gstreamer-compat32
gstreamer0-compat32
harfbuzz-compat32
icu4c-compat32
+isl-compat32
+jansson-compat32
jasper-compat32
json-c-compat32
json-glib-compat32
+keyutils-compat32
lame-compat32
lcms-compat32
lcms2-compat32
@@ -94,6 +115,9 @@ libcap-compat32
libcdio-paranoia-compat32
libclc-compat32
libcroco-compat32
+libdbusmenu-compat32
+libdeflate-compat32
+libdvdnav-compat32
libedit-compat32
libexif-compat32
libffi-compat32
@@ -103,10 +127,14 @@ libidn-compat32
libidn2-compat32
libieee1284-compat32
libjpeg-turbo-compat32
+libmad-compat32
libmng-compat32
libmpc-compat32
libnl3-compat32
+libnice-compat32
libnotify-compat32
+libnsl-compat32
+libnss_nis-compat32
libogg-compat32
libpcap-compat32
libpng-compat32
@@ -120,49 +148,74 @@ libtheora-compat32
libtiff-compat32
libunistring-compat32
libunwind-compat32
+liburing-compat32
libusb-compat32
+libvisual-compat32
libvorbis-compat32
libvpx-compat32
libwebp-compat32
+libxkbcommon-compat32
libxml2-compat32
libxslt-compat32
lmdb-compat32
+lz4-compat32
lzo-compat32
mozilla-nss-compat32
+neon-compat32
ncurses-compat32
ocl-icd-compat32
+openal-soft-compat32
+opencv-compat32
+openexr-compat32
openjpeg-compat32
opus-compat32
orc-compat32
pango-compat32
pcre-compat32
pcre2-compat32
+pipewire-compat32
+polkit-compat32
popt-compat32
pulseaudio-compat32
python-six-compat32
+qrencode-compat32
qt-compat32
+qt5-compat32
readline-compat32
+rpcsvc-proto-compat32
sbc-compat32
sdl-compat32
seamonkey-solibs-compat32
slang-compat32
speex-compat32
speexdsp-compat32
+spirv-llvm-translator-compat32
startup-notification-compat32
svgalib-compat32
+taglib-compat32
+talloc-compat32
+tdb-compat32
+tevent-compat32
v4l-utils-compat32
+vid.stab-compat32
wavpack-compat32
+woff2-compat32
+xxHash-compat32
zlib-compat32
zstd-compat32
+zxing-cpp-compat32
# The N/ series:
curl-compat32
cyrus-sasl-compat32
gnutls-compat32
+krb5-compat32
libgcrypt-compat32
libgpg-error-compat32
libtirpc-compat32
nettle-compat32
+nghttp2-compat32
openldap-client-compat32
+openldap-compat32
openssl-compat32
p11-kit-compat32
samba-compat32
@@ -221,6 +274,7 @@ libxshmfence-compat32
mesa-compat32
pixman-compat32
vulkan-sdk-compat32
+wayland-compat32
xcb-util-compat32
xorgproto-compat32
# The XAP/ series:
diff --git a/pkglists/noxbase.lst b/pkglists/noxbase.lst
index f6ac616..07dcca5 100644
--- a/pkglists/noxbase.lst
+++ b/pkglists/noxbase.lst
@@ -1,39 +1,54 @@
ModemManager
NetworkManager
+NetworkManager-openvpn
a52dec
alsa-lib
alsa-oss
alsa-plugins
alsa-utils
audiofile
+##autoconf
+##automake
bc
-bison
+##bison
+brotli
+c-ares
cgmanager
db48
dbus
dbus-glib
ddrescue
+efibootmgr
+efivar
elfutils
+elogind
exiv2
fftw
flac
-flex
-gcc
-gccmakedep
+##flex
+gamin
+##gcc
+##gccmakedep
gdk-pixbuf2
+gdk-pixbuf2-xlib
+##gettext
giflib
glib-networking
glib
glib2
glibc-i18n
-guile
+##guile
+htop
icu4c
ilmbase
-intltool
+iniparser
+##intltool
+inxi
ipw2100-fw
ipw2200-fw
isl
iw
+jansson
js185
lcms2
libX11
@@ -44,18 +59,23 @@ libao
libarchive
libasyncns
libatasmart
+libblockdev
+libbytesize
libcddb
libcdio
libcdio-paranoia
libcgroup
+libdeflate
libdvdnav
libdvdread
libexif
libffi
libgphoto2
+libgtop
libical
libieee1284
libimobiledevice
+libimobiledevice-glue
libjpeg-turbo
libmad
libmbim
@@ -82,10 +102,12 @@ libsndfile
libssh
libssh2
libsoup
+libsoup3
libtasn1
libtheora
libtiff
libtirpc
+##libtool
libusbmuxd
libvorbis
libvpx
@@ -96,19 +118,29 @@ libxslt
llvm
lm_sensors
lmdb
+lsof
+lynx
lzo
-make
+##m4
+##make
mozilla-nss
mpg123
mtdev
+ndctl
nettle
newt
nfs-utils
+nghttp2
+nmap
+ntfs-3g
+nvme-cli
openexr
openjpeg
orc
+os-prober
p11-kit
pm-utils
+pkg-config
pulseaudio
radeontool
rpcbind
@@ -118,7 +150,7 @@ smartmontools
speexdsp
sqlite
svgalib
-#tcl
+tcl
udisks
udisks2
upower
@@ -126,9 +158,11 @@ usb_modeswitch
util-macros
v4l-utils
vbetool
+volume_key
vorbis-tools
wavpack
wireless-tools
wireless_tools
wpa_supplicant
zd1211-firmware
+zlib
diff --git a/pkglists/plasma5wayland.lst b/pkglists/plasma5wayland.lst
deleted file mode 100644
index f4f9d45..0000000
--- a/pkglists/plasma5wayland.lst
+++ /dev/null
@@ -1,30 +0,0 @@
-# Change Plasma5 into Plasma5 with Wayland support.
-# -------------------------------------------------
-# Modifications of Slackware's own packages
-# (note that a '%' at the end means: removepkg):
-ConsoleKit2
-mesa
-xorg-server-xephyr%
-xorg-server-xnest%
-xorg-server-xvfb%
-xorg-server
-# Taken from ktown 'testing':
-# New dep:
-wayland-protocols
-# Updated dep:
-libxkbcommon
-qt5
-# Frameworks:
-kwayland
-plasma-framework
-# Plasma;
-kinfocenter
-kscreenlocker
-kwayland-integration
-libkscreen2
-plasma-desktop
-plasma-integration
-plasma-workspace
-powerdevil
-kwin
-
diff --git a/pkglists/lxqtdeps.conf b/pkglists/secureboot.conf
index 94a0566..a81a7c2 100644
--- a/pkglists/lxqtdeps.conf
+++ b/pkglists/secureboot.conf
@@ -1,8 +1,8 @@
# If 'SL_REPO_URL' is a rsync:// URL and 'SL_REPO' points to a non-existent
# or empty directory, then the content of 'SL_REPO_URL' will be rsync-ed
# to the local directory 'SL_REPO'.
-SL_REPO_URL="rsync://slackware.uk/people/alien-kde/${SL_VERSION}/latest/${SL_ARCH}"
-SL_REPO="/var/cache/liveslak/ktown/${SL_VERSION}/latest/${SL_ARCH}"
+SL_REPO_URL="rsync://slackware.uk/people/alien/sbrepos/${SL_VERSION}/${SL_ARCH}"
+SL_REPO="/var/cache/liveslak/sbrepos/${SL_VERSION}/${SL_ARCH}"
# Package root directory:
SL_PKGROOT=${SL_REPO}
diff --git a/pkglists/secureboot.lst b/pkglists/secureboot.lst
new file mode 100644
index 0000000..260a246
--- /dev/null
+++ b/pkglists/secureboot.lst
@@ -0,0 +1,3 @@
+mokutil
+sbsigntools
+
diff --git a/pkglists/slackextra.lst b/pkglists/slackextra.lst
index a9c5576..7cafab7 100644
--- a/pkglists/slackextra.lst
+++ b/pkglists/slackextra.lst
@@ -1,6 +1,4 @@
# extra:
bash-completion
-bittorrent
fltk
-recordmydesktop
tigervnc
diff --git a/pkglists/slackpkgplus.conf b/pkglists/slackpkgplus.conf
index 911a664..a0599fe 100644
--- a/pkglists/slackpkgplus.conf
+++ b/pkglists/slackpkgplus.conf
@@ -2,8 +2,14 @@
# or empty directory, then the content of 'SL_REPO_URL' will be rsync-ed
# to the local directory 'SL_REPO'.
-SL_REPO_URL="rsync://bear.alienbase.nl/mirrors/slackpkgplus/"
-SL_REPO="/var/cache/liveslak/slackpkgplus"
+if [ "${SL_VERSION}" == "current" ]; then
+ SPPSUFF="15"
+else
+ SPPSUFF=""
+fi
+
+SL_REPO_URL="rsync://slackware.nl/mirrors/slackpkgplus${SPPSUFF}/"
+SL_REPO="/var/cache/liveslak/slackpkgplus${SPPSUFF}"
# Package root directory:
SL_PKGROOT=${SL_REPO}
diff --git a/pkglists/x_base.lst b/pkglists/x_base.lst
index 83bf1ee..a7fc813 100644
--- a/pkglists/x_base.lst
+++ b/pkglists/x_base.lst
@@ -1,5 +1,6 @@
ConsoleKit2
GConf
+Imath
Mako
SDL2
SDL2_gfx
@@ -27,7 +28,7 @@ damageproto
dbus-python
dejavu-fonts-ttf
desktop-file-utils
-#djvulibre
+djvulibre
dmxproto
dosfstools
dri2proto
@@ -45,7 +46,7 @@ font-alias
#font-bh-75dpi
#font-bh-lucidatypewriter-100dpi
#font-bh-lucidatypewriter-75dpi
-#font-bh-ttf
+font-bh-ttf
#font-bitstream-75dpi
font-bitstream-100dpi
#font-bitstream-type1
@@ -61,11 +62,12 @@ freetype
fribidi
fslsfonts
fstobdf
-gamin
gcr
gd
gegl
gexiv2
+ghostscript
+ghostscript-fonts-std
glew
glproto
glu
@@ -74,22 +76,26 @@ gnome-keyring
gnome-themes-extra
gnome-themes-standard
gobject-introspection
+graphene
graphite2
gsettings-desktop-schemas
+gst-plugins-bad-free
gst-plugins-base
gst-plugins-base0
gst-plugins-good
gst-plugins-good0
gstreamer
gstreamer0
-#gtk+
+gtk+
gtk+2
gtk+3
+gtksourceview3
gtkspell
+gtkspell3
gvfs
harfbuzz
hicolor-icon-theme
-hplip
+#hplip
hunspell
iceauth
ico
@@ -102,6 +108,7 @@ json-c
json-glib
kbproto
keybinder
+keybinder3
lame
lcms
libFS
@@ -136,16 +143,19 @@ libXvMC
libXxf86dga
libXxf86misc
libXxf86vm
+libappindicator
libart_lgpl
libbluray
libcaca
libcanberra
libcap-ng
+libclc
libcroco
+libdbusmenu
libdmx
libdrm
libepoxy
-#liberation-fonts-ttf
+liberation-fonts-ttf
libevdev
libfakekey
libfontenc
@@ -154,6 +164,7 @@ libglvnd
libgnome-keyring
libgsf
libidl
+libindicator
libinput
libiodbc
libmng
@@ -169,9 +180,13 @@ libwacom
libwebp
libwmf
libwnck
+libwnck3
+libxcvt
+libxkbcommon
libxkbfile
libxklavier
libxshmfence
+links
listres
luit
makedepend
@@ -184,6 +199,7 @@ mypaint-brushes
neon
net-snmp
ocl-icd
+openal-soft
opus
pamixer
pango
@@ -197,13 +213,16 @@ pycairo
pygobject
pygobject3
pygtk
+python-MarkupSafe
+python-distro
+qrencode
randrproto
recordproto
rendercheck
renderproto
resourceproto
rgb
-#sazanami-fonts-ttf
+sazanami-fonts-ttf
sbc
scrnsaverproto
sdl
@@ -213,17 +232,21 @@ shared-mime-info
showfont
sinhala_lklug-font-ttf
smproxy
+sof-firmware
speex
+spirv-llvm-translator
startup-notification
t1lib
talloc
tdb
tevent
-#tibmachuni-font-ttf
+tibmachuni-font-ttf
ttf-indic-fonts
videoproto
viewres
vte
+vulkan-sdk
+wayland
wqy-zenhei-font-ttf
x11-skel
x11perf
@@ -319,6 +342,7 @@ xset
xsetroot
xsm
xstdcmap
+xterm
xtrans
xvidtune
xvinfo
diff --git a/pkglists/xapbase.lst b/pkglists/xapbase.lst
index 33ec7ef..03d497b 100644
--- a/pkglists/xapbase.lst
+++ b/pkglists/xapbase.lst
@@ -3,48 +3,68 @@ LibRaw
MPlayer
aspell
atkmm
-audacious
-audacious-plugins
+# requires qt5 now:
+#audacious
+#audacious-plugins
blueman
cairomm
+farstream
+ffmpegthumbnailer
fltk
geeqie
#gftp
gimp
gkrellm
glibmm
-#gnuchess
+gnuchess
+gparted
gtkmm3
gucharmap
gv
hexchat
imagemagick
-jansson
+# Needed in Core OS, moved to noxbase:
+#jansson
+libcue
+libgnt
+libnice
+libnma
+libptytty
libsigc++
+libsigc++3
+libsodium
+libzip
lftp
mozilla-firefox
#mozilla-thunderbird
network-manager-applet
-nghttp2
pangomm
pavucontrol
-#pidgin
+pidgin
+polkit-gnome
+python-cffi
+python-pycparser
rdesktop
+ruby
rxvt
rxvt-unicode
sane
+#seamonkey
seamonkey-solibs
tigervnc
+vid.stab
vim
vim-gvim
x11-ssh-askpass
x3270
-#xaos
+xaos
#xfractint
xgames
-#xlockmore
-#xmms
+xlockmore
+xmms
#xpaint
+xorriso
# Now needs qt:
#xpdf
+# Needs gimp:
xsane
diff --git a/pkglists/xfcebase.lst b/pkglists/xfcebase.lst
index 3e49027..2b7cf29 100644
--- a/pkglists/xfcebase.lst
+++ b/pkglists/xfcebase.lst
@@ -1,10 +1,14 @@
+Greybird
Thunar
+elementary-xfce
exo
garcon
gtk-xfce-engine
libxfce4ui
libxfce4util
-#orage
+mousepad
+orage
+thunar
thunar-volman
tumbler
xfce4-appfinder
@@ -22,7 +26,8 @@ xfce4-systemload-plugin
xfce4-taskmanager
xfce4-terminal
xfce4-volumed
-#xfce4-weather-plugin
+xfce4-weather-plugin
+xfce4-whiskermenu-plugin
xfconf
xfdesktop
xfwm4
diff --git a/pkglists/z00_plasma5supp.lst b/pkglists/z00_plasma5supp.lst
new file mode 100644
index 0000000..ff1b96b
--- /dev/null
+++ b/pkglists/z00_plasma5supp.lst
@@ -0,0 +1,148 @@
+#
+# Libraries and programs to support a basic Plasma5 installation:
+#
+#Imath
+#LibRaw
+PyQt5
+QScintilla
+QtAV
+accountsservice
+cdparanoia
+cfitsio
+cldr-emoji-annotation
+cryfs
+cryptopp
+daemon
+#djvulibre
+dotconf
+dvdauthor
+ebook-tools
+editorconfig-core-c
+#exiv2
+fcitx
+fcitx-anthy
+fcitx-configtool
+fcitx-hangul
+fcitx-kkc
+fcitx-libpinyin
+fcitx-m17n
+fcitx-qt5
+fcitx-sayura
+fcitx-table-extra
+fcitx-table-other
+fcitx-unikey
+fluxbox
+# x_base:
+#font-bh-ttf
+font-bitstream-type1
+font-xfree86-type1
+freerdp
+frei0r-plugins
+fuse
+# x_base:
+#ghostscript
+#ghostscript-fonts-std
+gmp
+#gpgme
+grantlee
+groff
+gtkmm2
+# xapbase:
+#gucharmap
+hack-fonts-ttf
+hyphen
+ibus
+ibus-anthy
+ibus-hangul
+ibus-kkc
+ibus-libpinyin
+ibus-m17n
+ibus-table
+ibus-unikey
+id3lib
+#json-glib
+kdsoap
+libXcm
+libburn
+libdbusmenu-qt
+libdmtx
+# x_base:
+#liberation-fonts-ttf
+libid3tag
+libkkc
+libkkc-data
+# xapbase:
+#libnice
+liboggz
+libpinyin
+libqalculate
+libraw1394
+libsass
+#libseccomp
+libspectre
+liburing
+libva-utils
+libvncserver
+libyaml
+#lilo
+#lmdb
+man
+man-db
+man-pages
+mariadb
+mlt
+noto-fonts-ttf
+opencv
+opus-tools
+opusfile
+phonon
+phonon-backend-gstreamer
+phonon-vlc
+pipewire
+polkit-qt-1
+#poppler
+python2
+python2-module-collection
+python-six
+pyxdg
+python-Jinja2
+python-PyYAML
+python-doxypypy
+python-doxyqml
+qca
+#qrencode
+qt5
+qt5-webkit
+qtkeychain
+rttr
+#ruby
+rxvt
+# xapbase:
+#libptytty
+#rxvt-unicode
+#sane
+# x_base:
+#sazanami-fonts-ttf
+sip
+skkdic
+sox
+ssr
+taglib
+taglib-extras
+# x_base:
+#vim
+#vim-gvim
+#vulkan-sdk
+woff2
+xcb-util-cursor
+xcb-util-errors
+xcb-util-image
+xcb-util-renderutil
+xcb-util-wm
+xcm
+xconsole
+xdg-desktop-portal
+xdg-user-dirs
+xedit
+xine-lib
+xpdf
diff --git a/pkglists/z01_plasma5base.lst b/pkglists/z01_plasma5base.lst
new file mode 100644
index 0000000..bb5c62c
--- /dev/null
+++ b/pkglists/z01_plasma5base.lst
@@ -0,0 +1,405 @@
+#
+# This file tries to define a lean 'base' setup of Plasma5
+#
+# frameworks:
+attica
+baloo
+bluez-qt
+breeze-icons
+extra-cmake-modules
+frameworkintegration
+kactivities
+kactivities-stats
+kapidox
+karchive
+kauth
+kbookmarks
+kcalendarcore
+kcmutils
+kcodecs
+kcompletion
+kconfig
+kconfigwidgets
+kcontacts
+kcoreaddons
+kcrash
+kdbusaddons
+kdeclarative
+kded
+kdelibs4support
+kdesignerplugin
+kdesu
+kdewebkit
+kdnssd
+kdoctools
+kemoticons
+kfilemetadata
+kglobalaccel
+kguiaddons
+kholidays
+khtml
+ki18n
+kiconthemes
+kidletime
+kimageformats
+kinit
+kio
+kio-admin
+kirigami-addons
+kirigami2
+kitemmodels
+kitemviews
+kjobwidgets
+kjs
+kjsembed
+kmediaplayer
+knewstuff
+knotifications
+knotifyconfig
+kpackage
+kparts
+kpeople
+kplotting
+kpty
+kquickcharts
+kross
+krunner
+kservice
+ktexteditor
+ktextwidgets
+kunitconversion
+kwallet
+kwidgetsaddons
+kwindowsystem
+kxmlgui
+kxmlrpcclient
+modemmanager-qt
+networkmanager-qt
+oxygen-icons5
+oxygen-sounds
+plasma-framework
+prison
+purpose
+qqc2-desktop-style
+solid
+sonnet
+syndication
+syntax-highlighting
+threadweaver
+
+# kdepim:
+#akonadi
+#akonadi-calendar
+#akonadi-calendar-tools
+#akonadi-contacts
+#akonadi-import-wizard
+#akonadi-mime
+#akonadi-notes
+#akonadi-search
+#akonadiconsole
+#akregator
+#blogilo
+#calendarsupport
+#eventviews
+#grantlee-editor
+#grantleetheme
+#incidenceeditor
+#kaddressbook
+#kalarm
+#kalarmcal
+#kcalutils
+#kdav
+#kdepim-addons
+#kdepim-apps-libs
+#kdepim-runtime
+#kidentitymanagement
+#kimap
+#kitinerary
+#kldap
+#kleopatra
+#kmail
+#kmail-account-wizard
+#kmailtransport
+#kmbox
+#kmime
+#knotes
+#kontact
+#kontactinterface
+#korganizer
+#kpimtextedit
+#kpkpass
+#ksmtp
+#ktnef
+#libgravatar
+#libkdepim
+#libkgapi
+#libkleo
+#libksieve
+#mailcommon
+#mailimporter
+#mbox-importer
+#messagelib
+#pim-data-exporter
+#pim-sieve-editor
+#pim-storage-service-manager
+#pimcommon
+
+# plasma:
+bluedevil
+breeze
+breeze-gtk
+breeze-grub
+drkonqi
+kactivitymanagerd
+kde-cli-tools
+kde-gtk-config
+kdecoration
+kdeplasma-addons
+kgamma5
+khelpcenter
+khotkeys
+kinfocenter
+kmenuedit
+kpipewire
+kscreen
+kscreenlocker
+ksshaskpass
+ksysguard
+ksystemstats
+kwallet-pam
+kwayland
+kwayland-integration
+kwayland-server
+kwin
+kwrited
+layer-shell-qt
+libkscreen
+libksysguard
+milou
+oxygen
+plasma-browser-integration
+plasma-desktop
+plasma-integration
+#plasma-mediacenter
+plasma-nm
+plasma-pa
+plasma-sdk
+plasma-vault
+#plasma-workspace-wallpapers
+polkit-kde-agent-1
+powerdevil
+sddm-kcm
+systemsettings
+xdg-desktop-portal-kde
+
+# plasma-extra:
+pulseaudio-qt
+#kpeoplevcard
+latte-dock
+#oxygen-fonts
+plasma-wayland-protocols
+sddm
+wacomtablet
+
+# applications:
+#analitza
+ark
+#artikulate
+audiocd-kio
+baloo-widgets
+#blinken
+#bomber
+#bovo
+#cantor
+#cervisia
+dolphin
+dolphin-plugins
+#dragon
+#elisa
+ffmpegthumbs
+#filelight
+#granatier
+gwenview
+#itinerary
+#juk
+k3b
+#kaccessible
+#kajongg
+#kalgebra
+#kalzium
+kamera
+#kamoso
+#kanagram
+#kapman
+#kapptemplate
+kate
+#katomic
+#kbackup
+#kblackbox
+#kblocks
+#kbounce
+#kbreakout
+#kbruch
+#kcachegrind
+kcalc
+kcharselect
+kcolorchooser
+kcron
+#kde-dev-scripts
+#kde-dev-utils
+#kde-runtime
+#kdebugsettings
+kdeconnect-kde
+#kdeedu-data
+kdegraphics-mobipocket
+kdegraphics-thumbnailers
+kdenetwork-filesharing
+#kdenlive
+#kdesdk-kioslaves
+#kdesdk-strigi-analyzers
+#kdesdk-thumbnailers
+kdf
+kdialog
+#kdiamond
+keditbookmarks
+#kfilereplace
+kfind
+#kfloppy
+#kfourinline
+#kgeography
+#kget
+#kgoldrunner
+kgpg
+#khangman
+#kig
+#kigo
+#killbots
+kimagemapeditor
+kio-extras
+kio-zeroconf
+kirigami-gallery
+#kiriki
+#kiten
+#kjumpingcube
+#klickety
+#klines
+#klinkstatus
+kmag
+#kmahjongg
+#kmines
+kmix
+kmousetool
+#kmouth
+#kmplot
+#knavalbattle
+#knetwalk
+#knights
+#kolf
+#kollision
+#kolourpaint
+#kommander
+kompare
+#konqueror
+#konquest
+konsole
+#kontrast
+konversation
+#kopete
+#kosmindoormap
+#kpat
+#kpublictransport
+#kqtquickcharts
+krdc
+#kremotecontrol
+#kreversi
+krfb
+#kruler
+ksanecore
+#kshisen
+#ksirk
+#ksnakeduel
+#kspaceduel
+#ksquares
+#ksudoku
+ksystemlog
+#kteatime
+#ktimer
+#ktouch
+#kturtle
+#kubrick
+kwalletmanager
+#kwave
+#kwordquiz
+libkcddb
+libkcompactdisc
+libkdcraw
+#libkdeedu
+#libkdegames
+#libkeduvocdocument
+libkexiv2
+#libkface
+#libkgeomap
+libkipi
+#libkmahjongg
+libkomparediff2
+libksane
+#lokalize
+#lskat
+#marble
+#markdownpart
+#minuet
+okteta
+okular
+#palapeli
+#parley
+#picmi
+#poxml
+print-manager
+#rocs
+skanlite
+skanpage
+spectacle
+#step
+#svgpart
+#sweeper
+#umbrello
+#zanshin
+zeroconf-ioslave
+zxing-cpp
+
+# applications-extra:
+#alkimia
+#calligra
+#calligraplan
+#digikam
+falkon
+ktextaddons
+kColorPicker
+kImageAnnotator
+#immer
+#lager
+#libunibreak
+#zug
+#krita
+#kdev-php
+#kdev-python
+#kdevelop
+#kdevelop-pg-qt
+#kdevplatform
+#kdiagram
+#kid3
+#kile
+#kjots
+#kmymoney
+kpmcore
+#krename
+#krusader
+#kstars
+#ktimetracker
+#ktorrent
+#kuser
+libktorrent
+#partitionmanager
+
+# Issues with 3 files in the squashfs module missing the last character:
+plasma-workspace
diff --git a/pkglists/z01_plasma5extra.lst b/pkglists/z01_plasma5extra.lst
new file mode 100644
index 0000000..744e3f6
--- /dev/null
+++ b/pkglists/z01_plasma5extra.lst
@@ -0,0 +1,6 @@
+elisa
+#kColorPicker
+#kImageAnnotator
+kdenlive
+keysmith
+kwave
diff --git a/pkglists/z01_swdev.lst b/pkglists/z01_swdev.lst
new file mode 100644
index 0000000..7542118
--- /dev/null
+++ b/pkglists/z01_swdev.lst
@@ -0,0 +1,30 @@
+# min.lst:
+glibc
+libmpc
+mpfr
+# noxbase.lst:
+autoconf
+automake
+bison
+flex
+gcc
+gccmakedep
+gettext
+guile
+intltool
+libtool
+lua
+m4
+make
+python-build
+python-flit-core
+python-glad2
+python-installer
+python-lxml
+python-pyproject-hooks
+python-tomli-w
+python-wheel
+# z00_plasma5supp.lst:
+gcc-g++
+gcc-gfortran
+
diff --git a/pkglists/plasma5.conf b/pkglists/z02_alien4daw.conf
index 1ab1a31..a81a7c2 100644
--- a/pkglists/plasma5.conf
+++ b/pkglists/z02_alien4daw.conf
@@ -1,11 +1,8 @@
# If 'SL_REPO_URL' is a rsync:// URL and 'SL_REPO' points to a non-existent
# or empty directory, then the content of 'SL_REPO_URL' will be rsync-ed
# to the local directory 'SL_REPO'.
-
-VARIANT=latest
-
-SL_REPO_URL="rsync://slackware.uk/people/alien-kde/${SL_VERSION}/${VARIANT}/${SL_ARCH}"
-SL_REPO="/var/cache/liveslak/ktown/${SL_VERSION}/${VARIANT}/${SL_ARCH}"
+SL_REPO_URL="rsync://slackware.uk/people/alien/sbrepos/${SL_VERSION}/${SL_ARCH}"
+SL_REPO="/var/cache/liveslak/sbrepos/${SL_VERSION}/${SL_ARCH}"
# Package root directory:
SL_PKGROOT=${SL_REPO}
diff --git a/pkglists/z02_alien4daw.lst b/pkglists/z02_alien4daw.lst
new file mode 100644
index 0000000..1f3823c
--- /dev/null
+++ b/pkglists/z02_alien4daw.lst
@@ -0,0 +1,15 @@
+#FAudio
+#MinGW-w64
+boost-compat
+dropbox-client
+fdk-aac
+gst-plugins-ffmpeg0
+mbedtls
+obs-studio
+openjdk11
+openconnect
+soxr
+unrar
+#vkd3d
+#wine
+x264
diff --git a/pkglists/z02_alienrest4daw.conf b/pkglists/z02_alienrest4daw.conf
new file mode 100644
index 0000000..40c3942
--- /dev/null
+++ b/pkglists/z02_alienrest4daw.conf
@@ -0,0 +1,12 @@
+# If 'SL_REPO_URL' is a rsync:// URL and 'SL_REPO' points to a non-existent
+# or empty directory, then the content of 'SL_REPO_URL' will be rsync-ed
+# to the local directory 'SL_REPO'.
+SL_REPO_URL="rsync://slackware.uk/people/alien/restricted_sbrepos/${SL_VERSION}/${SL_ARCH}"
+SL_REPO="/var/cache/liveslak/restricted_sbrepos/${SL_VERSION}/${SL_ARCH}"
+
+# Package root directory:
+SL_PKGROOT=${SL_REPO}
+
+# Patches root directory:
+SL_PATCHROOT=""
+
diff --git a/pkglists/z02_alienrest4daw.lst b/pkglists/z02_alienrest4daw.lst
new file mode 100644
index 0000000..ebc2f27
--- /dev/null
+++ b/pkglists/z02_alienrest4daw.lst
@@ -0,0 +1,3 @@
+ffmpeg
+libfdk-aac
+vlc
diff --git a/pkglists/z03_daw.conf b/pkglists/z03_daw.conf
new file mode 100644
index 0000000..a81a7c2
--- /dev/null
+++ b/pkglists/z03_daw.conf
@@ -0,0 +1,12 @@
+# If 'SL_REPO_URL' is a rsync:// URL and 'SL_REPO' points to a non-existent
+# or empty directory, then the content of 'SL_REPO_URL' will be rsync-ed
+# to the local directory 'SL_REPO'.
+SL_REPO_URL="rsync://slackware.uk/people/alien/sbrepos/${SL_VERSION}/${SL_ARCH}"
+SL_REPO="/var/cache/liveslak/sbrepos/${SL_VERSION}/${SL_ARCH}"
+
+# Package root directory:
+SL_PKGROOT=${SL_REPO}
+
+# Patches root directory:
+SL_PATCHROOT=""
+
diff --git a/pkglists/z03_daw.lst b/pkglists/z03_daw.lst
new file mode 100644
index 0000000..efe3cd2
--- /dev/null
+++ b/pkglists/z03_daw.lst
@@ -0,0 +1,144 @@
+# A collection of packages for the digital musician.
+OpenBLAS
+a2jmidid
+alsa-plugins-jack
+amsynth
+ardour
+aubio
+audacity
+avldrums.lv2
+boca
+cadence
+calf
+capnproto
+carla
+cecilia5
+chromaprint
+cuetools
+daw_base
+dblatex
+dgedit
+drumgizmo
+drumstick
+dssi
+elektroid
+eq10q
+faad2
+faust
+freac
+frescobaldi
+geonkick
+giada
+glfw
+guile1.8
+guitarix
+gxplugins.lv2
+helm
+hidapi
+hydrogen
+jack_capture
+jack-example-tools
+jack2
+jamulus
+jq
+ladspa_sdk
+libconfig
+libcyaml
+libfishsound
+libgig
+liblo
+liblrdf
+liblscp
+libltc
+libmicrohttpd
+libmodplug
+libmp4v2
+libmpdclient
+libsbsms
+libsmf
+libwebsockets
+lilv
+lilypond
+linuxsampler
+lsp-plugins
+lv2
+mac
+meterbridge
+mixxx
+mpc
+muse
+musescore
+mxml
+noise-repellent
+non-daw
+ntk
+pipewire-jack
+portaudio
+portmidi
+portsmf
+protobuf
+pulseaudio-jack
+python-attrdict
+python-ly
+python-numpy
+python-pathlib2
+python-poppler-qt5
+python-pygame
+python-pyliblo
+python-pyo
+qjackctl
+qmidiarp
+qpageview
+qsampler
+qsynth
+qtractor
+rapidjson
+raptor2
+redkite
+rosegarden
+rtaudio
+rtmidi
+rubberband
+sc3-plugins
+serd
+shntool
+smooth
+sonic-pi
+sonic-visualiser
+sord
+soundfont-unison
+soundtouch
+speex
+sratom
+suil
+supercollider
+twolame
+uriparser
+vamp-aubio-plugins
+vamp-plugin-sdk
+vcvrack
+vcvrack-audible-instruments
+vcvrack-befaco
+vcvrack-bogaudio
+vcvrack-countmodula
+vcvrack-impromptu-modular
+vcvrack-mental
+vcvrack-mindmeldmodular
+vcvrack-modularfungi
+vcvrack-packone
+vcvrack-squinkyvcv
+vcvrack-studiosixplusone
+vcvrack-valley
+vmpk
+wxGTK3
+wxpython
+x42-plugins
+yaml-cpp
+zita-ajbridge
+zita-alsa-pcmi
+zita-convolver
+zita-resampler
+zrythm
+#zynaddsubfx
+zyn-fusion
+
diff --git a/pxeserver.tpl b/pxeserver.tpl
index 3a9c206..46e19ee 100755
--- a/pxeserver.tpl
+++ b/pxeserver.tpl
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright 2011, 2016, 2017, 2019 Eric Hameleers, Eindhoven, NL
+# Copyright 2011, 2016, 2017, 2019, 2023 Eric Hameleers, Eindhoven, NL
# Copyright 2011 Patrick Volkerding, Sebeka, Minnesota USA
# All rights reserved.
#
@@ -43,6 +43,8 @@
# - The script will detect if you have an outside network connection on
# another interface and will enable IP forwarding if needed, so that the
# PXE clients will also have network access.
+# - Optionally, the script can hide its PXE clients behind a NAT router
+# in case external network is not accessible via normal routing.
# - The Live OS booted via pxelinux is configured with additional boot
# parameters:
# * nfsroot=${LOCAL_IPADDR}:/mnt/livemedia
@@ -83,6 +85,14 @@ GLOBAL_GW_INT=""
GLOBAL_GATEWAY=""
LOCAL_GATEWAY=""
+# Defining more global variables ahead of time:
+LOCAL_IPADDR=""
+LOCAL_NETMASK=""
+LOCAL_NETWORK=""
+
+# The script optionally configures a NAT gateway:
+ENABLE_NAT="no"
+
# The Slackware setup depends on english language settings because it
# parses program output like that of "fdisk -l". So, we need to override
# the Live user's local language settings here:
@@ -128,10 +138,25 @@ if [ -n "$PXETXTSRC" ]; then
fi
# For UEFI computers:
+if [ ! -f /mnt/livemedia${UEFIPREFIX}/SLACKWARELIVE ]; then
+ # We boot from a USB stick created with isu2usb.sh:
+ if ! mount |grep -q 'on /boot/efi' ; then
+ # USB EFI partition is not yet mounted, let's find where it is:
+ LIVEPART="$(df -P /mnt/livemedia/ |tail -n1 |cut -d' ' -f1)"
+ USBDEV="/dev/$(lsblk -no pkname ${LIVEPART=})"
+ EFIPART="$(blkid -t PARTLABEL="EFI System Partition" ${USBDEV=}* |cut -d: -f1)"
+ mkdir -p /boot/efi
+ mount -t vfat -o defaults ${EFIPART} /boot/efi
+ fi
+ UEFI_TFTP="/boot/efi"
+else
+ UEFI_TFTP="/mnt/livemedia"
+fi
+# Allow the boot files to be served by tftp:
mkdir -p /var/lib/tftpboot${UEFIPREFIX}
-ln -sf /mnt/livemedia${UEFIPREFIX}/@MARKER@ /var/lib/tftpboot${UEFIPREFIX}/
-ln -sf /mnt/livemedia${UEFIPREFIX}/bootx64.efi /var/lib/tftpboot${UEFIPREFIX}/
-ln -sf /mnt/livemedia${UEFIPREFIX}/theme /var/lib/tftpboot${UEFIPREFIX}/
+ln -sf ${UEFI_TFTP}${UEFIPREFIX}/SLACKWARELIVE /var/lib/tftpboot${UEFIPREFIX}/
+ln -sf ${UEFI_TFTP}${UEFIPREFIX}/bootx64.efi /var/lib/tftpboot${UEFIPREFIX}/
+ln -sf ${UEFI_TFTP}${UEFIPREFIX}/theme /var/lib/tftpboot${UEFIPREFIX}/
#
# Function definitions:
@@ -168,7 +193,7 @@ int_to_ip() {
echo $(($1>>24)).$(($1>>16&0xff)).$(($1>>8&0xff)).$(($1&0xff))
}
-# Find the location of the dhcpcd PID file:
+# Find out whether the interface is managed by DHCP:
get_dhcpcd_pid() {
# Find the location of the PID file of dhcpcd:
MYDEV="$1"
@@ -180,6 +205,20 @@ get_dhcpcd_pid() {
echo "/run/dhcpcd-${MYDEV}.pid"
elif [ -s /run/dhcpcd-${MYDEV}-4.pid ]; then
echo "/run/dhcpcd-${MYDEV}-4.pid"
+ elif [ -s /run/${MYDEV}.pid ]; then
+ echo "/run/${MYDEV}.pid"
+ else
+ echo UNKNOWNLOC
+ fi
+}
+
+# Find out whether the interface is managed by DHCP:
+get_nm_internal_lease() {
+ # Find the lease of NetworkManager internal dhcp client:
+ MYDEV="$1"
+ if [ -s /var/lib/NetworkManager/intern*-${MYDEV}.lease ]; then
+ # NM is indeed managing this interface:
+ echo "$(ls --indicator-style=none /var/lib/NetworkManager/intern*-${MYDEV}.lease)"
else
echo UNKNOWNLOC
fi
@@ -199,7 +238,7 @@ devconfig() {
elif ! ip -f inet -o addr show |grep -v " lo " |grep -qw 172.16 ; then
MYIP="172.16.10.10"
else
- MYIP="10.10.10.10"
+ MYIP="10.16.10.10"
fi
# Main loop IP configuration:
@@ -300,17 +339,20 @@ EOF
dhcpcd -k $MYIF 1>/dev/null 2>&1
rm -f /run/dhcpcd/dhcpcd-${MYIF}.pid 2>/dev/null
rm -f /run/dhcpcd-${MYIF}.pid 2>/dev/null
+ rm -f /run/${MYIF}.pid 2>/dev/null
# Broadcast and network are derived from IP and netmask:
- LOCAL_BROADCAST=$(ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 1 -d ' ')
- LOCAL_NETWORK=$(ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 2 -d ' ')
+ LOCAL_BROADCAST="$(ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 1 -d ' ')"
+ LOCAL_NETWORK="$(ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 2 -d ' ')"
if [ -x /etc/rc.d/rc.networkmanager 2>/dev/null ]; then
# Use nmcli to reconfigure NetworkManager:
- nmcli con add con-name pxe-${MYIF} ifname ${MYIF} type ethernet ip4 $LOCAL_IPADDR/$(mask_cvt $LOCAL_NETMASK)
+ nmcli con add save no con-name pxe-${MYIF} ifname ${MYIF} type ethernet
+ nmcli con mod pxe-${MYIF} ipv4.addresses ${LOCAL_IPADDR}/$(mask_cvt ${LOCAL_NETMASK}) ipv4.method manual connection.autoconnect no
if [ "x$GLOBAL_GATEWAY" = "x" -a "x$LOCAL_GATEWAY" != "x" ]; then
nmcli con mod pxe-${MYIF} ipv4.gateway $LOCAL_GATEWAY
fi
- nmcli dev connect ${MYIF}
+ nmcli con up pxe-${MYIF}
+ if [ $DEBUG -ne 0 ]; then read -p "Press ENTER to continue: " JUNK ; fi
else
# Use ifconfig and route commands:
ifconfig $MYIF $LOCAL_IPADDR netmask $LOCAL_NETMASK broadcast $LOCAL_BROADCAST
@@ -392,9 +434,11 @@ Alternate keys may also be used: '+', '-', and TAB." 13 72 9 \
# We now know what network interface to use.
#
- # If dhcpcd is running, it likely has a lease from a LAN DHCP server,
- # so we should not activate another DHCP server ourselves now:
- if [ -s $(get_dhcpcd_pid ${INTERFACE}) -a -n "$(ps -q $(cat $(get_dhcpcd_pid ${INTERFACE})) -o comm=)" ]; then
+ # If our interface is configured by DHCP, it likely has a lease from a
+ # LAN DHCP server, so we should not activate another DHCP server ourself now:
+ if [ -s $(get_dhcpcd_pid ${INTERFACE}) -a -n "$(ps -q $(cat $(get_dhcpcd_pid ${INTERFACE})) -o comm= 2>/dev/null)" ]; then
+ OWNDHCP="no"
+ elif [ -s $(get_nm_internal_lease ${INTERFACE}) ]; then
OWNDHCP="no"
else
# Assume nothing... we will ask the user for confirmation later!
@@ -439,6 +483,23 @@ not in reach of any DHCP server." 13 68
fi
fi
+ if [ "$OWNDHCP" == "yes" ]; then
+ if [ "$INTERFACE" != "$GLOBAL_GW_INT" ]; then
+ # The default gateway for this computer is on another interface;
+ $DIALOG --title "ENABLE NAT FIREWALL" --defaultno --yesno " \
+This computer's default gateway is network interface ${GLOBAL_GW_INT}. \
+The network behind the PXE server's interface ${INTERFACE} seems to be isolated.\n\
+Do you want to hide your PXE clients behind a NAT gateway?\n\
+This may be helpful if PXE clients cannot reach the external network otherwise.\n\
+Say 'NO' if you are not sure which is best." 12 68
+ if [ $? = 0 ]; then
+ ENABLE_NAT="yes"
+ else
+ ENABLE_NAT="no"
+ fi
+ fi
+ fi
+
# Assemble the network parameters:
LOCAL_IPADDR=$(ip -f inet -o addr show ${INTERFACE} |tr -s ' ' |head -1 |cut -f4 -d' ' |cut -f1 -d/)
if [ "x$LOCAL_IPADDR" = "x" ]; then # no IP Address was configured?!?
@@ -568,9 +629,9 @@ dhcp-leasefile=$TMP/pxe_dnsmasq.leases
# Test for the architecture of a netboot client. PXE clients are
# supposed to send their architecture as option 93. (See RFC 4578) .
-# The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86,
+# The known types are X86PC, PC98, IA64_EFI, Alpha, Arc_x86,
# Intel_Lean_Client, IA32_EFI, BC_EFI, Xscale_EFI and X86-64_EFI
-dhcp-match=x86PC, option:client-arch, 0 #BIOS x86
+dhcp-match=X86PC, option:client-arch, 0 #BIOS x86
dhcp-match=BC_EFI, option:client-arch, 7 #EFI Byte Code
dhcp-match=X86-64_EFI, option:client-arch, 9 #EFI x86_64
@@ -600,13 +661,14 @@ pxe-service=X86PC, "Boot from local hard disk", 0
# The above 'pxe-service' menu does not always work for UEFI-based clients,
# so alternatively you could implement a combination of 'dhcp-match' and
# 'dhcp-boot' to provide a boot image. Here is a commented-out example:
-#dhcp-match=set:efi-x86_64,option:client-arch,7
-#dhcp-match=set:efi-x86_64,option:client-arch,9
-#dhcp-match=set:efi-x86,option:client-arch,6
-#dhcp-match=set:bios,option:client-arch,0
-#dhcp-boot=tag:efi-x86_64,"${UEFIPREFIX}/bootx64.efi"
-#dhcp-boot=tag:efi-x86,"${UEFIPREFIX}/bootia32.efi"
-#dhcp-boot=tag:bios,"bios/lpxelinux.0"
+#dhcp-match=set:BC_EFI,option:client-arch,7
+#dhcp-match=set:X86-64_EFI,option:client-arch,9
+#dhcp-match=set:X86_EFI,option:client-arch,6
+#dhcp-match=set:X86PC,option:client-arch,0
+#dhcp-boot=tag:X86-64_EFI,"${UEFIPREFIX}/bootx64.efi,${LOCAL_IPADDR}"
+#dhcp-boot=tag:BC_EFI,"${UEFIPREFIX}/bootx64.efi,${LOCAL_IPADDR}"
+#dhcp-boot=tag:X86_EFI,"${UEFIPREFIX}/bootia32.efi,${LOCAL_IPADDR}"
+#dhcp-boot=tag:X86PC,"pxelinux.0,${LOCAL_IPADDR}"
EOF
@@ -667,7 +729,7 @@ F4 f4.txt #00000000
menu hshift 1
menu vshift 9
-menu width 45
+menu width 55
menu margin 1
menu rows 10
menu helpmsgrow 14
@@ -697,7 +759,7 @@ menu color help 37;40 #ff354172 #00000000 none
label pxelive
menu label Boot @CDISTRO@ Linux Live (@LIVEDE@) from network
kernel /generic
- append initrd=/initrd.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nfsroot=${LOCAL_IPADDR}:/mnt/livemedia luksvol= nop hostname=@DISTRO@ tz=$(cat /etc/timezone) locale=${SYSLANG:-"en_US.UTF-8"} kbd=${KBD:-"us"}
+ append initrd=/initrd.img @KAPPEND@ load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nfsroot=${LOCAL_IPADDR}:/mnt/livemedia luksvol= nop hostname=@DISTRO@ tz=$(cat /etc/timezone) locale=${SYSLANG:-"en_US.UTF-8"} kbd=${KBD:-"us"}
EOF
# And a Grub configuration for UEFI boot:
@@ -725,6 +787,8 @@ insmod ext2
# Determine whether we can show a graphical themed menu:
insmod font
if loadfont \$prefix/theme/dejavusansmono12.pf2 ; then
+ loadfont \$prefix/theme/dejavusansmono24.pf2
+ loadfont \$prefix/theme/dejavusansmono20.pf2
loadfont \$prefix/theme/dejavusansmono10.pf2
loadfont \$prefix/theme/dejavusansmono5.pf2
set font="DejaVu Sans Mono Regular 12"
@@ -743,7 +807,7 @@ set gfxpayload=keep
menuentry 'Boot @CDISTRO@ Linux Live (@LIVEDE@) from network' --class slackware --class gnu-linux --class gnu --class os {
echo "Loading @CDISTRO@ kernel"
- linux generic load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nfs root=${LOCAL_IPADDR}:/mnt/livemedia luksvol= nop hostname=@DISTRO@ tz=$(cat /etc/timezone) locale=${SYSLANG:-"en_US.UTF-8"} kbd=${KBD:-"us"}
+ linux generic @KAPPEND@ load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nfsroot=${LOCAL_IPADDR}:/mnt/livemedia luksvol= nop hostname=@DISTRO@ tz=$(cat /etc/timezone) locale=${SYSLANG:-"en_US.UTF-8"} kbd=${KBD:-"us"}
initrd initrd.img
echo "Booting @CDISTRO@ kernel"
}
@@ -764,7 +828,7 @@ while [ 0 ]; do
--menu \
"Welcome to @CDISTRO@ Linux Live PXE Server.\n\
Select an option below using the UP/DOWN keys and SPACE or ENTER.\n\
-Alternate keys may also be used: '+', '-', and TAB." 13 72 9 \
+Alternate keys may also be used: '+', '-', and TAB." 11 72 7 \
"NETWORK" "Configure your network parameters" \
"ACTIVATE" "Activate the @CDISTRO@ PXE Server" \
"EXIT" "Exit @CDISTRO@ PXE Setup" 2> $TMP/hdset
@@ -805,7 +869,11 @@ Press ENTER to return to the main menu." 14 68
Ready to start the PXE Server!\n\
The PXE server log will be displayed in the next screen.
\n\
-Press ENTER to start." 14 68
+Press ENTER to start or ESCAPE to return to the main menu." 14 68
+ if [ $? -ne 0 ]; then
+ # User did not press ENTER, let's return to main menu:
+ continue
+ fi
fi
# Time to start the BOOTP/TFTP/NFS servers:
@@ -824,9 +892,16 @@ EOT
# we need to enable forwarding:
OLDROUTING=$(cat /proc/sys/net/ipv4/ip_forward)
echo 1 > /proc/sys/net/ipv4/ip_forward
- # also start the route daemon:
- if [ -z "$(pidof routed)" ]; then
- /usr/sbin/routed -g -s
+ if [ "${ENABLE_NAT}" == "yes" ]; then
+ # Add NAT firewall rule:
+ iptables -t nat -A POSTROUTING -o ${GLOBAL_GW_INT} -j MASQUERADE
+ iptables -A FORWARD -p ALL -i ${GLOBAL_GW_INT} -j ACCEPT
+ iptables -A FORWARD -m state --state ESTABLISHED,RELATED -i ${GLOBAL_GW_INT} -j ACCEPT
+ else
+ if [ -z "$(pidof routed)" ]; then
+ # Also start the route daemon:
+ /usr/sbin/routed -g -s /var/log/routed_pxeserver.log
+ fi
fi
else
OLDROUTING=""
@@ -838,8 +913,16 @@ EOT
--ok-label "EXIT" \
--tailbox /var/log/pxe_dnsmasq.log 20 68
- # Time to kill the BOOTP/TFTP/NFS servers:
- [ -n "$OLDROUTING" ] && echo $OLDROUTING > /proc/sys/net/ipv4/ip_forward
+ # Time to kill the BOOTP/TFTP/NFS servers and revert network settings:
+ if [ "${ENABLE_NAT}" == "yes" ]; then
+ # Remove NAT firewall rule:
+ iptables -D FORWARD -m state --state ESTABLISHED,RELATED -i ${GLOBAL_GW_INT} -j ACCEPT
+ iptables -D FORWARD -p ALL -i ${GLOBAL_GW_INT} -j ACCEPT
+ iptables -t nat -D POSTROUTING -o ${GLOBAL_GW_INT} -j MASQUERADE
+ fi
+ if [ -n "$OLDROUTING" ]; then
+ echo $OLDROUTING > /proc/sys/net/ipv4/ip_forward
+ fi
kill -TERM $(cat ${TMP}/pxe_dnsmasq.pid)
sh /etc/rc.d/rc.nfsd stop
sed -i -e "s%^/mnt/livemedia.*%#&%" /etc/exports
@@ -847,6 +930,18 @@ EOT
if [ "$MAINSELECT" = "EXIT" ]; then
clear
+
+ if [ -x /etc/rc.d/rc.networkmanager 2>/dev/null ]; then
+ # Use nmcli to remove the NetworkManager connection:
+ nmcli con down pxe-${INTERFACE}
+ nmcli con del pxe-${INTERFACE}
+ else
+ # Manually bring the interface down:
+ dhcpcd -k ${INTERFACE} 2>/dev/null
+ ip link set dev ${INTERFACE} down
+ ip address flush dev ${INTERFACE}
+ fi
+
break
fi
diff --git a/setup2hd.local b/setup2hd.local.tpl
index 8edb7a5..7693159 100644
--- a/setup2hd.local
+++ b/setup2hd.local.tpl
@@ -50,15 +50,12 @@ live_post_install () {
cat << EOF > $TMP/tempmsg
@CDISTRO@ Live Edition (@LIVEDE@) has been installed to your hard drive!
- We installed the ${ACT_MODS} active modules (out of ${TOT_MODS} available).
+ We installed the ${ACT_MODS} active modules.
After rebooting, your installed computer will look exactly like the Live OS.
- After finishing system configuration and before rebooting, you can add any further Live modules from /@LIVEMAIN@/addons/ and /@LIVEMAIN@/optional/ to your hard drive, using a command similar to this:
- # unsquashfs -f -dest $T_PX /mnt/livemedia/@LIVEMAIN@/addons/mymodule.sxz
-
EOF
dialog --title "POST INSTALL HINTS AND TIPS" --msgbox "`cat $TMP/tempmsg`" \
- 20 65
+ 18 65
rm $TMP/tempmsg
# Setting MAINSELECT to "CONFIGURE" will call the usual Slackware
diff --git a/setup2hd.tpl b/setup2hd.tpl
index eb076a3..f87a697 100755
--- a/setup2hd.tpl
+++ b/setup2hd.tpl
@@ -24,27 +24,60 @@
#
# As always, bug reports, suggestions, etc: volkerdi@slackware.com
#
-# Modifications 2016, 2017 by Eric Hameleers <alien@slackware.com>
+# Modifications 2016, 2017, 2019, 2020 by Eric Hameleers <alien@slackware.com>
#
+# -------------------------------------------- #
+# Slackware Live Edition - check the media #
+# -------------------------------------------- #
+
# The Slackware setup depends on english language settings because it
# parses program output like that of "fdisk -l". So, we need to override
# the Live user's local language settings here:
export LANG=C
export LC_ALL=C
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+# Script needs to be run as root:
+if [ ${EUID} -ne 0 ]; then
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "NOT ROOT" --msgbox "\
+\n\
+You must be root to run this program!" 7 68
+ exit 1
+fi
+
+# The terminal window needs to be sufficiently large for cgdisk to fit:
+if [ $(tput cols) -lt 80 ] || [ $(tput lines) -lt 24 ]; then
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "TERMINAL TOO SMALL" --msgbox "\
+\n\
+Before you continue, re-size your terminal\nso it measures at least 80 x 24 characters.\n\
+Otherwise you will not be able to use disk partition tools." 11 68
+fi
+
if [ ! -d /mnt/livemedia/@LIVEMAIN@/system ]; then
- dialog --title "LIVE MEDIA NOT ACCESSIBLE" --msgbox "\
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "LIVE MEDIA NOT ACCESSIBLE" --msgbox "\
\n\
Before you can install software, complete the following tasks:\n\
\n\
1. Mount your Live media partition on /mnt/livemedia." 16 68
exit 1
fi
+
+# ------------------------------------------------ #
+# Slackware Live Edition - end check the media #
+# ------------------------------------------------ #
+
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
+# Wipe the probe md5sum to force rescanning partitions if setup is restarted:
+rm -f $TMP/SeTpartition.md5
rm -f $TMP/SeT*
# If a keymap was set up, restore that data:
if [ -r $TMP/Pkeymap ]; then
@@ -54,43 +87,84 @@ echo "on" > $TMP/SeTcolor # turn on color menus
PATH="$PATH:/usr/share/@LIVEMAIN@"
export PATH;
export COLOR=on
-#echo
-#echo
-#echo "Probing disk partitions. (Hint: if your ATAPI CD-ROM causes timeouts"
-#echo "during the probe process, try hitting the eject button)"
-#echo
-#sleep 5
-#
+${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" --infobox "\n
+Scanning your system for partition information...\n
+\n" 5 55
+# In case the machine is full of fast SSDs:
+sleep 1
# Before probing, activate any LVM partitions
# that may exist from before the boot:
vgchange -ay 1> /dev/null 2> /dev/null
if probe -l 2> /dev/null | grep -E 'Linux$' 1> /dev/null 2> /dev/null ; then
- probe -l 2> /dev/null | grep -E 'Linux$' | sort 1> $TMP/SeTplist 2> /dev/null
+ RUNPART=no
+ probe -l 2>/dev/null |grep -E 'Linux$' |sort |uniq 1>$TMP/SeTplist 2>/dev/null
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "LINUX PARTITIONS DETECTED" \
+ --yes-label "Continue" --no-label "Skip" --defaultno \
+ --yesno "Setup detected partitions on this machine of type Linux.\n\
+You probably created these before running '$(basename $0)'. Great!\n\n\
+If you would like to re-consider your partitioning scheme, \
+you can click 'Continue' now to start 'cfdisk' (MBR disk) \
+and/or 'cgdisk' (GPT disk) for all your hard drives.\n\
+Otherwise, select 'Skip' to skip disk partitioning and go on with the setup." \
+12 64
+ if [ $? -eq 0 ]; then
+ RUNPART=yes
+ fi
else
- dialog --title "NO LINUX PARTITIONS DETECTED" \
- --msgbox "There don't seem to be any partitions on this machine of type \
+ RUNPART=yes
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "NO LINUX PARTITIONS DETECTED" \
+ --msgbox "There don't seem to be any partitions on this machine of type \
Linux. You'll need to make at least one of these to install Linux. \
-To do this, you'll need to leave 'setup', and make the partitions using \
-'cfdisk' (MBR partitions) or 'cgdisk' (GPT partitions). For more \
-information, read the 'setup' help file from the next menu." 10 64
+To do this, you'll get a chance to make these partitions now using \
+'cfdisk' (MBR partitions) or 'cgdisk' (GPT partitions)." 10 64
fi
if [ -d /sys/firmware/efi ]; then
+ # First, let's make sure that efivarfs is active:
+ if [ "$(/bin/ls /sys/firmware/efi/efivars 2> /dev/null | wc -l)" = "0" ]; then
+ mount -t efivarfs none /sys/firmware/efi/efivars
+ fi
if ! probe -l 2> /dev/null | grep "EFI System Partition" 1> /dev/null 2> /dev/null ; then
- dialog --title "NO EFI SYSTEM PARTITION DETECTED" \
- --msgbox "This machine appears to be using EFI/UEFI, but no EFI System \
+ RUNPART=yes
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "NO EFI SYSTEM PARTITION DETECTED" \
+ --msgbox "This machine appears to be using EFI/UEFI, but no EFI System \
Partition was found. You'll need to make an EFI System Partition in order \
-to boot from the hard drive. To do this, leave 'setup', and \
-use 'cgdisk' to make a 100MB partition of type EF00. For more information, \
-read the 'setup' help file from the next menu." 10 64
+to boot from the hard drive. In the next step, using cfdisk/cgdisk, \
+make a 100MB partition of type EF00." 10 64
fi
fi
+if [ "$RUNPART" = "yes" ]; then
+
+ # ------------------------------------------------------- #
+ # Slackware Live Edition - find/partition the disk(s) #
+ # ------------------------------------------------------- #
+
+ SeTudiskpart
+ if [ ! $? = 0 ]; then
+ # No disks found or user canceled, means: abort.
+ exit 1
+ fi
+
+ # ----------------------------------------------------------- #
+ # Slackware Live Edition - end find/partition the disk(s) #
+ # ----------------------------------------------------------- #
+
+fi # End RUNPART = yes
+
T_PX="/setup2hd"
mkdir -p ${T_PX}
echo "$T_PX" > $TMP/SeTT_PX
ROOT_DEVICE="`mount | grep "on / " | cut -f 1 -d ' '`"
echo "$ROOT_DEVICE" > $TMP/SeTrootdev
-if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then # clear source
- umount /var/log/mount # location
+if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then # clear source location:
+ # In case of bind mounts, try to unmount them first:
+ umount -R /var/log/mount/dev 2> /dev/null
+ umount -R /var/log/mount/proc 2> /dev/null
+ umount -R /var/log/mount/sys 2> /dev/null
+ # Unmount target partition:
+ umount -R /var/log/mount
fi
# Anything mounted on /var/log/mount now is a fatal error:
if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then
@@ -108,18 +182,18 @@ rm -f /var/log/mount 2> /dev/null
rmdir /var/log/mount 2> /dev/null
mkdir /var/log/mount 2> /dev/null
+MAINSELECT="ADDSWAP"
while [ 0 ]; do
- dialog --title "@CDISTRO@ Linux Setup (version @SL_VERSION@)" \
---menu \
-"Welcome to @CDISTRO@ Linux Setup (Live Edition).\n\
+ ${DIALOG} --title "@CDISTRO@ Linux Setup (version @SL_VERSION@)" \
+ --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --default-item "$MAINSELECT" \
+ --menu "Welcome to @CDISTRO@ Linux Setup (Live Edition).\n\
Select an option below using the UP/DOWN keys and SPACE or ENTER.\n\
-Alternate keys may also be used: '+', '-', and TAB." 18 72 9 \
-"HELP" "Read the @CDISTRO@ Setup HELP file" \
-"KEYMAP" "Remap your keyboard if you're not using a US one" \
+Alternate keys may also be used: '+', '-', and TAB." 14 72 5 \
"ADDSWAP" "Set up your swap partition(s)" \
"TARGET" "Set up your target partitions" \
-"INSTALL" "Install @CDISTRO@ Live to disk" \
+"INSTALL" "Install @CDISTRO@ to disk" \
"CONFIGURE" "Reconfigure your Linux system" \
"EXIT" "Exit @CDISTRO@ Linux Setup" 2> $TMP/hdset
if [ ! $? = 0 ]; then
@@ -132,21 +206,6 @@ Alternate keys may also be used: '+', '-', and TAB." 18 72 9 \
# Start checking what to do. Some modules may reset MAINSELECT to run the
# next item in line.
- if [ "$MAINSELECT" = "HELP" ]; then
- SeTfdHELP
- fi
-
- if [ "$MAINSELECT" = "KEYMAP" ]; then
- SeTkeymap
- if [ -r $TMP/SeTkeymap ]; then
- MAINSELECT="ADDSWAP"
- fi
- fi
-
- if [ "$MAINSELECT" = "MAKE TAGS" ]; then
- SeTmaketag
- fi
-
if [ "$MAINSELECT" = "ADDSWAP" ]; then
SeTswap
if [ -r $TMP/SeTswap ]; then
@@ -162,127 +221,38 @@ Alternate keys may also be used: '+', '-', and TAB." 18 72 9 \
SeTEFI
SeTDOS
if [ -r $TMP/SeTnative ]; then
- MAINSELECT="INSTALL"
+ MAINSELECT="SOURCE"
fi
fi
- if [ "$MAINSELECT" = "INSTALL" ]; then
- if [ ! -r $TMP/SeTnative ]; then
- dialog --title "CANNOT INSTALL SOFTWARE YET" --msgbox "\
-\n\
-Before you can install software, complete the following tasks:\n\
-\n\
-1. Set up your target Linux partition(s).\n\
-\n\
-You may also optionally remap your keyboard and set up your\n\
-swap partition(s). \n\
-\n\
-Press ENTER to return to the main menu." 16 68
- continue
+ if [ "$MAINSELECT" = "SOURCE" ]; then
+ SeTumedia
+ if [ -r $TMP/SeTsource ]; then
+ if [ -r $TMP/SeTlive ]; then
+ MAINSELECT="INSTALL"
+ else
+ MAINSELECT="SELECT"
+ fi
fi
+ fi
- # --------------------------------------------- #
- # Slackware Live Edition - install to disk: #
- # --------------------------------------------- #
-
- # Buy us some time while we are calculating disk usage:
- dialog --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --infobox \
- "\nCalculating disk usage, please be patient ..." 5 65
-
- ACT_MODS=$(ls -rt --indicator-style=none /mnt/live/modules/ |wc -l)
- TOT_MODS=$(find /mnt/livemedia/@LIVEMAIN@/ -type f -name "*.sxz" |wc -l)
- DU_LIVE=$(du -s /mnt/@LIVEMAIN@fs/ |tr -s '\t' ' ' |cut -f1 -d' ')
- PARTFREE=$(df -P -BM $T_PX |tail -1 |tr -s '\t' ' ' |cut -d' ' -f4)
- PARTFREE=${PARTFREE%M}
-
- # Warn when it looks we have insufficient room:
- if [ $PARTFREE -lt $(($DU_LIVE/1024)) ]; then
-+ dialog --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --yesno \
- "\nAvailable space: $PARTFREE MB\nRequired space: $(($DU_LIVE/1024))\nIt looks like your hard drive partition is too small.\nDo you want to continue?" 10 65
- retval=$?
- if [ $retval = 1 ]; then
- umount $T_PX
- exit 1
- fi
+ if [ "$MAINSELECT" = "SELECT" ]; then
+ if [ -r /var/log/mount/isolinux/setpkg ]; then
+ sh /var/log/mount/isolinux/setpkg
else
- dialog --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --msgbox \
- "\nAvailable space: $PARTFREE MB\nRequired space: $(($DU_LIVE/1024)) MB\nIt looks like you're good to go!" 10 65
+ SeTPKG
fi
-
- (
- # Install the Live OS by rsyncing the readonly overlay to the harddisk:
- rsync -Hav --progress --no-inc-recursive /mnt/@LIVEMAIN@fs/ $T_PX/ \
- | awk '{ if (index($0, "to-chk=") > 0) { split($0, pieces, "to-chk="); split(pieces[2], term, ")"); split(term[1], division, "/"); print (1-(division[1]/division[2]))*100 }; fflush(); }' \
- | sed --unbuffered 's/^\([0-9]*\).*/\1/'
- ) | dialog --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --gauge \
- "\nProcessing ${TOT_MODS} @CDISTRO@ Live modules ($(( $DU_LIVE/1024 )) MB)" 8 65
-
- #
- # Live OS Post Install routine. If you want, you can override this routine
- # by (re-)defining this function "live_post_install()" in a file called
- # "/usr/share/@LIVEMAIN@/setup2hd.@DISTRO@".
- #
-
- live_post_install () {
- # Re-use some of the custom configuration from 0099-@DISTRO@_zzzconf-*.sxz
- # (some of these may not be present but the command will not fail):
- dialog --title "POST-INSTALL @UDISTRO@ LIVE (@LIVEDE@) DATA" --infobox \
- "\nCopying Live modifications to hard disk ..." 5 65
- # Do not overwrite a custom keymap:
- if [ ! -f $T_PX/etc/rc.d/rc.keymap ]; then
- unsquashfs -f -dest $T_PX \
- /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
- /etc/rc.d/rc.keymap
- fi
- unsquashfs -f -dest $T_PX \
- /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
- /etc/X11/xdm/liveslak-xdm \
- /etc/X11/xorg.conf.d/30-keyboard.conf \
- /etc/inittab \
- /etc/profile.d/lang.sh \
- /etc/rc.d/rc.font \
- /etc/rc.d/rc.gpm \
- /etc/slackpkg \
- /etc/vconsole.conf
- # Point xdm to the custom /etc/X11/xdm/liveslak-xdm/xdm-config:
- sed -i ${T_PX}/etc/rc.d/rc.4 -e 's,bin/xdm -nodaemon,& -config /etc/X11/xdm/liveslak-xdm/xdm-config,'
- # Remove the marker file from the filesystem root:
- rm -f ${T_PX}/@MARKER@
-
- cat << EOF > $TMP/tempmsg
-
- @CDISTRO@ Live Edition (@LIVEDE@) has been installed to your hard drive!
- We installed the ${ACT_MODS} active modules (out of ${TOT_MODS} available).
- The following configuration was copied from the Live OS to your harddisk:
- - console font
- - default runlevel
- - keyboard layout
- - language setting
- After finishing system configuration and before rebooting, you can add any further Live modules from /@LIVEMAIN@/addons/ and /@LIVEMAIN@/optional/ to your hard drive, using a command similar to this:
- # unsquashfs -f -dest $T_PX /mnt/livemedia/@LIVEMAIN@/addons/mymodule.sxz
-
-EOF
- dialog --title "POST INSTALL HINTS AND TIPS" --msgbox "`cat $TMP/tempmsg`" \
- 20 65
- rm $TMP/tempmsg
-
- MAINSELECT="CONFIGURE"
- }
-
- if [ -f /usr/share/@LIVEMAIN@/setup2hd.@DISTRO@ ]; then
- # If the setup2hd post-configuration file exists, source it.
- # The file should re-define the live_post_install() function.
- . /usr/share/@LIVEMAIN@/setup2hd.@DISTRO@
+ if [ -r $TMP/SeTSERIES ]; then
+ MAINSELECT="INSTALL"
fi
+ fi
- # Now, execute the function - either our own built-in version
- # or the re-defined function from the custom setup2hd.@DISTRO@ file.
- live_post_install
-
- # --------------------------------------------- #
- # Slackware Live Edition - end install to disk: #
- # --------------------------------------------- #
-
+ if [ "$MAINSELECT" = "INSTALL" ]; then
+ if [ -r $TMP/SeTlive ]; then
+ source setup.liveslak
+ else
+ source setup.slackware
+ fi
fi
if [ "$MAINSELECT" = "CONFIGURE" ]; then
@@ -293,11 +263,15 @@ EOF
if [ -f /usr/sbin/eliloconfig -a -f $T_PX/usr/sbin/eliloconfig ]; then
cat /usr/sbin/eliloconfig > $T_PX/usr/sbin/eliloconfig
fi
+ # Make bind mounts for /dev, /proc, and /sys:
+ mount -o rbind /dev $T_PX/dev 2> /dev/null
+ mount -o rbind /proc $T_PX/proc 2> /dev/null
+ mount -o rbind /sys $T_PX/sys 2> /dev/null
SeTconfig
REPLACE_FSTAB=Y
if [ -r $TMP/SeTnative ]; then
if [ -r $T_PX/etc/fstab ]; then
- dialog --title "REPLACE /etc/fstab?" --yesno "You already have an \
+ ${DIALOG} --title "REPLACE /etc/fstab?" --yesno "You already have an \
/etc/fstab on your install partition. If you were just adding software, \
you should probably keep your old /etc/fstab. If you've changed your \
partitioning scheme, you should use the new /etc/fstab. Do you want \
@@ -321,9 +295,10 @@ to replace your old /etc/fstab with the new one?" 10 58
printf "%-16s %-16s %-11s %-16s %-3s %s\n" "proc" "/proc" "proc" "defaults" "0" "0" >> $T_PX/etc/fstab
printf "%-16s %-16s %-11s %-16s %-3s %s\n" "tmpfs" "/dev/shm" "tmpfs" "defaults" "0" "0" >> $T_PX/etc/fstab
fi
- dialog --title "SETUP COMPLETE" --msgbox "System configuration \
+ ${DIALOG} --title "SETUP COMPLETE" --msgbox "System configuration \
and installation is complete. \
\n\nYou may now reboot your system." 7 55
+ MAINSELECT="DONE"
fi
fi
@@ -331,6 +306,10 @@ and installation is complete. \
break
fi
+ if [ "$MAINSELECT" = "DONE" ]; then
+ MAINSELECT="EXIT"
+ fi
+
done # end of main loop
sync
@@ -342,7 +321,7 @@ if mount | grep /var/log/mntiso 1> /dev/null 2> /dev/null ; then
umount -f /var/log/mntiso
fi
if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then
- umount /var/log/mount
+ umount -R /var/log/mount
fi
# Anything mounted on /var/log/mount now is a fatal error:
if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then
@@ -370,35 +349,26 @@ if [ -f ${T_PX}/etc/fstab ]; then
eject -s `cat $TMP/SeTCDdev`
# Tell the user to remove the disc, if one had previously been mounted
# (it should now be ejected):
- dialog \
+ ${DIALOG} \
--clear \
--title "@CDISTRO@ Linux Setup is complete" "$@" \
--msgbox "\nPlease remove the installation disc.\n" 7 40
fi
- # Offer to reboot or drop to shell:
- dialog \
+ # Sign off to the user:
+ ${DIALOG} \
+ --clear \
--title "@CDISTRO@ Linux Setup is complete" "$@" \
- --yesno \
- "\nWould you like to reboot your system?\n\n\n\
-If you choose \"No\", you will be dropped to a shell.\n" 11 50
- retval=$?
- if [ $retval = 1 ]; then
- clear
- echo
- echo "You may now reboot your system once you are ready."
- echo "You can issue the 'reboot' command; or if your system has"
- echo "a keyboard attached, you can use the key combination: control+alt+delete"
- echo
- else
- touch /reboot
- fi
+ --msgbox "\nInstallation is complete.\n\n
+You can reboot your system whenever you like,\n
+but don't forget to remove this Live medium first.\n" 11 50
+
fi
# Fix the date:
fixdate
# final cleanup
-rm -f $TMP/tagfile $TMP/SeT* $TMP/tar-error $TMP/unsquash_output $TMP/unsquash_error $TMP/PKGTOOL_REMOVED
+rm -f $TMP/tagfile $TMP/temp* $TMP/tmp* $TMP/SeT* $TMP/tar-error $TMP/unsquash_output $TMP/unsquash_error $TMP/PKGTOOL_REMOVED $TMP/LILO* $TMP/avail*
rm -f /var/log/mount/treecache
rmdir /var/log/mntiso 2>/dev/null
rm -rf $TMP/treecache
diff --git a/setup2hd/SeTfirewall.tpl b/setup2hd/SeTfirewall.tpl
new file mode 100644
index 0000000..e2e2687
--- /dev/null
+++ b/setup2hd/SeTfirewall.tpl
@@ -0,0 +1,704 @@
+#!/bin/bash
+
+# ------------------------------------------------------------------------------
+# Configure a basic firewall,
+# by generating a set of iptables rules (ipv4 and ipv6),
+# and saving those to /etc/firewall/ipv4 and /etc/firewall/ipv6 .
+# The accompanying script /etc/rc.d/rc.firewall will restore these configs.
+#
+# This script and rc.firewall are part of liveslak,
+# a project by Eric Hameleers, see https://download.liveslak.org/
+#
+# Iptables ruleset handling courtesy of Easy Firewall Generator for IPTables,
+# Copyright 2002 Timothy Scott Morizot
+# ------------------------------------------------------------------------------
+
+# The script accepts one parameter: the target filesystem:
+DESTDIR="$1"
+
+# This tmp directory is only writable by root:
+TMP=${TMP:-"/var/log/setup/tmp"}
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+# The iptables tools we use:
+IPT="/usr/sbin/iptables"
+IP6T="/usr/sbin/ip6tables"
+IPTS="/usr/sbin/iptables-save"
+IP6TS="/usr/sbin/ip6tables-save"
+IPTR="/usr/sbin/iptables-restore"
+IP6TR="/usr/sbin/ip6tables-restore"
+
+# Localhost Interface
+LO_IFACE="lo"
+LO_IP="127.0.0.1"
+LO_IP6="::1"
+
+# The default gateway device will be our primary candidate to firewall:
+GWDEV=$(/sbin/ip route show |grep ^default |cut -d' ' -f5)
+
+# Generate a list of network devices, minus the default gateway and loopback:
+AVAILDEV=$(ls --indicator-style=none /sys/class/net/ |sed -e "s/${GWDEV}//" -e "s/lo//")
+
+# Store all network interfaces in an associative array:
+declare -A NETDEVARR
+NETDEVARR=( [$GWDEV]=on )
+for INDEV in $AVAILDEV ; do NETDEVARR+=( [$INDEV]=off ) ; done
+unset INDEV
+
+# Store network services in another array:
+declare -A SERVARR=(
+ ['SSH']=off
+ ['RSYNC']=off
+ ['GIT']=off
+ ['HTTP']=off
+ ['HTTPS']=off
+ ['SMTP']=off
+ ['SMPTS']=off
+ ['IMAP']=off
+ ['IMAPS']=off
+ ['NTP']=off
+)
+
+# Store the list of custom ports/port ranges:
+CUSTOM_TCP_LIST=""
+CUSTOM_UDP_LIST=""
+
+# Will we auto-configure a restrictive firewall?
+AUTOCONFIG="YES"
+
+# User pressing ESC will change the default choice in the 1st dialog:
+DEFAULTNO=""
+
+# Loop over the configuration until the user is done:
+MAINSELECT="start"
+while [ "$MAINSELECT" != "done" ]; do
+ if [ "$MAINSELECT" = "start" ]; then
+ ${DIALOG} --backtitle "@UDISTRO@ (@LIVEDE@) Basic Firewall Setup" \
+ --title "CONFIGURE FIREWALL" ${DEFAULTNO} \
+ --yesno "Would you like to protect the system with a basic firewall?\n\n\
+You can either block all external connections,
+or you can expose specific TCP/UDP ports.\n\n\
+DHCP will never be blocked." 11 68
+ if [ $? != 0 ]; then
+ # Not needed.
+ exit 0
+ else
+ DEFAULTNO=""
+ fi
+ MAINSELECT="devices"
+ fi
+
+ if [ "$MAINSELECT" = "devices" ]; then
+ # Populate the network device checklist for the dialog:
+ NETDEVLIST="$(for I in ${!NETDEVARR[@]};do echo $I ${NETDEVARR[$I]};done)"
+ unset I
+ ${DIALOG} --backtitle "@UDISTRO@ (@LIVEDE@) Basic Firewall Setup" \
+ --title "PICK INTERFACES" \
+ --stdout --separate-output \
+ --no-items \
+ --ok-label "Next" --no-cancel --extra-button --extra-label "Previous" \
+ --checklist "\
+Select the network interface(s) exposed to the outside world.\n\
+Your default gateway is pre-selected.\n\
+Un-selected interfaces will accept all incoming traffic." 13 68 5 $NETDEVLIST \
+ > $TMP/SeTnics
+ RETVAL=$?
+ # Zero out the array values and re-enable only the ones we got returned:
+ for INDEV in ${!NETDEVARR[@]} ; do NETDEVARR[$INDEV]=off ; done
+ for INDEV in $(cat $TMP/SeTnics) ; do NETDEVARR[$INDEV]=on ; done
+ unset INDEV
+ case "$RETVAL" in
+ 0) MAINSELECT="autoselect" ;;
+ 3) MAINSELECT="start" ;;
+ *) MAINSELECT="start" ; DEFAULTNO="--defaultno" ;;
+ esac
+ rm -f $TMP/SeTnics
+ fi
+
+ if [ "$MAINSELECT" = "autoselect" ]; then
+ ${DIALOG} --backtitle "@UDISTRO@ (@LIVEDE@) Basic Firewall Setup" \
+ --title "ALL CLOSED?" \
+ --yesno "Do you want to block all incoming external connections?\n\
+If 'no', then you will be able to specify ports that need to be open." 7 68
+ RETVAL=$?
+ case "$RETVAL" in
+ 0) AUTOCONFIG="YES"
+ MAINSELECT="done" ;;
+ 1) AUTOCONFIG="NO"
+ MAINSELECT="services" ;;
+ *) MAINSELECT="start" ; DEFAULTNO="--defaultno" ;;
+ esac
+ fi
+
+ if [ "$MAINSELECT" = "services" ]; then
+ # Populate the services checklist for the dialog:
+ ${DIALOG} --backtitle "@UDISTRO@ (@LIVEDE@) Basic Firewall Setup" \
+ --title "OPEN PORTS" \
+ --stdout --separate-output \
+ --ok-label "Next" --no-cancel --extra-button --extra-label "Previous" \
+ --checklist "\
+Select the service ports you want to remain open for the outside world.\n\
+You can enter more ports or portranges in the next dialog." 19 68 13 \
+SSH 'SSH (port 22)' ${SERVARR['SSH']} \
+RSYNC 'RSYNC (port 873)' ${SERVARR['RSYNC']} \
+GIT 'GIT (port 9418)' ${SERVARR['GIT']} \
+HTTP 'Web Server (HTTP port 80)' ${SERVARR['HTTP']} \
+HTTPS 'Secure Web Server (HTTPS port 443)' ${SERVARR['HTTPS']} \
+SMTP 'Receiving Email (SMTP port 25)' ${SERVARR['SMTP']} \
+SMTPS 'Secure Receiving Email (SMPTS port 587)' ${SERVARR['SMPTS']} \
+IMAP 'IMAP Email Server (IMAP port 143)' ${SERVARR['IMAP']} \
+IMAPS 'Secure IMAP Email Server (IMAPS port 993)' ${SERVARR['IMAPS']} \
+NTP 'Time Server (NTP port 123)' ${SERVARR['NTP']} \
+ > $TMP/SeTservices
+ RETVAL=$?
+ # Zero out the array values and re-enable only the ones we got returned:
+ for INSRV in ${!SERVARR[@]} ; do SERVARR[$INSRV]=off ; done
+ for INSRV in $(cat $TMP/SeTservices) ; do SERVARR[$INSRV]=on ; done
+ unset INSRV
+ case $RETVAL in
+ 0) MAINSELECT="customports" ;;
+ 3) MAINSELECT="autoselect" ;;
+ *) MAINSELECT="start" ; DEFAULTNO="--defaultno" ;;
+ esac
+ rm -f $TMP/SeTservices
+ fi
+
+ if [ "$MAINSELECT" = "customports" ]; then
+ ${DIALOG} --backtitle "@UDISTRO@ (@LIVEDE@) Basic Firewall Setup" \
+ --title "CUSTOM PORTS" \
+ --stdout \
+ --ok-label "Next" --no-cancel --extra-button --extra-label "Previous" \
+ --form "\
+Enter additional ports or port ranges.\n\
+Port ranges consist of two numbers separated by a colon (example: 3000:3011).\n\
+Separate multiple entries with commas,\n\
+for example: 22,465,3000:3011,6660:6669,7000" \
+13 68 2 \
+"TCP ports/portranges:" 1 1 "$CUSTOM_TCP_LIST" 1 25 40 0 \
+"UDP ports/portranges:" 2 1 "$CUSTOM_UDP_LIST" 2 25 40 0 \
+ > $TMP/SeTcustomports
+ RETVAL=$?
+ CUSTOM_TCP_LIST=$(head -1 $TMP/SeTcustomports)
+ CUSTOM_UDP_LIST=$(tail -1 $TMP/SeTcustomports)
+ case $RETVAL in
+ 0) MAINSELECT="confirm" ;;
+ 3) MAINSELECT="services" ;;
+ *) MAINSELECT="start" ; DEFAULTNO="--defaultno" ;;
+ esac
+ rm -f $TMP/SeTcustomports
+ fi
+
+ if [ "$MAINSELECT" = "confirm" ]; then
+ # Collect all service ports that need to be remotely accessible.
+ # TCP:
+ TCP_LIST=""
+ if [ "${SERVARR['HTTP']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 80"
+ fi
+ if [ "${SERVARR['HTTPS']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 443"
+ fi
+ if [ "${SERVARR['SMTP']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 25"
+ fi
+ if [ "${SERVARR['SMTPS']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 587"
+ fi
+ if [ "${SERVARR['IMAP']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 143"
+ fi
+ if [ "${SERVARR['IMAPS']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 993"
+ fi
+ if [ "${SERVARR['SSH']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 22"
+ fi
+ if [ "${SERVARR['GIT']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 9418"
+ fi
+ if [ "${SERVARR['RSYNC']}" = "on" ]; then
+ TCP_LIST="$TCP_LIST 873"
+ fi
+ TCP_LIST=$(echo $TCP_LIST | sed 's/^ *//g' | tr ' ' ',')
+ # UDP:
+ UDP_LIST=""
+ if [ "${SERVARR['NTP']}" = "on" ]; then
+ UDP_LIST="$UDP_LIST 123"
+ fi
+ if [ "${SERVARR['RSYNC']}" = "on" ]; then
+ UDP_LIST="$UDP_LIST 873"
+ fi
+ UDP_LIST=$(echo $UDP_LIST | sed 's/^ *//g' | tr ' ' ',')
+
+ TCP_LIST=$(echo $TCP_LIST $CUSTOM_TCP_LIST | sed 's/^ *//g' | tr ' ' ',')
+ UDP_LIST=$(echo $UDP_LIST $CUSTOM_UDP_LIST | sed 's/^ *//g' | tr ' ' ',')
+ DEV_LIST=$(for INDEV in ${!NETDEVARR[@]} ; do if [ "${NETDEVARR[$INDEV]}" = "on" ]; then echo -n $INDEV" " ; fi ; done)
+
+ ${DIALOG} --backtitle "@UDISTRO@ (@LIVEDE@) Basic Firewall Setup" \
+ --title "CONFIRM CONFIGURATION" \
+ --yes-label "Generate" --no-label "Redo" \
+ --yesno "These are the ports you configured. Are you OK with them?\n\n\
+Press 'Generate' to generate the firewall configuration.\n\
+Else press 'Redo' to re-do the setup.\n\n\
+Firewalled interface(s): $DEV_LIST \n\
+TCP Ports: $TCP_LIST \n\
+UDP Ports: $UDP_LIST" 12 68
+ RETVAL=$?
+ case $RETVAL in
+ 0) MAINSELECT="done" ;;
+ 1) MAINSELECT="devices" ;;
+ *) MAINSELECT="start" ; DEFAULTNO="--defaultno" ;;
+ esac
+ fi
+
+done
+
+# ------------------------------------------------------------------------------
+# End of configuration, let's get to work.
+# ------------------------------------------------------------------------------
+
+#
+# Flush Any Existing Rules or Chains
+#
+
+${DIALOG} --backtitle "@UDISTRO@ (@LIVEDE@) Basic Firewall Setup" \
+ --infobox "Configuring your firewall ..." 4 68
+
+# Reset Default Policies
+$IPT -P INPUT ACCEPT
+$IPT -P FORWARD ACCEPT
+$IPT -P OUTPUT ACCEPT
+$IPT -t nat -P PREROUTING ACCEPT
+$IPT -t nat -P POSTROUTING ACCEPT
+$IPT -t nat -P OUTPUT ACCEPT
+$IPT -t mangle -P PREROUTING ACCEPT
+$IPT -t mangle -P OUTPUT ACCEPT
+#
+$IP6T -P INPUT ACCEPT
+$IP6T -P FORWARD ACCEPT
+$IP6T -P OUTPUT ACCEPT
+$IP6T -t mangle -P PREROUTING ACCEPT
+$IP6T -t mangle -P OUTPUT ACCEPT
+
+# Flush all rules
+$IPT -F
+$IPT -t nat -F
+$IPT -t mangle -F
+#
+$IP6T -F
+$IP6T -t mangle -F
+
+# Erase all non-default chains
+$IPT -X
+$IPT -t nat -X
+$IPT -t mangle -X
+#
+$IP6T -X
+$IP6T -t mangle -X
+
+#
+# Rules Configuration
+#
+# Filter Table
+#
+
+# Set Policies
+$IPT -P INPUT DROP
+$IPT -P OUTPUT DROP
+$IPT -P FORWARD DROP
+#
+$IP6T -P INPUT DROP
+$IP6T -P OUTPUT DROP
+$IP6T -P FORWARD DROP
+
+#
+# User-Specified Chains
+#
+# Create user chains to reduce the number of rules each packet must traverse.
+#
+
+# Create a chain to filter INVALID packets
+$IPT -N bad_packets
+$IP6T -N bad_packets
+
+# Create another chain to filter bad tcp packets
+$IPT -N bad_tcp_packets
+$IP6T -N bad_tcp_packets
+
+# Create separate chains for icmp, tcp (incoming and outgoing),
+# and incoming udp packets.
+$IPT -N icmp_packets
+$IP6T -N icmp_packets
+
+# Used for UDP packets inbound from the Internet
+$IPT -N udp_inbound
+$IP6T -N udp_inbound
+
+# Used to block outbound UDP services from internal network
+# Default to allow all
+$IPT -N udp_outbound
+$IP6T -N udp_outbound
+
+# Used to allow inbound services if desired
+# Default fail except for established sessions
+$IPT -N tcp_inbound
+$IP6T -N tcp_inbound
+
+# Used to block outbound services from internal network
+# Default to allow all
+$IPT -N tcp_outbound
+$IP6T -N tcp_outbound
+
+#
+# Populate User Chains
+#
+# bad_packets chain
+#
+
+# Drop INVALID packets immediately
+$IPT -A bad_packets -p ALL -m state --state INVALID -j DROP
+$IP6T -A bad_packets -p ALL -m state --state INVALID -j DROP
+
+# Then check the tcp packets for additional problems
+$IPT -A bad_packets -p tcp -j bad_tcp_packets
+$IP6T -A bad_packets -p tcp -j bad_tcp_packets
+
+# All good, so return
+$IPT -A bad_packets -p ALL -j RETURN
+$IP6T -A bad_packets -p ALL -j RETURN
+
+# bad_tcp_packets chain
+#
+# All tcp packets will traverse this chain.
+# Every new connection attempt should begin with
+# a syn packet. If it doesn't, it is likely a
+# port scan. This drops packets in state
+# NEW that are not flagged as syn packets.
+$IPT -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP
+$IP6T -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP
+$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL NONE -j DROP
+$IP6T -A bad_tcp_packets -p tcp --tcp-flags ALL NONE -j DROP
+$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL ALL -j DROP
+$IP6T -A bad_tcp_packets -p tcp --tcp-flags ALL ALL -j DROP
+$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
+$IP6T -A bad_tcp_packets -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
+$IPT -A bad_tcp_packets -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
+$IP6T -A bad_tcp_packets -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
+$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
+$IP6T -A bad_tcp_packets -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
+$IPT -A bad_tcp_packets -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
+$IP6T -A bad_tcp_packets -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
+
+# All good, so return
+$IPT -A bad_tcp_packets -p tcp -j RETURN
+$IP6T -A bad_tcp_packets -p tcp -j RETURN
+
+# icmp_packets chain
+#
+# This chain is for inbound (from the Internet) icmp packets only.
+# Type 8 (Echo Request) is not accepted by default
+# Enable it if you want remote hosts to be able to reach you.
+# 11 (Time Exceeded) is the only one accepted
+# that would not already be covered by the established
+# connection rule. Applied to INPUT on the external interface.
+#
+# See: http://www.ee.siue.edu/~rwalden/networking/icmp.html
+# for more info on ICMP types.
+#
+# Note that the stateful settings allow replies to ICMP packets.
+# These rules allow new packets of the specified types.
+
+# ICMP packets should fit in a Layer 2 frame, thus they should
+# never be fragmented. Fragmented ICMP packets are a typical sign
+# of a denial of service attack.
+$IPT -A icmp_packets --fragment -p icmp -j DROP
+$IP6T -A icmp_packets -p ipv6-icmp -m ipv6header --header frag --soft -j DROP
+
+# Echo - uncomment to allow your system to be pinged.
+# $IPT -A icmp_packets -p icmp -s 0/0 --icmp-type 8 -j ACCEPT
+# $IP6T -A icmp_packets -p ipv6-icmp -s 0/0 --icmpv6-type 8 -j ACCEPT
+
+# By default, however, drop pings without logging. Blaster
+# and other worms have infected systems blasting pings.
+# Comment the line below if you want pings logged, but it
+# will likely fill your logs.
+$IPT -A icmp_packets -p icmp -s 0/0 --icmp-type 8 -j DROP
+$IP6T -A icmp_packets -p ipv6-icmp -s 0/0 --icmpv6-type 8 -j DROP
+
+# Time Exceeded
+$IPT -A icmp_packets -p icmp -s 0/0 --icmp-type 11 -j ACCEPT
+$IP6T -A icmp_packets -p ipv6-icmp -s 0/0 --icmpv6-type 11 -j ACCEPT
+
+# Not matched, so return so it will be logged
+$IPT -A icmp_packets -p icmp -j RETURN
+$IP6T -A icmp_packets -p ipv6-icmp -j RETURN
+
+# TCP & UDP
+# Identify ports at:
+# http://www.chebucto.ns.ca/~rakerman/port-table.html
+# http://www.iana.org/assignments/port-numbers
+
+# udp_inbound chain
+#
+# This chain describes the inbound UDP packets it will accept.
+# It's applied to INPUT on the external or Internet interface.
+# Note that the stateful settings allow replies.
+# These rules are for new requests.
+# It drops netbios packets (windows) immediately without logging.
+
+# Drop netbios calls
+# Please note that these rules do not really change the way the firewall
+# treats netbios connections. Connections from the localhost and
+# internal interface (if one exists) are accepted by default.
+# Responses from the Internet to requests initiated by or through
+# the firewall are also accepted by default. To get here, the
+# packets would have to be part of a new request received by the
+# Internet interface. You would have to manually add rules to
+# accept these. I added these rules because some network connections,
+# such as those via cable modems, tend to be filled with noise from
+# unprotected Windows machines. These rules drop those packets
+# quickly and without logging them. This prevents them from traversing
+# the whole chain and keeps the log from getting cluttered with
+# chatter from Windows systems.
+$IPT -A udp_inbound -p udp -s 0/0 --dport 137 -j DROP
+$IPT -A udp_inbound -p udp -s 0/0 --dport 138 -j DROP
+$IP6T -A udp_inbound -p udp -s 0/0 --dport 137 -j DROP
+$IP6T -A udp_inbound -p udp -s 0/0 --dport 138 -j DROP
+
+# Ident requests (Port 113) must have a REJECT rule rather than the
+# default DROP rule. This is the minimum requirement to avoid
+# long delays while connecting. Also see the tcp_inbound rule.
+$IPT -A udp_inbound -p udp -s 0/0 --dport 113 -j REJECT
+$IP6T -A udp_inbound -p udp -s 0/0 --dport 113 -j REJECT
+
+# A more sophisticated configuration could accept the ident requests.
+# $IPT -A udp_inbound -p udp -s 0/0 --dport 113 -j ACCEPT
+# $IP6T -A udp_inbound -p udp -s 0/0 --dport 113 -j ACCEPT
+
+# IPv4 only:
+# Allow DHCP client request packets inbound from external network
+$IPT -A udp_inbound -p udp -s 0/0 --source-port 68 --dport 67 \
+ -j ACCEPT
+# Dynamic Address
+# If DHCP, the initial request is a broadcast. The response
+# doesn't exactly match the outbound packet. This explicitly
+# allow the DHCP ports to alleviate this problem.
+# If you receive your dynamic address by a different means, you
+# can probably comment this line.
+$IPT -A udp_inbound -p udp -s 0/0 --source-port 67 --dport 68 \
+ -j ACCEPT
+
+# Open the custom UDP ports if they have been configured:
+if [ -n "$UDP_LIST" ]; then
+ $IPT -A INPUT -p udp -m multiport --dport $UDP_LIST -j ACCEPT
+ $IP6T -A INPUT -p udp -m multiport --dport $UDP_LIST -j ACCEPT
+fi
+
+# Not matched, so return for logging
+$IPT -A udp_inbound -p udp -j RETURN
+$IP6T -A udp_inbound -p udp -j RETURN
+
+# udp_outbound chain
+#
+# This chain is used with a private network to prevent forwarding for
+# UDP requests on specific protocols. Applied to the FORWARD rule from
+# the internal network. Ends with an ACCEPT
+
+
+# No match, so ACCEPT
+$IPT -A udp_outbound -p udp -s 0/0 -j ACCEPT
+$IP6T -A udp_outbound -p udp -s 0/0 -j ACCEPT
+
+# tcp_inbound chain
+#
+# This chain is used to allow inbound connections to the
+# system/gateway. Use with care. It defaults to none.
+# It's applied on INPUT from the external or Internet interface.
+
+# Ident requests (Port 113) must have a REJECT rule rather than the
+# default DROP rule. This is the minimum requirement to avoid
+# long delays while connecting. Also see the tcp_inbound rule.
+$IPT -A tcp_inbound -p tcp -s 0/0 --dport 113 -j REJECT
+$IP6T -A tcp_inbound -p tcp -s 0/0 --dport 113 -j REJECT
+
+# A more sophisticated configuration could accept the ident requests.
+# $IPT -A tcp_inbound -p tcp -s 0/0 --dport 113 -j ACCEPT
+# $IP6T -A tcp_inbound -p tcp -s 0/0 --dport 113 -j ACCEPT
+
+# Open the requested TCP service ports if they have been configured:
+if [ -n "$TCP_LIST" ]; then
+ $IPT -A INPUT -p tcp -m multiport --dport $TCP_LIST -j ACCEPT
+ $IP6T -A INPUT -p tcp -m multiport --dport $TCP_LIST -j ACCEPT
+fi
+
+# Not matched, so return so it will be logged
+$IPT -A tcp_inbound -p tcp -j RETURN
+$IP6T -A tcp_inbound -p tcp -j RETURN
+
+# tcp_outbound chain
+#
+# This chain is used with a private network to prevent forwarding for
+# requests on specific protocols. Applied to the FORWARD rule from
+# the internal network. Ends with an ACCEPT
+
+# No match, so ACCEPT
+$IPT -A tcp_outbound -p tcp -s 0/0 -j ACCEPT
+$IP6T -A tcp_outbound -p tcp -s 0/0 -j ACCEPT
+
+#
+# INPUT Chain
+#
+# Allow all on localhost interface
+$IPT -A INPUT -p ALL -i $LO_IFACE -j ACCEPT
+$IP6T -A INPUT -p ALL -i $LO_IFACE -j ACCEPT
+
+# Allow all on other internal interfaces:
+for INDEV in ${!NETDEVARR[@]} ; do
+ if [ "${NETDEVARR[$INDEV]}" = "off" ] ; then
+ $IPT -A INPUT -p ALL -i $INDEV -j ACCEPT
+ $IP6T -A INPUT -p ALL -i $INDEV -j ACCEPT
+ fi
+done
+unset INDEV
+
+# Drop bad packets
+$IPT -A INPUT -p ALL -j bad_packets
+$IP6T -A INPUT -p ALL -j bad_packets
+
+# DOCSIS compliant cable modems
+# Some DOCSIS compliant cable modems send IGMP multicasts to find
+# connected PCs. The multicast packets have the destination address
+# 224.0.0.1. You can accept them. If you choose to do so,
+# Uncomment the rule to ACCEPT them and comment the rule to DROP
+# them The firewall will drop them here by default to avoid
+# cluttering the log. The firewall will drop all multicasts
+# to the entire subnet (224.0.0.1) by default. To only affect
+# IGMP multicasts, change '-p ALL' to '-p 2'. Of course,
+# if they aren't accepted elsewhere, it will only ensure that
+# multicasts on other protocols are logged.
+# Drop them without logging.
+$IPT -A INPUT -p ALL -d 224.0.0.1 -j DROP
+# The rule to accept the packets.
+# $IPT -A INPUT -p ALL -d 224.0.0.1 -j ACCEPT
+
+# Inbound Internet Packet Rules
+
+for INDEV in ${!NETDEVARR[@]} ; do
+ if [ "${NETDEVARR[$INDEV]}" = "on" ] ; then
+ # Accept Established Connections
+ $IPT -A INPUT -p ALL -i $INDEV -m state --state ESTABLISHED,RELATED \
+ -j ACCEPT
+ $IP6T -A INPUT -p ALL -i $INDEV -m state --state ESTABLISHED,RELATED \
+ -j ACCEPT
+
+ # Route the rest to the appropriate user chain
+ $IPT -A INPUT -p tcp -i $INDEV -j tcp_inbound
+ $IP6T -A INPUT -p tcp -i $INDEV -j tcp_inbound
+ $IPT -A INPUT -p udp -i $INDEV -j udp_inbound
+ $IP6T -A INPUT -p udp -i $INDEV -j udp_inbound
+ $IPT -A INPUT -p icmp -i $INDEV -j icmp_packets
+ $IP6T -A INPUT -p ipv6-icmp -i $INDEV -j icmp_packets
+ fi
+done
+unset INDEV
+
+# Drop without logging broadcasts that get this far.
+# Cuts down on log clutter.
+# Comment this line if testing new rules that impact
+# broadcast protocols.
+$IPT -A INPUT -m pkttype --pkt-type broadcast -j DROP
+$IP6T -A INPUT -m pkttype --pkt-type broadcast -j DROP
+
+# Log packets that still don't match
+$IPT -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
+ --log-prefix "INPUT packet died: "
+$IP6T -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
+ --log-prefix "INPUT packet ipv6 died: "
+
+#
+# FORWARD Chain
+#
+# Used if forwarding for a private network
+
+#
+# OUTPUT Chain
+#
+# Generally trust the firewall on output
+
+# However, invalid icmp packets need to be dropped
+# to prevent a possible exploit.
+$IPT -A OUTPUT -m state -p icmp --state INVALID -j DROP
+$IP6T -A OUTPUT -m state -p ipv6-icmp --state INVALID -j DROP
+
+# Localhost
+$IPT -A OUTPUT -p ALL -s $LO_IP -j ACCEPT
+$IP6T -A OUTPUT -p ALL -s $LO_IP6 -j ACCEPT
+$IPT -A OUTPUT -p ALL -o $LO_IFACE -j ACCEPT
+$IP6T -A OUTPUT -p ALL -o $LO_IFACE -j ACCEPT
+
+# Allow all on other internal interfaces:
+for OUTDEV in ${!NETDEVARR[@]} ; do
+ if [ "${NETDEVARR[$OUTDEV]}" = "off" ] ; then
+ $IPT -A OUTPUT -p ALL -o $OUTDEV -j ACCEPT
+ $IP6T -A OUTPUT -p ALL -o $OUTDEV -j ACCEPT
+ fi
+done
+unset OUTDEV
+
+# To internet
+for OUTDEV in ${!NETDEVARR[@]} ; do
+ if [ "${NETDEVARR[$OUTDEV]}" = "on" ] ; then
+ $IPT -A OUTPUT -p ALL -o $OUTDEV -j ACCEPT
+ $IP6T -A OUTPUT -p ALL -o $OUTDEV -j ACCEPT
+ fi
+done
+
+# Log packets that still don't match
+$IPT -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
+ --log-prefix "OUTPUT packet died: "
+$IP6T -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \
+ --log-prefix "OUTPUT packet ipv6 died: "
+
+#
+# nat table
+#
+# The nat table is where network address translation occurs if there
+# is a private network. If the gateway is connected to the Internet
+# with a static IP, snat is used. If the gateway has a dynamic address,
+# masquerade must be used instead. There is more overhead associated
+# with masquerade, so snat is better when it can be used.
+# The nat table has a builtin chain, PREROUTING, for dnat and redirects.
+# Another, POSTROUTING, handles snat and masquerade.
+
+#
+# PREROUTING chain
+#
+
+#
+# POSTROUTING chain
+#
+
+
+#
+# mangle table
+#
+# The mangle table is used to alter packets. It can alter or mangle them in
+# several ways. For the purposes of this generator, we only use its ability
+# to alter the TTL in packets. However, it can be used to set netfilter
+# mark values on specific packets. Those marks could then be used in another
+# table like filter, to limit activities associated with a specific host, for
+# instance. The TOS target can be used to set the Type of Service field in
+# the IP header. Note that the TTL target might not be included in the
+# distribution on your system. If it is not and you require it, you will
+# have to add it. That may require that you build from source.
+
+# Save the firewall configuration so that 'rc.firewall' can load it:
+mkdir -p $DESTDIR/etc/firewall
+${IPTS} > $DESTDIR/etc/firewall/ipv4
+${IP6TS} > $DESTDIR/etc/firewall/ipv6
+
diff --git a/setup2hd/SeTpasswd.tpl b/setup2hd/SeTpasswd.tpl
new file mode 100644
index 0000000..29d9943
--- /dev/null
+++ b/setup2hd/SeTpasswd.tpl
@@ -0,0 +1,51 @@
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+#!/bin/sh
+# Liveslak replacement for Slackware's SeTpassword script.
+
+TMP=/var/log/setup/tmp
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+T_PX="$(cat $TMP/SeTT_PX)"
+
+# Check for root password:
+if [ "$(cat $T_PX/etc/shadow | grep 'root:' | cut -f 2 -d :)" != "" ]; then
+ # Root password has been set, nothing further to be done.
+ exit 0
+fi
+
+# No root password has been set yet, which means no user was created either.
+
+# Set up a user account,
+if [ -r $TMP/SeTlive ]; then
+ # We will only configgure su access when installing a Live OS:
+ SUTEXT="\nYour account will be added to sudoers and suauth."
+else
+ SUTEXT=""
+fi
+${DIALOG} --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \
+ --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --msgbox "You will first get the chance to create your user account, \
+and set its password.${SUTEXT}\n\n\
+After that, you will be asked to set the root password." 11 55
+# This will set UFULLNAME, UACCOUNT and USHELL variables:
+SeTuacct 2>&1 1> $TMP/temppasswd
+if [ $? = 0 ]; then
+ # User filled out the form, so let's get the results for
+ # UFULLNAME, UACCOUNT, UACCTNR and USHELL:
+ source $TMP/temppasswd
+ rm -f $TMP/temppasswd
+ # Set a password for the new account:
+ UPASS=$(SeTupass $UACCOUNT)
+ # Create the account and set the password:
+ chroot ${T_PX} /usr/sbin/useradd -c "$UFULLNAME" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,dialout,games,disk,input -u ${UACCTNR} -d /home/${UACCOUNT} -m -s ${USHELL} ${UACCOUNT}
+ echo "${UACCOUNT}:${UPASS}" | chroot ${T_PX} /usr/sbin/chpasswd
+ unset UPASS
+fi # End user creation
+
+# Finally, set the root password:
+UPASS=$(SeTupass root)
+echo "root:${UPASS}" | chroot ${T_PX} /usr/sbin/chpasswd
+unset UPASS
diff --git a/setup2hd/SeTuacct.tpl b/setup2hd/SeTuacct.tpl
new file mode 100644
index 0000000..f6d6464
--- /dev/null
+++ b/setup2hd/SeTuacct.tpl
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+TMP=/var/log/setup/tmp
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+T_PX="$(cat $TMP/SeTT_PX)"
+
+freeuid() {
+ # Get the first free UIDNumber after 999:
+ local LUIDS=$( cat ${T_PX}/etc/passwd | cut -d: -f3 | sort -n )
+ local LUID=999
+ while true; do
+ LUID=$(( $LUID + 1))
+ if ! echo $LUIDS | grep -F -q -w "$LUID"; then
+ break;
+ fi
+ done
+ echo $LUID
+}
+FREEUID="$(freeuid)"
+
+UFULLNAME=""
+UACCOUNT=""
+UACCTNR="$FREEUID"
+USHELL="/bin/bash"
+UFORM="Fill out your user details:"
+while [ 0 ]; do
+ ${DIALOG} --stdout --ok-label "Submit" --no-cancel \
+ --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \
+ --form "$UFORM" \
+ 11 64 0 \
+ "Full Name:" 1 1 "$UFULLNAME" 1 14 40 0 \
+ "Logonname:" 2 1 "$UACCOUNT" 2 14 32 0 \
+ "UIDNumber:" 3 1 "$UACCTNR" 3 14 12 0 \
+ "Login Shell:" 4 1 "$USHELL" 4 14 12 0 \
+ 2>&1 1> $TMP/tempuacct
+ iii=0
+ declare -a USERATTR
+ while read LINE ; do
+ USERATTR[$iii]="$LINE"
+ iii=$(expr $iii + 1)
+ done < $TMP/tempuacct
+ rm -f $TMP/tempuacct
+ UFULLNAME="${USERATTR[0]}"
+ UACCOUNT="${USERATTR[1]}"
+ UACCTNR="${USERATTR[2]}"
+ USHELL="${USERATTR[3]}"
+ unset USERATTR
+ UINPUT=0
+ # Validate the input:
+ UACC_INVALID1="$(echo ${UACCOUNT:0:1} |tr -d 'a-z_')"
+ UACC_INVALID="$(echo ${UACCOUNT:1} |tr -d 'a-z0-9_-')"
+ if [ -n "$UACC_INVALID1" -o -n "$UACC_INVALID" ]; then
+ # User account contains invalid characters, let's remove them all:
+ UINPUT=1
+ UACCOUNT="$(echo ${UACCOUNT} |tr -cd 'a-z_')"
+ fi
+ if [ -z "$UACCOUNT" -o -z "$UFULLNAME" ]; then
+ # User account or fullname is empty, let's try again:
+ UINPUT=$(expr $UINPUT + 2)
+ fi
+ if chroot ${T_PX} /usr/bin/id -u ${UACCTNR} 1>/dev/null 2>/dev/null ; then
+ # UidNumber is already in use, fall back to sane default:
+ UINPUT=$(expr $UINPUT + 4)
+ UACCTNR=$FREEUID
+ fi
+ if ! grep -q ${USHELL} ${T_PX}/etc/shells ; then
+ # Login shell is invalid, suggest the bash shell again:
+ UINPUT=$(expr $UINPUT + 8)
+ USHELL=/bin/bash
+ fi
+ if [ $UINPUT -eq 0 ]; then
+ break
+ elif [ $UINPUT -eq 1 ]; then
+ UFORM="Please only use valid characters for logonname"
+ elif [ $UINPUT -eq 2 ]; then
+ UFORM="Please enter your logon and full name"
+ elif [ $UINPUT -eq 3 ]; then
+ UFORM="Use valid characters for logonname, and enter full name"
+ elif [ $UINPUT -eq 4 ]; then
+ UFORM="Enter unused number for your account, $FREEUID is a good default"
+ elif [ $UINPUT -eq 8 ]; then
+ UFORM="Please enter a valid shell"
+ else
+ UFORM="Fill all fields, using valid logonname/uidnumber values"
+ fi
+done
+
+echo "UACCOUNT=$UACCOUNT"
+echo "UFULLNAME='$UFULLNAME'"
+echo "UACCTNR=$UACCTNR"
+echo "USHELL=$USHELL"
diff --git a/setup2hd/SeTudiskpart.tpl b/setup2hd/SeTudiskpart.tpl
new file mode 100644
index 0000000..de671f4
--- /dev/null
+++ b/setup2hd/SeTudiskpart.tpl
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+TMP=/var/log/setup/tmp
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+
+ # If we do not find any useful disks at all, we must bail:
+ if [ -z "$(lsblk -a -o NAME,SIZE,RM,RO,TYPE,MODEL |tr -s '[:blank:]' ' ' |grep '0 *0 *disk' | grep -v '^ram')" ]; then
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "NO HARD DRIVE DETECTED" \
+ --msgbox "This machine appears not to have any hard drives installed.\
+This setup will not work. Please add a hard drive to the computer first." 10 64
+ exit 1
+ fi
+
+ # Generate a list of local hard drives we can write to:
+ rm -f $TMP/tempscript
+ cat <<EOT > $TMP/tempscript
+${DIALOG} --stdout \\
+ --title "SELECT DISK DRIVES" \\
+ --backtitle "Creating Linux, swap and EFI partitions" \\
+ --checklist "Select from available drives.\nA disk partitioning utility \\
+will be presented for any drive you select here:" \\
+ 19 0 9 \\
+EOT
+ lsblk -a -o NAME,SIZE,RM,RO,TYPE,MODEL | \
+ tr -s '[:blank:]' ' ' | grep '0 *0 *disk' | grep -v '^ram' | \
+ while read LINE ; do
+ DISKATTR=($LINE)
+ DISKVENDOR="${DISKATTR[@]:5}"
+ if [ -z "${DISKVENDOR}" ]; then
+ DISKVENDOR="UnknownVendor"
+ fi
+ echo "\"/dev/${DISKATTR[0]}\" \"${DISKATTR[1]}: ${DISKVENDOR}\" off \\" >> $TMP/tempscript
+ done
+ echo '2>&1 1>$TMP/availdisks' >> $TMP/tempscript
+
+ # Loop until the user makes a choice:
+ while [ 0 ]; do
+ source $TMP/tempscript
+ if [ ! $? = 0 ] || [ ! -s $TMP/availdisks ]; then
+ # Canceled the dialog, or did not select anything:
+ rm -f $TMP/availdisks
+ else
+ # We got an answer:
+ for DISKDRIVE in $(cat $TMP/availdisks) ; do
+ # Determine which disk partitioning tool to use:
+ if gdisk -l $DISKDRIVE |tr -s '[:blank:]' ' ' |grep -q "MBR: MBR only" ; then
+ PARTTOOL=cfdisk
+ else
+ PARTTOOL=cgdisk
+ fi
+ # Now let the user create her partitions:
+ $PARTTOOL $DISKDRIVE
+ done
+ break
+ fi
+ done
+ # We should have partitions now, so re-run probe and collect that list:
+ probe -l 2> /dev/null | grep -E 'Linux$' | sort 1> $TMP/SeTplist 2> /dev/null
+
diff --git a/setup2hd/SeTumedia.tpl b/setup2hd/SeTumedia.tpl
new file mode 100644
index 0000000..7035fcc
--- /dev/null
+++ b/setup2hd/SeTumedia.tpl
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+TMP=/var/log/setup/tmp
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+
+${DIALOG} --backtitle "Select Slackware installation source." \
+--title "SOURCE MEDIA SELECTION" \
+--default-item '4' --menu \
+"Please select the media from which to install Slackware Linux:" \
+11 70 4 \
+"1" "Install Slackware from NFS (Network File System)" \
+"2" "Install Slackware from FTP/HTTP server" \
+"3" "Install Slackware from Samba share" \
+"4" "Install @UDISTRO@ (@LIVEDE@) Live OS to disk" \
+2> $TMP/media
+if [ ! $? = 0 ]; then
+ rm $TMP/media
+ exit
+fi
+
+SOURCE_MEDIA="`cat $TMP/media`"
+rm -f $TMP/media
+if [ "$SOURCE_MEDIA" = "1" ]; then
+ INSNFS
+elif [ "$SOURCE_MEDIA" = "2" ]; then
+ INSURL
+elif [ "$SOURCE_MEDIA" = "3" ]; then
+ INSSMB
+elif [ "$SOURCE_MEDIA" = "4" ]; then
+ touch $TMP/SeTlive
+ touch $TMP/SeTsource
+fi
+
diff --git a/setup2hd/SeTupass.tpl b/setup2hd/SeTupass.tpl
new file mode 100644
index 0000000..fcc7523
--- /dev/null
+++ b/setup2hd/SeTupass.tpl
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+TMP=/var/log/setup/tmp
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+
+UACCOUNT="$1"
+
+UPASS1=""
+UPASS2=""
+UFORM="Define a new password for user '$UACCOUNT'"
+
+ while [ 0 ]; do
+ if [ "${DIALOG}" == "Xdialog" ]; then
+ ${DIALOG} --stdout --ok-label "Submit" --no-cancel \
+ --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \
+ --left --separator="\n" --password --password \
+ --2inputsbox "$UFORM" 20 40 \
+ "Password: " "$UPASS1" "Repeat password: " "$UPASS2" \
+ 2>&1 1> $TMP/tempupass
+ else
+ ${DIALOG} --stdout --ok-label "Submit" --no-cancel \
+ --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \
+ --insecure --passwordform "$UFORM" 9 64 0 "Password:" \
+ 1 1 "$UPASS1" 1 18 40 0 "Repeat password:" 2 1 "$UPASS2" 2 18 40 0 \
+ 2>&1 1> $TMP/tempupass
+ fi
+
+ iii=0
+ declare -a USERATTR
+ while read LINE ; do
+ USERATTR[$iii]="$LINE"
+ iii=$(expr $iii + 1)
+ done < $TMP/tempupass
+ rm -f $TMP/tempupass
+ UPASS1="${USERATTR[0]}"
+ UPASS2="${USERATTR[1]}"
+ unset USERATTR
+ if [ -z "$UPASS1" ]; then
+ UFORM="Password must not be empty, try again for user '$UACCOUNT'"
+ elif [ "$UPASS1" == "$UPASS2" ]; then
+ break
+ else
+ UFORM="Passwords do not match, try again for user '$UACCOUNT'"
+ fi
+ done
+ echo "${UPASS1}"
+ unset UPASS1
+ unset UPASS2
+ unset USERATTR
+
diff --git a/setup2hd/rc.firewall.tpl b/setup2hd/rc.firewall.tpl
new file mode 100644
index 0000000..4019b1a
--- /dev/null
+++ b/setup2hd/rc.firewall.tpl
@@ -0,0 +1,141 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Slackware init script for iptables firewall:
+# /etc/rc.d/rc.firewall
+# Written by Eric Hameleers <alien@slackware.com> for the liveslak project.
+# ---------------------------------------------------------------------------
+
+# Specify path to the iptables binaries:
+IPT_PATH="/usr/sbin"
+
+# Save location for firewall rules:
+[ ! -d /etc/firewall ] && mkdir /etc/firewall
+
+# Is ipv6 supported on this computer?
+if [ $(cat /sys/module/ipv6/parameters/disable) -eq 1 ]; then
+ HAVE_IPV6=0
+else
+ HAVE_IPV6=1
+fi
+
+fwflush() {
+ local IPT=${1:-iptables}
+ # Accept all traffic first:
+ ${IPT_PATH}/${IPT} -P INPUT ACCEPT
+ ${IPT_PATH}/${IPT} -P FORWARD ACCEPT
+ ${IPT_PATH}/${IPT} -P OUTPUT ACCEPT
+ # Flush all iptables chains and rules:
+ ${IPT_PATH}/${IPT} -F
+ # Delete all iptables chains:
+ ${IPT_PATH}/${IPT} -X
+ # Flush all counters:
+ ${IPT_PATH}/${IPT} -Z
+ # Flush/delete all nat and mangle rules:
+ if [ "$IPT" != "ip6tables" ]; then
+ ${IPT_PATH}/${IPT} -t nat -F
+ ${IPT_PATH}/${IPT} -t nat -X
+ fi
+ ${IPT_PATH}/${IPT} -t mangle -F
+ ${IPT_PATH}/${IPT} -t mangle -X
+ ${IPT_PATH}/${IPT} -t raw -F
+ ${IPT_PATH}//${IPT} -t raw -X
+}
+
+basic_protection() {
+ # Basic measures to applied on first start:
+
+ # Turn off packet forwarding in the kernel
+ echo 0 > /proc/sys/net/ipv4/ip_forward
+ # Enable TCP SYN Cookie Protection
+ echo 1 > /proc/sys/net/ipv4/tcp_syncookies
+ # Disable ICMP Redirect Acceptance
+ echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
+ # Accept only from gateways in the default gateways list
+ echo 1 > /proc/sys/net/ipv4/conf/all/secure_redirects
+ # Do not send Redirect Messages
+ echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
+ # Enable bad error message protection
+ echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
+ # Enable broadcast echo protection
+ echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
+ # Disable source-routed packets
+ echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
+ # Do not log spoofed packets, source-routed packets, and redirect packets
+ echo 0 > /proc/sys/net/ipv4/conf/all/log_martians
+}
+
+fw_start() {
+ echo "Loading firewall rules..."
+ # Apply basic protection in the kernel:
+ basic_protection
+ # Restore firewall rules:
+ if [ -f /etc/firewall/ipv4 ]; then
+ ${IPT_PATH}/iptables-restore < /etc/firewall/ipv4
+ else
+ echo "** No saved ipv4 firewall rules found. Run 'myfwconf' first."
+ fi
+ if [ $HAVE_IPV6 -eq 1 ]; then
+ if [ -f /etc/firewall/ipv6 ]; then
+ ${IPT_PATH}/ip6tables-restore < /etc/firewall/ipv6
+ else
+ echo "** No saved ipv6 firewall rules found. Run 'myfwconf' first."
+ fi
+ fi
+}
+
+fw_reload() {
+ fw_flush
+ fw_start
+}
+
+fw_save() {
+ # Save firewall rules:
+ echo "Saving firewall rules..."
+ ${IPT_PATH}/iptables -Ln 2>/dev/null
+ [ $? -eq 0 ] && ${IPT_PATH}/iptables-save > /etc/firewall/ipv4
+ ${IPT_PATH}/ip6tables -Ln 2>/dev/null
+ [ $? -eq 0 ] && ${IPT_PATH}/ip6tables-save > /etc/firewall/ipv6
+}
+
+fw_flush() {
+ # Flush firewall rules, delete all custom chains and reset counters:
+ # also resetting all policies to ACCEPT:
+ echo "Flushing firewall rules..."
+ fwflush iptables
+ if [ $HAVE_IPV6 -eq 1 ]; then
+ fwflush ip6tables
+ fi
+}
+
+fw_status() {
+ ${IPT_PATH}/iptables -L -n 2>/dev/null
+ [ $? -ne 0 ] && echo "** No ipv4 support in the kernel!"
+ ${IPT_PATH}/ip6tables -L -n 2>/dev/null
+ [ $? -ne 0 ] && echo "** No ipv6 support in the kernel!"
+}
+
+case "$1" in
+ start)
+ fw_start
+ ;;
+ stop|flush)
+ fw_flush
+ ;;
+ reload)
+ fw_reload
+ ;;
+ save)
+ fw_save
+ ;;
+ status)
+ fw_status
+ ;;
+ *)
+ echo "Usage: $0 start|stop|reload|save|flush|status"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/setup2hd/setup.liveslak.tpl b/setup2hd/setup.liveslak.tpl
new file mode 100644
index 0000000..fb6e03e
--- /dev/null
+++ b/setup2hd/setup.liveslak.tpl
@@ -0,0 +1,282 @@
+# This script is sourced from setup2hd.
+
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+ # Liveslak installation routine:
+ if [ "$MAINSELECT" = "INSTALL" ]; then
+ if [ ! -r $TMP/SeTnative ]; then
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "CANNOT INSTALL SOFTWARE YET" --msgbox "\
+\n\
+Before you can install software, complete the following tasks:\n\
+\n\
+1. Set up your target Linux partition(s).\n\
+\n\
+You may also optionally remap your keyboard and set up your\n\
+swap partition(s). \n\
+\n\
+Press ENTER to return to the main menu." 16 68
+ continue
+ fi
+
+ # --------------------------------------------- #
+ # Slackware Live Edition - install to disk: #
+ # --------------------------------------------- #
+
+ # Buy us some time while we are calculating disk usage:
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --infobox \
+ "\nCalculating disk usage, please be patient ..." 5 65
+
+ ACT_MODS=$(ls -rt --indicator-style=none /mnt/live/modules/ |wc -l)
+ TOT_MODS=$(find /mnt/livemedia/@LIVEMAIN@/ -type f -name "*.sxz" |wc -l)
+ DU_LIVE=$(du -s /mnt/live/modules/ 2>/dev/null |tr -s '\t' ' ' |cut -f1 -d' ')
+ PARTFREE=$(df -P -BM $T_PX |tail -1 |tr -s '\t' ' ' |cut -d' ' -f4)
+ PARTFREE=${PARTFREE%M}
+
+ # Warn when it looks we have insufficient room:
+ if [ $PARTFREE -lt $(($DU_LIVE/1024)) ]; then
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --yesno \
+ "\nAvailable space: $PARTFREE MB\nRequired space: $(($DU_LIVE/1024))\nIt looks like your hard drive partition is too small.\nDo you want to continue?" 10 65
+ retval=$?
+ if [ $retval = 1 ]; then
+ umount $T_PX
+ exit 1
+ fi
+ else
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --msgbox \
+ "\nAvailable space: $PARTFREE MB\nRequired space: $(($DU_LIVE/1024)) MB\nIt looks like you're good to go!" 10 65
+ fi
+
+ # Install the Live OS by rsyncing the readonly overlay to the harddisk:
+ if [ "${DIALOG}" == "Xdialog" ]; then
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --infobox \
+ "\nProcessing ${TOT_MODS} @CDISTRO@ Live modules ($(( $DU_LIVE/1024 )) MB)" 8 80 5000
+ (
+ rsync -HAXa --whole-file --checksum-choice=none --inplace \
+ --info=progress2 --no-inc-recursive \
+ /mnt/liveslakfs/ $T_PX/ ; echo DONE \
+ ) | ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --tailbox \
+ - 8 80
+ else
+ (
+ rsync -HAXa --whole-file --checksum-choice=none --inplace \
+ --info=progress2 --no-inc-recursive \
+ /mnt/liveslakfs/ $T_PX/ ; echo DONE \
+ ) | ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --programbox \
+ "\nProcessing ${TOT_MODS} @CDISTRO@ Live modules ($(( $DU_LIVE/1024 )) MB)" 8 80
+ fi
+
+ #
+ # Live OS Post Install routine. If you want, you can override this routine
+ # by (re-)defining this function "live_post_install()" in a file called
+ # "/usr/share/@LIVEMAIN@/setup2hd.@DISTRO@".
+ #
+
+ live_post_install () {
+ # ---------------------
+ # Set up a user account,
+ ${DIALOG} --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \
+ --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --msgbox "You will first get the chance to create your user account, \
+and set its password.\nYour account will be added to 'sudoers'.\n\n\
+After that, you will be asked to set the root password." 11 55
+ # This will set UFULLNAME, UACCOUNT, UACCTNR and USHELL variables:
+ SeTuacct 2>&1 1> $TMP/uacctresult
+ if [ $? = 0 ]; then
+ # User filled out the form, so let's get the results for
+ # UFULLNAME, UACCOUNT, UACCTNR and USHELL:
+ source $TMP/uacctresult
+ rm -f $TMP/uacctresult
+ # Set a password for the new account:
+ UPASS=$(SeTupass $UACCOUNT)
+ # Create the account and set the password:
+ chroot ${T_PX} /usr/sbin/useradd -c "$UFULLNAME" -g users -G wheel,audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,dialout,games,disk,input -u ${UACCTNR} -d /home/${UACCOUNT} -m -s ${USHELL} ${UACCOUNT}
+ echo "${UACCOUNT}:${UPASS}" | chroot ${T_PX} /usr/sbin/chpasswd
+ unset UPASS
+
+ # Configure suauth if we are not on a PAM system
+ # (where this does not work):
+ if [ ! -L ${T_PX}/lib@DIRSUFFIX@/libpam.so.? ]; then
+ cat <<EOT >${T_PX}/etc/suauth
+root:${UACCOUNT}:OWNPASS
+root:ALL EXCEPT GROUP wheel:DENY
+EOT
+ chmod 600 ${T_PX}/etc/suauth
+ fi
+
+ # Configure sudoers:
+ chmod 640 ${T_PX}/etc/sudoers
+ sed -i ${T_PX}/etc/sudoers -e 's/# *\(%wheel\sALL=(ALL)\sALL\)/\1/'
+ chmod 440 ${T_PX}/etc/sudoers
+ fi # End user creation
+ # ---------------------------
+
+ if [ "$(cat $T_PX/etc/shadow | grep 'root:' | cut -f 2 -d :)" = "" ]; then
+ # There is no root password yet:
+ UPASS=$(SeTupass root)
+ echo "root:${UPASS}" | chroot ${T_PX} /usr/sbin/chpasswd
+ unset UPASS
+ fi
+
+ # Add a rc.firewall script:
+ install -D -m0775 -t ${T_PX}/etc/rc.d/ /usr/share/@LIVEMAIN@/rc.firewall
+ # Install a firewall configuration script:
+ install -D -m755 /usr/share/@LIVEMAIN@/SeTfirewall ${T_PX}/usr/sbin/myfwconf
+ # Add a Slackware setup script invoking that 'myfwconf' script:
+ cat <<EOT >${T_PX}/var/log/setup/setup.firewall
+#!/bin/sh
+#BLURB="Configure a basic firewall."
+chroot . usr/sbin/myfwconf
+EOT
+ chmod 0775 ${T_PX}/var/log/setup/setup.firewall
+
+ # Re-use some of the custom configuration from 0099-@DISTRO@_zzzconf-*.sxz
+ # (some of these may not be present but the command will not fail):
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "POST-INSTALL @UDISTRO@ LIVE (@LIVEDE@) DATA" --infobox \
+ "\nCopying Live modifications to hard disk ..." 5 65
+ sleep 1 # It's too fast...
+ # Do not overwrite a custom keymap:
+ if [ ! -f $T_PX/etc/rc.d/rc.keymap ]; then
+ unsquashfs -n -f -dest $T_PX \
+ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
+ /etc/rc.d/rc.keymap
+ fi
+ unsquashfs -n -f -dest $T_PX \
+ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
+ /etc/X11/xinit/xinitrc \
+ /etc/X11/xdm/liveslak-xdm \
+ /etc/X11/xorg.conf.d/30-keyboard.conf \
+ /etc/inittab \
+ /etc/skel \
+ /etc/profile.d/lang.sh \
+ /etc/rc.d/rc.font \
+ /etc/rc.d/rc.gpm \
+ /etc/slackpkg \
+ /etc/vconsole.conf \
+ /var/lib/sddm/state.conf \
+ /var/lib/slackpkg
+ # Point xdm to the custom /etc/X11/xdm/liveslak-xdm/xdm-config:
+ sed -i ${T_PX}/etc/rc.d/rc.4 -e 's,bin/xdm -nodaemon,& -config /etc/X11/xdm/liveslak-xdm/xdm-config,'
+ # If gcc was not installed, create a symlink to cpp pointing to mcpp;
+ # liveslak's XDM theme needs a C preprocessor to calculate screen positions:
+ if [ ! -x ${T_PX}/usr/bin/cpp ]; then
+ ln -s mcpp ${T_PX}/usr/bin/cpp
+ fi
+ # If nvi was not installed, do not use it as a default selection:
+ if [ ! -x ${T_PX}/usr/bin/nvi ] && [ -e ${T_PX}/var/log/setup/setup.vi-ex ];
+ then
+ sed -e 's/default-item "nvi/default-item "elvis/' -i ${T_PX}/var/log/setup/setup.vi-ex
+ fi
+ # Prevent SeTconfig from asking redundant questions later on:
+ sed -i /usr/share/@LIVEMAIN@/SeTconfig \
+ -e '/.\/var\/log\/setup\/$SCRIPT $T_PX $ROOT_DEVICE/i # Skip stuff that was taken care of by liveslak\nif echo $SCRIPT |grep -E "(make-bootdisk|mouse|setconsolefont|xwmconfig)"; then continue; fi'
+
+ # If a user account was created, we restore some of the user customization:
+ if [ -n "${UACCOUNT}" ] && [ -d "${T_PX}/home/${UACCOUNT}" ]; then
+ unsquashfs -n -f -dest $T_PX \
+ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
+ /home/@LIVEUID@/.face \
+ /home/@LIVEUID@/.face.icon \
+ /home/@LIVEUID@/.bashrc \
+ /home/@LIVEUID@/.profile \
+ /home/@LIVEUID@/.screenrc \
+ /home/@LIVEUID@/.xprofile \
+ /home/@LIVEUID@/.xscreensaver
+ fi
+
+ # If the Live OS is real-time capable we need to apply that to the install:
+ if [ "@LIVEDE@" = "DAW" -o "@LIVEDE@" = "STUDIOWARE" ]; then
+ unsquashfs -n -f -dest $T_PX \
+ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
+ /etc/security/limits.d/rt_audio.conf \
+ /etc/initscript \
+ /etc/udev/rules.d/40-timer-permissions.rules \
+ /etc/sysctl.d/daw.conf
+ fi
+
+ # Copy relevant settings for Live DAW:
+ if [ "@LIVEDE@" = "DAW" ]; then
+ LCLIVEDE=$(echo @LIVEDE@ |tr 'A-Z' 'a-z')
+ unsquashfs -n -f -dest $T_PX \
+ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
+ /etc/pulse/daemon.conf \
+ /etc/xdg/menus/applications-merged/liveslak-daw.menu \
+ /usr/share/desktop-directories/liveslak-daw.directory \
+ /usr/share/icons/hicolor/256x256/apps/liveslak-daw.png \
+ /usr/share/applications \
+ /usr/share/wallpapers/${LCLIVEDE} \
+ /usr/share/@LIVEMAIN@/${LCLIVEDE}/background.jpg \
+ /usr/share/sddm/themes/breeze/${LCLIVEDE}_background.jpg \
+ /usr/share/sddm/themes/breeze/theme.conf.user
+
+ # If a user account was created, we restore DAW user customization:
+ if [ -n "${UACCOUNT}" ] && [ -d "${T_PX}/home/${UACCOUNT}" ]; then
+ unsquashfs -n -f -dest $T_PX \
+ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \
+ /home/@LIVEUID@/.jackdrc \
+ /home/@LIVEUID@/.config/autostart/qjackctl.desktop \
+ /home/@LIVEUID@/.config/rncbc.org/QjackCtl.conf \
+ /home/@LIVEUID@/.config/kscreenlockerrc \
+ /home/@LIVEUID@/.config/plasmarc
+ fi
+ fi
+
+ # If we restored user customizations and the new user account is
+ # not the same as the live user, sync the files over:
+ if [ "@LIVEUID@" != ${UACCOUNT} ]; then
+ rsync -a $T_PX/home/@LIVEUID@/ $T_PX/home/${UACCOUNT}/
+ rm -rf $T_PX/home/@LIVEUID@
+ # Also change SDDM default user:
+ sed -i ${T_PX}/var/lib/sddm/state.conf -e "s/User=@LIVEUID@/User=${UACCOUNT}/g"
+ fi
+ # Let's ensure the proper ownership:
+ chroot ${T_PX} /usr/bin/chown -R ${UACCTNR} /home/${UACCOUNT}
+
+ # Remove the marker file from the filesystem root:
+ rm -f ${T_PX}/@MARKER@
+
+ cat << EOF > $TMP/tempmsg
+
+ @CDISTRO@ Live Edition (@LIVEDE@) has been installed to your hard drive!
+ We installed the ${ACT_MODS} active modules (out of ${TOT_MODS} available).
+ The following configuration was copied from the Live OS to your harddisk:
+ - console font
+ - default runlevel
+ - keyboard layout
+ - language setting
+ - slackpkg/slackpkg+
+
+EOF
+ ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \
+ --title "POST INSTALL HINTS AND TIPS" --msgbox "`cat $TMP/tempmsg`" \
+ 19 65
+ rm $TMP/tempmsg
+
+ MAINSELECT="CONFIGURE"
+ } # END live_post_install() function
+
+
+ if [ -f /usr/share/@LIVEMAIN@/setup2hd.@DISTRO@ ]; then
+ # If the setup2hd post-configuration file exists, source it.
+ # The file should re-define the live_post_install() function.
+ . /usr/share/@LIVEMAIN@/setup2hd.@DISTRO@
+ fi
+
+ # Now, execute the function - either our own built-in version
+ # or the re-defined function from the custom setup2hd.@DISTRO@ file.
+ live_post_install
+
+ # --------------------------------------------- #
+ # Slackware Live Edition - end install to disk: #
+ # --------------------------------------------- #
+
+ fi
+ # End liveslak installation routine.
diff --git a/setup2hd/setup.slackware.tpl b/setup2hd/setup.slackware.tpl
new file mode 100644
index 0000000..e1b9fa1
--- /dev/null
+++ b/setup2hd/setup.slackware.tpl
@@ -0,0 +1,164 @@
+# This script is sourced from setup2hd.
+
+# The script defaults to curses dialog but Xdialog is a good alternative:
+DIALOG=${DIALOG:-"dialog"}
+
+ # Slackware installation routine as taken from original 'setup':
+ if [ "$MAINSELECT" = "INSTALL" ]; then
+ if [ ! -r $TMP/SeTSERIES -o ! -r $TMP/SeTsource -o ! -r $TMP/SeTnative ]; then
+ ${DIALOG} --title "CANNOT INSTALL SOFTWARE YET" --msgbox "\
+\n\
+Before you can install software, complete the following tasks:\n\
+\n\
+1. Select your source media.\n\
+2. Set up your target Linux partition(s).\n\
+3. Select which software categories to install.\n\
+\n\
+You may also optionally remap your keyboard and set up your\n\
+swap partition(s). \n\
+\n\
+Press ENTER to return to the main menu." 16 68
+ continue
+ fi
+ SERIES="`cat $TMP/SeTSERIES`"
+ SOURCE_DEVICE="`cat $TMP/SeTsource`"
+ IGNORE_TAGFILES=""
+ while [ 0 ]; do
+ ${DIALOG} --title "SELECT PROMPTING MODE" --default-item "terse" --menu \
+ "Now you must select the type of prompts you'd like to see during the \
+installation process. If you have the drive space, the 'full' option \
+is quick, easy, and by far the most foolproof choice. The 'newbie' \
+mode provides the most information but is much more time-consuming \
+(presenting the packages one by one) than the menu-based choices. \
+Otherwise, you can pick packages from menus \
+using 'expert' or 'menu' mode. Which type of prompting would you like \
+to use?" \
+ 20 76 7 \
+ "full" "Install everything (9+ GB of software, RECOMMENDED!)" \
+ "terse" "Like 'full', but display one line per package during install" \
+ "menu" "Choose individual packages from interactive menus" \
+ "expert" "This is actually the same as the \"menu\" option" \
+ "newbie" "Use verbose prompting (the X series takes one year)" \
+ "custom" "Use custom tagfiles in the package directories" \
+ "tagpath" "Use tagfiles in the subdirectories of a custom path" \
+ "help" "Read the prompt mode help file" 2> $TMP/SeTpmode
+ if [ ! $? = 0 ]; then
+ rm -f $TMP/SeTpmode
+ exit
+ fi
+ MODE="`cat $TMP/SeTpmode`"
+ rm -f $TMP/SeTtagext
+ if [ "$MODE" = "help" ]; then
+ ${DIALOG} --title "PROMPT MODE HELP" --exit-label OK --textbox "/usr/lib/setup/PROMPThelp" 19 65
+ fi
+ if [ "$MODE" = "tagpath" ]; then
+ ${DIALOG} --title "PROVIDE A CUSTOM PATH TO YOUR TAGFILES" --inputbox \
+ "If you're installing from CD or DVD, it's impossible to edit the \
+tagfiles that are in the package directories. In this case, you might \
+want to provide a path to your custom tagfiles. As an example, you \
+could create a /tagfiles directory and mount a floppy disk containing \
+the tagfiles on that directory. Then you'd enter '/tagfiles' at the \
+prompt below. The setup program will look for your tagfile in \
+SUBDIRECTORIES of the path you provide, such as /tagfiles/a, \
+/tagfiles/ap, /tagfiles/d, and so on. You only need to provide a \
+subdirectory and tagfile for the first disk of each series to be \
+installed. If a custom tagfile is not found at the path you provide, \
+setup will revert to the default tagfiles. Please enter the path to your \
+custom tagfiles:" \
+ 19 71 2> $TMP/SeTtagpath
+ if [ ! $? = 0 ]; then
+ continue
+ fi
+ if [ -r $TMP/SeTtagpath ]; then
+ if [ "`cat $TMP/SeTtagpath`" = "" ]; then
+ rm -f $TMP/SeTtagpath
+ elif [ ! -d "$(cat $TMP/SeTtagpath)" ]; then
+ ${DIALOG} --title "NOT A VALID DIRECTORY" --msgbox \
+"Sorry, but the $(cat $TMP/SeTtagpath) directory could not be located. \
+Press ENTER to go back to the SELECT PROMPTING MODE menu." \
+7 65
+ rm -f $TMP/SeTtagpath
+ continue
+ fi
+ fi
+ break;
+ fi
+ if [ "$MODE" = "newbie" ]; then
+ ${DIALOG} --infobox "'newbie' prompt mode selected. Using default tagfiles \
+and verbose package prompting." 4 50
+ break;
+ fi
+ if [ "$MODE" = "custom" ]; then
+ ${DIALOG} --title "ENTER CUSTOM EXTENSION" --inputbox "Now, enter the custom \
+extension you have used for your tagfiles. This must be a valid MS-DOS format \
+file extension consisting of a period followed by three characters. For \
+example, I use '.pat'. You might see my tagfiles on your disks. :^)" \
+12 60 2> $TMP/SeTtagext
+ if [ ! $? = 0 ]; then
+ continue
+ fi
+ if [ -r $TMP/SeTtagext ]; then
+ if [ "`cat $TMP/SeTtagext`" = "" ]; then
+ rm -f $TMP/SeTtagext
+ fi
+ fi
+ ${DIALOG} --infobox "'custom' prompt mode selected. Using prompting defaults \
+found in custom tagfiles." 4 50
+ break;
+ fi
+ if [ "$MODE" = "full" ]; then
+ IGNORE_TAGFILES="-ignore_tagfiles"
+ ${DIALOG} --infobox "Full installation mode. Installing all software \
+packages without prompting." 4 45
+ break;
+ fi
+ if [ "$MODE" = "terse" ]; then
+ setterm -background cyan -foreground black -blank 0
+ clear
+ IGNORE_TAGFILES="-ignore_tagfiles"
+ echo
+ echo
+ echo "Full (terse display) installation mode."
+ echo
+ echo "A one-line description will be displayed as each package is installed."
+ echo
+ break;
+ fi
+ if [ "$MODE" = "menu" ]; then
+ ${DIALOG} --infobox "'menu' prompt mode selected. Using interactive menus \
+to choose subsystems of related packages." 4 60
+ break;
+ fi
+ if [ "$MODE" = "expert" ]; then
+ ${DIALOG} --infobox "'expert' prompt mode selected. Using interactive menus \
+to choose packages individually." 4 60
+ break;
+ fi
+ done
+ export MAKETAG;
+ sleep 1
+ # On a new system, make /etc/mtab a symlink to /proc/mounts:
+ if [ ! -r $T_PX/etc/mtab ]; then
+ mkdir -p $T_PX/etc
+ ( cd $T_PX/etc ; ln -sf /proc/mounts mtab )
+ fi
+ # Do the package install:
+ if [ -r $TMP/SeTCDdev ]; then # only try to remount media if it's a CD/DVD
+ slackinstall --device `cat $TMP/SeTCDdev` --promptmode $MODE --srcpath `cat $TMP/SeTDS` --mountpoint /var/log/mount --target $T_PX --series $SERIES
+ elif [ -r $TMP/SeTremotesvr ]; then
+ slackinstall --device noremount --promptmode $MODE --srcpath `cat $TMP/SeTDS` --mountpoint /var/log/mount --target $T_PX --series $SERIES --net `cat $TMP/SeTremotesvr`
+ else
+ slackinstall --device noremount --promptmode $MODE --srcpath `cat $TMP/SeTDS` --mountpoint /var/log/mount --target $T_PX --series $SERIES
+ fi
+ # Run ldconfig on the newly installed system:
+ if [ -x $T_PX/sbin/ldconfig ]; then
+ $T_PX/sbin/ldconfig -r $T_PX
+ fi
+ if [ $MODE = terse ]; then
+ # Let's pause a moment and then restore the terminal settings
+ sleep 1
+ setterm -background black -foreground white -blank 0
+ fi
+ MAINSELECT="CONFIGURE"
+ fi
+ # End Slackware installation routine.
diff --git a/syslinux/f2.txt b/syslinux/f2.txt
index 2451b39..1a41e5c 100644
--- a/syslinux/f2.txt
+++ b/syslinux/f2.txt
@@ -8,11 +8,15 @@
kbd=fr xkb=ch,fr => Example of custom X keyboard layout.
livepw="somestring" => Change the password for user "live".
+ The password is passed as a cleartext string.
+ You can pass an empty string (livepw=) to remove the password.
locale=nl_NL kbd=nl tz=Europe/Amsterdam => Example of language,
keyboard and/or timezone customization.
rootpw="somestring" => Change the password for user "root".
+ The password is passed as a cleartext string.
+ You can pass an empty string (rootpw=) to remove the password.
=== Custom software ===
diff --git a/syslinux/f3.txt b/syslinux/f3.txt
index a5400f5..833956b 100644
--- a/syslinux/f3.txt
+++ b/syslinux/f3.txt
@@ -9,6 +9,9 @@ cfg=[skip|write] =>
OS parameters; or specify 'write' to write current OS parameters
to disk.
+domain=your_custom_domain =>
+ Specify a custom domain name. Defaults to 'example.net'.
+
hostname=your_custom_hostname[,qualifier] =>
Specify a custom hostname. A qualifier 'fixed' can be appended
to prohibit hostname modification in case of network boot.
@@ -18,20 +21,40 @@ livemedia=/dev/sdX => Tell the init script which partition
become necessary if you have another copy of Slackware Live
installed in another partition. Also accepted: UUID or LABEL.
-livemedia=/dev/sdX:/path/to/live.iso => Use this if you want to
+livemedia=/dev/sdX:/path/to/live.iso
+livemedia=scandev:/path/to/live.iso => Use this if you want to
load the live OS from an ISO file on a local harddisk partition.
livemain=directoryname => Use this if you copied the content
of the ISO to a different directory than "liveslak".
-nop => No persistence, i.e. boot the virgin installation in
- case your "persistence" directory got corrupted.
-
-persistence=directoryname => Use this if you want to use
- a different directory than "persistence" for storing
- persistent data.
+nop => No persistence, i.e. boot the virgin installation in
+ case your "persistence" directory got corrupted.
+ If you want to ignore any persistent data during boot,
+ including LUKS data, specify "nop luksvol=" .
+
+nop=wipe => Wipe all data from persistence directory or container.
+ Useful in cases where your persistent data got corrupted.
+
+persistence=name => Use this if you are using a different
+ directory/file than "persistence" for storing persistent data.
+
+persistence=/dev/sdX:/path/to/mypersistence
+persistence=scandev:/path/to/mypersistence => Use this if
+ the persistence directory or container is not located on the USB stick,
+ but on a local hard disk partition. Useful for network (PXE) boot
+ where you still want to offer users persistence.
toram => copy the OS from the media to to RAM before running it.
You can remove the boot media after booting.
+toram=all => Prevent writes to disk since we are supposed to
+ run from RAM; equivalent to parameter "toram".
+
+toram=core => Load Console OS modules into RAM. Console-only Slackware
+ loads fast, contains 'setup2hd' and frees up your USB drive so you can
+ overwrite it with a Persistent Live OS.
+
+toram=os => Load OS modules into RAM, but write persistent data to USB.
+
== [F1]: Home [F2]: Desktop setup [F4]: HW/debug [F5]: Network boot ==
diff --git a/syslinux/f4.txt b/syslinux/f4.txt
index c890348..80ca985 100644
--- a/syslinux/f4.txt
+++ b/syslinux/f4.txt
@@ -6,8 +6,10 @@ localhd => initialize RAID/LVM on local hard drives.
tweaks=tweak1[,tweak2,[,...]] => Implemented tweaks:
nga - no glamor 2D acceleration, avoids error "EGL_MESA_drm_image required".
+ nsh - no sub-pixel hinting in freetype.
tpb - enable TrackPoint scrolling while holding down middle mouse button.
syn - start the syndaemon for better support of Synaptics touchpads.
+ ssh - start SSH daemon (disabled by default).
nomodeset => Boot without kernel mode setting, needed with
some machines.
diff --git a/upslak.sh b/upslak.sh
index 4af5ae5..aa1c9ff 100644
--- a/upslak.sh
+++ b/upslak.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright 2017, 2019 Eric Hameleers, Eindhoven, NL
+# Copyright 2017, 2019, 2021, 2022, 2023 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -62,15 +62,28 @@ UPKERNEL=0
# Do not change usb wait time by default:
WAIT=-1
+# Not extending any container by default:
+EXTENSION=""
+
# ---------------------------------------------------------------------------
# END possible tasks to be executed by the script:
# ---------------------------------------------------------------------------
+# The extension for containerfiles accompanying an ISO is '.icc',
+# whereas the persistent USB stick created with iso2usb.sh uses '.img'.
+DEFEXT=".img"
+CNTEXT="${DEFEXT}"
+
+# Default filesystem for devices/containers:
+DEF_FS="ext4"
+FSYS="${DEF_FS}"
+
# Determine whether the USB stick has a supported kernel configuration
# i.e. one active and optionally one backup kernel plus mmodules:
SUPPORTED=1
# Values obtained from the init script on the USB:
+CORE2RAMMODS=""
DEF_KBD=""
DEF_LOCALE=""
DEF_TZ=""
@@ -88,9 +101,15 @@ VERSION=""
KBACKUP=1
# Does the initrd contain an old kernel that we can restore?
-# The 'read_initrd' routing may set this to '0':
+# The 'read_initrddir' routine may set this to '0':
KRESTORE=1
+# By default we create an addon live module for the new kernel modules,
+# otherwise the Live OS will be broken after reboot.
+# User can skip this if they already installed the kernel-modules package
+# in the Live OS earlier:
+NOLIVEMODS=0
+
# Timeout when scanning for inserted USB device, 30 seconds by default,
# but this default can be changed from outside the script:
SCANWAIT=${SCANWAIT:-30}
@@ -108,8 +127,6 @@ MINFREE=${MINFREE:-10}
# Variables to store content from an initrd we are going to refresh:
OLDKERNELSIZE=""
-OLDKMODDIRSIZE=""
-OLDKVER=""
OLDWAIT=""
# Record the version of the new kernel:
@@ -120,18 +137,31 @@ IMGDIR=""
KERDIR=""
USBMNT=""
EFIMNT=""
+CNTDEV=""
+LODEV=""
+
+# Empty initialization:
+INCSIZE=""
+PARTFREE=""
+PARTSIZE=""
# These tools are required by the script, we will check for their existence:
REQTOOLS="cpio gdisk inotifywait lsblk strings xz"
+# Minimim free space (in MB) we want to have left in any partition
+# after we are done.
+# The default value can be changed from the environment:
+MINFREE=${MINFREE:-10}
+
# Compressor used on the initrd ("gzip" or "xz --check=crc32");
# Note that the kernel's XZ decompressor does not understand CRC64:
COMPR="xz --check=crc32"
# -- START: Taken verbatim from make_slackware_live.sh -- #
# List of kernel modules required for a live medium to boot properly;
-# Lots of HID modules added to support keyboard input for LUKS password entry:
-KMODS=${KMODS:-"squashfs:overlay:loop:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:mmc-core:mmc-block:sdhci:sdhci-pci:sdhci-acpi:usb-storage:hid:usbhid:i2c-hid:hid-generic:hid-apple:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd:mbcache:ext3:ext4:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat:ntfs"}
+# Lots of HID modules added to support keyboard input for LUKS password entry;
+# Virtio modules added to experiment with liveslak in a VM.
+KMODS=${KMODS:-"squashfs:overlay:loop:efivarfs:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:mmc-core:mmc-block:sdhci:sdhci-pci:sdhci-acpi:rtsx_pci:rtsx_pci_sdmmc:usb-storage:uas:hid:usbhid:i2c-hid:hid-generic:hid-apple:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd:mbcache:ext3:ext4:zstd_compress:lz4hc_compress:lz4_compress:btrfs:f2fs:jfs:xfs:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat:exfat:ntfs:virtio_ring:virtio:virtio_blk:virtio_balloon:virtio_pci:virtio_pci_modern_dev:virtio_net"}
# Network kernel modules to include for NFS root support:
NETMODS="kernel/drivers/net kernel/drivers/virtio"
@@ -145,22 +175,32 @@ NETEXCL="appletalk arcnet bonding can dummy.ko hamradio hippi ifb.ko irda macvla
#
# Clean up in case of failure:
-cleanup() {
+function cleanup() {
# Clean up by unmounting our loopmounts, deleting tempfiles:
echo "--- Cleaning up the staging area..."
# During cleanup, do not abort due to non-zero exit code:
set +e
sync
+
+ if [ -n "$CNTDEV" ]; then
+ # In case of failure, only most recent LUKS mapped device is still open:
+ if mount | grep -q ${CNTDEV} ; then
+ umount -f ${CNTDEV}
+ cryptsetup luksClose $(basename ${CNTDEV})
+ losetup -d ${LODEV}
+ fi
+ fi
+
# No longer needed:
[ -n "${IMGDIR}" ] && ( rm -rf $IMGDIR )
[ -n "${KERDIR}" ] && ( rm -rf $KERDIR )
if [ -n "${USBMNT}" ]; then
if mount |grep -qw ${USBMNT} ; then umount ${USBMNT} ; fi
- rm -rf $USBMNT
+ rmdir $USBMNT
fi
if [ -n "${EFIMNT}" ]; then
if mount |grep -qw ${EFIMNT} ; then umount ${EFIMNT} ; fi
- rm -rf $EFIMNT
+ rmdir $EFIMNT
fi
set -e
} # End of cleanup()
@@ -168,7 +208,7 @@ cleanup() {
trap 'echo "*** $0 FAILED at line $LINENO ***"; cleanup; exit 1' ERR INT TERM
# Show the help text for this script:
-showhelp() {
+function showhelp() {
cat <<EOT
#
# Purpose: to update the content of a Slackware Live USB stick.
@@ -176,6 +216,7 @@ cat <<EOT
# $(basename $0) accepts the following parameters:
# -b|--nobackup Do not try to backup original kernel and modules.
# -d|--devices List removable devices on this computer.
+# -e|--examples Show some common usage examples.
# -h|--help This help.
# -i|--init <filename> Replacement init script.
# -k|--kernel <filename> The kernel file (or package).
@@ -188,21 +229,71 @@ cat <<EOT
# providing a devicename (using option '-o').
# -v|--verbose Show verbose messages.
# -w|--wait<number> Add <number> seconds wait time to initialize USB.
+# -x|--extend <fullpath> Full path (either in your filesystem or else
+# relative to the USB partition root)
+# to an existing (encrypted) container file,
+# whose size you want to extend.
+# Limitations:
+# - container needs to be LUKS encrypted.
+# - filename extension needs to be '${CNTEXT}'.
+# Supported filesystems inside container:
+# - $(resizefs).
+# -N|--nolivemods Don't create an addon live module containing
+# the new kernelmodules. Normally you *will* need
+# this addon module, *unless* you have already
+# installed these kernel-modules in the Live OS.
+# FYI: the kernel and module upgrade applies only
+# to the USB boot kernel and its initrd.
+# -X|--extendsize <size|perc> Extend size of existing container; value
+# is the requested extension of the container
+# in kB, MB, GB, or as percentage of free space
+# (integer numbers only).
+# Examples: '-X 125M', '-X 2G', '-X 20%'.
#
EOT
} # End of showhelp()
+function showexamples() {
+cat <<EOT
+#
+# Some common usage examples for $(basename $0)
+# ---------------------------------------------------------------------------
+#
+# Get a listing of all available removable devices on the computer:
+# ./$(basename $0) -d
+#
+# Updating kernel and modules, providing two packages as input and assuming
+# that the USB stick is known as /dev/sdX:
+# ./$(basename $0) -o /dev/sdX -m kernel-modules-4.19.0-x86_64-1.txz -k kernel-generic-4.19.0-x86_64-1.txz
+#
+# Restore the previous kernel and modules after a failed update,
+# and let the script scan your computer for the insertion of your USB stick:
+# ./$(basename $0) -s -r
+#
+# Replace the Live init script with the latest template taken from
+# the liveslak git repository:
+# wget https://git.liveslak.org/liveslak/plain/liveinit.tpl
+# ./$(basename $0) -o /dev/sdX -i liveinit.tpl
+#
+# Extend the size of the pre-existing LUKS container for your homedirectory
+# with 3 GB, and let the script scan for the insertion of your USB stick:
+# ./$(basename $0) -s -x /slhome.img -X 3G
+#
+EOT
+} # End of showexamples()
+
# Scan for insertion of a USB device:
-scan_devices() {
+function scan_devices() {
+ local MYSCANWAIT="${1}"
local BD
# Inotifywatch does not trigger on symlink creation,
# so we can not watch /sys/block/
- BD=$(inotifywait -q -t ${SCANWAIT} -e create /dev 2>/dev/null |cut -d' ' -f3)
+ BD=$(inotifywait -q -t ${MYSCANWAIT} -e create /dev 2>/dev/null |cut -d' ' -f3)
echo ${BD}
} # End of scan_devices()
# Show a list of removable devices detected on this computer:
-show_devices() {
+function show_devices() {
local MYDATA="${*}"
if [ -z "${MYDATA}" ]; then
MYDATA="$(ls --indicator-style=none /sys/block/ |grep -Ev '(ram|loop|dm-)')"
@@ -216,8 +307,110 @@ show_devices() {
echo "#"
} # End of show_devices()
+# Determine size of a mounted partition (in MB):
+function get_part_mb_size() {
+ local MYPART="${1}"
+ local MYSIZE
+ MYSIZE=$(df -P -BM ${MYPART} |tail -n -1 |tr -s '\t' ' ' |cut -d' ' -f2)
+ echo "${MYSIZE%M}"
+} # End of get_part_mb_size()
+
+# Determine free space of a mounted partition (in MB):
+function get_part_mb_free() {
+ local MYPART="${1}"
+ local MYSIZE
+ MYSIZE=$(df -P -BM ${MYPART} |tail -n -1 |tr -s '\t' ' ' |cut -d' ' -f4)
+ echo "${MYSIZE%M}"
+} # End of get_part_mb_free()
+
+# Determine requested container size in MB (allow for '%|k|K|m|M|g|G' suffix).
+# Note: sizes need to be integer values! Bash arithmetics don't work for floats.
+function cont_mb() {
+ # Uses global variables: PARTFREE
+ local MYSIZE="$1"
+ case "${MYSIZE: -1}" in
+ "%") MYSIZE="$(( $PARTFREE * ${MYSIZE%\%} / 100 ))" ;;
+ "k") MYSIZE="$(( ${MYSIZE%k} / 1024 ))" ;;
+ "K") MYSIZE="$(( ${MYSIZE%K} / 1024 ))" ;;
+ "m") MYSIZE="${MYSIZE%m}" ;;
+ "M") MYSIZE="${MYSIZE%M}" ;;
+ "g") MYSIZE="$(( ${MYSIZE%g} * 1024 ))" ;;
+ "G") MYSIZE="$(( ${MYSIZE%G} * 1024 ))" ;;
+ *) MYSIZE=-1 ;;
+ esac
+ echo "$MYSIZE"
+} # End of cont_mb()
+
+# Expand existing encrypted container file:
+function expand_container() {
+ # Uses external function: cleanup
+ # Uses global variables: CNTEXT, MINFREE
+ # Sets global variables: CNTDEV, LODEV, PARTFREE, PARTSIZE
+ local MYPART="$1" # disk partition
+ local MYINC="$2" # requested increase ('%|k|K|m|M|g|G' suffix)
+ local MYFILE="$3" # full path to ${CNTEXT} containerfile
+ local MYMAP="" # Name of the device-mapped file
+ local CNTIS="" # Stores size of the container
+
+ # Determine requested container increase in MB:
+ MYINC=$(cont_mb ${MYINC})
+
+ # Determine size of the target partition (in MB), and the free space:
+ PARTSIZE=$(get_part_mb_size ${MYPART})
+ PARTFREE=$(get_part_mb_free ${MYPART})
+
+ if [ $PARTFREE -lt $(( ${MYINC} + ${MINFREE} )) ]; then
+ echo "*** Free space on USB partition after file-resizing would be less than ${MINFREE} MB;"
+ echo "*** Not resizing the container file!"
+ cleanup
+ exit 1
+ fi
+
+ if ! file ${MYFILE} |grep -q 'LUKS' ; then
+ echo "*** No LUKS container: '${MYFILE}'"
+ cleanup
+ exit 1
+ else
+ echo "--- Expanding '$(basename ${MYFILE})' on '${MYPART}' with ${MYINC} MB..."
+ fi
+
+ # Append random bytes to the end of the container file:
+ dd if=/dev/urandom of=${MYFILE} bs=1M count=${MYINC} oflag=append conv=notrunc 2>/dev/null
+
+ # Setup a loopback device that we can use with or without cryptsetup:
+ LODEV=$(losetup -f)
+ losetup ${LODEV} ${MYFILE}
+
+ if cryptsetup isLuks ${LODEV} ; then
+ # Unlock LUKS encrypted container first:
+ MYMAP=$(basename ${MYFILE} ${CNTEXT})
+ CNTDEV=/dev/mapper/${MYMAP}
+ echo "--- Unlocking the LUKS container requires your passphrase..."
+ until cryptsetup luksOpen ${LODEV} ${MYMAP} ; do
+ echo ">>> Did you type an incorrect passphrases?"
+ read -p ">>> Press [ENTER] to try again or Ctrl-C to abort ..." REPLY
+ done
+ else
+ # Use the loopmounted block device for the un-encrypted container:
+ CNTDEV=${LODEV}
+ fi
+
+ # Run fsck so the filesystem is clean before we resize it:
+ fsck -fvy ${CNTDEV}
+ # Resize the filesystem to occupy the full new size:
+ resizefs ${CNTDEV}
+ # Just to be safe:
+ fsck -fvy ${CNTDEV}
+
+ # Don't forget to clean up after ourselves:
+ if cryptsetup isLuks ${LODEV} ; then
+ cryptsetup luksClose ${MYMAP}
+ fi
+ losetup -d ${LODEV} || true
+} # End of expand_container()
+
# Uncompress the initrd based on the compression algorithm used:
-uncompressfs () {
+function uncompressfs () {
if $(file "${1}" | grep -qi ": gzip"); then
gzip -cd "${1}"
elif $(file "${1}" | grep -qi ": XZ"); then
@@ -225,10 +418,76 @@ uncompressfs () {
fi
} # End of uncompressfs ()
+# Resize the filesystem on a block device:
+function resizefs() {
+ # Uses external function: cleanup
+ local MYDEV="${1}"
+ local MYFS
+ local TMPMNT
+
+ if [ -z "${MYDEV}" ]; then
+ # Without arguments given, reply with list of supported fs'es:
+ echo "btrfs,ext2,ext4,f2fs,jfs,xfs"
+ return
+ fi
+
+ # Determine the current filesystem for the block device:
+ MYFS=$(lsblk -n -o FSTYPE ${MYDEV})
+ if [ -z "${MYFS}" ]; then
+ echo "*** Failed to resize filesystem on device '${MYDEV}'!"
+ echo "*** No filesystem found."
+ cleanup
+ exit 1
+ fi
+
+ TMPMNT=$(mktemp -d -p ${TMP:=/tmp} -t alienres.XXXXXX)
+ if [ ! -d $TMPMNT ]; then
+ echo "*** Failed to create temporary mount for the filesystem resize!"
+ cleanup
+ exit 1
+ else
+ chmod 711 ${TMPMNT}
+ fi
+
+ # Mount the block device prior to the resize
+ # (btrfs, jfs and xfs do not support offline resize):
+ mount -o rw -t ${MYFS} ${MYDEV} ${TMPMNT}
+
+ # Resize the filesystem to occupy the full new device capacity:
+ case "${MYFS}" in
+ btrfs) btrfs filesystem resize max ${TMPMNT}
+ ;;
+ ext*) resize2fs ${MYDEV}
+ ;;
+ f2fs) resize.f2fs ${MYDEV}
+ ;;
+ jfs) mount -o remount,resize,rw ${TMPMNT}
+ ;;
+ xfs) xfs_growfs -d ${TMPMNT}
+ ;;
+ *) echo "*** Unsupported filesystem '${MYFS}'!"
+ cleanup
+ exit 1
+ ;;
+ esac
+
+ if [ ! $? ]; then
+ echo "*** Failed to resize '${MYFS}'filesystem on device '${MYDEV}'!"
+ cleanup
+ exit 1
+ else
+ # Un-mount the device again:
+ sync
+ umount ${TMPMNT}
+ rmdir ${TMPMNT}
+ fi
+} # End of resizefs()
+
+
# Collect the kernel modules we need for the liveslak initrd.
# When calling this function, the old module tree must already
# have been renamed to ${OLDKVER}.prev
-collect_kmods() {
+function collect_kmods() {
local IMGDIR="$1"
# Borrow (and mangle) code from Slackware's mkinitrd
@@ -359,11 +618,17 @@ collect_kmods() {
else
chroot ${IMGDIR} depmod $KVER 2>/dev/null
fi
-}
+} # End of collect_kmods ()
-# Read configuration data from old initrd:
-read_initrd() {
+# Read configuration data from old initrd,
+# after it has been extracted into a directory:
+function read_initrddir() {
local IMGDIR="$1"
+ local INITVARS="$2"
+ local OLDKVER
+ local OLDMODDIR
+ local OLDKMODDIRSIZE
+ local PREVMODDIR
cd ${IMGDIR}
@@ -371,7 +636,7 @@ read_initrd() {
OLDWAIT=$(cat ./wait-for-root)
# Read the values of liveslak template variables in the init script:
- for TEMPLATEVAR in DEF_KBD DEF_LOCALE DEF_TZ DISTRO LIVE_HOSTNAME LIVEMAIN LIVEUID MARKER MEDIALABEL PERSISTENCE SQ_EXT_AVAIL VERSION ; do
+ for TEMPLATEVAR in ${INITVARS} ; do
eval $(grep "^ *${TEMPLATEVAR}=" ./init |head -1)
done
@@ -403,23 +668,36 @@ read_initrd() {
fi
fi
fi
-} # End read_initrd()
-
-# Extract the initrd:
-extract_initrd() {
- local IMGFILE="$1"
+} # End read_initrddir()
+
+# Extract the initrd into a new directory and report the dirname back:
+function extract_initrd() {
+ local MYIMGFILE="$1"
+ local MYIMGDIR=$(mktemp -d -p ${TMP:=/tmp} -t alienimg.XXXXXX)
+ if [ ! -d $MYIMGDIR ]; then
+ echo "*** Failed to create temporary extraction directory for the initrd!"
+ cleanup
+ exit 1
+ else
+ chmod 711 $MYIMGDIR
+ fi
- cd ${IMGDIR}
- uncompressfs ${IMGFILE} \
- | cpio -i -d -m -H newc
+ cd ${MYIMGDIR}
+ uncompressfs ${MYIMGFILE} 2>/dev/null \
+ | cpio -i -d -m -H newc 2>/dev/null
+ echo "$MYIMGDIR"
} # End of extract_initrd()
# Modify the extracted initrd and re-pack it:
-update_initrd() {
- local IMGFILE="$1"
+function update_initrd() {
+ local MYIMGFILE="$1"
+ local MYIMGDIR="$2"
local NEED_RECOMP=0
+ local NEWMODDIR
+ local OLDMODDIR
+ local OLDKVER
- cd ${IMGDIR}
+ cd ${MYIMGDIR}
if [ ${WAIT} -ge 0 ]; then
if [ $WAIT != $OLDWAIT ]; then
echo "--- Updating 'waitforroot' time from '$OLDWAIT' to '$WAIT'"
@@ -430,24 +708,23 @@ update_initrd() {
if [ $UPKERNEL -eq 1 ]; then
OLDMODDIR=$(find ./lib/modules -type d -mindepth 1 -maxdepth 1 |grep -v .prev)
+ OLDKVER=$(strings $(find ${OLDMODDIR}/kernel/ -name "*.ko*" |head -1) |grep ^vermagic |cut -d= -f2 |cut -d' ' -f1)
rm -rf ./lib/modules/*.prev
if [ $KBACKUP -eq 1 ]; then
# We make one backup:
- if [ $VERBOSE -eq 1 ]; then
- echo "--- Making backup of kernel modules"
- fi
+ echo "--- Making backup of kernel modules (${OLDKVER}) in initrd"
mv -i ${OLDMODDIR} ${OLDMODDIR}.prev
else
- echo "--- No room for backing up old kernel modules"
+ echo "--- No room for backing up old kernel modules in initrd"
rm -rf ${OLDMODDIR}
fi
# Add modules for the new kernel:
- echo "--- Adding new kernel modules"
- collect_kmods ${IMGDIR}
+ echo "--- Adding new kernel modules (${KVER}) to initrd"
+ collect_kmods ${MYIMGDIR}
NEED_RECOMP=1
elif [ $RESTORE -eq 1 -a $KRESTORE -eq 1 ]; then
# Restore previous kernel module tree.
- # The 'read_initrd' routine will already have checked that we have
+ # The 'read_initrddir' routine will already have checked that we have
# one active and one .prev modules tree:
OLDMODDIR=$(find ./lib/modules -type d -mindepth 1 -maxdepth 1 |grep .prev || true)
NEWMODDIR=$(find ./lib/modules -type d -mindepth 1 -maxdepth 1 |grep -v .prev)
@@ -458,6 +735,11 @@ update_initrd() {
fi
if [ -n "${LIVEINIT}" ]; then
+ if ! file "${LIVEINIT}" |grep -q 'shell script' ; then
+ echo "*** Not a shell script: "${LIVEINIT}"!"
+ cleanup
+ exit 1
+ fi
echo "--- Replacing live init script"
cp ./init ./init.prev
if grep -q "@LIVEMAIN@" ${LIVEINIT} ; then
@@ -472,19 +754,21 @@ update_initrd() {
if [ ${NEED_RECOMP} -eq 1 ]; then
echo "--- Compressing the initrd image again"
- chmod 0755 ${IMGDIR}
- find . |cpio -o -H newc |$COMPR > ${IMGFILE}
+ chmod 0755 ${MYIMGDIR}
+ find . |cpio -o -H newc |$COMPR > ${MYIMGFILE}
fi
- cd - 1>/dev/null # End of 'cd ${IMGDIR}'
+ cd - 1>/dev/null # End of 'cd ${MYIMGDIR}'
} # End of update_initrd()
# Accept either a kernelimage or a packagename,
# and return the path to a kernelimage:
-getpath_kernelimg () {
+function getpath_kernelimg () {
local MYDATA="${*}"
- [ -z "${MYDATA}" ] && echo ""
- if [ -n "$(file "${MYDATA}" |grep -E 'x86 boot (executable|sector)')" ]; then
+ if [ -z "${MYDATA}" ]; then
+ echo ""
+ return
+ elif [ -n "$(file "${MYDATA}" |grep -E 'x86 boot (executable|sector)')" ]; then
# We have a kernel image:
echo "${MYDATA}"
else
@@ -497,38 +781,48 @@ getpath_kernelimg () {
# Accept either a directory containing module tree, or a packagename,
# and return the path to a module tree:
-getpath_kernelmods () {
+function getpath_kernelmods () {
local MYDATA="${*}"
- [ -z "${MYDATA}" ] && echo ""
+ local MYKVER
- if [ -d "${MYDATA}" ]; then
+ if [ -z "${MYDATA}" ]; then
+ echo ""
+ return
+ elif [ -d "${MYDATA}" ]; then
# We have directory, assume it contains the kernel modules:
- echo "${MYDATA}"
+ MYKVER=$(strings $(find ${MYDATA}/kernel/ -name "*.ko*" |head -1) |grep ^vermagic |cut -d= -f2 |cut -d' ' -f1)
+ if [ -z "${MYKVER}" ]; then
+ echo "*** Could not determine new kernel version from module directory!"
+ cleanup
+ exit 1
+ fi
+ mkdir -p ${KERDIR}/lib/modules/${MYKVER}
+ rsync -a ${MYDATA}/ ${KERDIR}/lib/modules/${MYKVER}/
else
# We assume a Slackware package:
# Extract the kernel modules from the package and return the path:
tar -C ${KERDIR} -xf ${MYDATA} lib/modules
- cd ${KERDIR}/lib/modules/*
- pwd
fi
+ cd ${KERDIR}/lib/modules/*
+ pwd
} # End of getpath_kernelmods
# Determine size of a mounted partition (in MB):
-get_part_mb_size() {
+function get_part_mb_size() {
local MYSIZE
MYSIZE=$(df -P -BM ${1} |tail -1 |tr -s '\t' ' ' |cut -d' ' -f2)
echo "${MYSIZE%M}"
} # End of get_part_mb_size
# Determine free space of a mounted partition (in MB):
-get_part_mb_free() {
+function get_part_mb_free() {
local MYSIZE
MYSIZE=$(df -P -BM ${1} |tail -1 |tr -s '\t' ' ' |cut -d' ' -f4)
echo "${MYSIZE%M}"
} # End of get_part_mb_free
-parse_template() {
- # Parse a liveslak template file and substitute the placeholders.
+# Parse a liveslak template file and substitute the placeholders.
+function parse_template() {
local INFILE="$1"
local OUTFILE="$2"
@@ -544,10 +838,13 @@ parse_template() {
-e "s/@PERSISTENCE@/${PERSISTENCE:-persistence}/g" \
-e "s/@DARKSTAR@/${LIVE_HOSTNAME:-darkstar}/g" \
-e "s/@LIVEUID@/${LIVEUID:-live}/g" \
+ -e "s/@LIVEUIDNR@/${LIVEUIDNR:-1000}/g" \
-e "s/@DISTRO@/$DISTRO/g" \
-e "s/@CDISTRO@/${DISTRO^}/g" \
-e "s/@UDISTRO@/${DISTRO^^}/g" \
+ -e "s/@CORE2RAMMODS@/${CORE2RAMMODS:-"min noxbase"}/g" \
-e "s/@VERSION@/${VERSION}/g" \
+ -e "s/@KVER@/$KVER/g" \
-e "s/@SQ_EXT_AVAIL@/${SQ_EXT_AVAIL}/g" \
-e "s,@DEF_KBD@,${DEF_KBD},g" \
-e "s,@DEF_LOCALE@,${DEF_LOCALE},g" \
@@ -576,6 +873,10 @@ while [ ! -z "$1" ]; do
show_devices
exit
;;
+ -e|--examples)
+ showexamples
+ exit
+ ;;
-h|--help)
showhelp
exit
@@ -620,6 +921,18 @@ while [ ! -z "$1" ]; do
WAIT="$2"
shift 2
;;
+ -N|--nolivemods)
+ NOLIVEMODS=1
+ shift
+ ;;
+ -x|--extend)
+ EXTENSION="$2"
+ shift 2
+ ;;
+ -X|--extendsize)
+ INCSIZE="$2"
+ shift 2
+ ;;
*)
echo "*** Unknown parameter '$1'!"
exit 1
@@ -640,8 +953,8 @@ fi
# Either provide a block device, or else scan for a block device:
if [ -z "$TARGET" ]; then
if [ $SCAN -eq 1 ]; then
- echo "-- Waiting ${SCANWAIT} seconds for a USB stick to be inserted..."
- TARGET=$(scan_devices)
+ echo "--- Waiting ${SCANWAIT} seconds for a USB stick to be inserted..."
+ TARGET=$(scan_devices ${SCANWAIT})
if [ -z "$TARGET" ]; then
echo "*** No new USB device detected during $SCANWAIT seconds scan."
exit 1
@@ -650,6 +963,7 @@ if [ -z "$TARGET" ]; then
fi
else
echo "*** You must specify the Live USB devicename (option '-o')!"
+ echo "*** Alternatively, let the script scan for insertion (option '-s')!"
exit 1
fi
elif [ $SCAN -eq 1 ]; then
@@ -701,7 +1015,6 @@ else
KVER=$(strings $(find ${KMODDIR}/kernel/ -name "*.ko*" |head -1) |grep ^vermagic |cut -d= -f2 |cut -d' ' -f1)
if [ -z "${KVER}" ]; then
echo "*** Could not determine kernel version from the module directory"
- echo "*** (querying module kernel/fs/overlayfs/overlay.ko)!"
cleanup
exit 1
fi
@@ -715,7 +1028,16 @@ if [ -n "${LIVEINIT}" -a ! -f "${LIVEINIT}" ]; then
exit 1
fi
-if [ $CHANGES2SXZ -eq 1 ]; then
+if [ -n "${EXTENSION}" ]; then
+ if [ -z "${INCSIZE}" ]; then
+ echo "*** LUKS container '${EXTENSION}' defined but no extension size provided!"
+ echo "*** Not extending encrypted ${EXTENSION}, please use '-X' parameter."
+ cleanup
+ exit 1
+ fi
+fi
+
+if [ $CHANGES2SXZ -eq 1 ] || [ $UPKERNEL -eq 1 ]; then
# We need to create a module, so add squashfs to the required tools:
REQTOOLS="${REQTOOLS} mksquashfs"
fi
@@ -728,9 +1050,9 @@ for PROGN in ${REQTOOLS} ; do
fi
done
if [ ! -z "$PROG_MISSING" ] ; then
- echo "-- Required program(s) not found in search path '$PATH'!"
+ echo "--- Required program(s) not found in search path '$PATH'!"
echo -e ${PROG_MISSING}
- echo "-- Exiting."
+ echo "--- Exiting."
cleanup
exit 1
fi
@@ -755,7 +1077,7 @@ echo q |gdisk -l $TARGET 2>/dev/null | \
# If the user just used the scan option (-s) and did not select a task,
# we will exit the script gracefully now:
-if [[ $WAIT -lt 0 && $UPKERNEL -ne 1 && $RESTORE -ne 1 && $NETSUPPORT -ne 1 && $LIVEINIT = "" && $CHANGES2SXZ -ne 1 ]]; then
+if [[ $WAIT -lt 0 && $UPKERNEL -ne 1 && $RESTORE -ne 1 && $NETSUPPORT -ne 1 && $LIVEINIT = "" && $CHANGES2SXZ -ne 1 && $EXTENSION = "" ]]; then
cleanup
exit 0
else
@@ -775,15 +1097,19 @@ TARGETP1=$(fdisk -l $TARGET |grep ^$TARGET |cut -d' ' -f1 |grep -E '[^0-9]1$')
TARGETP2=$(fdisk -l $TARGET |grep ^$TARGET |cut -d' ' -f1 |grep -E '[^0-9]2$')
TARGETP3=$(fdisk -l $TARGET |grep ^$TARGET |cut -d' ' -f1 |grep -E '[^0-9]3$')
-# Create a temporary extraction directory for the initrd:
-mkdir -p /mnt
-IMGDIR=$(mktemp -d -p /mnt -t alienimg.XXXXXX)
-if [ ! -d $IMGDIR ]; then
- echo "*** Failed to create temporary extraction directory for the initrd!"
- cleanup
- exit 1
+# Normalize filepath:
+if [ -f "${EXTENSION}" ]; then
+ # Container is an actual file, so where are we mounted?
+ EXTPART=$(cd "$(dirname "${EXTENSION}")" ; df --output=source . |tail -1)
+ EXTMNT=$(cd "$(dirname "${EXTENSION}")" ; df --output=target . |tail -1)
+ if [ "${EXTPART}" == "${TARGETP3}" ]; then
+ # User already mounted the USB linux partition; remove mountpoint:
+ EXTENSION="${EXTENSION#$EXTMNT}"
+ fi
+elif [ "$(dirname ${EXTENSION})" == "." ]; then
+ # Containerfile was provided without leading slash, add one:
+ EXTENSION="/${EXTENSION}"
fi
-chmod 711 $IMGDIR
# Create temporary mount point for the USB device:
mkdir -p /mnt
@@ -821,13 +1147,27 @@ EFIPFREE=$(get_part_mb_free ${EFIMNT})
# Record the Slackware Live version:
OLDVERSION="$(cat ${USBMNT}/.isoversion 2>/dev/null)"
-echo "-- The medium '${TARGET}' contains '${OLDVERSION}'"
+echo "--- The medium '${TARGET}' contains '${OLDVERSION}'"
+
+# Try a write to the partition:
+if touch ${USBMNT}/.rwtest 2>/dev/null && rm ${USBMNT}/.rwtest 2>/dev/null
+then
+ echo "--- The partition '${TARGETP3}' is writable."
+else
+ echo "--- Trying to remount readonly partition '${TARGETP3}' as writable..."
+ mount -o remount,rw ${USBMNT}
+ if [ $? -ne 0 ]; then
+ echo "*** Failed to remount '${TARGETP3}' writable, unable to continue!"
+ cleanup
+ exit 1
+ fi
+fi
# Find out if the USB contains an EFI bootloader and use it:
if [ ! -f ${EFIMNT}/EFI/BOOT/boot*.efi ]; then
EFIBOOT=0
- echo "-- Note: UEFI boot file 'bootx64.efi' or 'bootia32.efi' not found on ISO."
- echo "-- UEFI boot will not be supported"
+ echo "--- Note: UEFI boot file 'bootx64.efi' or 'bootia32.efi' not found on ISO."
+ echo "--- UEFI boot will not be supported"
else
EFIBOOT=1
fi
@@ -842,10 +1182,10 @@ fi
OLDKERNELSIZE=$(du -sm "${KIMG}" |tr '\t' ' ' |cut -d' ' -f1)
# Collect data from the USB initrd:
-extract_initrd ${USBMNT}/boot/initrd.img
-read_initrd ${IMGDIR}
+IMGDIR="$( extract_initrd ${USBMNT}/boot/initrd.img )"
+read_initrddir ${IMGDIR} "DEF_KBD DEF_LOCALE DEF_TZ DISTRO LIVE_HOSTNAME LIVEMAIN LIVEUID MARKER MEDIALABEL PERSISTENCE CORE2RAMMODS SQ_EXT_AVAIL VERSION"
-# The read_initrd routine will set SUPPORTED to '0'
+# The read_initrddir routine will set SUPPORTED to '0'
# if it finds a non-standard configuration for kernel & modules:
if [ $KBACKUP -eq 1 ]; then
if [ $SUPPORTED -ne 1 ]; then
@@ -872,14 +1212,27 @@ if [ $KBACKUP -eq 1 ]; then
fi
# Update the initrd with regard to USB wait time, liveinit, kernel:
-update_initrd ${USBMNT}/boot/initrd.img
+update_initrd ${USBMNT}/boot/initrd.img ${IMGDIR}
+
+# Add the new modules as a squashfs module:
+if [ $UPKERNEL -eq 1 ] && [ $NOLIVEMODS -eq 0 ]; then
+ LIVE_MOD_SYS=$(dirname $(find ${USBMNT} -name "0099-${DISTRO}_zzzconf*.sxz" |head -1))
+ LIVE_MOD_ADD=$(dirname ${LIVE_MOD_SYS})/addons
+ MODNAME="0100-${DISTRO}_kernelmodules_${KVER}.sxz"
+ echo "--- Creating kernelmodules addon live module '${MODNAME}'"
+ rm -f ${LIVE_MOD_ADD}/${MODNAME}
+ mksquashfs ${KERDIR} ${LIVE_MOD_ADD}/${MODNAME} -e boot -noappend -comp xz -b 1M
+ unset LIVE_MOD_SYS LIVE_MOD_ADD MODNAME
+fi
# Take care of the kernel in the Linux partition:
if [ $UPKERNEL -eq 1 ]; then
if [ $KBACKUP -eq 1 ]; then
# We always make one backup with the suffix ".prev":
if [ $VERBOSE -eq 1 ]; then
- echo "-- Backing up ${KIMG} to ${USBMNT}/boot/$(basename \"${KIMG}\").prev"
+ echo "--- Backing up ${KIMG} to ${USBMNT}/boot/$(basename \"${KIMG}\").prev"
+ else
+ echo "--- Backing up old kernel"
fi
mv "${KIMG}" ${USBMNT}/boot/$(basename "${KIMG}").prev
else
@@ -887,15 +1240,21 @@ if [ $UPKERNEL -eq 1 ]; then
fi
# And we name our new kernel exactly as the old one:
if [ $VERBOSE -eq 1 ]; then
- echo "-- Copying \"${KERNEL}\" to ${USBMNT}/boot/$(basename \"${KIMG}\")"
+ echo "--- Copying \"${KERNEL}\" to ${USBMNT}/boot/$(basename \"${KIMG}\")"
+ else
+ echo "--- Adding new kernel"
fi
cp "${KERNEL}" ${USBMNT}/boot/$(basename "${KIMG}")
elif [ $RESTORE -eq 1 -a $KRESTORE -eq 1 ]; then
if [ $VERBOSE -eq 1 ]; then
- echo "-- Restoring ${USBMNT}/boot/$(basename \"${KIMG}\").prev to ${KIMG}"
+ echo "--- Restoring ${USBMNT}/boot/$(basename \"${KIMG}\").prev to ${KIMG}"
+ else
+ echo "--- Restoring old kernel"
fi
+ OLDKVER=$(file "${KIMG}" |sed 's/^.*\(version [^ ]* \).*$/\1/' |cut -d' ' -f2)
rm -f "${KIMG}"
mv ${USBMNT}/boot/$(basename "${KIMG}").prev "${KIMG}"
+ echo "--- You may remove obsolete 'addons/0100-${DISTRO}_kernelmodules_${OLDKVER}.sxz' module"
fi
if [ $EFIBOOT -eq 1 ]; then
@@ -925,12 +1284,24 @@ if [ $CHANGES2SXZ -eq 1 ]; then
LIVE_MOD_SYS=$(dirname $(find ${USBMNT} -name "0099-${DISTRO}_zzzconf*.sxz" |head -1))
LIVE_MOD_ADD=$(dirname ${LIVE_MOD_SYS})/addons
MODNAME="0100-${DISTRO}_customchanges-$(date +%Y%m%d%H%M%S).sxz"
- echo "-- Moving current persistence data into addons module '${MODNAME}'"
+ echo "--- Moving current persistence data into addons module '${MODNAME}'"
mksquashfs /mnt/live/changes ${LIVE_MOD_ADD}/${MODNAME} -noappend -comp xz -b 1M -e .wipe
fi
fi
fi
+# Should we extend the size of a container?
+if [ -n "${EXTENSION}" ]; then
+ if [ "$(basename ${EXTENSION} ${CNTEXT})" == "$(basename ${EXTENSION})" ];
+ then
+ echo "*** File '${EXTENSION}' does not have an '${CNTEXT}' extension!"
+ cleanup
+ exit 1
+ fi
+ # Expand existing container file:
+ expand_container ${TARGETP3} ${INCSIZE} ${USBMNT}/${EXTENSION}
+fi
+
# Unmount/remove stuff:
cleanup
diff --git a/xdm/Xresources b/xdm/Xresources
index f0de167..91f066a 100644
--- a/xdm/Xresources
+++ b/xdm/Xresources
@@ -19,6 +19,8 @@ xlogin.Login.greeting:
!xlogin.Login.greeting: CLIENTHOST
xlogin.Login.namePrompt: Username:\040
xlogin.Login.passwdPrompt: Password:\040
+xlogin.Login.echoPasswd: true
+xlogin.Login.allowNullPasswd: true
xlogin.Login.fail: incorrect
xlogin.Login.greetFace: Terminus-14:style=Bold
xlogin.Login.promptFace: Terminus-12:style=Bold
@@ -34,8 +36,30 @@ xlogin.Login.y: LOGIN_POS_Y
xlogin.Login.borderWidth: 0
xlogin.Login.foreground: #ffe4e4
xlogin.Login.background: black
+xlogin.Login.hiColor: black
+xlogin.Login.shdColor: black
+xlogin.Login.inpColor: black
+xlogin.Login.innerFramesWidth: 0
+xlogin.Login.sepWidth: 0
xlogin.Login.logoFileName: /etc/X11/xdm/liveslak-xdm/bluepiSW.xpm
+xlogin*login.translations: #override \
+ Ctrl<Key>R: abort-display()\n\
+ <Key>Delete: delete-character()\n\
+ <Key>Left: move-backward-character()\n\
+ <Key>Right: move-forward-character()\n\
+ <Key>Home: move-to-begining()\n\
+ <Key>End: move-to-end()\n\
+ Ctrl<Key>KP_Enter: set-session-argument(failsafe) finish-field()\n\
+ <Key>KP_Enter: set-session-argument() finish-field()\n\
+ Ctrl<Key>Return: set-session-argument(failsafe) finish-field()\n\
+ <Key>Return: set-session-argument() finish-field()
+ <Key>F1: set-session-argument(failsafe) finish-field()\n\
+ <Key>F2: set-session-argument(kde) finish-field()\n\
+ <Key>F3: set-session-argument(xfce) finish-field()\n\
+ <Key>F4: set-session-argument(fvwm2) finish-field()\n\
+ <Key>F5: set-session-argument(fluxbox) finish-field()\n\
+
.XClock.geometry: 350x28+0-0
.XClock.Clock.analog: false
.XClock.Clock.strftime: (%A)\040%F\040%T