diff --git a/cfg/alix/INIT b/board/alix/INIT similarity index 100% rename from cfg/alix/INIT rename to board/alix/INIT diff --git a/cfg/alix/OPENSSL b/board/alix/OPENSSL similarity index 100% rename from cfg/alix/OPENSSL rename to board/alix/OPENSSL diff --git a/cfg/alix/ROOTFS b/board/alix/ROOTFS similarity index 100% rename from cfg/alix/ROOTFS rename to board/alix/ROOTFS diff --git a/cfg/alix/TOOLCHAIN b/board/alix/TOOLCHAIN similarity index 100% rename from cfg/alix/TOOLCHAIN rename to board/alix/TOOLCHAIN diff --git a/cfg/alix/bbstatic.config b/board/alix/bbstatic.config similarity index 100% rename from cfg/alix/bbstatic.config rename to board/alix/bbstatic.config diff --git a/cfg/alix/libgcc_files.txt b/board/alix/libgcc_files.txt similarity index 100% rename from cfg/alix/libgcc_files.txt rename to board/alix/libgcc_files.txt diff --git a/cfg/alix/linux.config b/board/alix/linux.config similarity index 100% rename from cfg/alix/linux.config rename to board/alix/linux.config diff --git a/cfg/rpi3/INIT b/board/rpi3/INIT similarity index 100% rename from cfg/rpi3/INIT rename to board/rpi3/INIT diff --git a/cfg/rpi3/LDPATH b/board/rpi3/LDPATH similarity index 100% rename from cfg/rpi3/LDPATH rename to board/rpi3/LDPATH diff --git a/cfg/rpi3/OPENSSL b/board/rpi3/OPENSSL similarity index 100% rename from cfg/rpi3/OPENSSL rename to board/rpi3/OPENSSL diff --git a/cfg/rpi3/ROOTFS b/board/rpi3/ROOTFS similarity index 100% rename from cfg/rpi3/ROOTFS rename to board/rpi3/ROOTFS diff --git a/cfg/rpi3/TOOLCHAIN b/board/rpi3/TOOLCHAIN similarity index 100% rename from cfg/rpi3/TOOLCHAIN rename to board/rpi3/TOOLCHAIN diff --git a/cfg/rpi3/bbstatic.config b/board/rpi3/bbstatic.config similarity index 100% rename from cfg/rpi3/bbstatic.config rename to board/rpi3/bbstatic.config diff --git a/cfg/rpi3/libgcc_files.txt b/board/rpi3/libgcc_files.txt similarity index 100% rename from cfg/rpi3/libgcc_files.txt rename to board/rpi3/libgcc_files.txt diff --git a/cfg/rpi3/linux.config b/board/rpi3/linux.config similarity index 100% rename from cfg/rpi3/linux.config rename to board/rpi3/linux.config diff --git a/mk.sh b/mk.sh index c9d14f9..89019fd 100755 --- a/mk.sh +++ b/mk.sh @@ -7,7 +7,7 @@ if [ ! $# -eq 1 ]; then exit 1 fi -CFG="$1" +BOARD="$1" ################################ basic setup ################################ BUILDROOT=$(pwd) @@ -15,20 +15,20 @@ SCRIPTDIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) NUMJOBS=$(grep -e "^processor" /proc/cpuinfo | wc -l) HOSTTUPLE=$(uname -m)-$OSTYPE -TCDIR="$BUILDROOT/$CFG/toolchain" -PKGBUILDDIR="$BUILDROOT/$CFG/build" +TCDIR="$BUILDROOT/$BOARD/toolchain" +PKGBUILDDIR="$BUILDROOT/$BOARD/build" PKGSRCDIR="$BUILDROOT/src" -PKGDEPLOYDIR="$BUILDROOT/$CFG/deploy" -PKGLOGDIR="$BUILDROOT/$CFG/log" +PKGDEPLOYDIR="$BUILDROOT/$BOARD/deploy" +PKGLOGDIR="$BUILDROOT/$BOARD/log" PKGDOWNLOADDIR="$BUILDROOT/download" -PACKAGELIST="$BUILDROOT/$CFG/pkglist" +PACKAGELIST="$BUILDROOT/$BOARD/pkglist" mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGBUILDDIR" "$PKGLOGDIR" mkdir -p "$PKGDEPLOYDIR" "$TCDIR/bin" export PATH="$TCDIR/bin:$PATH" -source "$SCRIPTDIR/cfg/$CFG/TOOLCHAIN" +source "$SCRIPTDIR/board/$BOARD/TOOLCHAIN" mkdir -p "$TCDIR/$TARGET" @@ -72,7 +72,7 @@ save_toolchain ############################### build packages ############################### echo "--- resolving package dependencies ---" -include_pkg "pkg" "release-${CFG}" +include_pkg "pkg" "release-${BOARD}" dependencies | tsort | tac > "$PACKAGELIST" cat "$PACKAGELIST" diff --git a/pkg/bbstatic/build b/pkg/bbstatic/build index 6352b3f..b938677 100755 --- a/pkg/bbstatic/build +++ b/pkg/bbstatic/build @@ -13,7 +13,7 @@ build() { local INPUT="$1" local OUTPUT="$2" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/bbstatic.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/bbstatic.config" local BB_CPU=$(head -1 "$CFGFILE" | cut -b 3-) local SYSROOT="$TCDIR/$TARGET" diff --git a/pkg/linux-rpi3/build b/pkg/linux-rpi3/build index 5c985cf..70a79c7 100755 --- a/pkg/linux-rpi3/build +++ b/pkg/linux-rpi3/build @@ -13,7 +13,7 @@ build() { local INPUT="$1" local OUTPUT="$2" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list" export KBUILD_OUTPUT="$OUTPUT" @@ -34,7 +34,7 @@ deploy() { local BUILD="$2" local DEPLOY="$3" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" pushd $BUILD install -m 755 "arch/arm/boot/zImage" "$DEPLOY/kernel.img" diff --git a/pkg/linux/build b/pkg/linux/build index 581710d..82e9eb9 100755 --- a/pkg/linux/build +++ b/pkg/linux/build @@ -17,7 +17,7 @@ build() { local INPUT="$1" local OUTPUT="$2" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-) local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-) local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list" @@ -38,7 +38,7 @@ deploy() { local BUILD="$2" local DEPLOY="$3" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-) local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-) diff --git a/pkg/linux_modules/build b/pkg/linux_modules/build index 39786b9..26af0a6 100755 --- a/pkg/linux_modules/build +++ b/pkg/linux_modules/build @@ -6,7 +6,7 @@ build() { local INPUT="$1" local OUTPUT="$2" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-) export KBUILD_OUTPUT="$OUTPUT" @@ -23,7 +23,7 @@ deploy() { local BUILD="$2" local DEPLOY="$3" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-) mkdir -p "$DEPLOY/lib/modules" diff --git a/pkg/openrc/build b/pkg/openrc/build index b6bb482..780c9fa 100755 --- a/pkg/openrc/build +++ b/pkg/openrc/build @@ -68,7 +68,7 @@ deploy() { mkdir -p ${DEPLOY}/etc/runlevels/{boot,sysinit,shutdown,default} cp -R "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$DEPLOY" - source "$SCRIPTDIR/cfg/$CFG/INIT" + source "$SCRIPTDIR/board/$BOARD/INIT" for i in $GETTY_TTY; do cat > "$DEPLOY/etc/conf.d/agetty.$i" << _EOF diff --git a/pkg/openssl/build b/pkg/openssl/build index 7c093b0..4881342 100755 --- a/pkg/openssl/build +++ b/pkg/openssl/build @@ -5,8 +5,6 @@ URL="https://www.openssl.org/source" SHA256SUM="de4d501267da39310905cb6dc8c6121f7a2cad45a7707f76df828fe1b85073af" DEPENDS="zlib" -source "$SCRIPTDIR/cfg/$CFG/OPENSSL" - prepare() { return } @@ -15,11 +13,15 @@ build() { local SOURCE="$1" local BUILD="$2" + source "$SCRIPTDIR/board/$BOARD/OPENSSL" + $SOURCE/Configure --prefix=/ --cross-compile-prefix="${TARGET}-" \ --openssldir=/etc/ssl --libdir=/lib \ -DOPENSSL_NO_HEARTBEATS \ threads shared zlib-dynamic no-async $OPENSSL_TARGET + unset -v OPENSSL_TARGET + make -j 1 } diff --git a/pkg/release-alix/build b/pkg/release-alix/build index 9d15079..6e768a4 100755 --- a/pkg/release-alix/build +++ b/pkg/release-alix/build @@ -19,7 +19,7 @@ build() { cp "/usr/share/syslinux/mbr.bin" "$BUILD" for script in install.sh genimage.sh syslinux.cfg; do - cp "$SCRIPTDIR/pkg/release-${CFG}/$script" "$BUILD" + cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/$script" "$BUILD" sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/$script" sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script" @@ -32,6 +32,6 @@ deploy() { local DEPLOY="$3" pushd "$PKGBUILDDIR" > /dev/null - tar czf "${DEPLOY}/release-${CFG}.tar.gz" "${PKGDIR}-release-${CFG}" + tar czf "$DEPLOY/$PKGNAME.tar.gz" "${PKGDIR}-${PKGNAME}" popd > /dev/null } diff --git a/pkg/release-rpi3/build b/pkg/release-rpi3/build index 161a171..fc36002 100755 --- a/pkg/release-rpi3/build +++ b/pkg/release-rpi3/build @@ -15,9 +15,9 @@ build() { done # copy files from this package - cp "$SCRIPTDIR/pkg/release-${CFG}/cmdline.txt" "$BUILD/boot" - cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD" - cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD" + cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/cmdline.txt" "$BUILD/boot" + cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/install.sh" "$BUILD" + cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/genimage.sh" "$BUILD" # substitute file names in scripts local rootfs_image="rootfs.img" @@ -31,6 +31,6 @@ deploy() { local DEPLOY="$3" pushd "$PKGBUILDDIR" > /dev/null - tar czf "${DEPLOY}/release-${CFG}.tar.gz" "${PKGDIR}-release-${CFG}" + tar czf "$DEPLOY/$PKGNAME.tar.gz" "${PKGDIR}-${PKGNAME}" popd > /dev/null } diff --git a/pkg/rootfs/build b/pkg/rootfs/build index 0202ead..52d30cb 100755 --- a/pkg/rootfs/build +++ b/pkg/rootfs/build @@ -1,4 +1,4 @@ -DEPENDS=$(cat "$SCRIPTDIR/cfg/$CFG/ROOTFS") +DEPENDS=$(cat "$SCRIPTDIR/board/$BOARD/ROOTFS") build() { local SOURCE="$1" @@ -12,8 +12,8 @@ build() { 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" + if [ -e "$SCRIPTDIR/board/$BOARD/LDPATH" ]; then + cat "$SCRIPTDIR/board/$BOARD/LDPATH" >> "$BUILD/etc/ld-musl-${MUSL_CPU}.path" fi cp -r "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$BUILD" diff --git a/tcpkg/libgcc/build b/tcpkg/libgcc/build index c74abb7..abb90eb 100755 --- a/tcpkg/libgcc/build +++ b/tcpkg/libgcc/build @@ -9,6 +9,6 @@ deploy() { local OUTPUT="$2" local DEPLOY="$3" - rsync -aH --files-from="$SCRIPTDIR/cfg/$CFG/libgcc_files.txt" \ + rsync -aH --files-from="$SCRIPTDIR/board/$BOARD/libgcc_files.txt" \ "$TCDIR/$TARGET" "$DEPLOY" } diff --git a/tcpkg/linux_hdr/build b/tcpkg/linux_hdr/build index 5763887..058af16 100755 --- a/tcpkg/linux_hdr/build +++ b/tcpkg/linux_hdr/build @@ -6,7 +6,7 @@ build() { local INPUT="$1" local OUTPUT="$2" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-) make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" mrproper @@ -17,7 +17,7 @@ deploy() { local INPUT="$1" local OUTPUT="$2" - local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config" + local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config" local LINUX_CPU=$(head -1 "$CFGFILE" | cut -b 3-) export KBUILD_OUTPUT="$OUTPUT"