1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-06-26 05:00:11 +02:00
build/pkg/musl/build
David Oberhollenzer 90b2586ea4 Restructure assembly of root filesystem image
Every package now has or generates a rootfs_files.txt containing a list
of files that should be packed into the rootfs, their permissions and
their owner.

This gives us fine grained controll over the owners and permissions of the
rootfs files (by generating a squashfs pseudo file).

In subsequent steps, this allows us to remove the deploy/devdeploy split and
actually simplifiy most of the build scripts.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-17 20:22:10 +02:00

48 lines
1.2 KiB
Plaintext
Executable file

VERSION="1.1.19"
SRCDIR="musl-$VERSION"
TARBALL="$SRCDIR.tar.gz"
URL="https://www.musl-libc.org/releases"
SHA256SUM="db59a8578226b98373f5b27e61f0dd29ad2456f4aa9cec587ba8c24508e4c1d9"
DEPENDS="tc-gcc1 linux_headers"
prepare() {
return
}
build() {
CC="${TARGET}-gcc" $1/configure --prefix=/ --target="$TARGET"
CC="${TARGET}-gcc" make -j $NUMJOBS
}
deploy() {
local INPUT="$1"
local DEPLOY="$2"
local DEVDEPLOY="$3"
DESTDIR="$DEVDEPLOY" make install-headers
DESTDIR="$DEVDEPLOY" make install-libs
rm $DEVDEPLOY/lib/*.so*
DESTDIR="$DEPLOY" make install-libs
rm $DEPLOY/lib/*.a $DEPLOY/lib/*.o
mkdir -p "$DEPLOY/etc"
cat_file_merge "LDPATH" > "$DEPLOY/etc/ld-musl-${MUSL_CPU}.path"
strip_files ${DEPLOY}/lib/*
find "$DEPLOY/lib" -exec stat {} --printf="%n m %a 0 0\\n" \; | \
sed "s#^$DEPLOY/##g" | sed "s/644/444/g" | \
sed "s/755/555/g" | tail -n +2 > "$DEPLOY/rootfs_files.txt"
find "$DEPLOY/etc" -exec stat {} --printf="%n m %a 0 0\\n" \; | \
sed "s#^$DEPLOY/##g" | tail -n +2 >> "$DEPLOY/rootfs_files.txt"
}
check_update() {
curl --silent -L "$URL" | grep -o ">musl-[0-9.]*tar.gz<" | \
sed 's/>musl-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}