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 9AA95138334 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 5F3DEE08D3; Sun, 14 Jul 2019 13:00:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 2D8D9E08D3 for ; Sun, 14 Jul 2019 13:00:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 65756347AA4 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 71BC572C 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.3ef66728b81c05cda2fce8aa09edcf2b3711949f.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_determineargs.sh gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 3ef66728b81c05cda2fce8aa09edcf2b3711949f 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: 4dce8479-600e-4cf6-9ddb-b8d0d34f4ebb X-Archives-Hash: a6861d9662bb2fe9dbab3b1e2ccdcdea commit: 3ef66728b81c05cda2fce8aa09edcf2b3711949f Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 14 09:56:51 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=3ef66728 gen_initramfs.sh: Refactor append_zfs() Signed-off-by: Thomas Deutschmann gentoo.org> gen_determineargs.sh | 7 +++++++ gen_initramfs.sh | 38 +++++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 7d01565..7fd39ef 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -420,6 +420,13 @@ determine_real_args() { then gen_die "--multipath requires --lvm but --no-lvm is set!" fi + + if isTrue "${ZFS}" && isTrue "$(tc-is-cross-compiler)" + then + local error_msg="Using binpkg for ZFS is not supported." + error_msg+=" Therefore we cannot cross-compile like requested!" + gen_die "${error_msg}" + fi fi MICROCODE=${MICROCODE,,} diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 2d178bb..7723204 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -547,45 +547,49 @@ append_mdadm() { || gen_die "Failed to append ${PN} to cpio!" } -append_zfs(){ - if [ -d "${TEMP}/initramfs-zfs-temp" ] +append_zfs() { + local PN=zfs + local TDIR="${TEMP}/initramfs-${PN}-temp" + if [ -d "${TDIR}" ] then - rm -r "${TEMP}/initramfs-zfs-temp" + rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!" fi - mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs" + mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!" + cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" + + mkdir -p "${TDIR}"/etc/zfs || gen_die "Failed to create '${TDIR}/etc/zfs'!" # Copy files to /etc/zfs for i in zdev.conf zpool.cache do if [ -f /etc/zfs/${i} ] then - print_info 1 "$(getIndent 2)zfs: >> Including ${i}" - cp -a "/etc/zfs/${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \ - || gen_die "Could not copy file ${i} for ZFS" + print_info 2 "$(get_indent 2)${PN}: >> Including ${i}" + cp -aL "/etc/zfs/${i}" "${TDIR}/etc/zfs/${i}" 2>/dev/null \ + || gen_die "Could not copy file '/etc/zfs/${i}' for ZFS" fi done if [ -f "/etc/hostid" ] then - local _hostid=$(hostid) - print_info 1 "$(getIndent 2)zfs: >> Embedding hostid '${_hostid}' into initramfs..." - cp -a /etc/hostid "${TEMP}/initramfs-zfs-temp/etc" 2> /dev/null \ + local _hostid=$(hostid 2>/dev/null) + print_info 2 "$(get_indent 2)${PN}: >> Embedding hostid '${_hostid}' into initramfs ..." + cp -aL /etc/hostid "${TDIR}"/etc/hostid 2>/dev/null \ || gen_die "Failed to copy /etc/hostid" - echo "${_hostid}" > "${TEMP}/.embedded_hostid" + echo "${_hostid}" > "${TEMP}"/.embedded_hostid \ + || gen_die "Failed to record system's hostid!" else - print_info 2 "$(getIndent 2)zfs: /etc/hostid not found; You must use 'spl_hostid' kernel command-line parameter!" + print_warning 1 "$(get_indent 2)${PN}: /etc/hostid not found; You must use 'spl_hostid' kernel command-line parameter!" fi - copy_binaries "${TEMP}/initramfs-zfs-temp" /sbin/{mount.zfs,zdb,zfs,zpool} + copy_binaries "${TDIR}" /sbin/{mount.zfs,zdb,zfs,zpool} - cd "${TEMP}/initramfs-zfs-temp/" + cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" log_future_cpio_content find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing zfs cpio" - cd "${TEMP}" - rm -rf "${TEMP}/initramfs-zfs-temp" > /dev/null + || gen_die "Failed to append ${PN} to cpio!" } append_btrfs() {