From 0932c5ae0bece3c59c103fbcb39b8f4dc881d13d Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 24 Jan 2018 13:41:45 +0100 Subject: [PATCH] Merge rootfs packages Signed-off-by: David Oberhollenzer --- cfg/alix/TOOLCHAIN | 1 + cfg/rpi3/LDPATH | 1 + cfg/rpi3/TOOLCHAIN | 1 + pkg/release-alix/build | 2 +- pkg/release-rpi3/build | 2 +- pkg/rootfs-rpi3/build | 45 ------------------------------- pkg/{rootfs-alix => rootfs}/build | 8 ++++-- 7 files changed, 11 insertions(+), 49 deletions(-) create mode 100644 cfg/rpi3/LDPATH delete mode 100755 pkg/rootfs-rpi3/build rename pkg/{rootfs-alix => rootfs}/build (78%) diff --git a/cfg/alix/TOOLCHAIN b/cfg/alix/TOOLCHAIN index 18db615..a1edf1e 100644 --- a/cfg/alix/TOOLCHAIN +++ b/cfg/alix/TOOLCHAIN @@ -1,5 +1,6 @@ TARGET="i686-linux-musl" GCC_CPU="i686" +MUSL_CPU="i386" GCC_EXTRACFG="--disable-libmpx --disable-libssp" diff --git a/cfg/rpi3/LDPATH b/cfg/rpi3/LDPATH new file mode 100644 index 0000000..b0a1aeb --- /dev/null +++ b/cfg/rpi3/LDPATH @@ -0,0 +1 @@ +/opt/vc/lib diff --git a/cfg/rpi3/TOOLCHAIN b/cfg/rpi3/TOOLCHAIN index b0e277c..02e7c14 100644 --- a/cfg/rpi3/TOOLCHAIN +++ b/cfg/rpi3/TOOLCHAIN @@ -1,5 +1,6 @@ TARGET="arm-linux-musleabihf" GCC_CPU="armv6" +MUSL_CPU="arm" GCC_EXTRACFG="--with-float=hard --with-fpu=neon-vfpv3" diff --git a/pkg/release-alix/build b/pkg/release-alix/build index f331000..6d35953 100755 --- a/pkg/release-alix/build +++ b/pkg/release-alix/build @@ -1,4 +1,4 @@ -DEPENDS="rootfs-alix linux" +DEPENDS="rootfs linux" build() { local SOURCE="$1" diff --git a/pkg/release-rpi3/build b/pkg/release-rpi3/build index 789c3a6..cfc7e2b 100755 --- a/pkg/release-rpi3/build +++ b/pkg/release-rpi3/build @@ -1,4 +1,4 @@ -DEPENDS="rootfs-rpi3 linux-rpi3 boot-rpi3" +DEPENDS="rootfs linux-rpi3 boot-rpi3" build() { local SOURCE="$1" diff --git a/pkg/rootfs-rpi3/build b/pkg/rootfs-rpi3/build deleted file mode 100755 index e5fb4f0..0000000 --- a/pkg/rootfs-rpi3/build +++ /dev/null @@ -1,45 +0,0 @@ -DEPENDS=$(cat "$SCRIPTDIR/cfg/$CFG/ROOTFS") - -build() { - local SOURCE="$1" - local BUILD="$2" - local DEPLOY="$3" - - # setup skeleton - mkdir -pv ${BUILD}/{bin,lib,etc,dev,sys,proc,tmp,var,run} - mkdir -pv ${BUILD}/{boot,usr,srv,mnt,opt} - mkdir -pv ${BUILD}/cfg/{preserve,overlay} - - echo "/lib" > "$BUILD/etc/ld-musl-arm.path" - echo "/opt/vc/lib" >> "$BUILD/etc/ld-musl-arm.path" - - # install packages to rootfs - dependencies "rootfs-rpi3" "pkg" | grep -v "rootfs-rpi3" > "$BUILD/etc/packages" - echo "toolchain" >> "$BUILD/etc/packages" - - while read pkgname; do - if [ ! -e "$PKGDEPLOYDIR/$pkgname" ]; then - continue - fi - - cp -ru --remove-destination ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD" - done < "$BUILD/etc/packages" - - # move configuration to preserve directory - mv ${BUILD}/etc ${BUILD}/cfg/preserve - mkdir -p ${BUILD}/etc - - mv ${BUILD}/var/lib ${BUILD}/cfg/preserve/var_lib - - mv ${BUILD}/root ${BUILD}/cfg/preserve - mkdir -p ${BUILD}/root - chmod 750 ${BUILD}/root -} - -deploy() { - local SOURCE="$1" - local BUILD="$2" - local DEPLOY="$3" - - mksquashfs "$BUILD" "$DEPLOY/rootfs.img" -all-root -no-progress -no-xattrs -} diff --git a/pkg/rootfs-alix/build b/pkg/rootfs/build similarity index 78% rename from pkg/rootfs-alix/build rename to pkg/rootfs/build index 38a7d82..ec2f102 100755 --- a/pkg/rootfs-alix/build +++ b/pkg/rootfs/build @@ -10,10 +10,14 @@ build() { mkdir -pv ${BUILD}/{boot,usr,srv,mnt,opt} mkdir -pv ${BUILD}/cfg/{preserve,overlay} - echo "/lib" > "$BUILD/etc/ld-musl-i386.path" + echo "/lib" > "$BUILD/etc/ld-musl-${MUSL_CPU}.path" + + if [ -e "$SCRIPTDIR/cfg/$CFG/LDPATH" ]; then + cat "$SCRIPTDIR/cfg/$CFG/LDPATH" >> "$BUILD/etc/ld-musl-${MUSL_CPU}.path" + fi # install packages to rootfs - dependencies "rootfs-alix" "pkg" | grep -v "rootfs-alix" > "$BUILD/etc/packages" + dependencies "rootfs" "pkg" | grep -v "rootfs" > "$BUILD/etc/packages" echo "toolchain" >> "$BUILD/etc/packages" while read pkgname; do