[solved] Variable in boot menu - Printable Version +- iPXE discussion forum (https://forum.ipxe.org) +-- Forum: iPXE user forums (/forumdisplay.php?fid=1) +--- Forum: General (/forumdisplay.php?fid=2) +--- Thread: [solved] Variable in boot menu (/showthread.php?tid=20148) |
[solved] Variable in boot menu - fred - 2019-10-11 21:37 Hello, This is what I have and compil from rom-o-matic and work: Code: #!ipxe But I want to passing variable in this menu something like: Code: #!ipxe I see the complet menu of robinsmidsrod, and I tried: Code: #!ipxe And in boot.ipxe.cfg: Code: set boot-url http://192.168.10.118/ It's not working. Only when I compil this full IP. I don't understand where is my error? Can you show me the way to work? Thanks RE: Variable in boot menu - NiKiZe - 2019-10-13 02:26 variables are set by http://ipxe.org/cmd/set and are kept between scripts --autofree and --replace are only about how the script file itself is handled. if you have chain boot.ipxe.cfg in your embedded script, after dhcp, it would try to use the default tftp path. If your http server is on the same server (ip) as your original tftp server than you could use something like: chain http://${netX/next-server}/boot.ipxe.cfg You might want to use the config command from the iPXE shell to see what is set RE: Variable in boot menu - fred - 2019-10-14 20:49 Hello, Thanks for your answer. I'm very very sorry, but I simply don't underdstand. Sorry... Yes, my TFTP server is on the same IP. I try this on rom-o-matic: Code: #!ipxe and in my boot.ipxe.cfg Code: set boot-url http://192.168.10.118/ And my root TFTP is: Code: |-- boot.ipxe.cfg When I boot, I have error No boot device, no such file or directory and It's loop reboot. Thanks RE: Variable in boot menu - NiKiZe - 2019-10-14 23:20 I strongly suggest to use netX not net0 Could you please post the full error message that you are seeing? Including the ipxe.org url in the message? RE: Variable in boot menu - fred - 2019-10-15 08:03 Hello, I tried with netX, nothing better. Sorry. screenshot http://ipxe.org/err/2d03e1 ??? Thanks RE: Variable in boot menu - cckp - 2019-10-15 11:38 try add some sleep and echo in your script to ensure it's actually running RE: Variable in boot menu - fred - 2019-10-15 12:27 I add: sleep 5 between each step and add echo http://${netX/next-server}/boot.ipxe.cfg Nothing sleep and nothing echo. Sorry don't know... RE: Variable in boot menu - MultimediaMan - 2019-10-16 23:42 Let's try with some debugging code inserted and also some troubleshooting options: Code: #!ipxe The above script should give you a pretty clear idea of what if going on without having to do too many gymnastics with the keyboard. I suspect the issue is a missing URI descriptor (tftp:// http://)... Let us know the output. Best, M^3 RE: Variable in boot menu - fred - 2019-10-17 07:56 It's little bit better! Something new! With your script Mr MultimediaMan I have something like this: Code: http://192.168.10.1/menu.ipxe... No such file or directory (http://ipxe.org/2d0c618e) My PXE server ip is 192.168.10.118 192.168.10.1 is my router. I also tried with: Code: set menu-url http://${netX/next-server}/menu.ipxe Same IP display. Near of solution? Thanks to help me! Very cool! Hope to read yours answers RE: Variable in boot menu - MultimediaMan - 2019-10-17 08:12 OK, I have an idea of the problem... Code: #!ipxe Please try that and post the output. Best, M^3 RE: Variable in boot menu - fred - 2019-10-17 08:19 The same: Code: 192.168.10.1 RE: Variable in boot menu - MultimediaMan - 2019-10-17 18:40 OK, this problem is easy to fix. But the real problem is your DHCP server configuration. If you have configured an iPXE class in the DHCP Server, please check your settings there. Can you post up your /etc/dhcp/dhcp.conf for the Subnet for PXE/iPXE and any global settings? The Issue Is DHCP Option 66 ${next-server} is set to 192.168.10.1 but it should be set to 192.168.10.118 There are a couple of different ways to address this... 1: Use DHCP Option 17 ${root-path} (Best way IMHO) instead of relying on DHCP option 66 ${next-server}. ${root-path} is a string variable and can be anything up to 255 characters. 2: Fix your DHCP Option 66/ iPXE class. 3: Ghetto method (not using any DHCP-passed variables, using values burned into iPXE): Code: #!ipxe RE: Variable in boot menu - fred - 2019-10-18 10:00 I'm using DNSMASQ with proxy relay to my router. This what I tried: dnsmasq.conf Code: #=============================================================== And new boot efi: Code: #!ipxe But no more. echo ${root-path} show me 192.168.10.1 And echo ${root-path}/menu.ipxe show me /menu.ipxe ... no such file or directory Thanks RE: Variable in boot menu - MultimediaMan - 2019-10-18 10:31 OK, add these lines in your DNSMASQ: Replace Line 14 with the following and restart DNSMASQ: Code: dhcp-option=17,http://192.168.10.118/ Here is your new embedded script: Code: #!ipxe Best, M^3 RE: Variable in boot menu - fred - 2019-10-18 11:06 Sorry, same result. Error echo ${3} show me 192.168.10.1 echo ${17} is empty initrd http:///menu.ipxe Failure! (ipxe.org/err/3e11618e) And that what I tried now: My snponly.efi built with: Code: #!ipxe because show 66 return me the right IP of my pxe-server. And It's works. echo ${3} show me 192.168.10.1 echo ${17} empty echo ${66} show me 192.168.10.118 But I'm not feel good with this solution. But maybe you can explain me. This morning (for me) I don't know dhcp-option before you show me. Why option 66 show me the right IP instead of 192.168.10.1 like in dnsmasq.conf?! Does I need to change something to have a "right classical" configuration? Thanks and sorry for distrub, I would like to have good config. RE: Variable in boot menu - MultimediaMan - 2019-10-18 11:39 What you have will work. DNSMASQ will assume to use the DNSMASQ Server IP for all standard DHCP options unless you tell it otherwise. IMHO, you are good right now with what you have... there are "better" ways to do it (Using DNS names and more generic Variables), but you are on the right path for now at least. Best, M^3 RE: Variable in boot menu - fred - 2019-10-18 12:36 Thanks, I will continue and post when I have finish. RE: Variable in boot menu - fred - 2019-10-20 15:07 My final snponly.efi generate by rom-o-matic that work: UEFI + dnsmasq Code: #!ipxe Hop can help. Many thanks for your help! |