linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH for libguestfs: tools for accessing and modifying virtual machine disk images
@ 2019-10-22 15:21 Metztli Information Technology
  0 siblings, 0 replies; only message in thread
From: Metztli Information Technology @ 2019-10-22 15:21 UTC (permalink / raw)
  To: edward.shishkin, reiserfs-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

Niltze all-

Enabled reiser4 in libguestfs 1.40.2 < http://libguestfs.org/ > since my Virtual Machines are formatted in reiser4.

Limited testing, though, as I only made sure I could peek into a VirtualBox VDI image, i.e.,

guestfish --ro -i -a metztli-reiser4.vdi

Given the fact that "man 2 statfs" did not provide a REISER4_SUPER_MAGIC 0x52345362 entry, (heck, entry is blacklisted in Debian, etc. *all* GNU / Linux's "man 2 statfs", /usr/include/linux/magic.h, coreutils' src/fs.h, libguestfs-1.40.2/gnulib/lib/fts.c, etc., WHY!?)

I created my own statfs(2) for reiser4 man page in html:

short link:
https://metztli.blog/index.php/amatl/aP3

long link:
https://metztli.blog/index.php/amatl/reiser-nahui/adding-reiser4_super_magic-to-man-2-statfs

It would be cool, though, if that reiser4 MAGIC string was included in
< https://www.kernel.org/doc/man-pages/ > (thanks in advance for your consideration)


The first patch applies against libguestfs 1.40.2 source; the second patch applies against Debian packaging for libguestfs 1.40.2 from 
< https://packages.debian.org/bullseye/libguestfs-tools >


Best Professional Regards.

-- 
Jose R R
http://metztli.it
---------------------------------------------------------------------------------------------
Download Metztli Reiser4: Debian Buster w/ Linux 5.2.17 AMD64
---------------------------------------------------------------------------------------------
feats ZSTD compression https://sf.net/projects/metztli-reiser4/
-------------------------------------------------------------------------------------------
Official current Reiser4 resources: https://reiser4.wiki.kernel.org/

[-- Attachment #2: metztli-libguestfs-1.40.2-for-reiser4.patch --]
[-- Type: application/octet-stream, Size: 2594 bytes --]

From 4eb934f1a43baa9684a30ef330a2bc37504df173 Mon Sep 17 00:00:00 2001
From: Metztli Information Technology <jose@metztli.it>
Date: Sun, 20 Oct 2019 20:36:05 -0700
Subject: [PATCH] Ome (second) commit libguestfs-1.40.2, including
 gnulib/lib/fts.c, enabling reiser4

---
 appliance/packagelist.in | 1 +
 daemon/mkfs.c            | 5 +++--
 gnulib/lib/fts.c         | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index 8d2e9d4..bb3a7a2 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -96,6 +96,7 @@ dnl iproute has been renamed to iproute2
   ntfs-3g
   openssh-client
   reiserfsprogs
+  reiser4progs              dnl Jose/Metztli IT added reiser4 10-20-2019
   sysvinit                  dnl for /sbin/reboot
   systemd                   dnl alternative for /sbin/reboot
   ufsutils
diff --git a/daemon/mkfs.c b/daemon/mkfs.c
index aa830dd..0335f17 100644
--- a/daemon/mkfs.c
+++ b/daemon/mkfs.c
@@ -80,9 +80,10 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
    * mkfs.jfs is the same
    * mkfs.xfs must force to make xfs filesystem when the device already
    * has a filesystem on it
+   * Jose/Metztli IT added reiser4 10-20-2019
    */
-  if (STREQ (fstype, "reiserfs") || STREQ (fstype, "jfs") ||
-      STREQ (fstype, "xfs"))
+  if (STREQ (fstype, "reiserfs") || STREQ (fstype, "reiser4") ||
+      STREQ (fstype, "jfs") || STREQ (fstype, "xfs"))
     ADD_ARG (argv, i, "-f");
 
   /* For GFS, GFS2, assume a single node. */
diff --git a/gnulib/lib/fts.c b/gnulib/lib/fts.c
index 5e8e895..df4ce13 100644
--- a/gnulib/lib/fts.c
+++ b/gnulib/lib/fts.c
@@ -658,12 +658,13 @@ enum leaf_optimization
 
 # include <sys/vfs.h>
 
-/* Linux-specific constants from coreutils' src/fs.h */
+/* Linux-specific constants from coreutils' src/fs.h; Metztli IT added constant for reiser4 */
 # define S_MAGIC_AFS 0x5346414F
 # define S_MAGIC_CIFS 0xFF534D42
 # define S_MAGIC_NFS 0x6969
 # define S_MAGIC_PROC 0x9FA0
 # define S_MAGIC_REISERFS 0x52654973
+# define S_MAGIC_REISER4 0x52345362
 # define S_MAGIC_TMPFS 0x1021994
 # define S_MAGIC_XFS 0x58465342
 
@@ -796,6 +797,7 @@ leaf_optimization (FTSENT const *p, int dir_fd)
       /* List here the file system types that may lack usable dirent.d_type
          info, yet for which the optimization does apply.  */
     case S_MAGIC_REISERFS:
+    case S_MAGIC_REISER4: /* Jose/Metztli IT 10-20-2019 */
     case S_MAGIC_XFS: /* XFS lacked it until 2013-08-22 commit.  */
       return NOSTAT_LEAF_OPTIMIZATION;
 
-- 
2.20.1


[-- Attachment #3: metztli-libguestfs-1.40.2-reiser4-enabling-debian-packaging-for-libguestfs-1.40.2.patch --]
[-- Type: application/octet-stream, Size: 6385 bytes --]

From f404b867954f844c3785c12477f7e8869c5acfa6 Mon Sep 17 00:00:00 2001
From: Metztli Information Technology <jose@metztli.it>
Date: Sun, 20 Oct 2019 22:01:45 -0700
Subject: [PATCH] Ome (second) commit reiser4 enabling debian packaging for
 libguestfs-1.40.2

---
 control                                       | 15 ++++
 gen-appliance-depends.sh                      |  2 +-
 libguestfs-reiser4.install                    |  1 +
 .../metztli/metztli-reiser4-enabling.patch    | 72 +++++++++++++++++++
 patches/series                                |  1 +
 split-appliance.sh                            |  2 +-
 6 files changed, 91 insertions(+), 2 deletions(-)
 create mode 100644 libguestfs-reiser4.install
 create mode 100644 patches/metztli/metztli-reiser4-enabling.patch

diff --git a/control b/control
index cac81d1..55f17d4 100644
--- a/control
+++ b/control
@@ -94,6 +94,7 @@ Build-Depends: debhelper (>= 12),
   procps,
   psmisc,
   reiserfsprogs,
+  reiser4progs,
   rsync,
   scrub,
   strace,
@@ -173,6 +174,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends},
   ${appliance:Depends},
 Recommends: libguestfs-hfsplus,
  libguestfs-reiserfs,
+ libguestfs-reiser4,
  libguestfs-xfs,
 Suggests: libguestfs-gfs2,
  libguestfs-jfs,
@@ -266,6 +268,19 @@ Description: guest disk image management system - ReiserFS support
  .
  This package contains appliance fragments for ReiserFS support.
 
+Package: libguestfs-reiser4
+Section: libs
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: libguestfs0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends},
+ ${appliance:Depends},
+Description: guest disk image management system - Reiser4 support
+ The libguestfs library allows accessing and modifying guest disk
+ images.
+ .
+ This package contains appliance fragments for Reiser4 support.
+
 Package: libguestfs-rescue
 Section: libs
 Architecture: linux-any
diff --git a/gen-appliance-depends.sh b/gen-appliance-depends.sh
index d751497..0f5f33e 100755
--- a/gen-appliance-depends.sh
+++ b/gen-appliance-depends.sh
@@ -15,7 +15,7 @@ pkglist_to_deps() {
     echo
 }
 
-for p in gfs2 hfsplus jfs nilfs reiserfs rescue rsync xfs zfs
+for p in gfs2 hfsplus jfs nilfs reiserfs reiser4 rescue rsync xfs zfs
 do
     cat debian/libguestfs-$p/usr/lib/*-*/guestfs/supermin.d/packages-$p \
         |  pkglist_to_deps \
diff --git a/libguestfs-reiser4.install b/libguestfs-reiser4.install
new file mode 100644
index 0000000..e55a654
--- /dev/null
+++ b/libguestfs-reiser4.install
@@ -0,0 +1 @@
+/usr/lib/*-*/guestfs/supermin.d/packages-reiser4
diff --git a/patches/metztli/metztli-reiser4-enabling.patch b/patches/metztli/metztli-reiser4-enabling.patch
new file mode 100644
index 0000000..823eb81
--- /dev/null
+++ b/patches/metztli/metztli-reiser4-enabling.patch
@@ -0,0 +1,72 @@
+From 1cd5634495ab9da3d71f42eb4a2969a98b6d1c55 Mon Sep 17 00:00:00 2001
+From: Metztli Information Technology <jose@metztli.it>
+Date: Sun, 20 Oct 2019 21:25:53 -0700
+Subject: [PATCH] Ome (second) commit libguestfs-1.40.2, inc. gnulib/lib/fts.c
+ in .gitignore, enabling reiser4 to complement debian packaging
+ patches/0009-Fix-sbin-reboot-requirements.patch
+
+---
+ appliance/packagelist.in | 1 +
+ daemon/mkfs.c            | 5 +++--
+ gnulib/lib/fts.c         | 4 +++-
+ 3 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/appliance/packagelist.in b/appliance/packagelist.in
+index d47e2d2..31df93c 100644
+--- a/appliance/packagelist.in
++++ b/appliance/packagelist.in
+@@ -96,6 +96,7 @@ dnl iproute has been renamed to iproute2
+   ntfs-3g
+   openssh-client
+   reiserfsprogs
++  reiser4progs              dnl Jose/Metztli IT added reiser4 10-20-2019
+   sysvinit-core             dnl for /sbin/reboot
+   systemd-sysv              dnl alternative for /sbin/reboot
+   ufsutils
+diff --git a/daemon/mkfs.c b/daemon/mkfs.c
+index aa830dd..0335f17 100644
+--- a/daemon/mkfs.c
++++ b/daemon/mkfs.c
+@@ -80,9 +80,10 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
+    * mkfs.jfs is the same
+    * mkfs.xfs must force to make xfs filesystem when the device already
+    * has a filesystem on it
++   * Jose/Metztli IT added reiser4 10-20-2019
+    */
+-  if (STREQ (fstype, "reiserfs") || STREQ (fstype, "jfs") ||
+-      STREQ (fstype, "xfs"))
++  if (STREQ (fstype, "reiserfs") || STREQ (fstype, "reiser4") ||
++      STREQ (fstype, "jfs") || STREQ (fstype, "xfs"))
+     ADD_ARG (argv, i, "-f");
+ 
+   /* For GFS, GFS2, assume a single node. */
+diff --git a/gnulib/lib/fts.c b/gnulib/lib/fts.c
+index 5e8e895..df4ce13 100644
+--- a/gnulib/lib/fts.c
++++ b/gnulib/lib/fts.c
+@@ -658,12 +658,13 @@ enum leaf_optimization
+ 
+ # include <sys/vfs.h>
+ 
+-/* Linux-specific constants from coreutils' src/fs.h */
++/* Linux-specific constants from coreutils' src/fs.h; Metztli IT added constant for reiser4 */
+ # define S_MAGIC_AFS 0x5346414F
+ # define S_MAGIC_CIFS 0xFF534D42
+ # define S_MAGIC_NFS 0x6969
+ # define S_MAGIC_PROC 0x9FA0
+ # define S_MAGIC_REISERFS 0x52654973
++# define S_MAGIC_REISER4 0x52345362
+ # define S_MAGIC_TMPFS 0x1021994
+ # define S_MAGIC_XFS 0x58465342
+ 
+@@ -796,6 +797,7 @@ leaf_optimization (FTSENT const *p, int dir_fd)
+       /* List here the file system types that may lack usable dirent.d_type
+          info, yet for which the optimization does apply.  */
+     case S_MAGIC_REISERFS:
++    case S_MAGIC_REISER4: /* Jose/Metztli IT 10-20-2019 */
+     case S_MAGIC_XFS: /* XFS lacked it until 2013-08-22 commit.  */
+       return NOSTAT_LEAF_OPTIMIZATION;
+ 
+-- 
+2.20.1
+
diff --git a/patches/series b/patches/series
index 591b6d2..deb6387 100644
--- a/patches/series
+++ b/patches/series
@@ -13,3 +13,4 @@
 0013-Fix-up-perl-path-in-installed-scripts.patch
 0014-Fix-.depend-generation-for-out-of-tree-build.patch
 0015-Change-cryptsetop-cryptsetup-bin-in-appliance.patch
+metztli/metztli-reiser4-enabling.patch
diff --git a/split-appliance.sh b/split-appliance.sh
index 4214763..702d646 100755
--- a/split-appliance.sh
+++ b/split-appliance.sh
@@ -5,7 +5,7 @@ set -ex
 cd debian/tmp/usr/lib/*-*/guestfs/supermin.d
 cp -n packages packages.orig
 
-for p in gfs2 hfsplus jfs nilfs reiserfs rsync xfs zfs; do
+for p in gfs2 hfsplus jfs nilfs reiserfs reiser4 rsync xfs zfs; do
     sed -i -e "/$p/d" packages
     grep -F  "$p" < packages.orig > packages-$p || true
 done
-- 
2.20.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-22 15:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 15:21 PATCH for libguestfs: tools for accessing and modifying virtual machine disk images Metztli Information Technology

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).