kernel-install: do not add kernel entry if already present
The entry may be already present for example when reinstalling package, or calling the script multiple times (which apparently is the case during system installation).
This commit is contained in:
parent
dc9e3c9c11
commit
4d4e7cc5e9
@ -15,6 +15,7 @@ fi
|
||||
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
if ! fgrep -q "[${KVER}]" $EFI_DIR/xen.cfg; then
|
||||
# take the default section and use it as a template for the new entry
|
||||
awk -F = --assign "kver=${KVER}" '
|
||||
/^\[/ {
|
||||
@ -57,6 +58,7 @@ case "$COMMAND" in
|
||||
|
||||
# then change the default
|
||||
sed -e "s/default=.*/default=$KVER/" -i $EFI_DIR/xen.cfg
|
||||
fi
|
||||
|
||||
cp "/boot/vmlinuz-$KVER" "$EFI_DIR/"
|
||||
dracut -f "$EFI_DIR/initramfs-${KVER}.img" "$KVER"
|
||||
|
Loading…
Reference in New Issue
Block a user