mirror of
https://github.com/pygos/build.git
synced 2024-11-05 11:37:10 +01:00
875a348d2d
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
37 lines
881 B
Text
Executable file
37 lines
881 B
Text
Executable file
DEPENDS="rootfs linux"
|
|
|
|
build() {
|
|
local SOURCE="$1"
|
|
local BUILD="$2"
|
|
local DEPLOY="$3"
|
|
|
|
# copy output of immediate dependencies
|
|
for pkgname in $DEPENDS; do
|
|
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
|
|
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD"
|
|
fi
|
|
done
|
|
|
|
# copy additional files from this package, subsitute filenames
|
|
local linux_image=$(basename $BUILD/vmlinuz*)
|
|
local rootfs_image="rootfs.img"
|
|
|
|
cp "/usr/share/syslinux/mbr.bin" "$BUILD"
|
|
|
|
for script in install.sh genimage.sh syslinux.cfg; do
|
|
cp "$SCRIPTDIR/pkg/release-${CFG}/$script" "$BUILD"
|
|
|
|
sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/$script"
|
|
sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/$script"
|
|
done
|
|
}
|
|
|
|
deploy() {
|
|
local SOURCE="$1"
|
|
local BUILD="$2"
|
|
local DEPLOY="$3"
|
|
|
|
pushd "$PKGBUILDDIR" > /dev/null
|
|
tar czf "${DEPLOY}/release-${CFG}.tar.gz" "${PKGDIR}-release-${CFG}"
|
|
popd > /dev/null
|
|
}
|