Closed codewithmichael closed 9 years ago
The problem exists in the generate
function in version 0.1.0, copy/update-grub.sh
between lines 141-153:
kernel="${directory}/$PLATFORM_IMAGE_KERNEL"
versioned_kernel=
kernel_version=
if test ! -f "${MOUNT_DEVICE%/}$kernel"; then
versioned_kernel=`getNewestExistingVersionedFilePath "${MOUNT_DEVICE%/}$kernel"` \
&& kernel_version="${versioned_kernel#${MOUNT_DEVICE%/}$kernel}" \
&& kernel="$kernel$kernel_version" \
|| { generate "$heading" "$fallback_directory" "$options" ; return $? ; }
fi
initrd="${directory}/$PLATFORM_IMAGE_INITRD$kernel_version"
test -f "${MOUNT_DEVICE%/}$initrd" \
|| { generate "$heading" "$fallback_directory" "$options" ; return $? ; }
If a kernel image isn't found in the save directory, the generate
function is just called recursively using $fallback_directory
, which in this case is the boot/images/
directory. Since the initrd image location is determined after the kernel image location, it's never even hitting the point where it looks for the initrd image in the save directory.
I believe I've corrected this issue in pull request #3.
Fixed by pull request #3. Merged into v0.1.1
Currently
update-grub.sh
finds existing save directories and addsmenuentry
sections for them in the output as expected, but unless there is a kernel image file (vmlinuz) in the save directory, any initramfs images (initrd.img) are ignored.It works fine when generating a new Grub configuration after a kernel update (because both files are copied into the save directory), but a basic system update that just rebuilds the initramfs image requires manually editing the
grub.cfg
file.update-grub.sh
should recognize a standaloneinitrd.img
file within the save directory so long as it matches the version number on the kernel image in theboot/images/
directory.