Skip to content

Conversation

@sec
Copy link

@sec sec commented Feb 4, 2024

Small changes that enable build on aarch64 based machines.

Tested with 13.2 under qemu for ex. qemu-system-aarch64 -drive format=raw,file=mfsbsd-13.2-RELEASE-aarch64.img -m 2048M -cpu cortex-a57 -M virt -bios edk2-aarch64-code.fd

@void-fm
Copy link

void-fm commented Mar 11, 2024

I'll try building this on a rpi4. Will it work with 14.0-releng?

Makefile Outdated
SCRIPTS?= mdinit mfsbsd interfaces packages
BOOTMODULES?= acpi ahci
.if defined(LOADER_4TH)
.if ${TARGET} == aarch64
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the only change here not to include device.hints?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that and also loader_4th and loader_lua - reworked logic around that now.

Makefile Outdated
@echo -n "Creating EFI boot image ..."
${_v}${MKDIR} -p ${WRKDIR}/efiroot/EFI/BOOT
${_v}${CP} ${WRKDIR}/cdboot/${EFILOADER} ${WRKDIR}/efiroot/EFI/BOOT/BOOTX64.efi
. if ${TARGET} == aarch64
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we also should use a variable for the bootfile instead of the complex if-else forking.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sesne, added EFIBOOT for that.

${TIME} makefs -B little ${TMPIMG} ${FSPROTO}
if [ -f ${EFIIMG} ]; then
${TIME} dd if=${TMPIMG} of=/dev/${unit}p3 bs=128k
if [ `uname -m` = 'arm64' ]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strange, the build should be host-independent, only target should impact any changres.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For aarch64, there's different layout of partitions and there's no need for installing bootcode - I tried to make my changes in that way, they won't touch the existing logic, but feel free to propose/change it any way you feel it should be.

@Toutzn
Copy link

Toutzn commented Dec 17, 2024

There is some issue if ISO will be build:

Installing roothack ... done
Creating and compressing mfsroot ... done
Creating ISO image ...makefs: cd9660_add_boot_disk: lstat("/workdir/mfsbsd_dev_dhcp/work/cdboot/cdboot"): No such file or directory
*** Error code 1

need also the aarch64. can someone fix it?

@sec
Copy link
Author

sec commented Dec 17, 2024

There is some issue if ISO will be build:

Installing roothack ... done Creating and compressing mfsroot ... done Creating ISO image ...makefs: cd9660_add_boot_disk: lstat("/workdir/mfsbsd_dev_dhcp/work/cdboot/cdboot"): No such file or directory *** Error code 1

need also the aarch64. can someone fix it?

Hi. Made the change to build ISO based on release scripts, if you could check if that's ok and it boot, thanks :)

@Toutzn
Copy link

Toutzn commented Dec 17, 2024

There is a little issue in the partition part

image

could help this?

@Toutzn
Copy link

Toutzn commented Dec 17, 2024

There is a little issue in the partition part

image could help this?

The Issue is in the zfsinstall file. There is no EFI partition part into which will setup the default way and let crash the setup in that case for arm64?

@Toutzn
Copy link

Toutzn commented Dec 17, 2024

There is a little issue in the partition part
image
could help this?

The Issue is in the zfsinstall file. There is no EFI partition part into which will setup the default way and let crash the setup in that case for arm64?

Background: I use the mfsbsd image to auto install OS System via foreman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants