add cleanup hook to the server builds
This commit is contained in:
parent
35ae8bb1d0
commit
c6256b4897
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
|
||||||
|
|
||||||
|
### Remove unnecessary files
|
||||||
|
rm /etc/default/grub
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
|
||||||
|
|
||||||
|
### Remove unnecessary files
|
||||||
|
rm /etc/default/grub
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/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 {} \;
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/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 {} \;
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,31 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/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 {} \;
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,31 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/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 {} \;
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,28 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
|
@ -1,129 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Function to install SQLite if not installed
|
|
||||||
install_sqlite_if_needed() {
|
|
||||||
if ! dpkg -l sqlite3 > /dev/null 2>&1; then
|
|
||||||
echo "SQLite is not installed. Installing..."
|
|
||||||
if sudo apt-get install -y sqlite3; then
|
|
||||||
echo "SQLite installed successfully."
|
|
||||||
else
|
|
||||||
echo "Failed to install SQLite. Exiting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to secure SQLite installation
|
|
||||||
secure_sqlite() {
|
|
||||||
echo "SQLite does not require additional security configuration."
|
|
||||||
dialog --msgbox "SQLite installation secured." 10 30
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to create a SQLite database
|
|
||||||
create_sqlite_database() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" ]]; then
|
|
||||||
touch $DATABASE.db
|
|
||||||
dialog --msgbox "SQLite database '$DATABASE.db' created successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to create a table in SQLite
|
|
||||||
create_sqlite_table() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
TABLE=$(dialog --inputbox "Enter the name of the table to create in SQLite:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
|
|
||||||
sqlite3 $DATABASE.db "CREATE TABLE $TABLE (id INTEGER PRIMARY KEY);"
|
|
||||||
dialog --msgbox "Table '$TABLE' created in SQLite database '$DATABASE.db' successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to insert data into SQLite table
|
|
||||||
insert_data_into_sqlite() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
TABLE=$(dialog --inputbox "Enter the name of the SQLite table to insert data into:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
DATA=$(dialog --inputbox "Enter data to insert into SQLite table (e.g., 'value1, value2'):" 10 60 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" && -n "$TABLE" && -n "$DATA" ]]; then
|
|
||||||
sqlite3 $DATABASE.db "INSERT INTO $TABLE VALUES ($DATA);"
|
|
||||||
dialog --msgbox "Data inserted into SQLite table '$TABLE' in database '$DATABASE.db' successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to query data from SQLite table
|
|
||||||
query_data_from_sqlite() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
TABLE=$(dialog --inputbox "Enter the name of the SQLite table to query from:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
|
|
||||||
QUERY=$(dialog --inputbox "Enter SQLite query (e.g., 'SELECT * FROM $TABLE;'):" 10 60 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$QUERY" ]]; then
|
|
||||||
sqlite3 $DATABASE.db "$QUERY"
|
|
||||||
dialog --msgbox "Query executed successfully." 10 60
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to backup SQLite database
|
|
||||||
backup_sqlite_database() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database to backup:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" ]]; then
|
|
||||||
cp $DATABASE.db $DATABASE.backup.db
|
|
||||||
dialog --msgbox "SQLite database '$DATABASE.db' backed up to '$DATABASE.backup.db' successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to restore SQLite database
|
|
||||||
restore_sqlite_database() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database to restore into:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" ]]; then
|
|
||||||
FILE=$(dialog --inputbox "Enter the path to the SQLite backup file to restore:" 10 60 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -f "$FILE" ]]; then
|
|
||||||
cp $FILE $DATABASE.db
|
|
||||||
dialog --msgbox "SQLite database '$DATABASE.db' restored successfully." 10 60
|
|
||||||
else
|
|
||||||
dialog --msgbox "File not found or invalid." 10 60
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to configure SQLite
|
|
||||||
configure_sqlite() {
|
|
||||||
while true; do
|
|
||||||
CHOICE=$(dialog --clear --backtitle "Configure SQLite" \
|
|
||||||
--title "SQLite Menu" \
|
|
||||||
--menu "Choose an option:" 20 60 10 \
|
|
||||||
1 "Install/Check SQLite" \
|
|
||||||
2 "Secure SQLite Installation" \
|
|
||||||
3 "Create SQLite Database" \
|
|
||||||
4 "Create Table in SQLite" \
|
|
||||||
5 "Insert Data into SQLite Table" \
|
|
||||||
6 "Query Data from SQLite Table" \
|
|
||||||
7 "Backup SQLite Database" \
|
|
||||||
8 "Restore SQLite Database" \
|
|
||||||
9 "Return to Main Menu" \
|
|
||||||
3>&1 1>&2 2>&3 3>&-)
|
|
||||||
|
|
||||||
clear
|
|
||||||
|
|
||||||
# Check if user canceled
|
|
||||||
if [ $? -eq 1 ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $CHOICE in
|
|
||||||
1) install_sqlite_if_needed ;;
|
|
||||||
2) secure_sqlite ;;
|
|
||||||
3) create_sqlite_database ;;
|
|
||||||
4) create_sqlite_table ;;
|
|
||||||
5) insert_data_into_sqlite ;;
|
|
||||||
6) query_data_from_sqlite ;;
|
|
||||||
7) backup_sqlite_database ;;
|
|
||||||
8) restore_sqlite_database ;;
|
|
||||||
9) break ;;
|
|
||||||
*) dialog --msgbox "Invalid option." 10 30 ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show main configuration menu
|
|
||||||
configure_sqlite
|
|
||||||
|
|
|
@ -1,130 +0,0 @@
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Function to install SQLite if not installed
|
|
||||||
install_sqlite_if_needed() {
|
|
||||||
if ! dpkg -l sqlite3 > /dev/null 2>&1; then
|
|
||||||
echo "SQLite is not installed. Installing..."
|
|
||||||
if sudo apt-get install -y sqlite3; then
|
|
||||||
echo "SQLite installed successfully."
|
|
||||||
else
|
|
||||||
echo "Failed to install SQLite. Exiting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to secure SQLite installation
|
|
||||||
secure_sqlite() {
|
|
||||||
echo "SQLite does not require additional security configuration."
|
|
||||||
dialog --msgbox "SQLite installation secured." 10 30
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to create a SQLite database
|
|
||||||
create_sqlite_database() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database to create:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" ]]; then
|
|
||||||
touch $DATABASE.db
|
|
||||||
dialog --msgbox "SQLite database '$DATABASE.db' created successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to create a table in SQLite
|
|
||||||
create_sqlite_table() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
TABLE=$(dialog --inputbox "Enter the name of the table to create in SQLite:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
|
|
||||||
sqlite3 $DATABASE.db "CREATE TABLE $TABLE (id INTEGER PRIMARY KEY);"
|
|
||||||
dialog --msgbox "Table '$TABLE' created in SQLite database '$DATABASE.db' successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to insert data into SQLite table
|
|
||||||
insert_data_into_sqlite() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
TABLE=$(dialog --inputbox "Enter the name of the SQLite table to insert data into:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
DATA=$(dialog --inputbox "Enter data to insert into SQLite table (e.g., 'value1, value2'):" 10 60 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" && -n "$TABLE" && -n "$DATA" ]]; then
|
|
||||||
sqlite3 $DATABASE.db "INSERT INTO $TABLE VALUES ($DATA);"
|
|
||||||
dialog --msgbox "Data inserted into SQLite table '$TABLE' in database '$DATABASE.db' successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to query data from SQLite table
|
|
||||||
query_data_from_sqlite() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
TABLE=$(dialog --inputbox "Enter the name of the SQLite table to query from:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" && -n "$TABLE" ]]; then
|
|
||||||
QUERY=$(dialog --inputbox "Enter SQLite query (e.g., 'SELECT * FROM $TABLE;'):" 10 60 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$QUERY" ]]; then
|
|
||||||
sqlite3 $DATABASE.db "$QUERY"
|
|
||||||
dialog --msgbox "Query executed successfully." 10 60
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to backup SQLite database
|
|
||||||
backup_sqlite_database() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database to backup:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" ]]; then
|
|
||||||
cp $DATABASE.db $DATABASE.backup.db
|
|
||||||
dialog --msgbox "SQLite database '$DATABASE.db' backed up to '$DATABASE.backup.db' successfully." 10 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to restore SQLite database
|
|
||||||
restore_sqlite_database() {
|
|
||||||
DATABASE=$(dialog --inputbox "Enter the name of the SQLite database to restore into:" 10 40 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -n "$DATABASE" ]]; then
|
|
||||||
FILE=$(dialog --inputbox "Enter the path to the SQLite backup file to restore:" 10 60 3>&1 1>&2 2>&3 3>&-)
|
|
||||||
if [[ -f "$FILE" ]]; then
|
|
||||||
cp $FILE $DATABASE.db
|
|
||||||
dialog --msgbox "SQLite database '$DATABASE.db' restored successfully." 10 60
|
|
||||||
else
|
|
||||||
dialog --msgbox "File not found or invalid." 10 60
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to configure SQLite
|
|
||||||
configure_sqlite() {
|
|
||||||
while true; do
|
|
||||||
CHOICE=$(dialog --clear --backtitle "Configure SQLite" \
|
|
||||||
--title "SQLite Menu" \
|
|
||||||
--menu "Choose an option:" 20 60 10 \
|
|
||||||
1 "Install/Check SQLite" \
|
|
||||||
2 "Secure SQLite Installation" \
|
|
||||||
3 "Create SQLite Database" \
|
|
||||||
4 "Create Table in SQLite" \
|
|
||||||
5 "Insert Data into SQLite Table" \
|
|
||||||
6 "Query Data from SQLite Table" \
|
|
||||||
7 "Backup SQLite Database" \
|
|
||||||
8 "Restore SQLite Database" \
|
|
||||||
9 "Return to Main Menu" \
|
|
||||||
3>&1 1>&2 2>&3 3>&-)
|
|
||||||
|
|
||||||
clear
|
|
||||||
|
|
||||||
# Check if user canceled
|
|
||||||
if [ $? -eq 1 ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $CHOICE in
|
|
||||||
1) install_sqlite_if_needed ;;
|
|
||||||
2) secure_sqlite ;;
|
|
||||||
3) create_sqlite_database ;;
|
|
||||||
4) create_sqlite_table ;;
|
|
||||||
5) insert_data_into_sqlite ;;
|
|
||||||
6) query_data_from_sqlite ;;
|
|
||||||
7) backup_sqlite_database ;;
|
|
||||||
8) restore_sqlite_database ;;
|
|
||||||
9) break ;;
|
|
||||||
*) dialog --msgbox "Invalid option." 10 30 ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show main configuration menu
|
|
||||||
configure_sqlite
|
|
||||||
|
|
Loading…
Reference in New Issue