First Commit
This commit is contained in:
39
helpers/calamares-bootloader-config
Executable file
39
helpers/calamares-bootloader-config
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g")
|
||||
|
||||
# Install luks utilities if needed.
|
||||
# Also, set secure permissions for the initramfs if we're configuring
|
||||
# full-disk-encryption. The initramfs is re-generated later in the
|
||||
# installation process so we only set the permissions snippet without
|
||||
# regenerating the initramfs right now:
|
||||
if [ "$(mount | grep $CHROOT" " | cut -c -16)" = "/dev/mapper/luks" ]; then
|
||||
echo "UMASK=0077" > $CHROOT/etc/initramfs-tools/conf.d/initramfs-permissions
|
||||
chroot $CHROOT apt-get -y install cryptsetup-initramfs cryptsetup keyutils
|
||||
fi
|
||||
|
||||
echo "Running bootloader-config..."
|
||||
|
||||
if [ -d /sys/firmware/efi/efivars ]; then
|
||||
echo " * Installing grub-efi (uefi)..."
|
||||
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-efi
|
||||
else
|
||||
echo " * install grub... (bios)"
|
||||
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-pc
|
||||
fi
|
||||
|
||||
# Re-enable os-prober:
|
||||
sed -i "s/#GRUB_DISABLE_OS_PROBER=false/# OS_PROBER re-enabled by RakuOS Calamares installation:\nGRUB_DISABLE_OS_PROBER=false/g" $CHROOT/etc/default/grub
|
||||
chroot $CHROOT /usr/sbin/update-grub
|
||||
# Detect filesystem type of the installed system
|
||||
FS_TYPE=$(findmnt -n -o FSTYPE "$CHROOT" || true)
|
||||
|
||||
echo "Filesystem detected inside chroot: $FS_TYPE"
|
||||
|
||||
# Btrfs = Default path, keep grub-btrfs / snapper
|
||||
if [ "$FS_TYPE" = "btrfs" ]; then
|
||||
echo " * Btrfs detected → leaving grub-btrfs + snapper installed"
|
||||
else
|
||||
echo " * Non-Btrfs filesystem detected → removing grub-btrfs + snapper"
|
||||
chroot "$CHROOT" apt-get -y purge grub-btrfs snapper btrfs-assistant 2>/dev/null || true
|
||||
fi
|
||||
13
helpers/calamares-dpkg-unsafe-io
Executable file
13
helpers/calamares-dpkg-unsafe-io
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g")
|
||||
|
||||
if [ "$1" = "-u" ]; then
|
||||
rm $CHROOT/etc/dpkg/dpkg.cfg.d/calamares-force-unsafe-io
|
||||
sync
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "force-unsafe-io" > $CHROOT/etc/dpkg/dpkg.cfg.d/calamares-force-unsafe-io
|
||||
|
||||
exit 0
|
||||
36
helpers/calamares-sources-final
Executable file
36
helpers/calamares-sources-final
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Writes the final sources.list file
|
||||
#
|
||||
|
||||
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g")
|
||||
RELEASE="sid"
|
||||
|
||||
rm $CHROOT/etc/apt/sources.list
|
||||
rm $CHROOT/etc/apt/sources.list.d/rakuos.list
|
||||
cat << EOF > $CHROOT/etc/apt/sources.list.d/rakuos.sources
|
||||
#RakuOS
|
||||
Types: deb
|
||||
URIs: https://repo.rakuos.org/rakuos
|
||||
Suites: rakuos
|
||||
Components: main contrib non-free
|
||||
Signed-By: /usr/share/keyrings/rakuos-archive-keyring.gpg
|
||||
|
||||
# Debian upstream
|
||||
Types: deb
|
||||
URIs: http://repo.rakuos.org/upstream/
|
||||
Suites: sid
|
||||
Components: main contrib non-free non-free-firmware
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
#XanMod
|
||||
Types: deb
|
||||
URIs: http://deb.xanmod.org/
|
||||
Suites: sid
|
||||
Components: main
|
||||
Signed-By: /usr/share/keyrings/xanmod-archive-keyring.gpg
|
||||
EOF
|
||||
rm -rf $CHROOT/live
|
||||
rm $CHROOT/etc/resolv.conf
|
||||
ln -sf /run/systemd/resolve/stub-resolv.conf $CHROOT/etc/resolv.conf
|
||||
exit 0
|
||||
33
helpers/calamares-sources-media
Executable file
33
helpers/calamares-sources-media
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g")
|
||||
KNOWN_MEDIUM_PATHS="/run/live/medium /run/initramfs/live"
|
||||
RELEASE="trixie"
|
||||
|
||||
# Support both dracut and initramfs configurations to avoid substitutions
|
||||
# in live-build, see: #1089618
|
||||
for path in $KNOWN_MEDIUM_PATHS; do
|
||||
if [ "$(mount | grep $path | cut -f3 -d" ")" = "$path" ]; then
|
||||
MEDIUM_PATH=$path
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$1" = "-u" ]; then
|
||||
umount $CHROOT/$MEDIUM_PATH
|
||||
rm $CHROOT/etc/apt/sources.list.d/debian-live-media.list
|
||||
chroot $CHROOT apt-get update
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Remove the base sources, we will configure sources in a later phase
|
||||
rm -f $CHROOT/etc/apt/sources.list.d/base.list
|
||||
|
||||
mkdir -p $CHROOT/$MEDIUM_PATH
|
||||
mount --bind $MEDIUM_PATH $CHROOT/$MEDIUM_PATH
|
||||
echo "deb [trusted=yes] file:$MEDIUM_PATH $RELEASE main" > $CHROOT/etc/apt/sources.list.d/debian-live-media.list
|
||||
chroot $CHROOT apt-get update
|
||||
# Attempt safest way to remove cruft
|
||||
rmdir $CHROOT/run/live/medium
|
||||
rmdir $CHROOT/run/live
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user