fai-chboot patch proposal : Choose kernel from the corresponding nfsroot
Prunk Dump
prunkdump at gmail.com
Fri Sep 11 09:20:47 CEST 2015
Hello FAI team !
When using fai with multiple architectures we have multiple fai config
directories :
/etc/fai-amd64
/etc/fai-i386
When launching the fai-setup command with the -C option ( fai-setup -C
/etc/fai-amd64 ). The corresponding nfsroots are created correctly :
/srv/fai/nfsroot-amd64
/srv/fai/nfsroot-amdi386
But if the -C option is set on the fai-chboot command ( fai-chboot
-IFv -C /etc/fai-i386 host ) the correct kernel is not automatically
selected. fai-chboot select the last kernel found in /srv/tftp/fai
directory :
if ($opt_i || $opt_s) {
$kernelsuffix = (glob "$tftproot/vmlinuz*$opt_s")[-1];
$kernelsuffix=~ s/.+vmlinuz-//;
die "No kernel found matching $tftproot/vmlinuz*$opt_s\n" unless $kernelsuffix;
}
Maybe fai-chboot can check first the kernels in the nfsroot directory
(in /srv/fai/nfsroot-amd64/boot or /srv/fai/nfsroot-i386boot) so it is
not necessary for the user to set the kernel suffix each time.
Something like this :
if ($opt_i || $opt_s) {
$kernelsuffix = (glob "$nfsroot/boot/vmlinuz*$opt_s")[-1];
if ! $kernelsuffix {
$kernelsuffix = (glob "$tftproot/vmlinuz*$opt_s")[-1];
}
$kernelsuffix=~ s/.+vmlinuz-//;
die "No kernel found matching $tftproot/vmlinuz*$opt_s\n" unless $kernelsuffix;
}
Just a proposition.
Thanks,
Baptiste.
More information about the linux-fai
mailing list