1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00
build/pkg/release-qemu/build
David Oberhollenzer fa4eff263b Cleanup: implement defaults for package functions
This commit adds an "emptypackage" template that implements defaults
for all package functions and is included before every package.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-04-16 15:16:58 +02:00

35 lines
1,008 B
Text
Executable file

DEPENDS="rootfs linux"
SUBPKG="release"
build() {
pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" linux
pkg dump -l pkg -r "$SYSROOT" "$REPODIR/rootfs.pkg" \
> "$PKGBUILDDIR/files.txt"
gensquashfs -F "$PKGBUILDDIR/files.txt" "$OS_RELEASE/rootfs.img"
rm "$PKGBUILDDIR/files.txt"
# copy helper scripts
local linux_image="vmlinuz"
local rootfs_image="rootfs.img"
for script in runqemu.sh cmdline.txt kernel.txt; do
cp "$SCRIPTDIR/pkg/$PKGNAME/$script" "$PKGBUILDDIR"
sed -i 's#ROOTFSFILE#'$rootfs_image'#g' "$PKGBUILDDIR/$script"
sed -i 's#KERNELFILE#'$linux_image'#g' "$PKGBUILDDIR/$script"
sed -i 's#VERSIONDIR#'$OS_RELEASE'#g' "$PKGBUILDDIR/$script"
done
# boot partition
mkdir "$PKGBUILDDIR/bootfs"
mv "$PKGBUILDDIR/$OS_RELEASE" "$PKGBUILDDIR/bootfs"
mv "$PKGBUILDDIR/cmdline.txt" "$PKGBUILDDIR/bootfs"
mv "$PKGBUILDDIR/kernel.txt" "$PKGBUILDDIR/bootfs"
}
deploy() {
tar czf "$BUILDROOT/release.tar.gz" *
touch "$PKGDEPLOYDIR/release.files" "$PKGDEPLOYDIR/release.desc"
}