mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 11:30:37 +02:00
switch to mkinitcpio handling uki rebuild
This commit is contained in:
parent
769a4e1e87
commit
f73dfdd393
4 changed files with 9 additions and 33 deletions
|
@ -19,7 +19,6 @@
|
||||||
. /usr/lib/archboot/installer/bootloader_uboot.sh
|
. /usr/lib/archboot/installer/bootloader_uboot.sh
|
||||||
. /usr/lib/archboot/installer/bootloader_uki.sh
|
. /usr/lib/archboot/installer/bootloader_uki.sh
|
||||||
. /usr/lib/archboot/installer/bootloader_pacman_hooks.sh
|
. /usr/lib/archboot/installer/bootloader_pacman_hooks.sh
|
||||||
. /usr/lib/archboot/installer/bootloader_systemd_services.sh
|
|
||||||
. /usr/lib/archboot/installer/btrfs.sh
|
. /usr/lib/archboot/installer/btrfs.sh
|
||||||
. /usr/lib/archboot/installer/configuration.sh
|
. /usr/lib/archboot/installer/configuration.sh
|
||||||
. /usr/lib/archboot/installer/mountpoints.sh
|
. /usr/lib/archboot/installer/mountpoints.sh
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
|
||||||
_uki_autobuild() {
|
|
||||||
sleep 2
|
|
||||||
_progress "50" "Enable automatic UKI creation on installed system..."
|
|
||||||
cat << CONFEOF > "${_DESTDIR}/etc/systemd/system/run_ukify.path"
|
|
||||||
[Unit]
|
|
||||||
Description=Run systemd ukify
|
|
||||||
[Path]
|
|
||||||
PathChanged=/boot/${_INITRAMFS}
|
|
||||||
PathChanged=/boot/${_UCODE}
|
|
||||||
Unit=run_ukify.service
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
CONFEOF
|
|
||||||
cat << CONFEOF > "${_DESTDIR}/etc/systemd/system/run_ukify.service"
|
|
||||||
[Unit]
|
|
||||||
Description=Run systemd ukify
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart="/usr/lib/systemd/ukify build --config=/etc/ukify.conf --output ${_UEFISYS_MP}/EFI/Linux/arch-linux.efi"
|
|
||||||
CONFEOF
|
|
||||||
${_NSPAWN} systemctl enable run_ukify.path &>"${_NO_LOG}"
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||||
_uki_config() {
|
_uki_config() {
|
||||||
_UKIFY_CONFIG="${_DESTDIR}/etc/ukify.conf"
|
_UKIFY_CONFIG="${_DESTDIR}/etc/kernel/uki.conf"
|
||||||
_CMDLINE="${_DESTDIR}/etc/kernel/cmdline"
|
_CMDLINE="${_DESTDIR}/etc/kernel/cmdline"
|
||||||
echo "${_KERNEL_PARAMS_MOD}" > "${_CMDLINE}"
|
echo "${_KERNEL_PARAMS_MOD}" > "${_CMDLINE}"
|
||||||
echo "[UKI]" > "${_UKIFY_CONFIG}"
|
echo "[UKI]" > "${_UKIFY_CONFIG}"
|
||||||
|
@ -22,7 +22,6 @@ CONFEOF
|
||||||
}
|
}
|
||||||
|
|
||||||
_uki_install() {
|
_uki_install() {
|
||||||
_uki_autobuild
|
|
||||||
_BOOTMGR_LABEL="Arch Linux - Unified Kernel Image"
|
_BOOTMGR_LABEL="Arch Linux - Unified Kernel Image"
|
||||||
_BOOTMGR_LOADER_PATH="/EFI/Linux/arch-linux.efi"
|
_BOOTMGR_LOADER_PATH="/EFI/Linux/arch-linux.efi"
|
||||||
_uefi_bootmgr_setup
|
_uefi_bootmgr_setup
|
||||||
|
@ -45,7 +44,10 @@ _uki_uefi() {
|
||||||
_geteditor || return 1
|
_geteditor || return 1
|
||||||
"${_EDITOR}" "${_CMDLINE}"
|
"${_EDITOR}" "${_CMDLINE}"
|
||||||
"${_EDITOR}" "${_UKIFY_CONFIG}"
|
"${_EDITOR}" "${_UKIFY_CONFIG}"
|
||||||
${_NSPAWN} /usr/lib/systemd/ukify build --config=/etc/ukify.conf --output "${_UEFISYS_MP}"/EFI/Linux/arch-linux.efi >>"${_LOG}"
|
# enable uki handling in presets
|
||||||
|
sd '#default_uki' 'default_uki' "${_DESTDIR}/etc/mkinitcpio.d/presets"
|
||||||
|
_run_mkinitcpio
|
||||||
|
_mkinitcpio_error
|
||||||
if [[ -e "${_DESTDIR}/${_UEFISYS_MP}/EFI/Linux/arch-linux.efi" ]]; then
|
if [[ -e "${_DESTDIR}/${_UEFISYS_MP}/EFI/Linux/arch-linux.efi" ]]; then
|
||||||
_uki_install | _dialog --title " Logging to ${_VC} | ${_LOG} " --gauge "Setting up Unified Kernel Image..." 6 75 0
|
_uki_install | _dialog --title " Logging to ${_VC} | ${_LOG} " --gauge "Setting up Unified Kernel Image..." 6 75 0
|
||||||
else
|
else
|
||||||
|
|
|
@ -15,15 +15,15 @@ _mkinitcpio() {
|
||||||
|
|
||||||
_run_mkinitcpio() {
|
_run_mkinitcpio() {
|
||||||
_chroot_mount
|
_chroot_mount
|
||||||
echo "Initramfs progress..." > /tmp/mkinitcpio.log
|
echo "Mkinitcpio progress..." > /tmp/mkinitcpio.log
|
||||||
: > /.archboot
|
: > /.archboot
|
||||||
_mkinitcpio &
|
_mkinitcpio &
|
||||||
_progress_wait "0" "99" "Rebuilding initramfs on installed system..." "0.1"
|
_progress_wait "0" "99" "Running mkinitcpio on installed system..." "0.1"
|
||||||
if [[ -e "/tmp/.mkinitcpio-success" ]]; then
|
if [[ -e "/tmp/.mkinitcpio-success" ]]; then
|
||||||
_progress "100" "Rebuilding initramfs complete." 6 75
|
_progress "100" "Mkinitcpio complete." 6 75
|
||||||
sleep 2
|
sleep 2
|
||||||
else
|
else
|
||||||
_progress "100" "Rebuilding initramfs failed." 6 75
|
_progress "100" "Mkinitcpio failed." 6 75
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
_chroot_umount
|
_chroot_umount
|
||||||
|
|
Loading…
Reference in a new issue