Merge remote-tracking branch 'origin/lance/live-iso' into staging

This commit is contained in:
Lance R. Vick 2024-02-27 11:32:01 -08:00
commit 9b08093da5
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
11 changed files with 2299 additions and 9 deletions

View file

@ -0,0 +1,42 @@
FROM scratch as base
ENV VERSION=4.2
ENV SRC_HASH=64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527
ENV SRC_FILE=dosfstools-${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/dosfstools/dosfstools/releases/download/v${VERSION}/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/m4 . /
COPY --from=stagex/libtool . /
COPY --from=stagex/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/musl . /
RUN tar -xzf ${SRC_FILE}
WORKDIR dosfstools-${VERSION}
RUN --network=none <<-EOF
set -eux
./autogen.sh
./configure \
--build=x86_64-unknown-linux-musl \
--host=x86_64-unknown-linux-musl \
--prefix=/usr \
--sbindir=/sbin \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--enable-compat-symlinks
EOF
FROM build as install
RUN --network=none make DESTDIR=/rootfs install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View file

@ -0,0 +1,57 @@
FROM scratch as base
ENV VERSION=6.7
ENV SRC_HASH=ef31144a2576d080d8c31698e83ec9f66bf97c677fa2aaf0d5bbb9f3345b1069
ENV SRC_FILE=linux-${VERSION}.tar.xz
ENV SRC_SITE=http://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/binutils . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/elfutils . /
COPY --from=stagex/openssl . /
COPY --from=stagex/perl . /
COPY --from=stagex/m4 . /
COPY --from=stagex/gcc . /
COPY --from=stagex/bison . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/zlib . /
COPY --from=stagex/flex . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/coreutils . /
COPY --from=stagex/findutils . /
COPY --from=stagex/diffutils . /
COPY --from=stagex/tar . /
COPY --from=stagex/gzip . /
COPY --from=stagex/xz . /
COPY --from=stagex/sed . /
COPY --from=stagex/grep . /
COPY --from=stagex/gawk . /
COPY --from=stagex/bc . /
COPY --from=stagex/bash . /
COPY --from=stagex/bash /bin/bash /bin/sh
RUN tar -xf ${SRC_FILE}
WORKDIR linux-${VERSION}
ADD linux.config .config
ENV KBUILD_BUILD_TIMESTAMP=1
RUN <<-EOF
set -eux
mkdir /tmp
make bzImage
EOF
FROM build as install
RUN <<-EOF
set -eux
mkdir /rootfs
cp .config /rootfs/linux.config
cp arch/x86_64/boot/bzImage /rootfs
EOF
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,6 @@ FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/binutils . /
@ -23,20 +22,37 @@ COPY --from=stagex/libzstd . /
COPY --from=stagex/zlib . /
COPY --from=stagex/flex . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/coreutils . /
COPY --from=stagex/findutils . /
COPY --from=stagex/diffutils . /
COPY --from=stagex/tar . /
COPY --from=stagex/gzip . /
COPY --from=stagex/xz . /
COPY --from=stagex/sed . /
COPY --from=stagex/grep . /
COPY --from=stagex/gawk . /
COPY --from=stagex/bc . /
COPY --from=stagex/bash . /
COPY --from=stagex/bash /bin/bash /bin/sh
RUN tar -xf ${SRC_FILE}
WORKDIR linux-${VERSION}
RUN <<-EOF
set -eux
mkdir /tmp
make oldconfig
make
make bzImage
make modules INSTALL_MOD_PATH=/rootfs
EOF
FROM build as install
RUN <<-EOF
set -eux
make DESTDIR=/rootfs install
mkdir -p /rootfs/usr
mkdir -p /rootfs/lib/modules /lib/modules
make INSTALL_MOD_PATH=/rootfs modules_install
cp .config /rootfs/linux.config
cp arch/x86_64/boot/bzImage /rootfs
EOF
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View file

@ -0,0 +1,38 @@
FROM scratch as base
ARG ARCH=x86_64
ENV VERSION=4.0.43
ENV SRC_HASH=541e179665dc4e272b9602f2074243591a157da89cc47064da8c5829dbd2b339
ENV SRC_FILE=mtools-${VERSION}.tar.bz2
ENV SRC_SITE=https://ftp.gnu.org/gnu/mtools/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
RUN tar -xjf ${SRC_FILE}
WORKDIR mtools-${VERSION}
ENV FORCE_UNSAFE_CONFIGURE=1
RUN --network=none <<-EOF
set -ex
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc/mtools \
--without-x
make -j "$(nproc)"
EOF
FROM build as install
RUN --network=none make DESTDIR="/rootfs" install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View file

@ -0,0 +1,40 @@
FROM scratch as base
ENV VERSION=6.04-pre1
ENV SRC_HASH=3f6d50a57f3ed47d8234fd0ab4492634eb7c9aaf7dd902f33d3ac33564fd631d
ENV SRC_FILE=syslinux-${VERSION}.tar.xz
ENV SRC_SITE=https://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/perl . /
COPY --from=stagex/musl . /
COPY --from=stagex/util-linux . /
COPY --from=stagex/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR syslinux-${VERSION}
COPY *.patch .
RUN --network=none <<-EOF
patch -p1 < fix-sysmacros.patch
patch -p1 < prevent-pow-optimization.patch
patch -p1 < gcc-10.patch
make efi64 installer
EOF
FROM build as install
RUN make -j1 INSTALLROOT="/rootfs" MANDIR=/usr/share/man bios efi64 install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM base as test
COPY --from=install /rootfs /
COPY --from=stagex/musl . /
COPY --from=stagex/busybox . /
RUN syslinux --version
FROM scratch as package
COPY --from=install /rootfs /

View file

@ -0,0 +1,12 @@
diff --git a/extlinux/main.c b/extlinux/main.c
index a7ebd49..69bb164 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -41,6 +41,7 @@
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/vfs.h>
+#include <sys/sysmacros.h>
#include "linuxioctl.h"

View file

@ -0,0 +1,109 @@
From 951928f2cad5682c2844e6bd0f7201236c5d9b66 Mon Sep 17 00:00:00 2001
From: Merlin Mathesius <mmathesi@redhat.com>
Date: Wed, 13 May 2020 08:02:27 -0500
Subject: [PATCH] Workaround multiple definition of symbol errors
---
com32/cmenu/Makefile | 2 +-
com32/elflink/ldlinux/Makefile | 2 +-
com32/gpllib/Makefile | 2 +-
com32/hdt/Makefile | 2 +-
core/Makefile | 2 +-
dos/Makefile | 2 +-
efi/Makefile | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
index b81b68ed..2ae989c4 100644
--- a/com32/cmenu/Makefile
+++ b/com32/cmenu/Makefile
@@ -49,7 +49,7 @@ makeoutputdirs:
@mkdir -p $(OBJ)/libmenu
libmenu/libmenu.elf: $(LIBMENU)
- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \
+ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \
-o $@ $^
tidy dist:
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
index 87c0d362..2be2a01a 100644
--- a/com32/elflink/ldlinux/Makefile
+++ b/com32/elflink/ldlinux/Makefile
@@ -33,7 +33,7 @@ endif
all: $(BTARGET) ldlinux_lnx.a
ldlinux.elf : $(OBJS)
- $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS)
+ $(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS)
LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
LNXLIBOBJS = get_key.lo
diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
index 1fec9145..2d764d0b 100644
--- a/com32/gpllib/Makefile
+++ b/com32/gpllib/Makefile
@@ -24,7 +24,7 @@ makeoutputdirs:
$(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b))
libgpl.elf : $(LIBOBJS)
- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
+ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
tidy dist clean:
find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
index 61736d05..1d947857 100644
--- a/com32/hdt/Makefile
+++ b/com32/hdt/Makefile
@@ -52,7 +52,7 @@ QEMU ?= qemu-kvm
all: $(MODULES) $(TESTFILES)
hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
- $(LD) $(LDFLAGS) -o $@ $^
+ $(LD) $(LDFLAGS) -z muldefs -o $@ $^
memtest:
-[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST)
diff --git a/core/Makefile b/core/Makefile
index 46cb037c..f0cfcbe9 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -156,7 +156,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld
NASM_ELF = elf
%.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS)
- $(LD) $(LDFLAGS) -pie -Bsymbolic \
+ $(LD) $(LDFLAGS) -z muldefs -pie -Bsymbolic \
-T $(LDSCRIPT) \
--unresolved-symbols=report-all \
-E --hash-style=gnu -M -o $@ $< \
diff --git a/dos/Makefile b/dos/Makefile
index 4c930d19..5d1c72ca 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -19,7 +19,7 @@ include $(MAKEDIR)/embedded.mk
CFLAGS += -D__MSDOS__ -mregparm=3 -DREGPARM=3
# CFLAGS += -DDEBUG
-LDFLAGS = -T $(SRC)/dosexe.ld
+LDFLAGS = -T $(SRC)/dosexe.ld -z muldefs
OPTFLAGS = -g
INCLUDES = -include code16.h -nostdinc -iwithprefix include \
-I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \
diff --git a/efi/Makefile b/efi/Makefile
index bbf23f24..3dd922d5 100644
--- a/efi/Makefile
+++ b/efi/Makefile
@@ -69,7 +69,7 @@ $(OBJS): | $(OBJ)/$(ARCH)
BTARGET = syslinux.efi
syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
- $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
+ $(LD) $(LDFLAGS) -z muldefs --strip-debug -o $@ $^ -lgnuefi -lefi
# We need to rename the .hash section because the EFI firmware
# linker really doesn't like it.
--
2.25.1

View file

@ -0,0 +1,36 @@
From: Lukas Schwaighofer <lukas@schwaighofer.name>
Date: Tue, 26 Feb 2019 23:13:58 +0100
Subject: Prevent optimizing the pow() function
With the current GCC 8.2.0 from Debian, a section of code calling pow() in
zzjson_parse.c is turned into a sequence calling exp(). Since no exp()
implementation is available in syslinux those optimizations need to be
disabled.
---
com32/gpllib/zzjson/zzjson_parse.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/com32/gpllib/zzjson/zzjson_parse.c b/com32/gpllib/zzjson/zzjson_parse.c
index ecb6f61..e66a9d8 100644
--- a/com32/gpllib/zzjson/zzjson_parse.c
+++ b/com32/gpllib/zzjson/zzjson_parse.c
@@ -138,6 +138,10 @@ static ZZJSON *parse_string2(ZZJSON_CONFIG *config) {
return zzjson;
}
+static double __attribute__((optimize("O0"))) pow_noopt(double x, double y) {
+ return pow(x, y);
+}
+
static ZZJSON *parse_number(ZZJSON_CONFIG *config) {
ZZJSON *zzjson;
unsigned long long ival = 0, expo = 0;
@@ -213,7 +217,7 @@ skipexpo:
if (dbl) {
dval = sign * (long long) ival;
dval += sign * frac;
- dval *= pow(10.0, (double) signexpo * expo);
+ dval *= pow_noopt(10.0, (double) signexpo * expo);
}
zzjson = config->calloc(1, sizeof(ZZJSON));

View file

@ -0,0 +1,53 @@
FROM scratch as base
ENV VERSION=2.39.3
ENV SRC_HASH=d3315ff701890f4fa1dd38ea387767fcb9e1aaeb763eb904677c03d2a7a5bdc1
ENV SRC_FILE=util-linux-${VERSION}.tar.gz
ENV SRC_SITE=https://codeload.github.com/util-linux/util-linux/legacy.tar.gz/v${VERSION}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/perl . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/gettext . /
COPY --from=stagex/bison . /
COPY --from=stagex/libtool . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/m4 . /
COPY --from=stagex/make . /
RUN mkdir util-linux
RUN tar -xvf $SRC_FILE --strip-components=1 -C util-linux
WORKDIR util-linux
RUN --network=none <<-EOF
set -eux
./autogen.sh
./configure \
--build=x86_64-unknown-linux-musl \
--host=x86_64-unknown-linux-musl \
--prefix=/usr \
--disable-nls \
--with-vendordir=/usr/lib \
--enable-fs-paths-extra=/usr/sbin \
--disable-silent-rules \
--disable-gtk-doc \
--enable-newgrp
make
EOF
FROM build as install
RUN <<-EOF
printf "root:x:0:root\ntty:x:5:" >> /etc/group
printf "root:x:0:0:root:/root:/bin/sh" >> /etc/passwd
make DESTDIR=/rootfs install
EOF
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View file

@ -189,6 +189,22 @@ out/diffutils/index.json: \
out/musl/index.json
$(call build,diffutils)
.PHONY: dosfstools
dosfstools: out/dosfstools/index.json
out/dosfstools/index.json: \
packages/dosfstools/Containerfile \
out/autoconf/index.json \
out/automake/index.json \
out/binutils/index.json \
out/busybox/index.json \
out/gcc/index.json \
out/libtool/index.json \
out/m4/index.json \
out/make/index.json \
out/musl/index.json \
out/perl/index.json
$(call build,dosfstools)
.PHONY: ed
ed: out/ed/index.json
out/ed/index.json: \
@ -586,16 +602,23 @@ out/libzstd/index.json: \
out/zlib/index.json
$(call build,libzstd)
.PHONY: linux-generic
linux-generic: out/linux-generic/index.json
out/linux-generic/index.json: \
packages/linux-generic/Containerfile \
.PHONY: linux-airgap
linux-airgap: out/linux-airgap/index.json
out/linux-airgap/index.json: \
packages/linux-airgap/Containerfile \
out/bash/index.json \
out/bc/index.json \
out/binutils/index.json \
out/bison/index.json \
out/busybox/index.json \
out/coreutils/index.json \
out/diffutils/index.json \
out/elfutils/index.json \
out/findutils/index.json \
out/flex/index.json \
out/gawk/index.json \
out/gcc/index.json \
out/grep/index.json \
out/gzip/index.json \
out/libzstd/index.json \
out/linux-headers/index.json \
out/m4/index.json \
@ -604,6 +627,40 @@ out/linux-generic/index.json: \
out/openssl/index.json \
out/perl/index.json \
out/pkgconf/index.json \
out/sed/index.json \
out/tar/index.json \
out/xz/index.json \
out/zlib/index.json
$(call build,linux-airgap)
.PHONY: linux-generic
linux-generic: out/linux-generic/index.json
out/linux-generic/index.json: \
packages/linux-generic/Containerfile \
out/bash/index.json \
out/bc/index.json \
out/binutils/index.json \
out/bison/index.json \
out/coreutils/index.json \
out/diffutils/index.json \
out/elfutils/index.json \
out/findutils/index.json \
out/flex/index.json \
out/gawk/index.json \
out/gcc/index.json \
out/grep/index.json \
out/gzip/index.json \
out/libzstd/index.json \
out/linux-headers/index.json \
out/m4/index.json \
out/make/index.json \
out/musl/index.json \
out/openssl/index.json \
out/perl/index.json \
out/pkgconf/index.json \
out/sed/index.json \
out/tar/index.json \
out/xz/index.json \
out/zlib/index.json
$(call build,linux-generic)
@ -717,6 +774,17 @@ out/meson/index.json: \
out/zlib/index.json
$(call build,meson)
.PHONY: mtools
mtools: out/mtools/index.json
out/mtools/index.json: \
packages/mtools/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/gcc/index.json \
out/make/index.json \
out/musl/index.json
$(call build,mtools)
.PHONY: musl
musl: out/musl/index.json
out/musl/index.json: \
@ -963,6 +1031,20 @@ out/sxctl/index.json: \
out/go/index.json
$(call build,sxctl)
.PHONY: syslinux
syslinux: out/syslinux/index.json
out/syslinux/index.json: \
packages/syslinux/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/gcc/index.json \
out/linux-headers/index.json \
out/make/index.json \
out/musl/index.json \
out/perl/index.json \
out/util-linux/index.json
$(call build,syslinux)
.PHONY: tar
tar: out/tar/index.json
out/tar/index.json: \
@ -1004,6 +1086,26 @@ out/tofu/index.json: \
out/go/index.json
$(call build,tofu)
.PHONY: util-linux
util-linux: out/util-linux/index.json
out/util-linux/index.json: \
packages/util-linux/Containerfile \
out/autoconf/index.json \
out/automake/index.json \
out/binutils/index.json \
out/bison/index.json \
out/busybox/index.json \
out/gcc/index.json \
out/gettext/index.json \
out/libtool/index.json \
out/linux-headers/index.json \
out/m4/index.json \
out/make/index.json \
out/musl/index.json \
out/perl/index.json \
out/pkgconf/index.json
$(call build,util-linux)
.PHONY: xorriso
xorriso: out/xorriso/index.json
out/xorriso/index.json: \