I just bought a new MacBook Pro, because macOS Monterey doesn't support my 2014 MacBook Pro. I'll blog in more detail about the new MacBook Pro later, but I want to mention something very odd that I quickly discovered: there was an empty AppleInternal folder in the root / folder of Macintosh HD. This was visible in Finder.
The /AppleInternal folder, as its name suggests, is used by Apple engineers for internal development purposes. Some people external to Apple have discovered that creating an /AppleInternal folder on your Mac can cause behavior changes in macOS that may be useful for development purposes. It may also have some undesirable side effects. I don't know the exact details offhand, but I've definitely heard of /AppleInternal before, and the Apple developer community has known of it for quite a while. The question, though, is how did this folder intended for Apple internal development get installed in the factory on a Mac intended for consumers?
I'm not the only person who's seen /AppleInternal on a new Mac. Michael Tsai told me that he saw it on his new MacBook Pro too. And there are reports of it on the web, such as a reddit user who found /AppleInternal on a new M1 MacBook Air.
One minor but annoying side effect of /AppleInternal is that it messes up /Applications path autocompletion in Terminal, so I decided to remove the /AppleInternal folder. On macOS Monterey, /AppleInternal is actually a firmlink. Apple introduced firmlinks in macOS Big Sur and discussed them the 2019 WWDC session What's New in Apple File Systems but otherwise hasn't provided much documentation. Firmlinks are not the same as symbolic links or hard links. Basically, a firmlink is a connection between the read-only system volume and the read-write data volume. Although you can't remove /AppleInternal directly, you can remove the folder /System/Volumes/Data/AppleInternal with the command
sudo rmdir /System/Volumes/Data/AppleInternal in Terminal. Then after you reboot, the /AppleInternal firmlink will be gone.
You can see the list of firmlinks by looking at the contents of the
/usr/share/firmlinks file. The entry
/AppleInternal AppleInternal exists in the file regardless of whether the folder /System/Volumes/Data/AppleInternal exists on disk. If the folder does exist, then macOS creates a firmlink for it.
Apple needs to explain to the public why new Macs are arriving with an /AppleInternal folder. I personally believe that it's just a mistake and not the result of supply chain tampering, but the unpleasant fact remains that these devices are manufactured in a totalitarian nation, so the latter possibility cannot be totally dismissed. Whatever the explanation, it looks like something is going wrong, and the problem ought to be corrected.