From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 330EF138334 for ; Sun, 14 Jul 2019 13:00:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 672A3E08BF; Sun, 14 Jul 2019 13:00:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 377C3E08BF for ; Sun, 14 Jul 2019 13:00:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5BBC2347A94 for ; Sun, 14 Jul 2019 13:00:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5DE1372B for ; Sun, 14 Jul 2019 13:00:30 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1563105497.568c8df66fcc3ba14d3f54882ad6c4744113f03c.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: /, patches/btrfs-progs/5.1.1/, defaults/, gkbuilds/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/software.sh gen_initramfs.sh gkbuilds/btrfs-progs.gkbuild gkbuilds/lzo.gkbuild gkbuilds/zstd.gkbuild patches/btrfs-progs/5.1.1/btrfs-lzo2.patch patches/btrfs-progs/5.1.1/btrfs-m4.patch X-VCS-Directories: / patches/btrfs-progs/5.1.1/ defaults/ gkbuilds/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 568c8df66fcc3ba14d3f54882ad6c4744113f03c X-VCS-Branch: master Date: Sun, 14 Jul 2019 13:00:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 96963619-3d4a-44f1-bd3f-62d848643479 X-Archives-Hash: 646d4b526d4c3a2c71004c7dc81b85b5 commit: 568c8df66fcc3ba14d3f54882ad6c4744113f03c Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 14 09:53:01 2019 +0000 Commit: Thomas Deutschmann gentoo 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 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${GKPKG_BTRFS_PROGS_PV}}" +GKPKG_BTRFS_PROGS_SRCTAR="${GKPKG_BTRFS_PROGS_SRCTAR:-${DISTDIR}/btrfs-progs-v${GKPKG_BTRFS_PROGS_PV}.tar.xz}" +GKPKG_BTRFS_PROGS_BINPKG="${GKPKG_BTRFS_PROGS_BINPKG:-%%CACHE%%/btrfs-progs-${GKPKG_BTRFS_PROGS_PV}-%%ARCH%%.tar.xz}" + GKPKG_BUSYBOX_PN="busybox" GKPKG_BUSYBOX_PV="${GKPKG_BUSYBOX_PV:-VERSION_BUSYBOX}" GKPKG_BUSYBOX_DEPS="" @@ -107,6 +114,13 @@ GKPKG_LVM_SRCDIR="${GKPKG_LVM_SRCDIR:-LVM2.${GKPKG_LVM_PV}}" GKPKG_LVM_SRCTAR="${GKPKG_LVM_SRCTAR:-${DISTDIR}/LVM2.${GKPKG_LVM_PV}.tgz}" GKPKG_LVM_BINPKG="${GKPKG_LVM_BINPKG:-%%CACHE%%/LVM2.${GKPKG_LVM_PV}-%%ARCH%%.tar.xz}" +GKPKG_LZO_PN="lzo" +GKPKG_LZO_PV="${GKPKG_LZO_PV:-VERSION_LZO}" +GKPKG_LZO_DEPS="" +GKPKG_LZO_SRCDIR="${GKPKG_LZO_SRCDIR:-lzo-${GKPKG_LZO_PV}}" +GKPKG_LZO_SRCTAR="${GKPKG_LZO_SRCTAR:-${DISTDIR}/lzo-${GKPKG_LZO_PV}.tar.gz}" +GKPKG_LZO_BINPKG="${GKPKG_LZO_BINPKG:-%%CACHE%%/lzo-${GKPKG_LZO_PV}-%%ARCH%%.tar.xz}" + GKPKG_MDADM_PN="mdadm" GKPKG_MDADM_PV="${GKPKG_MDADM_PV:-VERSION_MDADM}" GKPKG_MDADM_DEPS="" @@ -155,3 +169,10 @@ GKPKG_ZLIB_DEPS="" GKPKG_ZLIB_SRCDIR="${GKPKG_ZLIB_SRCDIR:-zlib-${GKPKG_ZLIB_PV}}" 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