Hacking [TOOL] Script to set up Android + L4T Ubuntu + CFW + EmuMMC on the same SD card

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
773
Country
United States
That's more of an Android related issue more than the script. It doesn't matter what image you use but if you set up your android partitions manually you can make it any size you want. You can still do so even if you use the script but that's a whole different matter.

What you have to keep in mind is that after flashing android you have to first boot it to twrp by holding onto vol+ when booting android and then install gapps and whatever else you'd like to add, then reboot to android from twrp when finished.

I never boot straight into android knowing that there's more to setup before intializing android, so unless it's something else that causing it I can't tell you since I never had an issue installing android
 

Jay1175

Member
Newcomer
Joined
May 7, 2020
Messages
5
Trophies
0
Age
33
XP
48
Country
United States
That's more of an Android related issue more than the script. It doesn't matter what image you use but if you set up your android partitions manually you can make it any size you want. You can still do so even if you use the script but that's a whole different matter.

What you have to keep in mind is that after flashing android you have to first boot it to twrp by holding onto vol+ when booting android and then install gapps and whatever else you'd like to add, then reboot to android from twrp when finished.

I never boot straight into android knowing that there's more to setup before intializing android, so unless it's something else that causing it I can't tell you since I never had an issue installing android

I'm trying to boot into twrp with vol+ for the initial boot. I think the script is actually failing to create system/vendor partitions, but it isn't giving me any errors. I'm running [sudo ./setup.sh --android "/home/user/Desktop/android-16gb.img" --emummc] and using default partition size for everything except userdata which I'm giving 16GB.

When the script finishes, I'm left with a 31GB volume (emummc I presume), an 18GB volume (android userdata I think), and a 75GB volume for the rest of my data. Those partitions are empty except for the bootloader and switchroot folders in the 75GB volume.

When I flash the android image using etcher it leaves me with additional partitions that I can see like system/vendor and can see the android filestructure.
 

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
773
Country
United States
I'm trying to boot into twrp with vol+ for the initial boot. I think the script is actually failing to create system/vendor partitions, but it isn't giving me any errors. I'm running [sudo ./setup.sh --android "/home/user/Desktop/android-16gb.img" --emummc] and using default partition size for everything except userdata which I'm giving 16GB.

When the script finishes, I'm left with a 31GB volume (emummc I presume), an 18GB volume (android userdata I think), and a 75GB volume for the rest of my data. Those partitions are empty except for the bootloader and switchroot folders in the 75GB volume.

When I flash the android image using etcher it leaves me with additional partitions that I can see like system/vendor and can see the android filestructure.

Have you considered using Linux to do your partitions?
 

Jay1175

Member
Newcomer
Joined
May 7, 2020
Messages
5
Trophies
0
Age
33
XP
48
Country
United States
Have you considered using Linux to do your partitions?

I'm working on it right now.

Viewing it in gparted, the script did in fact make vendor/system/boot/recovery/dtb partitions but they were all showing as unknown file system instead of ext4 or unallocated like they should be.
 

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
773
Country
United States
I'm working on it right now.

Viewing it in gparted, the script did in fact make vendor/system/boot/recovery/dtb partitions but they were all showing as unknown file system instead of ext4 or unallocated like they should be.

That's normal, as they are all system related partitions, I can't recall which ones exactly but userdata is definitely supposed to be ext4 as its where you will put all of your personal data, if you know how to use the Gdisk and DD commands you can extract the Android image, recreate the partitions manually with gparted and also make your Horizon and emunand partitions still readable. I know it defeats the purpose of the tool but at least that way if something goes wrong then you'll know if it was either a missed step or a bad image

You can DM me for more details
 
Last edited by konamicode89,

Jay1175

Member
Newcomer
Joined
May 7, 2020
Messages
5
Trophies
0
Age
33
XP
48
Country
United States
That's normal, as they are all system related partitions, I can't recall which ones exactly but userdata is definitely supposed to be ext4 as its where you will put all of your personal data, if you know how to use the Gdisk and DD commands you can extract the Android image, recreate the partitions manually with gparted and also make your Horizon and emunand partitions still readable. I know it defeats the purpose of the tool but at least that way if something goes wrong then you'll know if it was either a missed step or a bad image

You can DM me for more details

What I ended up doing was first flashing the 16gb image via etcher and then I went in gparted to manually resize the hosdata/userdata partitions and added the emummc partition. Then I used gdisk to fix the MBR settings.

I am glad other people got this tool to work, the github says if using a virtual machine you're on your own. If anyone else stumbles across this thread who isn't having any luck, I was using VirtualBox running Ubuntu 18.04 and could not get it to work.
 

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
773
Country
United States
The guy who came up with the Linux method explicitly said not to use virtual box, although with what I gathered but haven't had time to experiment is doing this on L4T Ubuntu maybe? Maybe Linux live disc? Besides isn't the script a windows tool for people who want a windows only method? I also only swear by the Linux method because I could actually size my partitions for Android accordingly in case the pie release has bigger sized partitions so I won't have to redo my entire SD card again and lose my emummc or Linux partitions and data
 

lulle2007200

Active Member
OP
Newcomer
Joined
Dec 1, 2017
Messages
25
Trophies
0
Age
25
XP
323
Country
Germany
To answer some questions:
1. The script is a linux tool
2. It let's you customize the partition sizes (of all partitions)
3. On Windows, you're stuck with balena etcher. were is virtually no way to set up the necessary partitions manually.
4. VM with proper USB pass through *should* work. I tested it a few times with Virtualbox. However the "connect switch in rcm" thing seems to not work properly in VM.
5. Some sd cards simply don't work at all with android oreo, Samsung evo cards are known to work well tho. That'll be fixed in the next android version.

As for why the script didn't work for you - can't tell exactly. If you should try it again and it fails, feel free to send the command line output.

Android Pie will have a different partition layout so you're pretty much forced to start over. You can backup your Emummc tho.
 

Jay1175

Member
Newcomer
Joined
May 7, 2020
Messages
5
Trophies
0
Age
33
XP
48
Country
United States
To answer some questions:
1. The script is a linux tool
2. It let's you customize the partition sizes (of all partitions)
3. On Windows, you're stuck with balena etcher. were is virtually no way to set up the necessary partitions manually.
4. VM with proper USB pass through *should* work. I tested it a few times with Virtualbox. However the "connect switch in rcm" thing seems to not work properly in VM.
5. Some sd cards simply don't work at all with android oreo, Samsung evo cards are known to work well tho. That'll be fixed in the next android version.

As for why the script didn't work for you - can't tell exactly. If you should try it again and it fails, feel free to send the command line output.

Android Pie will have a different partition layout so you're pretty much forced to start over. You can backup your Emummc tho.

Using virtualbox to get the USB passthrough to work you need to install the guest additions disk in the VM, then you can toggle whether a specific USB slot is read by the host machine or the VM
 
Joined
Nov 11, 2019
Messages
20
Trophies
0
XP
102
I hope this is the right thread for my question.
I have a patched Switch (not Mariko) with an installed SX Core. Currently I use the file based emunand from SX and want to use Ubuntu and Android additionally (everything on one sd card).

Can I use your script, copy the content of my backed up fat32 partition to the new one created, launch hekate through the SX bootloader and use Android and Ubuntu as described?

Edit:

Got Android working but Ubuntu only partly. I had some errors after sudo apt update and upgrade..
I don't know whether that could be solved by the updates from
https://gbatemp.net/threads/l4t-ubuntu-a-fully-featured-linux-on-your-switch.537301/

But how to modify his ubunti.ini and bootloader files (boot.scr for example) to make the update work with your setup?
 
Last edited by Deleted member 510354,

pixel_mx

Member
Newcomer
Joined
Nov 3, 2018
Messages
6
Trophies
0
Age
23
XP
79
Country
Mexico
hi i found some errors when using your script:

1.- if the partition for HOS is in exfat it will not be accessible in both linux and windows unless it is formatted in fat 32 and the process is repeated

2.- your scrip creates the emunand partition in the range 0x03, it would be appropriate if it were in the range 0x2 so you save problems for those who use sx os and atmosphere
 

evil_santa

Well-Known Member
Member
Joined
Jan 15, 2020
Messages
379
Trophies
1
Age
39
XP
1,834
Country
Germany
Got Android working but Ubuntu only partly. I had some errors after sudo apt update and upgrade..
I don't know whether that could be solved by the updates from
https://gbatemp.net/threads/l4t-ubuntu-a-fully-featured-linux-on-your-switch.537301/

But how to modify his ubunti.ini and bootloader files (boot.scr for example) to make the update work with your setup?
Show in Post nr 6 in this https://gbatemp.net/threads/setup-g...id-with-emummc-bigger-fat32-partition.544981/ thread and edit the boot.scr from the l4t 3.0.1 update. Use the partition where your Ubuntu is stored.
When you have problems I can do this for you.
How can you use Payloads in sxcore?
 
Last edited by evil_santa,
Joined
Nov 11, 2019
Messages
20
Trophies
0
XP
102
Show in Post nr 6 in this https://gbatemp.net/threads/setup-g...id-with-emummc-bigger-fat32-partition.544981/ thread and edit the boot.scr from the l4t 3.0.1 update. Use the partition where your Ubuntu is stored.
When you have problems I can do this for you.
How can you use Payloads in sxcore?

Thanks for the link and the help!
I tried to decrypt, edit the boot.scr and enrypt it again two or three weeks ago. It didn't help, but maybe I did something wrong. I will check your solution in a few weeks since I'm quite busy right now.

I own a patched unit (Erista) and loaded hekate.bin after selecting it in the SX bootloader. Booting Android and Ubuntu with hekate worked. But I had problems with updating Ubuntu as I said.
 

lulle2007200

Active Member
OP
Newcomer
Joined
Dec 1, 2017
Messages
25
Trophies
0
Age
25
XP
323
Country
Germany
1.- if the partition for HOS is in exfat it will not be accessible in both linux and windows unless it is formatted in fat 32 and the process is repeated

May look into that later.

2.- your scrip creates the emunand partition in the range 0x03, it would be appropriate if it were in the range 0x2 so you save problems for those who use sx os and atmosphere

No offense, but i couldnt care less if it's compatible with sx os or not. Besides that, i can't test with sx os.
 

pixel_mx

Member
Newcomer
Joined
Nov 3, 2018
Messages
6
Trophies
0
Age
23
XP
79
Country
Mexico
No offense, but i couldnt care less if it's compatible with sx os or not. Besides that, i can't test with sx os.

I understand you, the hidden emunand of sx os is shit since it writes in sectors where the information of the mbr would have to be making it difficult to manipulate
 
Last edited by pixel_mx,

OldGnashburg

Cobra Chicken Summoner
Member
Joined
Feb 6, 2017
Messages
501
Trophies
0
Location
Alberta, Canada
XP
2,902
Country
Canada
I had this working a while back, but now I can't get it to work. It either fails to detect my SD. It either says SD not inserted or I get the message
lsblk: switch: not a block device
sfdisk: cannot open switch: No such file or directory
Storage device too small, aborting.

I'm trying to get Android, Ubuntu and EmuNAND working
 

jacobsson

Well-Known Member
Member
Joined
Oct 30, 2019
Messages
165
Trophies
0
Age
38
XP
769
Country
Sweden
hi i found some errors when using your script:
1.- if the partition for HOS is in exfat it will not be accessible in both linux and windows unless it is formatted in fat 32 and the process is repeated

How come you can't keep your HOS exfat when having a multi-boot setup? I'm using files larger than 4GB for RetroArch etc. so I'd love to try figuring this out.
 
Last edited by jacobsson,

Draxzelex

Well-Known Member
Member
Joined
Aug 6, 2017
Messages
19,007
Trophies
2
Age
29
Location
New York City
XP
13,374
Country
United States
How come you can't keep your HOS exfat when having a multi-boot setup? I'm using files larger than 4GB for RetroArch etc. so I'd love to try figuring this out.
Because there is no reason to be using exFAT since it can corrupt your SD card. There are numerous workarounds for whatever files larger than 4 GB that you are currently using.
 

Site & Scene News

Popular threads in this forum

Recent Content

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: good night