2018-01-24 13:41:45 +01:00
|
|
|
DEPENDS="rootfs linux"
|
2018-01-24 12:52:41 +01:00
|
|
|
|
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
|
2018-01-24 12:52:41 +01:00
|
|
|
for pkgname in $DEPENDS; do
|
2018-01-17 00:56:06 +01:00
|
|
|
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
|
|
|
|
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD"
|
|
|
|
fi
|
2018-01-24 12:52:41 +01:00
|
|
|
done
|
2018-01-16 23:07:29 +01:00
|
|
|
|
2018-01-17 00:56:06 +01:00
|
|
|
# copy additional files from this package, subsitute filenames
|
|
|
|
local linux_image=$(basename $BUILD/vmlinuz*)
|
|
|
|
local rootfs_image="rootfs.img"
|
2018-01-16 23:07:29 +01:00
|
|
|
|
|
|
|
cp "/usr/share/syslinux/mbr.bin" "$BUILD"
|
|
|
|
|
2018-01-17 00:56:06 +01:00
|
|
|
for script in install.sh genimage.sh syslinux.cfg; do
|
2018-02-09 18:06:16 +01:00
|
|
|
cp "$SCRIPTDIR/$PKGDIR/$PKGNAME/$script" "$BUILD"
|
2018-01-16 23:07:29 +01:00
|
|
|
|
2018-01-17 00:56:06 +01:00
|
|
|
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/$script"
|
|
|
|
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script"
|
|
|
|
done
|
2018-01-16 23:07:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
deploy() {
|
|
|
|
local SOURCE="$1"
|
|
|
|
local BUILD="$2"
|
|
|
|
local DEPLOY="$3"
|
|
|
|
|
|
|
|
pushd "$PKGBUILDDIR" > /dev/null
|
2018-02-09 18:06:16 +01:00
|
|
|
tar czf "$DEPLOY/$PKGNAME.tar.gz" "${PKGDIR}-${PKGNAME}"
|
2018-01-16 23:07:29 +01:00
|
|
|
popd > /dev/null
|
|
|
|
}
|