From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BDAB4138A1A for ; Sun, 8 Feb 2015 21:40:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2DF6EE07F2; Sun, 8 Feb 2015 21:40:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 62D8AE07F2 for ; Sun, 8 Feb 2015 21:40:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 181E23406F1 for ; Sun, 8 Feb 2015 21:40:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 53CBF11589 for ; Sun, 8 Feb 2015 21:39:57 +0000 (UTC) From: "Christoph Junghans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christoph Junghans" Message-ID: <1421600238.c13e972b79864db27742fd9cdbd96be27d4f3462.ottxor@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: /, doc/ X-VCS-Repository: proj/genkernel X-VCS-Files: doc/genkernel.8.txt gen_cmdline.sh gen_determineargs.sh gen_initramfs.sh genkernel.conf X-VCS-Directories: / doc/ X-VCS-Committer: ottxor X-VCS-Committer-Name: Christoph Junghans X-VCS-Revision: c13e972b79864db27742fd9cdbd96be27d4f3462 X-VCS-Branch: master Date: Sun, 8 Feb 2015 21:39:57 +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-Archives-Salt: 6afd3114-8fc0-4acd-823b-d95bc61795bd X-Archives-Hash: ac12c940c6ee37cda21f7a61822cb205 commit: c13e972b79864db27742fd9cdbd96be27d4f3462 Author: Christoph Junghans gentoo org> AuthorDate: Sun Jan 18 00:57:55 2015 +0000 Commit: Christoph Junghans gentoo org> CommitDate: Sun Jan 18 16:57:18 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=c13e972b Added --wrap-initrd option This is useful in combination the u-boot bootloader which can only load wrap initramfs. Signed-off-by: Christoph Junghans gentoo.org> --- doc/genkernel.8.txt | 5 +++++ gen_cmdline.sh | 6 ++++++ gen_determineargs.sh | 1 + gen_initramfs.sh | 10 ++++++++++ genkernel.conf | 2 ++ 5 files changed, 24 insertions(+) diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index b36b78d..f8d7a10 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -376,6 +376,11 @@ OUTPUT SETTINGS Builds or does not build the generated initramfs into the kernel instead of keeping it as a separate file. +*--*[*no-*]*wrap-initrd*:: + Wrap initramfs using mkimage for u-boot boots. Please note that only + certain compression types are supported by mkimage (see manpage). + + *--*[*no-*]*compress-initramfs*, *--*[*no-*]*compress-initrd*:: Compresses or does not compress the generated initramfs. diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 6ef6ae0..baa58fa 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -158,6 +158,8 @@ longusage() { echo " --integrated-initramfs, --no-integrated-initramfs" echo " Include/exclude the generated initramfs in the kernel" echo " instead of keeping it as a separate file" + echo " --wrap-initrd, --no-wrap-initrd" + echo " Wrap initramfs using mkimage for u-boot boots" echo " --compress-initramfs, --no-compress-initramfs," echo " --compress-initrd, --no-compress-initrd" echo " Compress or do not compress the generated initramfs" @@ -575,6 +577,10 @@ parse_cmdline() { CMD_INTEGRATED_INITRAMFS=`parse_optbool "$*"` print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}" ;; + --wrap-initrd|--no-wrap-initrd) + CMD_WRAP_INITRD=`parse_optbool "$*"` + print_info 2 "CMD_WRAP_INITRD=${CMD_WRAP_INITRD}" + ;; --compress-initramfs|--no-compress-initramfs|--compress-initrd|--no-compress-initrd) CMD_COMPRESS_INITRD=`parse_optbool "$*"` print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index dc6b2c4..59af78b 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -131,6 +131,7 @@ determine_real_args() { set_config_with_override STRING FIRMWARE_DIR CMD_FIRMWARE_DIR "/lib/firmware" set_config_with_override STRING FIRMWARE_FILES CMD_FIRMWARE_FILES set_config_with_override BOOL INTEGRATED_INITRAMFS CMD_INTEGRATED_INITRAMFS + set_config_with_override BOOL WRAP_INITRD CMD_WRAP_INITRD set_config_with_override BOOL GENZIMAGE CMD_GENZIMAGE set_config_with_override BOOL KEYMAP CMD_KEYMAP "yes" set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO diff --git a/gen_initramfs.sh b/gen_initramfs.sh index b9ff518..254f21a 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -958,6 +958,16 @@ create_initramfs() { print_info 1 " >> Not compressing cpio data ..." fi fi + if isTrue "${WRAP_INITRD}" + then + local mkimage_cmd=$(type -p mkimage) + [[ -z ${mkimage_cmd} ]] && gen_die "mkimage is not available. Please install package 'dev-embedded/u-boot-tools'." + local mkimage_args="-A ${ARCH} -O linux -T ramdisk -C ${compression:-none} -a 0x00000000 -e 0x00000000" + print_info 1 " >> Wrapping initramfs using mkimage..." + print_info 2 "${mkimage_cmd} ${mkimage_args} -n initramfs-${KV} -d ${CPIO} ${CPIO}.uboot" + ${mkimage_cmd} ${mkimage_args} -n "initramfs-${KV}" -d "${CPIO}" "${CPIO}.uboot" >> ${LOGFILE} 2>&1 || gen_die "Wrapping initramfs using mkimage failed" + mv -f "${CPIO}.uboot" "${CPIO}" || gen_die "Rename failed" + fi fi if isTrue "${CMD_INSTALL}" diff --git a/genkernel.conf b/genkernel.conf index 0c3955c..7f42b05 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -296,6 +296,8 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux" # "fastest" selects the fastest available compression method #COMPRESS_INITRD_TYPE="best" +# wrap initramfs using mkimage for u-boot bootloader +# WRAP_INITRD=no # Create a self-contained env in the initramfs #NETBOOT="1"