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

Add /boot partition support to sysinstall(8).

This commit is contained in:
Jonas 'Sortie' Termansen 2016-08-27 21:46:30 +02:00
parent 019a8c239a
commit 4c6d8f98e5
2 changed files with 37 additions and 13 deletions

View file

@ -151,6 +151,11 @@ wish to use it in a dual boot scheme. The answer will default to yes if no
existing partitions are found, or if an existing Sortix installation is found
that uses the provided bootloader; and will otherwise default to no.
.Pp
The bootloader will be installed on the boot harddisk, which is the harddisk
containing the
.Pa /boot
partition if any, and otherwise the harddisk containing the root filesystem.
.Pp
Single-boot configurations should use the offered bootloader. Dual-boot
configurations should refuse it and arrange for bootloading by other means. The
installer will generate
@ -209,7 +214,7 @@ on the harddisk.
.Pp
The
.Sy ls
command to lists all partitions and unused space on the current device.
command lists all partitions and unused space on the current device.
The
.Sy mkpart
command creates a partition. You will be asked interactive questions to
@ -223,18 +228,26 @@ The
command removes a partition table entry and effectively deletes all data on the
partition.
.Pp
If the device containing the root filesystem uses the GPT partitioning scheme,
and you accepted the included bootloader, then you must create a
If you accepted the included bootloader, it will be installed on the boot
harddisk, which is the harddisk containing the
.Pa /boot
partition if any, and otherwise the harddisk containing the root filesystem. If
the boot harddisk uses the
.Xr gpt 7
partitioning scheme, then you must create a
.Sy biosboot
partition onto which the bootloader is installed. It should be at the start of
the harddisk and a size of 1 MiB will be more than sufficient.
partition on the boot harddisk which is where the bootloader will be installed.
It should be at the start of the boot harddisk and a size of 1 MiB will be more
than sufficient.
.Pp
You need to make a partition containing the root filesystem mounted at
.Pa / .
A size of 1 GiB will be comfortable for the base system and ports and basic
usage. There is no inherent need for a
.Pa /boot
or a
.Pa /home
partition so you are encouraged to make the root filesystem as large as you
partition, so you are encouraged to make the root filesystem as large as you
wish. Operating systems upgrades will preserve the root filesystem and the
installer handles installing on top of an existing installation and preserves
user files and local configuration.

View file

@ -674,6 +674,8 @@ int main(void)
"Type man 8 disked to display the disked(8) man page.\n",
mktable_tip);
struct filesystem* root_filesystem = NULL;
struct filesystem* boot_filesystem = NULL;
struct filesystem* bootloader_filesystem = NULL;
bool not_first = false;
while ( true )
{
@ -711,6 +713,7 @@ int main(void)
continue;
}
root_filesystem = NULL;
boot_filesystem = NULL;
bool cant_mount = false;
for ( size_t i = 0; i < mountpoints_used; i++ )
{
@ -734,17 +737,25 @@ int main(void)
}
if ( !strcmp(mnt->entry.fs_file, "/") )
root_filesystem = mnt->fs;
if ( !strcmp(mnt->entry.fs_file, "/boot") )
boot_filesystem = mnt->fs;
}
if ( cant_mount )
continue;
assert(root_filesystem);
bootloader_filesystem = boot_filesystem ? boot_filesystem : root_filesystem;
assert(bootloader_filesystem);
if ( !strcasecmp(accept_grub, "yes") &&
missing_bios_boot_partition(root_filesystem) )
missing_bios_boot_partition(bootloader_filesystem) )
{
textf("You are a installing BIOS bootloader and the root "
const char* where = boot_filesystem ? "/boot" : "root";
const char* dev = device_path_of_blockdevice(bootloader_filesystem->bdev);
assert(dev);
textf("You are a installing BIOS bootloader and the %s "
"filesystem is located on a GPT partition, but you haven't "
"made a BIOS boot partition on the root GPT disk. Pick "
"biosboot during mkpart and make a 1 MiB partition.\n");
"made a BIOS boot partition on the %s GPT disk. Pick "
"biosboot during mkpart and make a 1 MiB partition.\n",
where, dev);
char return_to_disked[10];
while ( true )
{
@ -775,12 +786,12 @@ int main(void)
}
if ( strcasecmp(accept_grub, "yes") == 0 )
{
struct partition* bbp = search_bios_boot_partition(root_filesystem);
struct partition* bbp = search_bios_boot_partition(bootloader_filesystem);
if ( bbp )
printf(" %-16s bios boot partition\n",
path_of_blockdevice(&bbp->bdev));
printf(" %-16s bootloader installation target\n",
device_path_of_blockdevice(root_filesystem->bdev));
device_path_of_blockdevice(bootloader_filesystem->bdev));
}
text("\n");
@ -875,7 +886,7 @@ int main(void)
{
printf(" - Installing bootloader...\n");
execute((const char*[]) { "chroot", "-d", ".", "grub-install",
device_path_of_blockdevice(root_filesystem->bdev), NULL },
device_path_of_blockdevice(bootloader_filesystem->bdev), NULL },
"_eqQ");
printf(" - Configuring bootloader...\n");
execute((const char*[]) { "chroot", "-d", ".", "update-grub", NULL },