1. Cyan

    Cyan GBATemp's lurking knight
    Global Moderator

    Joined:
    Oct 27, 2002
    Messages:
    22,532
    Country:
    France
    I know you said not to do it on windows, but I'm still curious and as I understand how it works I wanted to try.
    but tools are just lacking, or not working as intended.

    I used easeUS partition manager, it didn't have ext4 support, only ext3 (what? really? and it's one of the most know on windows).
    I found gparted self boot image, and I could create all the needed partition. but I had to use keyboard (no mouse support... the computer I use only have 2 usb port, one for live image, one for flashdrive...)
    I'm back on windows, disk manager detects all the partitions, and don't ask to format them which is good (as they don't have a letter assigned to them).

    now I decide to use dd for windows, which is the normal step. but no, it doesn't work like intended ! it lists only partitions that windows recognizes ! which means only the fat32 (with or without a letter assigned to it).
    dd for windows doesn't have an option to specify the device (like dev/sdb/), but it only lists partitions.
    so, again, stuck on a simple step because tools are really bad.

    I tried to find other image writer, but they all work with partition and mounted letters (win32imager, winDD, rufus, etc.)
    someone suggested to use cygwin, to use the native dd command.
    I wonder if it'll work and detect partition on SD card or rely on windows detection again.

    I wanted a windows app which let you write binary image to arbitrary sector number, why is it so hard to find?
    hexeditor could maybe do it? edit: hm, non I checked.

    maybe some console hacking tools? some emuNAND manager written for 3DS could maybe do it.
    The only one I found for switch still rely on lettered partition...
    @DarkMatterCore might be our last resort to get a tool on windows to manage read/write bin and dump from SD card on arbitrary sector numbers :D
    He is willing to add ways to generate/parse INI files in his program. it's already doing it for 3DS on arbitrary sectors, it'll be very easy to update it for switch.


    I can't do it from my gparted boot image, because of limited USB Port.
    and I can't put the img to write on the FAT32 hos_data (because bigger than 4GB), and I can't have another drive on it. Ah, unless I can mount windows partitions from within gparted boot image? hmm, maybe it'll be possible then, I'll try that. no idea if dd and gdisk is part of the image too.


    edit:
    I won't be home next 2 weeks, so you'll probably will have your tool released when I'll be back :)
    Good luck completing it.
    thanks for all your work, and to all users : enjoy it.
    to the switch scene : Don't make too much changes while I'm not here, I'll have to catch up ;o
     
    Last edited: Aug 9, 2019
  2. lordelan

    lordelan GBAtemp Psycho!
    Member

    Joined:
    Jan 4, 2015
    Messages:
    4,391
    Country:
    Germany
    Already dreaming of it while not even knowing what the f*ck it is. You got me on the hype train. :D
     
  3. stoffer666

    stoffer666 Advanced Member
    Newcomer

    Joined:
    May 21, 2018
    Messages:
    62
    Country:
    Denmark
    I can confirm that sx ox emunand (files) works. on this setup :-)
     
    lordelan likes this.
  4. TariqSoftDev

    OP TariqSoftDev ~Zexceil
    Member

    Joined:
    Sep 18, 2013
    Messages:
    725
    Country:
    Only way you can do this in windows is to figure out how to make a Hybrid MBR setup on a GPT formatted SD Card, I can teach you a trick to actually mount and load live linux off a FAT32 HDD partition rather than using a usb.
     
    lordelan likes this.
  5. Cyan

    Cyan GBATemp's lurking knight
    Global Moderator

    Joined:
    Oct 27, 2002
    Messages:
    22,532
    Country:
    France
    the hybrid MBR is really not my most concerned problem, I can create the hybrid MBR manually with an hexeditor. it's very easy (unless unexpected problem happen again, like antivirus preventing MBR edition on all drives, not only system drives).
    what seems hard is to find a tool which can write binary image at specific sectors, without the need of a lettered partition. and with a good speed. some writer are very slow because dealing with SD Card low level mmc commands (why?).
    for info, balena etcher doesn't work for me, it crashes and stop writing right away (maybe antivirus blocking because it detects/remounts the FAT32 partition right away and want to analyze it while it's still writing the img to SD?)

    @DarkMatterCore already has one for 3DS multi NAND dump/restore, and he said he is willing to update his tool to add ini file parsing.
    https://github.com/DarkMatterCore/3ds-multinand
    I have all the starting sector I need already, I just need a tool to write the bin to SD at these position.

    Then, making hybrid MBR is so easy I could even help him if he wants to learn how to create/parse MBR and GPT tables, so his tool could do all at once.
    MBR is just First/Last sector, in little endian. it also has CHS value, but apparently it can be faked to FF EF FF
    My first FAT32 partition is already MBR (apparently, it's added automatically as fallback by easeUS) so I already have the CHS values for it. but gparted can also provide them if exact values are really needed (they aren't. CHS is not used anymore).

    DarkMatterCore : Please, if you have time, could you update your tool ? :)
    it has already a lot of checks and bug fixed, and alignment check, administration status check, winXP SP2 check, etc.
    I see it's based on rufus, but please don't base it from lettered partition, only from raw device.

    let me know the ini format you need.
    I have all the start/end sectors numbers for each partition, but I don't need to write all binary image to them because apparently FAT32 and MMC require specific alignment, writing MMC at random sectors might not be good so hekate is better to dump to existing partition.
    something like "one per line"
    Code:
    NXpartitions.ini
    sector_start sector_end "path_to_image.bin" [nickname optional, only for read mode]
    sector_start sector_end "path_to_image.bin" [nickname optional, only for read mode]
    sector value could be hex or decimal, detect whether "0x" is present, or read them from GPT table (not hard, really easy to parse all the info from MBR/GPT! writing MBR is very easy too, writing GPT is very hard). but ini is a good idea in case MMC partition is not in the table.
    and for read, maybe it could benefit from similar ini file with sector start-end values, and just let the user pick a folder and name each 1.bin 2.bin, etc., or give a partition nickname in the ini to use as filename or prompt user if missing?


    I'm curious about your method to load live linux from hdd, but just point me to a guide or website, I can read about it. and I won't be there for next 2 week so I'll have time to read.
    don't bother writing it yourself, it's just by curiosity, I won't do it.
     
    Last edited: Aug 9, 2019
    lordelan likes this.
  6. TariqSoftDev

    OP TariqSoftDev ~Zexceil
    Member

    Joined:
    Sep 18, 2013
    Messages:
    725
    Country:
    Here's a work around I did, create a partition with a drive letter and just write to it; I'm 100% going to be making my tool work in windows by making a C++ program that can create Hybrid MBR and do Sector based disk stuff.

    Anyways my main tool for Linux is nearly done so I'll test it with WSL; if it doesn't work then I'll make a guide for people on windows on booting Linux without any USB drive(I use it myself to boot any live environment, it's drag n droppo).

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

    The tool is about 90% done rn.
     
    lordelan and Cyan like this.
  7. Cyan

    Cyan GBATemp's lurking knight
    Global Moderator

    Joined:
    Oct 27, 2002
    Messages:
    22,532
    Country:
    France
    maybe you could use darkmattercore old 3DS dumper project (gpl3) as base for your c++ tool, to prevent writing it entirely?
    he has already few checks in places (like verify if elevated admin privilege is available, etc.)
    but it's just an idea to speed your work, i you prefer to make your own that's fine. the more option the better :)

    edit: I checked the sources, it's heavily based on 3DS nand structure, maybe using rufus as base is cleaner for a new tool.
     
    Last edited: Aug 10, 2019
    TariqSoftDev and lordelan like this.
  8. tman708

    tman708 Member
    Newcomer

    Joined:
    Aug 4, 2019
    Messages:
    17
    Country:
    United States
    Do you mean the emunand works when the files are just placed on the fat32 partition of the drive instead of the hidden partition setup?
     
  9. lordelan

    lordelan GBAtemp Psycho!
    Member

    Joined:
    Jan 4, 2015
    Messages:
    4,391
    Country:
    Germany
    No he's talking about file based emuNAND instead of partition based emuNAND which is an option while creating an emuNAND with SX OS (to put files/folders on SD).
    However if you use file based with Atmopshère too, it'll be very slow so partition based is highly recommended!

    Edit @All:
    Interesting link notimp posted here -> https://forum.xda-developers.com/ni...evelopment/guide-resizing-partitions-t3955615
     
    Last edited: Aug 12, 2019
  10. Andalitez

    Andalitez GBAtemp Fan
    Member

    Joined:
    Jul 2, 2018
    Messages:
    435
    Country:
    United States
    How did you get it to work?

    Mine just boots to regular hos with no cfw loaded when I select emunand from sx boot options
     
  11. stoffer666

    stoffer666 Advanced Member
    Newcomer

    Joined:
    May 21, 2018
    Messages:
    62
    Country:
    Denmark
    I just did a copy of my intire card. and followed this guide and made a big fat32 partion and transfered my stuff back :-) it is working very good and i don't see any speed issues with the sx-ox filebased emunand. but i heard that atmoshere is slow if you make a filebased on there emunand solution.

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

    I have tried that guide first i could not get gparted to resize the unknown partions.
     
  12. pcwizard7

    pcwizard7 GBAtemp Advanced Fan
    Member

    Joined:
    Aug 2, 2013
    Messages:
    742
    Country:
    Australia
    anyone in windows should use vmware player /workstation or virtualbox to install ubuntu in virtual machine and follow this guide. but use ubuntu 18.04 LTS
     
  13. Gavin_Darkglider

    Gavin_Darkglider GBAtemp Regular
    Member

    Joined:
    May 20, 2019
    Messages:
    194
    Country:
    United States
    Ok, I didnt watch the video, as I was the one that wrote the original guide. That being said, the ubuntu boot.scr has changed for reboot to payload options, and you might want to update your tool for that.
    New kernel command line options are:
    Code:
    pmc_reboot2payload.default_payload=<payload.bin in /lib/firmware>
    pmc_reboot2payload.reboot_action = <bootloader(hekate, or payload defined above), via-payload(Reboot to payload with ID, recovery(Android use only)>
    pmc_reboot2payload.hekate_config_id=<ID defined in boot ini for linux/android/hekate_ipl.ini>
    
    The ID stuff isnt released in hekate yet, but should be in the next week. ;) Feel free to update you script for this.
     
    tabzer likes this.
  14. tabzer

    tabzer GBAtemp Fan
    Member

    Joined:
    Feb 15, 2019
    Messages:
    464
    Country:
    Japan
    Is this a script we can add to L4T boot.scr to enable reboot to payload? Is it coming out officially in a patch on the L4T thread, or do I have the wrong idea here?
     
  15. Gavin_Darkglider

    Gavin_Darkglider GBAtemp Regular
    Member

    Joined:
    May 20, 2019
    Messages:
    194
    Country:
    United States
    I already pushed the patch, it also includes minerva mini(Minerva patches to linux kernel for periodic retraining), and full minerva in coreboot. along with reboot2payload. I pushed out update 1.5.0 yesterday. here is the link: https://www.dropbox.com/s/54ibwj3id4vj2cc/l4t-ubuntu-1.5.0.zip?dl=0

    you also need to set some stuff up in userspace, it is all outlined in a post on this page: https://gbatemp.net/threads/l4t-ubuntu-a-fully-featured-linux-on-your-switch.537301/page-98

    not just read through that page, and you will find what you are looking for.

    Should also mention, that for some reason this breaks s2idle sleepmode. I am going to push a bugfix soon enough, just have to figure out what is causing the issue. I know the go to sleep issue is because of the wifi driver, but if you disable power management there, it still has issues waking sometimes. I am going to start by back porting the latest version into the kernel, and then go from there.
     
    lordelan and tabzer like this.
  16. tabzer

    tabzer GBAtemp Fan
    Member

    Joined:
    Feb 15, 2019
    Messages:
    464
    Country:
    Japan
    This was posted before you posted 1.5.0, saying that you just overwrite:


    We should do this too, correct?
     
    lordelan likes this.
  17. Gavin_Darkglider

    Gavin_Darkglider GBAtemp Regular
    Member

    Joined:
    May 20, 2019
    Messages:
    194
    Country:
    United States
    yes, but use the 1.5.0 update.

    I should also mention that I am working on 1.5.1 update to fix wifi sleep issue, and hopefully restore s2idle(current sleep) support, which is broken in 1.5.0.
     
    Last edited: Aug 18, 2019
    lordelan and tabzer like this.
  18. Gavin_Darkglider

    Gavin_Darkglider GBAtemp Regular
    Member

    Joined:
    May 20, 2019
    Messages:
    194
    Country:
    United States
    Also, I dont know if you saw my guide on multisdcard setup, but there are a few more things like copying joycon pairing keys from horizon, your script might be able to do. It wasnt in my guide, but the guide for that can be found here: https://lewd.pics/f/c9ec2b60/joyconsbluetoothhowto.txt

    That is for android, but you can follow the directions to get the pairing keys and patch them into linux as well. You will also need to patch the bluetooth mac address into the kernel. I havnt had time to find a way to script this, to make it easy though.
     
    tabzer likes this.
  19. tabzer

    tabzer GBAtemp Fan
    Member

    Joined:
    Feb 15, 2019
    Messages:
    464
    Country:
    Japan
    the reboot2payload works like a charm! as the kinks get ironed out, I am hopeful that it will find its way into lakka and lineageOS.

    As for the preserving the joycon keys across the systems, it will probably be impossible to keep pair settings consistent between OFW and CFW. So if we were able to preserve bluetooth keys across all other OSs, we'd have to use different joycons for using OFW if we don't want to go through the hassle of redoing the setup.
     
  20. Gavin_Darkglider

    Gavin_Darkglider GBAtemp Regular
    Member

    Joined:
    May 20, 2019
    Messages:
    194
    Country:
    United States
    It will find itself in lakka sooner than lineage. Nautinasala is on vacation for another week or so though. As for lineage, probably not, as the focus there has gone to porting android pie. As for the joycon stuff, if you set it on stock nand, then copy the "save" to the emunand, then it is feasable to have joycon configs on all options.
     
    tabzer likes this.
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Guide]Setting, partition, Android