Dev/chroot-scripts

From Whonix
< Dev
Jump to navigation Jump to search

Chroot Scripts[edit]

What are Chroot Scripts?[edit]

Some operations for building Whonix ™ cannot run as part Debian maintainer scripts (preinst, postinst, prerm, postrm). Those are installed by whonix-initializer to /usr/lib/anon-dist/chroot-scripts-post.d. When those scripts are just installed, they do nothing. Those scripts are run in lexical order after package installation by a later build step of Whonix ™ build script (see #Introduction for overview).

How many chroot-scripts are there and what are they used for?[edit]

Introduction[edit]

To get an always up to date list of packages that do ship chroot-scripts, you could run find from within Whonix ™ source code folder.

find . -type f -ipath *chroot-script* | sort

Here is the result that has been written at time of Whonix ™ git tag 13.0.0.1.1.

./build-steps.d/2300_run-chroot-scripts-post-d
./packages/whonix-initializer/usr/lib/anon-dist/chroot-scripts-post.d/20_sanity_checks
./packages/whonix-initializer/usr/lib/anon-dist/chroot-scripts-post.d/75_sources
./packages/whonix-initializer/usr/lib/anon-dist/chroot-scripts-post.d/80_cleanup

So let's go through them one by one.

run-chroot-scripts-post-d[edit]

./build-steps.d/2300_run-chroot-scripts-post-d

This is actually not a chroot-script, it is the build-steps.d/2300_run-chroot-scripts-post-d build step, which is responsible of running all these chroot-scripts at Whonix ™ build time.

anon-shared-build-sanity-checks[edit]

./packages/whonix-initializer/usr/lib/anon-dist/chroot-scripts-post.d/20_sanity_checks

anon-shared-build-remember-sources[edit]

./packages/whonix-initializer/usr/lib/anon-dist/chroot-scripts-post.d/75_sources

whonix-initializer[edit]

./packages/whonix-initializer/usr/lib/anon-dist/chroot-scripts-post.d/80_cleanup