simplify code

This commit is contained in:
Tobias Powalowski 2024-04-10 14:09:28 +02:00
parent 27b4369120
commit 02a266d10f
2 changed files with 7 additions and 5 deletions

View file

@ -18,8 +18,8 @@ _limine_config() {
PROTOCOL=linux PROTOCOL=linux
KERNEL_PATH=boot://${_PARTN}/${_VMLINUZ} KERNEL_PATH=boot://${_PARTN}/${_VMLINUZ}
CMDLINE=${_KERNEL_PARAMS_MOD} CMDLINE=${_KERNEL_PARAMS_MOD}
MODULE_PATH=boot://${_PARTN}/${_INITRAMFS}
CONFEOF CONFEOF
echo "MODULE_PATH=boot://${_PARTN}/${_INITRAMFS}" >> "${_LIMINE_CONFIG}"
## Edit limine.cfg config file ## Edit limine.cfg config file
_dialog --msgbox "You will now be put into the editor to edit:\nlimine.cfg\n\nAfter you save your changes, exit the editor." 8 50 _dialog --msgbox "You will now be put into the editor to edit:\nlimine.cfg\n\nAfter you save your changes, exit the editor." 8 50
_geteditor || return 1 _geteditor || return 1

View file

@ -5,13 +5,15 @@ _systemd_boot_uefi() {
_dialog --no-mouse --infobox "Setting up SYSTEMD-BOOT now..." 3 40 _dialog --no-mouse --infobox "Setting up SYSTEMD-BOOT now..." 3 40
# create directory structure, if it doesn't exist # create directory structure, if it doesn't exist
[[ -d "${_DESTDIR}/boot/loader/entries" ]] || mkdir -p "${_DESTDIR}/boot/loader/entries" [[ -d "${_DESTDIR}/boot/loader/entries" ]] || mkdir -p "${_DESTDIR}/boot/loader/entries"
cat << BOOTDEOF >> "${_DESTDIR}/boot/loader/entries/archlinux-core-main.conf" _MAIN_CFG="boot/loader/entries/archlinux-core-main.conf"
_LOADER_CFG="boot/loader/loader.conf"
cat << BOOTDEOF >> "${_DESTDIR}/${_MAIN_CFG}"
title Arch Linux title Arch Linux
linux /${_VMLINUZ} linux /${_VMLINUZ}
initrd /${_INITRAMFS} initrd /${_INITRAMFS}
options ${_KERNEL_PARAMS_MOD} options ${_KERNEL_PARAMS_MOD}
BOOTDEOF BOOTDEOF
cat << BOOTDEOF > "${_DESTDIR}/boot/loader/loader.conf" cat << BOOTDEOF > "${_DESTDIR}/${_LOADER_CFG}"
timeout 5 timeout 5
default archlinux-core-main default archlinux-core-main
BOOTDEOF BOOTDEOF
@ -37,8 +39,8 @@ BOOTDEOF
sleep 2 sleep 2
_dialog --msgbox "You will now be put into the editor to edit:\nloader.conf and menu entry files\n\nAfter you save your changes, exit the editor." 8 50 _dialog --msgbox "You will now be put into the editor to edit:\nloader.conf and menu entry files\n\nAfter you save your changes, exit the editor." 8 50
_geteditor || return 1 _geteditor || return 1
"${_EDITOR}" "${_DESTDIR}/boot/loader/entries/archlinux-core-main.conf" "${_EDITOR}" "${_DESTDIR}/${_MAIN_CFG}"
"${_EDITOR}" "${_DESTDIR}/boot/loader/loader.conf" "${_EDITOR}" "${_DESTDIR}/${_LOADER_CFG}"
_pacman_hook_systemd_bootd _pacman_hook_systemd_bootd
_dialog --title " Success " --no-mouse --infobox "SYSTEMD-BOOT has been setup successfully." 3 50 _dialog --title " Success " --no-mouse --infobox "SYSTEMD-BOOT has been setup successfully." 3 50
sleep 3 sleep 3