Ths first line ('... boolean true') is needed to trick debian-cd into
believing that the type of the question is a boolean.
Otherwise debian-cd will think that the question doesn't exist, probably
because it doesn't know the type, probably because there's no type to
start with (this is an error message, not a question).
FTR, without the first line, it fails with:
2022-08-04 10:05:37,846 DEBUG Checking configuration...
error: Cannot find a question for encfs/security-information
2022-08-04 10:05:38,016 ERROR preseed file invalid:
<<LBDIR>>/simple-cdd/profiles/kali.preseed
The function get_user_list returns a list of users on stdout, so
obviously it can't use stdout to also display messages. Use stderr
instead.
Note that we could also silently skip if we find a directory in /home
that is not a user. Does it happen in practice?
The vboxsf group is created by the postinst script of the package
virtualbox-guest-utils. The kali user needs to be part of this group
in order to access VirtualBox's shared folders.
This change does just that. It's effective for all the Live images
(where VirtualBox guest additions are installed unconditionnally),
and for the systems installed by the Installer image where VirtualBox
was detected (and therefore VirtualBox guest additions were installed).
Ref: <https://bugs.kali.org/view.php?id=7643>
Up to now, it was fine to use a command such as:
usermod -a -G group1,group2,... kali
However a limitation is that all the groups that are given to the option
-G must exist. If that's not the case, usermod fails (return code: 6)
without doing anything, and the user is not added to any group.
So with this commit, we prepare the code to support optional groups,
that might or might not exist. If ever a group does not exist, it's
skipped silently.
Changes:
- order groups alphabetically
- use the same comment "Ensure those groups exist" consistently in the 2
scripts, and also drop the comment regarding a "generically named"
function.
- adds "|| true" to the usermod command in kali-user-setup (only for
consistency, the script is not run with "set -e" anyway).
After those changes, the two functions "configure_usergroups()" are very
similar, and it's very easy to spot the differences between both.
This was introduced in 5989ec37de, and
probably that was not the intention.
Adding root to groups doesn't break anything, but I don't think it makes
any sense either.
By default, when you don't have any network or when you didn't enable
a network mirror, your sources.list is empty. We don't want this
so we hook into the finish-install step to make sure to set it up
if it's empty.
In theory, this change is not really needed here because the
package is not installed by d-i, it's already installed by live-build
in the live image. But I want this file to be consistent with the
version in debian-installer...
* Add new --variant option to build alternative images of Kali.
* Add new --version option to decide of the name of the generated file.
* Add new --subdir option to indicate where the image must be moved.