mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-19 02:56:34 +00:00
Fix boot slot A marked as bad on the very first boot (#3435)
On the very first boot, grubenv doesn't exist and loading and saving it silently fails. However, it is later created by the hassos-persists script and the missing information are added by grub.cfg on the next boot. As the consequence, when RAUC tries to get information from grubenv on the first boot, ORDER variable is missing and the slot is reported as bad. Fixes #3376
This commit is contained in:
parent
94c6930acd
commit
87a6c84025
@ -17,6 +17,7 @@ function hassos_pre_image() {
|
||||
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set ORDER="B A"
|
||||
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_OK=1
|
||||
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_TRY=0
|
||||
cp "${EFIPART_DATA}/EFI/BOOT/grubenv-A" "${EFIPART_DATA}/EFI/BOOT/grubenv"
|
||||
|
||||
cp -r "${EFIPART_DATA}/"* "${BOOT_DATA}/"
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ function hassos_pre_image() {
|
||||
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set ORDER="B A"
|
||||
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_OK=1
|
||||
grub-editenv "${EFIPART_DATA}/EFI/BOOT/grubenv-B" set B_TRY=0
|
||||
cp "${EFIPART_DATA}/EFI/BOOT/grubenv-A" "${EFIPART_DATA}/EFI/BOOT/grubenv"
|
||||
|
||||
cp -r "${EFIPART_DATA}/"* "${BOOT_DATA}/"
|
||||
}
|
||||
|
@ -35,6 +35,14 @@ def test_init(shell):
|
||||
_LOGGER.info("%s", "\n".join(output))
|
||||
|
||||
|
||||
@pytest.mark.dependency(depends=["test_init"])
|
||||
def test_rauc_status(shell):
|
||||
output = shell.run_check("rauc status --output-format=shell")
|
||||
# RAUC_BOOT_PRIMARY won't be set if correct grub env is missing
|
||||
assert "RAUC_BOOT_PRIMARY='kernel.0'" in output
|
||||
assert "rauc-WARNING" not in "\n".join(output)
|
||||
|
||||
|
||||
@pytest.mark.dependency(depends=["test_init"])
|
||||
def test_dmesg(shell):
|
||||
output = shell.run_check("dmesg")
|
||||
|
Loading…
x
Reference in New Issue
Block a user