FAI for Linux on Apple Silicon?

2025-01-17 Diskussionsfäden Steffen Grunewald
Good morning all -

Many years ago, I maintained a small cluster of Alpha 21064 machines, and
although they didn't support native PXE, they could boot over the network.
As a by-product, AlFAI was created - to FAI-install them without major
extra effort. (I believe FAI-CD didn't exist back then, and it wouldn't
have been as flexible as netbooted FAI anyway.)

While AlFAI was lost at some point (maybe I still have a copy of the
instructions on paper?), as the Alpha machines were taken out of service,
alternative platforms are still fascinating.

This is where Apple Silicon enters the stage...

Has someone already looked into combining FAI and Avahi - or even one of
its derivatives towards Debian?

I've got a M1 Mini on my desk that nobody will want to use for the next
few weeks - and I'd like to start with NFSroot first.

Anyone who can - ans is willing to - share some insights about PXE/netbooting
such a thing? I'm absolutely no Mac guy (yet)...

Thanks,
 Steffen

-- 
Steffen Grunewald, Cluster Administrator
Max Planck Institute for Gravitational Physics (Albert Einstein Institute)
Am Mühlenberg 1 * D-14476 Potsdam-Golm * Germany
~~~
Fon: +49-331-567 7274
Mail: steffen.grunewald(at)aei.mpg.de
~~~


Re: FAI for Linux on Apple Silicon?

2025-01-17 Diskussionsfäden Steffen Grunewald
Hi Thomas,

On Fri, 2025-01-17 at 12:00:21 +0100, Thomas Lange wrote:
> Hi,
> 
> I've already successfully booted an ARM64 server via UEFI/PXE using
> FAI. No installation was done, because this was a special FAI
> environment, were no installation is needed, but some hardware testing
> tools are used.

I had installed Stretch and Buster on a ThunderX machine, via FAI,
quite a while ago.
Unfortunately I'm now stuck with old kernels as the box won't boot
any recent one. 

> FAI 6.2.5 also includes some new code for creating a FAI-CD for
> arm64. I could not test it myself because of missing hardware.

I never used a FAI-CD on any architecture...

> I've read that the M1 CPU needs a kernel using 16k pages.

That's something that looks important, nicely spotted!

> I guess you mean Asahi not Avahi which is something different.

Indeed. This must have been autocorrect in action, replacing Japanese
beer with something more computer-related ;)

> Not sure if Apple can do UEFI or if it needs a signed kernel (and
> initrd) image.

That's actually what I wanted to know. Others may help, perhaps?

(Maybe, as a first step, there's a hidden means to make the boot process
more verbose and non-graphic?)

> I've just created a generic nfsroot using a 16k pages kernel from
> Debian backports. It's available from:
> 
> https://fai-project.org/download/misc/

Thanks, downloaded, will go and analyze it.

> A short info is in /root/README inside the nfsroot.
> You may try to PXE boot this nfsroot.

Will do as soon as I know how...
Random thought: Would this also run on a more "normal" ARM64 machine?

> Add this to dhcpd.conf:
> 
> if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00011" {
>   filename "boot/grub/grubnetaa64.efi";
>   }

I've been using this for years now ;) but I'm using the signed one, should
I revert this?

> Then you need a grub.cfg in /srv/tftp/grub/grub.cfg:
> 
> insmod all_video
> insmod efi_gop
> terminal_output gfxterm
> 
> set timeout=3
> 
> echo === GRUB grub.cfg geladen
> sleep 3
> 
> 
> menuentry 'FAI network boot' {
> echo'Loading FAI kernel ...'
> sleep 1
> linux   $prefix/vmlinuz-6.5.0-5-arm64 ip=dhcp 
> root=192.168.33.250:/srv/fai/nfsroot-arm:vers=3 rootovl  
> FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config 
> FAI_ACTION=install
> echo'Loading FAI initrd ...'
> sleep 1
> initrd  $prefix/initrd.img-6.5.0-5-arm64
> }
> 
> Here you must adjust the kernel and initrd names/versions.

Perhaps I'll go and try this with the ThunderX.

> Copy kernel and initrd into this dir:
> # cp -pv /srv/fai/nfsroot/boot/vmlinu* /srv/fai/nfsroot/boot/initrd* 
> /srv/tftp/grub/
> # chmod a+r /srv/fai/nfsroot/boot/initrd*

My directory structure is a bit different but I understand what you mean.
Shouldn't the second command change the copy, not the source of the initrd?

> It' more than a year ago, that I've test this. Please sent me any feeback.

Will do as soon as I've got time to address the machine. Maybe next week,
maybe after mid-February...

> I will try to build a FAI-CD for ARM64 in the next days.

Your choice; I won't use it ;)

Thanks so far,
 Steffen

-- 
Steffen Grunewald, Cluster Administrator
Max Planck Institute for Gravitational Physics (Albert Einstein Institute)
Am Mühlenberg 1 * D-14476 Potsdam-Golm * Germany
~~~
Fon: +49-331-567 7274
Mail: steffen.grunewald(at)aei.mpg.de
~~~


Re: FAI for Linux on Apple Silicon?

2025-01-17 Diskussionsfäden Thomas Lange
> On Fri, 17 Jan 2025 15:01:07 +0100, Steffen Grunewald 
>  said:

> Will do as soon as I know how...
> Random thought: Would this also run on a more "normal" ARM64 machine?
What's a normal machine?

>> Add this to dhcpd.conf:
>> 
>> if substring(option vendor-class-identifier, 0, 20) = 
"PXEClient:Arch:00011" {
>> filename "boot/grub/grubnetaa64.efi";
>> }

> I've been using this for years now ;) but I'm using the signed one, should
> I revert this?
No. If the signed works for you then dont't change it.
I don't know if the signed grub efi file works without a shim loader before.


>> Copy kernel and initrd into this dir:
>> # cp -pv /srv/fai/nfsroot/boot/vmlinu* /srv/fai/nfsroot/boot/initrd* 
/srv/tftp/grub/
>> # chmod a+r /srv/fai/nfsroot/boot/initrd*

> Shouldn't the second command change the copy, not the source of the 
initrd?
Yep, that a fault. Correct is:
# chmod a+r /srv/tftp/grub/initrd*


-- 
regards Thomas


migration to is-kea (was Re: FAI for Linux on Apple Silicon?)

2025-01-17 Diskussionsfäden Diego Zuccato

Hi.

Hijacking thread for a possibly quick question: is a migration to 
isc-kea planned ? isc-dhcp-server has been obsoleted, but the tests 
we've done highlighted many problems with the change (at leas with isc's 
upstream packages, not tested yet with Debian ones).


Tks,
Diego

Il 17/01/2025 12:00, Thomas Lange ha scritto:

Add this to dhcpd.conf:

if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00011" {
   filename "boot/grub/grubnetaa64.efi";
   }


--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786



migration to is-kea (was Re: FAI for Linux on Apple Silicon?)

2025-01-17 Diskussionsfäden Thomas Lange
> On Fri, 17 Jan 2025 18:00:34 +0100, Diego Zuccato 
>  said:

> Hi.
> Hijacking thread for a possibly quick question: is a migration to 
> isc-kea planned ? isc-dhcp-server has been obsoleted, but the tests 
No, there's no plan to use the kea DHCP server in the near future (not
in the next two years I guesss).
I always wanna use mature rock-solid software. Other people can deal
with the problems that a new software will always have.

But FAI itself does not depend on a specific DHCP server. I only
provide some config examples for the isc-dhcp. You can also use
dnsmasq if you like.

-- 
best regards Thomas


Re: migration to is-kea (was Re: FAI for Linux on Apple Silicon?)

2025-01-17 Diskussionsfäden Diego Zuccato

Il 17/01/2025 18:46, Thomas Lange ha scritto:


 > Hijacking thread for a possibly quick question: is a migration to
 > isc-kea planned ? isc-dhcp-server has been obsoleted, but the tests
No, there's no plan to use the kea DHCP server in the near future (not
in the next two years I guesss).
I always wanna use mature rock-solid software. Other people can deal
with the problems that a new software will always have.

But FAI itself does not depend on a specific DHCP server. I only
provide some config examples for the isc-dhcp. You can also use
dnsmasq if you like.


Tks. When I see a deprecation notice I always worry, but it seems 
isc-kea is not yet ready for prime time. I'll have a look at dnsmask too.


--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786



Re: migration to is-kea (was Re: FAI for Linux on Apple Silicon?)

2025-01-17 Diskussionsfäden Thomas Lange
ISC DHCP is well established. Although it's deprecated it will be used
for many more years. Many people/companies rely on it and can not
easily switch to another software, so IMO there will be people that
will fix bugs if they arise.

-- 
reagrds Thomas


Re: FAI for Linux on Apple Silicon?

2025-01-17 Diskussionsfäden Thomas Lange
Hi,

I've already successfully booted an ARM64 server via UEFI/PXE using
FAI. No installation was done, because this was a special FAI
environment, were no installation is needed, but some hardware testing
tools are used.

FAI 6.2.5 also includes some new code for creating a FAI-CD for
arm64. I could not test it myself because of missing hardware.

I've read that the M1 CPU needs a kernel using 16k pages.
I guess you mean Asahi not Avahi which is something different.
Not sure if Apple can do UEFI or if it needs a signed kernel (and
initrd) image.

I've just created a generic nfsroot using a 16k pages kernel from
Debian backports. It's available from:

https://fai-project.org/download/misc/

A short info is in /root/README inside the nfsroot.
You may try to PXE boot this nfsroot.
The DHCP config needs to be adjusted for ARM64 and the tftp directory
also needs additional parts.

Add this to dhcpd.conf:

if substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00011" {
  filename "boot/grub/grubnetaa64.efi";
  }

Add this file:
# cp /srv/fai/nfsroot/usr/lib/grub/arm64-efi/monolithic/grubnetaa64.efi 
/srv/tftp/boot/grub/grubnetaa64.efi

Then you need a grub.cfg in /srv/tftp/grub/grub.cfg:

insmod all_video
insmod efi_gop
terminal_output gfxterm

set timeout=3

echo === GRUB grub.cfg geladen
sleep 3


menuentry 'FAI network boot' {
echo'Loading FAI kernel ...'
sleep 1
linux   $prefix/vmlinuz-6.5.0-5-arm64 ip=dhcp 
root=192.168.33.250:/srv/fai/nfsroot-arm:vers=3 rootovl  
FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config 
FAI_ACTION=install
echo'Loading FAI initrd ...'
sleep 1
initrd  $prefix/initrd.img-6.5.0-5-arm64
}

Here you must adjust the kernel and initrd names/versions.


Copy kernel and initrd into this dir:
# cp -pv /srv/fai/nfsroot/boot/vmlinu* /srv/fai/nfsroot/boot/initrd* 
/srv/tftp/grub/
# chmod a+r /srv/fai/nfsroot/boot/initrd*


It' more than a year ago, that I've test this. Please sent me any feeback.
I will try to build a FAI-CD for ARM64 in the next days.

-- 
best regards Thomas