From f254026ef207ca47db44b32dfa96d7e2b2ed12b3 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 22 Aug 2016 19:07:34 +0100 Subject: [PATCH 1/3] Add block device for qemu and test fix #356 Signed-off-by: Justin Cormack --- Dockerfile.qemu | 4 +++- Dockerfile.test | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile.qemu b/Dockerfile.qemu index ee7c36907..07ae9c721 100644 --- a/Dockerfile.qemu +++ b/Dockerfile.qemu @@ -3,4 +3,6 @@ FROM justincormack/alpine-qemu COPY alpine/initrd.img.gz . COPY alpine/kernel/x86_64/vmlinuz64 . -ENTRYPOINT [ "qemu-system-x86_64", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img.gz", "-m", "2048", "-append", "earlyprintk=serial console=ttyS0 noapic", "-vnc", "none" ] +RUN qemu-img create -f raw disk.img 100M + +ENTRYPOINT [ "qemu-system-x86_64", "-drive", "file=disk.img,format=raw", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img.gz", "-m", "2048", "-append", "earlyprintk=serial console=ttyS0 noapic", "-vnc", "none" ] diff --git a/Dockerfile.test b/Dockerfile.test index 1619bd430..5a08b58ea 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -3,4 +3,6 @@ FROM justincormack/alpine-qemu COPY alpine/initrd.img.gz . COPY alpine/kernel/x86_64/vmlinuz64 . -ENTRYPOINT [ "qemu-system-x86_64", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img.gz", "-m", "1024", "-append", "earlyprintk=serial console=ttyS0 noapic mobyplatform=test", "-vnc", "none" ] +RUN qemu-img create -f raw disk.img 100M + +ENTRYPOINT [ "qemu-system-x86_64", "-drive", "file=disk.img,format=raw", "-serial", "stdio", "-kernel", "vmlinuz64", "-initrd", "initrd.img.gz", "-m", "1024", "-append", "earlyprintk=serial console=ttyS0 noapic mobyplatform=test", "-vnc", "none" ] From a4878c37d1fbfb0cf622502a3c2147630da2e5c2 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 22 Aug 2016 19:08:26 +0100 Subject: [PATCH 2/3] Fix for util-linux, no lsblk Signed-off-by: Justin Cormack --- alpine/packages/automount/etc/init.d/automount | 2 +- alpine/packages/diagnostics/diagnostics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/packages/automount/etc/init.d/automount b/alpine/packages/automount/etc/init.d/automount index 91c686033..294d4b332 100755 --- a/alpine/packages/automount/etc/init.d/automount +++ b/alpine/packages/automount/etc/init.d/automount @@ -10,7 +10,7 @@ start() { ebegin "Configuring host block device" - DEV="$(lsblk -r | grep ' disk $' | awk '{print $1}' | head -1 )" + DEV="$(find /dev -maxdepth 1 -type b ! -name 'loop*' | grep -v '[0-9]$' | sed 's@.*/dev/@@' | head -1 )" [ -z ${DEV} ] && exit 1 diff --git a/alpine/packages/diagnostics/diagnostics b/alpine/packages/diagnostics/diagnostics index 3027e0fb7..30b3e1096 100755 --- a/alpine/packages/diagnostics/diagnostics +++ b/alpine/packages/diagnostics/diagnostics @@ -1,7 +1,7 @@ #!/bin/sh printf '\n' -DEV="$(lsblk -r | grep ' disk $' | awk '{print $1}' | head -1 )" +DEV="$(find /dev -maxdepth 1 -type b ! -name 'loop*' | grep -v '[0-9]$' | sed 's@.*/dev/@@' | head -1 )" [ $? -eq 0 ] && printf "✓ Drive found: $DEV\n" || printf "✗ No drive found\n" DEV=$(mount | grep '/dev/.*da. on /var type') [ $? -eq 0 ] && printf "✓ Drive mounted: $DEV\n" || printf "✗ No drive mounted\n" From 06dd02178263ad97e125cc9b272d86522db0659d Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 22 Aug 2016 19:09:24 +0100 Subject: [PATCH 3/3] Busybox mount will not mount shared, so add a bind Signed-off-by: Justin Cormack --- alpine/etc/fstab | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alpine/etc/fstab b/alpine/etc/fstab index 7ca1d8cb5..0b20d1a8c 100644 --- a/alpine/etc/fstab +++ b/alpine/etc/fstab @@ -1 +1,2 @@ -tmpfs /run tmpfs defaults,nodev,relatime,size=10%,mode=755,shared 0 0 +tmpfs /run tmpfs defaults,nodev,relatime,size=10%,mode=755 0 0 +tmpfs /run tmpfs remount,bind,shared 0 0