public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:master commit in: /, patches/btrfs-progs/5.1.1/, defaults/, gkbuilds/
@ 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:     568c8df66fcc3ba14d3f54882ad6c4744113f03c
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 14 09:53:01 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Jul 14 11:58:17 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=568c8df6

Rework --btrfs support

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 defaults/software.sh                       | 21 ++++++++++++++++++++
 gen_initramfs.sh                           | 20 ++++++++++---------
 gkbuilds/btrfs-progs.gkbuild               | 31 ++++++++++++++++++++++++++++++
 gkbuilds/lzo.gkbuild                       | 17 ++++++++++++++++
 gkbuilds/zstd.gkbuild                      | 10 ++++++++++
 patches/btrfs-progs/5.1.1/btrfs-lzo2.patch | 24 +++++++++++++++++++++++
 patches/btrfs-progs/5.1.1/btrfs-m4.patch   | 14 ++++++++++++++
 7 files changed, 128 insertions(+), 9 deletions(-)

diff --git a/defaults/software.sh b/defaults/software.sh
index acf5439..8b0be26 100644
--- a/defaults/software.sh
+++ b/defaults/software.sh
@@ -9,6 +9,13 @@
 # - This file should not override previously defined variables, as their values may
 #   originate from user changes to /etc/genkernel.conf .
 
+GKPKG_BTRFS_PROGS_PN="btrfs-progs"
+GKPKG_BTRFS_PROGS_PV="${GKPKG_BTRFS_PROGS_PV:-VERSION_BTRFS_PROGS}"
+GKPKG_BTRFS_PROGS_DEPS="util-linux zlib zstd lzo"
+GKPKG_BTRFS_PROGS_SRCDIR="${GKPKG_BTRFS_PROGS_SRCDIR:-btrfs-progs-v${GKPK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GKPKG_ZLIB_SRCTAR="${GKPKG_ZLIB_SRCTAR:-${DISTDIR}/zlib-${GKPKG_ZLIB_PV}.tar.gz}"
 GKPKG_ZLIB_BINPKG="${GKPKG_ZLIB_BINPKG:-%%CACHE%%/zlib-${GKPKG_ZLIB_PV}-%%ARCH%%.tar.xz}"
+
+GKPKG_ZSTD_PN="zstd"
+GKPKG_ZSTD_PV="${GKPKG_ZSTD_PV:-VERSION_ZSTD}"
+GKPKG_ZSTD_DEPS=""
+GKPKG_ZSTD_SRCDIR="${GKPKG_ZSTD_SRCDIR:-zstd-${GKPKG_ZSTD_PV}}"
+GKPKG_ZSTD_SRCTAR="${GKPKG_ZSTD_SRCTAR:-${DISTDIR}/zstd-${GKPKG_ZSTD_PV}.tar.gz}"
+GKPKG_ZSTD_BINPKG="${GKPKG_ZSTD_BINPKG:-%%CACHE%%/zstd-${GKPKG_ZSTD_PV}-%%ARCH%%.tar.xz}"

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index aace8c9..2d178bb 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -589,22 +589,24 @@ append_zfs(){
 }
 
 append_btrfs() {
-	if [ -d "${TEMP}/initramfs-btrfs-temp" ]
+	local PN=btrfs-progs
+	local TDIR="${TEMP}/initramfs-${PN}-temp"
+	if [ -d "${TDIR}" ]
 	then
-		rm -r "${TEMP}/initramfs-btrfs-temp"
+		rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!"
 	fi
 
-	mkdir -p "${TEMP}/initramfs-btrfs-temp"
+	populate_binpkg ${PN}
 
-	# Copy binaries
-	copy_binaries "${TEMP}/initramfs-btrfs-temp" /sbin/btrfs
+	mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
+
+	unpack "$(get_gkpkg_binpkg "${PN}")" "${TDIR}"
+
+	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
 
-	cd "${TEMP}/initramfs-btrfs-temp/"
 	log_future_cpio_content
 	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
-			|| gen_die "compressing btrfs cpio"
-	cd "${TEMP}"
-	rm -rf "${TEMP}/initramfs-btrfs-temp" > /dev/null
+		|| gen_die "Failed to append ${PN} to cpio!"
 }
 
 append_libgcc_s() {

diff --git a/gkbuilds/btrfs-progs.gkbuild b/gkbuilds/btrfs-progs.gkbuild
new file mode 100644
index 0000000..9c85b91
--- /dev/null
+++ b/gkbuilds/btrfs-progs.gkbuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+src_configure() {
+	local myconf=(
+		--bindir="/sbin"
+		--disable-shared
+		--disable-convert
+		--disable-python
+		--disable-documentation
+	)
+
+	gkconf "${myconf[@]}"
+}
+
+src_compile() {
+	gkmake V=1 static
+}
+
+src_install() {
+	mkdir "${D}"/sbin || die "Failed to create '${D}/sbin'!"
+
+	cp -a btrfs.static "${D}"/sbin/btrfs \
+		|| die "Failed to copy '${S}/btrfs.static' to '${D}/sbin/btrfs'!"
+
+	"${STRIP}" --strip-all "${D}"/sbin/btrfs \
+		|| die "Failed to strip '${D}/sbin/btrfs'!"
+
+	ln -s btrfs "${D}"/sbin/btrfsck \
+		|| die "Failed to create symlink '${D}/sbin/btrfsck' to '${D}/sbin/btrfs'!"
+}

diff --git a/gkbuilds/lzo.gkbuild b/gkbuilds/lzo.gkbuild
new file mode 100644
index 0000000..e0c365c
--- /dev/null
+++ b/gkbuilds/lzo.gkbuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+src_configure() {
+	local myopts=(
+		--enable-shared
+		--enable-static
+	)
+
+	gkconf "${myopts[@]}"
+}
+
+src_install() {
+	default
+
+	rm -rf "${D}"/usr/share
+}

diff --git a/gkbuilds/zstd.gkbuild b/gkbuilds/zstd.gkbuild
new file mode 100644
index 0000000..15f3452
--- /dev/null
+++ b/gkbuilds/zstd.gkbuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+src_compile() {
+	gkmake -C lib V=1 PREFIX=/usr libzstd libzstd.a libzstd.pc
+}
+
+src_install() {
+	gkmake -C lib V=1 PREFIX=/usr DESTDIR="${D}" install
+}

diff --git a/patches/btrfs-progs/5.1.1/btrfs-lzo2.patch b/patches/btrfs-progs/5.1.1/btrfs-lzo2.patch
new file mode 100644
index 0000000..67b31f7
--- /dev/null
+++ b/patches/btrfs-progs/5.1.1/btrfs-lzo2.patch
@@ -0,0 +1,24 @@
+diff --git a/configure.ac b/configure.ac
+index cf792eb..3ca0806 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -256,17 +256,8 @@ if ${PKG_CONFIG} udev --atleast-version 190; then
+ fi
+ AC_SUBST(UDEVDIR)
+ 
+-dnl lzo library does not provide pkg-config, let use classic way
+-AC_CHECK_LIB([lzo2], [lzo_version], [
+-	LZO2_LIBS="-llzo2"
+-	LZO2_CFLAGS=""
+-	LZO2_LIBS_STATIC="-llzo2"],[
+-	AC_MSG_ERROR([cannot find lzo2 library])
+-])
+-AC_SUBST([LZO2_LIBS])
+-AC_SUBST([LZO2_LIBS_STATIC])
+-AC_SUBST([LZO2_CFLAGS])
+-
++PKG_CHECK_MODULES(LZO2, [lzo2])
++PKG_STATIC(LZO2_LIBS_STATIC, [lzo2])
+ 
+ dnl library stuff
+ AC_SUBST([LIBBTRFS_MAJOR])

diff --git a/patches/btrfs-progs/5.1.1/btrfs-m4.patch b/patches/btrfs-progs/5.1.1/btrfs-m4.patch
new file mode 100644
index 0000000..831ff99
--- /dev/null
+++ b/patches/btrfs-progs/5.1.1/btrfs-m4.patch
@@ -0,0 +1,14 @@
+Fixes
+
+./configure: line 4077: BTRFS_DETECT_CSTD: command not found
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -18,6 +18,7 @@ AC_SUBST([CFLAGS])
+ AC_PREREQ([2.60])
+ 
+ AC_CONFIG_AUX_DIR([config])
++AC_CONFIG_MACRO_DIR([m4])
+ dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
+ dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors.
+ AC_USE_SYSTEM_EXTENSIONS


^ 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/btrfs-progs/5.1.1/, defaults/, gkbuilds/ Thomas Deutschmann

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