Skip to content

Commit b13da0a

Browse files
authored
Move bootloader selection in calamares module (#76)
1 parent e556dad commit b13da0a

2 files changed

Lines changed: 8 additions & 65 deletions

File tree

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
Main() {
3+
main() {
44
# Remove current keyring first, to complete initiate it
55
sudo rm -rf /etc/pacman.d/gnupg
66
# We are using this, because archlinux is signing the keyring often with a newly created keyring
@@ -21,87 +21,31 @@ Main() {
2121
local log="/home/liveuser/cachy-install.log"
2222
local mode="online" # TODO: keep this line for now
2323

24-
local _efi_check_dir="/sys/firmware/efi"
25-
local _exitcode=2 # by default use grub
26-
2724
local SYSTEM=""
28-
local BOOTLOADER=""
29-
if [ -d "${_efi_check_dir}" ]; then
25+
26+
if [ -d /sys/firmware/efi ]; then
3027
SYSTEM="UEFI SYSTEM"
31-
_exitcode=$(yad --width 300 --title "Bootloader" \
32-
--image=gnome-shutdown \
33-
--button="Grub:2" \
34-
--button="Systemd-boot(Default):3" \
35-
--button="Refind:4" \
36-
--button="AI SDK / Refind:5" \
37-
--button="Limine:6" \
38-
--text "Choose Bootloader/Edition:" ; echo $?)
3928
else
4029
SYSTEM="BIOS/MBR SYSTEM"
41-
_exitcode=$(yad --width 300 --title "Bootloader" \
42-
--image=gnome-shutdown \
43-
--button="Grub:2" \
44-
--button="Limine:6" \
45-
--text "Choose Bootloader/Edition:" ; echo $?)
4630
fi
4731

4832
local ISO_VERSION="$(cat /etc/version-tag)"
4933
echo "USING ISO VERSION: ${ISO_VERSION}"
5034

51-
if [[ "${_exitcode}" -eq 2 ]]; then
52-
BOOTLOADER="GRUB"
53-
echo "USING GRUB!"
54-
yes | sudo pacman -R cachyos-calamares-qt6-next-systemd
55-
yes | sudo pacman -R cachyos-calamares-qt6-next-grub
56-
yes | sudo pacman -R cachyos-calamares-qt6-next-refind
57-
yes | sudo pacman -R cachyos-calamares-qt6-next-limine
58-
yes | sudo pacman -Sy cachyos-calamares-qt6-next-grub
59-
elif [[ "${_exitcode}" -eq 3 ]]; then
60-
BOOTLOADER="SYSTEMD-BOOT"
61-
echo "USING SYSTEMD-BOOT!"
62-
yes | sudo pacman -R cachyos-calamares-qt6-next-grub
63-
yes | sudo pacman -R cachyos-calamares-qt6-next-refind
64-
yes | sudo pacman -R cachyos-calamares-qt6-next-limine
65-
yes | sudo pacman -Sy cachyos-calamares-qt6-next-systemd
66-
elif [[ "${_exitcode}" -eq 4 ]]; then
67-
BOOTLOADER="REFIND"
68-
echo "USING REFIND!"
69-
yes | sudo pacman -R cachyos-calamares-qt6-next-grub
70-
yes | sudo pacman -R cachyos-calamares-qt6-next-systemd
71-
yes | sudo pacman -R cachyos-calamares-qt6-next-limine
72-
yes | sudo pacman -Sy cachyos-calamares-qt6-next-refind
73-
elif [[ "${_exitcode}" -eq 5 ]]; then
74-
BOOTLOADER="AI-SDK/Refind"
75-
echo "USING AI SDK and Refind!"
76-
yes | sudo pacman -R cachyos-calamares-qt6-next-grub
77-
yes | sudo pacman -R cachyos-calamares-qt6-next-systemd
78-
yes | sudo pacman -R cachyos-calamares-qt6-next-refind
79-
yes | sudo pacman -R cachyos-calamares-qt6-next-limine
80-
yes | sudo pacman -Sy cachyos-calamares-qt6-next-ai
81-
elif [[ "${_exitcode}" -eq 6 ]]; then
82-
BOOTLOADER="Limine"
83-
echo "USING Limine"
84-
yes | sudo pacman -R cachyos-calamares-qt6-next-grub
85-
yes | sudo pacman -R cachyos-calamares-qt6-next-systemd
86-
yes | sudo pacman -R cachyos-calamares-qt6-next-refind
87-
yes | sudo pacman -Sy cachyos-calamares-qt6-next-limine
88-
else
89-
exit
90-
fi
35+
sudo pacman -Sy --noconfirm cachyos-calamares-next
9136

9237
# Get Hardware Informations
93-
inxi -F > $log
38+
inxi -F > "$log"
9439

95-
cat <<EOF >> $log
40+
cat <<EOF >> "$log"
9641
########## $log by $progname
9742
########## Started (UTC): $(date -u "+%x %X")
9843
########## ISO version: $ISO_VERSION
9944
########## System: $SYSTEM
100-
########## Bootloader: $BOOTLOADER
10145
EOF
10246

10347
sudo cp "/usr/share/calamares/settings_${mode}.conf" /etc/calamares/settings.conf
10448
sudo -E dbus-launch calamares -D6 >> $log &
10549
}
10650

107-
Main "$@"
51+
main "$@"

archiso/packages_desktop.x86_64

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ breeze-gtk
1414
brltty
1515
btrfs-progs
1616
cachy-chroot
17-
cachyos-calamares-qt6-next-grub
17+
cachyos-calamares-next
1818
cachyos-cli-installer-new
1919
cachyos-fish-config
2020
cachyos-hello
@@ -209,5 +209,4 @@ xorg-xinit
209209
xorg-xkill
210210
xorg-xrandr
211211
xorg-xrdb
212-
yad
213212
zfs-utils

0 commit comments

Comments
 (0)