Skip to content

Commit c8a3707

Browse files
committed
Added qemu scripts.
1 parent 23c053e commit c8a3707

File tree

7 files changed

+61
-3
lines changed

7 files changed

+61
-3
lines changed

FlashCap.V4L2Generator/build-mono.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
#sudo apt install mono-devel
4+
35
Configuration=Debug; export Configuration
46

57
rm -rf bin/$Configuration/mono obj/$Configuration/mono

FlashCap.V4L2Generator/dumper.sh

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Clang=clang-13; export Clang
99
#Clang=clang-10; export Clang
1010
Configuration=Debug; export Configuration
1111

12+
#===============================================================
13+
1214
$Clang -v |& head -n 1 > clang_version.txt
1315
gcc -v |& tail -n 1 > gcc_version.txt
1416

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.qcow2
2+
*.iso
3+
install/
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# qemu virtual machines builder
2+
3+
This directory contains some bash scripts for building qemu-based vm images.
4+
We can use these vm environments for generating FlashCap V4L2 interop fragments.
5+
6+
* `build-virt-images.sh`:
7+
Construct virt-manager based Debian 12 vm images for `x86_64`, `i686`, `aarch64` and `armv7l` architectures.
8+
* `build-mipsel-image.sh`:
9+
Build Debian 12 vm image for `mipsel` architecture.
10+
* `run-mipsel-image.sh`:
11+
Run Debian 12 vm image for `mipsel` architecture.
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
# sudo apt install qemu-system bsdtar
4+
5+
wget https://cdimage.debian.org/debian-cd/12.5.0/mipsel/iso-cd/debian-12.5.0-mipsel-netinst.iso
6+
7+
qemu-img create -f qcow2 debian-mipsel.qcow2 20G
8+
9+
# https://github.com/kekyo/qemu-debian-mipsel-setup
10+
11+
bsdtar -xf debian-12.5.0-mipsel-netinst.iso install/malta/\*
12+
13+
qemu-system-mipsel \
14+
-M malta \
15+
-m 2048 \
16+
-cdrom `pwd`/debian-12.5.0-mipsel-netinst.iso \
17+
-hda debian-mipsel.qcow2 \
18+
-kernel install/malta/netboot/vmlinuz-* \
19+
-initrd install/malta/netboot/initrd.gz \
20+
-boot d \
21+
-nographic \
22+
-no-reboot \
23+
-append "root=/dev/sda1 nokaslr" \
24+
-netdev user,id=net0 \
25+
-device e1000,netdev=net0,id=net0,mac=52:54:00:12:34:56
26+

FlashCap.V4L2Generator/build-virt-images.sh FlashCap.V4L2Generator/qemu-vm-builder/build-virt-images.sh

-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ wget https://cdimage.debian.org/debian-cd/12.5.0/amd64/iso-cd/debian-12.5.0-amd6
66
wget https://cdimage.debian.org/debian-cd/12.5.0/i386/iso-cd/debian-12.5.0-i386-netinst.iso
77
wget https://cdimage.debian.org/debian-cd/12.5.0/arm64/iso-cd/debian-12.5.0-arm64-netinst.iso
88
wget https://cdimage.debian.org/debian-cd/12.5.0/armhf/iso-cd/debian-12.5.0-armhf-netinst.iso
9-
wget https://cdimage.debian.org/debian-cd/12.5.0/mipsel/iso-cd/debian-12.5.0-mipsel-netinst.iso
109

1110
qemu-img create -f qcow2 debian-amd64.qcow2 20G
1211
qemu-img create -f qcow2 debian-i386.qcow2 20G
1312
qemu-img create -f qcow2 debian-arm64.qcow2 20G
1413
qemu-img create -f qcow2 debian-armhf.qcow2 20G
15-
qemu-img create -f qcow2 debian-mipsel.qcow2 20G
1614

1715
virt-install --connect qemu:///system --name Debian_amd64 --vcpus 2 --ram 4096 --hvm --virt-type qemu --arch x86_64 --os-variant debian12 --import --noreboot --disk path=`pwd`/debian-12.5.0-amd64-netinst.iso,device=cdrom --disk path=`pwd`/debian-amd64.qcow2
1816

@@ -24,4 +22,3 @@ virt-install --connect qemu:///system --name Debian_arm64 --vcpus 2 --ram 4096 -
2422

2523
virt-install --connect qemu:///system --name Debian_armhf --vcpus 2 --ram 2048 --hvm --virt-type qemu --arch armv7l --os-variant debian12 --import --noreboot --disk path=`pwd`/debian-12.5.0-armhf-netinst.iso,device=cdrom --disk path=`pwd`/debian-armhf.qcow2 --tpm none
2624

27-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
# https://github.com/kekyo/qemu-debian-mipsel-setup
4+
5+
qemu-system-mipsel \
6+
-M malta \
7+
-m 2048 \
8+
-hda debian-mipsel.qcow2 \
9+
-kernel vmlinuz \
10+
-initrd initrd.gz \
11+
-nographic \
12+
-append "root=/dev/sda1 console=ttyS0 nokaslr" \
13+
-netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-:22 \
14+
-device e1000,netdev=net0,id=net0,mac=52:54:00:12:34:56
15+

0 commit comments

Comments
 (0)