# Author: Artem Bityutskiy
# License: GPLv2
-# This script assumes there is a working gummiboot configuration exists. This
-# scripts then scanse the boot partition, finds out which kernels are
-# available, and updates the gummiboot kernel entries: adds missing kernel
-# entries and delets non-existing kernel entries. The default entry is always
-# set to the latest kernel.
+# This scripts then scans ESP, finds out which kernels are available, and
+# updates the gummiboot kernel entries: adds missing kernel entries and delets
+# non-existing kernel entries. The default entry is always set to the newest
+# kernel version.
#
-# We make several assumptions in this script.
-# 1. The kernel binary names are 'vmlinuz-<version>'
-# 2. Kernel entry file names are 'vmlinuz-<version>.conf'
-# 3. There is always the "default" keyword in loader.conf, and we use the
-# corresponding kernel entry for adding new kernels.
-# 4. The 'default' entry in loader.conf does not does not use the wildcard ("*")
-# 5. Kernels binaries are placed in the ESP root
+# This scripts makes several assumptions.
+# 1. There is already a valid gummiboot configuration in ESP
+# 2. The kernel binary names are 'vmlinuz-<version>', and the gummiboot kernel
+# entry file names are 'vmlinuz-<version>.conf'
+# 3. There is always the "default" keyword in loader.conf.
+# 4. The default entry (in 'loader.conf) can safely be used as a pattern for
+# adding new entries (e.g., the kernel arguments are taken from there)
+# 4. The 'default' entry name does not have wildcards ("*")
+# 5. Kernels binaries are placed in the root of ESP
#
# May be there are few more implicit assumption. This all can be improved and
# made to be more flexible if needed.
# Create a gummiboot entry for every new kernel
printf "%s\n" "$kernels" | while IFS= read -r kernel; do
-
if [ -f "$entries_dir/$kernel.conf" ]; then
continue
fi