7-add-legacy-bios-support #8

Merged
hygienic-books merged 12 commits from 7-add-legacy-bios-support into main 2023-10-24 00:25:35 +00:00
Showing only changes of commit 73001c8e95 - Show all commits

View File

@ -6,14 +6,31 @@ Helper script to install Arch Linux with ZFSBootMenu from within a running Arch
We expect minimal prep on your end. Please make sure that before execution the following conditions are met. We expect minimal prep on your end. Please make sure that before execution the following conditions are met.
### UEFI
On a UEFI system ensure these conditions are met. See [How to prep](#how-to-prep) for details on how to meet these conditions.
- One GPT-partitioned disk
- Arch Linux live CD ISO image sees exactly one partition with partition type code `BF00` ("Solaris root") - Arch Linux live CD ISO image sees exactly one partition with partition type code `BF00` ("Solaris root")
- Arch Linux live CD ISO image sees exactly one partition with partition type code `EF00` ("EFI system partition") - Arch Linux live CD ISO image sees exactly one partition with partition type code `EF00` ("EFI system partition")
- The `EF00` EFI partition is mountable, in practical terms this usually only means it has a file system. - The `EF00` EFI partition is mountable, in practical terms this usually only means it has a file system.
- No ZFS zpool exists - No ZFS zpool exists
### How to prep ### Legacy BIOS
On a blank example disk `/dev/sda` you can fulfill the requirements (One `EF00` partition with a file system plus one `BF00` partition) for example like so: If you are instead running a legacy BIOS machine ensure these conditions are met. See [How to prep](#how-to-prep) for details on how to meet these conditions.
- One MBR-partitioned disk
- Arch Linux live CD ISO image sees exactly one partition with partition type code `BF` ("Solaris root")
- Arch Linux live CD ISO image sees exactly one partition with partition type code `83` ("Linux")
- The `83` Linux partition is mountable, in practical terms this usually only means it has a file system.
- No ZFS zpool exists
## How to prep
### UEFI
On a blank example disk `/dev/sda` you can fulfill the UEFI requirements (One `EF00` partition with a file system plus one `BF00` partition) for example like so:
``` ```
sgdisk --new '1::+512M' --new '2' --typecode '1:EF00' --typecode '2:BF00' /dev/sda sgdisk --new '1::+512M' --new '2' --typecode '1:EF00' --typecode '2:BF00' /dev/sda
mkfs.vfat /dev/sda1 mkfs.vfat /dev/sda1
@ -37,6 +54,28 @@ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
└─/dev/sda2 202:2 0 9.5G 0 part └─/dev/sda2 202:2 0 9.5G 0 part
``` ```
### Legacy BIOS
For a legacy BIOS machine you'll be using a master boot record (MBR) on your disk.
```
printf -- '%s\n' 'label: dos' 'start=1MiB, size=512MiB, type=83, bootable' 'start=513MiB, size=+, type=bf' | sfdisk /dev/sda
mkfs.vfat /dev/sda1
```
> `label: dos`: Create the following partition layout in a master boot record.
>
> `start=1MiB, size=512MiB, type=83, bootable`: Partition 1 begins 1 Mebibyte after disk start and is 512 Mebibyte in size. We're setting its bootable flag and setting partition type code `83` ("Linux").
>
> `start=513MiB, size=+, type=bf`: Partition 2 begins right at the start of Mebibyte 513, this is the very next sector after the end of partition 1. It takes up the remaining disk space, we're assigning type code `bf` ("Solaris").
The result will be something like this at which point you can start the `setup.sh` script, see [How to run this?](#how-to-run-this) below for more details.
```
# lsblk --paths --output 'NAME,SIZE,FSTYPE,PARTTYPE,PARTTYPENAME,PTTYPE' /dev/sda
NAME SIZE FSTYPE PARTTYPE PARTTYPENAME PTTYPE
/dev/sda 10G dos
├─/dev/sda1 512M vfat 0x83 Linux dos
└─/dev/sda2 9.5G 0xbf Solaris dos
```
## ZFS dataset layout ## ZFS dataset layout
The script will create a single ZFS zpool `zpool` on the `BF00` partition with dataset child `zpool/root` which itself has one child `zpool/root/archlinux`, that's where Arch Linux gets installed. Parallel to `zpool/root` it'll create `zpool/data` with a `zpool/data/home` child dataset that gets mounted at `/home`. The script will create a single ZFS zpool `zpool` on the `BF00` partition with dataset child `zpool/root` which itself has one child `zpool/root/archlinux`, that's where Arch Linux gets installed. Parallel to `zpool/root` it'll create `zpool/data` with a `zpool/data/home` child dataset that gets mounted at `/home`.