PDA

View Full Version : Fix for Live USB boot in EFI mode (64 bits)



zebul666
2015-04-26, 23:25
hi.
So here is what I have used to sucessfully boot in EFI mode the Live USB key I have made. (The original boot did not worked at all (https://forums.kali.org/showthread.php?24894-Live-USB-with-EFI-not-working-(Kali-1-1-0a)&p=44413&viewfull=1#post44413). I had to boot in legacy BIOS mode)

Summary: We replace the broken syslinux boot with a grub EFI boot

TL;DR
Download and burn/use the efi patched kali iso (https://goo.gl/6lMQ2Y)

Step by step walkthrough to change Live USB

On the USB key, you have a second partition (ESP). Mount it if it is not already done
For example:

# mount /dev/sdc2 /mnt/kali

then

# cd /mnt/kali/EFI/BOOT
# rm -f *

We don't need any of the already existing file

then copy into that directory the following file BOOTX64.EFI (https://drive.google.com/uc?export=download&id=0B3Y5pC3gyeFWZ0xzZ1RMSWllQm8&authuser=0)

For the one not trusting that file, they can recreate it like I did on my Ubuntu 15.04 with this command:

# grub-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi --modules="part_gpt part_msdos iso9660 all_video efi_gop efi_uga video_bochs video_cirrus gfxterm gettext font" --fonts="unicode" --themes="" -o /mnt/kali/EFI/BOOT/BOOTX64.EFI --compress=gz "boot/grub/grub.cfg=/root/kali.cfg"
where the config file kali.cfg is the following:

# Config file for GRUB2 - The GNU GRand Unified Bootloader

set menu_color_normal=white/black
set menu_color_highlight=black/white

function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
fi
}

load_video
set gfxmode=auto
set gfxpayload=800x600

insmod font
font=unicode
loadfont $font

insmod gfxterm
insmod gettext

# Timeout for menu
set timeout=5

# Set default boot entry as Entry 0
set default=0
set color_normal=white/black

function find_root {
insmod part_gpt
insmod part_msdos
insmod iso9660
search --no-floppy --fs-uuid --set=root 2015-03-12-17-52-45-00
}

menuentry "Live (amd64)" {
find_root
linux /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali
initrd /live/initrd.img
}

menuentry "Live (amd64 failsafe)" {
find_root
linux /live/vmlinuz boot=live config memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal
initrd /live/initrd.img
}

menuentry "Live USB Persistence (check kali.org/prst)" {
find_root
linux /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali persistence
initrd /live/initrd.img
}

menuentry "Live USB Encrypted Persistence (check kali.org/prst)" {
find_root
linux /live/vmlinuz boot=live persistent=cryptsetup persistence-encryption=luks noconfig=sudo username=root hostname=kali persistence
initrd /live/initrd.img
}

menuentry "Live (forensic mode)" {
find_root
linux /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali noswap noautomount
initrd /live/initrd.img
}
#####
menuentry "Install" {
find_root
linux /install/vmlinuz vga=788 -- quiet
initrd /install/initrd.gz
}

menuentry "Graphical Install" {
find_root
linux /install/gtk/vmlinuz video=vesa:ywrap,mtrr vga=788 -- quiet
initrd /install/gtk/initrd.gz
}

menuentry "Install with speech synthesis" {
find_root
linux /install/gtk/vmlinuz video=vesa:ywrap,mtrr vga=788 speakup.synth=soft -- quiet
initrd /install/gtk/initrd.gz
}

this file is an adaptation fo the boot file used by the original syslinux kali. If you don't use Ubuntu 15.04, you may have to make some adjustement to the grub-mkstandalone command above

Then

# umount /mnt/kali

And reboot!

TODO: Use a graphical background with the original splash.png

zebul666
2015-06-08, 13:01
For your convenience, I have made a modified iso of kali 1.1.0a amd64 (https://goo.gl/6lMQ2Y) (md5sum: 5ecb2f838b675597ba918c6475d5c91e) that include the fix discussed above.

Only the ESP partition on the iso has been changed. I have touched nothing on the kali partition. You can check that for yourself.

Explanation:
Basically what I have done is not even regenerate a new iso but modify it ! Yes, I didn't think it was possible but it is after all.

Run

kpartx -a kali-linux-1.1.0a-amd64.iso
Then you should have 2 loop0p? under /dev/mapper. Mount the second one which is the ESP.

mount /dev/mapper/loop0p2 /mnt/loop
cd /mnt/loop/EFI/BOOT
rm -f *
and add the BOOTX64.EFI above.


cp /somewhere/BOOTX64.EFI BOOTX64.EFI
cd -
umount /mnt/loop
kpartx -d kali-linux-1.1.0a-amd64.iso

and you can burn the iso...

soxrok2212
2015-07-17, 23:51
For your convenience, I have made a modified iso of kali 1.1.0a amd64 (https://goo.gl/6lMQ2Y) (md5sum: 5ecb2f838b675597ba918c6475d5c91e) that include the fix discussed above.

Only the ESP partition on the iso has been changed. I have touched nothing on the kali partition. You can check that for yourself.

Explanation:
Basically what I have done is not even regenerate a new iso but modify it ! Yes, I didn't think it was possible but it is after all.

Run

kpartx -a kali-linux-1.1.0a-amd64.iso
Then you should have 2 loop0p? under /dev/mapper. Mount the second one which is the ESP.

mount /dev/mapper/loop0p2 /mnt/loop
cd /mnt/loop/EFI/BOOT
rm -f *
and add the BOOTX64.EFI above.


cp /somewhere/BOOTX64.EFI BOOTX64.EFI
cd -
umount /mnt/loop
kpartx -d kali-linux-1.1.0a-amd64.iso

and you can burn the iso...

I'm trying this right now. I just bought the 2015 Retina MacBook Pro with the dedicated graphics card (I specifically bought this model to use with oclHashcat) and I've been trying for almost 7 hours to get Kali to install. I've tried 1.0.9a, 1.1.0a, and I've tried about 1,000 different ways to install. Hopefully this works, and I presume it will because the errors I was receiving pertained to legacy booting.

So anyways, thanks in advance!

UPDATE: This didn't work for me unfortunately. I believe it is a problem with refind because i tried the exact same method on my 2012 MacBook Pro and it worked fine.

artistlogic
2015-08-05, 14:24
I tried simply creating the USB using the above ISO, and it did not work for me, but if I'm not mistaken this is due to there not being a /EFI/BOOT directory for the *.efi ? I'd really like to revive this thread as I've been trying my damnedest to get kali to boot on this uefi only machine (no legacy boot option) and just cannot do it. The closest I've gotten is a grub terminal...

Asus X205TA (Baytrail)

Rentboy
2016-11-16, 14:25
For your convenience, I have made a modified iso of kali 1.1.0a amd64 (https://goo.gl/6lMQ2Y) (md5sum: 5ecb2f838b675597ba918c6475d5c91e) that include the fix discussed above.

Only the ESP partition on the iso has been changed. I have touched nothing on the kali partition. You can check that for yourself.

Explanation:
Basically what I have done is not even regenerate a new iso but modify it ! Yes, I didn't think it was possible but it is after all.

Run

kpartx -a kali-linux-1.1.0a-amd64.iso
Then you should have 2 loop0p? under /dev/mapper. Mount the second one which is the ESP.

mount /dev/mapper/loop0p2 /mnt/loop
cd /mnt/loop/EFI/BOOT
rm -f *
and add the BOOTX64.EFI above.


cp /somewhere/BOOTX64.EFI BOOTX64.EFI
cd -
umount /mnt/loop
kpartx -d kali-linux-1.1.0a-amd64.iso

and you can burn the iso...

I am trying to Install Kali on my USB having the same problems.. Do I do these steps on terminal mac?