From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1m1WNr-00060p-4T for mharc-grub-devel@gnu.org; Thu, 08 Jul 2021 11:56:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1WNp-0005tN-7b for grub-devel@gnu.org; Thu, 08 Jul 2021 11:56:13 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:38910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1WNl-0003Na-2l for grub-devel@gnu.org; Thu, 08 Jul 2021 11:56:12 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4C4062223C; Thu, 8 Jul 2021 15:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1625759765; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jXENweH9b1Y+azeyUjlsqPFQ+KLXMl+v2/1rt7TQV3o=; b=Agi96SeAuqmYe0qQHoSQAzPaTShlxhxXy/BCAYzqb53oQJIYS9LkS3t0TuTZFUrmGe+9U3 /ky5ws4eVD2qwZPWHaKz6qrBvOHOkEssqlouK0AizxLUBsZu/Dzp9wEZpXt9qbPJgiQdEF jBwzrtrWZW8Si8nvbT2adA7jWSXG8vI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1625759765; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jXENweH9b1Y+azeyUjlsqPFQ+KLXMl+v2/1rt7TQV3o=; b=65MJmEUHjXrn7Ea+9w3tJzcRTWElfML2IoN5OVbsd+VdVXiKLigFowqohgGTjUWladG7+H JrzRQFRs+C4ht2Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0798113B00; Thu, 8 Jul 2021 15:56:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YFktABUg52DlGQAAMHmgww (envelope-from ); Thu, 08 Jul 2021 15:56:05 +0000 From: Petr Vorel To: grub-devel@gnu.org Cc: Petr Vorel , Daniel Kiper , Michael Chang , Mike Gilbert , Jeff Mahoney Subject: [PATCH 1/2] osdep: Introduce major.h and use it Date: Thu, 8 Jul 2021 17:55:57 +0200 Message-Id: <20210708155558.26466-2-pvorel@suse.cz> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708155558.26466-1-pvorel@suse.cz> References: <20210708155558.26466-1-pvorel@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=195.135.220.28; envelope-from=pvorel@suse.cz; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Thu, 08 Jul 2021 15:56:13 -0000 Signed-off-by: Petr Vorel --- grub-core/osdep/devmapper/getroot.c | 7 +------ grub-core/osdep/devmapper/hostdisk.c | 7 +------ grub-core/osdep/linux/getroot.c | 7 +------ grub-core/osdep/unix/getroot.c | 7 +------ include/grub/osdep/major.h | 30 ++++++++++++++++++++++++++++ 5 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 include/grub/osdep/major.h diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c index a13a39c96..9ba5c9865 100644 --- a/grub-core/osdep/devmapper/getroot.c +++ b/grub-core/osdep/devmapper/getroot.c @@ -40,12 +40,7 @@ #include #endif -#if defined(MAJOR_IN_MKDEV) -#include -#elif defined(MAJOR_IN_SYSMACROS) -#include -#endif - +#include #include #include diff --git a/grub-core/osdep/devmapper/hostdisk.c b/grub-core/osdep/devmapper/hostdisk.c index a8afc0c94..c8053728b 100644 --- a/grub-core/osdep/devmapper/hostdisk.c +++ b/grub-core/osdep/devmapper/hostdisk.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -24,12 +25,6 @@ #include #include -#if defined(MAJOR_IN_MKDEV) -#include -#elif defined(MAJOR_IN_SYSMACROS) -#include -#endif - #ifdef HAVE_DEVICE_MAPPER # include diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c index 001b818fe..cd588588e 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -35,12 +35,7 @@ #include #endif -#if defined(MAJOR_IN_MKDEV) -#include -#elif defined(MAJOR_IN_SYSMACROS) -#include -#endif - +#include #include #include /* ioctl */ #include diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c index 46d7116c6..74f69116d 100644 --- a/grub-core/osdep/unix/getroot.c +++ b/grub-core/osdep/unix/getroot.c @@ -51,12 +51,7 @@ #endif /* ! FLOPPY_MAJOR */ #endif -#include -#if defined(MAJOR_IN_MKDEV) -#include -#elif defined(MAJOR_IN_SYSMACROS) -#include -#endif +#include #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) # include diff --git a/include/grub/osdep/major.h b/include/grub/osdep/major.h new file mode 100644 index 000000000..e3b545551 --- /dev/null +++ b/include/grub/osdep/major.h @@ -0,0 +1,30 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2021 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * Fix for glibc 2.25 is deprecating the namespace pollution of sys/types.h + * injecting major(), minor(), and makedev() into the compilation environment. + * See configure.ac. +*/ + +#include +#ifdef MAJOR_IN_MKDEV +# include +#elif defined(MAJOR_IN_SYSMACROS) +# include +#endif -- 2.32.0