Re: Sysemd in the nfsroot

2022-05-10 Diskussionsfäden Justin Cattle
Hi Thomas,


I found a bit of time to take a look.

I have forked and created a branch with a demo of how it could work.  It's
not meant to be the finished article, but hopefully it shows how some of it
could be achieved.

Things to note:

   - Relevant part of NFSROOT config needs to be something like this:
  - systemd systemd-sysv libpam-systemd sysvinit-core-
   - Because of potential race conditions with starting usual tty services,
   I select unused tty for this
  - fai on tty11
  - fai-maint on tty12
   - fai-maint is a systemd service which creates a tty with a root bash
   session already logged in.  It's just an example of how that kind of thing
   could be achieved with systemd.
   - Although I tried to make FAI itself still support both SysV and
   Systemd, it's hard to do that in the packaging I think, so for this I
   dropped SysV support in the packaging.
  - You can use the systemd-sysv compatibility layer to create service
  units, but that doesn't give as much control over the units [
they are much
  more basic ], so native systemd is better.


Please also note I haven't tested this exhaustively, so far I've only used
it with a squashfs image, not an nfs root.

I'd be happy to work with you to create a PR and review it together to try
and integrate it, but I appreciate you may not want to look at this yet.
It seems to be that multi init system packaging could be the trickiest
part, and you may not want to drop SysV support any time soon.

Please take a look and let me know what you think:
https://github.com/ocadotechnology/fai/tree/systemd-support


Cheers,
Just


On Fri, 6 May 2022 at 20:40, Thomas Lange  wrote:

> Hi Justin,
>
> I didn't had time to work on this yet. I do not know how to call the
> main fai script from systemd, so its output is shown on the console
> and the input is also read from the console. It must also work that
> the admin can interrupt the fai run via ctrl-C and get an interactive
> shell.
> Does anyone know how to do this?
>
> Currently (using sysv init) the script is started as /etc/init.d/rcS
> and starts some other daemons on demand (for e.g. sshd is only started
> if FAI_FLAGS includes sshd). How do we do this using systemd?
>
>
> > On Fri, 6 May 2022 15:02:30 +0100, Justin Cattle  said:
>
> > Hi,
> > I'm just wondering what the current blockers to using systemd in the
> nfsroot are.  Are there some things that simply won't work, or is it more
> about reducing complexity by only supporting
> > a single init system, or something else ?
>
>
> --
> best regards Thomas
>

-- 


Notice: 
This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message 
may not necessarily reflect the opinions and views of the members of the 
Ocado Group.

If you are not the intended recipient, please notify us 
immediately and delete all copies of this message. Please note that it is 
your responsibility to scan this message for viruses.

References to the 
"Ocado Group" are to Ocado Group plc (registered in England and Wales with 
number 7098618) and its subsidiary undertakings (as that expression is 
defined in the Companies Act 2006) from time to time. The registered office 
of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way, 
Hatfield, Hertfordshire, AL10 9UL.


Re: Multi-arch installer

2022-05-10 Diskussionsfäden Ian Eure

Steffen Grunewald  writes:


On Mon, 2022-05-09 at 21:50:23 -0700, Ian Eure wrote:
I have some oddball hardware I want to use FAI on.  It has a 
64-bit CPU, but
its UEFI BIOS only supports 32-bits.  I can manually install 
with the Debian
multi-arch image[1], which has a 32-bit bootloader, but 
correctly installs

amd64 kernel and packages.

Is there a way to get FAI to do something similar?


I may not fully understand your problem, but wouldn't FAI just 
detect the

availability of UEFI (via /sys/)?

Relevant background here is that I’m booting FAI off a CD image, 
because this hardware doesn’t have Ethernet.  The image doesn’t 
even boot, because it has a 64-bit bootloader which the computer’s 
32-bit UEFI can’t use.  So it can’t make any decisions based on 
what’s in /sys.


 -- Ian


Re: Multi-arch installer

2022-05-10 Diskussionsfäden Steffen Grunewald
On Mon, 2022-05-09 at 21:50:23 -0700, Ian Eure wrote:
> I have some oddball hardware I want to use FAI on.  It has a 64-bit CPU, but
> its UEFI BIOS only supports 32-bits.  I can manually install with the Debian
> multi-arch image[1], which has a 32-bit bootloader, but correctly installs
> amd64 kernel and packages.
> 
> Is there a way to get FAI to do something similar?

I may not fully understand your problem, but wouldn't FAI just detect the
availability of UEFI (via /sys/)? Everything else should be handled by the
DHCP/TFTP server side (which is only closely related to FAI).
Whether there's a 64-bit system installed depends on the NFSROOT assigned.
But since you want to talk to the 32-bit UEFI first, perhaps the following
years-old snippet from my dhcpd.conf may point you in some direction:

...
## https://www.syslinux.org/wiki/index.php?title=PXELINUX#UEFI
if substring(option vendor-class-identifier, 0, 20) = 
"PXEClient:Arch:0" {
  filename "pxelinux.0";
}
if substring(option vendor-class-identifier, 0, 20) = 
"PXEClient:Arch:6" {
  filename "syslinux32.efi";
}
if substring(option vendor-class-identifier, 0, 20) = 
"PXEClient:Arch:7" {
  filename "syslinux64.efi";
}
if substring(option vendor-class-identifier, 0, 20) = 
"PXEClient:Arch:9" {
  filename "syslinux64.efi";
}
...

You may have to look for ldlinux.* and syslinux*.* files in various subtrees
provided by the syslinux-common package, and copy them into your TFTP tree.

HTH,
- S

-- 
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
~~~