dkp-pacman removes /etc link on macOS

Post Reply
Fusion86
Posts: 2
Joined: Thu Jun 07, 2018 8:31 am

dkp-pacman removes /etc link on macOS

Post by Fusion86 » Thu Jun 07, 2018 8:47 am

Yesterday I installed the most recent dkp-pacman from GitHub on my MacBook with macOS 10.13.4.

I tried to install the switch-dev package using `dkp-pacman -S switch-dev` and it gave me the error `devkit-env: /etc exists in filesystem`
At that point I had no idea what that meant. Obviously the directory /etc exists so I saw no issue with that. One thing worth noting is that on macOS /etc is actually a link to /private/etc (afaik).

Ignoring all the warnings I decided to run `dkp-pacman -S switch-dev --force`, which worked fine. Except that it removed the /etc link and created a 'real' /etc directory (probably because it wants to place devkit-env.sh in /etc/profile.d)
At this point macOS started breaking down, because all kinds of files where 'missing' in /etc. Simply rebooting into recovery mode and running `ln -s /private/etc /etc` fixed the problem.

Just before writing this post I tried this again with the `3ds-dev` package, but without --force. To my suprise it still removed the /etc link and created a new /etc directory.
Console log

WinterMute
Site Admin
Posts: 1400
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: dkp-pacman removes /etc link on macOS

Post by WinterMute » Thu Jun 07, 2018 3:14 pm

My apologies, that package should probably have been placed in the dkp-linux repo rather than dkp-libs.

On my system even --force doesn't allow pacman to overwrite the symlink which I presume is System Integrity Protection in action even though /etc isn't listed at https://support.apple.com/en-gb/HT204899. Did you disable it?

For now I'm going to move that particular package over to the dkp-linux repo but I do still need to find a way to set the environment variables on OSX. Any ideas on how best to do it (probably for the pacman installer itself)?
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Fusion86
Posts: 2
Joined: Thu Jun 07, 2018 8:31 am

Re: dkp-pacman removes /etc link on macOS

Post by Fusion86 » Wed Jun 13, 2018 9:39 am

Yes I did disable SIP.

As for environment variables you could either just put them in ~/.profile or print them to the screen and ask users to set them manually, since there are quite a few users who don't use the built-in bash (e.g I use fish and always set the environment vars myself, so I wouldn't be the best person to ask).

Oh and thanks for your quick response :)

Rajveer
Posts: 8
Joined: Sat Jan 24, 2009 11:37 pm

Re: dkp-pacman removes /etc link on macOS

Post by Rajveer » Fri Sep 07, 2018 1:05 am

I've recently reinstalled everything on macOS using pacman and it's a massive improvement! Are you still looking for a good way to set environmental variables? If so I place the attached launchctl job plist (zipped as I can't upload plist files) in to "/Library/LaunchAgents/" (or "~/Library/LaunchAgents"). This sets environmental variables which seem to work in both bash and in Xcode, maybe something similar could be done during installation.
Attachments
devkitProEnvironmentalVariables.zip
(491 Bytes) Downloaded 149 times

WinterMute
Site Admin
Posts: 1400
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: dkp-pacman removes /etc link on macOS

Post by WinterMute » Wed Nov 14, 2018 1:18 am

Thanks for this Rajveer. I can hopefully test this & add it to the installer in a couple of days.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Rajveer
Posts: 8
Joined: Sat Jan 24, 2009 11:37 pm

Re: dkp-pacman removes /etc link on macOS

Post by Rajveer » Thu Nov 15, 2018 8:25 pm

No problem, hope it helps :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest