Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iLNAa-0002C5-IR for mharc-grub-devel@gnu.org; Fri, 18 Oct 2019 03:59:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34109) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNAQ-00027E-7t for grub-devel@gnu.org; Fri, 18 Oct 2019 03:59:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLNAO-0005Ie-D6 for grub-devel@gnu.org; Fri, 18 Oct 2019 03:59:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42266) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLNAO-0005IF-7d for grub-devel@gnu.org; Fri, 18 Oct 2019 03:59:20 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (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 EF490C004E8D for ; Fri, 18 Oct 2019 07:59:18 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id v7so273686wrf.4 for ; Fri, 18 Oct 2019 00:59:18 -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=wxf1LC0sjqv5nBIHeAD/YnHLmSjnghKuA+JVlSLv2J0=; b=rgl4efS/0bHMDvQatRssNEevZ7iQGcfUlud+/r1bB9k1xeqEYTLtJQ5jnT+9gYnZ6r eo4yNErEkDLMpe09VNfMN6WI/mXg/fhl3bMVjNM0VyJ/QsdRVQFmzzwSymjIqp2BujDY R95r5GFtlBsyvK3nxOUOiEO3Pc/RV/NKUb/sifjP3DPO5/6iSH5B6dBCYYLfY6E0oYI+ +U/4X4wFu+WDnO+M3+ilIQJ81c7l/KKzRUOEgmVrasToFCT25WZFUWtXr6k6fRMUwWmc wW0Z6EpWGomVrtN2FZA/lKlaP6ibchGN/9zckM8OM3V397VWI454gIEng4M4LJJM3hg0 GGJw== X-Gm-Message-State: APjAAAX9ke9v4EkBpbTRU123zUCG3CP/r4jK7jiPzF7+MI3cQ7I4lAxv yDwK9OjPvqcjNObqwe0VYdb+Z/lfKl0Njfa8MChpLlzcE34vDeccD8YVyY6uXhLFeaqmxou8Ls5 qgfMF0ayJl9Y= X-Received: by 2002:a5d:4f8f:: with SMTP id d15mr6897268wru.126.1571385557180; Fri, 18 Oct 2019 00:59:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqySFElXG6ZlyC7GeCdIGHpVeT6dF+SQeLwg3iAcqQAZJriCOwDMlWB66POdFy0QpxWI2SQkbA== X-Received: by 2002:a5d:4f8f:: with SMTP id d15mr6897238wru.126.1571385556861; Fri, 18 Oct 2019 00:59:16 -0700 (PDT) Received: from minerva.redhat.com ([90.168.169.92]) by smtp.gmail.com with ESMTPSA id z22sm5198245wmf.2.2019.10.18.00.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 00:59:15 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Vladimir Serbinenko , Daniel Kiper , Paulo Flabiano Smorigo , Javier Martinez Canillas Subject: [PATCH v2 0/3] Search for specific config files using UUID, MAC and IP Date: Fri, 18 Oct 2019 09:59:07 +0200 Message-Id: <20191018075910.31263-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: Fri, 18 Oct 2019 07:59:23 -0000 Hello, This is a 2nd version of a series that have been carried in Fedora (and other distros) for a long time. It allows to fetch GRUB configurations that are customized for each machine by using the client UUID, MAC and IP addresses as suffixes for the grub.cfg file. 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 more similar to printf() and not require to use %x plus grub_toupper(). Patch #2 sets net__client{id,uuid} environment variables by using the DHCP client ID and UUID options if these are found. Finally Patch #3 adds the support to fetch the config files using the UUID, MAC and IP as suffixes. If these aren't found, the default GRUB config filename is used as a fallback. Best regards, Javier 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= . - Add Reviewed-by tag from Daniel Kiper. Paulo Flabiano Smorigo (3): Add %X option to printf functions Set net__client{id,uuid} variables from DHCP options Search for specific config files for netboot 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 | 5 ++ 5 files changed, 180 insertions(+), 14 deletions(-) --=20 2.21.0