Replace HP QuickLook with a custom bootloader

Some of you probably noticed a little button next to the power button in some HP laptops. How many of you actually found out what it’s for? On Windows, as long as all the drivers are installed, it opens a window that’s not really useful. On Linux (unless somebody has figured out some way to use it), it does nothing. But when the PC is off some sort of thing called QuickLook comes out after about 10 seconds. For who doesn’t know what it’s for, it’s supposed to be combined with Microsoft Outlook. It installs a plug-in into it and emails, calendars and contacts can be viewed quickly even when the PC is off (kinda).

From a technical point of view, what happens when you press the QuickLook button is this:

  • The firmware is loaded and hardware is initialized as usual, but the screen stays blank.
  • The firmware then looks for a FAT32 partition named “HP_TOOLS”.
  • The firmware runs an EFI executable: “(HP_TOOLS)/Hewlett-Packard/QuickLook/QuickLook.efi”

Interestingly enough there’s a QuickLook.sig file in the same directory, which I suppose is a public key or something like that (I haven’t checked), but it doesn’t complain too much if it doesn’t exist, it just runs the EFI executable and that’s it, or at least it does so on my HP ProBook 4510s with a really poor EFI implementation (no Secure Boot). Probably the signature is checked in newer models.

Now this feature is really cool and useful, but it doesn’t help very much if you’re not running Windows, or if you are but you’re using another mail client. There are better things we can do with that button.

All we need to do is install an OS that will be loaded when that button is pressed. The only requirement (unless you find an alternative) is to have a GNU/Linux distro already installed (it can be the one you want to boot with that button), UEFI enabled from firmware settings and possibly a GUID partition table (GPT).

Note: my HP ProBook 4510s doesn’t boot if the hard disk has a GPT partition table and UEFI is not already enabled from firmware settings. Enable UEFI first and change your partition table afterwards. There are guides on how to convert MBR to GPT, and other guides on how to switch from MBR GRUB to EFI GRUB on GNU/Linux OSes.

I’m using Ubuntu 14.04 as main OS and Android x86 KitKat as QuickLook OS. There are guides on how to install Android on a GPT partition table, but basically you just install it on an MBR USB drive then copy its files to another ext formatted partition in the main hard drive; you can find the bootloader configuration with the kernel command lines in the android-x86-version directory in the USB drive.

Note: I noticed that when booting Linux through QuickLook (e.g. you use GRUB as QuickLook bootloader and then boot Ubuntu), the efivars module cannot be loaded. This causes some init daemons (like Ubuntu’s Upstart) to hang and wait for the user to make a decision. It doesn’t happen on Android, which does not really care about running on an EFI system. I haven’t tried to skip the user input prompt; however, if you need to edit your NVRAM through efibootmgr make sure you boot your computer normally.

Steps

  1. Install your QuickLook OS. You can use any OS the GRUB bootloader can boot.
  2. Run your GNU/Linux distro, make sure the GRUB package is installed and the efivars module is loaded, otherwise it will install an MBR GRUB. Read your distro’s documentation if you don’t know how to do this.
  3. Using GParted or any other partitioning tool, create a new FAT30, 200 MB big (or larger) and name it “HP_TOOLS”, without quotes, case-sensitive. It can be in any position in the hard disk, as long as it’s primary.
  4. Create a new directory in /boot and mount your new partition there. Add an entry to your /etc/fstab to do this automatically,

    You can find your partition’s UUID with the blkid command (run it as root).
    Run mount -a as root to mount all the volumes in the fstab.
  5. Run, as root:

    You might want to edit temporarily /etc/default/grub before running grub-mkconfig, set GRUB_TIMEOUT to 0, GRUB_HIDDEN_TIMEOUT to 1 and GRUB_HIDDEN_TIMEOUT_QUIET to true to set GRUB to boot directly the first OS. You can change it back afterwards if you have another installation of GRUB.
  6. Edit /boot/hp/grub/grub.cfg as root. Remove all the menuentries that are not needed (at the end of the file); make sure the entry you want to boot is the first one. You may want to add yours if it was not detected by os-prober (there are guides on how to do so).
  7. If you previously installed QuickLook, rename QuickLook.efi and QuickLook.sig to something else.
  8. Move /boot/hp/EFI/grub/grubx86.efi (the path may slightly change based on your distro) to /boot/hp/Hewlett-Packard/QuickLook/QuickLook.efi (create missing directories)

Done! Turn your computer off (do not reboot it). Press the QuickLook button. Your OS should boot. If it doesn’t, press the Esc button to stop GRUB and show the boot menu to see what’s wrong.

Thanks for reading! 🙂 If you had troubles following this guide, have a suggestion or simply want to let me know what do you think of it, add a comment below! 😉

See also:

(sponsored)

There is a mobile optimized version of this page, view mobile Version.

Leave a Reply