commit:     ba8d7607b735d08eede975671edcc1e6d9b37345
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 26 09:48:59 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Mar 26 09:48:59 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=ba8d7607

create_initramfs(): add error checking sed call which ties to delete 
CONFIG_INITRAMFS_SOURCE

Bug: https://bugs.gentoo.org/656944
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_initramfs.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 03e3d59..da5ffcf 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1110,7 +1110,9 @@ create_initramfs() {
                # Explicitly do not compress if we are integrating into the 
kernel.
                # The kernel will do a better job of it than us.
                mv ${TMPDIR}/initramfs-${KV} ${TMPDIR}/initramfs-${KV}.cpio
-               sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' 
${KERNEL_OUTPUTDIR}/.config
+               sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' 
"${KERNEL_OUTPUTDIR}/.config" ||
+                       gen_die "failed to delete CONFIG_INITRAMFS_SOURCE from 
'${KERNEL_OUTPUTDIR}/.config'"
+
                compress_config='INITRAMFS_COMPRESSION_NONE'
                case ${compress_ext} in
                        gz)   compress_config='INITRAMFS_COMPRESSION_GZIP' ;;

Reply via email to