Root must come first in MBR, but for GPT, having root last makes it easily resizable
While here, if scheme == GPT, always install BOTH partcodes, so the system can be converted back and forth between EFI/CSM
Todo: align partitions
Differential D6232
Make bsdinstall/autopart put swap before the root filesystem in GPT configurations allanjude on May 5 2016, 6:35 PM. Authored by Tags None Referenced Files
Subscribers
Details
Root must come first in MBR, but for GPT, having root last makes it easily resizable While here, if scheme == GPT, always install BOTH partcodes, so the system can be converted back and forth between EFI/CSM Todo: align partitions
Diff Detail
Event Timeline
Comment Actions Aside from the issue with swap and root ordering, this looks mostly reasonable at first pass. It would be nice if the logic were less convoluted, however, especially on non-x86 systems. Right now, there are functions (bootpart_type(), bootpart_size(), bootcode_path(), partcode_path()) to abstract out the GEOM parts of this code. This patch adds yet another function that bypasses the other ones. It would be really good to have this one way or the other: either have x86 use the abstractions (somehow, potentially expanding them) or have all the platforms use the GEOM bits directly.
Comment Actions Yeah, the complexity here came from the fact that I expanded it to install both bootcodes, gptzfsboot and boot1.efifat. Maybe the idea would be to create 1 abstraction for each platform, that creates the bootcode partitions, rather than having the abstractions to get the size, contents, etc. Comment Actions I like that idea a lot. Unless you feel like you have time to do that soon, the interface shouldn't be the thing to block the commit.
Comment Actions
My MIPS ERL has a FAT boot fs as well. In any case I don't think we want to change the way the installer handles this before 11.0 (coming too quickly) but it is something we should take a look at afterwards. Comment Actions Agreed on that. The main point that this is a thing we'll have to do more of with arbitrary lists of files in the future, though, remains valid. The timing of when we have to do it is one for debate (though I fall on the post 11.0 side of the spectrum), but the need is real. Comment Actions It's not that bad to do, some minor refactoring at worst (the installer already knows how to set up FAT partitions). What does need to happen is that we need decide where they get mounted, what files should go onto them, how updates work, etc. It's a policy issue rather than a technical one, and one we can easily fix after 11.
Comment Actions Was this review overcome by events?
I did have swap first with an installation of 12.3 that was performed in June 2022: root@fuji:~ # lsblk DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT ada0 0:127 149G GPT - - ada0p1 0:129 512K freebsd-boot gpt/gptboot0 - <FREE> -:- 492K - - - ada0p2 0:131 16G freebsd-swap gpt/swap0 SWAP ada0p2.eli 0:161 16G freebsd-swap - SWAP ada0p3 0:133 133G freebsd-zfs gpt/zfs0 <ZFS> ada0p3.eli 0:140 133G zfs - - <FREE> -:- 836K - - - root@fuji:~ # bectl list -c creation BE Active Mountpoint Space Created default - - 1.30G 2022-06-11 19:03 12.3-RELEASE-p5_2022-06-11_212957 - - 86.6M 2022-06-11 21:29 13.1-RELEASE_2022-06-11_213806 - - 2.75M 2022-06-11 21:38 13.1-RELEASE_2022-06-11_214835 - - 13.3M 2022-06-11 21:48 13.1-RELEASE_2022-06-18 - - 974M 2022-06-18 19:56 13.1-RELEASE_2022-06-29 - - 402M 2022-06-29 20:02 13.1-RELEASE_2022-08-02 - - 208M 2022-08-02 18:18 13.1-RELEASE_2022-08-05 - - 2.13G 2022-08-05 18:00 13.1-RELEASE_2022-08-11_011205 - - 51.2M 2022-08-11 01:12 13.1-RELEASE-p1_2022-09-18_042630 - - 599M 2022-09-18 04:26 13.1-RELEASE_2022-10-10 - - 754M 2022-10-10 02:58 13.1-RELEASE_2022-10-28 - - 749M 2022-10-28 23:37 13.1-RELEASE-p2_2022-11-03_174754 - - 551M 2022-11-03 17:47 13.1-RELEASE-p3_2022-11-20_101333 - - 608M 2022-11-20 10:13 13.1-RELEASE-p4_2022-12-10_144333 - - 926M 2022-12-10 14:43 13.1-RELEASE-p5_2023-02-11_093418 - - 2.74G 2023-02-11 09:34 13.1-RELEASE-p6_2023-02-23_182708 - - 2.36G 2023-02-23 18:27 13.1-RELEASE-p7_2023-03-19_154504 NR / 44.1G 2023-03-19 15:45 13.2-RC3_2023-03-19_160134 - - 5.19M 2023-03-19 16:01 13.2-RC3_2023-03-24 - - 1.14G 2023-03-24 01:04 13.2-RC3_2023-03-26_045052 - - 4.62M 2023-03-26 04:50 13.2-RC4_2023-03-26_052745 - - 4.72M 2023-03-26 05:27 13.2-RC4_2023-04-01_215204 - - 4.76M 2023-04-01 21:52 13.2-RC6_2023-04-02_023914 - - 11.3G 2023-04-02 02:39 13.2-RC6_2023-04-09_100730 - - 198M 2023-04-09 10:07 13.1-RELEASE-p7_2023-04-10_192020 - - 3.22M 2023-04-10 19:20 13.1-RELEASE-p7_2023-04-10_205201 - - 4.03M 2023-04-10 20:52 13.2-RELEASE_2023-04-10_223831 - - 4.54M 2023-04-10 22:38 root@fuji:~ # freebsd-version -kru 13.2-RELEASE 13.2-RELEASE 13.2-RELEASE root@fuji:~ # |