Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial aarch64 support, cross arch stateless images with qemu-user-static, grub2 for x86 #7257

Merged
merged 13 commits into from
Jul 25, 2024

Conversation

Obihoernchen
Copy link
Member

@Obihoernchen Obihoernchen commented Sep 30, 2022

The following PR adds three features:

  • initial aarch64 support for xCAT using grub2
  • grub2 support for x86 arch
  • cross arch stateless image generation with qemu-user-static allowing you to build ppc64 or aarch64 stateless images on x86 hosts

It's not 100% ready yet and at the moment I've only tested EL8, but it should be good enough for some PoC tests :)

Status

  • stateful aarch64 images
  • stateless aarch64 images
  • Fix aarch64 install dependencies
  • activate xCAT-genesis-scripts-aarch64 build + build xCAT-genesis-base-aarch64 + add dep to xCAT.spec (optional)
  • grub2 support for x86 arch
  • cross arch stateless image generation with qemu-user-static
  • Man pages
  • Documentation

Emulate aarch64 on x86_64 with QEMU for testing

  • Install qemu-system-aarch64
  • Create VM with:
    • arch: aarch64
    • machine type: virt
    • cpu model: max
    • emulator: /usr/bin/qemu-system-aarch64
    • firmware: UEFI aarch64: /usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw

Note: tested with Fedora 36

Refs:

xCAT RPMs for aarch64

  • xcat-core packages are builded for aarch64 with: bf57a2b13ef5978a3e05076b195f01dc3f2ddb35
  • Missing dependencies:
    • ipmitool-xcat
    • goconserver [dep, SOL] --> built
    • perl-IO-Tty.x86_64 [dep] --> perl-IO-Tty.aarch64 in powertools repo

Build goconserver for aarch64

dnf install golang
git clone https://github.com/xcat2/goconserver.git
cd goconserver
go env -w GO111MODULE=auto
make deps
make rpm
ls -l build/*.rpm

grub2 boot preparation

qemu-user-static for cross arch stateless images

:qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:F
  • Restart binfmt service: systemctl restart systemd-binfmt

Misc

[root@xcat-aarch64 grub2]# lsdef -t osimage rocky8-aarch64-netboot-compute
Object name: rocky8-aarch64-netboot-compute
    exlist=/opt/xcat/share/xcat/netboot/rocky/compute.rocky8.x86_64.exlist
    imagetype=linux
    osarch=aarch64
    osdistroname=rocky8-aarch64
    osname=Linux
    osvers=rocky8
    otherpkgdir=/install/post/otherpkgs/rocky8/aarch64
    permission=755
    pkgdir=/install/rocky8/aarch64
    pkglist=/opt/xcat/share/xcat/netboot/rocky/compute.rocky8.x86_64.pkglist
    postinstall=/opt/xcat/share/xcat/netboot/rocky/compute.rocky8.x86_64.postinstall
    profile=compute
    provmethod=netboot
    rootimgdir=/install/netboot/rocky8/aarch64/compute

@Obihoernchen Obihoernchen changed the title Initial aarch64 support Initial aarch64 support, cross arch stateless images with qemu-user-static, grub2 for x86 Sep 30, 2022
@Obihoernchen Obihoernchen changed the title Initial aarch64 support, cross arch stateless images with qemu-user-static, grub2 for x86 WIP: Initial aarch64 support, cross arch stateless images with qemu-user-static, grub2 for x86 Sep 30, 2022
@Obihoernchen Obihoernchen added this to the 2.17 milestone Feb 7, 2024
@Obihoernchen Obihoernchen self-assigned this Feb 7, 2024
@Obihoernchen
Copy link
Member Author

Obihoernchen commented Feb 23, 2024

Works fine with el9, too.
Feel free to test it. You don't need an arm management node for testing.
Just install grub2 and qemu-user-static on your management node as described above.

@Obihoernchen
Copy link
Member Author

Note: you might have to manually edit generated grub configs because ARM servers might use serial port ttyAMA0 and xCAT will always use the string "ttyS" + nodehm.serialport

@Obihoernchen Obihoernchen force-pushed the aarch64 branch 3 times, most recently from b4a6bf9 to c4edbdd Compare July 12, 2024 16:49
@Obihoernchen Obihoernchen changed the title WIP: Initial aarch64 support, cross arch stateless images with qemu-user-static, grub2 for x86 Initial aarch64 support, cross arch stateless images with qemu-user-static, grub2 for x86 Jul 12, 2024
@Obihoernchen
Copy link
Member Author

@ocfmatt please take a look at it. Especially the documentation I have written.

Copy link

@ocfmatt ocfmatt left a comment

Choose a reason for hiding this comment

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

The changes look good to me. I like the use of qemu for cross architecture compiling.

@Obihoernchen Obihoernchen merged commit c8cb1d6 into xcat2:master Jul 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants