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 2A8FA138334 for ; Sun, 14 Jul 2019 13:00:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3B621E08D4; 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 0891AE08BF 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 72089347A93 for ; Sun, 14 Jul 2019 13:00:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4A93D721 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.db94e5a20cd0a9bd458a3a3df515f5e47985dab5.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: db94e5a20cd0a9bd458a3a3df515f5e47985dab5 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: 9f4cfee6-9938-4df4-a57c-f212a56f5051 X-Archives-Hash: 53173ccd0376b04905d5566cd206bc57 commit: db94e5a20cd0a9bd458a3a3df515f5e47985dab5 Author: Thomas Deutschmann gentoo org> AuthorDate: Sun Jul 14 09:51:25 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=db94e5a2 gen_initramfs.sh: Refactor append_splash Signed-off-by: Thomas Deutschmann gentoo.org> gen_initramfs.sh | 68 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 56c84c7..aace8c9 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -682,35 +682,49 @@ append_linker() { || gen_die "Failed to append linker to cpio!" } -append_splash(){ - splash_geninitramfs=`which splash_geninitramfs 2>/dev/null` - if [ -x "${splash_geninitramfs}" ] && grep -q -E '^CONFIG_FRAMEBUFFER_CONSOLE=[y|m]' ${KERNEL_CONFIG} +append_splash() { + local TDIR="${TEMP}/initramfs-splash-temp" + if [ -d "${TDIR}" ] then - [ -z "${SPLASH_THEME}" ] && [ -e /etc/conf.d/splash ] && source /etc/conf.d/splash - [ -z "${SPLASH_THEME}" ] && SPLASH_THEME=default - print_info 1 "$(getIndent 1)>> Installing splash [ using the ${SPLASH_THEME} theme ]..." - if [ -d "${TEMP}/initramfs-splash-temp" ] - then - rm -r "${TEMP}/initramfs-splash-temp/" - fi - mkdir -p "${TEMP}/initramfs-splash-temp" - cd / - local tmp="" - [ -n "${SPLASH_RES}" ] && tmp="-r ${SPLASH_RES}" - splash_geninitramfs -c "${TEMP}/initramfs-splash-temp" ${tmp} ${SPLASH_THEME} || gen_die "Could not build splash cpio archive" - if [ -e "/usr/share/splashutils/initrd.splash" ]; then - mkdir -p "${TEMP}/initramfs-splash-temp/etc" - cp -f "/usr/share/splashutils/initrd.splash" "${TEMP}/initramfs-splash-temp/etc" - fi - cd "${TEMP}/initramfs-splash-temp/" - log_future_cpio_content - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing splash cpio" - cd "${TEMP}" - rm -r "${TEMP}/initramfs-splash-temp/" - else - print_warning 1 "$(getIndent 1)>> No splash detected; skipping!" + rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!" + fi + + if ! hash splash_geninitramfs &>/dev/null + then + gen_die "Unable to generate splash, 'splash_geninitramfs' was not found!" + fi + + mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!" + cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" + + if [ -z "${SPLASH_THEME}" -a -e /etc/conf.d/splash ] + then + source /etc/conf.d/splash &>/dev/null || gen_die "Failed to source '/etc/conf.d/splash'!" + fi + + if [ -z "${SPLASH_THEME}" ] + then + SPLASH_THEME=default + fi + + print_info 1 "$(get_indent 1)>> Installing splash [ using the ${SPLASH_THEME} theme ] ..." + + local res_param="" + [ -n "${SPLASH_RES}" ] && res_param="-r ${SPLASH_RES}" + splash_geninitramfs -c "${TDIR}" ${res_param} ${SPLASH_THEME} \ + | gen_die "Failed to build splash cpio archive" + + if [ -e "/usr/share/splashutils/initrd.splash" ] + then + mkdir -p "${TDIR}"/etc || gen_die "Failed to create '${TDIR}/etc'!" + cp -f /usr/share/splashutils/initrd.splash "${TDIR}"/etc/ 2>/dev/null \ + gen_die "Failed to copy '/usr/share/splashutils/initrd.splash'!" fi + + 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 splash to cpio!" } append_overlay() {