-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.ubuntu.mk
30 lines (24 loc) · 1.09 KB
/
Makefile.ubuntu.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
DISTS=bionic xenial
images/ubuntu-%-core-cloudimg-arm64-root.tar.gz:
wget -O [email protected] https://partner-images.canonical.com/core/$(filter $(DISTS), $(subst -, ,$@))/current/$(basename $@)
mv [email protected] $@
nfsroot/%-containers-arm64.tar.gz: images/ubuntu-%-core-cloudimg-arm64-root.tar.gz
docker build -t $$(basename $@ .tar.gz) \
-f images/Dockerfile.ubuntu \
--build-arg dist=$(filter $(DISTS), $(subst -, ,$(basename $<))) \
images/
-docker rm -f $$(basename $@ .tar.gz)
docker run --name=$$(basename $@ .tar.gz) $$(basename $@ .tar.gz) rm /.dockerenv
docker export $$(basename $@ .tar.gz) | gzip -c > [email protected]
mv [email protected] $@
-docker rm -f $$(basename $@ .tar.gz)
xenial-qemu: tftproot/kernel-arm64 \
xenial-containers-arm64-initrd.img.gz
qemu-img create -f qcow2 tmp/qemu.qcow2 8G
qemu-system-aarch64 -cpu 4 -m 4096 -cpu cortex-a57 -M virt -nographic \
-kernel tftproot/kernel-arm64 \
-initrd xenial-containers-arm64-initrd.img.gz \
-append "printk.devkmsg=on console=ttyAMA0,115200n8 rdinit=/sbin/init" \
-hda tmp/qemu.qcow2 \
-net user
xenial-containers: nfsroot/xenial-containers-arm64.tar.gz