Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iNGFr-0006EB-9J for mharc-grub-devel@gnu.org; Wed, 23 Oct 2019 09:00:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40985) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNGFo-0006AX-0b for grub-devel@gnu.org; Wed, 23 Oct 2019 09:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNGFm-0004iW-4f for grub-devel@gnu.org; Wed, 23 Oct 2019 09:00:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4196) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNGFl-0004hp-Sl for grub-devel@gnu.org; Wed, 23 Oct 2019 09:00:42 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC67E356CE for ; Wed, 23 Oct 2019 13:00:40 +0000 (UTC) Received: by mail-wr1-f71.google.com with SMTP id v7so9040687wrf.4 for ; Wed, 23 Oct 2019 06:00:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8hhx7mh+BO9VsVEJHrHnoBvcD23rMY6UHyRasa+tuwQ=; b=jUSx0098imwaC2JyuqEtzf1rBKClfW5ggYDe7a08TEmV4TfZTIDHngQVUEtfxBFhcw 604HRF3T5EeAIMyg5dR6ZfCFQ3vurI0pOI1AutNHM3Q6G4vjOKMZenrwUZcXjdyavTZM CE28lDYTc6uH75Qx9SQ8Nw/StW9jMTt2FUrW8UHenOO75biIp71U0Il3u/qtYjV6TRAD /X/+DdYS8zqrgfckDm8iyeRzslnyRzS00d7NExrDhlyYgqB+IGT8Ar3cJWwV+DVuEzHW 5/xmyp/QByN7YdnhMoIP/8tYQMd8Vc3HtE296YdMJG7/+n8N2OfnrPZb9itVHnmJpKoi y/FQ== X-Gm-Message-State: APjAAAVgPSAvSX9savk7XEWJSs7wcbsviOERY0tl5IC8/RMyH1jvz9/O cRu+2VZy8rtsfgHZ3x9HPMu19/LkXbrwbs8lcQpiJd8jTsI+hJQV4BK9xBsVaRraX2hyYdFL+qB 20GRQKmmFKc8= X-Received: by 2002:a5d:4612:: with SMTP id t18mr7971238wrq.255.1571835638977; Wed, 23 Oct 2019 06:00:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUUeYT+8LfOLkoqMND92aiBl8Pyv32DONr2eQo3BlzxYMEcraduEpPvyEbr+SnKm6oS3HuYA== X-Received: by 2002:a5d:4612:: with SMTP id t18mr7971216wrq.255.1571835638674; Wed, 23 Oct 2019 06:00:38 -0700 (PDT) Received: from minerva.redhat.com ([90.168.169.92]) by smtp.gmail.com with ESMTPSA id t123sm27423301wma.40.2019.10.23.06.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 06:00:37 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Vladimir Serbinenko , Daniel Kiper , Paulo Flabiano Smorigo , Javier Martinez Canillas Subject: [PATCH v4 0/5] Search for specific config files using UUID, MAC and IP Date: Wed, 23 Oct 2019 15:00:28 +0200 Message-Id: <20191023130034.12834-1-javierm@redhat.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2019 13:00:45 -0000 Hello, This is a v4 of a series that have been carried in Fedora (and other dist= ros) for a long time. It allows to fetch GRUB configurations that are customiz= ed to each machine by using the client UUID, MAC and IP as grub.cfg suffixes= . The procedure is similar to what is used by pxelinux and yaboot, i.e: http://www.syslinux.org/wiki/index.php/PXELINUX#config Patch #1 adds a %X format specifier to make the grub_printf() function mo= re similar to printf() and not require to use %x plus grub_toupper(). Patch #2 is just a cleanup of the bootp/dhcp options enum to consistently= use hexadecimal numbers for all the values. Patch #3 sets net__client{id,uuid} environment variables by us= ing the DHCP client ID and UUID options if these are found. Patch #4 adds the support to fetch the config files using the UUID, MAC a= nd IP as suffixes. If these aren't found, the default GRUB config filename is u= sed as a fallback. Patch #5 adds documentation that specifies the order netboot clients use = to select a grub configuration file. Best regards, Javier Changes in v4: - Use decimal instead of hexadecimal numbers to be consistent with RFC 21= 32. - Mention that the UUID is unique to the machine and not the NIC and also refer to the RFC 4578 where the client UUID DHCP option is specified. Changes in v3: - Add patch to cleanup bootp/dhcp options enum. - Use decimal numbers for the newly added DHCP client ID and UUID options= . - Add Reviewed-by tag from Daniel Kiper. - Add a patch documenting the grub.cfg netboot selection order. Changes in v2: - Put patch that adds the %X format specifier first in the series. - Use the existing grub_env_set_net_property() and remove duplicated code= . Javier Martinez Canillas (1): net/dhcp: Consistently use decimal numbers for DHCP/BOOTP options enum Paulo Flabiano Smorigo (3): Add %X option to printf functions net/dhcp: Set net__client{id,uuid} variables from DHCP options normal/main: Search for specific config files for netboot Robert Marshall (1): docs: Update info with grub.cfg netboot selection order docs/grub.texi | 46 ++++++++++++++++ grub-core/kern/misc.c | 7 ++- grub-core/net/bootp.c | 48 ++++++++++++++--- grub-core/net/net.c | 117 ++++++++++++++++++++++++++++++++++++++++ grub-core/normal/main.c | 17 ++++-- include/grub/net.h | 24 +++++---- 6 files changed, 236 insertions(+), 23 deletions(-) --=20 2.21.0