summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJianxun Zhang <jianxun.zhang@linux.intel.com>2016-08-03 18:04:21 (GMT)
committerTom Zanussi <tom.zanussi@linux.intel.com>2016-08-03 22:43:30 (GMT)
commitb9f9710ba4df77e2ef0f06ccb1d2870f626d229e (patch)
treefcceb47048d753b2645df60eba2492e3cf0290d9 /common
parent8afe60c0bfb878578fd0619c1abf87452275912a (diff)
downloadmeta-intel-b9f9710ba4df77e2ef0f06ccb1d2870f626d229e.tar.gz
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 <jianxun.zhang@linux.intel.com> Reviewed-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Diffstat (limited to 'common')
-rw-r--r--common/recipes-core/initrdscripts/files/init-install-efi.sh31
1 files changed, 18 insertions, 13 deletions
diff --git a/common/recipes-core/initrdscripts/files/init-install-efi.sh b/common/recipes-core/initrdscripts/files/init-install-efi.sh
index 0b2ee46..7148005 100644
--- a/common/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/common/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -208,21 +208,14 @@ fi
208mount $bootfs /boot 208mount $bootfs /boot
209echo "Preparing boot partition..." 209echo "Preparing boot partition..."
210 210
211# RMC deployment
212RMC_CMD=/src_root/usr/bin/rmc
213RMC_DB=/run/media/$1/rmc.db
214
215EFIDIR="/boot/EFI/BOOT" 211EFIDIR="/boot/EFI/BOOT"
216mkdir -p $EFIDIR 212mkdir -p $EFIDIR
217
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
225fi
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