In a previous blog post, I described how you could MBR-boot to android x86 with a persistence file.
To UEFI-boot, we need to create a FAT32 .imgPTN partition image. However, this limits us to a <4GB data.img persistence file.
Here is how to have a >4GB persistence file and UEFI-boot by using an NTFS partition to hold the android boot files and persistence file.
I used android-x86-4.4-r5.iso for this.
android_FAT32
android_NTFS
2. Extract the contents of android-x86-4.4-r5.iso to the android_NTFS folder (e.g. using 7zip)
3. Copy the android_NTFS\boot folder from the android_NTFS folder to the android_FAT32 folder
4. Copy the android_NTFS\efi folder from the android_NTFS folder to the android_FAT32 folder
5. Create a android_FAT32\boot\grub\x86_64-efi folder
6. Find a Ubuntu ISO (or other linux ISO that uses grub2) and copy the \boot\grub\x86_64-efi\ntfs.mod file to the android_FAT32\boot\grub\x86_64-efi folder
7. Edit the android_FAT32\boot\grub\grub.cfg file to add the line in red below:
set timeout=30
insmod ntfs
menuentry 'Android-x86 4.4-r5 Live' --class android-x86 {
search --file --no-floppy --set=root /system.sfs
linux /kernel root=/dev/ram0 androidboot.hardware=android_x86 quiet DATA=
initrd /initrd.img
}
menuentry 'Android-x86 4.4-r5 DEBUG mode' --class android-x86 {
search --file --no-floppy --set=root /system.sfs
linux /kernel root=/dev/ram0 androidboot.hardware=android_x86 DATA= DEBUG=2
initrd /initrd.img
}
menuentry 'Android-x86 4.4-r5 Installation' --class android-x86 {
search --file --no-floppy --set=root /system.sfs
linux /kernel root=/dev/ram0 androidboot.hardware=android_x86 DEBUG= INSTALL=1
initrd /initrd.img
}
menuentry 'Windows' {
search --file --no-floppy --set=root /EFI/Microsoft/Boot/bootmgfw.efi
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
The file name must be identical to the .imgPTN file name (but with no extension).
Tip: The filename should NOT contain a . (dot)
title android x86 (MBR) \nBoot to android
root (hd0,2)
kernel /kernel root=/dev/ram0 androidboot.hardware=android_x86 quiet DATA=
initrd /initrd.img
boot
To UEFI-boot, we need to create a FAT32 .imgPTN partition image. However, this limits us to a <4GB data.img persistence file.
Here is how to have a >4GB persistence file and UEFI-boot by using an NTFS partition to hold the android boot files and persistence file.
I used android-x86-4.4-r5.iso for this.
Instructions
1. Make two folders on your PC:android_FAT32
android_NTFS
2. Extract the contents of android-x86-4.4-r5.iso to the android_NTFS folder (e.g. using 7zip)
3. Copy the android_NTFS\boot folder from the android_NTFS folder to the android_FAT32 folder
4. Copy the android_NTFS\efi folder from the android_NTFS folder to the android_FAT32 folder
5. Create a android_FAT32\boot\grub\x86_64-efi folder
6. Find a Ubuntu ISO (or other linux ISO that uses grub2) and copy the \boot\grub\x86_64-efi\ntfs.mod file to the android_FAT32\boot\grub\x86_64-efi folder
7. Edit the android_FAT32\boot\grub\grub.cfg file to add the line in red below:
set timeout=30
insmod ntfs
menuentry 'Android-x86 4.4-r5 Live' --class android-x86 {
search --file --no-floppy --set=root /system.sfs
linux /kernel root=/dev/ram0 androidboot.hardware=android_x86 quiet DATA=
initrd /initrd.img
}
menuentry 'Android-x86 4.4-r5 DEBUG mode' --class android-x86 {
search --file --no-floppy --set=root /system.sfs
linux /kernel root=/dev/ram0 androidboot.hardware=android_x86 DATA= DEBUG=2
initrd /initrd.img
}
menuentry 'Android-x86 4.4-r5 Installation' --class android-x86 {
search --file --no-floppy --set=root /system.sfs
linux /kernel root=/dev/ram0 androidboot.hardware=android_x86 DEBUG= INSTALL=1
initrd /initrd.img
}
menuentry 'Windows' {
search --file --no-floppy --set=root /EFI/Microsoft/Boot/bootmgfw.efi
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
As you can see, this grub.cfg will look for a /system.sfs file and set the root to that volume.
By loading the ntfs.mod module, we can search NTFS volumes.
8. Use RMPrepUSB to make a large data.img ext2 file by using the Make ext2 FS button (file name = data.img, volume name=data.img, size=whatever - e.g. 5000). You need to select an NTFS drive for this, not a FAT32 volume (use Ctrl-F5 to see all disks on your system to allow you to use an internal hard disk, if you wish).
9. Move (cut and paste) the \data.img file to the android_NTFS folder
You should now have:
android_NTFS folder
\data.img
(contents of android ISO)
android_FAT32 folder
\efi folder
\boot folder
\boot\grub\grub.cfg (modified)
\boot\grub\x86_64-efi\ntfs.mod (new file)
10. Drag-and-drop the android_FAT32 folder onto the MPI Tool Pack MPI_FAT32 shortcut, specify a name of android.imgPTN
Tip: The filename should NOT contain a . (dot) (e.g. android_4_4 is OK but not android_4.4).
Tip: The filename should NOT contain a . (dot) (e.g. android_4_4 is OK but not android_4.4).
11. Drag-and-drop the android_NTFS folder onto the MPI_Tool Pack MPI_NTFS shortcut, specify a name of android
The file name must be identical to the .imgPTN file name (but with no extension).
Tip: The filename should NOT contain a . (dot)
12. Copy both android.imgPTN and android to your E2B USB drive (e.g. \_ISO\LINUX folder).
You should now be able to run the android.imgPTN file (or use SWITCH_E2B.exe) and then UEFI-boot to android x86 with persistence.
Note that I had to type exit a few times (during a debug boot) because android objected to some drives in my system, but after the first time, I did not need to do this again.
I had to boot from a real 64-bit UEFI system (not VBox) to test this, because android did not seem to like my VBox VMs.
MBR booting
If you want to MBR boot, add this menu to the bottom of the \menu.lst file in the android_FAT32 (the .imgPTN volume) partition once you have switched to it.title android x86 (MBR) \nBoot to android
root (hd0,2)
kernel /kernel root=/dev/ram0 androidboot.hardware=android_x86 quiet DATA=
initrd /initrd.img
boot
For later versions, e.g. android-x86_64-9.0-r1-k49.iso use:
title android x86 (MBR) \nBoot to android
root (hd0,2)
kernel /kernel root=/dev/ram0 quiet DATA= SRC=
initrd /initrd.img
boot
title android x86 (MBR) \nBoot to android
root (hd0,2)
kernel /kernel root=/dev/ram0 quiet DATA= SRC=
initrd /initrd.img
boot
No comments:
Post a Comment