[OE-core] [PATCH] syslinux.bbclass: Add a default serial console option and real boot menu support
The previous syslinux menu code did not support using both a serial and vga console, but this has worked for years in syslinux so there is no reason not to take advantage of it. The previous menu looked like: --- Linux Boot Menu The following targets are available on this image: boot: None install: None --- This commit makes it look something more like a traditional grub menu on both the serial console and vga console as well as providing the option to continue on using either the serial or vga console with the correct kernel arguments. You can see the screen shots attached to the bugzilla. https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944 [ YOCTO #3944 ] Signed-off-by: Jason Wessel --- meta/classes/syslinux.bbclass | 128 - 1 files changed, 49 insertions(+), 79 deletions(-) diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass index c4596bf..c6a5a15 100644 --- a/meta/classes/syslinux.bbclass +++ b/meta/classes/syslinux.bbclass @@ -11,15 +11,17 @@ # ${LABELS} - a list of targets for the automatic config # ${APPEND} - an override list of append strings for each label # ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited +# ${SYSLINUX_SPLASH} - A background for the vga boot menu if using the boot menu +# ${SYSLINUX_SERIAL} - Set an alternate serial port or turn off serial with empty string do_bootimg[depends] += "syslinux:do_populate_sysroot \ syslinux-native:do_populate_sysroot" SYSLINUXCFG = "${S}/syslinux.cfg" -SYSLINUXMENU = "${S}/menu" ISOLINUXDIR = "/isolinux" SYSLINUXDIR = "/" +SYSLINUX_SERIAL ?= "0 115200" ISO_BOOTIMG = "isolinux/isolinux.bin" ISO_BOOTCAT = "isolinux/boot.cat" MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table" @@ -34,82 +36,34 @@ syslinux_populate() { # Install the config files install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME} - if [ -f ${SYSLINUXMENU} ]; then - install -m 0644 ${SYSLINUXMENU} ${DEST}${BOOTDIR} - fi } syslinux_iso_populate() { syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR} + if [ x${AUTO_SYSLINUXMENU} = x1 ] ; then + install -m 0644 ${STAGING_DIR}/${MACHINE}/usr/share/syslinux/vesamenu.c32 ${ISODIR}${ISOLINUXDIR}/vesamenu.c32 + if [ x${SYSLINUX_SPLASH} != x ] ; then + install -m 0644 ${SYSLINUX_SPLASH} ${ISODIR}${ISOLINUXDIR}/splash.lss + fi + fi } syslinux_hddimg_populate() { syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg install -m 0444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys + if [ x${AUTO_SYSLINUXMENU} = x1 ] ; then + install -m 0644 ${STAGING_DIR}/${MACHINE}/usr/share/syslinux/vesamenu.c32 ${HDDDIR}${SYSLINUXDIR}/vesamenu.c32 + if [ x${SYSLINUX_SPLASH} != x ] ; then + install -m 0644 ${SYSLINUX_SPLASH} ${HDDDIR}${SYSLINUXDIR}/splash.lss + fi + fi } syslinux_hddimg_install() { syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg } -python build_syslinux_menu () { -import copy -import sys - -workdir = d.getVar('WORKDIR', True) -if not workdir: -bb.error("WORKDIR is not defined") -return - -labels = d.getVar('LABELS', True) -if not labels: -bb.debug(1, "LABELS not defined, nothing to do") -return - -if labels == []: -bb.debug(1, "No labels, nothing to do") -return - -cfile = d.getVar('SYSLINUXMENU', True) -if not cfile: -raise bb.build.FuncFailed('Unable to read SYSLINUXMENU') - -try: -cfgfile = file(cfile, 'w') -except OSError: -raise bb.build.funcFailed('Unable to open %s' % (cfile)) - -# Beep the speaker and Clear the screen -cfgfile.write('\x07\x0C') - -# The title should be configurable -cfgfile.write('Linux Boot Menu\n') -cfgfile.write('The following targets are available on this image:\n') -cfgfile.write('\n') - -for label in labels.split(): -from copy import deepcopy -localdata = deepcopy(d) - -overrides = localdata.getVar('OVERRIDES') -if not overrides: -raise bb.build.FuncFailed('OVERRIDES not defined') -overrides = localdata.expand(overrides) - -localdata.setVar('OVERRIDES', label + ':' + overrides) -bb.data.update_data(localdata) - -usage = localdata.getVar('USAGE', True) -cfgfile.write(' \x0F\x30\x3E%16s\x0F\x30\x37: ' % (label)) -cfgfile.write('%s\n' % (usage)) - -del localdata - -cfgfile.write('\n') -c
Re: [OE-core] [PATCH] syslinux.bbclass: Add a default serial console option and real boot menu support
On Tue, Feb 26, 2013 at 9:04 PM, Jason Wessel wrote: > You can see the screen shots attached to the bugzilla. > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944 > > [ YOCTO #3944 ] Is the "Windriver" logo on the VGA example optional? ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] syslinux.bbclass: Add a default serial console option and real boot menu support
On 02/27/2013 05:51 AM, Trevor Woerner wrote: > On Tue, Feb 26, 2013 at 9:04 PM, Jason Wessel > wrote: >> You can see the screen shots attached to the bugzilla. >> >> https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944 >> >> [ YOCTO #3944 ] > Is the "Windriver" logo on the VGA example optional? The Wind River logo is purely an example. It is not actually included in the commit. If you build the commit I published you get what ever the internal splash that is part of isolinux. To be more specific, if you don't provide a SYSLINUX_SPLASH = "location of some lss file" in your local.conf you get the internal default which has nothing to do with Wind River's logo. I published an example to show that it can be done because other vendors would also likely want to include their own boot splash. Jason. ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] syslinux.bbclass: Add a default serial console option and real boot menu support
On 02/26/2013 06:04 PM, Jason Wessel wrote: The previous syslinux menu code did not support using both a serial and vga console, but this has worked for years in syslinux so there is no reason not to take advantage of it. The previous menu looked like: --- Linux Boot Menu The following targets are available on this image: boot: None install: None --- This commit makes it look something more like a traditional grub menu on both the serial console and vga console as well as providing the option to continue on using either the serial or vga console with the correct kernel arguments. You can see the screen shots attached to the bugzilla. https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944 [ YOCTO #3944 ] Signed-off-by: Jason Wessel --- meta/classes/syslinux.bbclass | 128 - 1 files changed, 49 insertions(+), 79 deletions(-) diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass index c4596bf..c6a5a15 100644 --- a/meta/classes/syslinux.bbclass +++ b/meta/classes/syslinux.bbclass @@ -11,15 +11,17 @@ # ${LABELS} - a list of targets for the automatic config # ${APPEND} - an override list of append strings for each label # ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited +# ${SYSLINUX_SPLASH} - A background for the vga boot menu if using the boot menu +# ${SYSLINUX_SERIAL} - Set an alternate serial port or turn off serial with empty string do_bootimg[depends] += "syslinux:do_populate_sysroot \ syslinux-native:do_populate_sysroot" SYSLINUXCFG = "${S}/syslinux.cfg" -SYSLINUXMENU = "${S}/menu" ISOLINUXDIR = "/isolinux" SYSLINUXDIR = "/" +SYSLINUX_SERIAL ?= "0 115200" ISO_BOOTIMG = "isolinux/isolinux.bin" ISO_BOOTCAT = "isolinux/boot.cat" MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table" @@ -34,82 +36,34 @@ syslinux_populate() { # Install the config files install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME} - if [ -f ${SYSLINUXMENU} ]; then - install -m 0644 ${SYSLINUXMENU} ${DEST}${BOOTDIR} - fi } syslinux_iso_populate() { syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR} + if [ x${AUTO_SYSLINUXMENU} = x1 ] ; then I believe that the convention is for these string tests to be quoted, here and below. + install -m 0644 ${STAGING_DIR}/${MACHINE}/usr/share/syslinux/vesamenu.c32 ${ISODIR}${ISOLINUXDIR}/vesamenu.c32 + if [ x${SYSLINUX_SPLASH} != x ] ; then + install -m 0644 ${SYSLINUX_SPLASH} ${ISODIR}${ISOLINUXDIR}/splash.lss + fi + fi } syslinux_hddimg_populate() { syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg install -m 0444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys + if [ x${AUTO_SYSLINUXMENU} = x1 ] ; then + install -m 0644 ${STAGING_DIR}/${MACHINE}/usr/share/syslinux/vesamenu.c32 ${HDDDIR}${SYSLINUXDIR}/vesamenu.c32 + if [ x${SYSLINUX_SPLASH} != x ] ; then + install -m 0644 ${SYSLINUX_SPLASH} ${HDDDIR}${SYSLINUXDIR}/splash.lss + fi + fi } syslinux_hddimg_install() { syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg } -python build_syslinux_menu () { -import copy -import sys - -workdir = d.getVar('WORKDIR', True) -if not workdir: -bb.error("WORKDIR is not defined") -return - -labels = d.getVar('LABELS', True) -if not labels: -bb.debug(1, "LABELS not defined, nothing to do") -return - -if labels == []: -bb.debug(1, "No labels, nothing to do") -return - -cfile = d.getVar('SYSLINUXMENU', True) -if not cfile: -raise bb.build.FuncFailed('Unable to read SYSLINUXMENU') - -try: -cfgfile = file(cfile, 'w') -except OSError: -raise bb.build.funcFailed('Unable to open %s' % (cfile)) - -# Beep the speaker and Clear the screen -cfgfile.write('\x07\x0C') - -# The title should be configurable -cfgfile.write('Linux Boot Menu\n') -cfgfile.write('The following targets are available on this image:\n') -cfgfile.write('\n') - -for label in labels.split(): -from copy import deepcopy -localdata = deepcopy(d) - -overrides = localdata.getVar('OVERRIDES') -if not overrides: -raise bb.build.FuncFailed('OVERRIDES not defined') -overrides = localdata.expand(overrides) - -localdata.setVar('OVERRIDES', label + ':' + overrides) -bb.data.update_data(localdata) - -usage = localdata.getVar('USAGE', True) -cfgfile.write(' \x0F\x30
Re: [OE-core] [PATCH] syslinux.bbclass: Add a default serial console option and real boot menu support
On 02/27/2013 07:52 PM, Saul Wold wrote: > On 02/26/2013 06:04 PM, Jason Wessel wrote: >> syslinux_iso_populate() { >> syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg >> install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin >> ${ISODIR}${ISOLINUXDIR} >> +if [ x${AUTO_SYSLINUXMENU} = x1 ] ; then > I believe that the convention is for these string tests to be quoted, > here and below. No problem. I'll fix that. Someone's mail server was hoarding mail for bulk delivery (I'll assume it was mine given the influx in the past 24 hours). I didn't get this until yesterday but it looks like it was sent last week. I'll send a v2 of the patch shortly. Cheers, Jason. ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core