summaryrefslogtreecommitdiffstats
path: root/meta/classes/syslinux.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-02-24 01:23:58 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-02 23:08:51 +0000
commitbb1c719250cecc8725147cbdd999a9a44a11b549 (patch)
tree87c69fe8fe2c254d87dbf09b47fba74b9c8a8928 /meta/classes/syslinux.bbclass
parent5c5c13d77783e96b9acbbe460bf7060722f436cb (diff)
downloadpoky-bb1c719250cecc8725147cbdd999a9a44a11b549.tar.gz
syslinux.bbclass: make vm and live can be built together
* The vm image(hdddirect, vmdk, qcow2, vdi) and live image (hddimg, iso) couldn't be built together because the following vars settings are conflicted: - SYSLINUX_ROOT (/dev/sda2 vs /dev/ram0) - LABELS (boot vs boot install) - INITRD (None vs live install) - SYSLINUX_CFG (see above) Introduce new vars (SYSLINUX_ROOT_VM/_LIVE, the samilar to others) to make them can work together, now we can build all of them together: IMAGE_FSTYPES += "live iso hddimg hdddirect vmdk qcow2 vdi" * Use SYSLINUX_CFG rather than SYSLINUXCFG to keep align with others SYSLINUX vars. * The SYSLINUX_TIMEOUT had been set, but it didn't work since AUTO_SYSLINUXMENU wasn't set, this would cause confusions, so also set AUTO_SYSLINUXMENU. * Move SYSLINUX_PROMPT and SYSLINUX_TIMEOUT to syslinux.bbclass rather than in separate classes since they are the same. * Set SYSLINUX_TIMEOUT to 50 to have a unique timeout for syslinux. [YOCTO #9161] (From OE-Core rev: e38c94d6bf83ed3ca7f046d9503e81b927487bf2) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/syslinux.bbclass')
-rw-r--r--meta/classes/syslinux.bbclass23
1 files changed, 18 insertions, 5 deletions
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index 44ef9a9176..1b644b2561 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -20,8 +20,6 @@
20do_bootimg[depends] += "${MLPREFIX}syslinux:do_populate_sysroot \ 20do_bootimg[depends] += "${MLPREFIX}syslinux:do_populate_sysroot \
21 syslinux-native:do_populate_sysroot" 21 syslinux-native:do_populate_sysroot"
22 22
23SYSLINUXCFG = "${S}/syslinux.cfg"
24
25ISOLINUXDIR = "/isolinux" 23ISOLINUXDIR = "/isolinux"
26SYSLINUXDIR = "/" 24SYSLINUXDIR = "/"
27# The kernel has an internal default console, which you can override with 25# The kernel has an internal default console, which you can override with
@@ -29,6 +27,9 @@ SYSLINUXDIR = "/"
29SYSLINUX_DEFAULT_CONSOLE ?= "" 27SYSLINUX_DEFAULT_CONSOLE ?= ""
30SYSLINUX_SERIAL ?= "0 115200" 28SYSLINUX_SERIAL ?= "0 115200"
31SYSLINUX_SERIAL_TTY ?= "console=ttyS0,115200" 29SYSLINUX_SERIAL_TTY ?= "console=ttyS0,115200"
30SYSLINUX_PROMPT ?= "0"
31SYSLINUX_TIMEOUT ?= "50"
32AUTO_SYSLINUXMENU ?= "1"
32ISO_BOOTIMG = "isolinux/isolinux.bin" 33ISO_BOOTIMG = "isolinux/isolinux.bin"
33ISO_BOOTCAT = "isolinux/boot.cat" 34ISO_BOOTCAT = "isolinux/boot.cat"
34MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table" 35MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
@@ -37,6 +38,18 @@ APPEND_prepend = " ${SYSLINUX_ROOT} "
37# Need UUID utility code. 38# Need UUID utility code.
38inherit fs-uuid 39inherit fs-uuid
39 40
41# Some of the vars for vm and live image are conflicted, this function
42# is used for fixing the problem.
43def syslinux_set_vars(d, suffix):
44 vars = ['SYSLINUX_ROOT', 'SYSLINUX_CFG', 'LABELS', 'INITRD']
45 for var in vars:
46 var_with_suffix = var + '_' + suffix
47 if d.getVar(var, True):
48 bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \
49 (var, var_with_suffix, var))
50 elif d.getVar(var_with_suffix, True):
51 d.setVar(var, d.getVar(var_with_suffix, True))
52
40syslinux_populate() { 53syslinux_populate() {
41 DEST=$1 54 DEST=$1
42 BOOTDIR=$2 55 BOOTDIR=$2
@@ -45,7 +58,7 @@ syslinux_populate() {
45 install -d ${DEST}${BOOTDIR} 58 install -d ${DEST}${BOOTDIR}
46 59
47 # Install the config files 60 # Install the config files
48 install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME} 61 install -m 0644 ${SYSLINUX_CFG} ${DEST}${BOOTDIR}/${CFGNAME}
49 if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then 62 if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
50 install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${DEST}${BOOTDIR}/vesamenu.c32 63 install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${DEST}${BOOTDIR}/vesamenu.c32
51 install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${DEST}${BOOTDIR}/libcom32.c32 64 install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${DEST}${BOOTDIR}/libcom32.c32
@@ -96,9 +109,9 @@ python build_syslinux_cfg () {
96 bb.debug(1, "No labels, nothing to do") 109 bb.debug(1, "No labels, nothing to do")
97 return 110 return
98 111
99 cfile = d.getVar('SYSLINUXCFG', True) 112 cfile = d.getVar('SYSLINUX_CFG', True)
100 if not cfile: 113 if not cfile:
101 raise bb.build.FuncFailed('Unable to read SYSLINUXCFG') 114 raise bb.build.FuncFailed('Unable to read SYSLINUX_CFG')
102 115
103 try: 116 try:
104 cfgfile = file(cfile, 'w') 117 cfgfile = file(cfile, 'w')