summaryrefslogtreecommitdiff
path: root/update-kernel.in
diff options
context:
space:
mode:
authorDennis Günnewig <dev@fedux.org>2021-05-30 15:16:17 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2021-10-25 11:37:28 +0000
commit661f3b90f29f96a733aaff62ff0ca899ed34234d (patch)
treeeadaeee15238bddcfb45985cb17962a3b0b8619a /update-kernel.in
parentf8e79444b338414595a7a612d871792ebfa70b9e (diff)
downloadalpine-conf-661f3b90f29f96a733aaff62ff0ca899ed34234d.zip
update-kernel: Make path for tmpdir changeable via cli flag
On a Raspberry Pi 3B+ the memory is limited. Updating a kernel might be not possible due to "out of space" situations. This MR adds a flag to mitigate the problem for users facing this issue.
Diffstat (limited to 'update-kernel.in')
-rw-r--r--update-kernel.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/update-kernel.in b/update-kernel.in
index dce5006..51fed76 100644
--- a/update-kernel.in
+++ b/update-kernel.in
@@ -31,6 +31,7 @@ REPOSITORIES_FILE=/etc/apk/repositories
KEYS_DIR=/etc/apk/keys
SIGNALS="HUP INT TERM"
TMPDIR=
+TMPDIR_PATH="/tmp"
features=
modloopfw=
@@ -55,6 +56,7 @@ usage() {
-F|--feature <feature> Enable initfs feature
-p|--package <package> Additional module or firmware package
-s|--modloopsign Sign modloop with abuild key
+ -t|--tmpdir <directory> Choose different (non RAM) temporary directory for build files etc.
-v|--verbose Verbose output
-k|--apk-pubkey <key> Include given key in initramfs
-K|--hostkeys Include host keys in initramfs
@@ -68,8 +70,8 @@ usage() {
}
QUIET_OPT="--quiet"
-OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,modloopfw:,help,package:,modloopsign,verbose,apk-pubkey:,hostkeys,compression:,media,repositories-file:,keys-dir: \
- -n $SCRIPT -o a:b:f:F:hp:svk:KC:Md: -- "$@") || usage 1
+OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,modloopfw:,help,package:,modloopsign,tmpdir:,verbose,apk-pubkey:,hostkeys,compression:,media,repositories-file:,keys-dir: \
+ -n $SCRIPT -o a:b:f:F:hp:st:vk:KC:Md: -- "$@") || usage 1
eval set -- "$OPTS"
while :; do
@@ -105,6 +107,10 @@ while :; do
-s|--modloopsign)
MODLOOPSIGN=1
;;
+ -t|--tmpdir)
+ shift
+ TMPDIR_PATH="$1"
+ ;;
-v|--verbose)
QUIET_OPT=
;;
@@ -218,7 +224,7 @@ fi
[ "$ARCH" ] || ARCH=$(apk --print-arch)
-TMPDIR=$(mktemp -d /tmp/$SCRIPT.XXXXXX)
+TMPDIR=$(mktemp -d "$TMPDIR_PATH/$SCRIPT.XXXXXX")
ROOT=$TMPDIR/root
BOOT=$ROOT/boot