Debconf Preseeding of
Installed Packages
You can provide Debconf preseed files (see section
4.3.2
, “
Creating a Preseed File
”
[page 97] for explanations) as
preseed/*.cfg
files. They will be used to configure
the packages installed in the live file system.
244
Kali Linux Revealed
9.3.4. Using Hooks to Tweak the Contents of the Image
live-build
offers hooks that can be executed at different steps of the build process. Chroot
hooks are executable scripts that you install as
hooks/live/*.chroot
files in your config tree
and that are executed within the chroot. While
chroot
is the command that lets you temporar-
ily changes the operating system’s root directory to a directory of your choice, it is also used
by extension to designate a directory hosting a full (alternate) file system tree. This is the case
here with
live-build
, where the chroot directory is the directory where the live file system is
being prepared. Since applications started in a chroot can’t see outside of that directory, the
same goes with the chroot hooks: you can only use and modify anything available in that ch-
root environment. We rely on those hooks to perform multiple Kali specific customizations (see
kali-config/common/hooks/live/kali-hacks.chroot
).
Binary hooks (
hooks/live/*.binary
) are executed in the context of the build process (and not
chrooted anywhere) at the end of the process. You can modify the content of the ISO image built
but not of the live file system since at this point, it has already been generated. We use this feature
in Kali to make some changes to the default isolinux configuration generated by live-build. For
example, see
kali-config/common/hooks/live/persistence.binary
where we add the boot
menu entries enabling persistence.
9.3.5. Adding Files in the ISO Image or in the Live Filesystem
Another very common customization is to add files either in the live file system or in the ISO
image.
You can add files to the live file system by putting them at their expected location be-
low the
includes.chroot
config directory. For example, we provide
kali-config/common/
includes.chroot/usr/lib/live/config/0031-kali-password
, which ends up as
/usr/lib/
live/config/0031-kali-password
in the live file system.
Live-Boot Hooks
Scripts installed as
/lib/live/config/
XXXX
-
name
are executed by the init script
of the live-boot package. They reconfigure many aspects of the system to be suited
for a live system. You can add scripts of your own to customize your live system at
run-time: it’s notably used to implement a custom boot parameter for example.
You can add files to the ISO image by putting them at their expected location below the
includes.
binary
config directory. For example, we provide
kali-config/common/includes.binary/
isolinux/splash.png
to override the background image used by the Isolinux bootloader (which
is stored in
/isolinux/splash.png
in the filesystem of the ISO image).
245
Chapter 9 — Advanced Usage
|