aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-04-03 03:58:56 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-04-03 03:58:56 +0200
commit60a0ba78d26c1829b77ffa9aa59aac761a970b93 (patch)
tree90d69827a57ab7a9d68b050aa64ac05c6b4981ba
parentarch-config: add missing arch-config for consistency (diff)
downloadgenkernel-60a0ba78d26c1829b77ffa9aa59aac761a970b93.tar.gz
genkernel-60a0ba78d26c1829b77ffa9aa59aac761a970b93.tar.bz2
genkernel-60a0ba78d26c1829b77ffa9aa59aac761a970b93.zip
Make sure $TMPDIR exists
Since commit 479b2386c8 we are using mktemp to create the temporary folder $TEMP for the current genkernel run. However, when $TMPDIR doesn't exist, mktemp will fail. Reported-By: Aaron Bauman <bman@gentoo.org> Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-xgen_cmdline.sh1
-rwxr-xr-xgenkernel3
2 files changed, 3 insertions, 1 deletions
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 795c2c6..c5697e2 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -587,6 +587,7 @@ parse_cmdline() {
;;
--tempdir=*)
TMPDIR="${*#*=}"
+ [ ! -d "${TMPDIR}" ] && mkdir -p "${TMPDIR}" || gen_die "Failed to create '${TMPDIR}'!"
TEMP=$(mktemp -d -p "${TMPDIR}" gk.XXXXXXXX)
print_info 2 "TMPDIR: ${TMPDIR}"
print_info 2 "TEMP: ${TEMP}"
diff --git a/genkernel b/genkernel
index 676471c..6904ff2 100755
--- a/genkernel
+++ b/genkernel
@@ -44,6 +44,7 @@ source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_mod
source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh"
source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh"
+[ ! -d "${TMPDIR}" ] && mkdir -p "${TMPDIR}" || gen_die "Failed to create '${TMPDIR}'!"
TEMP=$(mktemp -d -p "${TMPDIR}" gk.XXXXXXXX)
trap_cleanup(){
@@ -150,7 +151,7 @@ determine_config_file
set_kernel_arch
-[ ! -f "${TEMP}" ] && mkdir -p "${TEMP}"
+[ ! -f "${TEMP}" ] && mkdir "${TEMP}" || gen_die "Failed to create '${TEMP}'!"
setup_cache_dir