Giter Club home page Giter Club logo

arch-efiboot's Introduction

EFI-bootable kernel image builder for Arch Linux

Linux supports EFISTUB booting, where the UEFI can load the kernel directly without any bootloader. This can be done by setting up the boot entries with efibootmgr command (https://wiki.archlinux.org/index.php/EFISTUB). The problem is that some systems (like Dell XPS laptops) doesn't support passing kernel command line arguments. This results in failing to boot.

This script builds single-file bootable efi modules, which includes the kernel, command line strings, initramfs and microcode.

EFISTUB booting should not have any negative consequences to anything (hibernation, power management, etc). For my Dell XPS 9560, everything works just fine.

How it works

Objcopy can be used to merge all the files in single bootable image. See https://wiki.archlinux.org/index.php/systemd-boot, section "Preparing kernels for /EFI/Linux" for more details. You do not have to use systemd-boot for this to work.

If you have multiple initrds (ucode and initramfs), then you have to concatenate them to a single file before embedding.

The problem remaining is that this manually builds the kernel, but does not run if you update. Here is where the pacman hooks come handy. It is possible to set up hooks for updating the kernels or the microcode and run the build script automatically (see kernel-update.hook).

How to install

AUR

Note: this method is only suited for systems with EFI partition mounted as /boot (as recommended in https://wiki.archlinux.org/index.php/EFI_system_partition) and with kernels installed there. For other setups, see manual installation instructions.

Install the AUR package.

Manual installation

Download the repository onto your system.

If your EFI partition is mounted as /boot and your kernels are installed there, run

sudo install.sh

If not, please edit build_kernel.sh and install it manually. You can do it by running

cp build_kernel.sh to /opt
mkdir -p /etc/pacman.d/hooks/
cp kernel-update.hook /etc/pacman.d/hooks

EFI boot entries

When completed, you can use efibootmgr to setup the boot item, or your BIOS settings might have an option to chose the file from the ESP partition (as with Dell XPS 9560). It works either way.

Custom command line parameters

By default, when you run the script, it extract your current kernel command line to /boot/cmdline.txt. Change it and rerun to include the new paramters. If the file exists, it will not overwrite it.

It is also possible to have different command lines for different kernels. You can do this by placing cmdline-.txt in your /boot folder, where the is the part after "vmlinuz-" of your kernel. For example for vmlinuz-linux it is cmdline-linux.txt, for vmlinuz-linux-lts it is cmdline-linux-lts.txt.

arch-efiboot's People

Contributors

julienfalque avatar khuedoan avatar robertcsordas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arch-efiboot's Issues

/usr/bin/build_efi_kernels: line 17: /tmp/initrd.bin: Permission denied

Hi, I'm trying to run the script after running mkinitcpio manually, but I get the following error:

/usr/bin/build_efi_kernels: line 17: /tmp/initrd.bin: Permission denied

I have no idea why this is, I'm running the script as root. FYI I installed the AUR package. Any help would be appreciated.

systemd

i am new to arch and learning everyday.

when the kernel and ucode updates, the hook works.

i noticed that when systemd updates, the bootup screen still have the older systemd version. I like to have everything to the latest and greatest version.

i added Target=systemd to the hook.

[Trigger]
Type = Package
Operation = Upgrade
Operation = Install
Target = linux*
Target = intel-ucode
Target = systemd

should this be added to your github project?

$INITRDFILE value without intel-ucode

Hello here :)
It's work great and you script help me to be able to bootstub with my laptop.
i think they have a error,
if "intel-ucode.img" is not found $INITRDFILE must be $INITRD

if [ -f "$UCODE" ]; then
	cat "$UCODE" "$INITRD" > /tmp/initrd.bin
	INITRDFILE=/tmp/initrd.bin
else
	# Do not fail on AMD systems
	echo "    Intel microcode not found. Skipping."
	###INITRDFILE="$UCODE"
	INITRDFILE="$INITRD"
fi

and if i have true you can write like this :

INITRDFILE="$INITRD"
if [ -f "$UCODE" ]; then
	cat "$UCODE" "$INITRD" > /tmp/initrd.bin
	INITRDFILE=/tmp/initrd.bin
fi

If I use this approach, will I need to re-run it on occasion?

Hi there,

I have an XPS 9380 coming in the mail soon, and I'd certainly consider using EFISTUB in this manner as directed. After everything's working, in the event of (a) a kernel update, or (b) re-running mkinitcpio, do I need to re-run this script every time?

-Brandon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.