Difference between revisions of "Talk:UEFI Bootloaders"

From ArchWiki
Jump to: navigation, search
(Why rename)
(comment on new mkinitcpio scripts)
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== <s> gummiboot </s> ==
+
== Incorrect instructions ==
and gummiboot ?
+
[http://www.phoronix.com/scan.php?page=news_item&px=MTEzODY]
+
--[[User:NTia89|nTia89]] ([[User talk:NTia89|talk]]) 17:14, 15 July 2012 (UTC)
+
:Direct link to its page: http://freedesktop.org/wiki/Software/gummiboot -- [[User:Karol|Karol]] ([[User talk:Karol|talk]])
+
:: Added. Close. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 05:39, 11 September 2012 (UTC)
+
  
== Why rename ==
+
Hi,
Why was this added to the refind instructions?
+
  
4. Rename /boot/efi/EFI/arch/refind/refind_x64.efi to /boot/efi/EFI/arch/refind/refindx64.efi
+
I have already posted some information on the Forums, but since this is the way to go, I'm posting my thoughts here.
  
https://wiki.archlinux.org/index.php?title=UEFI_Bootloaders&diff=201731&oldid=201727
+
The Wiki's says the following about rEFInd:
 +
''"Note: As of refind-efi 0.6.5, refind now automatically detects kernels in /boot. They do not have to be renamed to have a .efi extension either. Hence, the following sync scripts aren't needed if using refind."''
  
--[[User:Litemotiv|Litemotiv]] ([[User talk:Litemotiv|talk]]) 08:06, 9 September 2012 (UTC)
+
But how it is possible for rEFInd to scan the /boot directory? When booting rEFInd, only the dirs inside \EFI are readable for rEFInd. I have tested this and I confirm that rEFInd can't scan /boot until it is mounted by fstab. (the actual booting process). The sync scripts seems to be needed, to successfully boot Arch.
  
I had a minor issue with UEFI Shell not launching EFI files with underscore in their file name a long time back. It does not seem to exist now. It actually doesn't matter. But extra/refind-efi-x86_64 uses refindx64.efi (again my mistake). In any case it doesn't matter. -- [[User:The.ridikulus.rat|Keshav P R]] ([[User talk:The.ridikulus.rat|talk]]) 13:25, 11 September 2012 (UTC)
+
 
 +
As for '''Systemd Automation''' script, I find the following line a little bit weird:
 +
''cp -r /usr/{share/refind/*,lib/refind/*$arch*} $refind_dir/  && ## update bin and dirs''
 +
 
 +
Should it not be: cp -r {/usr/share/refind/*,/lib/refind/refind_x*$arch*.efi} $refind_dir/  && ## update bin and dirs ?
 +
Only the file refind_x*ARCH*, is needed for the /lib directory.
 +
 
 +
 
 +
Also I would like to see instructions how to add a custom boot entry (if needed/other location). They are documented inside rEFInd, but not on the Wiki.
 +
menuentry "Arch Linux" {
 +
    icon /EFI/refind/icons/os_arch.icns
 +
    loader /EFI/arch/vmlinuz-arch.efi
 +
    initrd /EFI/arch/initramfs-arch.img
 +
    options "root=PARTUUID=xx rootfstype=ext4 ro add_efi_memmap systemd.unit=graphical.target"
 +
}
 +
 
 +
menuentry "Arch Linux Fallback" {
 +
    icon /EFI/refind/icons/os_arch.icns
 +
    loader /EFI/arch/vmlinuz-arch.efi
 +
    initrd /EFI/arch/initramfs-arch-fallback.img
 +
    options "root=PARTUUID=xx rootfstype=ext4 ro add_efi_memmap systemd.unit=multi-user.target"
 +
}
 +
 
 +
 
 +
Thanks
 +
 
 +
[[User:Beta990|Beta990]] ([[User talk:Beta990|talk]]) 11:11, 28 January 2013 (UTC)
 +
 
 +
 
 +
== Issue with the Systemd Automation script ==
 +
 
 +
Beta990 has some reason questioning the '''Systemd Automation''' script's line:
 +
  cp -r /usr/{share/refind/*,lib/refind/*$arch*} $refind_dir/  && ## update bin and dirs
 +
As it is on the wiki, it just prints this when launched:
 +
  /usr/lib/systemd/scripts/refind_name_patchv2: ligne31: « update-efi-dir » : identifiant non valable
 +
[in English: unvalid identifier].
 +
Unfortunately editing that single line as follow changes nothing:
 +
  cp -r /usr/{share/refind/*,lib/refind/refind_*$arch*.efi} $refind_dir/ && ## update bin and dirs
 +
 
 +
Next in the wiki, there might be a typo at the end of the systemctl command (see the « ; »):
 +
  Tip: Enable the systemd path unit by running :
 +
  # systemctl enable refind_update.path;
 +
[[User:Kozaki|kozaki]] ([[User talk:Kozaki|talk]]) 23:31, 3 February 2013 (UTC)
 +
 
 +
 
 +
== MKinitcpio update hook not working ==
 +
 
 +
The mkinitcpio auto-update hook does not work. I get the following output: "Synced  to /boot/efi/EFI/arch", along with some cp errors. Obviously, the parameters are not passed.
 +
 
 +
If i replace the script with the static cp commands from incron, i get the following output, indicating that the image is copied BEFORE the new one is written:
 +
 
 +
      -> Running build hook: [efistub-update]
 +
    Synced new kernel and initrd to EFIStub.
 +
    ==> Generating module dependencies
 +
    ==> Creating gzip initcpio image: /boot/initramfs-linux.img
 +
    ==> Image generation successful
 +
 
 +
As a result, my scripts now look as follows:
 +
 
 +
    /usr/lib/initcpio/install/efistub-update   
 +
----
 +
    #!/bin/sh
 +
   
 +
    build() {
 +
        /usr/local/sbin/efistub-update &
 +
    }
 +
   
 +
    help() {
 +
        cat <<HELPEOF
 +
    This hook simply waits for mkinitcpio to finish and copies the finished ramdisk and kernel to UEFI
 +
    HELPEOF
 +
    }
 +
 
 +
and
 +
 
 +
    /usr/local/sbin/efistub-update
 +
----
 +
    #!/bin/sh
 +
   
 +
    while [ [ -d "/proc/$PPID" ]]; do
 +
        sleep 1
 +
    done
 +
   
 +
    /bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/EFIStub/vmlinuz-arch.efi
 +
    /bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/EFIStub/initramfs-arch.img
 +
    /bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/EFIStub/initramfs-arch-fallback.img
 +
   
 +
    echo "Synced new kernel and initrd to EFIStub."
 +
 
 +
 
 +
 
 +
Also, the watch.sh does not get chmod +x'ed in the existing example.
 +
 
 +
--[[User:Denoyse|Denoyse]] ([[User talk:Denoyse|talk]]) 16:08, 15 February 2013 (UTC)
 +
 
 +
== Mkinitcpio update hook inefficiency ==
 +
 
 +
I updated the scripts reflecting [[User:Denoyse|Denoyse's]] suggestions, but the scripts still copy all of the files twice: first after building the regular image and again after building the fallback image. Is there a way to make it only run once, or to have different hooks for each image?
 +
 
 +
[[User:Silverhammermba|Silverhammermba]] ([[User talk:Silverhammermba|talk]]) 04:14, 1 March 2013 (UTC)

Revision as of 04:14, 1 March 2013

Incorrect instructions

Hi,

I have already posted some information on the Forums, but since this is the way to go, I'm posting my thoughts here.

The Wiki's says the following about rEFInd: "Note: As of refind-efi 0.6.5, refind now automatically detects kernels in /boot. They do not have to be renamed to have a .efi extension either. Hence, the following sync scripts aren't needed if using refind."

But how it is possible for rEFInd to scan the /boot directory? When booting rEFInd, only the dirs inside \EFI are readable for rEFInd. I have tested this and I confirm that rEFInd can't scan /boot until it is mounted by fstab. (the actual booting process). The sync scripts seems to be needed, to successfully boot Arch.


As for Systemd Automation script, I find the following line a little bit weird: cp -r /usr/{share/refind/*,lib/refind/*$arch*} $refind_dir/ && ## update bin and dirs

Should it not be: cp -r {/usr/share/refind/*,/lib/refind/refind_x*$arch*.efi} $refind_dir/ && ## update bin and dirs ? Only the file refind_x*ARCH*, is needed for the /lib directory.


Also I would like to see instructions how to add a custom boot entry (if needed/other location). They are documented inside rEFInd, but not on the Wiki. menuentry "Arch Linux" {

   icon /EFI/refind/icons/os_arch.icns
   loader /EFI/arch/vmlinuz-arch.efi
   initrd /EFI/arch/initramfs-arch.img
   options "root=PARTUUID=xx rootfstype=ext4 ro add_efi_memmap systemd.unit=graphical.target"

}

menuentry "Arch Linux Fallback" {

   icon /EFI/refind/icons/os_arch.icns
   loader /EFI/arch/vmlinuz-arch.efi
   initrd /EFI/arch/initramfs-arch-fallback.img
   options "root=PARTUUID=xx rootfstype=ext4 ro add_efi_memmap systemd.unit=multi-user.target"

}


Thanks

Beta990 (talk) 11:11, 28 January 2013 (UTC)


Issue with the Systemd Automation script

Beta990 has some reason questioning the Systemd Automation script's line:

 cp -r /usr/{share/refind/*,lib/refind/*$arch*} $refind_dir/  && ## update bin and dirs

As it is on the wiki, it just prints this when launched:

 /usr/lib/systemd/scripts/refind_name_patchv2: ligne31: « update-efi-dir » : identifiant non valable

[in English: unvalid identifier]. Unfortunately editing that single line as follow changes nothing:

 cp -r /usr/{share/refind/*,lib/refind/refind_*$arch*.efi} $refind_dir/ && ## update bin and dirs

Next in the wiki, there might be a typo at the end of the systemctl command (see the « ; »):

 Tip: Enable the systemd path unit by running :
 # systemctl enable refind_update.path;

kozaki (talk) 23:31, 3 February 2013 (UTC)


MKinitcpio update hook not working

The mkinitcpio auto-update hook does not work. I get the following output: "Synced to /boot/efi/EFI/arch", along with some cp errors. Obviously, the parameters are not passed.

If i replace the script with the static cp commands from incron, i get the following output, indicating that the image is copied BEFORE the new one is written:

     -> Running build hook: [efistub-update]
   Synced new kernel and initrd to EFIStub.
   ==> Generating module dependencies
   ==> Creating gzip initcpio image: /boot/initramfs-linux.img
   ==> Image generation successful

As a result, my scripts now look as follows:

   /usr/lib/initcpio/install/efistub-update    

   #!/bin/sh
   
   build() {
       /usr/local/sbin/efistub-update &
   }
   
   help() {
       cat <<HELPEOF
   This hook simply waits for mkinitcpio to finish and copies the finished ramdisk and kernel to UEFI
   HELPEOF
   }

and

   /usr/local/sbin/efistub-update

   #!/bin/sh
   
   while [ [ -d "/proc/$PPID" ]]; do
       sleep 1
   done
   
   /bin/cp -f /boot/vmlinuz-linux /boot/efi/EFI/EFIStub/vmlinuz-arch.efi
   /bin/cp -f /boot/initramfs-linux.img /boot/efi/EFI/EFIStub/initramfs-arch.img
   /bin/cp -f /boot/initramfs-linux-fallback.img /boot/efi/EFI/EFIStub/initramfs-arch-fallback.img
   
   echo "Synced new kernel and initrd to EFIStub."


Also, the watch.sh does not get chmod +x'ed in the existing example.

--Denoyse (talk) 16:08, 15 February 2013 (UTC)

Mkinitcpio update hook inefficiency

I updated the scripts reflecting Denoyse's suggestions, but the scripts still copy all of the files twice: first after building the regular image and again after building the fallback image. Is there a way to make it only run once, or to have different hooks for each image?

Silverhammermba (talk) 04:14, 1 March 2013 (UTC)