-
Notifications
You must be signed in to change notification settings - Fork 11
Enhance FIT image packaging: helper invocation, executable permissions, artifact rename, sector size configurability, and prerequisite installation #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary:
- Updated script header to accurately reflect supported arguments:
* Replaced incorrect `--dtb` with `--metadata`
* Fixed typo `--kob` → `--kobj`
* Added default paths for clarity in options section
- Improved invocation of helper script `generate_boot_bins.sh`:
* Use absolute path based on this script’s directory (`SELF_DIR`) to avoid PATH dependency
* Ensures consistent execution regardless of current working directory
Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
- Set executable permissions for build scripts: * chmod +x kmake-image/make_fitimage.sh * chmod +x kmake-image/generate_boot_bins.sh
Update make_fitimage.sh to rename final packaged image from fit_dtb.bin to dtb.bin for consistency with naming conventions. Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
Introduce a global `--sector-size BYTES` flag that can be specified before the command (`dtb` or `bin`). When present, it overrides the mkfs.vfat logical sector size; when absent, the script retains the existing default `-S 512`. This keeps current behavior unchanged while allowing callers to produce FAT images with non-512 logical sectors when required by tooling or platform constraints. Usage examples: # DTB image with default sector size (512 bytes) ./generate_boot_bins.sh dtb --input out/combined.dtb --output out # DTB image with 4096-byte sectors ./generate_boot_bins.sh --sector-size 4096 dtb --input out/combined.dtb --output out # BIN image with default sector size (512 bytes) ./generate_boot_bins.sh bin --input out/fit_dir --output out/dtb.bin # BIN image with 4096-byte sectors ./generate_boot_bins.sh --sector-size 4096 bin --input out/fit_dir --output out/dtb.bin No changes to image layout or content; only mkfs.vfat invocation is adjusted. Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
…helper Introduce a new `--sector-size BYTES` argument to make_fitimage.sh that controls the logical sector size used when packaging the final FAT image. The value is forwarded as a global flag to generate_boot_bins.sh. When not provided, the script defaults to 512 bytes to preserve existing behavior. Usage examples: # Default 512-byte sectors ./make_fitimage.sh --metadata <path>/qcom-metadata.dts --its <path>/qcom-fitimage.its # Explicit 4096-byte sectors ./make_fitimage.sh --sector-size 4096 --metadata <path>/qcom-metadata.dts --its <path>/qcom-fitimage.its No functional changes to FIT generation; only the final FAT image formatting is affected via mkfs.vfat sector size. Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
Add a conditional apt-get install step for required tools: - device-tree-compiler (provides `dtc` for DTS → DTB compilation) - u-boot-tools (provides `mkimage` for FIT image generation) This step runs only if `apt-get` is available and script executes as root, ensuring the environment has the necessary utilities before proceeding. Improves robustness in CI and containerized builds. Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
| echo "Ensuring prerequisites are installed: device-tree-compiler, u-boot-tools" | ||
| export DEBIAN_FRONTEND=noninteractive | ||
| apt-get update -y | ||
| apt-get install -y device-tree-compiler u-boot-tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dockerfile already installs u-boot-tools; you could also include device-tree-compiler there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both device-tree-compiler AND u-boot-tools are mandatory for the tool to execute, so until BOTH are included in Dockerfile definition, it's a must to have the tool install those as pre-req.
At the same time, there is no harm in having those there, taking in consideration support for local developer workflows independent of docker usage?
This PR introduces multiple improvements to the FIT image packaging mechanism:
Script header and argument fixes
--dtbto--metadatafor clarity.--kob→--kobj.Helper script invocation improvements
generate_boot_bins.shbased on the caller script’s directory.PATHto ensure consistent execution across environments.Executable permissions
chmod +x kmake-image/make_fitimage.shchmod +x kmake-image/generate_boot_bins.shArtifact naming
fit_dtb.bintodtb.binfor consistency with downstream consumers and flashing tools.Sector size configurability
--sector-size <bytes>option togenerate_boot_bins.sh(default:512).dtb,bin,efi) in the invocation.--sector-size <bytes>argument tomake_fitimage.sh(default:512).generate_boot_bins.shfor FAT image creation.Prerequisite installation
apt-get installstep inmake_fitimage.shfor required tools:device-tree-compiler(providesdtc)u-boot-tools(providesmkimage)apt-getis available and script executes as root.Rationale
PATHfor helper script invocation caused failures when executed from different directories.Impact
fit_dtb.binmust be updated todtb.bin.512when required.Usage Examples
Default sector size (512 bytes):
Custom sector size (4096 bytes):