Skip to contentSkip to conversation

fix #11044: wic should support multiple boot labels such as boot and install targets

PATCH New Ed Bartosh 1 participant 3 messages Feb 23, 2017

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

cover fix #11044: wic should support multiple boot labels such as boot and install targets

Hi,

This patchset provides an example of multi-target syslinux config. It utilizes --configfile bootloader option instead of "traditional" way to hardcode all configuration details in wic plugin code.

This approach is a preferable way to configure bootloaders in wic. It should be used for all wic pluins in future.

The following changes since commit 5d96bc6d1af89dda11f3266548fe1547152c86e1:

image_types_wic: fix expansion error (2017-02-22 15:41:33 +0200)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ed/wic/wip
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/wic/wip

Ed Bartosh (2):
wic: bootimg-pcbios: add support for syslinux vesamenu
wic: add more targets to directdisk syslinux config

 .../canned-wks/directdisk-bootloader-config.cfg    | 28 +++++++++++++++++-----
 scripts/lib/wic/plugins/source/bootimg-pcbios.py   | 20 ++++++++++------
 2 files changed, 35 insertions(+), 13 deletions(-)

--
Regards,
Ed

author
#1 lore raw

PATCH 1/2 wic: bootimg-pcbios: add support for syslinux vesamenu

Installed vesamenu.c32 and its dependencies to support vesamenu ui in syslinux config.

---
 scripts/lib/wic/plugins/source/bootimg-pcbios.py | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
scripts/lib/wic/plugins/source/bootimg-pcbios.py +13 -7
index bbc9f47..bd03eaa 100644
@@ -160,13 +160,19 @@ class BootimgPcbiosPlugin(SourcePlugin):
 
         hdddir = "%s/hdd/boot" % cr_workdir
 
-        install_cmd = "install -m 0644 %s/bzImage %s/vmlinuz" \
-            % (staging_kernel_dir, hdddir)
-        exec_cmd(install_cmd)
-
-        install_cmd = "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" \
-            % (bootimg_dir, hdddir)
-        exec_cmd(install_cmd)
+        cmds = ("install -m 0644 %s/bzImage %s/vmlinuz" %
+                (staging_kernel_dir, hdddir),
+                "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" %
+                (bootimg_dir, hdddir),
+                "install -m 0644 %s/syslinux/vesamenu.c32 %s/vesamenu.c32" %
+                (bootimg_dir, hdddir),
+                "install -m 444 %s/syslinux/libcom32.c32 %s/libcom32.c32" %
+                (bootimg_dir, hdddir),
+                "install -m 444 %s/syslinux/libutil.c32 %s/libutil.c32" %
+                (bootimg_dir, hdddir))
+
+        for install_cmd in cmds:
+            exec_cmd(install_cmd)
 
         du_cmd = "du -bks %s" % hdddir
         out = exec_cmd(du_cmd)
Signature · 1 line
2.1.4
author
#2 lore raw

PATCH 2/2 wic: add more targets to directdisk syslinux config

In reply to Ed Bartosh

Added 3 new targets to directdisk-bootloader-config.cfg to match hddimg syslinux config.

This is a preparation for dropping hddimg in favor of wic.

[YOCTO #11044]

---
 .../canned-wks/directdisk-bootloader-config.cfg    | 28 +++++++++++++++++-----
 1 file changed, 22 insertions(+), 6 deletions(-)
scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg +22 -6
index a16bd6a..d5a07d2 100644
@@ -1,11 +1,27 @@
 # This is an example configuration file for syslinux.
-PROMPT 0
-TIMEOUT 10
-
+TIMEOUT 50
 ALLOWOPTIONS 1
 SERIAL 0 115200
+PROMPT 0
+
+UI vesamenu.c32
+menu title Select boot options
+menu tabmsg Press [Tab] to edit, [Return] to select
+
+DEFAULT Graphics console boot
+
+LABEL Graphics console boot
+KERNEL /vmlinuz
+APPEND label=boot root=/dev/sda2 rootwait
+
+LABEL Serial console boot
+KERNEL /vmlinuz
+APPEND label=boot root=/dev/sda2 rootwait console=ttyS0,115200
+
+LABEL Graphics console install
+KERNEL /vmlinuz
+APPEND label=install root=/dev/sda2 rootwait
 
-DEFAULT boot
-LABEL boot
+LABEL Serial console install
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0
+APPEND label=install root=/dev/sda2 rootwait console=ttyS0,115200
Signature · 1 line
2.1.4