From 0a2627b610fe3bfb19fccde5d540781cf2304a47 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 13 Aug 2024 13:08:11 +0000 Subject: [PATCH] add cleanup hook to the server builds --- .../scripts/deb_32/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/deb_32/07grub-config | 39 ++++++++++ .../installer/scripts/deb_32/07update-system | 28 ++++++++ .../scripts/deb_64/06copy-files-to-target | 71 ++++++++++++++++++ .../installer/scripts/deb_64/06hblock-install | 14 ++++ .../scripts/deb_64/06setup-snap-install | 18 +++++ .../installer/scripts/deb_64/07final-cleanup | 23 ++++++ .../installer/scripts/deb_64/07grub-config | 31 ++++++++ .../scripts/deb_64/07rebuild-icon-caches | 11 +++ .../installer/scripts/deb_64/07update-system | 28 ++++++++ .../scripts/deb_arm/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/deb_arm/07grub-config | 39 ++++++++++ .../installer/scripts/deb_arm/07update-system | 28 ++++++++ .../scripts/debld_32/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/debld_32/07grub-config | 39 ++++++++++ .../scripts/debld_32/07update-system | 28 ++++++++ .../scripts/debld_64/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/debld_64/07grub-config | 39 ++++++++++ .../scripts/debld_64/07update-system | 28 ++++++++ .../scripts/debmin_32/06copy-files-to-target | 71 ++++++++++++++++++ .../scripts/debmin_32/06hblock-install | 14 ++++ .../scripts/debmin_32/06setup-snap-install | 18 +++++ .../scripts/debmin_32/07final-cleanup | 23 ++++++ .../installer/scripts/debmin_32/07grub-config | 31 ++++++++ .../scripts/debmin_32/07rebuild-icon-caches | 11 +++ .../scripts/debmin_32/07update-system | 28 ++++++++ .../scripts/debmin_64/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/debmin_64/07grub-config | 39 ++++++++++ .../scripts/debmin_64/07update-system | 28 ++++++++ .../scripts/debsrv_64/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/debsrv_64/07grub-config | 39 ++++++++++ .../scripts/debsrv_64/07update-system | 28 ++++++++ .../scripts/dev_32/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/dev_32/07grub-config | 39 ++++++++++ .../installer/scripts/dev_32/07update-system | 28 ++++++++ .../scripts/dev_64/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/dev_64/07grub-config | 39 ++++++++++ .../installer/scripts/dev_64/07update-system | 28 ++++++++ .../scripts/dev_arm/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/dev_arm/07grub-config | 39 ++++++++++ .../installer/scripts/dev_arm/07update-system | 28 ++++++++ .../scripts/devld_32/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/devld_32/07grub-config | 39 ++++++++++ .../scripts/devld_32/07update-system | 28 ++++++++ .../scripts/devld_64/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/devld_64/07grub-config | 39 ++++++++++ .../scripts/devld_64/07update-system | 28 ++++++++ .../scripts/devmin_32/06copy-files-to-target | 72 +++++++++++++++++++ .../scripts/devmin_32/06hblock-install | 14 ++++ .../scripts/devmin_32/07final-cleanup | 23 ++++++ .../installer/scripts/devmin_32/07grub-config | 31 ++++++++ .../scripts/devmin_32/07rebuild-icon-caches | 11 +++ .../scripts/devmin_32/07update-system | 28 ++++++++ .../scripts/devmin_64/06copy-files-to-target | 72 +++++++++++++++++++ .../scripts/devmin_64/06hblock-install | 14 ++++ .../scripts/devmin_64/07final-cleanup | 23 ++++++ .../installer/scripts/devmin_64/07grub-config | 31 ++++++++ .../scripts/devmin_64/07rebuild-icon-caches | 11 +++ .../scripts/devmin_64/07update-system | 28 ++++++++ .../scripts/devsrv_64/06copy-files-to-cdrom | 18 +++++ .../installer/scripts/devsrv_64/07grub-config | 39 ++++++++++ .../scripts/devsrv_64/07update-system | 28 ++++++++ 62 files changed, 1770 insertions(+) create mode 100755 iso_configs/installer/scripts/deb_32/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/deb_32/07grub-config create mode 100755 iso_configs/installer/scripts/deb_32/07update-system create mode 100755 iso_configs/installer/scripts/deb_64/06copy-files-to-target create mode 100755 iso_configs/installer/scripts/deb_64/06hblock-install create mode 100755 iso_configs/installer/scripts/deb_64/06setup-snap-install create mode 100755 iso_configs/installer/scripts/deb_64/07final-cleanup create mode 100755 iso_configs/installer/scripts/deb_64/07grub-config create mode 100755 iso_configs/installer/scripts/deb_64/07rebuild-icon-caches create mode 100755 iso_configs/installer/scripts/deb_64/07update-system create mode 100755 iso_configs/installer/scripts/deb_arm/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/deb_arm/07grub-config create mode 100755 iso_configs/installer/scripts/deb_arm/07update-system create mode 100755 iso_configs/installer/scripts/debld_32/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/debld_32/07grub-config create mode 100755 iso_configs/installer/scripts/debld_32/07update-system create mode 100755 iso_configs/installer/scripts/debld_64/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/debld_64/07grub-config create mode 100755 iso_configs/installer/scripts/debld_64/07update-system create mode 100755 iso_configs/installer/scripts/debmin_32/06copy-files-to-target create mode 100755 iso_configs/installer/scripts/debmin_32/06hblock-install create mode 100755 iso_configs/installer/scripts/debmin_32/06setup-snap-install create mode 100755 iso_configs/installer/scripts/debmin_32/07final-cleanup create mode 100755 iso_configs/installer/scripts/debmin_32/07grub-config create mode 100755 iso_configs/installer/scripts/debmin_32/07rebuild-icon-caches create mode 100755 iso_configs/installer/scripts/debmin_32/07update-system create mode 100755 iso_configs/installer/scripts/debmin_64/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/debmin_64/07grub-config create mode 100755 iso_configs/installer/scripts/debmin_64/07update-system create mode 100755 iso_configs/installer/scripts/debsrv_64/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/debsrv_64/07grub-config create mode 100755 iso_configs/installer/scripts/debsrv_64/07update-system create mode 100755 iso_configs/installer/scripts/dev_32/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/dev_32/07grub-config create mode 100755 iso_configs/installer/scripts/dev_32/07update-system create mode 100755 iso_configs/installer/scripts/dev_64/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/dev_64/07grub-config create mode 100755 iso_configs/installer/scripts/dev_64/07update-system create mode 100755 iso_configs/installer/scripts/dev_arm/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/dev_arm/07grub-config create mode 100755 iso_configs/installer/scripts/dev_arm/07update-system create mode 100755 iso_configs/installer/scripts/devld_32/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/devld_32/07grub-config create mode 100755 iso_configs/installer/scripts/devld_32/07update-system create mode 100755 iso_configs/installer/scripts/devld_64/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/devld_64/07grub-config create mode 100755 iso_configs/installer/scripts/devld_64/07update-system create mode 100755 iso_configs/installer/scripts/devmin_32/06copy-files-to-target create mode 100755 iso_configs/installer/scripts/devmin_32/06hblock-install create mode 100755 iso_configs/installer/scripts/devmin_32/07final-cleanup create mode 100755 iso_configs/installer/scripts/devmin_32/07grub-config create mode 100755 iso_configs/installer/scripts/devmin_32/07rebuild-icon-caches create mode 100755 iso_configs/installer/scripts/devmin_32/07update-system create mode 100755 iso_configs/installer/scripts/devmin_64/06copy-files-to-target create mode 100755 iso_configs/installer/scripts/devmin_64/06hblock-install create mode 100755 iso_configs/installer/scripts/devmin_64/07final-cleanup create mode 100755 iso_configs/installer/scripts/devmin_64/07grub-config create mode 100755 iso_configs/installer/scripts/devmin_64/07rebuild-icon-caches create mode 100755 iso_configs/installer/scripts/devmin_64/07update-system create mode 100755 iso_configs/installer/scripts/devsrv_64/06copy-files-to-cdrom create mode 100755 iso_configs/installer/scripts/devsrv_64/07grub-config create mode 100755 iso_configs/installer/scripts/devsrv_64/07update-system diff --git a/iso_configs/installer/scripts/deb_32/06copy-files-to-cdrom b/iso_configs/installer/scripts/deb_32/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/deb_32/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/deb_32/07grub-config b/iso_configs/installer/scripts/deb_32/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/deb_32/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/deb_32/07update-system b/iso_configs/installer/scripts/deb_32/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/deb_32/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/deb_64/06copy-files-to-target b/iso_configs/installer/scripts/deb_64/06copy-files-to-target new file mode 100755 index 00000000..d1dea05d --- /dev/null +++ b/iso_configs/installer/scripts/deb_64/06copy-files-to-target @@ -0,0 +1,71 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# setup a folder structure +mkdir -p /target/etc/skel/.local/share/pmostools +mkdir -p /target/etc/skel/.config/autostart +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/etc/default +mkdir -p /target/etc/apt/sources.list.d +mkdir -p /target/etc/apt +mkdir -p /target/etc/apt/trusted.gpg.d +mkdir -p /target/usr/share/keyrings +mkdir -p /target/usr/share/applications +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/usr/share/polkit-1/actions +mkdir -p /target/usr/share/pixmaps +mkdir -p /target/etc/lightdm +mkdir -p /target/usr/lib/python3/dist-packages +mkdir -p /target/boot/grub + +# Copy files to the chroot directory +cp /preseed/grub/grub /target/etc/default +cp /preseed/repos/multimedia.list /target/etc/apt/sources.list.d +cp /preseed/repos/peppermint.list /target/etc/apt/sources.list.d +cp /preseed/repos/sources.list /target/etc/apt +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/peppermint-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/usr/share/keyrings +cp /preseed/keyrings/peppermint-keyring.gpg /target/usr/share/keyrings +cp /preseed/apps/* /target/usr/share/applications +cp /preseed/conf/* /target/opt/pepconf +cp /preseed/database/* /target/opt/pypep/dbpep +cp /preseed/polkit/* /target/usr/share/polkit-1/actions +cp /preseed/pixmaps/* /target/usr/share/pixmaps +cp /preseed/lightdm/* /target/etc/lightdm +cp /preseed/autostart/* /target/etc/skel/.config/autostart + +# Copy recursive files and sub-directories +cp -r /preseed/grub/themes /target/boot/grub +cp -r /preseed/protools/* /target/usr/local/bin +cp -r /preseed/py/* /target/usr/lib/python3/dist-packages +cp -r /preseed/tools/* /target/etc/skel/.local/share/pmostools + +# Run a commands in the chroot +cd /target/usr/share/python-apt/templates/ +ln -s Debian.info Peppermint.info +ln -s Debian.mirrors Peppermint.mirrors +cd /target/usr/share/distro-info/ +ln -s debian.csv peppermint.csv +cd /target/usr/share/ +ln -s icons pepicons +ln -s themes pepthemes +ln -s backgrounds pepwallpaper +chmod 777 pepicons +chmod 777 pepthemes +chmod 777 pepwallpaper + +# update gub and initramfs +chroot /target update-initramfs -u +chroot /target update-grub + + +exit 0 + diff --git a/iso_configs/installer/scripts/deb_64/06hblock-install b/iso_configs/installer/scripts/deb_64/06hblock-install new file mode 100755 index 00000000..ed31649a --- /dev/null +++ b/iso_configs/installer/scripts/deb_64/06hblock-install @@ -0,0 +1,14 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# install hblock + +chroot /target curl -o /tmp/hblock 'https://raw.githubusercontent.com/hectorm/hblock/v3.4.2/hblock' +chroot /target mv /tmp/hblock /usr/local/bin/hblock +chroot /target chown 0:0 /usr/local/bin/hblock +chroot /target chmod 755 /usr/local/bin/hblock diff --git a/iso_configs/installer/scripts/deb_64/06setup-snap-install b/iso_configs/installer/scripts/deb_64/06setup-snap-install new file mode 100755 index 00000000..7a129730 --- /dev/null +++ b/iso_configs/installer/scripts/deb_64/06setup-snap-install @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Workaround for using snapd on debian. Thank You - @stevesveryown and peppermint team.. +cd /target +[ ! -e /etc/skel/.local/share ] && mkdir -p /etc/skel/.local/share +[ ! -e /var/lib/snapd/desktop/applications ] && +mkdir -p /var/lib/snapd/desktop/applications && +chmod 777 /var/lib/snapd/desktop/applications +ln -s /var/lib/snapd/desktop/applications /etc/skel/.local/share/applications +ln -s snap /usr/bin/snap-store + + diff --git a/iso_configs/installer/scripts/deb_64/07final-cleanup b/iso_configs/installer/scripts/deb_64/07final-cleanup new file mode 100755 index 00000000..921b9199 --- /dev/null +++ b/iso_configs/installer/scripts/deb_64/07final-cleanup @@ -0,0 +1,23 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script removes unwanted software and files after Debian installation. + +# Remove unwanted packages +chroot /target apt purge --autoremove -y \ + quassel \ + thunderbird \ + mpv \ + smtube \ + smplayer \ + audacious \ + connman \ + deluge \ + galculator \ + imagemagick \ + imagemagick-6-common \ + xterm + diff --git a/iso_configs/installer/scripts/deb_64/07grub-config b/iso_configs/installer/scripts/deb_64/07grub-config new file mode 100755 index 00000000..ec3902c1 --- /dev/null +++ b/iso_configs/installer/scripts/deb_64/07grub-config @@ -0,0 +1,31 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_DISABLE_OS_PROBER=false + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/deb_64/07rebuild-icon-caches b/iso_configs/installer/scripts/deb_64/07rebuild-icon-caches new file mode 100755 index 00000000..8c3c5b3d --- /dev/null +++ b/iso_configs/installer/scripts/deb_64/07rebuild-icon-caches @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) +# +#This script rebuilds the icon caches after Debian installation. + +# Rebuild the icon caches +chroot /target find /usr/share/icons -type d -exec gtk-update-icon-cache -f {} \; + diff --git a/iso_configs/installer/scripts/deb_64/07update-system b/iso_configs/installer/scripts/deb_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/deb_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/deb_arm/06copy-files-to-cdrom b/iso_configs/installer/scripts/deb_arm/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/deb_arm/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/deb_arm/07grub-config b/iso_configs/installer/scripts/deb_arm/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/deb_arm/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/deb_arm/07update-system b/iso_configs/installer/scripts/deb_arm/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/deb_arm/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/debld_32/06copy-files-to-cdrom b/iso_configs/installer/scripts/debld_32/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/debld_32/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/debld_32/07grub-config b/iso_configs/installer/scripts/debld_32/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/debld_32/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/debld_32/07update-system b/iso_configs/installer/scripts/debld_32/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/debld_32/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/debld_64/06copy-files-to-cdrom b/iso_configs/installer/scripts/debld_64/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/debld_64/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/debld_64/07grub-config b/iso_configs/installer/scripts/debld_64/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/debld_64/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/debld_64/07update-system b/iso_configs/installer/scripts/debld_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/debld_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/debmin_32/06copy-files-to-target b/iso_configs/installer/scripts/debmin_32/06copy-files-to-target new file mode 100755 index 00000000..d1dea05d --- /dev/null +++ b/iso_configs/installer/scripts/debmin_32/06copy-files-to-target @@ -0,0 +1,71 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# setup a folder structure +mkdir -p /target/etc/skel/.local/share/pmostools +mkdir -p /target/etc/skel/.config/autostart +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/etc/default +mkdir -p /target/etc/apt/sources.list.d +mkdir -p /target/etc/apt +mkdir -p /target/etc/apt/trusted.gpg.d +mkdir -p /target/usr/share/keyrings +mkdir -p /target/usr/share/applications +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/usr/share/polkit-1/actions +mkdir -p /target/usr/share/pixmaps +mkdir -p /target/etc/lightdm +mkdir -p /target/usr/lib/python3/dist-packages +mkdir -p /target/boot/grub + +# Copy files to the chroot directory +cp /preseed/grub/grub /target/etc/default +cp /preseed/repos/multimedia.list /target/etc/apt/sources.list.d +cp /preseed/repos/peppermint.list /target/etc/apt/sources.list.d +cp /preseed/repos/sources.list /target/etc/apt +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/peppermint-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/usr/share/keyrings +cp /preseed/keyrings/peppermint-keyring.gpg /target/usr/share/keyrings +cp /preseed/apps/* /target/usr/share/applications +cp /preseed/conf/* /target/opt/pepconf +cp /preseed/database/* /target/opt/pypep/dbpep +cp /preseed/polkit/* /target/usr/share/polkit-1/actions +cp /preseed/pixmaps/* /target/usr/share/pixmaps +cp /preseed/lightdm/* /target/etc/lightdm +cp /preseed/autostart/* /target/etc/skel/.config/autostart + +# Copy recursive files and sub-directories +cp -r /preseed/grub/themes /target/boot/grub +cp -r /preseed/protools/* /target/usr/local/bin +cp -r /preseed/py/* /target/usr/lib/python3/dist-packages +cp -r /preseed/tools/* /target/etc/skel/.local/share/pmostools + +# Run a commands in the chroot +cd /target/usr/share/python-apt/templates/ +ln -s Debian.info Peppermint.info +ln -s Debian.mirrors Peppermint.mirrors +cd /target/usr/share/distro-info/ +ln -s debian.csv peppermint.csv +cd /target/usr/share/ +ln -s icons pepicons +ln -s themes pepthemes +ln -s backgrounds pepwallpaper +chmod 777 pepicons +chmod 777 pepthemes +chmod 777 pepwallpaper + +# update gub and initramfs +chroot /target update-initramfs -u +chroot /target update-grub + + +exit 0 + diff --git a/iso_configs/installer/scripts/debmin_32/06hblock-install b/iso_configs/installer/scripts/debmin_32/06hblock-install new file mode 100755 index 00000000..ed31649a --- /dev/null +++ b/iso_configs/installer/scripts/debmin_32/06hblock-install @@ -0,0 +1,14 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# install hblock + +chroot /target curl -o /tmp/hblock 'https://raw.githubusercontent.com/hectorm/hblock/v3.4.2/hblock' +chroot /target mv /tmp/hblock /usr/local/bin/hblock +chroot /target chown 0:0 /usr/local/bin/hblock +chroot /target chmod 755 /usr/local/bin/hblock diff --git a/iso_configs/installer/scripts/debmin_32/06setup-snap-install b/iso_configs/installer/scripts/debmin_32/06setup-snap-install new file mode 100755 index 00000000..7a129730 --- /dev/null +++ b/iso_configs/installer/scripts/debmin_32/06setup-snap-install @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Workaround for using snapd on debian. Thank You - @stevesveryown and peppermint team.. +cd /target +[ ! -e /etc/skel/.local/share ] && mkdir -p /etc/skel/.local/share +[ ! -e /var/lib/snapd/desktop/applications ] && +mkdir -p /var/lib/snapd/desktop/applications && +chmod 777 /var/lib/snapd/desktop/applications +ln -s /var/lib/snapd/desktop/applications /etc/skel/.local/share/applications +ln -s snap /usr/bin/snap-store + + diff --git a/iso_configs/installer/scripts/debmin_32/07final-cleanup b/iso_configs/installer/scripts/debmin_32/07final-cleanup new file mode 100755 index 00000000..921b9199 --- /dev/null +++ b/iso_configs/installer/scripts/debmin_32/07final-cleanup @@ -0,0 +1,23 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script removes unwanted software and files after Debian installation. + +# Remove unwanted packages +chroot /target apt purge --autoremove -y \ + quassel \ + thunderbird \ + mpv \ + smtube \ + smplayer \ + audacious \ + connman \ + deluge \ + galculator \ + imagemagick \ + imagemagick-6-common \ + xterm + diff --git a/iso_configs/installer/scripts/debmin_32/07grub-config b/iso_configs/installer/scripts/debmin_32/07grub-config new file mode 100755 index 00000000..ec3902c1 --- /dev/null +++ b/iso_configs/installer/scripts/debmin_32/07grub-config @@ -0,0 +1,31 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_DISABLE_OS_PROBER=false + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/debmin_32/07rebuild-icon-caches b/iso_configs/installer/scripts/debmin_32/07rebuild-icon-caches new file mode 100755 index 00000000..8c3c5b3d --- /dev/null +++ b/iso_configs/installer/scripts/debmin_32/07rebuild-icon-caches @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) +# +#This script rebuilds the icon caches after Debian installation. + +# Rebuild the icon caches +chroot /target find /usr/share/icons -type d -exec gtk-update-icon-cache -f {} \; + diff --git a/iso_configs/installer/scripts/debmin_32/07update-system b/iso_configs/installer/scripts/debmin_32/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/debmin_32/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/debmin_64/06copy-files-to-cdrom b/iso_configs/installer/scripts/debmin_64/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/debmin_64/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/debmin_64/07grub-config b/iso_configs/installer/scripts/debmin_64/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/debmin_64/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/debmin_64/07update-system b/iso_configs/installer/scripts/debmin_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/debmin_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/debsrv_64/06copy-files-to-cdrom b/iso_configs/installer/scripts/debsrv_64/06copy-files-to-cdrom new file mode 100755 index 00000000..93a3bd5f --- /dev/null +++ b/iso_configs/installer/scripts/debsrv_64/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +echo "Copying files to chroot..." +cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +chroot /cdrom update-initramfs -u +chroot /cdrom update-grub + +exit 0 + diff --git a/iso_configs/installer/scripts/debsrv_64/07grub-config b/iso_configs/installer/scripts/debsrv_64/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/debsrv_64/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/debsrv_64/07update-system b/iso_configs/installer/scripts/debsrv_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/debsrv_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/dev_32/06copy-files-to-cdrom b/iso_configs/installer/scripts/dev_32/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/dev_32/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/dev_32/07grub-config b/iso_configs/installer/scripts/dev_32/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/dev_32/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/dev_32/07update-system b/iso_configs/installer/scripts/dev_32/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/dev_32/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/dev_64/06copy-files-to-cdrom b/iso_configs/installer/scripts/dev_64/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/dev_64/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/dev_64/07grub-config b/iso_configs/installer/scripts/dev_64/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/dev_64/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/dev_64/07update-system b/iso_configs/installer/scripts/dev_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/dev_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/dev_arm/06copy-files-to-cdrom b/iso_configs/installer/scripts/dev_arm/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/dev_arm/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/dev_arm/07grub-config b/iso_configs/installer/scripts/dev_arm/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/dev_arm/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/dev_arm/07update-system b/iso_configs/installer/scripts/dev_arm/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/dev_arm/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/devld_32/06copy-files-to-cdrom b/iso_configs/installer/scripts/devld_32/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/devld_32/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/devld_32/07grub-config b/iso_configs/installer/scripts/devld_32/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/devld_32/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/devld_32/07update-system b/iso_configs/installer/scripts/devld_32/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/devld_32/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/devld_64/06copy-files-to-cdrom b/iso_configs/installer/scripts/devld_64/06copy-files-to-cdrom new file mode 100755 index 00000000..a1fc3189 --- /dev/null +++ b/iso_configs/installer/scripts/devld_64/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +#echo "Copying files to chroot..." +#cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +#chroot /cdrom update-initramfs -u +#chroot /cdrom update-grub + +#exit 0 + diff --git a/iso_configs/installer/scripts/devld_64/07grub-config b/iso_configs/installer/scripts/devld_64/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/devld_64/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/devld_64/07update-system b/iso_configs/installer/scripts/devld_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/devld_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/devmin_32/06copy-files-to-target b/iso_configs/installer/scripts/devmin_32/06copy-files-to-target new file mode 100755 index 00000000..efeb2220 --- /dev/null +++ b/iso_configs/installer/scripts/devmin_32/06copy-files-to-target @@ -0,0 +1,72 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# setup a folder structure +mkdir -p /target/etc/skel/.local/share/pmostools +mkdir -p /target/etc/skel/.config/autostart +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/etc/default +mkdir -p /target/etc/apt/sources.list.d +mkdir -p /target/etc/apt +mkdir -p /target/etc/apt/trusted.gpg.d +mkdir -p /target/usr/share/keyrings +mkdir -p /target/usr/share/applications +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/usr/share/polkit-1/actions +mkdir -p /target/usr/share/pixmaps +mkdir -p /target/etc/lightdm +mkdir -p /target/usr/lib/python3/dist-packages +mkdir -p /target/boot/grub +mkdir -p /target/usr/share/python-apt/templates + +# Copy files to the chroot directory +cp /preseed/grub/grub /target/etc/default +cp /preseed/repos/multimedia.list /target/etc/apt/sources.list.d +cp /preseed/repos/peppermint.list /target/etc/apt/sources.list.d +cp /preseed/repos/sources.list /target/etc/apt +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/peppermint-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/usr/share/keyrings +cp /preseed/keyrings/peppermint-keyring.gpg /target/usr/share/keyrings +cp /preseed/apps/* /target/usr/share/applications +cp /preseed/conf/* /target/opt/pepconf +cp /preseed/database/* /target/opt/pypep/dbpep +cp /preseed/polkit/* /target/usr/share/polkit-1/actions +cp /preseed/pixmaps/* /target/usr/share/pixmaps +cp /preseed/lightdm/* /target/etc/lightdm +cp /preseed/autostart/* /target/etc/skel/.config/autostart +cp /preseed/info/* /target/usr/share/python-apt/templates + +# Copy recursive files and sub-directories +cp -r /preseed/grub/themes /target/boot/grub +cp -r /preseed/protools/* /target/usr/local/bin +cp -r /preseed/py/* /target/usr/lib/python3/dist-packages +cp -r /preseed/tools/* /target/etc/skel/.local/share/pmostools + +# Run a commands in the chroot +cd /target/usr/share/python-apt/templates/ +ln -s Devuan.info Peppermint.info +ln -s Devuan.mirrors Peppermint.mirrors +cd /target/usr/share/distro-info/ +ln -s devuan.csv peppermint.csv +cd /target/usr/share/ +ln -s icons pepicons +ln -s themes pepthemes +ln -s backgrounds pepwallpaper +chmod 777 pepicons +chmod 777 pepthemes +chmod 777 pepwallpaper + +# update gub and initramfs +chroot /target update-initramfs -u +chroot /target update-grub + +exit 0 + diff --git a/iso_configs/installer/scripts/devmin_32/06hblock-install b/iso_configs/installer/scripts/devmin_32/06hblock-install new file mode 100755 index 00000000..ed31649a --- /dev/null +++ b/iso_configs/installer/scripts/devmin_32/06hblock-install @@ -0,0 +1,14 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# install hblock + +chroot /target curl -o /tmp/hblock 'https://raw.githubusercontent.com/hectorm/hblock/v3.4.2/hblock' +chroot /target mv /tmp/hblock /usr/local/bin/hblock +chroot /target chown 0:0 /usr/local/bin/hblock +chroot /target chmod 755 /usr/local/bin/hblock diff --git a/iso_configs/installer/scripts/devmin_32/07final-cleanup b/iso_configs/installer/scripts/devmin_32/07final-cleanup new file mode 100755 index 00000000..721019e8 --- /dev/null +++ b/iso_configs/installer/scripts/devmin_32/07final-cleanup @@ -0,0 +1,23 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script removes unwanted software and files after Debian installation. + +# Remove unwanted packages +chroot /target apt purge --autoremove -y \ + quassel \ + thunderbird \ + mpv \ + smtube \ + smplayer \ + audacious \ + connman \ + deluge \ + galculator \ + raspi-firmware \ + imagemagick \ + imagemagick-6-common \ + xterm diff --git a/iso_configs/installer/scripts/devmin_32/07grub-config b/iso_configs/installer/scripts/devmin_32/07grub-config new file mode 100755 index 00000000..ec3902c1 --- /dev/null +++ b/iso_configs/installer/scripts/devmin_32/07grub-config @@ -0,0 +1,31 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_DISABLE_OS_PROBER=false + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/devmin_32/07rebuild-icon-caches b/iso_configs/installer/scripts/devmin_32/07rebuild-icon-caches new file mode 100755 index 00000000..8c3c5b3d --- /dev/null +++ b/iso_configs/installer/scripts/devmin_32/07rebuild-icon-caches @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) +# +#This script rebuilds the icon caches after Debian installation. + +# Rebuild the icon caches +chroot /target find /usr/share/icons -type d -exec gtk-update-icon-cache -f {} \; + diff --git a/iso_configs/installer/scripts/devmin_32/07update-system b/iso_configs/installer/scripts/devmin_32/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/devmin_32/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/devmin_64/06copy-files-to-target b/iso_configs/installer/scripts/devmin_64/06copy-files-to-target new file mode 100755 index 00000000..efeb2220 --- /dev/null +++ b/iso_configs/installer/scripts/devmin_64/06copy-files-to-target @@ -0,0 +1,72 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# setup a folder structure +mkdir -p /target/etc/skel/.local/share/pmostools +mkdir -p /target/etc/skel/.config/autostart +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/etc/default +mkdir -p /target/etc/apt/sources.list.d +mkdir -p /target/etc/apt +mkdir -p /target/etc/apt/trusted.gpg.d +mkdir -p /target/usr/share/keyrings +mkdir -p /target/usr/share/applications +mkdir -p /target/opt/pepconf +mkdir -p /target/opt/pypep/dbpep +mkdir -p /target/usr/share/polkit-1/actions +mkdir -p /target/usr/share/pixmaps +mkdir -p /target/etc/lightdm +mkdir -p /target/usr/lib/python3/dist-packages +mkdir -p /target/boot/grub +mkdir -p /target/usr/share/python-apt/templates + +# Copy files to the chroot directory +cp /preseed/grub/grub /target/etc/default +cp /preseed/repos/multimedia.list /target/etc/apt/sources.list.d +cp /preseed/repos/peppermint.list /target/etc/apt/sources.list.d +cp /preseed/repos/sources.list /target/etc/apt +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/peppermint-keyring.gpg /target/etc/apt/trusted.gpg.d +cp /preseed/keyrings/deb-multimedia-keyring.gpg /target/usr/share/keyrings +cp /preseed/keyrings/peppermint-keyring.gpg /target/usr/share/keyrings +cp /preseed/apps/* /target/usr/share/applications +cp /preseed/conf/* /target/opt/pepconf +cp /preseed/database/* /target/opt/pypep/dbpep +cp /preseed/polkit/* /target/usr/share/polkit-1/actions +cp /preseed/pixmaps/* /target/usr/share/pixmaps +cp /preseed/lightdm/* /target/etc/lightdm +cp /preseed/autostart/* /target/etc/skel/.config/autostart +cp /preseed/info/* /target/usr/share/python-apt/templates + +# Copy recursive files and sub-directories +cp -r /preseed/grub/themes /target/boot/grub +cp -r /preseed/protools/* /target/usr/local/bin +cp -r /preseed/py/* /target/usr/lib/python3/dist-packages +cp -r /preseed/tools/* /target/etc/skel/.local/share/pmostools + +# Run a commands in the chroot +cd /target/usr/share/python-apt/templates/ +ln -s Devuan.info Peppermint.info +ln -s Devuan.mirrors Peppermint.mirrors +cd /target/usr/share/distro-info/ +ln -s devuan.csv peppermint.csv +cd /target/usr/share/ +ln -s icons pepicons +ln -s themes pepthemes +ln -s backgrounds pepwallpaper +chmod 777 pepicons +chmod 777 pepthemes +chmod 777 pepwallpaper + +# update gub and initramfs +chroot /target update-initramfs -u +chroot /target update-grub + +exit 0 + diff --git a/iso_configs/installer/scripts/devmin_64/06hblock-install b/iso_configs/installer/scripts/devmin_64/06hblock-install new file mode 100755 index 00000000..ed31649a --- /dev/null +++ b/iso_configs/installer/scripts/devmin_64/06hblock-install @@ -0,0 +1,14 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# install hblock + +chroot /target curl -o /tmp/hblock 'https://raw.githubusercontent.com/hectorm/hblock/v3.4.2/hblock' +chroot /target mv /tmp/hblock /usr/local/bin/hblock +chroot /target chown 0:0 /usr/local/bin/hblock +chroot /target chmod 755 /usr/local/bin/hblock diff --git a/iso_configs/installer/scripts/devmin_64/07final-cleanup b/iso_configs/installer/scripts/devmin_64/07final-cleanup new file mode 100755 index 00000000..721019e8 --- /dev/null +++ b/iso_configs/installer/scripts/devmin_64/07final-cleanup @@ -0,0 +1,23 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script removes unwanted software and files after Debian installation. + +# Remove unwanted packages +chroot /target apt purge --autoremove -y \ + quassel \ + thunderbird \ + mpv \ + smtube \ + smplayer \ + audacious \ + connman \ + deluge \ + galculator \ + raspi-firmware \ + imagemagick \ + imagemagick-6-common \ + xterm diff --git a/iso_configs/installer/scripts/devmin_64/07grub-config b/iso_configs/installer/scripts/devmin_64/07grub-config new file mode 100755 index 00000000..ec3902c1 --- /dev/null +++ b/iso_configs/installer/scripts/devmin_64/07grub-config @@ -0,0 +1,31 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_DISABLE_OS_PROBER=false + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/devmin_64/07rebuild-icon-caches b/iso_configs/installer/scripts/devmin_64/07rebuild-icon-caches new file mode 100755 index 00000000..8c3c5b3d --- /dev/null +++ b/iso_configs/installer/scripts/devmin_64/07rebuild-icon-caches @@ -0,0 +1,11 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) +# +#This script rebuilds the icon caches after Debian installation. + +# Rebuild the icon caches +chroot /target find /usr/share/icons -type d -exec gtk-update-icon-cache -f {} \; + diff --git a/iso_configs/installer/scripts/devmin_64/07update-system b/iso_configs/installer/scripts/devmin_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/devmin_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 + diff --git a/iso_configs/installer/scripts/devsrv_64/06copy-files-to-cdrom b/iso_configs/installer/scripts/devsrv_64/06copy-files-to-cdrom new file mode 100755 index 00000000..93a3bd5f --- /dev/null +++ b/iso_configs/installer/scripts/devsrv_64/06copy-files-to-cdrom @@ -0,0 +1,18 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me) + +# This script copies a file to the chroot and runs commands during the Debian installation process. + +# Copy files to the chroot directory +echo "Copying files to chroot..." +cp /preseed/grub/grub /cdrom/etc/default + +# update grub and initramfs +chroot /cdrom update-initramfs -u +chroot /cdrom update-grub + +exit 0 + diff --git a/iso_configs/installer/scripts/devsrv_64/07grub-config b/iso_configs/installer/scripts/devsrv_64/07grub-config new file mode 100755 index 00000000..405e9181 --- /dev/null +++ b/iso_configs/installer/scripts/devsrv_64/07grub-config @@ -0,0 +1,39 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script configures grub defaults after Debian installation. + +# Defines the variables +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="Peppermint" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +GRUB_GFXMODE=1360x768 +GRUB_THEME="/boot/grub/themes/peppermint/theme.txt" +GRUB_DISABLE_OS_PROBER=false + + +# GRUB configuration file path +GRUB_CONFIG_FILE="/target/etc/default/grub" + +# Modify the GRUB file +sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=$GRUB_DEFAULT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=$GRUB_TIMEOUT/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$GRUB_DISTRIBUTOR\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"$GRUB_CMDLINE_LINUX_DEFAULT\"/" $GRUB_CONFIG_FILE +sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"$GRUB_CMDLINE_LINUX\"/" $GRUB_CONFIG_FILE +sed -i "s/^#GRUB_GFXMODE=.*/GRUB_GFXMODE=$GRUB_GFXMODE/" $GRUB_CONFIG_FILE +# Add GRUB_THEME if it doesn't exist +if ! grep -q "^GRUB_THEME=" $GRUB_CONFIG_FILE; then + echo "GRUB_THEME=\"$GRUB_THEME\"" >> $GRUB_CONFIG_FILE +else + sed -i "s#^GRUB_THEME=.*#GRUB_THEME=\"$GRUB_THEME\"#" $GRUB_CONFIG_FILE +fi +sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=$GRUB_DISABLE_OS_PROBER/" $GRUB_CONFIG_FILE + +# Run update-grub after modifying the file +chroot /target update-grub diff --git a/iso_configs/installer/scripts/devsrv_64/07update-system b/iso_configs/installer/scripts/devsrv_64/07update-system new file mode 100755 index 00000000..23a6e1ad --- /dev/null +++ b/iso_configs/installer/scripts/devsrv_64/07update-system @@ -0,0 +1,28 @@ +#!/bin/sh -e + +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 PeppermintOS Team (peppermintosteam@proton.me) + +# This script updates the system after Debian installation. + +# Update the system +if ! chroot /target apt update; then + echo "Failed to update package lists. Aborting." >&2 + exit 1 +fi + +# Upgrade the system +if ! chroot /target apt upgrade -y; then + echo "Failed to upgrade packages. Aborting." >&2 + exit 1 +fi + +# Clean up unnecessary packages +if ! chroot /target apt autoremove -y; then + echo "Failed to remove unnecessary packages. Continuing anyway." >&2 +fi + +echo "System update completed successfully." +exit 0 +