diff options
-rw-r--r-- | backend/modules/bootloader | 33 | ||||
-rw-r--r-- | backend/modules/install_configure | 38 | ||||
-rw-r--r-- | backend/modules/partitions | 2 | ||||
-rw-r--r-- | debian/changelog | 54 | ||||
-rw-r--r-- | debian/kanotix-enable-persistent-live.install | 2 | ||||
-rwxr-xr-x | kanotix/9000-enable-persistent | 17 | ||||
-rw-r--r--[-rwxr-xr-x] | kanotix/enable_persistent_live.bash (renamed from kanotix/enable_persistent_live) | 51 |
7 files changed, 182 insertions, 15 deletions
diff --git a/backend/modules/bootloader b/backend/modules/bootloader index 629f9b5..4fd4df9 100644 --- a/backend/modules/bootloader +++ b/backend/modules/bootloader @@ -54,6 +54,11 @@ function list_bootloaders() grub) echo "GRUB - GRand Unified Bootloader";; esac done + if [ -d /sys/firmware/efi ]; then + if [ -x /usr/sbin/refind-install ]; then + echo "rEFInd - Refind Bootmanager" + fi + fi } function send_bootloaders() @@ -75,6 +80,9 @@ function install_bootmanager_to_target() burg) install_burg ;; + refind) + install_refind + ;; esac } @@ -163,6 +171,27 @@ function install_burg() return 0 } +function install_refind() +{ + rm -f $TARGET/boot/vmlinuz $TARGET/boot/System.map $TARGET/boot/initrd.img + + apple=0 + dmidecode -s system-manufacturer | grep -q "Apple Inc." && apple=1 + + # install refind + if [ -d /sys/firmware/efi ]; then + if is_removeable "$cfg_bootloader_target" || [ "$apple" = 1 ]; then + refind-install --usedefault "$cfg_bootloader_target" --alldrivers &>/dev/null + else + refind-install --root $TARGET &>/dev/null + fi + fi + + write_kernel_img_conf + + return 0 +} + function write_kernel_img_conf() { rm -f $TARGET/etc/kernel-img.conf @@ -170,13 +199,9 @@ cat << EOT > $TARGET/etc/kernel-img.conf # Kernel image management overrides # See kernel-img.conf(5) for details do_symlinks = yes -relative_links = yes do_bootloader = no -do_bootfloppy = no do_initrd = yes link_in_boot = no -postinst_hook = update-$cfg_bootloader -postrm_hook = update-$cfg_bootloader EOT } diff --git a/backend/modules/install_configure b/backend/modules/install_configure index ad5a543..c0eb95b 100644 --- a/backend/modules/install_configure +++ b/backend/modules/install_configure @@ -55,6 +55,14 @@ EOF rm -f $TARGET/tmp 2>/dev/null mkdir -p $TARGET/tmp chmod 1777 $TARGET/tmp + + # create file to mount efivars (needed since bullseye) + cat <<EOF >$TARGET/tmp/fixmount +#!/bin/sh +modprobe efivarfs +mount -t efivarfs efivarfs /sys/firmware/efi/efivars +EOF + chmod ugo+x $TARGET/tmp/fixmount # create /etc/mtab as a regular file rm -f $TARGET/etc/mtab @@ -99,8 +107,15 @@ EOF [ -n "$KEYTABLE" ] && chroot_it install-keymap "$KEYTABLE" 2>/dev/null - # remove live-repo from sources.list + # remove live-repo from sources.list and delete key sed -i -e '/^# Live Media$/{N;\|\ndeb file:/live/image/debian |{N;/\n$/d}}' $TARGET/etc/apt/sources.list + sed -i -e '/^# Live Media$/{N;\|\ndeb file:/run/live/medium/debian |{N;/\n$/d}}' $TARGET/etc/apt/sources.list + sed -i -e '/^# Live Media$/{N;\|\ndeb \[signed-by=\/usr\/share\/keyrings\/live-media.gpg\] file:/run/live/medium/debian |{N;/\n$/d}}' $TARGET/etc/apt/sources.list + rm -f $TARGET/etc/apt/trusted.gpg.d/live-media.asc $TARGET/usr/share/keyrings/live-media.gpg + # remove acritoxinstaller-qt4 repo + sed -i '/[Aa]critoxinstaller-qt4/d' $TARGET/etc/apt/sources.list + # remove double empty lines + sed -i 'N;/^\n$/D;P;D;'g $TARGET/etc/apt/sources.list } # Synopsis: configure_target_purge_live_only_stuff @@ -115,6 +130,8 @@ function configure_target_purge_live_only_stuff() acritoxinstaller-icons \ acritoxinstaller-kanotix \ kanotix-enable-persistent-live \ + calamares \ + calamares-settings-kanotix \ live-boot-initramfs-tools \ live-boot \ live-initramfs \ @@ -137,7 +154,12 @@ function configure_target_purge_live_only_stuff() zram &> /dev/null # remove unused stuff - chroot_it apt-get autoremove --purge --yes + chroot_it apt-get autoremove --purge --yes &> /dev/null + + # execute above configured fix for efi (new since bullseye) + if [ -d /sys/firmware/efi/efivars ]; then + chroot_it /tmp/fixmount + fi # remove kde-config-touchpad if no touchpad is available [ "$(su "$FLL_LIVE_USER" -c "qdbus org.kde.synaptiks /modules/synaptiks org.kde.Synaptiks.isTouchpadAvailable")" = true ] && \ @@ -160,10 +182,22 @@ function configure_target_purge_live_only_stuff() # remove kdm live shutdown hack rm -f "$TARGET/home/$cfg_username/.kde/shutdown/kdm-force-shutdown-hack" + # remove with live-boot created powermanagementprofilesrc ,will be automatically recreated at plasma5 session-startup + rm -f "$TARGET/home/$cfg_username/.config/powermanagementprofilesrc" + # remove live-only hooks rm -rf $TARGET/lib/live rm -f $TARGET/etc/profile.d/zz-live.sh rm -f $TARGET/usr/local/bin/enable_persistent_live.bash rm -f "$TARGET/home/$cfg_username/Desktop/enable_persistent.desktop" + + #remove appimage desktop files + if [ -e /run/live/medium/appimages ]; then + for appimages in /run/live/medium/appimages/* + do + appimage=$(basename $appimages) + rm -f "$TARGET/home/$cfg_username/Desktop/$appimage.desktop" + done + fi } diff --git a/backend/modules/partitions b/backend/modules/partitions index 7b3d5f2..4c033c7 100644 --- a/backend/modules/partitions +++ b/backend/modules/partitions @@ -66,7 +66,7 @@ function list_all_partitions() # /dev/mapper/cryptoroot function list_dm_partitions() { - ls /dev/mapper/* 2>/dev/null | fmt -w1 | grep -v "/control$" + ls /dev/mapper/* 2>/dev/null | fmt -w1 | grep -v "/control$" -e "/ventoy$" -e "/vtoy_persistent" } # Synopsis: (e.g.) list_all_partitions | partitions_usage_details diff --git a/debian/changelog b/debian/changelog index 2f7632e..d5c5240 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,57 @@ +acritoxinstaller (0.2.55) unstable; urgency=medium + + * Remove installer repo in installation. + * Buildsystem bullseye. + + -- Holger Paradies <retabell@gmx.de> Fri, 15 Mar 2024 16:27:39 +0100 + +acritoxinstaller (0.2.54) unstable; urgency=medium + + * Remove debpool stuff + + -- Holger Paradies <retabell@gmx.de> Tue, 12 Mar 2024 19:24:19 +0100 + +acritoxinstaller (0.2.53) unstable; urgency=medium + + * Cleanup kernel-img.conf still TODO + * Remove .config/powermanagementprofilesrc + + -- Holger Paradies <retabell@gmx.de> Mon, 27 Nov 2023 18:38:51 +0100 + +acritoxinstaller (0.2.52) unstable; urgency=medium + + * Add support for refind bootmanager + + -- Holger Paradies <retabell@gmx.de> Sun, 12 Nov 2023 12:41:28 +0100 + +acritoxinstaller (0.2.50) unstable; urgency=medium + + * Fix uefi boot + * Cleanup appimages + * Install grub-efi from debpool + * Remove calamares if installed + + -- Holger Paradies <retabell@gmx.de> Tue, 31 Oct 2023 13:29:14 +0100 + +acritoxinstaller (0.2.45) unstable; urgency=medium + + * add some cleanups for debpool + * prepare packages + + -- Holger Paradies <retabell@gmx.de> Sat, 21 Oct 2023 16:47:19 +0200 + +acritoxinstaller (0.2.44) silverfire; urgency=medium + + * remarks for UEFI at intro screen + * Add new live mount point + * Use own icon theme + * crypttab install + * fix nvme + * filter ventoy + * fix startup gparted + + -- Holger Paradies <retabell@gmx.de> Wed, 30 Dec 2020 13:46:21 +0100 + acritoxinstaller (0.2.43) steelfire; urgency=medium * do not remove busybox diff --git a/debian/kanotix-enable-persistent-live.install b/debian/kanotix-enable-persistent-live.install index 78c1759..aefdc50 100644 --- a/debian/kanotix-enable-persistent-live.install +++ b/debian/kanotix-enable-persistent-live.install @@ -1,2 +1,2 @@ -kanotix/enable_persistent_live /usr/bin +kanotix/enable_persistent_live.bash /usr/local/bin kanotix/9000-enable-persistent /lib/live/config diff --git a/kanotix/9000-enable-persistent b/kanotix/9000-enable-persistent index 734af95..c8f0b31 100755 --- a/kanotix/9000-enable-persistent +++ b/kanotix/9000-enable-persistent @@ -14,16 +14,23 @@ Configure_Persistent Configure_Persistent () { -if ! [ -x /usr/bin/enable_persistent_live ] +if ! [ -x /usr/local/bin/enable_persistent_live.bash ] then touch /var/lib/live/config/enable-persistent return fi -case "$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"){print $1;}}' /proc/mounts)" in +HAVE_PERS_CMDLINE="$(grep -F persistence /proc/cmdline)" +if [ -n "$HAVE_PERS_CMDLINE" ]; then + HAVE_PERS_CMDLINE="persistence" +fi + +ISO_DEVICE="$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"||$2=="/run/live/medium"){print $1;}}' /proc/mounts)" + +case "$ISO_DEVICE" in /dev/sd*) - case "$( ls /grub.cmdline 2>/dev/null)" in - /grub.cmdline) + case "$HAVE_PERS_CMDLINE" in + persistence) rm -f /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop ;; *) @@ -31,7 +38,7 @@ case "$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"){print $1;}}' / [Desktop Entry] Comment[de]=Diesen Live-USB-Stick persistent machen, d.h. alle Änderungen werden auf dem Stick gespeichert. Comment=Make this Live-USB-Stick persistent, i.e. all changes will be saved to the stick. -Exec=/usr/bin/enable_persistent_live +Exec=/usr/local/bin/enable_persistent_live.bash Icon=acritoxinstaller MimeType= Name[de]=»persistent« aktivieren diff --git a/kanotix/enable_persistent_live b/kanotix/enable_persistent_live.bash index a28bdc0..395f3de 100755..100644 --- a/kanotix/enable_persistent_live +++ b/kanotix/enable_persistent_live.bash @@ -4,12 +4,13 @@ # Written by Andreas Loibl <andreas@andreas-loibl.de> KDIALOG="$(which kdialog)" || KDIALOG="/usr/bin/kdialog" ZENITY="$(which zenity)" || ZENITY="/usr/bin/zenity" +YAD="$(which yad)" || YAD="/usr/bin/yad" partition=3 filesystem=ext4 . /etc/default/distro -isodev="$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"){print $1;}}' /proc/mounts)" +isodev="$(awk '{if($2=="/live/image"||$2=="/lib/live/mount/medium"||$2=="/run/live/medium"){print $1;}}' /proc/mounts)" case $isodev in /dev/sd*) ;; *) isodev= ;; @@ -20,16 +21,31 @@ if [ -x "$KDIALOG" ]; then $KDIALOG --error "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick" elif [ -x "$ZENITY" ]; then $ZENITY --error --text "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick" +elif [ -x "$YAD" ]; then + $YAD --center --error --text "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick" fi exit 1 ;; esac +if [ -d "/run/live/persistence" ]; then +if [ -x "$KDIALOG" ]; then + $KDIALOG --error "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick" +elif [ -x "$ZENITY" ]; then + $ZENITY --error --text "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick" +elif [ -x "$YAD" ]; then + $YAD --center --error --text "Persistent mode seems to be enabled already!" --title "Persistent Live-USB-Stick" +fi +exit 1 +fi + if [ "$FLL_DISTRO_MODE" != "live" -o -z "$isodev" ]; then if [ -x "$KDIALOG" ]; then $KDIALOG --error "This script can only be used from a Live USB-Stick!" --title "Persistent Live-USB-Stick" elif [ -x "$ZENITY" ]; then $ZENITY --error --text "This script can only be used from a Live USB-Stick!" --title "Persistent Live-USB-Stick" +elif [ -x "$YAD" ]; then + $YAD --center --error --text "This script can only be used from a Live USB-Stick!" --title "Persistent Live-USB-Stick" fi exit 1 fi @@ -64,6 +80,22 @@ CURRENT CHANGES ARE NOT STORED, YOU HAVE TO REBOOT TO ENABLE PERSISTENCE! Press \"Continue\" when you are ready to start. " --title "Persistent Live-USB-Stick" || exit 0 +elif [ -x "$YAD" ]; then + +$YAD --center --question --text "This script automatically configures your Live-USB-Stick to be persistent: + +* it adds a new partition into the unused space of your stick +* formats the partition with $filesystem filesystem +* writes config files to the new partition + +=============================================================== +CURRENT CHANGES ARE NOT STORED, YOU HAVE TO REBOOT TO ENABLE PERSISTENCE! +=============================================================== + +Press \"Continue\" when you are ready to start. + +" --title "Persistent Live-USB-Stick" || exit 0 + fi cp "$0" "/tmp/$(basename "$0")" chmod +x "/tmp/$(basename "$0")" @@ -72,6 +104,8 @@ $KDIALOG --progressbar "Please wait..." --title "Persistent Live-USB-Stick" 0 sudo "/tmp/$(basename "$0")" "$@" elif [ -x "$ZENITY" ]; then sudo "/tmp/$(basename "$0")" "$@" | $ZENITY --progress --pulsate --text "Please wait..." --title "Persistent Live-USB-Stick" 0 +elif [ -x "$YAD" ]; then +sudo "/tmp/$(basename "$0")" "$@" | $YAD --center --progress --pulsate --text "Please wait..." --title "Persistent Live-USB-Stick" 0 fi exit $? @@ -98,6 +132,18 @@ if [ ! -e "$isodisk"$partition ]; then mkfs.$filesystem -L "persistence" "$isodisk"$partition fi +if [ -d /run/live/medium ]; then + mkdir -p /run/live/persistence + mount "$isodisk"$partition /run/live/persistence + set -- $(cat /proc/cmdline) + shift + echo "set persistence_cmdline='$@ persistence'" > /run/live/persistence/grub.cmdline + echo "/ union" > /run/live/persistence/persistence.conf + umount /run/live/persistence + rmdir /run/live/persistence + +else + if [ -d /lib/live/mount ]; then mkdir -p /lib/live/mount/persistence mount "$isodisk"$partition /lib/live/mount/persistence @@ -117,7 +163,8 @@ elif [ -d /live ]; then umount /live/persistence rmdir /live/persistence fi - +fi #killall -9 kdialog kill $(ps ax | grep kdialog | grep Live-USB | cut -c2-5) +killall -9 kdialog_progress_helper exit 0 |