Etc portage package unmask needs updating
Gentoo is based on the sources, so these tools will automatically download the sources and compile the program and all its necessary dependencies.
In other words, if you need a program which is not provided with the official System Rescue Cd, and if this package is supported by Gentoo, then use the Gentoo commands such as to manage the packages.
That’s why important header files are included on the official System Rescue Cd.
If you install a program which has other dependencies, and header files have been removed to save space, reinstall dependencies even if they are already part of the system according to the package management system.
You can create a swap partition in order to avoid problems with the squashfs step in the script.
You may also be interested in a procedure which explains how to build a System Rescue Cd with your own kernel.