search for: aug_transform

Displaying 20 results from an estimated 54 matches for "aug_transform".

2016 Aug 19
2
[PATCH] New API: aug_transform
Expose the aug_transform API through the library, so it's possible to add/remove Augeas transformations to handle files in custom places using existing lenses. --- daemon/augeas.c | 21 +++++++++++++++++++++ generator/actions.ml | 12 ++++++++++++ gobject/Makefile.inc | 2 ++ src/MAX_PROC_NR | 2 +- 4 file...
2014 Oct 24
2
[PATCH] daemon: Remove custom Augeas lenses.
...| AUG_NO_ERR_CLOSE); + aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE); if (!aug) { reply_with_error ("augeas initialization failed"); @@ -148,25 +148,6 @@ do_aug_init (const char *root, int flags) return -1; } - if (!augeas_is_version (1, 2, 1)) { - int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow", - 0 /* = included */); - if (r == -1) { - AUGEAS_ERROR ("aug_transform"); - aug_close (aug); - aug = NULL; - return -1; - } - - /* If aug_load was implicitly called, reload th...
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 02
4
[PATCH v4 1/2] v2v: bootloaders: search grub config for all distributions
...et 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" then + g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf" in + (* Grub prefix? Usually "/boot". *) let grub_prefix = let mounts = g#inspect_get_mountpoints inspect.i_root in @@ -191,7 +199,7 @@ type default_kernel_method = | MethodNone (** No known way. *) (* Grub2 re...
2016 Nov 03
1
Transform and "Lenses xx and xx could be used to load this file"
...ny advice. The problem is that we often -- as with yesterday's patch -- add new config file paths to lenses. Or we want to parse config files which are not necessarily in the exact paths that Augeas is expecting. Now it's easy enough to parse such files using an arbitrary lens by calling aug_transform, eg: $ ls passwd $ augtool -r `pwd` augtool> transform passwd incl /passwd augtool> load augtool> ls /files/passwd/ abrt/ lightdm/ rjones/ adm/ lirc/ root/ akmods/ lp/ rpc/ #...
2014 Oct 24
1
[PATCH v3] daemon: Remove custom Augeas lenses.
v3: - Don't remove the LVM transform.
2016 Nov 01
3
[PATCH v3] v2v: bootloaders: search grub config for all distributions
...ugeas 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 + * grub_config is a grub file (this apparently doesn't affect + * Augeas if it already parsed the file). + *) + let () = g#aug_transform "grub" grub_config in + (* Grub prefix? Usually "/boot". *) let grub_prefix = let mounts = g#inspect_get_mountpoints inspect.i_root in @@ -191,7 +199,7 @@ type default_kernel_method = | MethodNone (** No known way. *) (* Grub2 representation. *) -class bootloa...
2014 Oct 24
1
[PATCH v2] daemon: Remove custom Augeas lenses.
v2 of previous patch, which fixes some missing bits. For now I'm going to go with Pino's RHEL 7.1 patch, since it is at least smaller than this. So I'm sending this to the list just to have it archived for later. Rich.
2016 Nov 01
0
[PATCH] v2v: bootloaders: search grub config for all distributions
On Thu, Oct 27, 2016 at 08:22:30PM +0300, Pavel Butsykin wrote: > match typ with > | Grub1 -> > - if config_file = "/boot/efi/EFI/redhat/grub.conf" then > - g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf"; > - > + (match inspect.i_firmware with > + | I_BIOS -> () > + | I_UEFI _ -> g#aug_transform "grub" config_file > + ); > new bootloader_grub1 g inspect config_file > | Grub2 -> ne...
2016 Nov 01
0
Re: [PATCH] v2v: bootloaders: search grub config for all distributions
...wrote: > On 01.11.2016 13:11, Richard W.M. Jones wrote: > >On Thu, Oct 27, 2016 at 08:22:30PM +0300, Pavel Butsykin wrote: > >> match typ with > >> | Grub1 -> > >>- if config_file = "/boot/efi/EFI/redhat/grub.conf" then > >>- g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf"; > >>- > >>+ (match inspect.i_firmware with > >>+ | I_BIOS -> () > >>+ | I_UEFI _ -> g#aug_transform "grub" config_file > >>+ ); > >> new bootloader_gru...
2016 Nov 02
0
Re: [PATCH v4 1/2] v2v: bootloaders: search grub config for all distributions
...LGTM (it was the approach I suggested, after all) -- just one note below. > (* Grub1 (AKA grub-legacy) representation. *) > class bootloader_grub1 (g : G.guestfs) inspect grub_config = > + let () = > + if grub_config = "/boot/efi/EFI/redhat/grub.conf" then > + g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf" in I guess this could be changed to be: if String.is_prefix grub_config "/boot/efi/EFI/" then g#aug_transform "grub" grub_config so even if we keep it around for a while, it will work fine also for other distro...
2017 Apr 28
0
Re: [PATCH v6 0/1] v2v bootloaders and augeas
...t;>>As far as I understand we can't do a strict requirement to use Augeas > >>>>= 1.7.0. > >>I'm not sure I know enough to review this patch, but on the issue > > > >As I remember the patch was already reviewed, there was only an issue with > >aug_transform to existing grub config path. > > > >>of Augeas 1.7.0: As Augeas 1.7.0 was released nearly 6 months ago, > >>I think it would be fine to require it for virt-v2v. If we did > >>that does it help? > > > >Yes, definitely. In this case, we can just apply y...
2014 Oct 24
0
Re: [PATCH] daemon: Remove custom Augeas lenses.
...Augeas >= 1.2.1 is released. > diff --git a/daemon/lvm-filter.c b/daemon/lvm-filter.c > index 72fe6ac..d119f9e 100644 > --- a/daemon/lvm-filter.c > +++ b/daemon/lvm-filter.c > @@ -133,18 +133,6 @@ set_filter (char *const *filters) > return -1; > } > > - r = aug_transform (aug, "guestfs_lvm_conf", "/lvm/lvm.conf", > - 0 /* = included */); > - if (r == -1) { > - AUGEAS_ERROR ("aug_transform"); > - return -1; > - } > - > - if (aug_load (aug) == -1) { > - AUGEAS_ERROR ("aug_load&...
2016 Oct 31
0
Re: [PATCH] v2v: bootloaders: search grub config for all distributions
...extract the basename of each path, never use Filename.basename for paths in the appliance!) + comparison with the elements in the grub_configs array of this patch. > match typ with > | Grub1 -> > - if config_file = "/boot/efi/EFI/redhat/grub.conf" then > - g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf"; > - > + (match inspect.i_firmware with > + | I_BIOS -> () > + | I_UEFI _ -> g#aug_transform "grub" config_file > + ); > new bootloader_grub1 g inspect config_file This part looks fine....
2016 Nov 10
0
[PATCH v5 1/3] v2v: bootloaders: search grub config for all distributions
...et 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" then + g#aug_transform "grub" "/boot/efi/EFI/redhat/grub.conf" in + (* Grub prefix? Usually "/boot". *) let grub_prefix = let mounts = g#inspect_get_mountpoints inspect.i_root in @@ -191,7 +199,7 @@ type default_kernel_method = | MethodNone (** No known way. *) (* Grub2 re...
2016 Sep 16
1
[PATCH v4] v2v: linux: correctly reconfigure the initrd on Debian
...(* The modules to add to initrd are defined in: + * /etc/initramfs-tools/modules + * File format is same as modules(5). + *) + let file = "/etc/initramfs-tools/modules" in + let path = sprintf "/files%s" file in + g#aug_transform "modules" file; + g#aug_load (); + g#aug_set (sprintf "%s/#comment[last()+1]" path) + "The following modules were added by virt-v2v"; + List.iter ( + fun m -> g#aug_clear (sprintf "%s/%s" path m) +...
2016 Nov 01
0
Re: [PATCH v3] v2v: bootloaders: search grub config for all distributions
...file. However > + * the upstream lens only lists a subset of the possible > + * locations for this file. Therefore tell Augeas that > + * grub_config is a grub file (this apparently doesn't affect > + * Augeas if it already parsed the file). > + *) > + let () = g#aug_transform "grub" grub_config in > + > (* Grub prefix? Usually "/boot". *) > let grub_prefix = > let mounts = g#inspect_get_mountpoints inspect.i_root in > @@ -191,7 +199,7 @@ type default_kernel_method = > | MethodNone (** No known way. *) > > (*...
2017 Apr 28
0
Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
...grub_config = > + let () = Wrong indentation here. > + (* 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" ^ grub_config) = [||] then > + g#aug_transform "grub" grub_config in > + > (* Grub prefix? Usually "/boot". *) > let grub_prefix = > let mounts = g#inspect_get_mountpoints inspect.i_root in > @@ -191,7 +202,7 @@ type default_kernel_method = > | MethodNone (** No known way. *) > > (*...
2017 May 02
2
[PATCH] v2v: bootloaders: search grub config for all distributions
...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" ^ grub_config) = [||] then + g#aug_transform "grub" grub_config in + (* Grub prefix? Usually "/boot". *) let grub_prefix = let mounts = g#inspect_get_mountpoints inspect.i_root in @@ -335,33 +342,46 @@ object (self) end let detect_bootloader (g : G.guestfs) inspect = - let config_file, typ = - let locat...
2017 Apr 28
0
Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
...on here. > > > >>+ (* 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" ^ grub_config) = [||] then > >>+ g#aug_transform "grub" grub_config in > >>+ > >> (* Grub prefix? Usually "/boot". *) > >> let grub_prefix = > >> let mounts = g#inspect_get_mountpoints inspect.i_root in > >>@@ -191,7 +202,7 @@ type default_kernel_method = > >>...