aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/x86/image/Makefile
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tomek_n@o2.pl>2020-01-14 18:45:44 +0100
committerPetr Štetiar <ynezz@true.cz>2020-03-01 21:36:00 +0100
commitb322243d2f768a04a04831c45dabc627a41c4570 (patch)
tree162013f56e86a8d63c1e451d59682d3ef3991970 /target/linux/x86/image/Makefile
parent48873ace4e4bca9cb5de05b7e0a229c221bece34 (diff)
downloadupstream-b322243d2f768a04a04831c45dabc627a41c4570.tar.gz
upstream-b322243d2f768a04a04831c45dabc627a41c4570.tar.bz2
upstream-b322243d2f768a04a04831c45dabc627a41c4570.zip
x86: add bootloader upgrade on sysupgrade
Currently bootloader always stays on the same version as when first written to boot medium (not true if partition layout changed, which will trigger sysupgrade process to write full disk image). That creates inconveniences as it always stays with same features or/and bugs. Users wishing to add support to additional modules or new version, would need to write the whole image, potentially destroying previous system configuration. To fix these, this commit adds additional routine to sysupgrade which upgrades unconditionally the bootloader to the latest state provided by OpenWrt. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Diffstat (limited to 'target/linux/x86/image/Makefile')
-rw-r--r--target/linux/x86/image/Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index 2838b3139c..373f2396b7 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -66,11 +66,11 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
grub-mkimage \
-p /boot/grub \
-d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
- -o $(KDIR)/grub2/core.img \
+ -o $(KDIR)/root.grub/boot/grub/core.img \
-O i386-pc \
-c ./grub-early.cfg \
$(GRUB2_MODULES)
- $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img $(KDIR)/grub2/
+ $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img $(KDIR)/root.grub/boot/grub/
echo '(hd0) $(BIN_DIR)/$(IMG_COMBINED)-$(1).img' > $(KDIR)/grub2/device.map
sed \
-e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \
@@ -80,6 +80,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
-e 's#@TITLE@#$(GRUB_TITLE)#g' \
./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg
-$(CP) $(STAGING_DIR_ROOT)/boot/. $(KDIR)/root.grub/boot/
+ grub-bios-setup -V | cut -d' ' -f3 > $(KDIR)/root.grub/boot/grub/version
PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)" PATH="$(TARGET_PATH)" $(SCRIPT_DIR)/gen_image_generic.sh \
$(BIN_DIR)/$(IMG_COMBINED)-$(1).img \
$(CONFIG_TARGET_KERNEL_PARTSIZE) $(KDIR)/root.grub \
@@ -87,7 +88,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
256
grub-bios-setup \
--device-map="$(KDIR)/grub2/device.map" \
- -d "$(KDIR)/grub2" \
+ -d "$(KDIR)/root.grub/boot/grub" \
-r "hd0,msdos1" \
"$(BIN_DIR)/$(IMG_COMBINED)-$(1).img"
endef