updates for iso

This commit is contained in:
emmett1
2023-04-07 14:48:24 +08:00
parent c2c33f340a
commit 7db284a950
18 changed files with 192 additions and 63 deletions

1
.gitignore vendored
View File

@@ -16,4 +16,5 @@ venomlinux-rootfs*.tar.xz.md5
*-gitignore.sh
*.iso
*.iso.md5
*.iso.sha256sum
*/*/.*.swp

View File

@@ -1,12 +0,0 @@
#
# /etc/scratchpkg.repo : scratchpkg repo file
#
# format:
# <repo directory> <repo url for sync>
#
#/usr/ports/core https://raw.githubusercontent.com/venomlinux/ports/master/core
#/usr/ports/multilib https://raw.githubusercontent.com/venomlinux/ports/master/multilib
#/usr/ports/nonfree https://raw.githubusercontent.com/venomlinux/ports/master/nonfree
#/usr/ports/community https://raw.githubusercontent.com/venomlinux/ports/master/community
#/usr/ports/testing https://raw.githubusercontent.com/venomlinux/ports/master/testing

View File

@@ -1,4 +1,5 @@
a1ec4bfb2ae5116db789397aa796683a detect-venom-fallback-initrd.patch
da388905710bb4cbfbc7bd7346ff9174 grub-2.06-upstream_fixes-1.patch
cf0fd928b1e5479c8108ee52cb114363 grub-2.06.tar.xz
5555ecc4025d7b5cf01709ed7bfe6e5f grub.cfg
b4a4d287513091e7e66eca5853101a93 grub.default

View File

@@ -1,4 +1,4 @@
grub-2.06-4
grub-2.06-5
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/bash_completion.d/
-rw-r--r-- root/root etc/bash_completion.d/grub
@@ -622,6 +622,7 @@ drwxr-xr-x root/root usr/lib/grub/i386-pc/
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/grub/
-rw-r--r-- root/root usr/share/grub/grub-mkconfig_lib
-rw-r--r-- root/root usr/share/grub/grub.cfg
drwxr-xr-x root/root usr/share/info/
-rw-r--r-- root/root usr/share/info/grub-dev.info.gz
-rw-r--r-- root/root usr/share/info/grub.info-1.gz

View File

@@ -0,0 +1,135 @@
Submitted By: Xi Ruoyao <xry111 AT xry111 DOT site>
Date: 2023-02-18
Initial Package Version: 2.06
Upstream Status: Committed
Origin: Upstream git repository, commit SHA follows:
7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763
2e9fa73a040462b81bfbfe56c0bc7ad2d30b446b
Description: Recognize ext2/3/4 filesystem features
metdata_csum_seed and large_dir; ignore them as
they are not used by GRUB and can be safely
ignored, instead of treat these unrecognized
features as hard errors. Particularly, the
metadata_csum_seed feature is enabled by
e2fsprogs >= 1.47.0, so failing to recognize it
will cause grub-install failure if the /boot
partition (or /, when /boot is not a separate
partition) is created by a recent mkfs.ext4.
From 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Fri, 11 Jun 2021 21:36:16 +0200
Subject: [PATCH] fs/ext2: Ignore checksum seed incompat feature
This incompat feature is used to denote that the filesystem stored its
metadata checksum seed in the superblock. This is used to allow tune2fs
changing the UUID on a mounted metdata_csum filesystem without having
to rewrite all the disk metadata. However, the GRUB doesn't use the
metadata checksum at all. So, it can just ignore this feature if it
is enabled. This is consistent with the GRUB filesystem code in general
which just does a best effort to access the filesystem's data.
The checksum seed incompat feature has to be removed from the ignore
list if the support for metadata checksum verification is added to the
GRUB ext2 driver later.
Suggested-by: Eric Sandeen <esandeen@redhat.com>
Suggested-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/fs/ext2.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c
index e7dd78e66..4953a1591 100644
--- a/grub-core/fs/ext2.c
+++ b/grub-core/fs/ext2.c
@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
#define EXT4_FEATURE_INCOMPAT_MMP 0x0100
#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
+#define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000
#define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000
/* The set of back-incompatible features this driver DOES support. Add (OR)
@@ -123,10 +124,15 @@ GRUB_MOD_LICENSE ("GPLv3+");
* mmp: Not really back-incompatible - was added as such to
* avoid multiple read-write mounts. Safe to ignore for this
* RO driver.
+ * checksum seed: Not really back-incompatible - was added to allow tools
+ * such as tune2fs to change the UUID on a mounted metadata
+ * checksummed filesystem. Safe to ignore for now since the
+ * driver doesn't support checksum verification. However, it
+ * has to be removed from this list if the support is added later.
*/
#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
- | EXT4_FEATURE_INCOMPAT_MMP)
-
+ | EXT4_FEATURE_INCOMPAT_MMP \
+ | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
#define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U
--
2.39.2
From 2e9fa73a040462b81bfbfe56c0bc7ad2d30b446b Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Tue, 30 Aug 2022 22:41:59 -0400
Subject: [PATCH] fs/ext2: Ignore the large_dir incompat feature
Recently, ext4 added the large_dir feature, which adds support for
a 3 level htree directory support.
The GRUB supports existing file systems with htree directories by
ignoring their existence, and since the index nodes for the hash tree
look like deleted directory entries (by design), the GRUB can simply do
a brute force O(n) linear search of directories. The same is true for
3 level deep htrees indicated by large_dir feature flag.
Hence, it is safe for the GRUB to ignore the large_dir incompat feature.
Fixes: https://savannah.gnu.org/bugs/?61606
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/fs/ext2.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c
index 0989e26e1..e1cc5e62a 100644
--- a/grub-core/fs/ext2.c
+++ b/grub-core/fs/ext2.c
@@ -104,6 +104,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
#define EXT4_FEATURE_INCOMPAT_MMP 0x0100
#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
#define EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000
+#define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3 level htree */
#define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000
/* The set of back-incompatible features this driver DOES support. Add (OR)
@@ -129,10 +130,17 @@ GRUB_MOD_LICENSE ("GPLv3+");
* checksummed filesystem. Safe to ignore for now since the
* driver doesn't support checksum verification. However, it
* has to be removed from this list if the support is added later.
+ * large_dir: Not back-incompatible given that the GRUB ext2 driver does
+ * not implement EXT2_FEATURE_COMPAT_DIR_INDEX. If the GRUB
+ * eventually supports the htree feature (aka dir_index)
+ * it should support 3 level htrees and then move
+ * EXT4_FEATURE_INCOMPAT_LARGEDIR to
+ * EXT2_DRIVER_SUPPORTED_INCOMPAT.
*/
#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
| EXT4_FEATURE_INCOMPAT_MMP \
- | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
+ | EXT4_FEATURE_INCOMPAT_CSUM_SEED \
+ | EXT4_FEATURE_INCOMPAT_LARGEDIR)
#define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U
--
2.39.2

View File

@@ -21,20 +21,20 @@ else
set color_highlight=white/blue
fi
menuentry "Boot Venom Linux @RLS@ (UEFI mode)" {
menuentry "Boot Venom Linux (UEFI mode)" {
linux /boot/vmlinuz ro quiet
initrd /boot/initrd
}
menuentry "Boot Venom Linux @RLS@ (UEFI mode) debug" {
menuentry "Boot Venom Linux (UEFI mode) debug" {
set background_color=black
linux /boot/vmlinuz ro verbose
initrd /boot/initrd
}
menuentry "Boot Venom Linux @RLS@ (UEFI mode) [Ram]" {
menuentry "Boot Venom Linux (UEFI mode) [Ram]" {
linux /boot/vmlinuz ro quiet ram
initrd /boot/initrd
}
menuentry "Boot Venom Linux @RLS@ (UEFI mode) [Ram] debug" {
menuentry "Boot Venom Linux (UEFI mode) [Ram] debug" {
set background_color=black
linux /boot/vmlinuz ro verbose ram
initrd /boot/initrd

View File

@@ -3,12 +3,13 @@
name=grub
version=2.06
release=4
release=5
backup="etc/default/grub"
source="https://ftp.gnu.org/gnu/$name/$name-$version.tar.xz
grub.default
detect-venom-fallback-initrd.patch
https://www.linuxfromscratch.org/patches/blfs/svn/grub-2.06-upstream_fixes-1.patch"
grub-2.06-upstream_fixes-1.patch
grub.cfg"
build() {
# workaround for https://savannah.gnu.org/bugs/?60458
@@ -39,7 +40,9 @@ build() {
make
make DESTDIR=$PKG install
# Borrow from Arch
install -D -m0644 $SRC/grub.default $PKG/etc/default/grub
# liveiso stuff
cp $SRC/grub.cfg $PKG/usr/share/$name
}

View File

@@ -1,3 +1,4 @@
cce74924f25220228f9492973f3814b4 base.hook
1c1c7bd8abb0ce614397b1a5d287e8f6 mkinitramfs-20220427.tar.gz
c2c85eacc62694f8c4a9d99c7f04f38d liveiso.hook
2c0dfdaf25bd902eea657a50cb7ab075 mkinitramfs-63c0bb3acaf3c9e0146007e08c13be448e1814c9.tar.gz
86e4e8ba8abc12ecbfcc167889868797 mkinitramfs.conf

View File

@@ -12,7 +12,7 @@ drwxr-xr-x root/root usr/share/mkinitramfs/hooks/
-rw-r--r-- root/root usr/share/mkinitramfs/hooks/automod.hook
-rw-r--r-- root/root usr/share/mkinitramfs/hooks/base.hook
-rw-r--r-- root/root usr/share/mkinitramfs/hooks/encrypt.hook
-rw-r--r-- root/root usr/share/mkinitramfs/hooks/liveiso.hook
-rw-r--r-- root/root usr/share/mkinitramfs/hooks/modules.hook
-rw-r--r-- root/root usr/share/mkinitramfs/hooks/udev.hook
-rw-r--r-- root/root usr/share/mkinitramfs/hooks/venomiso.hook
-rw-r--r-- root/root usr/share/mkinitramfs/init.in

View File

@@ -43,7 +43,7 @@ run_earlyhook() {
mount_venomiso() {
newroot=$1
MEDIA=/dev/disk/by-label/@ISOLABEL@
MEDIA=/dev/disk/by-label/LIVEISO
MEDIUM=/run/initramfs/medium
SYSTEM=/run/initramfs/system
WRITEDIR=/run/initramfs/overlayfs/write

View File

@@ -5,14 +5,17 @@ name=mkinitramfs
version=20220427
release=1
backup="etc/mkinitramfs.conf"
commit=8fae073690ac7ea49f0951ea3355b6196eca7a12
source="$name-$version.tar.gz::https://github.com/venomlinux/mkinitramfs/archive/$commit.tar.gz
commit=63c0bb3acaf3c9e0146007e08c13be448e1814c9
source="$name-$commit.tar.gz::https://github.com/venomlinux/mkinitramfs/archive/$commit.tar.gz
mkinitramfs.conf
base.hook"
base.hook
liveiso.hook"
build() {
cd $name-$commit
DESTDIR=$PKG ./INSTALL.sh
install -m644 $SRC/mkinitramfs.conf $PKG/etc/
install -m644 $SRC/base.hook $PKG/usr/share/mkinitramfs/hooks/base.hook
install -m644 $SRC/liveiso.hook $PKG/usr/share/mkinitramfs/hooks/liveiso.hook
rm $PKG/usr/share/mkinitramfs/hooks/venomiso.hook
}

View File

@@ -1,3 +1,5 @@
0adc9a5d743d4270063c68fe12b165e5 fix-build-with-glibc-2.36.patch
e65a5089185635b2d3d90b5f3a95aba9 isolinux.cfg
e089d2baceb324fbcb7685dc0ce88cc4 splash.png
92a253df9211e9c20172796ecf388f13 syslinux-6.03.tar.xz
3f1370d9ad233b9c717f14d5ae9859c1 syslinux-sysmacros.patch

View File

@@ -1,4 +1,4 @@
syslinux-6.03-3
syslinux-6.03-4
drwxr-xr-x root/root sbin/
-rwxr-xr-x root/root sbin/extlinux
drwxr-xr-x root/root usr/
@@ -337,6 +337,7 @@ drwxr-xr-x root/root usr/share/syslinux/efi64/
-rw-r--r-- root/root usr/share/syslinux/isohdppx_f.bin
-rw-r--r-- root/root usr/share/syslinux/isolinux-debug.bin
-rw-r--r-- root/root usr/share/syslinux/isolinux.bin
-rwxr-xr-x root/root usr/share/syslinux/isolinux.cfg
-rw-r--r-- root/root usr/share/syslinux/kbdmap.c32
-rw-r--r-- root/root usr/share/syslinux/kontron_wdt.c32
-rw-r--r-- root/root usr/share/syslinux/ldlinux.c32
@@ -369,6 +370,7 @@ drwxr-xr-x root/root usr/share/syslinux/efi64/
-rw-r--r-- root/root usr/share/syslinux/rosh.c32
-rw-r--r-- root/root usr/share/syslinux/sanboot.c32
-rw-r--r-- root/root usr/share/syslinux/sdi.c32
-rw-r--r-- root/root usr/share/syslinux/splash.png
-rw-r--r-- root/root usr/share/syslinux/sysdump.c32
-rw-r--r-- root/root usr/share/syslinux/syslinux.c32
-rw-r--r-- root/root usr/share/syslinux/syslinux.com

View File

@@ -25,22 +25,22 @@ MENU TABMSGROW -1
MENU CMDLINEROW -1
LABEL silent
MENU LABEL Boot Venom Linux @RLS@
MENU LABEL Boot Venom Linux
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd quiet
LABEL debug
MENU LABEL Boot Venom Linux @RLS@ (Debug)
MENU LABEL Boot Venom Linux (Debug)
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd verbose
LABEL silentram
MENU LABEL Boot Venom Linux @RLS@ [Ram]
MENU LABEL Boot Venom Linux [Ram]
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd quiet ram
LABEL debug
MENU LABEL Boot Venom Linux @RLS@ [Ram] (Debug)
MENU LABEL Boot Venom Linux [Ram] (Debug)
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd verbose ram

View File

@@ -3,10 +3,12 @@
name=syslinux
version=6.03
release=3
release=4
source="http://www.kernel.org/pub/linux/utils/boot/$name/$name-$version.tar.xz
$name-sysmacros.patch
fix-build-with-glibc-2.36.patch"
fix-build-with-glibc-2.36.patch
isolinux.cfg
splash.png"
build() {
cd $name-$version
@@ -25,5 +27,6 @@ build() {
make OPTFLAGS="$CFLAGS" INSTALLROOT=$PKG MANDIR=/usr/share/man install
cp venom/* $PKG/usr/share/syslinux
cp $SRC/isolinux.cfg $SRC/splash.png $PKG/usr/share/$name
}

View File

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 256 KiB

View File

@@ -60,16 +60,6 @@ umount_cache_and_portsrepo() {
# unmount packages and source cache
unmount $ROOTFS/var/cache/scratchpkg/packages
unmount $ROOTFS/var/cache/scratchpkg/sources
# mount ports dir
umount_repo
}
umount_repo() {
for repo in $REPO; do
unmount $ROOTFS/usr/ports/$repo
rm -rf $ROOTFS/usr/ports/$repo
done
}
unmount_any_mounted() {
@@ -87,16 +77,21 @@ mount_cache_and_portsrepo() {
bindmount $PKGDIR $ROOTFS/var/cache/scratchpkg/packages
# mount ports dir
mount_repo
copy_repo
}
mount_repo() {
copy_repo() {
for i in $ROOTFS/usr/ports/*; do
case $i in
*/core) continue;;
*) rm -fr $i;;
esac
done
for repo in $REPO; do
[ -d "$PORTSDIR/$repo" ] || {
msgerr "repo not exist: $repo"
}
mkdir -p "$ROOTFS/usr/ports/$repo"
bindmount "$PORTSDIR/$repo" "$ROOTFS/usr/ports/$repo"
cp -r "$PORTSDIR/$repo" "$ROOTFS/usr/ports"
done
}
@@ -241,8 +236,9 @@ make_iso() {
for file in $ISOLINUX_FILES; do
cp "$ROOTFS/usr/share/syslinux/$file" "$ISODIR/isolinux" || die "Failed copying isolinux file: $file"
done
cp "$FILESDIR/splash.png" "$ISODIR/isolinux"
sed "s/@RLS@/$RELEASE/g" "$FILESDIR/isolinux.cfg" > "$ISODIR/isolinux/isolinux.cfg"
#cp "$FILESDIR/splash.png" "$ISODIR/isolinux"
cp "$ROOTFS/usr/share/syslinux/splash.png" "$ISODIR/isolinux"
sed "s/Venom Linux/Venom Linux $RELEASE/g" "$ROOTFS/usr/share/syslinux/isolinux.cfg" > "$ISODIR/isolinux/isolinux.cfg"
[ -d "$PORTSDIR/virootfs" ] && {
cp -aR "$PORTSDIR/virootfs" "$ISODIR"
@@ -267,9 +263,8 @@ make_iso() {
cp "$ROOTFS/boot/vmlinuz-venom" "$ISODIR/boot/vmlinuz" || die "Failed copying kernel"
sed "s/@ISOLABEL@/$ISOLABEL/g" "$FILESDIR/venomiso.hook" > "$ROOTFS/etc/mkinitramfs.d/venomiso.hook" || die "Failed preparing venomiso.hook"
kernver=$(file $ROOTFS/boot/vmlinuz-venom | cut -d ' ' -f9)
chrootrun mkinitramfs -k $kernver -a venomiso || die "Failed create initramfs"
chrootrun mkinitramfs -k $kernver -a liveiso || die "Failed create initramfs"
cp "$ROOTFS/boot/initrd-venom.img" "$ISODIR/boot/initrd" || die "Failed copying initrd"
msg "Setup UEFI mode..."
@@ -282,7 +277,7 @@ make_iso() {
fi
echo "set prefix=/boot/grub" > "$ISODIR/boot/grub-early.cfg"
cp -a $ROOTFS/usr/lib/grub/x86_64-efi/*.{mod,lst} "$ISODIR/boot/grub/x86_64-efi" || die "Failed copying efi files"
sed "s/@RLS@/$RELEASE/g" "$FILESDIR/grub.cfg" > "$ISODIR/boot/grub/grub.cfg"
sed "s/Venom Linux/Venom Linux $RELEASE/g" "$ROOTFS/usr/share/grub/grub.cfg" > "$ISODIR/boot/grub/grub.cfg"
grub-mkimage -c "$ISODIR/boot/grub-early.cfg" -o "$ISODIR/efi/boot/bootx64.efi" -O x86_64-efi -p "" iso9660 normal search search_fs_file
modprobe loop
@@ -295,11 +290,6 @@ make_iso() {
unmount "$ISODIR/boot/efiboot"
rm -fr "$ISODIR/boot/efiboot"
# save list packages to iso
#for pkg in base linux $(echo $PKG | tr ',' ' '); do
# echo "$pkg" >> "$ISODIR/rootfs/pkglist"
#done
msg "Making iso: $OUTPUTISO ..."
rm -f "$OUTPUTISO" "$OUTPUTISO.md5"
xorriso -as mkisofs \
@@ -313,12 +303,14 @@ make_iso() {
-e boot/efiboot.img \
-no-emul-boot \
-isohybrid-gpt-basdat \
-volid $ISOLABEL \
-volid LIVEISO \
-o "$OUTPUTISO" "$ISODIR" || die "Failed creating iso: $OUTPUTISO"
msg "Cleaning iso directory: $ISODIR"
rm -fr "$ISODIR"
md5sum "$OUTPUTISO" > "$OUTPUTISO".md5
cd $(dirname $(realpath "$OUTPUTISO"))
sha256sum $(basename $(realpath "$OUTPUTISO")) > $(basename $(realpath "$OUTPUTISO")).sha256sum
cd - >/dev/null
msg "Making iso completed: $OUTPUTISO ($(ls -lh $OUTPUTISO | awk '{print $5}'))"
}
@@ -506,15 +498,12 @@ SRCDIR="${SRCDIR:-/var/cache/scratchpkg/sources}"
PKGDIR="${PKGDIR:-/var/cache/scratchpkg/packages}"
ROOTFS="${ROOTFS:-$PORTSDIR/rootfs}"
CCACHE_DIR="${CCACHEDIR:-/var/lib/ccache}"
FILESDIR="$PORTSDIR/files"
JOBS="${JOBS:-$(nproc)}"
REPO="main multilib nonfree testing"
REPOFILE="$FILESDIR/scratchpkg.repo"
# iso
ISODIR="${ISODIR:-/tmp/venomiso}"
ISOLABEL="VENOMLIVE_$(date +"%Y%m%d")"
ISO_PKG="linux-lts,squashfs-tools,grub-efi,btrfs-progs,reiserfsprogs,xfsprogs,syslinux"
OUTPUTISO="${OUTPUTISO:-$PORTSDIR/venomlinux-$RELEASE-$ARCH.iso}"

View File

@@ -13,7 +13,7 @@ as_root()
case ${0##*/} in
*-runit.sh) INIT=runit;;
*) INIT=svsv;;
*) INIT=sysv;;
esac
PORTSDIR="$(dirname $(dirname $(realpath $0)))"