commit 5433d237e9535dac9fa57322a79b871fffeec61f Author: oxmc7769 Date: Tue Mar 25 14:03:19 2025 -0700 base diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..aff5967 --- /dev/null +++ b/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Path to the package root directory +PKG_DIR="./chillcraftos-default-settings" + +# Calculate installed size in KB +PKG_SIZE=$(du -sk "$PKG_DIR" | cut -f1) + +# Update control file +sed -i "s/Installed-Size: INSTSIZE/Installed-Size: $PKG_SIZE/" "$PKG_DIR/DEBIAN/control" + +# Build the .deb package +dpkg-deb --build "$PKG_DIR" ../chillcraftos-default-settings.deb + +echo "Package built with Installed-Size: $PKG_SIZE KB" diff --git a/chillcraftos-default-settings/DEBIAN/control b/chillcraftos-default-settings/DEBIAN/control new file mode 100644 index 0000000..d82f8be --- /dev/null +++ b/chillcraftos-default-settings/DEBIAN/control @@ -0,0 +1,12 @@ +Package: chillcraftos-default-settings +Version: 1.0 +Maintainer: Seth Olivarez +Section: metapackages +Priority: required +Architecture: all +Depends: base-files (>= 10) +Replaces: base-files (>= 10) +Breaks: base-files (<< 10) +Installed-Size: 212 +Description: Default settings for ChillcraftOS + This package contains the default settings and files for ChillcraftOS. diff --git a/chillcraftos-default-settings/DEBIAN/postinst b/chillcraftos-default-settings/DEBIAN/postinst new file mode 100755 index 0000000..0fafe28 --- /dev/null +++ b/chillcraftos-default-settings/DEBIAN/postinst @@ -0,0 +1,57 @@ +#!/bin/bash +set -e + +# List of system identity files to divert +identity_files=( + "/etc/os-release" + "/etc/issue" + "/etc/issue.net" +) + +echo "Diverting and replacing system identity files..." + +for file in "${identity_files[@]}"; do + if [ -f "$file" ]; then + dpkg-divert --add --rename --divert "${file}.diverted" "$file" + ln -sf "/etc/chillcraft/$(basename "$file")" "$file" + fi +done + +# Set the Vendor-recommended default mirror using apt-manage +#echo "Setting the Vendor-recommended default mirror..." +#apt-manage modify system --default-mirror "http://cdn.oxmc.me/apt" + +# Ensure custom logo exists +cp /etc/chillcraft/chillcraft.png /usr/share/pixmaps/chillcraft.png + +# List of Debian branding images to divert +branding_files=( + "/usr/share/plymouth/themes/debian-logo.png" + "/usr/share/pixmaps/debian-logo.png" + "/usr/share/icons/hicolor/256x256/apps/debian-logo.png" + "/usr/share/icons/hicolor/128x128/apps/debian-logo.png" + "/usr/share/icons/hicolor/64x64/apps/debian-logo.png" + "/usr/share/icons/hicolor/48x48/apps/debian-logo.png" + "/usr/share/icons/hicolor/32x32/apps/debian-logo.png" + "/usr/share/icons/hicolor/16x16/apps/debian-logo.png" + "/usr/share/desktop-base/active-theme/grub/grub-background.png" +) + +echo "Diverting and replacing Debian branding images..." + +for file in "${branding_files[@]}"; do + if [ -f "$file" ]; then + dpkg-divert --add --rename --divert "${file}.diverted" "$file" + ln -sf /usr/share/pixmaps/chillcraft.png "$file" + fi +done + +# Update the initramfs +echo "Updating initramfs..." +update-initramfs -u || true + +# Update the icon cache +echo "Updating icon cache..." +gtk-update-icon-cache /usr/share/icons/hicolor/ + +exit 0 diff --git a/chillcraftos-default-settings/DEBIAN/prerm b/chillcraftos-default-settings/DEBIAN/prerm new file mode 100755 index 0000000..6b1da06 --- /dev/null +++ b/chillcraftos-default-settings/DEBIAN/prerm @@ -0,0 +1,58 @@ +#!/bin/bash +set -e + +# List of system identity files to restore +identity_files=( + "/etc/os-release" + "/etc/issue" + "/etc/issue.net" +) + +echo "Restoring system identity files..." + +for file in "${identity_files[@]}"; do + if [ -f "${file}.diverted" ]; then + mv "${file}.diverted" "$file" + dpkg-divert --rename --remove "$file" + fi +done + +# Remove the custom mirror configuration +#echo "Removing Vendor-recommended mirror..." +#apt-manage modify system --default-mirror "" + +# Remove the custom logo +echo "Removing custom logo..." +rm -f /usr/share/pixmaps/chillcraft.png + +# List of Debian branding images to restore +branding_files=( + "/usr/share/plymouth/themes/debian-logo.png" + "/usr/share/pixmaps/debian-logo.png" + "/usr/share/icons/hicolor/256x256/apps/debian-logo.png" + "/usr/share/icons/hicolor/128x128/apps/debian-logo.png" + "/usr/share/icons/hicolor/64x64/apps/debian-logo.png" + "/usr/share/icons/hicolor/48x48/apps/debian-logo.png" + "/usr/share/icons/hicolor/32x32/apps/debian-logo.png" + "/usr/share/icons/hicolor/16x16/apps/debian-logo.png" + "/usr/share/desktop-base/active-theme/grub/grub-background.png" +) + +echo "Restoring Debian branding images..." + +for file in "${branding_files[@]}"; do + if [ -f "${file}.diverted" ]; then + mv "${file}.diverted" "$file" + dpkg-divert --rename --remove "$file" + fi +done + +# Update the initramfs +echo "Updating initramfs..." +update-initramfs -u || true + +# Update the icon cache +echo "Updating icon cache..." +gtk-update-icon-cache /usr/share/icons/hicolor/ + +exit 0 diff --git a/chillcraftos-default-settings/etc/chillcraft/chillcraft.png b/chillcraftos-default-settings/etc/chillcraft/chillcraft.png new file mode 100644 index 0000000..353cc98 Binary files /dev/null and b/chillcraftos-default-settings/etc/chillcraft/chillcraft.png differ diff --git a/chillcraftos-default-settings/etc/chillcraft/os-release b/chillcraftos-default-settings/etc/chillcraft/os-release new file mode 100644 index 0000000..ebfd8cc --- /dev/null +++ b/chillcraftos-default-settings/etc/chillcraft/os-release @@ -0,0 +1,10 @@ +PRETTY_NAME="ChillcraftOS (bonfire)" +NAME="Debian GNU/Linux" +VERSION_ID="16.4" +VERSION="12 (bookworm)" +VERSION_CODENAME=bookworm +ID=debian +ID_LIKE="debian" +HOME_URL="https://www.debian.org/" +SUPPORT_URL="https://www.debian.org/support" +BUG_REPORT_URL="https://bugs.debian.org/"