1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-12-23 23:50:51 +01:00

Rename board configuration directory to "board"

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-02-09 18:06:16 +01:00
parent 63fc33657d
commit ae57b55b9c
27 changed files with 32 additions and 30 deletions

16
mk.sh
View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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-)

View file

@ -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"

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}

View file

@ -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"

View file

@ -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"
}

View file

@ -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"