diff options
author | Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> | 2022-08-20 16:38:45 +0000 |
---|---|---|
committer | Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> | 2022-08-20 16:38:45 +0000 |
commit | a078bdb66a95b9d604cfc0ba4122feec2e040c68 (patch) | |
tree | 65fe438f521919f9d4445570e8ecb651ffa85cf4 /rc | |
parent | 95206ac7e54cbc7a0c913c0ab73b509896ff27a5 (diff) |
fshalt: support relative paths to the new kernel
Diffstat (limited to 'rc')
-rwxr-xr-x | rc/bin/fshalt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rc/bin/fshalt b/rc/bin/fshalt index 127c92691..1d63ac45e 100755 --- a/rc/bin/fshalt +++ b/rc/bin/fshalt @@ -14,6 +14,12 @@ if not if(! ~ $#* 0 && ! ~ $#* 1){ exit usage } +if(~ $reboot yes && ~ $#* 1){ + bootf=$1 + if(! ~ $bootf /*) + bootf=`{builtin pwd}^/$bootf +} + path=(/bin) builtin cd / bind -c '#s' /srv @@ -47,8 +53,8 @@ cp /bin/sed /tmp cp /bin/sleep /tmp cp /bin/scram /tmp cp /bin/test /tmp -if(~ $reboot yes && ~ $#* 1){ - if(! cp $1 /tmp/bootf) +if(~ $#bootf 1){ + if(! cp $bootf /tmp/bootf) exit 'failed to copy kernel' bootf=/bin/bootf } |