1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 02:59:47 +01:00

Add configuration for testing with qemu

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-09-28 00:39:22 +02:00
parent 59d01432b1
commit 121fee7e97
11 changed files with 3162 additions and 0 deletions

5
layer/bsp-qemu64/INIT Normal file
View file

@ -0,0 +1,5 @@
GETTY_TTY="tty1 tty2 tty3 tty4 tty5 tty6 tty7"
HWCLOCK="yes"
DHCP_PORTS="port0"
SERVICES=""
MODULES=""

1
layer/bsp-qemu64/LDPATH Normal file
View file

@ -0,0 +1 @@
/lib

1
layer/bsp-qemu64/ROOTFS Normal file
View file

@ -0,0 +1 @@
linux

View file

@ -0,0 +1,11 @@
RELEASEPKG="release-qemu"
TARGET="x86_64-linux-musl"
GCC_CPU="x86-64"
MUSL_CPU="x86_64"
GCC_EXTRACFG=""
LINUXPKG="linux"
LINUX_CPU="x86_64"
LINUX_TGT="bzImage"
OPENSSL_TARGET="linux-x86_64"

View file

@ -0,0 +1 @@
eth*,52:54:00:*,port

File diff suppressed because it is too large Load diff

46
pkg/release-qemu/build Executable file
View file

@ -0,0 +1,46 @@
DEPENDS="rootfs"
build() {
local SOURCE="$1"
local DEPLOY="$2"
mkdir -p "$PKGBUILDDIR/$OS_RELEASE"
# copy output of immediate dependencies
for pkgname in $DEPENDS; do
if [ -e "$PKGDEPLOYDIR/$pkgname" ]; then
cp -ru ${PKGDEPLOYDIR}/${pkgname}/* \
"$PKGBUILDDIR/$OS_RELEASE"
fi
done
# 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() {
local SOURCE="$1"
local DEPLOY="$2"
tar czf "$DEPLOY/$PKGNAME.tar.gz" *
}
check_update() {
return
}

View file

@ -0,0 +1 @@
root=/dev/vda1 root_sfs=VERSIONDIR/ROOTFSFILE overlay_dev=overlay overlay_type=qemu

View file

@ -0,0 +1 @@
VERSIONDIR/KERNELFILE

24
pkg/release-qemu/runqemu.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
SCRIPTDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
BOOT="$SCRIPTDIR/bootfs"
OVERLAY="$SCRIPTDIR/overlay"
KERNEL=$(cat "$BOOT/kernel.txt")
CMDLINE=$(cat "$BOOT/cmdline.txt")
RAM="256M"
MAC0="52:54:00:12:34:56"
mkdir -p ${OVERLAY}/{etc,etc_work,usr,usr_work,var_lib,var_lib_work}
qemu-system-x86_64 \
-drive "file=fat:rw:$BOOT,readonly=off,format=raw,if=virtio" \
-m "$RAM" -accel kvm -cpu host \
-vga virtio -display sdl \
-netdev user,id=netdev0 \
-device virtio-net-pci,netdev=netdev0,mac="$MAC0" \
-fsdev "local,id=overlay,path=$OVERLAY,security_model=mapped" \
-device "virtio-9p-pci,fsdev=overlay,mount_tag=overlay" \
-kernel "$BOOT/$KERNEL" -append "$CMDLINE"

3
product/qemu-test.layers Normal file
View file

@ -0,0 +1,3 @@
bsp-qemu64
pygos-cli
pygos-cli-net