Pino Toscano
2017-May-15 12:52 UTC
[Libguestfs] [PATCH] v2v: linux: pass the root device when using SUSE's mkinitrd
mkinitrd in SLE guests < 12 tries to get the root device by scanning the fstab: this will fail, since v2v already remapped the devices from hd*/sd* to vd* in the guest (including in its fstab). Since we know what is the root device in the appliance, pass it to mkinitrd directly, so it does not have to do guesswork. Thanks to: Cédric Bosdonnat, for reporting the issue, and testing the fix. --- v2v/convert_linux.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index a1088b3..f8dfa00 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -517,7 +517,8 @@ let rec convert (g : G.guestfs) inspect source output rcaps g#command [| "/sbin/mkinitrd"; "-m"; String.concat " " modules; "-i"; initrd; - "-k"; kernel.ki_vmlinuz |] + "-k"; kernel.ki_vmlinuz; + "-d"; inspect.i_root |] ) ) else if family = `Debian_family then ( -- 2.9.3
Cedric Bosdonnat
2017-May-15 13:51 UTC
Re: [Libguestfs] [PATCH] v2v: linux: pass the root device when using SUSE's mkinitrd
ACK. On Mon, 2017-05-15 at 14:52 +0200, Pino Toscano wrote:> mkinitrd in SLE guests < 12 tries to get the root device by scanning the > fstab: this will fail, since v2v already remapped the devices from > hd*/sd* to vd* in the guest (including in its fstab). > > Since we know what is the root device in the appliance, pass it to > mkinitrd directly, so it does not have to do guesswork. > > Thanks to: Cédric Bosdonnat, for reporting the issue, and testing > the fix. > --- > v2v/convert_linux.ml | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml > index a1088b3..f8dfa00 100644 > --- a/v2v/convert_linux.ml > +++ b/v2v/convert_linux.ml > @@ -517,7 +517,8 @@ let rec convert (g : G.guestfs) inspect source output rcaps > g#command [| "/sbin/mkinitrd"; > "-m"; String.concat " " modules; > "-i"; initrd; > - "-k"; kernel.ki_vmlinuz |] > + "-k"; kernel.ki_vmlinuz; > + "-d"; inspect.i_root |] > ) > ) > else if family = `Debian_family then (
Apparently Analagous Threads
- [PATCH v3 1/2] v2v: linux: correctly reconfigure the initrd on Debian
- [PATCH v4] v2v: linux: correctly reconfigure the initrd on Debian
- [PATCH] v2v: tell v2v the real root device to mkinitrd
- [PATCH] v2v: linux: Move kernel detection to a separate module.
- Re: [PATCH 8/8] v2v: linux: correctly reconfigure the initrd on Debian