Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #40 from R-YaTian/update_makefile
Browse files Browse the repository at this point in the history
Add workflow file and libnx 4.3.0 support
  • Loading branch information
dezem committed Apr 8, 2023
2 parents 7956222 + 8582490 commit a97a3eb
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 6 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,56 @@
name: Build AtmoXL-Titel-Installer

on: [push, pull_request]

jobs:
Build:
runs-on: ubuntu-latest
container: devkitpro/devkita64:latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Update packages
run: |
sudo -n apt-get update
sudo -n apt-get upgrade -y patch autoconf automake diffutils pkgconf fakeroot git file tar bzip2
sudo -n dkp-pacman --noconfirm -U \
"https://wii.leseratte10.de/devkitPro/other-stuff/dkp-toolchain-vars-1.0.2-1-any.pkg.tar.xz"
- name: Silence all git safe directory warnings
run: git config --system --add safe.directory '*'

- name: Checkout latest libnx commit
run: |
git clone --recurse-submodules https://github.com/switchbrew/libnx.git
- name: Checkout latest libusbhsfs commit
run: |
git clone https://github.com/DarkMatterCore/libusbhsfs.git
- name: Set workspace permissions
run: chmod 777 -R "$GITHUB_WORKSPACE"

- name: Build and install libnx
run: |
cd libnx
make install -j$(nproc)
- name: Build libusbhsfs dependencies
run: |
cd libusbhsfs
cd libntfs-3g; su -s /bin/bash nobody -c "dkp-makepkg -c -C -f" > /dev/null; sudo -n dkp-pacman -U --needed --noconfirm *.pkg.tar.* > /dev/null; cd ..
cd liblwext4; su -s /bin/bash nobody -c "dkp-makepkg -c -C -f" > /dev/null; sudo -n dkp-pacman -U --needed --noconfirm *.pkg.tar.* > /dev/null; cd ..
make BUILD_TYPE=GPL release
- name: Build AtmoXL-Titel-Installer
run: |
make -j$(nproc)
- uses: actions/upload-artifact@v3
with:
name: AtmoXL-Titel-Installer
path: AtmoXL-Titel-Installer.nro
if-no-files-found: error
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -74,7 +74,7 @@ LIBS += -lz -lssh2 -lusbhsfs -lntfs-3g -llwext4 -lmbedtls -lmbedcrypto -lmbedx50
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/include/Plutonium/Plutonium/Output
LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/include/Plutonium/Plutonium/Output $(CURDIR)/libusbhsfs


#---------------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions source/install/install_nsp.cpp
Expand Up @@ -69,7 +69,8 @@ namespace tin::install::nsp

NcmContentInfo cnmtContentInfo;
cnmtContentInfo.content_id = cnmtContentId;
*(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF;
ncmU64ToContentInfoSize(cnmtNcaSize & 0xFFFFFFFFFFFF, &cnmtContentInfo);
//*(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF;
cnmtContentInfo.content_type = NcmContentType_Meta;

CNMTList.push_back( { tin::util::GetContentMetaFromNCA(cnmtNCAFullPath), cnmtContentInfo } );
Expand Down Expand Up @@ -182,4 +183,4 @@ namespace tin::install::nsp
ASSERT_OK(esImportTicket(tikBuf.get(), tikSize, certBuf.get(), certSize), "Failed to import ticket");
}
}
}
}
5 changes: 3 additions & 2 deletions source/install/install_xci.cpp
Expand Up @@ -65,7 +65,8 @@ namespace tin::install::xci

NcmContentInfo cnmtContentInfo;
cnmtContentInfo.content_id = cnmtContentId;
*(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF;
ncmU64ToContentInfoSize(cnmtNcaSize & 0xFFFFFFFFFFFF, &cnmtContentInfo);
//*(u64*)&cnmtContentInfo.size = cnmtNcaSize & 0xFFFFFFFFFFFF;
cnmtContentInfo.content_type = NcmContentType_Meta;

CNMTList.push_back( { tin::util::GetContentMetaFromNCA(cnmtNCAFullPath), cnmtContentInfo } );
Expand Down Expand Up @@ -181,4 +182,4 @@ namespace tin::install::xci
ASSERT_OK(esImportTicket(tikBuf.get(), tikSize, certBuf.get(), certSize), "Failed to import ticket");
}
}
}
}
2 changes: 1 addition & 1 deletion source/nx/fs.cpp
Expand Up @@ -116,7 +116,7 @@ namespace nx::fs
path.reserve(FS_MAX_PATH);

std::string errorMsg = "Failed to open file system with id: " + path;
rc = fsOpenFileSystemWithId(&m_fileSystem, titleId, fileSystemType, path.c_str());
rc = fsOpenFileSystemWithId(&m_fileSystem, titleId, fileSystemType, path.c_str(), FsContentAttributes_All);

if (rc == 0x236e02)
errorMsg = "File " + path + " is unreadable! You may have a bad dump, fs_mitm may need to be removed, or your firmware version may be too low to decrypt it.";
Expand Down

0 comments on commit a97a3eb

Please sign in to comment.