mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
init-script-builder: handle containers without a kernel
This commit is contained in:
parent
ee90c703be
commit
5396a01b6c
1 changed files with 7 additions and 2 deletions
|
@ -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