alias tmerge=PORTAGE_CONFIGROOT=CONF_ROOT ROOT=/root/target/image emerge -K (don't actually alias, just set env vars and use EMERGE_DEFAULT_OPTS=-K in make.conf) generate a fake CONF_ROOT with /etc/make.profile (linked based on target arch) and /etc/make.conf (generated) make.conf: PKGDIR=... CFLAGS=? CXXFLAGS=? CHOST=... MAKEOPTS=? EMERGE_LOG_DIR=... (same as PORT_LOGDIR) PORT_LOGDIR=... (create me) PORT_TMPDIR=... (create me) FEATURES=ccache? tmerge -p system (check that it doesn't mention unavailable packages) # Possibly merge with tmerge system ln -s /usr/portage/profiles/x /etc/make.profile tar -zxvf portage-snapshot (or is this just a cp of /usr/portage or something?) generate a new make.conf without PORT_LOGDIR, PKGDIR, etc. Install user-selected packages ln -s /usr/share/zoneinfo/x /etc/localtime (optional) uninstall toolchain and portage (other unwanted stuff too) TIP: To unmerge portage, use equery files portage and delete all files and non-empty directories (will have to emerge gentoolkit, then unmerge it once we have the uninstall list for portage) Package everything - tar/gz or tar/bz2 or one of those and then throw it on an ISO image Notify the user their build is ready