mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
test-data: Use another name for boot and root MD devices.
mdadm 4.0 no longer lets you create devices called literally "boot" or "root", giving a very obscure error message: https://bugzilla.redhat.com/show_bug.cgi?id=1433575 Work around this by calling them something else.
This commit is contained in:
@@ -83,7 +83,7 @@ LABEL=ROOT / ext2 default 0 0
|
||||
EOF
|
||||
close ($fstab) or die;
|
||||
|
||||
$bootdev = '/dev/md/boot';
|
||||
$bootdev = '/dev/md/bootdev';
|
||||
|
||||
foreach my $img (@images) {
|
||||
$g->disk_create ($img, "raw", $IMAGE_SIZE);
|
||||
@@ -100,8 +100,8 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
$g->md_create ('boot', ['/dev/sda1', '/dev/sdb1']);
|
||||
$g->md_create ('root', ['/dev/sda2', '/dev/sdb2']);
|
||||
$g->md_create ('bootdev', ['/dev/sda1', '/dev/sdb1']);
|
||||
$g->md_create ('rootdev', ['/dev/sda2', '/dev/sdb2']);
|
||||
|
||||
open (my $mdadm, '>', "fedora.mdadm") or die;
|
||||
print $mdadm <<EOF;
|
||||
@@ -110,7 +110,7 @@ AUTO +imsm +1.x -all
|
||||
EOF
|
||||
|
||||
my $i = 0;
|
||||
foreach ('boot', 'root') {
|
||||
foreach ('bootdev', 'rootdev') {
|
||||
my %detail = $g->md_detail ("/dev/md/$_");
|
||||
print $mdadm "ARRAY /dev/md$i level=raid1 num-devices=2 UUID=",
|
||||
$detail{uuid}, "\n";
|
||||
@@ -119,7 +119,7 @@ EOF
|
||||
|
||||
close ($mdadm) or die;
|
||||
|
||||
init_lvm_root ('/dev/md/root');
|
||||
init_lvm_root ('/dev/md/rootdev');
|
||||
}
|
||||
|
||||
elsif ($ENV{LAYOUT} eq 'btrfs') {
|
||||
|
||||
@@ -40,10 +40,10 @@ if [ "$(cat inspect-fstab-md.output)" != "true" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test inspection when /boot is specfied as /dev/md/boot
|
||||
# Test inspection when /boot is specfied as /dev/md/bootdev
|
||||
cat <<'EOF' > inspect-fstab-md.fstab
|
||||
/dev/VG/Root / ext2 default 0 0
|
||||
/dev/md/boot /boot ext2 default 0 0
|
||||
/dev/md/bootdev /boot ext2 default 0 0
|
||||
EOF
|
||||
|
||||
guestfish --format=raw -a inspect-fstab-md-1.img --format=raw -a inspect-fstab-md-2.img <<'EOF'
|
||||
@@ -57,7 +57,7 @@ guestfish -i --format=raw -a inspect-fstab-md-1.img --format=raw -a inspect-fsta
|
||||
EOF
|
||||
|
||||
if [ "$(cat inspect-fstab-md.output)" != "true" ]; then
|
||||
echo "$0: error: /boot not correctly mounted (/dev/md/boot)"
|
||||
echo "$0: error: /boot not correctly mounted (/dev/md/bootdev)"
|
||||
cat inspect-fstab-md.output
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user