Page MenuHomeFreeBSD

ARM64: bsdinstall support for creating EFI partitions
ClosedPublic

Authored by der_semihalf.com on Jun 15 2016, 5:45 PM.
Tags
Referenced Files
Unknown Object (File)
Sep 29 2024, 1:19 PM
Unknown Object (File)
Sep 28 2024, 11:44 PM
Unknown Object (File)
Sep 24 2024, 2:59 PM
Unknown Object (File)
Sep 24 2024, 2:59 PM
Unknown Object (File)
Sep 24 2024, 2:59 PM
Unknown Object (File)
Sep 24 2024, 2:52 PM
Unknown Object (File)
Sep 21 2024, 6:19 AM
Unknown Object (File)
Sep 16 2024, 6:47 PM
Subscribers

Details

Summary

This patch enables bsdinstall to create EFI partition during installation and uploading it's contents,
making the ARM64 FreeBSD installation bootable.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

der_semihalf.com retitled this revision from to ARM64: bsdinstall support for creating EFI partitions.
der_semihalf.com updated this object.
der_semihalf.com edited the test plan for this revision. (Show Details)
der_semihalf.com set the repository for this revision to rS FreeBSD src repository - subversion.
der_semihalf.com added a project: arm64.
usr.sbin/bsdinstall/partedit/partedit_arm64.c
73

This is not actually true, although I would expect the installer to always produce EFI on GPT for arm64.

usr.sbin/bsdinstall/partedit/partedit_arm64.c
73

That is, I think you might want to update the comment, but I don't think the functionality needs to change.

/* We only support GPT with EFI */ perhaps?

Partition scheme screen from Thunder:

FreeBSD Installer
──────────────────────────────────────────────────────────────────────────────

               ┌────────────Partition Scheme───────────────┐
               │ Select a partition scheme for this        │  
               │ volume:                                   │  
               │ ┌───────────────────────────────────────┐ │  
               │ │   APM    Apple Partition Map          │ │  
               │ │   BSD    BSD Labels                   │ │  
               │ │   GPT    GUID Partition Table         │ │  
               │ │   MBR    DOS Partitions               │ │  
               │ │   PC98   NEC PC9801 Partition Table   │ │  
               │ │   VTOC8  Sun VTOC8 Partition Table    │ │  
               │ └───────────────────────────────────────┘ │  
               │                                           │  
               │                                           │  
               ├───────────────────────────────────────────┤  
               │         <  OK  >     <Cancel>             │  
               └───────────────────────────────────────────┘  
                                                              



Bootable on most x86 systems and EFI aware ARM64

After GPT has ben selected (which is default):

FreeBSD Installer
──────────────────────────────────────────────────────────────────────────────

          ┌──────────────────Partition Editor────────────────────┐
          │ Please review the disk setup. When complete, press   │  
          │ the Finish button.                                   │  
          │┌────────────────────────────────────────────────────┐│  
          ││ada0            75 GB   GPT                         ││  
          ││  ada0p1        800 KB  efi                         ││  
          ││  ada0p2        71 GB   freebsd-ufs    /            ││  
          ││  ada0p3        3.5 GB  freebsd-swap   none         ││  
          ││da0             7.2 GB  GPT                         ││  
          ││  da0p1         800 KB  efi                         ││  
          ││  da0s2         581 MB  freebsd                     ││  
          ││                                                    ││  
          │└────────────────────────────────────────────────────┘│  
          ├──────────────────────────────────────────────────────┤  
          │<Create> <Delete> <Modify> <Revert> < Auto > <Finish> │  
          └──────────────────────────────────────────────────────┘  
                                                                    



Exit partitioner (will ask whether to save changes)
usr.sbin/bsdinstall/partedit/partedit_arm64.c
73

Yeah, I can fix that. Though I would stay with making only GPT paritions on installation targets - I do not think that MBR has future on non-x86 machines (with exception to memsticks.)

emaste added a reviewer: emaste.

Looks good to me; it will have to go through a re@ request to be committed.

This revision is now accepted and ready to land.Jun 15 2016, 6:04 PM

Thanks! I'll take care of re@ and committing this change then.

usr.sbin/bsdinstall/partedit/partedit_arm64.c
29

$FreeBSD$ missing

nwhitehorn edited edge metadata.

Looks good to me.

allanjude edited edge metadata.
allanjude added inline comments.
usr.sbin/bsdinstall/partedit/partedit_arm64.c
63

I don't think you need the GPT conditional here

If you also include this diff:
https://reviews.freebsd.org/differential/diff/17606/

It will enable the 'ZFS Auto' installer bits as well

It will enable the 'ZFS Auto' installer bits as well

We'll want to wait for @andrew to confirm that we're good to go with ZFS on arm64 before adding that part.

usr.sbin/bsdinstall/partedit/partedit_arm64.c
35–36

Experience at Netflix suggests that dd'ing the FAT partition is too limiting. We've gone to using a 50MB EFI partition because we have too much hardware that needs EFI drivers or applications to upgrade firmware or change settings... This suggests that only allowing an 800k partition may be too limiting...

73

I'd like to disagree. MBR is the happening place on ARM and has been for long enough that it isn't going away anytime soon (too many ROM-based boot loaders are burned into the CPU/SoC). If you say that only in the context of EFI, then perhaps you're right.

der_semihalf.com edited edge metadata.

All reviewers comments have been applied.
Booting from ZFS have been removed for now.

This revision now requires review to proceed.Jun 16 2016, 9:54 AM

Thank you for reviewing the code.

usr.sbin/bsdinstall/partedit/partedit_arm64.c
35–36

Following your suggestion I will change the partition size to 50MB, for ARM64 only. I'll try to make it compilation option after freeze ends, for all archs that use EFI.

63

True. For now I will remove zfs support now. I have just tested booting from ZFS and it is not possible for now:

>> FreeBSD EFI boot block
   Loader path: /boot/loader.efi

   Initializing modules: ZFS UFS
   Probing 8 block devices......+..** done
    ZFS found the following pools: root
    UFS found 2 partitions
Consoles: EFI console  
part0 isn't a logical partition, skipping
part1 isn't a logical partition, skipping
part4 isn't a logical partition, skipping
Nommand line arguments: lUS_BLK_LOCK not completed
Image base: 0x1ff7bb3000TUS_BLK_LOCK not completed
EFI version: 2.40
EFI Firmware: Cavium Thunder cn88xx EFI sdk-test-tag-xxx-46-g8f94dfc Feb 12 2016
 13:01:59 (rev 0.04)

FreeBSD/arm64 EFI loader, Revision 1.1
(root@arm64-prime, Tue Jun  7 16:44:13 CEST 2016)
Loading /boot/defaults/loader.conf
/

Synchronous Exception at 0x0000001FF7BB3FE0


Synchronous Exception at 0x0000001FF7BB3FE0


Synchronous Exception at 0x0000001FF7BB3FE0
wma edited edge metadata.

It seems that all issues are resolved now.

This revision is now accepted and ready to land.Jun 17 2016, 6:43 AM
usr.sbin/bsdinstall/partedit/partedit_arm64.c
35–36

A problem with this is that boot1 is currently shipped as a pre-built FAT image, so would add a 50MB file to /boot.

We really need to rework the installer to create the EFI filesystem and install boot1 into there rather than using a prebuilt image.

usr.sbin/bsdinstall/partedit/partedit_arm64.c
35–36

I was mistaken: this is the EFI partition size, not the size of the FAT filesystem it will contain, and does not have this problem. I've since made a similar change to amd64.

der_semihalf.com added inline comments.
usr.sbin/bsdinstall/partedit/partedit_arm64.c
35–36

I let myself provide link to Your review: https://reviews.freebsd.org/D6935

Looks like it did not auto-close due to the indentation of the Differential Revision line in rS302025