Displaying 16 results from an estimated 16 matches for "grub2_update_console".
2016 Aug 06
1
[PATCH] v2v: fix regex replacement in grub2_update_console
The replacement string was wrong. There are only two match groups in the
regular expression, not three.
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
---
v2v/convert_linux.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 06943cd..4b1ce99 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@
2016 Aug 26
2
[PATCH] v2v: Use unitless methods for methods which don't change the internal state.
..._kernels () =
+ method list_kernels =
let paths =
let expr = sprintf "/files%s/title/kernel" grub_config in
let paths = g#aug_match expr in
@@ -189,7 +189,7 @@ class bootloader_grub2 (g : G.guestfs) grub_config =
object (self)
inherit bootloader
- method private grub2_update_console ~remove =
+ method private grub2_update_console ~remove () =
let rex = Str.regexp "\\(.*\\)\\bconsole=[xh]vc0\\b\\(.*\\)" in
let paths = [
@@ -235,7 +235,7 @@ object (self)
"/files/boot/grub2/device.map/*[label() != \"#comment\"]";
]
- method li...
2016 Sep 12
2
[PATCH 2/2] v2v: ilnux: detect name of grub2-mkconfig
...in
+ try
+ List.find (
+ let e ->
+ try g#is_file ~followsymlinks:true e
+ with G.Error _ -> false
+ ) elems
+ with Not_found ->
+ error (f_"failed to find grub2-mkconfig binary (but Grub2 was detected on guest)")
+
method private grub2_update_console ~remove () =
let rex = Str.regexp "\\(.*\\)\\bconsole=[xh]vc0\\b\\(.*\\)" in
@@ -218,7 +234,7 @@ object (self)
g#aug_save ();
try
- ignore (g#command [| "grub2-mkconfig"; "-o"; grub_config |])
+ ignore (g#command [| grub2_mk...
2016 Aug 25
2
[PATCH v2] v2v: factor out bootloader handling
...t;
- let console = g#aug_get path in
- if Str.string_match rex console 0 then (
- let console = Str.global_replace rex "\\1ttyS0\\3" console in
- g#aug_set path console
- )
- ) paths;
-
- g#aug_save ()
-
- | `Grub2 ->
- grub2_update_console ~remove:false
-
(* If the target doesn't support a serial console, we want to remove
* all references to it instead.
*)
@@ -1013,71 +821,6 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
g#aug_save ()
- and grub_remove_console () =
- match...
2016 Aug 25
0
Re: [PATCH v2] v2v: factor out bootloader handling
On Thu, Aug 25, 2016 at 06:05:16PM +0200, Pino Toscano wrote:
> +(* Grub2 representation. *)
> +class bootloader_grub2 (g : G.guestfs) grub_config =
> + let grub2_update_console ~remove =
I checked the before and after code and I don't think anything has
been missed out.
My only comment is it seems a bit awkward stuffing the
grub2_update_console function definition into what is effectively the
class constructor. Maybe it should be hoisted to the top level of the
Lin...
2016 Sep 12
0
Re: [PATCH 2/2] v2v: ilnux: detect name of grub2-mkconfig
...t, so there is no need to
catch the error (this currently swallows other errors than "does not
exist")
> + ) elems
> + with Not_found ->
> + error (f_"failed to find grub2-mkconfig binary (but Grub2 was detected on guest)")
> +
> method private grub2_update_console ~remove () =
> let rex = Str.regexp "\\(.*\\)\\bconsole=[xh]vc0\\b\\(.*\\)" in
>
> @@ -218,7 +234,7 @@ object (self)
> g#aug_save ();
>
> try
> - ignore (g#command [| "grub2-mkconfig"; "-o"; grub_config |])
>...
2016 Aug 15
2
[PATCH v2] v2v: factor out bootloader handling
...t paths in
+ loop paths
+ )
+ else
+ loop paths
+ in
+ let paths = g#aug_match expr in
+ let paths = Array.to_list paths in
+ loop paths;
+
+ g#aug_save ()
+end
+
+(* Grub2 representation. *)
+class bootloader_grub2 (g : G.guestfs) grub_config =
+ let grub2_update_console ~remove =
+ let rex = Str.regexp "\\(.*\\)\\bconsole=[xh]vc0\\b\\(.*\\)" in
+
+ let paths = [
+ "/files/etc/sysconfig/grub/GRUB_CMDLINE_LINUX";
+ "/files/etc/default/grub/GRUB_CMDLINE_LINUX";
+ "/files/etc/default/grub/GRUB_CMDLINE_LINUX_DEFAU...
2015 Nov 20
0
[PATCH] v2v: factor out bootloader handling
...= Array.to_list paths in
+ loop paths
+ )
+ else
+ loop paths
+ in
+ let paths = g#aug_match expr in
+ let paths = Array.to_list paths in
+ loop paths;
+
+ g#aug_save ()
+end
+
+(* Grub2 representation. *)
+class bootloader_grub2 g grub_config =
+ let grub2_update_console ~remove =
+ let rex = Str.regexp "\\(.*\\)\\bconsole=[xh]vc0\\b\\(.*\\)" in
+
+ let paths = [
+ "/files/etc/sysconfig/grub/GRUB_CMDLINE_LINUX";
+ "/files/etc/default/grub/GRUB_CMDLINE_LINUX";
+ "/files/etc/default/grub/GRUB_CMDLINE_LINUX_DEFAU...
2016 Aug 15
0
Re: [PATCH v2] v2v: factor out bootloader handling
...t; + loop paths
> + in
> + let paths = g#aug_match expr in
> + let paths = Array.to_list paths in
> + loop paths;
> +
> + g#aug_save ()
> +end
> +
> +(* Grub2 representation. *)
> +class bootloader_grub2 (g : G.guestfs) grub_config =
> + let grub2_update_console ~remove =
> + let rex = Str.regexp "\\(.*\\)\\bconsole=[xh]vc0\\b\\(.*\\)" in
> +
> + let paths = [
> + "/files/etc/sysconfig/grub/GRUB_CMDLINE_LINUX";
> + "/files/etc/default/grub/GRUB_CMDLINE_LINUX";
> + "/files/etc/default...
2016 Sep 13
1
[PATCH v3 2/2] v2v: ilnux: detect name of grub2-mkconfig
....Error msg ->
warning (f_"could not rebuild grub2 configuration file (%s). This may mean that grub output will not be sent to the serial port, but otherwise should be harmless. Original error message: %s")
@@ -290,7 +303,7 @@ object (self)
method remove_console = self#grub2_update_console ~remove:true
method update () =
- ignore (g#command [| "grub2-mkconfig"; "-o"; grub_config |])
+ ignore (g#command [| grub2_mkconfig_cmd; "-o"; grub_config |])
end
let detect_bootloader (g : G.guestfs) inspect =
--
2.9.3
2016 Sep 27
0
[PATCH 3/3] v2v: bootloaders: improve detection of Grub2 default method
...@@ -296,7 +322,8 @@ object (self)
my $newdefault = $section->{name};
SetGlobals(default, \"$newdefault\");
" vmlinuz |] in
- ignore (g#command cmd)
+ ignore (g#command cmd)
+ | MethodNone -> ()
method configure_console = self#grub2_update_console ~remove:false
--
2.7.4
2016 Sep 27
8
[PATCH 0/3] v2v: further bits of Debian/Ubuntu guests supports
Hi,
this series adds a couple bits more in v2v to convert Debian/Ubuntu
(and derived) guests. The series does not complete the support (see
known issues below), but all the patches here should be fit for review
and inclusion. The series does not enable the conversion, yet.
Known issues:
* currently tested with simple local guest images, hence needs testing
with real guests on
2016 Oct 03
4
[PATCH v2 0/3] v2v: further bits of Debian/Ubuntu guests supports
Hi,
this series adds a couple bits more in v2v to convert Debian/Ubuntu
(and derived) guests. The series does not complete the support (see
known issues below), but all the patches here should be fit for review
and inclusion. The series does not enable the conversion, yet.
Known issues:
* currently tested with simple local guest images, hence needs testing
with real guests on
2020 May 15
1
[PATCH] v2v: fix UEFI bootloader for linux guests
...i_firmware with
+ | I_UEFI _ -> true
+ | _ -> false in
+
+ let arch = inspect.i_arch in
+ let distro = inspect.i_distro in
+ let distro_ver_major = inspect.i_major_version in
+
object (self)
inherit bootloader
@@ -340,8 +475,14 @@ object (self)
method remove_console = self#grub2_update_console ~remove:true
- method update () =
- ignore (g#command [| grub2_mkconfig_cmd; "-o"; grub_config |])
+ method update () = (
+ ignore (g#command [| grub2_mkconfig_cmd; "-o"; grub_config |]))
+
+ method fix_efi_boot () =
+ if uefi_active then
+ fix_uefi g distro d...
2017 Sep 21
18
[PATCH v2 00/18] Replace many more uses of the Str module with PCRE.
v1 was here:
https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html
This is a more complete evolution of the earlier patch. It replaces
most important uses of Str with PCRE throughout the code. It also
extends the bindings with some useful features like case-insensitive
regexps.
The main places I *didn't* touch are the generator (GObject uses Str
extensively); and
2017 Sep 22
27
[PATCH v3 00/22] Replace almost all uses of the Str module with PCRE.
v1:
https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html
v2:
https://www.redhat.com/archives/libguestfs/2017-September/msg00158.html
v3 is almost identical to v2, but I have added 4 extra commits to
almost finish the job of replacing Str everywhere possible (note it's
not possible to replace Str in common/mlstdutils or the generator
because those are pure OCaml).
As