public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:master commit in: patches/xfsprogs/5.0.0/, /, doc/, gkbuilds/, defaults/
@ 2019-07-14 13:00 Thomas Deutschmann
  0 siblings, 0 replies; only message in thread
From: Thomas Deutschmann @ 2019-07-14 13:00 UTC (permalink / raw
  To: gentoo-commits

commit:     ccfe8f4a8123bf2c64e77879aea1ad475caa2a23
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 14 10:42:41 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Jul 14 11:58:18 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=ccfe8f4a

Add --xfsprogs support

Bug: https://bugs.gentoo.org/407999
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 defaults/software.sh                               |   7 ++
 doc/genkernel.8.txt                                |   3 +
 gen_cmdline.sh                                     |   6 ++
 gen_determineargs.sh                               |   1 +
 gen_initramfs.sh                                   |  22 +++++
 gkbuilds/xfsprogs.gkbuild                          |  42 +++++++++
 .../5.0.0/xfsprogs-4.15.0-sharedlibs.patch         | 105 +++++++++++++++++++++
 .../5.0.0/xfsprogs-4.9.0-underlinking.patch        |  11 +++
 8 files changed, 197 insertions(+)

diff --git a/defaults/software.sh b/defaults/software.sh
index 8b0be26..34b38dc 100644
--- a/defaults/software.sh
+++ b/defaults/software.sh
@@ -163,6 +163,13 @@ GKPKG_UTIL_LINUX_SRCDIR="${GKPKG_UTIL_LINUX_SRCDIR:-util-linux-${GKPKG_UTIL_LINU
 GKPKG_UTIL_LINUX_SRCTAR="${GKPKG_UTIL_LINUX_SRCTAR:-${DISTDIR}/util-linux-${GKPKG_UTIL_LINUX_PV}.tar.xz}"
 GKPKG_UTIL_LINUX_BINPKG="${GKPKG_UTIL_LINUX_BINPKG:-%%CACHE%%/util-linux-${GKPKG_UTIL_LINUX_PV}-%%ARCH%%.tar.xz}"
 
+GKPKG_XFSPROGS_PN="xfsprogs"
+GKPKG_XFSPROGS_PV="${GKPKG_XFSPROGS_PV:-VERSION_XFSPROGS}"
+GKPKG_XFSPROGS_DEPS="util-linux"
+GKPKG_XFSPROGS_SRCTAR="${GKPKG_XFSPROGS_SRCTAR:-${DISTDIR}/xfsprogs-${GKPKG_XFSPROGS_PV}.tar.xz}"
+GKPKG_XFSPROGS_SRCDIR="${GKPKG_XFSPROGS_SRCDIR:-xfsprogs-${GKPKG_XFSPROGS_PV}}"
+GKPKG_XFSPROGS_BINPKG="${GKPKG_XFSPROGS_BINPKG:-%%CACHE%%/xfsprogs-${GKPKG_XFSPROGS_PV}-%%ARCH%%.tar.xz}"
+
 GKPKG_ZLIB_PN="zlib"
 GKPKG_ZLIB_PV="${GKPKG_ZLIB_PV:-VERSION_ZLIB}"
 GKPKG_ZLIB_DEPS=""

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 055610b..68f6f92 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -302,6 +302,9 @@ INITIALIZATION
 *--*[*no-*]*e2fsprogs*::
     Includes or excludes e2fsprogs.
 
+*--*[*no-*]*xfsprogs*::
+    Includes or excludes xfsprogs.
+
 *--*[*no-*]*zfs*::
     Includes or excludes ZFS support.
 

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index ec5a5bc..2131f77 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -118,6 +118,8 @@ longusage() {
   echo "	--no-dmraid		Exclude DMRAID support"
   echo "	--e2fsprogs		Include e2fsprogs"
   echo "	--no-e2fsprogs		Exclude e2fsprogs"
+  echo "	--xfsprogs		Include xfsprogs"
+  echo "	--no-xfsprogs		Exclude xfsprogs"
   echo "	--zfs			Include ZFS support (enabled by default if rootfs is ZFS)"
   echo "	--no-zfs		Exclude ZFS support"
   echo "	--btrfs			Include Btrfs support (enabled by default if rootfs is Btrfs)"
@@ -385,6 +387,10 @@ parse_cmdline() {
 			CMD_E2FSPROGS=$(parse_optbool "$*")
 			print_info 2 "CMD_E2FSPROGS: ${CMD_E2FSPROGS}"
 			;;
+		--xfsprogs|--no-xfsprogs)
+			CMD_XFSPROGS=$(parse_optbool "$*")
+			print_info 2 "CMD_XFSPROGS: ${CMD_XFSPROGS}"
+			;;
 		--zfs|--no-zfs)
 			CMD_ZFS=$(parse_optbool "$*")
 			print_info 2 "CMD_ZFS: ${CMD_ZFS}"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 7fd39ef..75b7b3b 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -165,6 +165,7 @@ determine_real_args() {
 	set_config_with_override BOOL   MDADM                    CMD_MDADM                    "no"
 	set_config_with_override STRING MDADM_CONFIG             CMD_MDADM_CONFIG
 	set_config_with_override BOOL   E2FSPROGS                CMD_E2FSPROGS                "no"
+	set_config_with_override BOOL   XFSPROGS                 CMD_XFSPROGS                 "no"
 	set_config_with_override BOOL   ZFS                      CMD_ZFS                      "$(rootfs_type_is zfs)"
 	set_config_with_override BOOL   BTRFS                    CMD_BTRFS                    "$(rootfs_type_is btrfs)"
 	set_config_with_override BOOL   VIRTIO                   CMD_VIRTIO                   "no"

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index acb5c65..45bf4fe 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -621,6 +621,27 @@ append_mdadm() {
 		|| gen_die "Failed to append ${PN} to cpio!"
 }
 
+append_xfsprogs() {
+	local PN=xfsprogs
+	local TDIR="${TEMP}/initramfs-${PN}-temp"
+	if [ -d "${TDIR}" ]
+	then
+		rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!"
+	fi
+
+	populate_binpkg ${PN}
+
+	mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
+
+	unpack "$(get_gkpkg_binpkg "${PN}")" "${TDIR}"
+
+	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
+
+	log_future_cpio_content
+	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+		|| gen_die "Failed to append ${PN} to cpio!"
+}
+
 append_zfs() {
 	local PN=zfs
 	local TDIR="${TEMP}/initramfs-${PN}-temp"
@@ -1462,6 +1483,7 @@ create_initramfs() {
 	append_data 'multipath' "${MULTIPATH}"
 	append_data 'splash' "${SPLASH}"
 	append_data 'unionfs_fuse' "${UNIONFS}"
+	append_data 'xfsprogs' "${XFSPROGS}"
 	append_data 'zfs' "${ZFS}"
 
 	if isTrue "${ZFS}"

diff --git a/gkbuilds/xfsprogs.gkbuild b/gkbuilds/xfsprogs.gkbuild
new file mode 100644
index 0000000..4456738
--- /dev/null
+++ b/gkbuilds/xfsprogs.gkbuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+src_prepare() {
+	default
+
+	# Force static programs
+	find -name Makefile -exec \
+		sed -i -r -e 's/-static(-libtool-libs)?/-all-static/' {} +
+}
+
+src_configure() {
+	export DEBUG=-DNDEBUG
+	export OPTIMIZER=${CFLAGS}
+	unset PLATFORM # if set in user env, this breaks configure
+
+	local myconf=(
+		--disable-lto #655638
+		--enable-blkid
+		--disable-libicu
+		--disable-gettext
+		--disable-readline
+		--disable-editline
+		--disable-scrub
+	)
+
+	gkconf "${myconf[@]}"
+}
+
+src_compile() {
+	gkmake V=1 headers repair
+}
+
+src_install() {
+	mkdir "${D}"/sbin || die "Failed to create '${D}/sbin'!"
+
+	cp repair/xfs_repair "${D}"/sbin \
+		|| die "Failed to copy '${S}/repair/xfs_repair' to '${D}/sbin/'!"
+
+	"${STRIP}" --strip-all "${D}"/sbin/xfs_repair \
+		|| die "Failed to strip '${D}/sbin/xfs_repair'!"
+}

diff --git a/patches/xfsprogs/5.0.0/xfsprogs-4.15.0-sharedlibs.patch b/patches/xfsprogs/5.0.0/xfsprogs-4.15.0-sharedlibs.patch
new file mode 100644
index 0000000..a8911ce
--- /dev/null
+++ b/patches/xfsprogs/5.0.0/xfsprogs-4.15.0-sharedlibs.patch
@@ -0,0 +1,105 @@
+--- xfsprogs-4.15.0/include/buildmacros
++++ xfsprogs-4.15.0/include/buildmacros
+@@ -70,18 +70,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+-	cd $(TOPDIR)/$(LIBNAME)/.libs; \
+-	../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+-	../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+-	../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+-	../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+-	../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+-	if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \
+-	     "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))" ]; then \
+-		../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+-		../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+-		../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+-	fi
++	set -e; cd $(TOPDIR)/$(LIBNAME); \
++	$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++	env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
+--- xfsprogs-4.15.0/libfrog/Makefile
++++ xfsprogs-4.15.0/libfrog/Makefile
+@@ -34,6 +36,9 @@
+ 
+ include $(BUILDRULES)
+ 
+-install install-dev: default
++install: default
++
++install-dev: default
++	$(INSTALL_LTLIB_DEV)
+ 
+ -include .ltdep
+--- xfsprogs-4.15.0/libhandle/Makefile
++++ xfsprogs-4.15.0/libhandle/Makefile
+@@ -24,7 +24,6 @@
+ include $(BUILDRULES)
+ 
+ install: default
+-	$(INSTALL_LTLIB)
+ 
+ install-dev: default
+ 	$(INSTALL_LTLIB_DEV)
+--- xfsprogs-4.15.0/libxcmd/Makefile
++++ xfsprogs-4.15.0/libxcmd/Makefile
+@@ -12,6 +12,8 @@
+ 
+ CFILES = command.c input.c help.c quit.c
+ 
++LTLIBS = $(LIBXFS) $(LIBBLKID)
++
+ ifeq ($(ENABLE_READLINE),yes)
+ LCFLAGS += -DENABLE_READLINE
+ LTLIBS += $(LIBREADLINE) $(LIBTERMCAP)
+@@ -26,6 +28,9 @@
+ 
+ include $(BUILDRULES)
+ 
+-install install-dev: default
++install: default
++
++install-dev: default
++	$(INSTALL_LTLIB_DEV)
+ 
+ -include .ltdep
+--- xfsprogs-4.15.0/libxfs/Makefile
++++ xfsprogs-4.15.0/libxfs/Makefile
+@@ -151,6 +151,7 @@
+ 
+ install-dev: install
+ 	$(INSTALL) -m 644 $(PKGHFILES) $(PKG_INC_DIR)
++	$(INSTALL_LTLIB_DEV)
+ 
+ # We need to install the headers before building the dependencies.  If we
+ # include the .ltdep file, the makefile decides that it needs to build the
+--- xfsprogs-4.15.0/libxlog/Makefile
++++ xfsprogs-4.15.0/libxlog/Makefile
+@@ -19,6 +19,9 @@
+ 
+ include $(BUILDRULES)
+ 
+-install install-dev: default
++install: default
++
++install-dev: default
++	$(INSTALL_LTLIB_DEV)
+ 
+ -include .ltdep
+--- xfsprogs-4.15.0/Makefile
++++ xfsprogs-4.15.0/Makefile
+@@ -92,6 +92,10 @@
+ mkfs: libxcmd
+ spaceman: libxcmd
+ scrub: libhandle libxcmd
++#libxfs: libfrog
++#libfrog-install-dev: libxfs-install-dev
++#libxlog: libxfs
++#libxlog-install-dev: libxfs-install-dev
+ 
+ ifeq ($(HAVE_BUILDDEFS), yes)
+ include $(BUILDRULES)

diff --git a/patches/xfsprogs/5.0.0/xfsprogs-4.9.0-underlinking.patch b/patches/xfsprogs/5.0.0/xfsprogs-4.9.0-underlinking.patch
new file mode 100644
index 0000000..55d9efd
--- /dev/null
+++ b/patches/xfsprogs/5.0.0/xfsprogs-4.9.0-underlinking.patch
@@ -0,0 +1,11 @@
+--- a/libxfs/Makefile
++++ b/libxfs/Makefile
+@@ -107,7 +107,7 @@ CFILES = cache.c \
+ 
+ FCFLAGS = -I.
+ 
+-LTLIBS = $(LIBPTHREAD) $(LIBRT)
++LTLIBS = $(LIBFROG) $(LIBPTHREAD) $(LIBRT) $(LIBUUID)
+ 
+ # don't try linking xfs_repair with a debug libxfs.
+ DEBUG = -DNDEBUG


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

only message in thread, other threads:[~2019-07-14 13:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-14 13:00 [gentoo-commits] proj/genkernel:master commit in: patches/xfsprogs/5.0.0/, /, doc/, gkbuilds/, defaults/ Thomas Deutschmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox