2

I work with a free/open source project. A Debian maintainer reported a failure under X32 (not a typo; its not X86), and I'm trying to set up a test environment to reproduce it.

According Debian's X32 Ports wiki, I need to enable the X32 extensions in the kernel. To do that, I need to add the Grub entry. Below is what I added to /etc/default/grub, and its taken from the wiki page (except I commented the default entry).

# GRUB_CMDLINE_LINUX_DEFAULT="syscall.x32=y quiet"
GRUB_CMDLINE_LINUX="syscall.x32=y"

I then performed an update-grub per the wiki page and verified the entries in the compiled menu (see below).

When I boot the system, the option does not appear to be available under the main menu or the advanced options:

Missing Grub entry for X32

Debian's Grub2 docs leaves a lot to be desired. It only discusses how to colorize menu entries (you can't make this sort of stuff up...).

I expected the following after following the prescription provided by the docs:

  • Debian GNU/Linux
  • Debian GNU/Linux (X32)
  • Advanced options
  • Memory test (memtest86+)
  • Memory test (memtest86+, serial)
  • ...

How do I add X32 boot options to Grub, give it a name like "Debian GNU/Linux (X32)", ensure its a boot option for the kernel during boot, and ensure the changes survive after an upgrade or dist-upgrade?


According to Marius's answer below, I added the following to /etc/grub.d/40_custom:

menuentry 'Debian GNU/Linux (X32)' --class debian --class gnu-linux --class gnu --class os
  $menuentry_id_option 'gnulinux-simple-a4af7dfc-640c-4aa8-bf0b-068af3d72b01' {
    linux/boot/vmlinuz-4.2.0-1-amd64 root=UUID=a4af7dfc-640c-4aa8-bf0b-068af3d72b01 ro syscall.x32=y quiet
}

It provides the named entry as expected, but it results in a boot error:

error: can't find command: `linux/boot/vmlinuz-4`

I think that was due to copy/paste in Emacs (it apparently removes whitespace???). So I changed it to linux /boot/vmlinuz-4.2.0-1-amd64.... It resulted in a kernel panic:

enter image description here

1

You could add foo=bar at grub

From a terminal run:

gksudo gedit /etc/default/grub

and enter your password.

Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and append foo=bar to its end. For example:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash foo=bar"

Save the file and close the editor.

Finally, start a terminal and run:

sudo update-grub

to update GRUB's configuration file (you probably need to enter your password).

On the next reboot, the kernel should be started with the boot parameter

Source : Grub forums

  • Thanks BlueBerry. I set up a second VM with the syscall.x32=y option always in effect. The Debian docs on GRUB don't tell us how to add a second, persistent entry with different options from the default ones. Can you tell me how to add a second, persistent entry that survives GRUB updates (i.e., when /etc/default/grub gets over written by the distro)? If so, I'd be happy to accept. – jww Sep 21 '15 at 7:02
1

If I have understood you right, you want to find a way to choose whether to boot with/out X32. You can do it in two distinct ways:

  1. As need arises. Boot, at the boot menu hit e for edit, scroll down to the line

    linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff quiet splash
    

and modify it to

  linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff syscall.x32=y quiet 

Now continue booting.

  1. Systematically. In the directory /etc/grub.d/ there is an entry, 40_custom, which is used exactly for this. You will have to copy in it a section of the file /boot/grub/grub.cfg: the part included between menuentry Debian GNU/Linux... and the end of the breaces, }. After inclusion, modify the line

     linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff quiet splash
    

into

     linux /boot/vmlinuz-linux root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff syscall.x32=y quiet

Also, remember to change the name of the menuentry, in 40_custom to something different from your first entry, otherwise you will not be able to distinguish the two entries.

Run update-grub and you are done.

  • Thanks Marius. "...If I have understood you right..." - here is what I am trying to do. They are the requirements phrased as a question: "How do I add X32 boot options to Grub, give it a name like "Debian GNU/Linux (X32)", ensure its a boot option for the kernel during boot, and ensure the changes survive after an upgrade or dist-upgrade?" – jww Oct 7 '15 at 15:30
  • Well, I've been trying to figure out exactly must be copied from /boot/grub/grub.cfg and pasted into /etc/grub.d/40_custom. grub.cfg is very busy, each menuentry contains non-trivial scripting, and I'm not sure I am doing things correctly. Does Debian provide a clear and concise reference somewhere for this? I can't believe its this damn difficult... – jww Oct 7 '15 at 15:44
  • @jww if you boot your machine, hit <kbd>e</kbd> when the Grub menu appears, you will find in front of you the standard menuentry that starts your system, without the fluff. That's the one you want to copy: pencil and paper... – MariusMatutiae Oct 7 '15 at 15:48
  • Now I'm getting a kernel panic.... At this point, I think I am going to abandon this quest because I can't find clear and concise references or answers. I even asked on the Debian mailing lists (with no replies). There's no sense it continuing to aggravate myself, and I can create a second Debian 8 VM with syscall.x32=y. Thanks for trying. – jww Oct 7 '15 at 16:26
1

If you want the option just for the latest kernel in the top level menu, do not put "syscall.x32=y" in /etc/default/grub. Instead, find

linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"

in /etc/grub.d/10_linux and add this after it:

linux_entry "${OS} (X32)" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} syscall.x32=y"

Then run update-grub to update /boot/grub/grub.cfg accordingly.

This way I could boot the latest kernel with "syscall.x32=y" option, but I don't notice difference to booting without it. That is in Xubuntu 15.10 64-bit. As for the configration surviving after grub package upgrade, I don't know; maybe installation notices a customized configuration file and gives you an option to keep it. At least this survives kernel updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.