diff --git a/exports/iso/03-finalize/01-run.sh b/exports/iso/03-finalize/01-run.sh new file mode 100755 index 0000000..cd9754b --- /dev/null +++ b/exports/iso/03-finalize/01-run.sh @@ -0,0 +1,95 @@ +#!/bin/bash -e + +if [ "${ARCH}" != "amd64" ]; then + echo "export-iso: skipping live package install for non-amd64 arch (${ARCH})" + exit 0 +else + on_chroot << EOF +apt-get install -y \ + live-boot \ + live-boot-initramfs-tools \ + live-config \ + live-config-systemd +EOF + + on_chroot << EOF +apt-get install --no-install-recommends -y calamares calamares-settings-vesperos libcrack2 cracklib-runtime +EOF + + # Write live-config user settings + mkdir -p "${ROOTFS_DIR}/etc/live" + cat > "${ROOTFS_DIR}/etc/live/config.conf" << EOF +LIVE_USERNAME="${LIVE_USERNAME:-user}" +LIVE_USER_FULLNAME="${LIVE_USER_FULLNAME:-Live User}" +LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev bluetooth" +LIVE_USER_PASSWORD="${LIVE_USER_PASSWORD:-live}" +EOF + + # Rewrite fstab for the live environment. + # live-boot manages root via overlayfs — build-time disk entries cause fsck failures at boot. + cat > "${ROOTFS_DIR}/etc/fstab" << 'FSTABEOF' +# Live system fstab — root is managed by live-boot via overlayfs, not this file. +tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0 +FSTABEOF + + # Remove first-boot trigger so GDM uses autologin in the live session. + rm -f "${ROOTFS_DIR}/var/lib/gdm/run-initial-setup" + + # Configure initramfs for live boot — squashfs and overlay are required + if [ -f "${ROOTFS_DIR}/etc/initramfs-tools/initramfs.conf" ]; then + sed -i 's/^MODULES=.*/MODULES=most/' "${ROOTFS_DIR}/etc/initramfs-tools/initramfs.conf" + fi + + for mod in squashfs overlay; do + grep -qx "${mod}" "${ROOTFS_DIR}/etc/initramfs-tools/modules" 2>/dev/null || \ + echo "${mod}" >> "${ROOTFS_DIR}/etc/initramfs-tools/modules" + done +fi + +# Ensure update-initramfs actually runs — it silently exits if update_initramfs=no/disabled, +# which may have been set during the build to suppress apt-hook rebuilds. +# This mirrors what exports/iso/04-finalise does before calling update-initramfs. +if [ -f "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" ]; then + sed -i 's/^update_initramfs=.*/update_initramfs=yes/' "${ROOTFS_DIR}/etc/initramfs-tools/update-initramfs.conf" +fi + +on_chroot <<- EOF + update-initramfs -k all -c + if hash hardlink 2>/dev/null; then + hardlink -t /usr/share/doc + fi + if [ -f /usr/lib/systemd/system/apt-listchanges.service ]; then + python3 -m apt_listchanges.populate_database --profile apt + systemctl disable apt-listchanges.timer + fi + install -m 755 -o systemd-timesync -g systemd-timesync -d /var/lib/systemd/timesync + install -m 644 -o systemd-timesync -g systemd-timesync /dev/null /var/lib/systemd/timesync/clock +EOF + +rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static" + +if [ "${USE_QEMU}" != "1" ]; then + if [ -e "${ROOTFS_DIR}/etc/ld.so.preload.disabled" ]; then + mv "${ROOTFS_DIR}/etc/ld.so.preload.disabled" "${ROOTFS_DIR}/etc/ld.so.preload" + fi +fi + +rm -f "${ROOTFS_DIR}/etc/network/interfaces.dpkg-old" +rm -f "${ROOTFS_DIR}/etc/apt/sources.list~" +rm -f "${ROOTFS_DIR}/etc/apt/trusted.gpg~" +rm -f "${ROOTFS_DIR}/etc/passwd-" +rm -f "${ROOTFS_DIR}/etc/group-" +rm -f "${ROOTFS_DIR}/etc/shadow-" +rm -f "${ROOTFS_DIR}/etc/gshadow-" +rm -f "${ROOTFS_DIR}/etc/subuid-" +rm -f "${ROOTFS_DIR}/etc/subgid-" +rm -f "${ROOTFS_DIR}"/var/cache/debconf/*-old +rm -f "${ROOTFS_DIR}"/var/lib/dpkg/*-old +rm -f "${ROOTFS_DIR}"/usr/share/icons/*/icon-theme.cache +rm -f "${ROOTFS_DIR}/var/lib/dbus/machine-id" + +echo "uninitialized" > "${ROOTFS_DIR}/etc/machine-id" + +ln -nsf /proc/mounts "${ROOTFS_DIR}/etc/mtab" + +find "${ROOTFS_DIR}/var/log/" -type f -exec cp /dev/null {} \; \ No newline at end of file diff --git a/exports/iso/03-install-live/01-run.sh b/exports/iso/03-install-live/01-run.sh deleted file mode 100755 index 74c3d9d..0000000 --- a/exports/iso/03-install-live/01-run.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -e - -if [ "${ARCH}" != "amd64" ]; then - echo "export-iso: skipping live package install for non-amd64 arch (${ARCH})" - exit 0 -fi - -on_chroot << EOF -apt-get install -y \ - grub-efi-amd64 \ - grub-efi-amd64-bin \ - live-boot \ - live-boot-initramfs-tools \ - live-config \ - live-config-systemd - -apt-get install --no-install-recommends -y calamares calamares-settings-vesperos -EOF - -# Write live-config user settings -mkdir -p "${ROOTFS_DIR}/etc/live" -cat > "${ROOTFS_DIR}/etc/live/config.conf" << EOF -LIVE_USERNAME="${LIVE_USERNAME:-user}" -LIVE_USER_FULLNAME="${LIVE_USER_FULLNAME:-Live User}" -LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev bluetooth" -LIVE_USER_PASSWORD="${LIVE_USER_PASSWORD:-live}" -EOF \ No newline at end of file diff --git a/exports/squashfs/03-finalise/01-run.sh b/exports/squashfs/03-finalise/01-run.sh index a34d558..c050176 100755 --- a/exports/squashfs/03-finalise/01-run.sh +++ b/exports/squashfs/03-finalise/01-run.sh @@ -46,6 +46,13 @@ FSTABEOF fi fi +# If live install add calamares installer +if [ "${LIVEINSTALL}" == "1" ]; then + on_chroot << EOF +apt-get install --no-install-recommends -y calamares calamares-settings-vesperos libcrack2 cracklib-runtime +EOF +fi + # Ensure update-initramfs actually runs — it silently exits if update_initramfs=no/disabled, # which may have been set during the build to suppress apt-hook rebuilds. # This mirrors what exports/iso/04-finalise does before calling update-initramfs. diff --git a/exports/squashfs/05-install-calamares/01-run.sh b/exports/squashfs/05-install-calamares/01-run.sh deleted file mode 100755 index 075b309..0000000 --- a/exports/squashfs/05-install-calamares/01-run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e - -[ "${LIVEINSTALL}" != "1" ] && exit 0 - -on_chroot << EOF -apt-get install --no-install-recommends -y calamares calamares-settings-vesperos -EOF \ No newline at end of file diff --git a/exports/squashfs/06-export-livefs/01-run.sh b/exports/squashfs/06-export-livefs/01-run.sh deleted file mode 100755 index b67b965..0000000 --- a/exports/squashfs/06-export-livefs/01-run.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -e - -[ "${LIVEINSTALL}" != "1" ] && exit 0 - -LIVEFS_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.livefs.squashfs" - -unmount "${ROOTFS_DIR}" - -mksquashfs "${ROOTFS_DIR}" "${LIVEFS_FILE}" \ - -comp xz \ - -noappend \ - -e boot/efi - -mkdir -p "${DEPLOY_DIR}" - -VMLINUZ=$(find "${ROOTFS_DIR}/boot" -maxdepth 1 -name "vmlinuz-*" | sort | tail -1) -INITRD=$(find "${ROOTFS_DIR}/boot" -maxdepth 1 -name "initrd.img-*" | sort | tail -1) - -cp "${LIVEFS_FILE}" "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.livefs.squashfs" -[ -n "${VMLINUZ}" ] && cp "${VMLINUZ}" "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.livefs.vmlinuz" -[ -n "${INITRD}" ] && cp "${INITRD}" "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.livefs.initrd.img" diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 9750ec9..6b61026 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -27,5 +27,5 @@ udisks2 unzip zip p7zip-full file python3-venv -hyfetch -cups \ No newline at end of file +cups +command-not-found \ No newline at end of file diff --git a/stage2/01-sys-tweaks/00-packages-nr b/stage2/01-sys-tweaks/00-packages-nr index c208dee..3594199 100644 --- a/stage2/01-sys-tweaks/00-packages-nr +++ b/stage2/01-sys-tweaks/00-packages-nr @@ -1,2 +1,3 @@ cifs-utils mkvtoolnix +hyfetch \ No newline at end of file diff --git a/stage3/00-install-packages/00-packages b/stage3/00-install-packages/00-packages index 8bf8d7b..3e7d9c7 100644 --- a/stage3/00-install-packages/00-packages +++ b/stage3/00-install-packages/00-packages @@ -6,9 +6,7 @@ gvfs rfkill fonts-droid-fallback fonts-liberation2 -obconf python3-pyqt5 python3-qtawesome python3-opengl vulkan-tools mesa-vulkan-drivers -libopengl0 -command-not-found \ No newline at end of file +libopengl0 \ No newline at end of file