[QUICK TUTO] How to boot Linux on your Switch

Discussion in 'Switch - Tutorials' started by natinusala, Apr 24, 2018.

  1. sigboe

    sigboe Advanced Member

    Newcomer
    2
    Feb 3, 2016
    Norway
    @natinusala Is there a way to mount NAND backups as loop partitions in Linux yet?
     
    Tommy084 likes this.
  2. BR6

    BR6 Member

    Newcomer
    1
    Oct 13, 2016
    Can anyone confirm a rpi3 boot linux onto the rcm switch
     
  3. ExploitTnT

    ExploitTnT Devy | YT: DevRin | dev_settings

    Member
    3
    Jul 30, 2017
    Austria
    Try "Ubuntu Mate" i hope this will work for rpi3
     
  4. natinusala
    OP

    natinusala Win32 error 31 is not an error

    Member
    11
    Dec 1, 2012
    France
    Linux can certainly read the NAND as backup scripts for Linux can be found here. But as to say that they can be _mounted_... I don't even know if it's a known filesystem. Anyway you'll need keys to decrypt the NAND. Some work needs to be done here.
     
  5. apple_juice

    apple_juice Newbie

    Newcomer
    1
    May 3, 2018
    Czech Republic
    Anyone encountered this issue?

    Code:
    aaaa@ubuntu:/mnt/hgfs/b_hunter/linux_switch/shofel2/usb_loader$ sudo ../../imx_usb_loader/imx_usb -c .
    config file <./imx_usb.conf>
    vid=0x0955 pid=0x701a file_name=switch.conf
    config file <./switch.conf>
    parse ./switch.conf
    Trying to open device vid=0x0955 pid=0x701a
    Interface 0 claimed
    HAB security state: development mode (0x56787856)
    == work item
    filename ../../linux/arch/arm64/boot/Image.gz
    load_size 0 bytes
    load_addr 0x83000000
    dcd 0
    clear_dcd 0
    plug 0
    jump_mode 0
    jump_addr 0x00000000
    == end work item
    
    loading binary file(../../linux/arch/arm64/boot/Image.gz) to 83000000, skip=0, fsize=831079 type=0
    
    <<<8589433, 8589433 bytes>>>
    succeeded (security 0x56787856, status 0x88888888)
    HAB security state: development mode (0x56787856)
    == work item
    filename ../../linux/arch/arm64/boot/dts/nvidia/tegra210-nintendo-switch.dtb
    load_size 0 bytes
    load_addr 0x8d000000
    dcd 0
    clear_dcd 0
    plug 0
    jump_mode 0
    jump_addr 0x00000000
    == end work item
    
    loading binary file(../../linux/arch/arm64/boot/dts/nvidia/tegra210-nintendo-switch.dtb) to 8d000000, skip=0, fsize=a040 type=0
    
    <<<41024, 41024 bytes>>>
    succeeded (security 0x56787856, status 0x88888888)
    HAB security state: development mode (0x56787856)
    == work item
    filename switch.scr.img
    load_size 0 bytes
    load_addr 0x8e000000
    dcd 0
    clear_dcd 0
    plug 0
    jump_mode 1
    jump_addr 0x8e000000
    == end work item
    
    loading binary file(switch.scr.img) to 8e000000, skip=0, fsize=162 type=aa
    
    <<<354, 354 bytes>>>
    succeeded (security 0x56787856, status 0x88888888)
    jumping to 0x8e000162
    failed (security 0x56787856, status 0x33050a00)
    
     
  6. Mittytoto

    Mittytoto Member

    Newcomer
    2
    Apr 27, 2018
    New Zealand
    Auckland
    Have you built the kernel i.e. the linux folder? The message clearly said that it couldn't find the kernel. You could avoid this hassle by using the prebuilt kernel. Just search for shofel2_linux in this thread.
     
    apple_juice likes this.
  7. justinbug2

    justinbug2 GBAtemp Advanced Fan

    Member
    5
    Jun 9, 2015
    United States
    lordelan and natinusala like this.
  8. natinusala
    OP

    natinusala Win32 error 31 is not an error

    Member
    11
    Dec 1, 2012
    France
    I will try this out and write a super simplified Windows guide (if someone isn't faster than me at least), thanks for reporting !
     
  9. apple_juice

    apple_juice Newbie

    Newcomer
    1
    May 3, 2018
    Czech Republic
    actually, I did compile the kernel, thats why im asking, im using VMware btw
     
  10. Mittytoto

    Mittytoto Member

    Newcomer
    2
    Apr 27, 2018
    New Zealand
    Auckland
    And the folder named exact "linux" and it sits right next to the shofel2 folder? I am asking because the loader config files are looking for those exact. If you notice the git clone commands on the OP, some of them need to have the local folder names different from the repo names.
    Alternatively, you can update the loader config to match your folders structure. There is a post from @cmsj of how to make it load the kernel from SD, which you may find it handy.
     
    Last edited by Mittytoto, May 3, 2018
  11. Giodude

    Giodude GBAtemp's official rock

    Member
    11
    GBAtemp Patron
    Giodude is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    May 17, 2015
    United States
    New York
    what would be the best version of libssl-dev to download while on an ubuntu vm?
     
  12. natinusala
    OP

    natinusala Win32 error 31 is not an error

    Member
    11
    Dec 1, 2012
    France
    What are the possibilities ? I'd say openssl but I don't know if it really matters anyway.
     
  13. Giodude

    Giodude GBAtemp's official rock

    Member
    11
    GBAtemp Patron
    Giodude is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    May 17, 2015
    United States
    New York
    I have absolutely no clue what I'm doing.
     
  14. SapphireExile

    SapphireExile Advanced Member

    Newcomer
    3
    May 2, 2018
    United States
    Plant City, FL
    Just get the latest.
    Code:
    sudo apt-get install libssl-dev
     
    Giodude likes this.
  15. Davelo

    Davelo Advanced Member

    Newcomer
    4
    Feb 10, 2018
    Bahrain
    Can someone tell me what is the default password for linux ? My username by default is “alarm”
     
  16. EpicLPer

    EpicLPer Nice unless you give me a reason to hate you ;)

    Member
    6
    Mar 13, 2015
    Austria
    Austria
    alarm = alarm
    root = root
     
  17. saneatsu

    saneatsu Advanced Member

    Newcomer
    2
    Apr 28, 2018
    United States
    For anyone on OS X that is seeing slow as card write times with dd, use /dev/rdiskX which is the raw disk access method instead of /dev/diskX which is unbuffered.

    This is the only difference for OSX’s dd command.
     
    cmsj and natinusala like this.
  18. cmsj

    cmsj Advanced Member

    Newcomer
    2
    Apr 25, 2018
    United Kingdom
    Ok, I've been quiet for a few days, but I'm back with some progress - not on better Switch hardware support, I drew a lot of blanks in my investigations there.

    But, I do now have a fully automated build system (using Docker) for the f0f exploit chain, the various bootloaders, the Linux kernel and an Ubuntu root filesystem.

    So what? Well, what it spits out right now is a tarball containing all of the scripts/executables/payloads for the f0f exploit, and an SD card image of Ubuntu :)

    There's one very big difference compared to the other f0f exploit payloads - specifically, this one only boots a kernel from /boot/ in the SD card, it doesn't send the kernel/DTB over USB. I plan on extending the u-boot script so that it will look for the files on SD and fall back to USB if it can't find them, but overall I think sending them over USB is kinda pointless from a user perspective.

    In terms of what's in the Ubuntu image, nothing has changed really since I was last posting - the rotation is still wrong on the first boot for example. Someone please figure out what I did wrong with my Xsession.d script, to fix that!

    One other big caveat right now is that the Linux partition doesn't resize itself to fill the SD card. I know how to do it, I just wanted to focus first on getting a full build chain that spits out everything required to install/boot Ubuntu.

    See https://github.com/cmsj/switch_linux_kit/releases/tag/1.0 for the downloads (ie the exploit chain and the SD card image) and some brief instructions :)

    — Posts automatically merged - Please don't double post! —

    Lots of credits to other folk on this:
    • Nold360 for his build scripts which I've significantly extended, and his Docker based toolchain builder, which I've also hacked up quite a bit
    • Open Source Robotics Foundation for their multiarch Ubuntu image builder
    • f0f obviously
    • Everyone who posted some kind of little fix to Xorg/etc that I've incorporated so far
     
    Last edited by cmsj, May 4, 2018
  19. natinusala
    OP

    natinusala Win32 error 31 is not an error

    Member
    11
    Dec 1, 2012
    France
    That's very nice ! I see that you're still using imx_usb_loader though, is it for the u-boot script ?
     
  20. uyjulian

    uyjulian Homebrewer

    Member
    9
    Nov 26, 2012
    United States
    United States
    Or just increase the bs= size...

    The problem with buffered access is that you don't know when it's safe to unplug the storage device.
     
Quick Reply
Draft saved Draft deleted
Loading...