Skip to content

Provide alternative Bash script#27

Open
JunielKatarn wants to merge 9 commits into
darwin-containers:mainfrom
JunielKatarn:speedup
Open

Provide alternative Bash script#27
JunielKatarn wants to merge 9 commits into
darwin-containers:mainfrom
JunielKatarn:speedup

Conversation

@JunielKatarn
Copy link
Copy Markdown
Contributor

As observed in macOS versions 12 and later, paths computed by otool -L no longer exist in the raw file system, but are contained in the DYLD cache (i.e. /System/Library/dyld).
This makes checking every single element being copied into the jail (chroot directory structure) for OTOOL dependencies completely redundant.
The main Python script may not be necessary for the currently supported macOS version range (12-15).

This PR provides the alternative simplified shell script that calls rsync directly on the known paths to be installed into the jail, including the DYLD cache. The running time benefits can be measured dozens of minutes.

Testing

  1. Created a new jail in macOS 12.
  2. Created a TAR archive from such jail.
  3. Uploaded the archive to a new image in a private Docker registry.
  4. Pulled and ran the image in a second machine.

Result: The image ran as expected without issues.

Notes

  • The script installs the command line tools (compilers). This could be optional to save drive space.
  • I had to manually link /var/run/mDNSResponder. Should we add this to the script? What is the risk, based on the commented-out code in main.py?

@slonopotamus
Copy link
Copy Markdown
Collaborator

I had to manually link /var/run/mDNSResponder. Should we add this to the script?

We don't want that symlink to be in chroot dir when it is loaded into Docker. Possibly there should be a command-line option whether to create it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants