path: root/common/recipes-core
diff options
authorJianxun Zhang <>2016-08-03 18:04:21 (GMT)
committerTom Zanussi <>2016-08-03 22:43:30 (GMT)
commitb9f9710ba4df77e2ef0f06ccb1d2870f626d229e (patch)
treefcceb47048d753b2645df60eba2492e3cf0290d9 /common/recipes-core
parent8afe60c0bfb878578fd0619c1abf87452275912a (diff)
rmc: Don't install boot entries when RMC entries exist
RMC installer copies RMC entries after copying default entries. But default entries aren't overwritten when RMC entries have different file names from them, so they will be kept on target after installation. RMC Bootloader skips loading default entries when it can get RMC entries from RMC database file. However, RMC database file isn't deployed onto target in installation by design. As a result, default entries show up along with deployed RMC entries once target reboots after installation. We cannot get rid of these default entries in RMC deployment section because it doesn't know which entry file should be removed. An easier way is not to deploy default entries when any boot entry files assumingly from RMC are already deployed at a later step. Similar logic applies to loader.conf too. Signed-off-by: Jianxun Zhang <> Reviewed-by: Saul Wold <> Signed-off-by: Tom Zanussi <>
Diffstat (limited to 'common/recipes-core')
1 files changed, 18 insertions, 13 deletions
diff --git a/common/recipes-core/initrdscripts/files/ b/common/recipes-core/initrdscripts/files/
index 0b2ee46..7148005 100644
--- a/common/recipes-core/initrdscripts/files/
+++ b/common/recipes-core/initrdscripts/files/
@@ -208,21 +208,14 @@ fi
208mount $bootfs /boot 208mount $bootfs /boot
209echo "Preparing boot partition..." 209echo "Preparing boot partition..."
210 210
211# RMC deployment
215EFIDIR="/boot/EFI/BOOT" 211EFIDIR="/boot/EFI/BOOT"
216mkdir -p $EFIDIR 212mkdir -p $EFIDIR
218# Copy the efi loader 213# Copy the efi loader
219cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR 214cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
220 215
221# We only support gummiboot/systemd-boot. Leave grub-efi not changed. 216# RMC deployment
222if [ -d /run/media/$1/loader ]; then 217RMC_CMD=/src_root/usr/bin/rmc
223 # copy config files for gummiboot 218RMC_DB=/run/media/$1/rmc.db
224 cp -dr /run/media/$1/loader /boot
226 219
227# We don't want to quit when a step failed. For example, 220# We don't want to quit when a step failed. For example,
228# a file system could not support some operations. 221# a file system could not support some operations.
@@ -298,9 +291,21 @@ fi
298if [ -d /run/media/$1/loader ]; then 291if [ -d /run/media/$1/loader ]; then
299 rootuuid=$(blkid -o value -s PARTUUID ${rootfs}) 292 rootuuid=$(blkid -o value -s PARTUUID ${rootfs})
300 GUMMIBOOT_CFGS="/boot/loader/entries/*.conf" 293 GUMMIBOOT_CFGS="/boot/loader/entries/*.conf"
301 # delete the install entry 294 if [ -d /boot/loader ]; then
302 # fixme: If RMC did deploy install.conf at previous steps, it is purged here... 295 # Don't override loader.conf RMC already deployed
303 rm -f /boot/loader/entries/install.conf 296 if [ ! -f /boot/loader/loader.conf ]; then
297 cp /run/media/$1/loader/loader.conf /boot/loader/
298 fi
299 # only copy built OE entries when RMC entries don't exist.
300 if [ ! -d /boot/loader/entries ] || [ ! ls /boot/loader/entries/*.conf &>/dev/null ]; then
301 cp -dr /run/media/$1/loader/entries /boot/loader
302 fi
303 else
304 # copy config files for gummiboot
305 cp -dr /run/media/$1/loader /boot
306 # delete the install entry
307 rm -f /boot/loader/entries/install.conf
308 fi
304 # delete the initrd lines 309 # delete the initrd lines
305 sed -i "/initrd /d" $GUMMIBOOT_CFGS 310 sed -i "/initrd /d" $GUMMIBOOT_CFGS
306 # delete any LABEL= strings 311 # delete any LABEL= strings