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

Ian Tanner

Active Member
Newcomer
Joined
Oct 14, 2015
Messages
29
Trophies
0
Age
27
XP
96
Country
United States

Ian Tanner

Active Member
Newcomer
Joined
Oct 14, 2015
Messages
29
Trophies
0
Age
27
XP
96
Country
United States

OldGnashburg

Cobra Chicken Summoner
Member
Joined
Feb 6, 2017
Messages
499
Trophies
0
Location
Alberta, Canada
XP
2,881
Country
Canada
What would I type in to have L4T Ubuntu, EmuNAND, Lakka, Android setup, with the images present?

EDIT: Nevermind, I figured it out. I just created an Ubuntu VM, installed python3-usb (just looked online), extracted everything into the downloads folder, opened a terminal in it and ran the following:

sudo ./setup.sh --device "switch" --android "/home/[user]/Downloads/android-32gb.img" --l4t "/home/[user]/Downloads/switchroot-l4t-ubuntu-3.0.0-full-2020-03-01.img" --emummc
Replace [user] with your username.

EDIT2: I think I screwed up the size of the Android, I only have 2 GB left from my 32gb image. What is the storage partition supposed to be so I can resize it?
 
Last edited by OldGnashburg,

lulle2007200

Active Member
OP
Newcomer
Joined
Dec 1, 2017
Messages
25
Trophies
0
Age
25
XP
323
Country
Germany
If you want more Storage space in Android, Android userdata (aka UDA) is the partition you want to extend when the script asks you. Just run the script again, manually resizing partitions when the images are already flashed is kind of a pita. And yes, the script does everything, creates partitions and flashes the images. Youre ready to go after it finished.
 

Ian Tanner

Active Member
Newcomer
Joined
Oct 14, 2015
Messages
29
Trophies
0
Age
27
XP
96
Country
United States
If you want more Storage space in Android, Android userdata (aka UDA) is the partition you want to extend when the script asks you. Just run the script again, manually resizing partitions when the images are already flashed is kind of a pita. And yes, the script does everything, creates partitions and flashes the images. Youre ready to go after it finished.
Awesome thank you for your amazing tool it worked great! i just had to re read the github page a few times to completely understand what to do
 

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
757
Country
United States
If you want more Storage space in Android, Android userdata (aka UDA) is the partition you want to extend when the script asks you. Just run the script again, manually resizing partitions when the images are already flashed is kind of a pita. And yes, the script does everything, creates partitions and flashes the images. Youre ready to go after it finished.


Big question does this allow for reflashing the Android partitions when pie is released? I actually just finished setting up two switches manually, and I don't really know if and how to find out if there are slight size differences in pie's vendor, system, boot, userdata etc partitions and if making the partitions slightly larger on the SD to accommodate for the transition would be a good idea.

Also what's the partition order that this tool provides? Does it already edit the boot.scr to properly boot linux or does it set it up in a way where it doesn't need to?

I'm sorry if I'm throwing too many questions at you, and I do appreciate the feedback. Also... Is this for windows or Linux?!
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,456
Country
United States
So I had used this just to have the emuMMC as I wait for Android Pie, but had to install the FilterDriver as under Win10, it wouldn't let me access the hos_data partition without formatting (even though it was listed as FAT32, whereas it gave me access to the emuMMC just fine even though it listed no partition format for it). When installed though, I had to assign it a drive letter. It works, but when I unplug the sd card, the drive letter remains and locks, and can't be reused until I restart my computer, even if I replug the card back in (to which I have to assign the partition a different drive letter).
 

lulle2007200

Active Member
OP
Newcomer
Joined
Dec 1, 2017
Messages
25
Trophies
0
Age
25
XP
323
Country
Germany
Big question does this allow for reflashing the Android partitions when pie is released?

Also what's the partition order that this tool provides? Does it already edit the boot.scr to properly boot linux or does it set it up in a way where it doesn't need to?


You can reflash using the script if, and only if the required partitions are already there and big enough. The script will give the option to not format the card then. So if you plan on doing that, its generally a good idea to extend the android partitions a bit. In case images get larger.

Partition order depends on what gets flashed, usually its hos data, android, l4t, emummc.

The script changes the boot.scr for l4t. When it has finished, you are ready to boot.

--------------------- MERGED ---------------------------

It works, but when I unplug the sd card, the drive letter remains and locks, and can't be reused until I restart my computer, even if I replug the card back in (to which I have to assign the partition a different drive letter).

Im aware of this. That's due to the utterly horrible way of how Windows handles MBR storage devices. As I found out, Windows has "fake attributes" for MBR partitions. The flags that indicate attributes get read from where the id for the first GPT partition lives. One of those attributes is a hidden flag that prevents auto mounting and its basically random weather or not that bit is set in said Id. You can't switch those flags either, because Windows is smart enough to detect that it would overwrite part of the GPT table

Gonna fix that in the future. For now you gotta assign a drive letter every time.
 

DiscostewSM

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
5,484
Trophies
2
Location
Sacramento, California
Website
lazerlight.x10.mx
XP
5,456
Country
United States
Im aware of this. That's due to the utterly horrible way of how Windows handles MBR storage devices. As I found out, Windows has "fake attributes" for MBR partitions. The flags that indicate attributes get read from where the id for the first GPT partition lives. One of those attributes is a hidden flag that prevents auto mounting and its basically random weather or not that bit is set in said Id. You can't switch those flags either, because Windows is smart enough to detect that it would overwrite part of the GPT table

Gonna fix that in the future. For now you gotta assign a drive letter every time.
Well, at the very least, the current method to make hos_data accessible is better than plugging the card in and Windows crashing.
 

Ian Tanner

Active Member
Newcomer
Joined
Oct 14, 2015
Messages
29
Trophies
0
Age
27
XP
96
Country
United States
how to i get the 64gb emunand to show up? the tool gave it the rest of the unalocated space but it only shows my 32gb image i dd it, would i have to rezise that image then dd it?
 

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
757
Country
United States
how to i get the 64gb emunand to show up? the tool gave it the rest of the unalocated space but it only shows my 32gb image i dd it, would i have to rezise that image then dd it?

I don't think you can resize the emunand itself, it's unlikely with the wah emunand itself is hidden to the whole partition table so it's probably best to leave it at 30823mb(30.10gb) and allocate the rest to hos_data if anything. But then again I used hekate nyx to create my emunand, I believe if you DDed the emunand image you created you can use gparted and right click on the emunand partition and select the check option. It reallocated the space for my L4T and android userdata so I don't see why it wouldn't work for your emunand
 

Ian Tanner

Active Member
Newcomer
Joined
Oct 14, 2015
Messages
29
Trophies
0
Age
27
XP
96
Country
United States
I don't think you can resize the emunand itself, it's unlikely with the wah emunand itself is hidden to the whole partition table so it's probably best to leave it at 30823mb(30.10gb) and allocate the rest to hos_data if anything. But then again I used hekate nyx to create my emunand, I believe if you DDed the emunand image you created you can use gparted and right click on the emunand partition and select the check option. It reallocated the space for my L4T and android userdata so I don't see why it wouldn't work for your emunand
okay thank you, my problem is i need to plit my emummc.img and I have yet found the command to do that (my main systems are always running linux)
 

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
757
Country
United States
okay thank you, my problem is i need to plit my emummc.img and I have yet found the command to do that (my main systems are always running linux)

Why split it? You're supposed to merge everything into one big image and then DD it to the partition, honestly it's just easier to create your partition and use gdisk redo the partition table and set the value to E0 and let hekate create create your emummc in the partition so you don't have to tweak a 30gb image just to get it working right.
 

Ian Tanner

Active Member
Newcomer
Joined
Oct 14, 2015
Messages
29
Trophies
0
Age
27
XP
96
Country
United States
Why split it? You're supposed to merge everything into one big image and then DD it to the partition, honestly it's just easier to create your partition and use gdisk redo the partition table and set the value to E0 and let hekate create create your emummc in the partition so you don't have to tweak a 30gb image just to get it working right.
I ment about splitting it for hekate to write my emummc file with haveing fat32 has my file format
Why split it? You're supposed to merge everything into one big image and then DD it to the partition, honestly it's just easier to create your partition and use gdisk redo the partition table and set the value to E0 and let hekate create create your emummc in the partition so you don't have to tweak a 30gb image just to get it working right.

i dont want to recreate my nand dump i already have
Why split it? You're supposed to merge everything into one big image and then DD it to the partition, honestly it's just easier to create your partition and use gdisk redo the partition table and set the value to E0 and let hekate create create your emummc in the partition so you don't have to tweak a 30gb image just to get it working right.
because i use fat32 and id rather use it to flash my emummc image after i set up ubuntu and android on a dual boot hakete thinks my ntsc hiddin partition is the main one and wont load my sd contents. and i dont know how to use the unalocated space at the table after i resize my hos_data to make my emunnd larger then 32gbs. id rather have hakate set up my emunand after i set up android then ubuntu then resize it as needed after hakete writes my emummc.img for me
 

konamicode89

Well-Known Member
Member
Joined
Mar 13, 2018
Messages
142
Trophies
0
Age
34
XP
757
Country
United States
I ment about splitting it for hekate to write my emummc file with haveing fat32 has my file format


i dont want to recreate my nand dump i already have

because i use fat32 and id rather use it to flash my emummc image after i set up ubuntu and android on a dual boot hakete thinks my ntsc hiddin partition is the main one and wont load my sd contents. and i dont know how to use the unalocated space at the table after i resize my hos_data to make my emunnd larger then 32gbs. id rather have hakate set up my emunand after i set up android then ubuntu then resize it as needed after hakete writes my emummc.img for me

Ntsc hidden partition? There shouldn't even be ntsc on the SD card at all, if you're finding yourself having to resize hos_data you have two choices

1. Use gparted to move all of your partitions starting from the last partition to the end of the table until the unallocated space is in front of hos_data. That way you can resize your hos_data because the unallocated space is between hos_data and the partition after it, then proceed to resize. Lastly use gdisk to rewrite your partition tables so hos_data and emummc is bootable.. I only recommend this option if you either haven't set up your emummc yet as I'm pretty sure it messes up your emummc somehow and needs reconfiguration

2. Redo your setup, I cannot stress enough that this process is a one shot perfect execution the whole way through for it to work and stay working. Besides didn't you use the app?
 

lulle2007200

Active Member
OP
Newcomer
Joined
Dec 1, 2017
Messages
25
Trophies
0
Age
25
XP
323
Country
Germany
I had to assign it a drive letter
Updated the script, should be fixed.


partition table and set the value to E0 and let hekate create create your emummc
Don't mess with the partition table, Hekate will recognize the emummc partition.



how to i get the 64gb emunand to show up?
You don't. Emunand is a copy of internal nand, which, in fact, is only 32Gb big. It is possible to have a bigger emunand, but that requires de- and reencryption, it's not something the script does. Emummc partition is supposed to be used with hekate (create emummc from hekate). You can write your nand image using dd but only if it is properly aligned and has the right size. Its easier to just do that in hekate. Probably easier to create it from Hekate.
 

Ian Tanner

Active Member
Newcomer
Joined
Oct 14, 2015
Messages
29
Trophies
0
Age
27
XP
96
Country
United States
Updated the script, should be fixed.



Don't mess with the partition table, Hekate will recognize the emummc partition.




You don't. Emunand is a copy of internal nand, which, in fact, is only 32Gb big. It is possible to have a bigger emunand, but that requires de- and reencryption, it's not something the script does. Emummc partition is supposed to be used with hekate (create emummc from hekate). You can write your nand image using dd but only if it is properly aligned and has the right size. Its easier to just do that in hekate. Probably easier to create it from Hekate.
thank you for that info, the tool gave me a recomended 64 gb partition for my emunand partition when i only need 32 put since it kepted showing 64gbs i thought it would extend the image itself, when this pandemic slows down and i can get a job i plan to get a 256gb nand chip to upgrade so i wouldnt have to worry about deviding space on a 200gb micro sd card when my eshop library alomost fills it but i have a second switch stored all my games so i can just pick and choose which ones to install on my modded one
 

Jay1175

Member
Newcomer
Joined
May 7, 2020
Messages
5
Trophies
0
Age
33
XP
48
Country
United States
Does it matter what size android image you use?

The script seems to finish successfully, I force power off my switch then reboot into hekate. Launching the android payload just leaves me on a black screen.

I flashed the 16gb image to my 128gb SD card.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • A @ anotherthing:
    Online was free on the 3DS as well, and it worked well.
    +1
  • S @ salazarcosplay:
    I can't help but think nintendo switch online is the reason we did not get a gameboy/n64/gamecube
    mini classic edition
    +1
  • Xdqwerty @ Xdqwerty:
    @salazarcosplay, i think it would have been impossible to see anything in a gameboy mini
  • S @ salazarcosplay:
    well I meant that as a figure of speech
  • S @ salazarcosplay:
    they could just rerelease a modern gameboy
  • S @ salazarcosplay:
    like the pocket analogue
  • S @ salazarcosplay:
    but nintendo licensed
  • LeoTCK @ LeoTCK:
    dammit that thread got moved from offtopic to edge, well since that happened
  • Xdqwerty @ Xdqwerty:
    @LeoTCK, atleast it's still avaliable
  • LeoTCK @ LeoTCK:
    yes but it wasn't meant to be a comedy thread
  • LeoTCK @ LeoTCK:
    and edge of the forum is mostly comedy and games
  • LeoTCK @ LeoTCK:
    so I don't get why it got moved at all
  • Xdqwerty @ Xdqwerty:
    @LeoTCK, mods are probably hating you
  • LeoTCK @ LeoTCK:
    on most sites mods hated me, sooner or later, but usually over time I get either banned or the mods get used to me
  • LeoTCK @ LeoTCK:
    sometimes to the point of thanking me for my quick actions etc against spam and other stuff, but yea...its either they come to respect me or outright hate me
    +1
  • BigOnYa @ BigOnYa:
    If it's not game related, it will be moved to the Egde of the forum. Mods have moved a few of my threads also.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, it was in the off topic chat forum
  • BigOnYa @ BigOnYa:
    Well atleast they didn't delete it completely.
  • LeoTCK @ LeoTCK:
    hmm
  • Xdqwerty @ Xdqwerty:
    uoiea
  • LeoTCK @ LeoTCK:
    huh?
  • Xdqwerty @ Xdqwerty:
    Aeiou backwards
    Xdqwerty @ Xdqwerty: Aeiou backwards