Compiling Atmosphere - what version python?

Discussion in 'Switch - Exploits, Custom Firmwares & Soft Mods' started by mrdude, Apr 21, 2019.

  1. mrdude
    OP

    mrdude GBAtemp Advanced Fan

    Member
    6
    Dec 11, 2015
    I'm trying to compile Atmosphere from the git, but I fail because crypto is apparently not installed. I have python-3.7.2-1 installed & using mysys2 on windows. All the other stuff I'm compiling works fine, but there's not any info on the Atmosphere page about compiling and what version of python or it's crypto library are needed.

    Cheers, if you can compile - what version of python and crypto libraries are you using?
     
    Last edited by mrdude, Apr 21, 2019
  2. gnilwob

    gnilwob GBAtemp Regular

    Member
    5
    Mar 16, 2008
    Hong Kong
    I am also interested in trying this.
    If you can successfully compile it, can you share the steps you take to compile it please ?
    Thanks.
     
  3. bodefuceta

    bodefuceta GBAtemp Regular

    Member
    4
    Apr 3, 2018
    Brazil
    All i found is github issue #356
     
    Last edited by bodefuceta, Apr 22, 2019
  4. hippy dave

    hippy dave BBMB

    Member
    14
    Apr 30, 2012
    United Kingdom
    Check the instructions about setting an environment variable with the location of the pre-encrypted sept binary (as included in the compiled atmosphere release). Once you do that, python won't be needed at all to build atmosphere.

    There's nothing to be gained from building sept yourself as you can't encrypt it with the correct key (not public).
     
    OkazakiTheOtaku likes this.
  5. mrdude
    OP

    mrdude GBAtemp Advanced Fan

    Member
    6
    Dec 11, 2015
    What instructions, there's no readme files on the github to explain how to do this - if there is - they are very hard to find. Do you have a link?
     
  6. urherenow

    urherenow GBAtemp Psycho!

    Member
    9
    Mar 8, 2009
    United States
    Japan
    Assuming you can build other things (follow the guide in my sig if you don't know how), you need to:

    1) build the latest libnx from source and install it (dkp-pacman one is not up-to-date enough)
    2) Grab the sept-secondary.enc from the release and drop it somewhere in the Atmosphere folder
    and
    3) make dist SEPT_ENC_PATH=“/path/to/sept-secondary.enc”
    (you can simply have an explorer/nautilus window open, and drag and drop the file from the Atmosphere folder onto the terminal, instead of typing the full path)

    That's it.
     
    Last edited by urherenow, Apr 22, 2019
    hippy dave and mrdude like this.
  7. mrdude
    OP

    mrdude GBAtemp Advanced Fan

    Member
    6
    Dec 11, 2015
    Thanks, there's an issue with some make files not being complete -
    Code:
    built ... exosphere.bin
    make[1]: Leaving directory '/home/Alan/desktop/atmosphere/exosphere'
    make -C stratosphere all
    make[1]: Entering directory '/home/Alan/desktop/atmosphere/stratosphere'
    make -C libstratosphere all
    make[2]: Entering directory '/home/Alan/desktop/atmosphere/stratosphere/libstratosphere'
    make[2]: *** No rule to make target 'all'.  Stop.
    make[2]: Leaving directory '/home/Alan/desktop/atmosphere/stratosphere/libstratosphere'
    make[1]: *** [Makefile:10: libstratosphere] Error 2
    make[1]: Leaving directory '/home/Alan/desktop/atmosphere/stratosphere'
    make: *** [Makefile:21: stratosphere] Error 2
    
    When I checked - a couple of the make files don't contain any info for building.
     
  8. urherenow

    urherenow GBAtemp Psycho!

    Member
    9
    Mar 8, 2009
    United States
    Japan
    delete the folder (save your .enc file) and re-clone, and make sure you're using --recursive when you clone. It builds perfectly fine on my end.
     
    mrdude likes this.
  9. mrdude
    OP

    mrdude GBAtemp Advanced Fan

    Member
    6
    Dec 11, 2015
    This is what I've done:
    Code:
    git clone https://github.com/Atmosphere-NX/Atmosphere.git --recursive
    cd atmosphere
    (copy sept-secondary.enc to atmosphere folder)
    make dist SEPT_ENC_PATH='C:/Users/Alan/Desktop/Atmosphere/sept-secondary.enc'
    
    I still get the crypto error though on building:
    Code:
    sept-secondary/sept-secondary.bin
    built ... sept-secondary.bin
    Traceback (most recent call last):
      File "/home/Alan/desktop/atmosphere/sept/sept-secondary/sept_sign.py", line 4, in <module>
        from Crypto.Cipher import AES
    ModuleNotFoundError: No module named 'Crypto'
    make[3]: *** [/home/Alan/desktop/atmosphere/sept/sept-secondary/Makefile:150: /home/Alan/desktop/atmosphere/sept/sept-secondary/sept-secondary.enc] Error 1
    make[2]: *** [Makefile:125: build] Error 2
    make[2]: Leaving directory '/home/Alan/desktop/atmosphere/sept/sept-secondary'
    make[1]: *** [Makefile:8: sept-secondary] Error 2
    make[1]: Leaving directory '/home/Alan/desktop/atmosphere/sept'
    make: *** [Makefile:27: sept] Error 2
    
    Any idea (apart from that python error)? I have crypto installed in python already.

    EDIT: OK figured it, on windows you need to use:

    make dist SEPT_ENC_PATH="C:/Users/Alan/Desktop/Atmosphere/sept-secondary.enc"

    instead of

    make dist SEPT_ENC_PATH='C:/Users/Alan/Desktop/Atmosphere/sept-secondary.enc'

    Quotation marks make all the difference to finding the path - doh! thanks, that's it compiled fine now.

    So for people building on windows:
    Code:
    git clone https://github.com/Atmosphere-NX/Atmosphere.git --recursive
    cd atmosphere
    (copy sept-secondary.enc to atmosphere folder)
    make dist SEPT_ENC_PATH="C:/Users/yourusename/Desktop/Atmosphere/sept-secondary.enc"
    
     
    Last edited by mrdude, Apr 22, 2019
    hippy dave likes this.
  10. xenon

    xenon GBAtemp Regular

    Member
    2
    May 19, 2006
    Italy
    I compiled it using the docker from Lavatech. I had to also compile and install libnx. In the end the build completed successfully, but my Atmos wouldn't boot.
     
  11. hippy dave

    hippy dave BBMB

    Member
    14
    Apr 30, 2012
    United Kingdom
    Did you use the supplied encrypted sept binary rather than your own when trying to boot? (Assuming you're on 7.x+)
     
  12. xenon

    xenon GBAtemp Regular

    Member
    2
    May 19, 2006
    Italy
    I am on 7.0.1 and I used everything my build produced (are you talking about sept-secondary.enc?).

    I have to say I gave up since my compiling effort was motivated by a patch which is now part of Atmos 0.8.8, but I am curious: what is the implication of your question and the file you mentioned?
     
  13. hippy dave

    hippy dave BBMB

    Member
    14
    Apr 30, 2012
    United Kingdom
    Yes, sept-secondary.enc - use the one that comes with the official Atmosphere release, and you can use everything else that you built yourself. This is because sept-secondary has to be encrypted with a Nintendo key that isn't publicly known, so you can build it yourself but you can't correctly encrypt it so using your own version won't work. This was the compromise SciresM came up with for a way to derive the new key Atmosphere needed to boot on 7.x+, without releasing that key publicly (which would be a bad move legally speaking).
     
  14. urherenow

    urherenow GBAtemp Psycho!

    Member
    9
    Mar 8, 2009
    United States
    Japan
    For your python question, see if the scripts folder is in your path (c:/python27/scripts or c:/python36/scripts, for example). The issue someone linked for you states that it should work with 2.7 or 3.x.

    And I guess it doesn’t matter if it worked for you, but I always do “git clone —recursive”. Not sure why you tacked it on after the path...

    Corrected the quotes on my post so others don’t get confused.
     
    Last edited by urherenow, Apr 22, 2019
    mrdude likes this.
  15. xenon

    xenon GBAtemp Regular

    Member
    2
    May 19, 2006
    Italy
    Got it! Thanks for your reply. :)
     
    hippy dave likes this.
  16. hellogbatemp

    hellogbatemp Member

    Newcomer
    1
    May 19, 2018
    France
  17. designgears

    designgears GBAtemp Regular

    Member
    3
    Aug 8, 2016
    United States
    Here's a basic docker script to get the job done.

    Code:
    FROM devkitpro/devkita64:20190329
    
    COPY ./sept-secondary.enc /sept-secondary.enc
    
    RUN dkp-pacman -Syyu --noconfirm --needed \
            devkitA64 \
            devkitARM \
            devkitarm-rules \
            switch-freetype \
            switch-portlibs \
            switch-dev && \
        dkp-pacman -Scc --noconfirm
    
    ENV DEVKITARM=${DEVKITPRO}/devkitARM
    ENV SEPT_ENC_PATH="/sept-secondary.enc"
    
    RUN git clone https://github.com/switchbrew/libnx.git
    WORKDIR /libnx
    RUN make install
    
    WORKDIR /Atmosphere
    
    ENTRYPOINT ["make"]
     
Loading...