Add partition table type selector (defaulted to DOS/MBR) to format package

Signed-off-by: Federico Pellegatta <12744504+federico-pellegatta@users.noreply.github.com>
This commit is contained in:
Federico Pellegatta
2020-04-20 12:55:07 +02:00
parent cab95cfc51
commit 5fc196c289
25 changed files with 119 additions and 38 deletions

View File

@@ -12,7 +12,7 @@ onboot:
- name: sysfs
image: linuxkit/sysfs:697f996868d6625a78bbbefb199d7b6b6ae3533a
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69
command: ["/usr/bin/mountie", "/var/lib/docker"]

View File

@@ -13,7 +13,7 @@ onboot:
- name: sysctl
image: linuxkit/sysctl:541f60fe3676611328e89e8bac251fc636b1a6aa
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69
command: ["/usr/bin/mountie", "/var/lib"]

View File

@@ -6,7 +6,7 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69
command: ["/usr/bin/mountie", "/var/lib/docker"]

View File

@@ -9,7 +9,7 @@ onboot:
image: linuxkit/modprobe:944769462b9d10b1b1506498d3eb03dcc5416f7f
command: ["modprobe", "btrfs"]
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-type", "btrfs" ]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69

View File

@@ -6,7 +6,7 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-type", "xfs"]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69

View File

@@ -6,7 +6,7 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format"]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69

View File

@@ -6,7 +6,7 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-label", "docker"]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69

View File

@@ -6,7 +6,7 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "@DEVICE@"]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69

View File

@@ -9,7 +9,7 @@ onboot:
image: linuxkit/modprobe:944769462b9d10b1b1506498d3eb03dcc5416f7f
command: ["modprobe", "btrfs"]
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-type", "btrfs" ]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69

View File

@@ -6,7 +6,7 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-type", "xfs" ]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69

View File

@@ -6,19 +6,19 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-verbose", "-type", "ext4", "/dev/sda"]
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-verbose", "-type", "ext4", "/dev/sdb"]
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-verbose", "-type", "xfs", "/dev/sda"]
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-verbose", "-force", "-type", "xfs", "/dev/sdb"]
- name: test
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
binds:
- /check.sh:/check.sh
command: ["sh", "./check.sh"]

View File

@@ -0,0 +1,10 @@
#!/bin/sh
function failed {
printf "format_mount test suite FAILED\n" >&1
exit 1
}
touch /var/lib/docker/foo || failed
printf "format_mount test suite PASSED\n" >&1

View File

@@ -0,0 +1,25 @@
#!/bin/sh
# SUMMARY: Check that a GPT partitioned disk can be mounted
# LABELS:
# REPEAT:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=test-format
DISK=disk.img
clean_up() {
rm -rf ${NAME}-* ${DISK}
}
trap clean_up EXIT
linuxkit build -format kernel+initrd -name ${NAME} test.yml
RESULT="$(linuxkit run -disk file=${DISK},size=512M ${NAME})"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0

View File

@@ -0,0 +1,29 @@
kernel:
image: linuxkit/kernel:5.4.30
cmdline: "console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:f670045ecb6ec31ea37dd10114366e9a1e915013
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-partition", "gpt"]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69
command: ["/usr/bin/mountie", "/var/lib/docker"]
- name: test
image: alpine:3.11
binds:
- /var/lib/docker:/var/lib/docker
- /check.sh:/check.sh
command: ["sh", "./check.sh"]
- name: poweroff
image: linuxkit/poweroff:06dd4e46c62fbe79123a028835c921f80e4855d3
command: ["/bin/sh", "/poweroff.sh", "10"]
files:
- path: check.sh
source: ./check.sh
trust:
org:
- linuxkit
- library

View File

@@ -6,10 +6,10 @@ init:
- linuxkit/runc:1eef77f5963e44e491abfe392206769037d47ae2
onboot:
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-label", "docker"]
- name: format
image: linuxkit/format:80bd847a90842d3f19460a560d7d95d6fe13bd71
image: linuxkit/format:0b75e494eea0312f3015e6c6f7c5927620d56c96
command: ["/usr/bin/format", "-label", "foo"]
- name: mount
image: linuxkit/mount:8363f4f1744e1df2557ec260a4cc94227178fd69