mirror of
https://github.com/pygos/build.git
synced 2024-11-22 11:09:46 +01:00
Rename board configuration directory to "board"
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
63fc33657d
commit
ae57b55b9c
27 changed files with 32 additions and 30 deletions
16
mk.sh
16
mk.sh
|
@ -7,7 +7,7 @@ if [ ! $# -eq 1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CFG="$1"
|
BOARD="$1"
|
||||||
|
|
||||||
################################ basic setup ################################
|
################################ basic setup ################################
|
||||||
BUILDROOT=$(pwd)
|
BUILDROOT=$(pwd)
|
||||||
|
@ -15,20 +15,20 @@ SCRIPTDIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
|
||||||
NUMJOBS=$(grep -e "^processor" /proc/cpuinfo | wc -l)
|
NUMJOBS=$(grep -e "^processor" /proc/cpuinfo | wc -l)
|
||||||
HOSTTUPLE=$(uname -m)-$OSTYPE
|
HOSTTUPLE=$(uname -m)-$OSTYPE
|
||||||
|
|
||||||
TCDIR="$BUILDROOT/$CFG/toolchain"
|
TCDIR="$BUILDROOT/$BOARD/toolchain"
|
||||||
PKGBUILDDIR="$BUILDROOT/$CFG/build"
|
PKGBUILDDIR="$BUILDROOT/$BOARD/build"
|
||||||
PKGSRCDIR="$BUILDROOT/src"
|
PKGSRCDIR="$BUILDROOT/src"
|
||||||
PKGDEPLOYDIR="$BUILDROOT/$CFG/deploy"
|
PKGDEPLOYDIR="$BUILDROOT/$BOARD/deploy"
|
||||||
PKGLOGDIR="$BUILDROOT/$CFG/log"
|
PKGLOGDIR="$BUILDROOT/$BOARD/log"
|
||||||
PKGDOWNLOADDIR="$BUILDROOT/download"
|
PKGDOWNLOADDIR="$BUILDROOT/download"
|
||||||
PACKAGELIST="$BUILDROOT/$CFG/pkglist"
|
PACKAGELIST="$BUILDROOT/$BOARD/pkglist"
|
||||||
|
|
||||||
mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGBUILDDIR" "$PKGLOGDIR"
|
mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGBUILDDIR" "$PKGLOGDIR"
|
||||||
mkdir -p "$PKGDEPLOYDIR" "$TCDIR/bin"
|
mkdir -p "$PKGDEPLOYDIR" "$TCDIR/bin"
|
||||||
|
|
||||||
export PATH="$TCDIR/bin:$PATH"
|
export PATH="$TCDIR/bin:$PATH"
|
||||||
|
|
||||||
source "$SCRIPTDIR/cfg/$CFG/TOOLCHAIN"
|
source "$SCRIPTDIR/board/$BOARD/TOOLCHAIN"
|
||||||
|
|
||||||
mkdir -p "$TCDIR/$TARGET"
|
mkdir -p "$TCDIR/$TARGET"
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ save_toolchain
|
||||||
############################### build packages ###############################
|
############################### build packages ###############################
|
||||||
echo "--- resolving package dependencies ---"
|
echo "--- resolving package dependencies ---"
|
||||||
|
|
||||||
include_pkg "pkg" "release-${CFG}"
|
include_pkg "pkg" "release-${BOARD}"
|
||||||
dependencies | tsort | tac > "$PACKAGELIST"
|
dependencies | tsort | tac > "$PACKAGELIST"
|
||||||
cat "$PACKAGELIST"
|
cat "$PACKAGELIST"
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ build() {
|
||||||
local INPUT="$1"
|
local INPUT="$1"
|
||||||
local OUTPUT="$2"
|
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 BB_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||||
local SYSROOT="$TCDIR/$TARGET"
|
local SYSROOT="$TCDIR/$TARGET"
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ build() {
|
||||||
local INPUT="$1"
|
local INPUT="$1"
|
||||||
local OUTPUT="$2"
|
local OUTPUT="$2"
|
||||||
|
|
||||||
local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config"
|
local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config"
|
||||||
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
||||||
|
|
||||||
export KBUILD_OUTPUT="$OUTPUT"
|
export KBUILD_OUTPUT="$OUTPUT"
|
||||||
|
@ -34,7 +34,7 @@ deploy() {
|
||||||
local BUILD="$2"
|
local BUILD="$2"
|
||||||
local DEPLOY="$3"
|
local DEPLOY="$3"
|
||||||
|
|
||||||
local CFGFILE="$SCRIPTDIR/cfg/$CFG/linux.config"
|
local CFGFILE="$SCRIPTDIR/board/$BOARD/linux.config"
|
||||||
|
|
||||||
pushd $BUILD
|
pushd $BUILD
|
||||||
install -m 755 "arch/arm/boot/zImage" "$DEPLOY/kernel.img"
|
install -m 755 "arch/arm/boot/zImage" "$DEPLOY/kernel.img"
|
||||||
|
|
|
@ -17,7 +17,7 @@ build() {
|
||||||
local INPUT="$1"
|
local INPUT="$1"
|
||||||
local OUTPUT="$2"
|
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_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||||
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
|
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
|
||||||
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
local INITRDLIST="$PKGDEPLOYDIR/initrd/initrd.list"
|
||||||
|
@ -38,7 +38,7 @@ deploy() {
|
||||||
local BUILD="$2"
|
local BUILD="$2"
|
||||||
local DEPLOY="$3"
|
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_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||||
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
|
local LINUX_TGT=$(head -2 "$CFGFILE" | tail -1 | cut -b 3-)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ build() {
|
||||||
local INPUT="$1"
|
local INPUT="$1"
|
||||||
local OUTPUT="$2"
|
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_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||||
|
|
||||||
export KBUILD_OUTPUT="$OUTPUT"
|
export KBUILD_OUTPUT="$OUTPUT"
|
||||||
|
@ -23,7 +23,7 @@ deploy() {
|
||||||
local BUILD="$2"
|
local BUILD="$2"
|
||||||
local DEPLOY="$3"
|
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_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||||
|
|
||||||
mkdir -p "$DEPLOY/lib/modules"
|
mkdir -p "$DEPLOY/lib/modules"
|
||||||
|
|
|
@ -68,7 +68,7 @@ deploy() {
|
||||||
mkdir -p ${DEPLOY}/etc/runlevels/{boot,sysinit,shutdown,default}
|
mkdir -p ${DEPLOY}/etc/runlevels/{boot,sysinit,shutdown,default}
|
||||||
cp -R "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$DEPLOY"
|
cp -R "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$DEPLOY"
|
||||||
|
|
||||||
source "$SCRIPTDIR/cfg/$CFG/INIT"
|
source "$SCRIPTDIR/board/$BOARD/INIT"
|
||||||
|
|
||||||
for i in $GETTY_TTY; do
|
for i in $GETTY_TTY; do
|
||||||
cat > "$DEPLOY/etc/conf.d/agetty.$i" << _EOF
|
cat > "$DEPLOY/etc/conf.d/agetty.$i" << _EOF
|
||||||
|
|
|
@ -5,8 +5,6 @@ URL="https://www.openssl.org/source"
|
||||||
SHA256SUM="de4d501267da39310905cb6dc8c6121f7a2cad45a7707f76df828fe1b85073af"
|
SHA256SUM="de4d501267da39310905cb6dc8c6121f7a2cad45a7707f76df828fe1b85073af"
|
||||||
DEPENDS="zlib"
|
DEPENDS="zlib"
|
||||||
|
|
||||||
source "$SCRIPTDIR/cfg/$CFG/OPENSSL"
|
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -15,11 +13,15 @@ build() {
|
||||||
local SOURCE="$1"
|
local SOURCE="$1"
|
||||||
local BUILD="$2"
|
local BUILD="$2"
|
||||||
|
|
||||||
|
source "$SCRIPTDIR/board/$BOARD/OPENSSL"
|
||||||
|
|
||||||
$SOURCE/Configure --prefix=/ --cross-compile-prefix="${TARGET}-" \
|
$SOURCE/Configure --prefix=/ --cross-compile-prefix="${TARGET}-" \
|
||||||
--openssldir=/etc/ssl --libdir=/lib \
|
--openssldir=/etc/ssl --libdir=/lib \
|
||||||
-DOPENSSL_NO_HEARTBEATS \
|
-DOPENSSL_NO_HEARTBEATS \
|
||||||
threads shared zlib-dynamic no-async $OPENSSL_TARGET
|
threads shared zlib-dynamic no-async $OPENSSL_TARGET
|
||||||
|
|
||||||
|
unset -v OPENSSL_TARGET
|
||||||
|
|
||||||
make -j 1
|
make -j 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ build() {
|
||||||
cp "/usr/share/syslinux/mbr.bin" "$BUILD"
|
cp "/usr/share/syslinux/mbr.bin" "$BUILD"
|
||||||
|
|
||||||
for script in install.sh genimage.sh syslinux.cfg; do
|
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/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/$script"
|
||||||
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script"
|
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script"
|
||||||
|
@ -32,6 +32,6 @@ deploy() {
|
||||||
local DEPLOY="$3"
|
local DEPLOY="$3"
|
||||||
|
|
||||||
pushd "$PKGBUILDDIR" > /dev/null
|
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
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,9 @@ build() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# copy files from this package
|
# copy files from this package
|
||||||
cp "$SCRIPTDIR/pkg/release-${CFG}/cmdline.txt" "$BUILD/boot"
|
cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/cmdline.txt" "$BUILD/boot"
|
||||||
cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD"
|
cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/install.sh" "$BUILD"
|
||||||
cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD"
|
cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/genimage.sh" "$BUILD"
|
||||||
|
|
||||||
# substitute file names in scripts
|
# substitute file names in scripts
|
||||||
local rootfs_image="rootfs.img"
|
local rootfs_image="rootfs.img"
|
||||||
|
@ -31,6 +31,6 @@ deploy() {
|
||||||
local DEPLOY="$3"
|
local DEPLOY="$3"
|
||||||
|
|
||||||
pushd "$PKGBUILDDIR" > /dev/null
|
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
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
DEPENDS=$(cat "$SCRIPTDIR/cfg/$CFG/ROOTFS")
|
DEPENDS=$(cat "$SCRIPTDIR/board/$BOARD/ROOTFS")
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
local SOURCE="$1"
|
local SOURCE="$1"
|
||||||
|
@ -12,8 +12,8 @@ build() {
|
||||||
|
|
||||||
echo "/lib" > "$BUILD/etc/ld-musl-${MUSL_CPU}.path"
|
echo "/lib" > "$BUILD/etc/ld-musl-${MUSL_CPU}.path"
|
||||||
|
|
||||||
if [ -e "$SCRIPTDIR/cfg/$CFG/LDPATH" ]; then
|
if [ -e "$SCRIPTDIR/board/$BOARD/LDPATH" ]; then
|
||||||
cat "$SCRIPTDIR/cfg/$CFG/LDPATH" >> "$BUILD/etc/ld-musl-${MUSL_CPU}.path"
|
cat "$SCRIPTDIR/board/$BOARD/LDPATH" >> "$BUILD/etc/ld-musl-${MUSL_CPU}.path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -r "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$BUILD"
|
cp -r "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$BUILD"
|
||||||
|
|
|
@ -9,6 +9,6 @@ deploy() {
|
||||||
local OUTPUT="$2"
|
local OUTPUT="$2"
|
||||||
local DEPLOY="$3"
|
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"
|
"$TCDIR/$TARGET" "$DEPLOY"
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ build() {
|
||||||
local INPUT="$1"
|
local INPUT="$1"
|
||||||
local OUTPUT="$2"
|
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_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||||
|
|
||||||
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" mrproper
|
make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" mrproper
|
||||||
|
@ -17,7 +17,7 @@ deploy() {
|
||||||
local INPUT="$1"
|
local INPUT="$1"
|
||||||
local OUTPUT="$2"
|
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_CPU=$(head -1 "$CFGFILE" | cut -b 3-)
|
||||||
|
|
||||||
export KBUILD_OUTPUT="$OUTPUT"
|
export KBUILD_OUTPUT="$OUTPUT"
|
||||||
|
|
Loading…
Reference in a new issue