From dbd267f4b7c09a58cb2a5562cebcafe4c0a9d55b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 8 Jul 2024 04:04:29 -0500 Subject: [PATCH] Repackage Linux From Scratch 12.1 sources into a squashfs image. --- mkroot/packages/lfs-sources | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 mkroot/packages/lfs-sources diff --git a/mkroot/packages/lfs-sources b/mkroot/packages/lfs-sources new file mode 100755 index 00000000..63269cf4 --- /dev/null +++ b/mkroot/packages/lfs-sources @@ -0,0 +1,35 @@ +#!/bin/echo Try "mkroot/mkroot.sh lfs" + +[ -z "$(which mksquashfs)" ] && echo "no squashfs" && exit 1 + +# Download osuosl's rollup tarball of all the LFS packages. + +download 45a27da2ee443a8e35a7e29db8a0c6877bbb98bb \ + http://ftp.osuosl.org/pub/lfs/lfs-packages/lfs-packages-12.1.tar + +# This one's a little weird, we're creating a target-agonstic squashfs image +# not part of the initramfs. + +setupfor lfs-packages +LFS="$OUTPUT/lfs" LFSRC="$LFS/src" +rm -rf "$LFS" && mkdir -p "$LFSRC/tzdata" && +# Fixup names +tar xfC tzdata*.tar.gz "$LFSRC/tzdata" && # Horrible package, no subdirectory! +rm tzdata*.tar.gz && +mv {expect*,expect-0}.tar.gz && # broken name (no - before version) +rm -f tcl*-html.tar.gz && # Broken _and_ duplicate name +mv {tcl*,tcl-0}.tar.gz && +mkdir sub || exit 1 +# extract tarballs to package name in output and apply patches (if any) +for i in *.tar*; do + PKG="${i/-[0-9]*/}" + echo process $PKG + tar xfC $i sub && mv sub/* "$LFSRC/$PKG" || exit 1 + for j in $PKG*.patch; do + [ -e "$j" ] && { ( cd "$LFSRC/$PKG" && patch -p1) < "$j" || exit 1 ; } + done +done + +# Archive the sources + +mksquashfs "$LFSRC" "$TOP"/lfs.sqf -noappend -all-root >/dev/null -- 2.39.2