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
1 changed files with 7 additions and 7 deletions

View File

@ -227,6 +227,13 @@ int main(int argc, char* argv[])
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 )
{
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);
return 0;