I'm having an issue with the images.sh script not being executed during the CREATE phase of an image build, and I'm hoping to get some guidance on what might be wrong with my setup.
* Environment:
- KIWI version: 10.2.33
- Schema version: 8.0
- Image type: oem disk image with LVM
- Build command: `kiwi-ng --profile=Cloud-GCE-LVM --profile=rocky system build ...`
* Issue:
I have an images.sh script in my image description directory alongside config.sh, but it doesn't appear to be executed during the CREATE phase. There are no log entries indicating it ran, and the modifications I expect it to make to /etc/fstab are not present in the final image.
*Directory structure:*
/path/to/image-description/
├── config.xml (schemaversion="8.0")
├── config.sh (executable, runs successfully during PREPARE)
├── images.sh (executable, does not run)
├── root/ (overlay directory)
└── cloud/ (additional XML configs)
* images.sh script:
#!/bin/bash
set -euxo pipefail
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
echo "Running images.sh for [$kiwi_iname]-[$kiwi_profiles]..."
# Modify /etc/fstab to add mount options
if [ -f /etc/fstab ]; then
cp /etc/fstab /etc/fstab.pre-hardening
sed -i '/[[:space:]]\/home[[:space:]]/ s/defaults/defaults,nodev,nosuid/' /etc/fstab
echo "Modified fstab"
fi
echo "images.sh completed."
* Permissions:
-rwxr-x--- 1 root root 1687 Nov 5 23:27 images.sh
* Why I need images.sh:
The config.sh script runs during the PREPARE phase, but KIWI generates /etc/fstab during the transition from PREPARE to CREATE. I need to modify the fstab after it's been generated by KIWI, which is why I'm trying to use images.sh.
* Questions:
1. Does KIWI 10.x still automatically detect and execute images.sh from the image description directory?
2. Do I need to explicitly reference images.sh in config.xml for schema 8.0?
3. Are there specific requirements for images.sh that I might be missing?
4. Is there a better way to modify /etc/fstab after KIWI generates it during the build process?
* What I've verified:
- config.sh runs successfully and its changes are present in the image
- images.sh has execute permissions
- images.sh is in the same directory as config.sh
- No errors in KIWI build logs related to script execution
I've consulted the KIWI documentation which mentions images.sh should run during CREATE phase, but I can't find specific information about schema 8.0 requirements or version 10.x changes.
Any guidance would be greatly appreciated!
Thank you!
-Matt