[ALL] Small fixes to the update mechnism

This commit is contained in:
j1nx 2023-09-14 06:29:39 +00:00
parent 4280abe4d6
commit 5c43befc3e
3 changed files with 9 additions and 6 deletions

View File

@ -18,10 +18,14 @@ file_env -f ($root)/cmdline.txt cmdline
regexp --set 1:boothd (.+),.+ ${root}
menuentry "OpenVoiceOS - Slot A" {
set default="0"
set fallback="1"
linux (${boothd},gpt2)/boot/kernel root=PARTUUID=c0932a41-44cf-463b-8152-d43188553ed4 ro $default_cmdline $cmdline
}
menuentry "OpenVoiceOS - Slot B" {
set default="1"
set fallback="0"
linux (${boothd},gpt3)/boot/kernel root=PARTUUID=3adea996-45ad-4928-920e-ffb5aedd00cb ro $default_cmdline $cmdline
}

View File

@ -18,10 +18,14 @@ file_env -f ($root)/cmdline.txt cmdline
regexp --set 1:boothd (.+),.+ ${root}
menuentry "OpenVoiceOS - Slot A" {
set default="0"
set fallback="1"
linux (${boothd},gpt2)/boot/kernel root=PARTUUID=c0932a41-44cf-463b-8152-d43188553ed4 ro $default_cmdline $cmdline
}
menuentry "OpenVoiceOS - Slot B" {
set default="1"
set fallback="0"
linux (${boothd},gpt3)/boot/kernel root=PARTUUID=3adea996-45ad-4928-920e-ffb5aedd00cb ro $default_cmdline $cmdline
}

View File

@ -6,8 +6,7 @@ fi
function get_current_root_device
{
PARTUUID=$(swupdate -g | sed 's/PARTUUID=\([^ ]*\).*/\1/');
CURRENT_ROOT=$(readlink -f /dev/disk/by-partuuid/$PARTUUID);
CURRENT_ROOT=$(swupdate -g);
}
function get_update_part
@ -39,11 +38,7 @@ if [ $1 == "preinst" ]; then
# create a symlink for the update process
ln -sf $UPDATE_ROOT /dev/update
fi
if [ $1 == "postinst" ]; then
get_current_root_device
get_update_part
sync; /usr/bin/grub-editenv /boot/efi/EFI/BOOT/grubenv set default=$GRUB_DEFAULT; sync;
sync; /usr/bin/grub-editenv /boot/efi/EFI/BOOT/grubenv set fallback=$GRUB_FALLBACK; sync;
fi