snapshotmanager / boom-boot

Boom Boot Manager
GNU General Public License v2.0
30 stars 4 forks source link

Do not attempt to delete read-only boot entries #10

Closed bmr-cymru closed 2 years ago

bmr-cymru commented 2 years ago

Boot entries provided by the system that boom cannot match to a configured profile are treated as read-only and should not allow modification or removal. Currently attempting to remove these entries with boom delete gives a misleading error involving the boot entry path:

# boom delete 29490c5
Entry does not exist: /boot/loader/entries/28fc0d05bf6b460d888965a23ddf1e53-29490c5-5.14.0-108.el9.x86_64.conf

The message is correct in that the file does not exist - this is because the system entries use a different format for constructing BLS file names. The actual path is known to the BootEntry object and it is also marked read-only. The command should return an error string like:

# boom delete 7fce1e5
Cannot delete read-only system boot entry: /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-5.14.0-108.el9.x86_64.conf