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-02-14 13:07:23 +01:00
|
|
|
mkdir -p "$BUILD/$OS_RELEASE"
|
|
|
|
|
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
|
2018-02-14 13:07:23 +01:00
|
|
|
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD/$OS_RELEASE"
|
2018-01-17 00:56:06 +01:00
|
|
|
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
|
2018-02-14 13:07:23 +01:00
|
|
|
local linux_image="$OS_RELEASE/vmlinuz"
|
|
|
|
local rootfs_image="$OS_RELEASE/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-15 23:47:54 +01:00
|
|
|
cp "$SCRIPTDIR/pkg/$PKGNAME/$script" "$BUILD"
|
2018-01-16 23:07:29 +01:00
|
|
|
|
2018-02-14 13:07:23 +01:00
|
|
|
sed -i 's#ROOTFSFILE#'$rootfs_image'#g' "$BUILD/$script"
|
|
|
|
sed -i 's#KERNELFILE#'$linux_image'#g' "$BUILD/$script"
|
|
|
|
sed -i 's#VERSIONDIR#'$OS_RELEASE'#g' "$BUILD/$script"
|
2018-01-17 00:56:06 +01:00
|
|
|
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-15 23:47:54 +01:00
|
|
|
tar czf "$DEPLOY/$PKGNAME.tar.gz" "$PKGNAME"
|
2018-01-16 23:07:29 +01:00
|
|
|
popd > /dev/null
|
|
|
|
}
|