51 lines
2.7 KiB
Plaintext
51 lines
2.7 KiB
Plaintext
|
# Armbian virtual ARM64 image for qemu
|
||
|
#
|
||
|
#
|
||
|
# produces a single partition VM image in qcow2 format.
|
||
|
# how to use
|
||
|
# the resulting cache/sources/u-boot/v22021.04/u-boot.bin will need to be copied.. that is your bios
|
||
|
# how to run on linux
|
||
|
##!/bin/bash
|
||
|
#
|
||
|
#declare -g image=armbian.img
|
||
|
#smp=4
|
||
|
#rams=1000M
|
||
|
#bios=u-boot.bin
|
||
|
#/usr/bin/qemu-system-aarch64 -name ArmbianVirtualTest -m ${rams} -smp ${smp} -drive file=${image} -nographic -enable-kvm -M virt -cpu host -bios ${bios} -netdev user,id=user.0,hostfwd=udp::31783-:22,hostfwd=tcp::31783-:22 -device virtio-net,netdev=user.0 -machine gic-version=3
|
||
|
#
|
||
|
#how to run on mac... i'm using utm and making a custom config...
|
||
|
#
|
||
|
#/Applications/UTM.app/Contents/XPCServices/QEMUHelper.xpc/Contents/MacOS/QEMULauncher /Applications/UTM.app/Contents/Frameworks/libqemu-aarch64-softmmu.utm.dylib -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4000,server,nowait -vga none -spice port=4001,addr=127.0.0.1,disable-ticketing,image-compression=off,playback-compression=off,streaming-video=off -device virtio-ramfb -cpu host -smp cpus=8,sockets=1,cores=8,threads=1 -machine none,highmem=off -accel hvf -accel tcg,tb-size=1024 -boot menu=on -m 4096 -name armbian -usb -device virtio-blk-pci,drive=drive0,bootindex=0 -drive if=none,media=disk,id=drive0,file=/Users/lane/Library/Containers/com.utmapp.UTM/Data/Documents/armbian.utm/Images/armbian.img,cache=writethrough -device virtio-net-device,mac=AE:C6:BD:B0:F1:33,netdev=net0 -netdev user,id=net0 -uuid 3952DB60-A50E-4838-BAAE-BD13C526CC7A -rtc base=localtime -M virt -cpu host -accel hvf -bios u-boot.bin -device virtio-mouse -device virtio-keyboard
|
||
|
#
|
||
|
BOARD_NAME="Virtual QEMU"
|
||
|
BOARDFAMILY="virtual"
|
||
|
BOARD_MAINTAINER=""
|
||
|
KERNEL_TARGET="current"
|
||
|
SERIALCON="ttyS0"
|
||
|
FULL_DESKTOP="no"
|
||
|
BOOT_LOGO="yes"
|
||
|
BOOTCONFIG="qemu_arm64_defconfig"
|
||
|
ATF_COMPILE="no"
|
||
|
BOOTBRANCH='tag:v2021.04'
|
||
|
USE_OVERLAYFS='no'
|
||
|
BOOT_SCENARIO="blobless"
|
||
|
BOOT_SOC=qemu
|
||
|
EXTRAWIFI='no'
|
||
|
ROOTFS_TYPE="ext4"
|
||
|
PACKAGE_LIST_DESKTOP_BOARD="spice-vdagent"
|
||
|
|
||
|
post_build_image_modify() {
|
||
|
|
||
|
if [[ ${BOARD} == "virtual-qemu" ]]; then
|
||
|
local IMAGE_PATH=${1}
|
||
|
##fixme put this where it belongs
|
||
|
apt install -y qemu-utils
|
||
|
display_alert "converting image to qcow2 format" "$(qemu-img convert -f raw -O qcow2 ${IMAGE_PATH} ${IMAGE_PATH}.qcow2)" "info"
|
||
|
display_alert "resizing qcow2 image to 50G" "$(qemu-img resize ${IMAGE_PATH}.qcow2 50G)" "info"
|
||
|
display_alert "shuffling image files" "$(mv -vf ${IMAGE_PATH}.qcow2 ${IMAGE_PATH})" "info"
|
||
|
display_alert "check img format" "$(qemu-img info ${IMAGE_PATH} | fgrep qcow2)" "info"
|
||
|
else
|
||
|
display_alert "failsafe applied" "This post_build_image_modify function should not have been executed" "warn"
|
||
|
fi
|
||
|
}
|