Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

kload: add append option

  • Loading branch information...
commit 0380669b6d851ad2cca65e403f950dc53a8131d6 1 parent 09de126
@falconindy authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 kload
View
13 kload
@@ -134,12 +134,13 @@ runcmd() {
}
# main()
-while getopts ":f:hl" flag; do
+while getopts ":a:f:hl" flag; do
case $flag in
+ a) optappend=$OPTARG ;;
f) bootloadercfg=$OPTARG ;;
h) usage ;;
l) list=1 ;;
- :) die "option '--%s' requires an argument" "$OPTARG" ;;
+ :) die "option '-%s' requires an argument" "$OPTARG" ;;
?) die "invalid option -- '%s'" "$OPTARG" ;;
esac
done
@@ -155,13 +156,13 @@ label=$1; shift
(( UID == 0 )) || needsroot=1
{
- read -rd '' kernel
- read -rd '' append
- read -rd '' initrd
+ IFS= read -rd '' kernel
+ IFS= read -rd '' append
+ IFS= read -rd '' initrd
} < <(parse_config 'parse_one' "$label")
[[ -z $kernel || -z $append ]] && die "failed to find label \`%s'" "$label"
-kexec_cmd=(kexec -l "/boot/${kernel##*/}" --append="${*:-$append}")
+kexec_cmd=(kexec -l "/boot/${kernel##*/}" --append="${*:-$append} $optappend")
[[ $initrd ]] && kexec_cmd+=(--initrd="/boot/${initrd##*/}")
runcmd "${kexec_cmd[@]}"
Please sign in to comment.
Something went wrong with that request. Please try again.