1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-18 03:26:14 +02:00
build/pkg/release-rpi3/build
David Oberhollenzer 1636fc8aac Merge management of regular and toolchain packages
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-02-15 23:47:54 +01:00

43 lines
1 KiB
Plaintext
Executable file

DEPENDS="rootfs linux-rpi3 boot-rpi3"
build() {
local SOURCE="$1"
local BUILD="$2"
local DEPLOY="$3"
# copy output of immediate dependencies
mkdir -p "$BUILD/boot"
for pkgname in $DEPENDS; do
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD/boot"
fi
done
# copy files from this package
cp "$SCRIPTDIR/pkg/$PKGNAME/cmdline.txt" "$BUILD/boot"
cp "$SCRIPTDIR/pkg/$PKGNAME/install.sh" "$BUILD"
cp "$SCRIPTDIR/pkg/$PKGNAME/genimage.sh" "$BUILD"
# substitute file names in scripts
mkdir -p "$BUILD/boot/$OS_RELEASE"
mv "$BUILD/boot/rootfs.img" "$BUILD/boot/$OS_RELEASE"
mv "$BUILD/boot/vmlinuz" "$BUILD/boot/$OS_RELEASE"
local rootfs_image="$OS_RELEASE/rootfs.img"
local kernel_image="$OS_RELEASE/vmlinuz"
sed -i 's#ROOTFSFILE#'$rootfs_image'#g' "$BUILD/boot/cmdline.txt"
sed -i 's#KERNELFILE#'$kernel_image'#g' "$BUILD/boot/config.txt"
}
deploy() {
local SOURCE="$1"
local BUILD="$2"
local DEPLOY="$3"
pushd "$PKGBUILDDIR" > /dev/null
tar czf "$DEPLOY/$PKGNAME.tar.gz" "$PKGNAME"
popd > /dev/null
}