1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Fix sysmerge delayed upgrade bricking system.

It ran update-initrd before removing /sysmerge, which caused the initrd to
attempt another upgrade, but there was no image in /sysmerge.
This commit is contained in:
Jonas 'Sortie' Termansen 2016-02-21 22:09:03 +01:00
parent f52fb3202c
commit 478468a04e

View file

@ -227,6 +227,13 @@ int main(int argc, char* argv[])
return 0; return 0;
} }
if ( booting )
{
unlink("/boot/sortix.bin.sysmerge.orig");
unlink("/boot/sortix.initrd.sysmerge.orig");
execute((const char*[]) { "rm", "-rf", "/sysmerge", NULL }, "");
}
if ( !wait && access_or_die("/etc/fstab", F_OK) == 0 ) if ( !wait && access_or_die("/etc/fstab", F_OK) == 0 )
{ {
printf(" - Creating initrd...\n"); printf(" - Creating initrd...\n");
@ -247,13 +254,6 @@ int main(int argc, char* argv[])
} }
} }
if ( booting )
{
unlink("/boot/sortix.bin.sysmerge.orig");
unlink("/boot/sortix.initrd.sysmerge.orig");
execute((const char*[]) { "rm", "-rf", "/sysmerge", NULL }, "");
}
printf("Successfully upgraded to %s.\n", new_release.pretty_name); printf("Successfully upgraded to %s.\n", new_release.pretty_name);
return 0; return 0;