From 5b20983ebfbfe3340667afdc69ed6d4ea0fb3a10b6bba15b66c6d60451990400 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 14 Oct 2014 08:35:35 +0000 Subject: [PATCH 1/4] - Include gconv modules for hivex (bnc#900530) OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=320 --- libguestfs.changes | 5 +++++ libguestfs.mkinitrd.setup.sh | 29 +++++++++++++++++++++++++++++ libguestfs.spec | 2 ++ 3 files changed, 36 insertions(+) diff --git a/libguestfs.changes b/libguestfs.changes index 83e6ef2..ac2780f 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 14 10:34:12 CEST 2014 - ohering@suse.de + +- Include gconv modules for hivex (bnc#900530) + ------------------------------------------------------------------- Fri Sep 5 09:53:22 CEST 2014 - ohering@suse.de diff --git a/libguestfs.mkinitrd.setup.sh b/libguestfs.mkinitrd.setup.sh index 39917c9..dfac67a 100644 --- a/libguestfs.mkinitrd.setup.sh +++ b/libguestfs.mkinitrd.setup.sh @@ -2,6 +2,26 @@ #%stage: block # +fdupes_s() { + local _target="" + local _file= + fdupes --quiet --noempty --recurse "$@" | + while read _file + do + if test -z "$_target" + then + _target="$_file" + else + if test -z "$_file" + then + _target="" + continue + fi + echo ln -fv "${_target##*/}" "$_file" + fi + done +} + # copy daemon manually because it is located in RPM_BUILD_ROOT mkdir -vp $tmp_mnt/usr/sbin cp_bin $(type -p guestfsd) $tmp_mnt/usr/sbin @@ -37,6 +57,15 @@ do fi done +for d in /usr/lib*/gconv +do + if test -e $d + then + cp -avL --parents $d $tmp_mnt/ + fdupes_s $tmp_mnt$d + fi +done + for t in \ screen \ vt100 \ diff --git a/libguestfs.spec b/libguestfs.spec index 6d3ecc2..a888e0e 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -166,6 +166,7 @@ BuildRequires: fuse-devel %endif # %if %{with hivex} +BuildRequires: glibc-locale BuildRequires: hivex-devel %endif # @@ -403,6 +404,7 @@ BuildRequires: e2fsprogs %if %{with ext4_writeable} BuildRequires: ext4-writeable-kmp-default %endif +BuildRequires: fdupes BuildRequires: file BuildRequires: findutils BuildRequires: gawk From 33d5907880f5dd7934fed536235ee7c9f16c1bbed9e6b3e0ee02966676cb90e5 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 16 Oct 2014 11:27:06 +0000 Subject: [PATCH 2/4] - Handle btrfs subvolume name '@' as used in SLE12 (bnc#900346) OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=321 --- 0000-hotfix.patch | 30 ++++++++++++++++++++++++++++++ libguestfs.changes | 5 +++++ 2 files changed, 35 insertions(+) diff --git a/0000-hotfix.patch b/0000-hotfix.patch index b9f1150..5b21c45 100644 --- a/0000-hotfix.patch +++ b/0000-hotfix.patch @@ -16,3 +16,33 @@ index 0000000..8b13789 +++ b/pkg-hotfix.txt @@ -0,0 +1 @@ + +diff --git a/daemon/btrfs.c b/daemon/btrfs.c +index 7a4d43d..ceea593 100644 +--- a/daemon/btrfs.c ++++ b/daemon/btrfs.c +@@ -356,6 +356,7 @@ do_btrfs_subvolume_list (const mountable_t *fs) + ADD_ARG (argv, i, str_btrfs); + ADD_ARG (argv, i, "subvolume"); + ADD_ARG (argv, i, "list"); ++ ADD_ARG (argv, i, "-a"); + ADD_ARG (argv, i, fs_buf); + ADD_ARG (argv, i, NULL); + +diff --git a/src/listfs.c b/src/listfs.c +index ffb0adc..db127ea 100644 +--- a/src/listfs.c ++++ b/src/listfs.c +@@ -176,9 +183,12 @@ check_with_vfs_type (guestfs_h *g, const char *device, struct stringsbuf *sb) + + for (size_t i = 0; i < vols->len; i++) { + struct guestfs_btrfssubvolume *this = &vols->val[i]; ++ char *btrfssubvolume_path = this->btrfssubvolume_path; ++ guestfs___trace(g, "XXX %s(%u) device %s btrfssubvolume_path %s", __func__, __LINE__, device, btrfssubvolume_path); ++ if (STREQ(btrfssubvolume_path, "/@")) btrfssubvolume_path = "/@"; + guestfs___add_sprintf (g, sb, + "btrfsvol:%s/%s", +- device, this->btrfssubvolume_path); ++ device, btrfssubvolume_path); + guestfs___add_string (g, sb, "btrfs"); + } + diff --git a/libguestfs.changes b/libguestfs.changes index ac2780f..23f4b62 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Oct 16 13:26:13 CEST 2014 - ohering@suse.de + +- Handle btrfs subvolume name '@' as used in SLE12 (bnc#900346) + ------------------------------------------------------------------- Tue Oct 14 10:34:12 CEST 2014 - ohering@suse.de From 3200147e0a52b3df795528a74db0385db5070b267ceba0e4f11a4f59b45b8836 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 16 Oct 2014 13:42:16 +0000 Subject: [PATCH 3/4] drop guestfs___trace from btrfs subvol change OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=322 --- 0000-hotfix.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/0000-hotfix.patch b/0000-hotfix.patch index 5b21c45..e5712e3 100644 --- a/0000-hotfix.patch +++ b/0000-hotfix.patch @@ -32,12 +32,11 @@ diff --git a/src/listfs.c b/src/listfs.c index ffb0adc..db127ea 100644 --- a/src/listfs.c +++ b/src/listfs.c -@@ -176,9 +183,12 @@ check_with_vfs_type (guestfs_h *g, const char *device, struct stringsbuf *sb) +@@ -176,9 +183,11 @@ check_with_vfs_type (guestfs_h *g, const char *device, struct stringsbuf *sb) for (size_t i = 0; i < vols->len; i++) { struct guestfs_btrfssubvolume *this = &vols->val[i]; + char *btrfssubvolume_path = this->btrfssubvolume_path; -+ guestfs___trace(g, "XXX %s(%u) device %s btrfssubvolume_path %s", __func__, __LINE__, device, btrfssubvolume_path); + if (STREQ(btrfssubvolume_path, "/@")) btrfssubvolume_path = "/@"; guestfs___add_sprintf (g, sb, "btrfsvol:%s/%s", From 72ad8f1b193bcdef0a2170c861cb360b4a183b1a43dab58bba9194384b9b2b8b Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 16 Oct 2014 15:06:01 +0000 Subject: [PATCH 4/4] Use just btrfs subvolume list -o $mnt OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=323 --- 0000-hotfix.patch | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/0000-hotfix.patch b/0000-hotfix.patch index e5712e3..fe556db 100644 --- a/0000-hotfix.patch +++ b/0000-hotfix.patch @@ -24,24 +24,7 @@ index 7a4d43d..ceea593 100644 ADD_ARG (argv, i, str_btrfs); ADD_ARG (argv, i, "subvolume"); ADD_ARG (argv, i, "list"); -+ ADD_ARG (argv, i, "-a"); ++ ADD_ARG (argv, i, "-o"); ADD_ARG (argv, i, fs_buf); ADD_ARG (argv, i, NULL); -diff --git a/src/listfs.c b/src/listfs.c -index ffb0adc..db127ea 100644 ---- a/src/listfs.c -+++ b/src/listfs.c -@@ -176,9 +183,11 @@ check_with_vfs_type (guestfs_h *g, const char *device, struct stringsbuf *sb) - - for (size_t i = 0; i < vols->len; i++) { - struct guestfs_btrfssubvolume *this = &vols->val[i]; -+ char *btrfssubvolume_path = this->btrfssubvolume_path; -+ if (STREQ(btrfssubvolume_path, "/@")) btrfssubvolume_path = "/@"; - guestfs___add_sprintf (g, sb, - "btrfsvol:%s/%s", -- device, this->btrfssubvolume_path); -+ device, btrfssubvolume_path); - guestfs___add_string (g, sb, "btrfs"); - } -