Displaying 17 results from an estimated 17 matches for "remove_hd_prefix".
2016 Aug 15
2
[PATCH v2] v2v: factor out bootloader handling
...ethod virtual configure_console : unit -> unit
+ method virtual remove_console : unit -> unit
+ method update () = ()
+end
+
+(* Helper type used in detect_bootloader. *)
+type bootloader_type =
+ | Grub1
+ | Grub2
+
+(* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
+let remove_hd_prefix path =
+ let rex = Str.regexp "^(hd.*)\\(.*\\)" in
+ Str.replace_first rex "\\1" path
+
+(* Grub1 (AKA grub-legacy) representation. *)
+class bootloader_grub1 (g : G.guestfs) inspect grub_config =
+ (* Grub prefix? Usually "/boot". *)
+ let grub_prefix =
+ let...
2015 Nov 20
0
[PATCH] v2v: factor out bootloader handling
...ethod virtual configure_console : unit -> unit
+ method virtual remove_console : unit -> unit
+ method update () = ()
+end
+
+(* Helper type used in detect_bootloader. *)
+type bootloader_type =
+ | Grub1
+ | Grub2
+
+(* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
+let remove_hd_prefix path =
+ let rex = Str.regexp "^(hd.*)\\(.*\\)" in
+ Str.replace_first rex "\\1" path
+
+(* Grub1 (AKA grub-legacy) representation. *)
+class bootloader_grub1 g inspect grub_config =
+ let prefix =
+ let mounts = g#inspect_get_mountpoints inspect.i_root in
+ try
+...
2016 Aug 15
0
Re: [PATCH v2] v2v: factor out bootloader handling
...nd it appears to be correct and there is
nothing omitted from the current implementation.
Rich.
> +(* Helper type used in detect_bootloader. *)
> +type bootloader_type =
> + | Grub1
> + | Grub2
> +
> +(* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
> +let remove_hd_prefix path =
> + let rex = Str.regexp "^(hd.*)\\(.*\\)" in
> + Str.replace_first rex "\\1" path
> +
> +(* Grub1 (AKA grub-legacy) representation. *)
> +class bootloader_grub1 (g : G.guestfs) inspect grub_config =
> + (* Grub prefix? Usually "/boot". *)...
2016 Nov 10
0
[PATCH v5 1/3] v2v: bootloaders: search grub config for all distributions
..._bootloaders.ml
+++ b/v2v/linux_bootloaders.ml
@@ -42,6 +42,10 @@ type bootloader_type =
| Grub1
| Grub2
+let string_of_bootloader_type = function
+ | Grub1 -> "Grub1"
+ | Grub2 -> "Grub2"
+
(* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
let remove_hd_prefix path =
let rex = Str.regexp "^(hd.*)\\(.*\\)" in
@@ -49,6 +53,10 @@ let remove_hd_prefix path =
(* Grub1 (AKA grub-legacy) representation. *)
class bootloader_grub1 (g : G.guestfs) inspect grub_config =
+ let () =
+ if grub_config = "/boot/efi/EFI/redhat/grub.conf" th...
2016 Nov 02
4
[PATCH v4 1/2] v2v: bootloaders: search grub config for all distributions
..._bootloaders.ml
+++ b/v2v/linux_bootloaders.ml
@@ -42,6 +42,10 @@ type bootloader_type =
| Grub1
| Grub2
+let string_of_bootloader_type = function
+ | Grub1 -> "Grub1"
+ | Grub2 -> "Grub2"
+
(* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
let remove_hd_prefix path =
let rex = Str.regexp "^(hd.*)\\(.*\\)" in
@@ -49,6 +53,10 @@ let remove_hd_prefix path =
(* Grub1 (AKA grub-legacy) representation. *)
class bootloader_grub1 (g : G.guestfs) inspect grub_config =
+ let () =
+ if grub_config = "/boot/efi/EFI/redhat/grub.conf" th...
2016 Aug 25
2
[PATCH v2] v2v: factor out bootloader handling
...ed_kernels : kernel_info list =
@@ -276,88 +240,7 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
* list is the default booting kernel.
*)
let grub_kernels : kernel_info list =
- (* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
- let remove_hd_prefix =
- let rex = Str.regexp "^(hd.*)\\(.*\\)" in
- Str.replace_first rex "\\1"
- in
-
- let vmlinuzes =
- match grub with
- | `Grub1 ->
- let paths =
- let expr = sprintf "/files%s/title/kernel" grub_config in
- let p...
2017 Apr 28
0
Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
...; @@ -42,6 +42,10 @@ type bootloader_type =
> | Grub1
> | Grub2
>
> +let string_of_bootloader_type = function
> + | Grub1 -> "Grub1"
> + | Grub2 -> "Grub2"
> +
> (* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
> let remove_hd_prefix path =
> let rex = Str.regexp "^(hd.*)\\(.*\\)" in
> @@ -49,6 +53,13 @@ let remove_hd_prefix path =
>
> (* Grub1 (AKA grub-legacy) representation. *)
> class bootloader_grub1 (g : G.guestfs) inspect grub_config =
> + let () =
Wrong indentation here.
> +...
2016 Aug 15
1
Re: [PATCH v2] v2v: factor out bootloader handling
...id this approach as well, and it turns out that:
* every method is basically a giant "match t with Grub1 _ | Grub2 _",
which makes it ugly to read: this is also because the code shared
between one bootloader implementation and another is not really much,
and currently only the "remove_hd_prefix" function is
* the implementation of a bootloader is scattered all around, so
looking at what is done for a bootloader means looking everywhere
* passing a data type when calling every method is basically like
what is done in C to mimim OOP; hence if I have to do something that
resembles...
2017 Apr 28
0
Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
...gt;> | Grub2
> >>
> >>+let string_of_bootloader_type = function
> >>+ | Grub1 -> "Grub1"
> >>+ | Grub2 -> "Grub2"
> >>+
> >> (* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
> >> let remove_hd_prefix path =
> >> let rex = Str.regexp "^(hd.*)\\(.*\\)" in
> >>@@ -49,6 +53,13 @@ let remove_hd_prefix path =
> >>
> >> (* Grub1 (AKA grub-legacy) representation. *)
> >> class bootloader_grub1 (g : G.guestfs) inspect grub_config =
> >>...
2017 Jul 21
3
[PATCH] common/mlstdutils: Add chomp function to remove \n from end of strings.
...ml
@@ -307,12 +307,8 @@ object (self)
match res with
| None -> None
| Some k ->
- let len = String.length k in
- let k =
- if len > 0 && k.[len-1] = '\n' then
- String.sub k 0 (len-1)
- else k in
- Some (remove_hd_prefix k)
+ let k = String.chomp k in
+ Some (remove_hd_prefix k)
in
let vmlinuzes =
--
2.13.2
2016 Nov 10
5
[PATCH v5 0/3] v2v and augeas
Augeas 1.7.0 was released a couple of days ago. By encouraging
everyone to upgrade to this we can drop several calls to aug_transform
and also our custom copies of two lenses, and a lot of related code.
Rich.
2016 Nov 01
3
[PATCH v3] v2v: bootloaders: search grub config for all distributions
...ootloaders.ml | 78 +++++++++++++++++++++++++++++-------------------
1 file changed, 47 insertions(+), 31 deletions(-)
diff --git a/v2v/linux_bootloaders.ml b/v2v/linux_bootloaders.ml
index e03d22b..0c236e1 100644
--- a/v2v/linux_bootloaders.ml
+++ b/v2v/linux_bootloaders.ml
@@ -49,6 +49,14 @@ let remove_hd_prefix path =
(* Grub1 (AKA grub-legacy) representation. *)
class bootloader_grub1 (g : G.guestfs) inspect grub_config =
+ (* We expect Augeas to parse the grub_config file. However
+ * the upstream lens only lists a subset of the possible
+ * locations for this file. Therefore tell Augeas that...
2016 Nov 01
0
Re: [PATCH v3] v2v: bootloaders: search grub config for all distributions
...+++++++++++++-------------------
> 1 file changed, 47 insertions(+), 31 deletions(-)
>
> diff --git a/v2v/linux_bootloaders.ml b/v2v/linux_bootloaders.ml
> index e03d22b..0c236e1 100644
> --- a/v2v/linux_bootloaders.ml
> +++ b/v2v/linux_bootloaders.ml
> @@ -49,6 +49,14 @@ let remove_hd_prefix path =
>
> (* Grub1 (AKA grub-legacy) representation. *)
> class bootloader_grub1 (g : G.guestfs) inspect grub_config =
> + (* We expect Augeas to parse the grub_config file. However
> + * the upstream lens only lists a subset of the possible
> + * locations for this fil...
2017 May 02
2
[PATCH] v2v: bootloaders: search grub config for all distributions
...oaders.ml | 80 ++++++++++++++++++++++++++++++------------------
1 file changed, 50 insertions(+), 30 deletions(-)
diff --git a/v2v/linux_bootloaders.ml b/v2v/linux_bootloaders.ml
index cad72a829..33a6dc4e9 100644
--- a/v2v/linux_bootloaders.ml
+++ b/v2v/linux_bootloaders.ml
@@ -49,6 +49,13 @@ let remove_hd_prefix path =
(* Grub1 (AKA grub-legacy) representation. *)
class bootloader_grub1 (g : G.guestfs) inspect grub_config =
+ let () =
+ (* Apply the "grub" lens if it is not handling the file
+ * already -- Augeas < 1.7.0 will error out otherwise.
+ *)
+ if g#aug_ls ("/files&quo...
2020 May 15
1
[PATCH] v2v: fix UEFI bootloader for linux guests
...bootloader = object
method virtual configure_console : unit -> unit
method virtual remove_console : unit -> unit
method update () = ()
+ method virtual fix_efi_boot : unit -> string
end
(* Helper function for SUSE: remove (hdX,X) prefix from a path. *)
@@ -43,6 +44,115 @@ let remove_hd_prefix =
let rex = PCRE.compile "^\\(hd.*\\)" in
PCRE.replace rex ""
+(* Standard uefi fallback path *)
+let uefi_fallback_path =
+ "/boot/efi/EFI/BOOT/"
+
+(* Helper function checks if 'source' contains 's' *)
+let contains source s =
+ let re = S...
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