Hacking L4T Ubuntu and Atmosphere on same SD card?

blaze5

Well-Known Member
OP
Newcomer
Joined
Nov 27, 2016
Messages
45
Trophies
0
Age
32
XP
1,508
Country
United States
I've set up Atmosphere and L4T Ubuntu on separate SD cards which works fine, but I'd like to keep everything on a single SD card and boot between them with Hekate. Right now, I have a boot partition (FAT32), L4T Ubuntu partition (EXT4), Atmosphere SD partition (exFAT), and a Linux Swap partition at the end. When I launch L4T Ubuntu from the main boot partition, it loads from the separate EXT4 partition, but is there a way to have Atmosphere load a specific partition through the ini configuration or patch? It looks like everything in the ini configurations points to files on the same partition and can't specify other partitions.

Pretty much everything I've found for Atmosphere partitions is setting up partitions for emuMMC which I can always try later, but mainly I just want a large SD partition in Horizon and don't need emuMMC at the moment. Does the Atmosphere SD partition need to be the first partition on the SD card then? The L4T Ubuntu boot rom can use multiple partitions, but maybe it's not possible for Atmosphere to use other SD partitions without patches. If this is the case, I can always resize my partitions with gparted or something. I just thought it was better to isolate everything to separate partitions.

On a somewhat unrelated note, I may switch my Atmosphere SD partition back to FAT32 for homebrew stability, but the 2 GB file size limit is annoying and homebrew has been running pretty well for me so far.
 

Masamune3210

Well-Known Member
Member
Joined
Apr 23, 2016
Messages
132
Trophies
0
Age
28
XP
623
Country
United States
Easiest way is to just test your questions on a clean sd card. The most you have to lose is it not working as long as you back everything up. BTW FAT32 file size limit is 4GB, not 2GB
 

wstlxx

Member
Newcomer
Joined
Apr 29, 2019
Messages
13
Trophies
0
Age
28
XP
134
Country
China
Go search for noob-freindly L4T ubuntu
Acctually ,I believe that even more than 2 systems could exist at the same time, didn't try though
 

blaze5

Well-Known Member
OP
Newcomer
Joined
Nov 27, 2016
Messages
45
Trophies
0
Age
32
XP
1,508
Country
United States
I figured this out over the past few weeks. I've seen the info scattered in a bunch of places, so I'll compile it and put together a guide. I have reboot2payload working for Atmosphere, L4T Ubuntu, and Switchroot Android.
 
  • Like
Reactions: enderer

blaze5

Well-Known Member
OP
Newcomer
Joined
Nov 27, 2016
Messages
45
Trophies
0
Age
32
XP
1,508
Country
United States
@Philliyxx I had come across that script after I had set everything up. It seems convenient, though it doesn't look like it lets you choose the size for any of the partitions like I did (basically all leftover space gets allocated to Android). I did basically everything with dd, fdisk, gdisk, and this script that lets you explicitly set the size of the Android userdata partition (https://github.com/Gabri3lZ/SwitchrootAndroidUtils). I basically allocated most of my space (100 GB of my 256 GB microSD) to Horizon since I can mount the Horizon partition in Ubuntu and left 50 GB for Android.

@mettalik What do you have on your current microSD card? Just Atmosphere and maybe emuMMC? If you just want to add Ubuntu I can easily tell you what you need to do, but if you also want Android it's a little more involved. You can create new partitions with gparted and don't need to erase your card, though it would be a good idea to do a dd backup first. I did everything from an Ubuntu 18.04 VM.

I'll try to create a basic guide and automate it when I get some time.

Edit:
This post (https://gbatemp.net/threads/setup-g...c-bigger-fat32-partition.544981/#post-8740835) covers modifying the l4t-ubuntu boot.scr to point to the correct partitions. You should be able to create a new partition for Ubuntu at the end of your SD card using gparted (with some swap at the very end ideally) and then just dd the image file to your new partition (e.g. "sudo dd if=switchroot-l4t-ubuntu-3.0.0-full-2020-03-01.img of=/dev/sdbX bs=4096 skip=Y status=progress" where X is the partition you created for Ubuntu and Y is the offset where the Ubuntu partition within the image starts). After you dd the image to the partition, you can use gparted to expand the Ubuntu partition to full size if it isn't already

To calculate the offset, run fdisk on the switchroot-l4t-ubuntu.img file and find the starting sector of the Ubuntu partition in that image. Then multiply the start sector by 512 (512 bytes per sector) and divide that by your block size (4096 is what I used). That is the skip value which tells dd to skip that many blocks into the image before it starts to copy it over. The same principle applies to Android, but it's a little more involved with the hybrid MBR and additional partitions.

You can mount the first partition in the switchroot-l4t-ubuntu.img file and copy the files over to your Horizon partition. Then edit the boot.scr to point to the correct partition in the post I referenced above.
 
Last edited by blaze5,

lulle2007200

Active Member
Newcomer
Joined
Dec 1, 2017
Messages
25
Trophies
0
Age
25
XP
323
Country
Germany
If there is leftover space, the script gives you the option to extend all partitions however you like. If there is still leftover space *after* you changed partition sizes, it gets assigned to the hos_data partition.
 

blaze5

Well-Known Member
OP
Newcomer
Joined
Nov 27, 2016
Messages
45
Trophies
0
Age
32
XP
1,508
Country
United States
If there is leftover space, the script gives you the option to extend all partitions however you like. If there is still leftover space *after* you changed partition sizes, it gets assigned to the hos_data partition.
Oh nice. Thanks for making a flexible, easy to use script to set this up. I'm glad to have gone through the process doing it manually just to get the experience, but this would have saved me a lot of time had I started with it and it's way more accessible for anyone to get into.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Sicklyboy @ Sicklyboy: *teleports behind you* "Nothing personnel, kiddo" +1