Hacking Compiling Atmosphere - what version python?

  • Thread starter Thread starter mrdude
  • Start date Start date
  • Views Views 4,175
  • Replies Replies 16

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,063
Reaction score
5,160
Trophies
1
Age
58
XP
8,384
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,
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?

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.
 
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).
 
  • Like
Reactions: OkazakiTheOtaku
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).

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?
 
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,
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.

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.
 
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.
 
  • Like
Reactions: mrdude
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.

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,
  • Like
Reactions: hippy dave
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.
 
Did you use the supplied encrypted sept binary rather than your own when trying to boot? (Assuming you're on 7.x+)
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?
 
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?
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).
 
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"
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,
  • Like
Reactions: mrdude
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"]
 

Site & Scene News

Popular threads in this forum