[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grub2 PXE Boot UEFI MAC address based configuration

From: Engelmann Florian
Subject: Re: Grub2 PXE Boot UEFI MAC address based configuration
Date: Fri, 28 Oct 2016 07:18:00 +0000

Dear Andrei,

thank you for your feedback. My grub.cfg currently looks like this:

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set gfxpayload=keep
insmod all_video

#if $grub_platform = efi ; then
#  eval "set net_pxe_mac=\$net_${efi_boot_interface}_mac" 
set net_pxe_mac=$net_default_mac

regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6  


source "$configfile"

source "$configfile"


for c in 1 2 3 4; do
source "$configfile"
regexp --set=ip '^(.*)\..+$' "$ip"

is there any way to nicen up that regexp command?

All the best,

From: Andrei Borzenkov <address@hidden>
Sent: Thursday, October 27, 2016 7:11 PM
To: Engelmann Florian; address@hidden
Subject: Re: Grub2 PXE Boot UEFI MAC address based configuration

27.10.2016 14:25, Engelmann Florian пишет:
> Dear list,
> I am at the same path Andy was:
> But I found lots of tutorials describing grub2 using a configuration scheme 
> like grub.cfg-01-<MAC>:
> I was not able to make it work. I did:
> grub-mknetdir --net-directory=/srv/tftpboot
> and my dnsmasq configuration looks like:
> interface=eth1
> enable-tftp
> tftp-root=/srv/tftpboot
> dhcp-boot=bios/pxelinux.0
> dhcp-match=set:efi-x86_64,option:client-arch,9
> dhcp-boot=tag:efi-x86_64,boot/grub/x86_64-efi/core.efi
> dhcp-match=set:efi-x86_64,option:client-arch,7
> dhcp-boot=tag:efi-x86_64,boot/grub/x86_64-efi/core.efi
> #dhcp-boot=tag:efi-x86_64,efi64/syslinux.efi
> #dhcp-match=set:efi-x86_64,option:client-arch,7
> #dhcp-boot=tag:efi-x86_64,efi64/syslinux.efi
> #dhcp-match=set:efi-x86_32,option:client-arch,6
> #dhcp-boot=tag:efi-x86_32,efi32/syslinux.efi
> dhcp-option=42,   # Timeserver
> domain-needed
> bogus-priv
> #listen-address=
> expand-hosts
> dhcp-range=,,12h
> local=/xxxxxxxxxxxxxx/
> Using /srv/tftpboot/boot/grub/grub.cfg works fine but any file like  
> /srv/tftpboot/boot/grub/grub.cfg-01-<client MAC address> is ignored.
> Is there any documentation to get the job done?

grub itself reads single file, which is grub.cfg. This file can be
script that attempts to load other files. You can access MAC address of
interface over which grub was netbooted using $net_default_mac variable
and derive file names from it.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]