Re: [PATCH v7 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64
Le Tue, May 2, 2017 à 9:06 AM, a écrit : > From: Fu Wei > > This patch adds the support of xen_boot command for aarch64: > xen_hypervisor > xen_module > These two commands are only for aarch64, since it has its own protocol and > commands to boot xen hypervisor and Dom0, but not multiboot. > > For other architectures, they are still using multiboot and module > commands. > > Signed-off-by: Fu Wei > --- > util/grub.d/20_linux_xen.in | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in > index c48af94..919 100644 > --- a/util/grub.d/20_linux_xen.in > +++ b/util/grub.d/20_linux_xen.in > @@ -122,16 +122,16 @@ linux_entry () > else > xen_rm_opts="no-real-mode edd=off" > fi > - multiboot ${rel_xen_dirname}/${xen_basename} placeholder > ${xen_args} \${xen_rm_opts} > + ${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder > ${xen_args} \${xen_rm_opts} > echo'$(echo "$lmessage" | grub_quote)' > - module ${rel_dirname}/${basename} placeholder > root=${linux_root_device_thisversion} ro ${args} > + ${module_loader}${rel_dirname}/${basename} placeholder > root=${linux_root_device_thisversion} ro ${args} > EOF >if test -n "${initrd}" ; then > # TRANSLATORS: ramdisk isn't identifier. Should be translated. > message="$(gettext_printf "Loading initial ramdisk ...")" > sed "s/^/$submenu_indentation/" << EOF > echo'$(echo "$message" | grub_quote)' > - module --nounzip ${rel_dirname}/${initrd} > + ${module_loader}--nounzip ${rel_dirname}/${initrd} > EOF >fi >sed "s/^/$submenu_indentation/" << EOF > @@ -206,6 +206,13 @@ while [ "x${xen_list}" != "x" ] ; do > if [ "x$is_top_level" != xtrue ]; then > echo " submenu '$(gettext_printf "Xen hypervisor, version %s" > "${xen_version}" | grub_quote)' \$menuentry_id_option > 'xen-hypervisor-$xen_version-$boot_device_id' {" > fi > +if [ "x$machine" != xaarch64 ]; then > Machine of grub-mkconfig doesn't necessarily match the kernel. Think of chroot or of having 32-bit userspace with 64-bit kernel. Better to do this on runtime. I know, it's not very nice but the whole grub-mkconfig is trouble that needs redesign that I'm working on. > + xen_loader="multiboot" > + module_loader="module" > +else > + xen_loader="xen_hypervisor" > + module_loader="xen_module" > +fi > while [ "x$list" != "x" ] ; do > linux=`version_find_latest $list` > gettext_printf "Found linux image: %s\n" "$linux" >&2 > -- > 2.9.3 > > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v2] grub-core/term/i386/coreboot/cbmemc.c: Update console format
Committed, thanks Le Tue, Apr 25, 2017 à 10:19 PM, Julius Werner a écrit : > Changed cbmemc to support updated console format from coreboot. > --- > grub-core/term/i386/coreboot/cbmemc.c | 50 > --- > 1 file changed, 35 insertions(+), 15 deletions(-) > > diff --git a/grub-core/term/i386/coreboot/cbmemc.c > b/grub-core/term/i386/coreboot/cbmemc.c > index 25e64a05c..436eda52a 100644 > --- a/grub-core/term/i386/coreboot/cbmemc.c > +++ b/grub-core/term/i386/coreboot/cbmemc.c > @@ -29,11 +29,14 @@ > > GRUB_MOD_LICENSE ("GPLv3+"); > > +#define CURSOR_MASK ((1 << 28) - 1) > +#define OVERFLOW (1 << 31) > + > struct grub_linuxbios_cbmemc > { >grub_uint32_t size; > - grub_uint32_t pointer; > - char data[0]; > + grub_uint32_t cursor; > + char body[0]; > }; > > static struct grub_linuxbios_cbmemc *cbmemc; > @@ -41,11 +44,20 @@ static struct grub_linuxbios_cbmemc *cbmemc; > static void > put (struct grub_term_output *term __attribute__ ((unused)), const int c) > { > + grub_uint32_t flags, cursor; >if (!cbmemc) > return; > - if (cbmemc->pointer < cbmemc->size) > -cbmemc->data[cbmemc->pointer] = c; > - cbmemc->pointer++; > + flags = cbmemc->cursor & ~CURSOR_MASK; > + cursor = cbmemc->cursor & CURSOR_MASK; > + if (cursor >= cbmemc->size) > +return; > + cbmemc->body[cursor++] = c; > + if (cursor >= cbmemc->size) > +{ > + cursor = 0; > + flags |= OVERFLOW; > +} > + cbmemc->cursor = flags | cursor; > } > > struct grub_terminfo_output_state grub_cbmemc_terminfo_output = > @@ -87,21 +99,29 @@ grub_cmd_cbmemc (struct grub_command *cmd > __attribute__ ((unused)), > int argc __attribute__ ((unused)), > char *argv[] __attribute__ ((unused))) > { > - grub_size_t len; > - char *str; > - struct grub_linuxbios_cbmemc *cbmemc_saved; > + grub_size_t size, cursor; > + struct grub_linuxbios_cbmemc *real_cbmemc; > >if (!cbmemc) > return grub_error (GRUB_ERR_IO, "no CBMEM console found"); > > - len = cbmemc->pointer; > - if (len > cbmemc->size) > -len = cbmemc->size; > - str = cbmemc->data; > - cbmemc_saved = cbmemc; > + real_cbmemc = cbmemc; >cbmemc = 0; > - grub_xnputs (str, len); > - cbmemc = cbmemc_saved; > + cursor = real_cbmemc->cursor & CURSOR_MASK; > + if (!(real_cbmemc->cursor & OVERFLOW) && cursor < real_cbmemc->size) > +size = cursor; > + else > +size = real_cbmemc->size; > + if (real_cbmemc->cursor & OVERFLOW) > +{ > + if (cursor > size) > +cursor = 0; > + grub_xnputs(real_cbmemc->body + cursor, size - cursor); > + grub_xnputs(real_cbmemc->body, cursor); > +} > + else > +grub_xnputs(real_cbmemc->body, size); > + cbmemc = real_cbmemc; >return 0; > } > > -- > 2.12.2 > > > ___ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: (GRUB) 2.02~beta2_Add_Feature
Le Wed, Apr 5, 2017 à 3:59 PM, esmaeel ensanimehr a écrit : > Hi > > I suggests adding a little feature to GRUB (GRUB) 2.02~beta2-36ubuntu3.8. > (i am using UBUNTU 16.04 LTS) > > in boot up selection menu add circular loop that can change between options > in circular way. > This was requested several times and rejected for good reason: imagine that you have no gfx output and trying to boot a second entry and don't know what current choice is. With current code you can press up many times, one down and enter. With circular, you're screwed > > for example > 1.option1 (UBUNTU 16.04) > 2. option2 (Win7) > 3. option3 (DOS) > > if press 3 times down key, reach to first option UBUNTU > and if press up key reach to option3 DOS (circular) as the default option > is 1. UBUNTU > > with best wishes and regards > > Esmaeel E > ___ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
How to build GRUB for `arm_coreboot`?
Dear GRUB folks, After the GRUB 2.02 release, φ-coder’s work to get GRUB working on ARM is now in the master branch. I like to try GRUB with the coreboot “board” *emulation/qemu-armv7 (QEMU ARMv7)*, and did the following under Debian Sid/unstable ``` $ git log --oneline -1 d11ced1e1 arm_coreboot: Support EHCI. $ ./autogen.sh […] $ ./configure --target=arm --with-platform=coreboot TARGET_CC=arm-linux-gnueabi-gcc-6 TARGET_OBJCOPY="arm-linux-gnueabi-objcopy" TARGET_STRIP="arm-linux-gnueabi-strip" TARGET_NM="arm-linux-gnueabi-nm" TARGET_RANLIB="arm-linux-gnueabi-ranlib" […] $ make -j […] if /usr/bin/makeinfo -I . \ -o grub.info grub.texi; \ then \ rc=0; \ CDPATH="${ZSH_VERSION+.}:" && cd .; \ else \ rc=$?; \ CDPATH="${ZSH_VERSION+.}:" && cd . && \ $restore $backupdir/* `echo "./grub.info" | sed 's|[^/]*$||'`; \ fi; \ rm -rf $backupdir; exit $rc make[2]: Verzeichnis „/dev/shm/grub/docs“ wird verlassen Making all in util/bash-completion.d make[2]: Verzeichnis „/dev/shm/grub/util/bash-completion.d“ wird betreten ../../config.status --file=grub:grub-completion.bash.in config.status: creating grub make[2]: Verzeichnis „/dev/shm/grub/util/bash-completion.d“ wird verlassen make[1]: Verzeichnis „/dev/shm/grub“ wird verlassen $ LANG=C make default_payload.elf make: *** No rule to make target 'default_payload.elf'. Stop. ``` I failed to adapt the command in the Makefile for arm_coreboot. ``` default_payload.elf: grub-mkstandalone grub-mkimage FORCE test -f $@ && rm $@ || true pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu all_video $(shell cat grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg ``` Passing `arm-coreboot` and `arm_coreboot` to the switch `-O` gives back an error, for example: ``` unknown target format arm_coreboot ``` Could you please tell me how to create the payload file? Thanks, Paul signature.asc Description: This is a digitally signed message part ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v7 1/3] arm64: add "--nounzip" option support in xen_module command
Hi Vladimir, On 9 May 2017 at 14:56, Vladimir 'phcoder' Serbinenko wrote: > > > Le Tue, May 2, 2017 à 9:06 AM, a écrit : >> >> From: Fu Wei >> >> This patch adds "--nounzip" option support in order to >> be compatible with the module command of multiboot on other architecture, >> by this way we can simplify grub-mkconfig support code. >> >> This patch also allow us to use zip compressed module(like Linux kernel >> "vmlinuz*" for Dom0). >> >> Signed-off-by: Fu Wei >> --- >> grub-core/loader/arm64/xen_boot.c | 17 + >> 1 file changed, 17 insertions(+) >> >> diff --git a/grub-core/loader/arm64/xen_boot.c >> b/grub-core/loader/arm64/xen_boot.c >> index a914eb8..0878364 100644 >> --- a/grub-core/loader/arm64/xen_boot.c >> +++ b/grub-core/loader/arm64/xen_boot.c >> @@ -20,6 +20,7 @@ >> #include >> #include >> #include >> +#include > > This looks like spurious hunk. Yes, we don't need this headfile to build xen_boot. will delete it Thanks, >> >> #include >> #include >> #include >> @@ -379,6 +380,20 @@ grub_cmd_xen_module (grub_command_t cmd >> __attribute__((unused)), >> >>struct xen_boot_binary *module = NULL; >>grub_file_t file = 0; >> + int nounzip = 0; >> + >> + if (!argc) >> +{ >> + grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); >> + goto fail; >> +} >> + >> + if (grub_strcmp (argv[0], "--nounzip") == 0) >> +{ >> + argv++; >> + argc--; >> + nounzip = 1; >> +} >> >>if (!argc) >> { >> @@ -403,6 +418,8 @@ grub_cmd_xen_module (grub_command_t cmd >> __attribute__((unused)), >> >>grub_dprintf ("xen_loader", "Init module and node info\n"); >> >> + if (nounzip) >> +grub_file_filter_disable_compression (); >>file = grub_file_open (argv[0]); >>if (!file) >> goto fail; >> -- >> 2.9.3 >> > -- Best regards, Fu Wei Software Engineer Red Hat ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v7 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64
Hi Vladimir On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko wrote: > > > Le Tue, May 2, 2017 à 9:06 AM, a écrit : >> >> From: Fu Wei >> >> This patch adds the support of xen_boot command for aarch64: >> xen_hypervisor >> xen_module >> These two commands are only for aarch64, since it has its own protocol and >> commands to boot xen hypervisor and Dom0, but not multiboot. >> >> For other architectures, they are still using multiboot and module >> commands. >> >> Signed-off-by: Fu Wei >> --- >> util/grub.d/20_linux_xen.in | 13 ++--- >> 1 file changed, 10 insertions(+), 3 deletions(-) >> >> diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in >> index c48af94..919 100644 >> --- a/util/grub.d/20_linux_xen.in >> +++ b/util/grub.d/20_linux_xen.in >> @@ -122,16 +122,16 @@ linux_entry () >> else >> xen_rm_opts="no-real-mode edd=off" >> fi >> - multiboot ${rel_xen_dirname}/${xen_basename} placeholder >> ${xen_args} \${xen_rm_opts} >> + ${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder >> ${xen_args} \${xen_rm_opts} >> echo'$(echo "$lmessage" | grub_quote)' >> - module ${rel_dirname}/${basename} placeholder >> root=${linux_root_device_thisversion} ro ${args} >> + ${module_loader}${rel_dirname}/${basename} placeholder >> root=${linux_root_device_thisversion} ro ${args} >> EOF >>if test -n "${initrd}" ; then >> # TRANSLATORS: ramdisk isn't identifier. Should be translated. >> message="$(gettext_printf "Loading initial ramdisk ...")" >> sed "s/^/$submenu_indentation/" << EOF >> echo'$(echo "$message" | grub_quote)' >> - module --nounzip ${rel_dirname}/${initrd} >> + ${module_loader}--nounzip ${rel_dirname}/${initrd} >> EOF >>fi >>sed "s/^/$submenu_indentation/" << EOF >> @@ -206,6 +206,13 @@ while [ "x${xen_list}" != "x" ] ; do >> if [ "x$is_top_level" != xtrue ]; then >> echo " submenu '$(gettext_printf "Xen hypervisor, version %s" >> "${xen_version}" | grub_quote)' \$menuentry_id_option >> 'xen-hypervisor-$xen_version-$boot_device_id' {" >> fi >> +if [ "x$machine" != xaarch64 ]; then > > Machine of grub-mkconfig doesn't necessarily match the kernel. Think of > chroot or of having 32-bit userspace with 64-bit kernel. Better to do this > on runtime. I know, it's not very nice but the whole grub-mkconfig is > trouble that needs redesign that I'm working on. So if we need to do this at run time(in grub shell), can I use "grub_cpu" variable instead? Thanks! >> >> + xen_loader="multiboot" >> + module_loader="module" >> +else >> + xen_loader="xen_hypervisor" >> + module_loader="xen_module" >> +fi >> while [ "x$list" != "x" ] ; do >> linux=`version_find_latest $list` >> gettext_printf "Found linux image: %s\n" "$linux" >&2 >> -- >> 2.9.3 >> > -- Best regards, Fu Wei Software Engineer Red Hat ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v7 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64
Hi Vladimir On 9 May 2017 at 17:02, Fu Wei wrote: > Hi Vladimir > > On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko > wrote: >> >> >> Le Tue, May 2, 2017 à 9:06 AM, a écrit : >>> >>> From: Fu Wei >>> >>> This patch adds the support of xen_boot command for aarch64: >>> xen_hypervisor >>> xen_module >>> These two commands are only for aarch64, since it has its own protocol and >>> commands to boot xen hypervisor and Dom0, but not multiboot. >>> >>> For other architectures, they are still using multiboot and module >>> commands. >>> >>> Signed-off-by: Fu Wei >>> --- >>> util/grub.d/20_linux_xen.in | 13 ++--- >>> 1 file changed, 10 insertions(+), 3 deletions(-) >>> >>> diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in >>> index c48af94..919 100644 >>> --- a/util/grub.d/20_linux_xen.in >>> +++ b/util/grub.d/20_linux_xen.in >>> @@ -122,16 +122,16 @@ linux_entry () >>> else >>> xen_rm_opts="no-real-mode edd=off" >>> fi >>> - multiboot ${rel_xen_dirname}/${xen_basename} placeholder >>> ${xen_args} \${xen_rm_opts} >>> + ${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder >>> ${xen_args} \${xen_rm_opts} >>> echo'$(echo "$lmessage" | grub_quote)' >>> - module ${rel_dirname}/${basename} placeholder >>> root=${linux_root_device_thisversion} ro ${args} >>> + ${module_loader}${rel_dirname}/${basename} placeholder >>> root=${linux_root_device_thisversion} ro ${args} >>> EOF >>>if test -n "${initrd}" ; then >>> # TRANSLATORS: ramdisk isn't identifier. Should be translated. >>> message="$(gettext_printf "Loading initial ramdisk ...")" >>> sed "s/^/$submenu_indentation/" << EOF >>> echo'$(echo "$message" | grub_quote)' >>> - module --nounzip ${rel_dirname}/${initrd} >>> + ${module_loader}--nounzip ${rel_dirname}/${initrd} >>> EOF >>>fi >>>sed "s/^/$submenu_indentation/" << EOF >>> @@ -206,6 +206,13 @@ while [ "x${xen_list}" != "x" ] ; do >>> if [ "x$is_top_level" != xtrue ]; then >>> echo " submenu '$(gettext_printf "Xen hypervisor, version %s" >>> "${xen_version}" | grub_quote)' \$menuentry_id_option >>> 'xen-hypervisor-$xen_version-$boot_device_id' {" >>> fi >>> +if [ "x$machine" != xaarch64 ]; then >> >> Machine of grub-mkconfig doesn't necessarily match the kernel. Think of >> chroot or of having 32-bit userspace with 64-bit kernel. Better to do this >> on runtime. I know, it's not very nice but the whole grub-mkconfig is >> trouble that needs redesign that I'm working on. > > So if we need to do this at run time(in grub shell), can I use > "grub_cpu" variable instead? Dose this patch make sense to you? diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..0c26cbb 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -122,16 +122,23 @@ linux_entry () else xen_rm_opts="no-real-mode edd=off" fi - multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} +if [ "x\$grub_cpu" != xarm64 ]; then +xen_loader="multiboot" +module_loader="module" +else +xen_loader="xen_hypervisor" +module_loader="xen_module" +fi +\${xen_loader} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} echo'$(echo "$lmessage" | grub_quote)' - module ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} +\${module_loader} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" sed "s/^/$submenu_indentation/" << EOF echo'$(echo "$message" | grub_quote)' - module --nounzip ${rel_dirname}/${initrd} +\${module_loader} --nounzip${rel_dirname}/${initrd} EOF fi sed "s/^/$submenu_indentation/" << EOF > > Thanks! > >>> >>> + xen_loader="multiboot" >>> + module_loader="module" >>> +else >>> + xen_loader="xen_hypervisor" >>> + module_loader="xen_module" >>> +fi >>> while [ "x$list" != "x" ] ; do >>> linux=`version_find_latest $list` >>> gettext_printf "Found linux image: %s\n" "$linux" >&2 >>> -- >>> 2.9.3 >>> >> > > > > -- > Best regards, > > Fu Wei > Software Engineer > Red Hat -- Best regards, Fu Wei Software Engineer Red Hat ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v6 2/2] Add a module for retrieving SMBIOS information
Hi, Bumping this thread, since it looks like new features are being applied again, and the patch still seems to apply cleanly. Is there still interest in this module? I didn't see any changes requested with v6, but let me know if you'd like me to resend it (or the small patch 1/2 for defining the UUID). Thanks. David ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v6 2/2] Add a module for retrieving SMBIOS information
Hi, from my side there is a big interest in this module. I use it to detect specific hardware platforms. Dependant on the hardware platforms there are several decisions in how to boot the kernel. Thats why I would be pleased if these two patches will be integrated into upstream grub2. Best regards, Dennis On 10.05.2017 03:34, David Michael wrote: > Hi, > > Bumping this thread, since it looks like new features are being > applied again, and the patch still seems to apply cleanly. Is there > still interest in this module? I didn't see any changes requested > with v6, but let me know if you'd like me to resend it (or the small > patch 1/2 for defining the UUID). > > Thanks. > > David > > ___ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel