diff options
Diffstat (limited to 'make_slackware_live.sh')
-rwxr-xr-x | make_slackware_live.sh | 318 |
1 files changed, 233 insertions, 85 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 3428ca6..e91f1a4 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 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,7 @@ # ----------------------------------------------------------------------------- # Version of the Live OS generator: -VERSION="1.5.4" +VERSION="1.8.1.1" # Timestamp: THEDATE=$(date +%Y%m%d) @@ -84,9 +84,11 @@ MOKCERT="" # to be defined through the '-S' parameter: MOKPRIVKEY="" -# Set to NO if you want to use the non-SMP kernel on 32bit Slackware. -# note: unsupported option since Slackware enabled preemption in 5.14.15. -SMP32=${SMP32:-"YES"} +# 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"} @@ -179,8 +181,9 @@ ONLY_ISO="NO" # The name of the directory used for storing persistence data: PERSISTENCE=${PERSISTENCE:-"persistence"} -# Add a Core OS to load into RAM (currently supported for XFCE, LEAN, DAW): +# 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): @@ -200,11 +203,17 @@ 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,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 local:mcpp" +SEQ_XFCEBASE="pkglist:${MINLIST},noxbase,x_base,xapbase,xfcebase local:mcpp" # Stripped-down Base Slackware: SEQ_LEAN="pkglist:${MINLIST},noxbase,x_base,xapbase,xfcebase,slackpkgplus,z00_plasma5supp,z01_plasma5base,z01_swdev" @@ -216,7 +225,7 @@ SEQ_DAW="pkglist:${MINLIST},noxbase,x_base,xapbase,slackpkgplus,z00_plasma5supp, # Slackware with 'ktown' Plasma5 instead of its own KDE (full install): # - each will become a squashfs module: -SEQ_KTOWN="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap,xfce,y pkglist:ktown,ktownalien,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 (full install): # - each will become a squashfs module: @@ -237,6 +246,7 @@ SEQ_STUDW="tagfile:a,ap,d,e,f,k,kde,l,n,t,tcl,x,xap,xfce,y pkglist:slackextra,sl # 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: @@ -247,7 +257,7 @@ TESTINGLIST_DAW="" # 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; # Virtio modules added to experiment with liveslak in a VM. -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: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: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"} +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" @@ -262,7 +272,7 @@ NETFIRMWARE="3com acenic adaptec bnx tigon e100 sun kaweth tr_smctr cxgb3 rtl_ni # 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_KTOWN="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" @@ -348,9 +358,9 @@ function cleanup() { umount ${LIVE_ROOTDIR}/sys 2>${DBGOUT} || true umount ${LIVE_ROOTDIR}/proc 2>${DBGOUT} || true umount ${LIVE_ROOTDIR}/dev 2>${DBGOUT} || true - umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true + umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true # Need to umount the squashfs modules too: - umount ${LIVE_WORK}/*_$$ 2>${DBGOUT} || true + umount -R ${LIVE_WORK}/*_$$ 2>${DBGOUT} || true rmdir ${LIVE_ROOTDIR} 2>${DBGOUT} rmdir ${LIVE_WORK}/*_$$ 2>${DBGOUT} @@ -482,6 +492,16 @@ 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 @@ -727,6 +747,7 @@ function gen_bootmenu() { -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) @@ -772,6 +793,7 @@ EOL -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: @@ -802,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} @@ -832,12 +854,13 @@ function gen_uefimenu() { -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 @@ -883,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 @@ -890,35 +916,46 @@ 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() @@ -971,8 +1008,8 @@ function secureboot() { if [ "${SHIM_VENDOR}" = "fedora" ]; then # The version of Fedora's shim package - always use the latest! - SHIM_MAJVER=15.4 - SHIM_MINVER=5 + 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 - \ @@ -988,7 +1025,7 @@ function secureboot() { # ${LIVE_STAGING}/EFI/BOOT/fbx64.efi elif [ "${SHIM_VENDOR}" = "opensuse" ]; then SHIM_MAJVER=15.4 - SHIM_MINVER=4.2 + 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 - \ @@ -1003,10 +1040,10 @@ function secureboot() { #install -D -m0644 usr/share/efi/x86_64/fallback.efi \ # ${LIVE_STAGING}/EFI/BOOT/fallback.efi elif [ "${SHIM_VENDOR}" = "debian" ]; then - DEBSHIM_VER=1.38 + DEBSHIM_VER=1.40 DEBMOKM_VER=1 - SHIM_MAJVER=15.4 - SHIM_MINVER=7 + 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." @@ -1204,7 +1241,7 @@ EOT # 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.deskop + THEMEFIL=/usr/share/plasma/desktoptheme/default/metadata.desktop else # Frameworks 5.94.0 and newer: THEMEFIL=/usr/share/plasma/desktoptheme/default/plasmarc @@ -1234,6 +1271,18 @@ 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() # --------------------------------------------------------------------------- @@ -1266,6 +1315,7 @@ do 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" @@ -1278,7 +1328,7 @@ do echo " -v Show debug/error output." echo " -z version Define your ${DISTRO^} version (default: $SL_VERSION)." echo " -C Add RAM-based Console OS to boot menu." - echo " -G Generate ISO file from existing directory tree" + 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." @@ -1407,20 +1457,18 @@ case "$LIVEDE" in ;; esac -if [ "${CORE2RAM}" == "YES" ] || [ "${LIVEDE}" == "XFCE" ] || [ "${LIVEDE}" == "LEAN" ] || [ "${LIVEDE}" == "DAW" ] ; then - # For now, allow CORE2RAM only for the variants that actually - # have the required modules in their system list. - # TODO: create these modules separately in the 'core2ram' subdirectory. - for MY_MOD in ${CORE2RAMMODS} ; do - if ! echo ${MSEQ} | grep -wq ${MY_MOD} ; then - echo ">> Modules required for Core RAM-based OS (${CORE2RAMMODS}) not available." - exit 1 - fi - done - # Whether to hide the Core OS menu on boot yes or no: - C2RMH="#" +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="" + C2RMH="" # syslinux + C2RMS="#" # grub fi if ! cat ${LIVE_TOOLDIR}/languages |grep -Ev '(^ *#|^$)' |grep -q ^${DEF_LANG}: @@ -1520,6 +1568,11 @@ 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} @@ -1551,7 +1604,7 @@ fi if [ "$FORCE" = "YES" ]; then echo "-- Removing old files and directories!" umount ${LIVE_ROOTDIR}/{proc,sys,dev} 2>${DBGOUT} || true - umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true + umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true rm -rf ${LIVE_STAGING}/${LIVEMAIN} ${LIVE_WORK} ${LIVE_ROOTDIR} fi @@ -1589,6 +1642,12 @@ RODIRS="${LIVE_BOOT}" # Create the verification file for the install_pkgs function: echo "${THEDATE} (${BUILDER})" > ${LIVE_BOOT}/${MARKER} +# 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." @@ -1628,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 @@ -1645,14 +1708,14 @@ for SPS in ${SL_SERIES} ; do echo "${THEDATE} (${BUILDER})" > ${INSTDIR}/${MARKER} echo "-- Installing the '${SPS}' series." - umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true + umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true mount -t overlay -o lowerdir=${RODIRS},upperdir=${INSTDIR},workdir=${LIVE_OVLDIR} overlay ${LIVE_ROOTDIR} # Install the package series: install_pkgs ${SPS} ${LIVE_ROOTDIR} ${MTYPE} - umount ${LIVE_ROOTDIR} || true + umount -R ${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 @@ -1719,7 +1782,7 @@ mkdir -p ${INSTDIR} echo "-- Configuring the base system." # -------------------------------------------------------------------------- # -umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true +umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true mount -t overlay -o lowerdir=${RODIRS},upperdir=${INSTDIR},workdir=${LIVE_OVLDIR} overlay ${LIVE_ROOTDIR} # Determine the kernel version in the Live OS: @@ -1744,6 +1807,7 @@ sed -e "s/^\(127.0.0.1\t*\)darkstar.*/\1${LIVE_HOSTNAME}.home.arpa ${LIVE_HOSTNA cat <<EOT >> ${LIVE_ROOTDIR}/etc/resolv.conf nameserver 8.8.4.4 nameserver 8.8.8.8 +nameserver 1.1.1.1 EOT @@ -1761,7 +1825,7 @@ 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: -ln -s /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 @@ -1836,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 @@ -2056,7 +2130,7 @@ 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}/ @@ -2111,6 +2185,7 @@ 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 @@ -2522,14 +2597,14 @@ EOT fi # End KDE4 -# Only configure for Plasma5 if it is actually installed: -if [ -d ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/kf5 ]; then +# 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 Plasma5 based variant. + # This section is for any Plasma based variant. # Install a custom login/desktop/lock background if an image is present: plasma5_custom_bg @@ -2538,7 +2613,7 @@ if [ -d ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/kf5 ]; then 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 @@ -2551,6 +2626,12 @@ if [ -d ${LIVE_ROOTDIR}/usr/lib${DIRSUFFIX}/kf5 ]; then # 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 @@ -2578,6 +2659,18 @@ 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] @@ -2640,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 @@ -2650,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: @@ -2672,21 +2779,53 @@ EOT 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 Qt5 applications: +# 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 Qt5 applications: +# 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.* -fi # End Plasma5 +# 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 @@ -3106,6 +3245,10 @@ 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: @@ -3216,6 +3359,10 @@ if [ -x ${LIVE_ROOTDIR}/etc/cron.daily/mlocate ]; then else LOCATE_BIN=slocate fi +# Mlocate needs a mounted /proc in the chroot: +if ! mount | grep -q 'on ${LIVE_ROOTDIR}/proc' ; then + mount --bind /proc ${LIVE_ROOTDIR}/proc +fi chroot ${LIVE_ROOTDIR} /etc/cron.daily/${LOCATE_BIN} 2>${DBGOUT} # ----------------------------------------------------------------------------- @@ -3223,7 +3370,7 @@ chroot ${LIVE_ROOTDIR} /etc/cron.daily/${LOCATE_BIN} 2>${DBGOUT} # ----------------------------------------------------------------------------- # Squash the configuration into its own module: -umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true +umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true mksquashfs ${INSTDIR} ${LIVE_MOD_SYS}/0099-${DISTRO}_zzzconf-${SL_VERSION}-${SL_ARCH}.sxz -noappend -comp ${SQ_COMP} ${SQ_COMP_PARAMS} rm -rf ${INSTDIR}/* @@ -3243,7 +3390,7 @@ unset INSTDIR # ----------------------------------------------------------------------------- echo "-- Preparing the system for live booting." -umount ${LIVE_ROOTDIR} 2>${DBGOUT} || true +umount -R ${LIVE_ROOTDIR} 2>${DBGOUT} || true mount -t overlay -o lowerdir=${RODIRS%:*},upperdir=${LIVE_BOOT},workdir=${LIVE_OVLDIR} overlay ${LIVE_ROOTDIR} mount --bind /proc ${LIVE_ROOTDIR}/proc @@ -3294,6 +3441,12 @@ 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} \ @@ -3347,7 +3500,7 @@ rm -rf ${LIVE_ROOTDIR}/boot/initrd-tree # ... and cleanup these mounts again: umount ${LIVE_ROOTDIR}/{proc,sys,dev} || true -umount ${LIVE_ROOTDIR} || true +umount -R ${LIVE_ROOTDIR} || true # Paranoia: [ ! -z "${LIVE_BOOT}" ] && rm -rf ${LIVE_BOOT}/{etc,tmp,usr,var} 1>${DBGOUT} 2>${DBGOUT} @@ -3361,11 +3514,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/ @@ -3387,7 +3535,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 \ |