[LEDE-DEV] dnsmasq possible bug on creating config

Lucian Cristian luci at createc.ro
Tue Jun 20 15:50:29 PDT 2017


On 20.06.2017 22:16, Uwe Arnold wrote:
> Hi guys,
>
> I'm using openwrt / lede devices for at least 5 years but never
> actively submitted any line of code or something.
> But i think the time has come ;)
>
> I hope this is the right channel for this:
> I added below lines to /etc/dnsmasq.conf:
> # inspect the vendor class string and match the text to set the tag
> dhcp-vendorclass=BIOS,PXEClient:Arch:00000
> dhcp-vendorclass=UEFI32,PXEClient:Arch:00006
> dhcp-vendorclass=UEFI,PXEClient:Arch:00007
> dhcp-vendorclass=UEFI64,PXEClient:Arch:00009
>
> # Set the boot file name based on the matching tag from the vendor
> class (above)
> dhcp-boot=net:UEFI32,i386-efi/ipxe.efi,tftpboot-server,192.168.30.254
> dhcp-boot=net:UEFI,ipxe.efi,tftpboot-server,192.168.30.254
> dhcp-boot=net:UEFI64,ipxe.efi,tftpboot-server,192.168.30.254
>
> And the below lines to /etc/config/dhcp:
> config boot linux
>          option filename         'pxelinux.0'
>          option serveraddress    '192.168.30.254'
>          option servername       'tftpboot-server'
>
> the auto generated config file /var/etc/dnsmasq.conf.cfg02411c
> will only contain this line:
> dhcp-boot=pxelinux.0,tftpboot-server,192.168.30.254
>
> I'm a bit confused as i thought that the above dhcp-boot=net:UEFI*
> lines should be available in the generated config which is indeed not
> the case.
>
> In /etc/init.d/dnsmasq I found in line 843:
> append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
>
> as for example the pxe_service is scripted as a config_list_foreach:
> config_list_foreach "$cfg" "pxe_service" append_pxe_service
>
> below the version information and so on:
> cat /etc/openwrt_releaseappend_parm "$cfg" "dhcp_boot" "--dhcp-boot"
> DISTRIB_ID='LEDE'
> DISTRIB_RELEASE='SNAPSHOT'
> DISTRIB_REVISION='r4407-a3332f2'
> DISTRIB_CODENAME='reboot'
> DISTRIB_TARGET='ar71xx/generic'
> DISTRIB_ARCH='mips_24kc'
> DISTRIB_DESCRIPTION='LEDE Reboot SNAPSHOT r4407-a3332f2'
> DISTRIB_TAINTS='no-all'
> uname -mrvo
> 4.4.71 #0 Wed Jun 14 15:47:08 UTC 2017 mips GNU/Linux
> dnsmasq -v
> Dnsmasq version 2.77  Copyright (c) 2000-2016 Simon Kelley
> Compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-
> DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC no-ID loop-
> detect inotify
>
> This software comes with ABSOLUTELY NO WARRANTY.
> Dnsmasq is free software, and you are welcome to redistribute it
> under the terms of the GNU General Public License, version 2 or 3.
>
> Don't hesistate to contact me if you need more information and indeed
> i'm willing to investgate this.
>
> Best regards,
> Uwe
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

for uefi I'm using this in dnsmasq.conf (maybe enable log to see more: 
log-dhcp)


dhcp-match=set:X86PC,option:client-arch,0
dhcp-boot=tag:X86PC,undionly.kkpxe,,192.168.123.1
dhcp-boot=undionly.kkpxe

dhcp-match=set:BC_EFI,option:client-arch,7
dhcp-boot=tag:BC_EFI,bootx64.efi,,192.168.123.1

dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-boot=tag:efi-x86_64,ipxe.efi,,192.168.123.1

the /var/etc/dnsmasq file doesn't need to contain /etc/dnsmasq.conf 
settings to work, they are included

so, enable the log to see more

in /etc/config/dhcp you only need the tftp root:

       option enable_tftp '1'
       option tftp_root '/mnt/sda3/tftpboot'

my ipxe is precompiled with the http path

Regards




More information about the Lede-dev mailing list