Looking at the original problem: you set up an image and boot it with a boot loader that does not match the stored type. And then want pbl to update the 'correct' boot config. 'correct' being the loader last used, assuming you never change your mind in the future. Wouldn't it be more straightforward to have a systemd service run the first time that adjusts the loader type (or maybe even always)? Or simply disallow legacy booting. BTW, aren't you aiming for systemd-boot for micro-os anyway in the future?