Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iPSIO-00083P-Jf for mharc-grub-devel@gnu.org; Tue, 29 Oct 2019 10:16:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60388) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPSIK-0007y0-SF for grub-devel@gnu.org; Tue, 29 Oct 2019 10:16:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPSIJ-000128-5H for grub-devel@gnu.org; Tue, 29 Oct 2019 10:16:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52892) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iPSII-0000zY-RT for grub-devel@gnu.org; Tue, 29 Oct 2019 10:16:23 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (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 A70943DD47 for ; Tue, 29 Oct 2019 14:16:20 +0000 (UTC) Received: by mail-wr1-f69.google.com with SMTP id a15so8515124wrr.0 for ; Tue, 29 Oct 2019 07:16:20 -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=ka4IByTLkdL3CNEElISC0kJQla36nBfVrST9m3HzV0k=; b=CBDqeMW8oZrDaIF64fGKIhPJTQswc3G8o4G7MdhKgQF+nazdJDxE4uum+OeReyQcvT 1gb9mNaRLYBowiBpSHcR/D2iRKmwCkYX7O3bo7fLtqN2RUbpVZ9pxlyzj8ayj2Kcx5vP +eqdiCaJZpCojVy6m7iy9y2MTa8cn0VIqrk4YBjnjtDw6IrfLlBJ6nudsNfJrQk40oH0 mbwTxJ3hQhv+LLdu+MYZioD2vbnSRDUt3GgjZcZZIj649b0b0vUSjRWElJaFqQuTY9bU Gs6+kg/t2mRrEFVB0ZOlKyjFjSfpIZxughDBhdbRq2sM2F1/Z/7OVd9FsFtGRY25iiOp scZw== X-Gm-Message-State: APjAAAXFf0xj+BH9DyPrxOYmGQCKPJDz9EwXNQKR79j4cYTieCtVVhFA E1g4vkkm2V7grkcSx/kwQH9b1GE7VTsNkwZOpD4NiK+MC6nZP5I5tjs8daa6N1FYeQVJ3xWY2Ev X3U+fboTtS0M= X-Received: by 2002:adf:ef4f:: with SMTP id c15mr20607076wrp.296.1572358579124; Tue, 29 Oct 2019 07:16:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsDw5yTpZ1ljqRSCbC4Ke2gYwLraG3eRstdtsRW4/kM6d7ZHZgwyPp0JDVMf90UFAZsehuFQ== X-Received: by 2002:adf:ef4f:: with SMTP id c15mr20607055wrp.296.1572358578821; Tue, 29 Oct 2019 07:16:18 -0700 (PDT) Received: from minerva.redhat.com ([90.168.169.92]) by smtp.gmail.com with ESMTPSA id s17sm2965808wmh.3.2019.10.29.07.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 07:16:18 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Vladimir Serbinenko , Daniel Kiper , Paulo Flabiano Smorigo , Javier Martinez Canillas Subject: [PATCH v5 0/5] Search for specific config files using UUID, MAC and IP Date: Tue, 29 Oct 2019 15:16:07 +0100 Message-Id: <20191029141612.29488-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: Tue, 29 Oct 2019 14:16:27 -0000 Hello, This is a v5 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 v5: - Add Reviewed-by from Daniel Kiper to patch #2. - Don't mix variable declaration and code. - Don't initialize variable without need. - Check for memory allocation failure. - Add missing grub_free(). - Don't mix varible declarations and code. - Don't use variable length arrays. - Fix coding style issues. - Fix function prototype. - Include missing header. - Add Reviewed-by tag from Daniel Kiper to patch #5. 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 | 52 +++++++++++++--- grub-core/net/net.c | 131 ++++++++++++++++++++++++++++++++++++++++ grub-core/normal/main.c | 19 ++++-- include/grub/net.h | 22 ++++--- 6 files changed, 254 insertions(+), 23 deletions(-) --=20 2.21.0