Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
From 1c35333cd7836c3cc9b39cf6c5599d2221268e94 Mon Sep 17 00:00:00 2001
From: Simon Rowe <simon.rowe@nutanix.com>
Date: Thu, 23 Mar 2023 09:57:59 +0000
Subject: [PATCH] cmdline: use freopen() to reopen standard streams
In glibc stdin, stdout & stderr are variables that can be assigned to
(https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html)
however this not necessarily true of other C libraries.
The gentoo musl porting notes
(https://wiki.gentoo.org/wiki/Musl_porting_notes)
recommend the substitution of
stdX = fopen(...)
with
freopen(..., stdX)
Taken from: https://github.com/gentoo/gentoo/blob/master/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch
Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
[Julien: rebased patch on v2.03.27]
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
tools/lvmcmdline.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 7209ebd9b..3c0c957b1 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3378,7 +3378,11 @@ static int _check_standard_fds(void)
int err = is_valid_fd(STDERR_FILENO);
if (!is_valid_fd(STDIN_FILENO) &&
+#ifdef __GLIBC__
!(stdin = fopen(_PATH_DEVNULL, "r"))) {
+#else
+ !freopen(_PATH_DEVNULL, "r", stdin)) {
+#endif
if (err)
perror("stdin stream open");
else
@@ -3388,7 +3392,11 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDOUT_FILENO) &&
+#ifdef __GLIBC__
!(stdout = fopen(_PATH_DEVNULL, "w"))) {
+#else
+ !freopen(_PATH_DEVNULL, "w", stdout)) {
+#endif
if (err)
perror("stdout stream open");
/* else no stdout */
@@ -3396,7 +3404,11 @@ static int _check_standard_fds(void)
}
if (!is_valid_fd(STDERR_FILENO) &&
+#ifdef __GLIBC__
!(stderr = fopen(_PATH_DEVNULL, "w"))) {
+#else
+ !freopen(_PATH_DEVNULL, "w", stderr)) {
+#endif
printf("stderr stream open: %s\n",
strerror(errno));
return 0;
--
2.46.2

View File

@@ -0,0 +1,46 @@
From 760ac03a8d8870ad47776075c1e59b6395d308bf Mon Sep 17 00:00:00 2001
From: Simon Rowe <simon.rowe@nutanix.com>
Date: Thu, 23 Mar 2023 10:07:02 +0000
Subject: [PATCH] log: use freopen() to reopen standard streams
In glibc stdin, stdout & stderr are variables that can be assigned to
(https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html)
however this not necessarily true of other C libraries.
The gentoo musl porting notes
(https://wiki.gentoo.org/wiki/Musl_porting_notes)
recommend the substitution of
stdX = fopen(...)
with
freopen(..., stdX)
Taken from: https://github.com/gentoo/gentoo/blob/master/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
[Julien: rebased patch on v2.03.27]
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
lib/log/log.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/log/log.c b/lib/log/log.c
index 3eda7d343..0bcd9552d 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -208,7 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
_check_and_replace_standard_log_streams(*stream, new_stream);
+#ifdef __GLIBC__
*stream = new_stream;
+#else
+ freopen(NULL, mode, *stream);
+#endif
return 1;
}
--
2.46.2

41
package/lvm2/Config.in Normal file
View File

@@ -0,0 +1,41 @@
config BR2_PACKAGE_LVM2
bool "lvm2 & device mapper"
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_MMU # needs fork()
help
This is LVM2, the rewrite of The Linux Logical Volume Manager.
LVM supports enterprise level volume management of disk and
disk subsystems by grouping arbitrary disks into volume
groups. The total capacity of volume groups can be allocated
to logical volumes, which are accessed as regular block
devices.
The Linux Kernel Device Mapper is the LVM
(Linux Logical Volume Management) Team's implementation of a
minimalistic kernel-space driver that handles volume
management, while keeping knowledge of the underlying device
layout in user-space. This makes it useful for not only LVM,
but EVMS, software raid, and other drivers that create
"virtual" block devices.
http://www.sourceware.org/lvm2/
if BR2_PACKAGE_LVM2
config BR2_PACKAGE_LVM2_STANDARD_INSTALL
bool "standard install instead of only dmsetup"
default y
depends on !BR2_STATIC_LIBS
select BR2_PACKAGE_LIBAIO
help
Install the standard suite of lvm2 programs. When this option
is not set, only dmsetup is installed.
comment "lvm2 standard install needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS
endif
comment "lvm2 needs a toolchain w/ threads"
depends on BR2_USE_MMU
depends on !BR2_TOOLCHAIN_HAS_THREADS

6
package/lvm2/lvm2.hash Normal file
View File

@@ -0,0 +1,6 @@
# From https://sourceware.org/ftp/lvm2/sha512.sum
sha512 254131e28b22d55531d211886afbfdc219e77a4df802e3ec9b66d889ff22bf6d0a6c2df9c5ff017592d92e1dce0f658a6628fb321c1e90152ff7257492218242 LVM2.2.03.31.tgz
# Locally computed sha256 checksums
sha256 e76fbcd2fb97cf202da330301327754d2db5c58b5b4bebd3a8a749393e7603d1 COPYING
sha256 5df07007198989c622f5d41de8d703e7bef3d0e79d62e24332ee739a452af62a COPYING.LIB

94
package/lvm2/lvm2.mk Normal file
View File

@@ -0,0 +1,94 @@
################################################################################
#
# lvm2
#
################################################################################
LVM2_VERSION = 2.03.31
LVM2_SOURCE = LVM2.$(LVM2_VERSION).tgz
LVM2_SITE = https://sourceware.org/ftp/lvm2
LVM2_INSTALL_STAGING = YES
LVM2_LICENSE = GPL-2.0, LGPL-2.1
LVM2_LICENSE_FILES = COPYING COPYING.LIB
LVM2_CPE_ID_VENDOR = redhat
# parallel build issues
LVM2_MAKE = $(MAKE1)
# Make sure that binaries and libraries are installed with write
# permissions for the owner. We disable NLS because it's broken, and
# the package anyway doesn't provide any translation files.
LVM2_CONF_OPTS += \
--enable-write_install \
--enable-pkgconfig \
--enable-cmdlib \
--enable-dmeventd \
--disable-nls \
--with-symvers=no
LVM2_DEPENDENCIES += host-pkgconf
# LVM2 uses autoconf, but not automake, and the build system does not
# take into account the toolchain passed at configure time.
LVM2_MAKE_ENV = $(TARGET_CONFIGURE_OPTS)
# package/readline is GPL-3.0+, so not license compatible
LVM2_CONF_OPTS += --disable-readline
LVM2_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR)
LVM2_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR)
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
LVM2_CONF_OPTS += --enable-udev_rules
endif
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
LVM2_CONF_OPTS += --enable-selinux
LVM2_DEPENDENCIES += libselinux
else
LVM2_CONF_OPTS += --disable-selinux
endif
ifeq ($(BR2_STATIC_LIBS),y)
# configure: error: --enable-cmdlib requires dynamic linking.
LVM2_CONF_OPTS += --disable-cmdlib
# configure: error: --enable-dmeventd requires --enable-cmdlib to be used as well
LVM2_CONF_OPTS += --disable-dmeventd
# install static version of the devmapper library
LVM2_CONF_OPTS += --enable-static_link
endif
ifeq ($(BR2_PACKAGE_LVM2_STANDARD_INSTALL),y)
LVM2_DEPENDENCIES += libaio
LVM2_INSTALL_STAGING_OPTS += install
LVM2_INSTALL_TARGET_OPTS += install
ifeq ($(BR2_INIT_SYSTEMD),y)
LVM2_INSTALL_TARGET_OPTS += install_systemd_units install_systemd_generators
endif
else
LVM2_MAKE_OPTS = device-mapper
LVM2_INSTALL_STAGING_OPTS += install_device-mapper
LVM2_INSTALL_TARGET_OPTS += install_device-mapper
endif
ifeq ($(BR2_TOOLCHAIN_SUPPORTS_PIE),)
LVM2_CONF_ENV += ac_cv_flag_HAVE_PIE=no
endif
HOST_LVM2_DEPENDENCIES = host-pkgconf host-libaio
HOST_LVM2_CONF_OPTS = \
--enable-write_install \
--enable-pkgconfig \
--disable-cmdlib \
--disable-dmeventd \
--disable-fsadm \
--disable-readline \
--disable-selinux \
--with-confdir=$(HOST_DIR)/etc
define LVM2_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_MD)
$(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_DM)
endef
$(eval $(autotools-package))
$(eval $(host-autotools-package))