Hacking Cannot set archive bit to split NSP on Mac OSX

jebediah

Well-Known Member
OP
Newcomer
Joined
Aug 24, 2015
Messages
63
Trophies
0
Age
39
XP
221
Country
United States
After splitting a large NSP with splitNSP.py successfully, I tried the following chflags commands:

sudo chflags -R arch splitnspfolder.nsp
sudo chflags -R noarch splitnspfolder.nsp
sudo chflags arch splitnspfolder.nsp
sudo chflags noarch splitnspfolder.nsp

However, the folder is still not recognised as archive/file by Tinfoil and I am unable to install. Booting into Windows confirms the archive bit was not set.

I installed mtools to use mattrib, but I get the following error:

sudo mattrib +a SPLITFOLDER.nsp
Drive 'A:' not supported
Cannot initialize 'A:'

For the life of me I don't want to boot into Windows every time I split a large NSP, and I can't understand why we can't do that on OSX.
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,883
Trophies
2
XP
29,267
Country
United Kingdom
I haven't had a need to mess with it on mac lately, but what you can do is use NX-Shell to set the archive bit on your Switch. Run NX-Shell from the homebrew menu, find the folder, press X, choose "more..." (I think) then "Set archive bit".
 

jebediah

Well-Known Member
OP
Newcomer
Joined
Aug 24, 2015
Messages
63
Trophies
0
Age
39
XP
221
Country
United States
Thank you so much @hippy dave you saved the day!

People, be aware that you first need to enable Developer options in NX-Shell's settings menu first (hit the menu icon top left, then the settings icon in the left panel). Also I recommend using the controller (not touch screen) to select your split folder because setting the archive bit will only work on a highlighted item (grey background), not by checking its left side box then hitting the 3 dots on top right. So you highlight your split folder using the controller and hit the X button to bring up the Actions menu, select More and then Set archive bit. If you don't use the controller, only the Parent folder will be highlighted and pressing Set archive bit will give no response. This is on NX-Shell 1.2.0.

@stick267 Thanks for the tip but I can't seem to establish a USB connection to my Mac. I'm using a USB-C to USB-C cable and since the Switch isn't detected in USB install mode out of the box I just left this on the side. Happy to read your tips on how to set it up though.
 
  • Like
Reactions: hippy dave

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
Thank you so much @hippy dave you saved the day!

People, be aware that you first need to enable Developer options in NX-Shell's settings menu first (hit the menu icon top left, then the settings icon in the left panel). Also I recommend using the controller (not touch screen) to select your split folder because setting the archive bit will only work on a highlighted item (grey background), not by checking its left side box then hitting the 3 dots on top right. So you highlight your split folder using the controller and hit the X button to bring up the Actions menu, select More and then Set archive bit. If you don't use the controller, only the Parent folder will be highlighted and pressing Set archive bit will give no response. This is on NX-Shell 1.2.0.

@stick267 Thanks for the tip but I can't seem to establish a USB connection to my Mac. I'm using a USB-C to USB-C cable and since the Switch isn't detected in USB install mode out of the box I just left this on the side. Happy to read your tips on how to set it up though.
Glad you found the solution with NX-Shell, it's currently the only work around for macOS users. It's not that macOS cannot set the archive flag (it can), it's that it won't set or keep the flag on a FAT32 volume. Once the folder is copied to the SD card the flags are reset. No idea why this happens but no tool seems to get around it.

As for USB installs, USB-C to USB-C is iffy. Sometimes the Mac mounts the Switch as an accessory and you can do it, other times the Mac tries to charge from the Switch and it won't work. I can't work out a pattern on why which happens or a way to force other than just changing the USB-C I'm using back and forth. This is assuming you installed the required libUSB drivers and such.
 

stick267

Well-Known Member
Member
Joined
Dec 17, 2018
Messages
586
Trophies
0
Age
33
XP
1,171
Country
United States
Thank you so much @hippy dave you saved the day!

People, be aware that you first need to enable Developer options in NX-Shell's settings menu first (hit the menu icon top left, then the settings icon in the left panel). Also I recommend using the controller (not touch screen) to select your split folder because setting the archive bit will only work on a highlighted item (grey background), not by checking its left side box then hitting the 3 dots on top right. So you highlight your split folder using the controller and hit the X button to bring up the Actions menu, select More and then Set archive bit. If you don't use the controller, only the Parent folder will be highlighted and pressing Set archive bit will give no response. This is on NX-Shell 1.2.0.

@stick267 Thanks for the tip but I can't seem to establish a USB connection to my Mac. I'm using a USB-C to USB-C cable and since the Switch isn't detected in USB install mode out of the box I just left this on the side. Happy to read your tips on how to set it up though.
I've heard of issues with USB-C to USB-C cables while doing USB install so if splitting is currently working (minus the archive bit stuff) then it'd probably just be easiest to stick with it.

To answer your original question though, you have to set the archive bit AFTER you transfer the folder to your SD card. If you do it before hand, the archive bit gets wiped out when you transfer it.
 

jebediah

Well-Known Member
OP
Newcomer
Joined
Aug 24, 2015
Messages
63
Trophies
0
Age
39
XP
221
Country
United States
Glad you found the solution with NX-Shell, it's currently the only work around for macOS users. It's not that macOS cannot set the archive flag (it can), it's that it won't set or keep the flag on a FAT32 volume. Once the folder is copied to the SD card the flags are reset. No idea why this happens but no tool seems to get around it.

As for USB installs, USB-C to USB-C is iffy. Sometimes the Mac mounts the Switch as an accessory and you can do it, other times the Mac tries to charge from the Switch and it won't work. I can't work out a pattern on why which happens or a way to force other than just changing the USB-C I'm using back and forth. This is assuming you installed the required libUSB drivers and such.
Thanks for clarifying. I've been struggling to find anything else than booting Windows and had no idea that there was a homebrew out there to do the job.

As for the USB-C cabling, I did notice the Mac won't decide on a consistent way to interact, so I just like you I've given up since we do have some reliable workarounds for now.

--------------------- MERGED ---------------------------

I've heard of issues with USB-C to USB-C cables while doing USB install so if splitting is currently working (minus the archive bit stuff) then it'd probably just be easiest to stick with it.

To answer your original question though, you have to set the archive bit AFTER you transfer the folder to your SD card. If you do it before hand, the archive bit gets wiped out when you transfer it.
Yes I had figured that out because I tried to re-use the same file I previously set the archive bit of in Windows and which I had stored externally, and indeed flags got reset as I transferred it again to the SDcard. OSes are what they are I guess, but Tinfoil and other installers should definitely include a way to set the archive bit themselves or to accept the split folder as it is so that everything can be handled from the SDcard directly and at the time of installation.
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
Thanks for clarifying. I've been struggling to find anything else than booting Windows and had no idea that there was a homebrew out there to do the job.

As for the USB-C cabling, I did notice the Mac won't decide on a consistent way to interact, so I just like you I've given up since we do have some reliable workarounds for now.

--------------------- MERGED ---------------------------


Yes I had figured that out because I tried to re-use the same file I previously set the archive bit of in Windows and which I had stored externally, and indeed flags got reset as I transferred it again to the SDcard. OSes are what they are I guess, but Tinfoil and other installers should definitely include a way to set the archive bit themselves or to accept the split folder as it is so that everything can be handled from the SDcard directly and at the time of installation.
Hmmm, not a bad idea. If TinFoil or Goldleaf sees a directory that ends in .nsp then it should list it and if the user selects it, apply the archive bit to it then process it. That would make things a little more seamless.
 
  • Like
Reactions: hippy dave

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,883
Trophies
2
XP
29,267
Country
United Kingdom
My olde Mac doesn't have USB C, but I think I read someone had more success using a USB C-to-A adapter at the Mac end, then a C-to-A cable from the Switch.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: @salazarcosplay, Good.