В Wed, 29 May 2013 14:31:43 -0700 (PDT) Rigoberto Corujo <[email protected]> пишет:
> > > > > ----- Original Message ----- > > From: Rick Salevsky <[email protected]> > > To: [email protected] > > Cc: > > Sent: Wednesday, May 29, 2013 9:35 AM > > Subject: Retrieving MAC address in grub2 network boot environment > > > > Hay, > > > > i need some help with grub2 network boot. My plan is to load different > > configs for different machines. At first I created a main grub.cfg with > > including "configfile uEFI/test.cfg" which works fine and the test.cfg > > is loading. > > > > But now i will do something like this: "configfile uEFI/$mac.cfg". > > I once could access EFI variables, and could read out the MAC > > and make above work. > > But..., I cannot find anymore how I have done that :( > > The EFI variable including the MAC address seem to differ > > between different platforms. > > > > The function: > > net_ls_addr > > provides: > > efinet2 MAC IP > > but I failed how to parse this in grub2 scripting. > > I couldn't find out how to assign the result of a function to variables. > > > > Has anyone an i idea how I can resolve this? > > > > Bye, > > -- > > Rick Salevsky > > SUSE LINUX GmbH, Maxfeldstr. 5, D-90409 Nuernberg > > Tel: +49-911-74053-538 - [email protected] > > SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB > > 21284 (AG Nürnberg) > > > > > > _______________________________________________ > > Help-grub mailing list > > [email protected] > > https://lists.gnu.org/mailman/listinfo/help-grub > > > > I had a similar question recently and the Grub 2 developers quickly > implemented the following variables: net_default_interface, net_default_ip, > and net_default_mac > If you build the latest sources, you should have access to them. > To clarify - net_default_{interface|ip|mac} initially refer to interface that was used to netboot GRUB2. On PC platform there is one pseudo-interface "pxe"; and on EFI platform there are multiple interfaces efinet0, efinet1, ... If GRUB2 was netbooted via e.g. efinet1, then net_default_interface will be set to "efinet1" and both other variables will be the same as net_efinet1_ip and net_efinet1_mac, where net_efinet1_ip is presumably set by PXE. _______________________________________________ Help-grub mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-grub
