From d1c39543c259f76720a4d9c173d7d15f6fa753d7 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 22 Dec 2022 09:52:41 +0100 Subject: give the ext4 image a disk label - this allows the kernel cmdline and fstab to refer to it by label instead of by /dev/sda or /dev/vda (depending on whether the disk is attached to qemu via virtio or not) - it allows other consumers of the image to detect that this is an image created by debvm and then treat it accordingly --- debvm-create | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debvm-create') diff --git a/debvm-create b/debvm-create index 11e145c..c44b67d 100755 --- a/debvm-create +++ b/debvm-create @@ -122,7 +122,7 @@ set -- \ "$@" # unless we set up a fstab, / will be read-only -set -- "--customize-hook=echo '/dev/vda / ext4 defaults 0 1' >"'"$1/etc/fstab"' "$@" +set -- "--customize-hook=echo 'LABEL=debvm / ext4 defaults 0 1' >"'"$1/etc/fstab"' "$@" # set up a hostname set -- \ @@ -176,4 +176,4 @@ mmdebstrap "$@" truncate -s "$SIZE" "$IMAGE" /sbin/resize2fs "$IMAGE" -/sbin/tune2fs -i 0 -O extents,uninit_bg,dir_index,has_journal "$IMAGE" +/sbin/tune2fs -L debvm -i 0 -O extents,uninit_bg,dir_index,has_journal "$IMAGE" -- cgit v1.2.3