init-script-builder: handle containers without a kernel
This commit is contained in:
parent
d98f0ea720
commit
c8ca34e269
|
@ -80,8 +80,13 @@ for generation in $(
|
|||
| sort -n -r); do
|
||||
link=/nix/var/nix/profiles/system-$generation-link
|
||||
date=$(stat --printf="%y\n" $link | sed 's/\..*//')
|
||||
kernelVersion=$(cd $(dirname $(readlink -f $link/kernel))/lib/modules && echo *)
|
||||
addEntry "NixOS - Configuration $generation ($date - $kernelVersion)" $link "$generation ($date)"
|
||||
if [ -d $link/kernel ]; then
|
||||
kernelVersion=$(cd $(dirname $(readlink -f $link/kernel))/lib/modules && echo *)
|
||||
suffix="($date - $kernelVersion)"
|
||||
else
|
||||
suffix="($date)"
|
||||
fi
|
||||
addEntry "NixOS - Configuration $generation $suffix" $link "$generation ($date)"
|
||||
done
|
||||
|
||||
mv $tmpOther $targetOther
|
||||
|
|
Loading…
Reference in a new issue