Add /boot partition support to sysinstall(8).
This commit is contained in:
parent
3f86ec6544
commit
b70ffb70af
|
@ -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
|
existing partitions are found, or if an existing Sortix installation is found
|
||||||
that uses the provided bootloader; and will otherwise default to no.
|
that uses the provided bootloader; and will otherwise default to no.
|
||||||
.Pp
|
.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
|
Single-boot configurations should use the offered bootloader. Dual-boot
|
||||||
configurations should refuse it and arrange for bootloading by other means. The
|
configurations should refuse it and arrange for bootloading by other means. The
|
||||||
installer will generate
|
installer will generate
|
||||||
|
@ -209,7 +214,7 @@ on the harddisk.
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Sy ls
|
.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
|
The
|
||||||
.Sy mkpart
|
.Sy mkpart
|
||||||
command creates a partition. You will be asked interactive questions to
|
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
|
command removes a partition table entry and effectively deletes all data on the
|
||||||
partition.
|
partition.
|
||||||
.Pp
|
.Pp
|
||||||
If the device containing the root filesystem uses the GPT partitioning scheme,
|
If you accepted the included bootloader, it will be installed on the boot
|
||||||
and you accepted the included bootloader, then you must create a
|
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
|
.Sy biosboot
|
||||||
partition onto which the bootloader is installed. It should be at the start of
|
partition on the boot harddisk which is where the bootloader will be installed.
|
||||||
the harddisk and a size of 1 MiB will be more than sufficient.
|
It should be at the start of the boot harddisk and a size of 1 MiB will be more
|
||||||
|
than sufficient.
|
||||||
.Pp
|
.Pp
|
||||||
You need to make a partition containing the root filesystem mounted at
|
You need to make a partition containing the root filesystem mounted at
|
||||||
.Pa / .
|
.Pa / .
|
||||||
A size of 1 GiB will be comfortable for the base system and ports and basic
|
A size of 1 GiB will be comfortable for the base system and ports and basic
|
||||||
usage. There is no inherent need for a
|
usage. There is no inherent need for a
|
||||||
|
.Pa /boot
|
||||||
|
or a
|
||||||
.Pa /home
|
.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
|
wish. Operating systems upgrades will preserve the root filesystem and the
|
||||||
installer handles installing on top of an existing installation and preserves
|
installer handles installing on top of an existing installation and preserves
|
||||||
user files and local configuration.
|
user files and local configuration.
|
||||||
|
|
|
@ -674,6 +674,8 @@ int main(void)
|
||||||
"Type man 8 disked to display the disked(8) man page.\n",
|
"Type man 8 disked to display the disked(8) man page.\n",
|
||||||
mktable_tip);
|
mktable_tip);
|
||||||
struct filesystem* root_filesystem = NULL;
|
struct filesystem* root_filesystem = NULL;
|
||||||
|
struct filesystem* boot_filesystem = NULL;
|
||||||
|
struct filesystem* bootloader_filesystem = NULL;
|
||||||
bool not_first = false;
|
bool not_first = false;
|
||||||
while ( true )
|
while ( true )
|
||||||
{
|
{
|
||||||
|
@ -711,6 +713,7 @@ int main(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
root_filesystem = NULL;
|
root_filesystem = NULL;
|
||||||
|
boot_filesystem = NULL;
|
||||||
bool cant_mount = false;
|
bool cant_mount = false;
|
||||||
for ( size_t i = 0; i < mountpoints_used; i++ )
|
for ( size_t i = 0; i < mountpoints_used; i++ )
|
||||||
{
|
{
|
||||||
|
@ -734,17 +737,25 @@ int main(void)
|
||||||
}
|
}
|
||||||
if ( !strcmp(mnt->entry.fs_file, "/") )
|
if ( !strcmp(mnt->entry.fs_file, "/") )
|
||||||
root_filesystem = mnt->fs;
|
root_filesystem = mnt->fs;
|
||||||
|
if ( !strcmp(mnt->entry.fs_file, "/boot") )
|
||||||
|
boot_filesystem = mnt->fs;
|
||||||
}
|
}
|
||||||
if ( cant_mount )
|
if ( cant_mount )
|
||||||
continue;
|
continue;
|
||||||
assert(root_filesystem);
|
assert(root_filesystem);
|
||||||
|
bootloader_filesystem = boot_filesystem ? boot_filesystem : root_filesystem;
|
||||||
|
assert(bootloader_filesystem);
|
||||||
if ( !strcasecmp(accept_grub, "yes") &&
|
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 "
|
"filesystem is located on a GPT partition, but you haven't "
|
||||||
"made a BIOS boot partition on the root GPT disk. Pick "
|
"made a BIOS boot partition on the %s GPT disk. Pick "
|
||||||
"biosboot during mkpart and make a 1 MiB partition.\n");
|
"biosboot during mkpart and make a 1 MiB partition.\n",
|
||||||
|
where, dev);
|
||||||
char return_to_disked[10];
|
char return_to_disked[10];
|
||||||
while ( true )
|
while ( true )
|
||||||
{
|
{
|
||||||
|
@ -775,12 +786,12 @@ int main(void)
|
||||||
}
|
}
|
||||||
if ( strcasecmp(accept_grub, "yes") == 0 )
|
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 )
|
if ( bbp )
|
||||||
printf(" %-16s bios boot partition\n",
|
printf(" %-16s bios boot partition\n",
|
||||||
path_of_blockdevice(&bbp->bdev));
|
path_of_blockdevice(&bbp->bdev));
|
||||||
printf(" %-16s bootloader installation target\n",
|
printf(" %-16s bootloader installation target\n",
|
||||||
device_path_of_blockdevice(root_filesystem->bdev));
|
device_path_of_blockdevice(bootloader_filesystem->bdev));
|
||||||
}
|
}
|
||||||
text("\n");
|
text("\n");
|
||||||
|
|
||||||
|
@ -875,7 +886,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
printf(" - Installing bootloader...\n");
|
printf(" - Installing bootloader...\n");
|
||||||
execute((const char*[]) { "chroot", "-d", ".", "grub-install",
|
execute((const char*[]) { "chroot", "-d", ".", "grub-install",
|
||||||
device_path_of_blockdevice(root_filesystem->bdev), NULL },
|
device_path_of_blockdevice(bootloader_filesystem->bdev), NULL },
|
||||||
"_eqQ");
|
"_eqQ");
|
||||||
printf(" - Configuring bootloader...\n");
|
printf(" - Configuring bootloader...\n");
|
||||||
execute((const char*[]) { "chroot", "-d", ".", "update-grub", NULL },
|
execute((const char*[]) { "chroot", "-d", ".", "update-grub", NULL },
|
||||||
|
|
Loading…
Reference in New Issue