diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2019-07-14 11:36:51 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2019-07-14 13:58:16 +0200 |
commit | d4450fcaad41aff9b2d5a693df80560890730dc1 (patch) | |
tree | 6e21d3f27b98873f3fe9d07c9583b245bb32fb98 | |
parent | gen_initramfs.sh: Refactor append_firmware() (diff) | |
download | genkernel-d4450fca.tar.gz genkernel-d4450fca.tar.bz2 genkernel-d4450fca.zip |
gen_initramfs.sh: Refactor append_libgcc_s()
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-x | gen_initramfs.sh | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh index c7fd1dc9..8d6996e8 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -613,12 +613,14 @@ append_btrfs() { } append_libgcc_s() { - if [ -d "${TEMP}/initramfs-libgcc_s-temp" ] + local TDIR="${TEMP}/initramfs-libgcc_s-temp" + if [ -d "${TDIR}" ] then - rm -r "${TEMP}/initramfs-libgcc_s-temp" + rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!" fi - mkdir -p "${TEMP}/initramfs-libgcc_s-temp" + mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!" + cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" # Include libgcc_s.so.1: # - workaround for zfsonlinux/zfs#4749 @@ -631,17 +633,12 @@ append_libgcc_s() { libgccpath="/usr/lib/gcc/*/*/libgcc_s.so.1" fi - # Copy binaries - copy_binaries "${TEMP}/initramfs-libgcc_s-temp" ${libgccpath} - cd "${TEMP}/initramfs-libgcc_s-temp/lib64" - ln -s "..${libgccpath}" + copy_binaries "${TDIR}" ${libgccpath} - cd "${TEMP}/initramfs-libgcc_s-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 libgcc_s cpio" - cd "${TEMP}" - rm -rf "${TEMP}/initramfs-libgcc_s-temp" > /dev/null + || gen_die "Failed to append libgcc_s to cpio!" } append_linker() { |