I've been using my own custom live ISO for a couple months now and really enjoy the versatility of it. That said, I use a "post boot" script to perform some additional actions because I couldn't figure out how to get it to work during the build. Here's a link to what I currently have https://github.com/gr4ysku11/kali-gr.../main/build.sh

and below is the code that I'd like to include into the image, instead of running a script after booting:
Code:
# create post-install script and include it in chroot
cat > kali-config/common/includes.chroot/usr/share/gr4ysku11/post-install.sh << EOF

#!/bin/bash
# run this script as kali user, after live boot
# install vscode extensions
echo "installing vscodium extensions..."
codium --install-extension vscodevim.vim > /dev/null 2>&1
codium --install-extension ms-python.python > /dev/null 2>&1
codium --install-extension dendron.dendron-paste-image > /dev/null 2>&1

echo "copying kde config files..."
# copy config/database files for favorites and task manager
cp /usr/share/gr4ysku11/database* ~/.local/share/kactivitymanagerd/resources/
cp /usr/share/gr4ysku11/kactivitymanagerd-statsrc ~/.config
cp /usr/share/gr4ysku11/plasma-org.kde.plasma.desktop-appletsrc ~/.config/

# change default password
passwd
echo "logging out..."

# logout to reload plasma workspace
qdbus org.kde.ksmserver /KSMServer logout 0 3 3
EOF
It takes quite a while for the build to fail, so trying to get it working is painful. If anyone has any ideas on how to get this working it would be much appreciated.

Thanks!