diff --git a/blueprints/docker-for-mac/base.yml b/blueprints/docker-for-mac/base.yml index 04e62b08e..7d1373003 100644 --- a/blueprints/docker-for-mac/base.yml +++ b/blueprints/docker-for-mac/base.yml @@ -20,7 +20,7 @@ onboot: image: linuxkit/binfmt:4b1d7a8dab03c09855fb4b6060a42b2294674b47 # Format and mount the disk image in /var/lib/docker - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib"] diff --git a/examples/cadvisor.yml b/examples/cadvisor.yml index f2fd85098..69b23c074 100644 --- a/examples/cadvisor.yml +++ b/examples/cadvisor.yml @@ -15,7 +15,7 @@ onboot: - name: sysfs image: linuxkit/sysfs:1284b4a7061a5cc426425f0fb00748192505a05f - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib/docker"] diff --git a/examples/docker.yml b/examples/docker.yml index 8b9a70edb..82bc29bb2 100644 --- a/examples/docker.yml +++ b/examples/docker.yml @@ -12,7 +12,7 @@ onboot: - name: sysfs image: linuxkit/sysfs:1284b4a7061a5cc426425f0fb00748192505a05f - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib/docker"] diff --git a/examples/swap.yml b/examples/swap.yml index 44b8e026f..934b158cf 100644 --- a/examples/swap.yml +++ b/examples/swap.yml @@ -13,7 +13,7 @@ onboot: image: linuxkit/dhcpcd:0d59a6cc03412289ef4313f2491ec666c1715cc9 command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/external"] diff --git a/pkg/format/format.go b/pkg/format/format.go index 713975555..d6868d2ac 100644 --- a/pkg/format/format.go +++ b/pkg/format/format.go @@ -171,7 +171,15 @@ func format(d, label, fsType string, forced bool) error { return fmt.Errorf("Error running blockdev: %v", err) } - partition := fmt.Sprintf("%s1", d) + var partition string + // check if last char is numeric in case of nvme + c := d[len(d)-1] + if c > '0' && c < '9' { + partition = fmt.Sprintf("%sp1", d) + } else { + partition = fmt.Sprintf("%s1", d) + } + if err := refreshDevicesAndWaitFor(partition); err != nil { return err } diff --git a/projects/compose/compose-dynamic.yml b/projects/compose/compose-dynamic.yml index 108d434a2..496e34c6c 100644 --- a/projects/compose/compose-dynamic.yml +++ b/projects/compose/compose-dynamic.yml @@ -15,7 +15,7 @@ onboot: image: linuxkit/dhcpcd:0d59a6cc03412289ef4313f2491ec666c1715cc9 command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib/docker"] diff --git a/projects/compose/compose-static.yml b/projects/compose/compose-static.yml index da25fba9d..8a4e79f0d 100644 --- a/projects/compose/compose-static.yml +++ b/projects/compose/compose-static.yml @@ -15,7 +15,7 @@ onboot: image: linuxkit/dhcpcd:0d59a6cc03412289ef4313f2491ec666c1715cc9 command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib/docker"] diff --git a/test/cases/030_security/000_docker-bench/test.yml b/test/cases/030_security/000_docker-bench/test.yml index 75672d6f8..70d6cea6a 100644 --- a/test/cases/030_security/000_docker-bench/test.yml +++ b/test/cases/030_security/000_docker-bench/test.yml @@ -12,7 +12,7 @@ onboot: - name: sysfs image: linuxkit/sysfs:1284b4a7061a5cc426425f0fb00748192505a05f - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib/docker"] diff --git a/test/cases/040_packages/003_containerd/test.yml b/test/cases/040_packages/003_containerd/test.yml index 76cb0af76..c64b6b3fa 100644 --- a/test/cases/040_packages/003_containerd/test.yml +++ b/test/cases/040_packages/003_containerd/test.yml @@ -13,7 +13,7 @@ onboot: - name: sysctl image: linuxkit/sysctl:4c1ef93bb5eb1a877318db4b2daa6768ed002e21 - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib"] diff --git a/test/cases/040_packages/005_extend/000_ext4/test-create.yml b/test/cases/040_packages/005_extend/000_ext4/test-create.yml index d5d98515b..9c83517c1 100644 --- a/test/cases/040_packages/005_extend/000_ext4/test-create.yml +++ b/test/cases/040_packages/005_extend/000_ext4/test-create.yml @@ -6,7 +6,7 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b command: ["/usr/bin/mountie", "/var/lib/docker"] diff --git a/test/cases/040_packages/005_extend/001_btrfs/test-create.yml b/test/cases/040_packages/005_extend/001_btrfs/test-create.yml index 6348f2c85..669962115 100644 --- a/test/cases/040_packages/005_extend/001_btrfs/test-create.yml +++ b/test/cases/040_packages/005_extend/001_btrfs/test-create.yml @@ -9,7 +9,7 @@ onboot: image: linuxkit/modprobe:1a192d168adadec47afa860e3fc874fbc2a823ff command: ["modprobe", "btrfs"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-type", "btrfs" ] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b diff --git a/test/cases/040_packages/005_extend/002_xfs/test-create.yml b/test/cases/040_packages/005_extend/002_xfs/test-create.yml index ddb0c8f57..69852f6d6 100644 --- a/test/cases/040_packages/005_extend/002_xfs/test-create.yml +++ b/test/cases/040_packages/005_extend/002_xfs/test-create.yml @@ -6,7 +6,7 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-type", "xfs"] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b diff --git a/test/cases/040_packages/006_format_mount/000_auto/test.yml b/test/cases/040_packages/006_format_mount/000_auto/test.yml index 62d182e33..714f0e990 100644 --- a/test/cases/040_packages/006_format_mount/000_auto/test.yml +++ b/test/cases/040_packages/006_format_mount/000_auto/test.yml @@ -6,7 +6,7 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format"] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b diff --git a/test/cases/040_packages/006_format_mount/001_by_label/test.yml b/test/cases/040_packages/006_format_mount/001_by_label/test.yml index ffd0e8893..6d4dcdfc1 100644 --- a/test/cases/040_packages/006_format_mount/001_by_label/test.yml +++ b/test/cases/040_packages/006_format_mount/001_by_label/test.yml @@ -6,7 +6,7 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-label", "docker"] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b diff --git a/test/cases/040_packages/006_format_mount/002_by_name/test.yml.in b/test/cases/040_packages/006_format_mount/002_by_name/test.yml.in index 622451209..05b924eeb 100644 --- a/test/cases/040_packages/006_format_mount/002_by_name/test.yml.in +++ b/test/cases/040_packages/006_format_mount/002_by_name/test.yml.in @@ -6,7 +6,7 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "@DEVICE@"] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b diff --git a/test/cases/040_packages/006_format_mount/003_btrfs/test.yml b/test/cases/040_packages/006_format_mount/003_btrfs/test.yml index a18de5d98..61a027fab 100644 --- a/test/cases/040_packages/006_format_mount/003_btrfs/test.yml +++ b/test/cases/040_packages/006_format_mount/003_btrfs/test.yml @@ -9,7 +9,7 @@ onboot: image: linuxkit/modprobe:1a192d168adadec47afa860e3fc874fbc2a823ff command: ["modprobe", "btrfs"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-type", "btrfs" ] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b diff --git a/test/cases/040_packages/006_format_mount/004_xfs/test.yml b/test/cases/040_packages/006_format_mount/004_xfs/test.yml index c8bd81945..bfb5a9a3f 100644 --- a/test/cases/040_packages/006_format_mount/004_xfs/test.yml +++ b/test/cases/040_packages/006_format_mount/004_xfs/test.yml @@ -6,7 +6,7 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-type", "xfs" ] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b diff --git a/test/cases/040_packages/006_format_mount/005_by_device_force/test.yml b/test/cases/040_packages/006_format_mount/005_by_device_force/test.yml index a87c6b185..791dd1258 100644 --- a/test/cases/040_packages/006_format_mount/005_by_device_force/test.yml +++ b/test/cases/040_packages/006_format_mount/005_by_device_force/test.yml @@ -6,19 +6,19 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-verbose", "-type", "ext4", "/dev/sda"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-verbose", "-type", "ext4", "/dev/sdb"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-verbose", "-type", "xfs", "/dev/sda"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-verbose", "-force", "-type", "xfs", "/dev/sdb"] - name: test - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab binds: - /check.sh:/check.sh command: ["sh", "./check.sh"] diff --git a/test/cases/040_packages/006_format_mount/010_multiple/test.yml b/test/cases/040_packages/006_format_mount/010_multiple/test.yml index bc68ff82e..f704de86c 100644 --- a/test/cases/040_packages/006_format_mount/010_multiple/test.yml +++ b/test/cases/040_packages/006_format_mount/010_multiple/test.yml @@ -6,10 +6,10 @@ init: - linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023 onboot: - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-label", "docker"] - name: format - image: linuxkit/format:e945016ec780a788a71dcddc81497d54d3b14bc7 + image: linuxkit/format:5a1140cb65e733f26de727fa684fef1326e9d5ab command: ["/usr/bin/format", "-label", "foo"] - name: mount image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b