Skip to content

Commit

Permalink
Repackage Linux From Scratch 12.1 sources into a squashfs image.
Browse files Browse the repository at this point in the history
  • Loading branch information
landley committed Jul 8, 2024
1 parent afc993e commit dbd267f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions mkroot/packages/lfs-sources
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dbd267f

Please sign in to comment.