2018-01-16 23:07:29 +01:00
|
|
|
build() {
|
|
|
|
local SOURCE="$1"
|
|
|
|
local BUILD="$2"
|
|
|
|
local DEPLOY="$3"
|
|
|
|
|
2018-01-17 00:56:06 +01:00
|
|
|
# copy output of immediate dependencies
|
|
|
|
mkdir -p "$BUILD/boot"
|
2018-01-16 23:07:29 +01:00
|
|
|
|
2018-01-17 00:56:06 +01:00
|
|
|
while read pkgname; do
|
|
|
|
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
|
|
|
|
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD/boot"
|
|
|
|
fi
|
|
|
|
done < "$SCRIPTDIR/pkg/release-${CFG}/depends"
|
2018-01-16 23:07:29 +01:00
|
|
|
|
2018-01-17 00:56:06 +01:00
|
|
|
# copy files from this package
|
|
|
|
cp "$SCRIPTDIR/pkg/release-${CFG}/cmdline.txt" "$BUILD/boot"
|
2018-01-16 23:07:29 +01:00
|
|
|
cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD"
|
|
|
|
cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD"
|
2018-01-17 00:56:06 +01:00
|
|
|
|
|
|
|
# substitute file names in scripts
|
|
|
|
local rootfs_image="rootfs.img"
|
|
|
|
|
|
|
|
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/boot/cmdline.txt"
|
2018-01-16 23:07:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
deploy() {
|
|
|
|
local SOURCE="$1"
|
|
|
|
local BUILD="$2"
|
|
|
|
local DEPLOY="$3"
|
|
|
|
|
|
|
|
pushd "$PKGBUILDDIR" > /dev/null
|
|
|
|
tar czf "${DEPLOY}/release-${CFG}.tar.gz" "release-${CFG}"
|
|
|
|
popd > /dev/null
|
|
|
|
}
|