Skip to content

Commit a1e3eb6

Browse files
rootfs(policy): remove Debian-specific DTB injection from generic rootfs builder
Context - The script carried a platform-specific Debian path that: - searched for `glymur-crd.dtb`, - created `/boot/dtb` symlink, - patched `grub.cfg` to inject `devicetree` directives. - This behavior is board-specific policy, not generic rootfs assembly responsibility. Implementation - Remove the Debian-only DTB injection block entirely, including conditional guard, filesystem probing, symlink synthesis, and GRUB mutation. Architectural rationale - Keep `build-rootfs.sh` focused on distribution-agnostic image construction. - Avoid embedding platform policy and hardcoded DTB assumptions in a shared reusable tool. - Defer DTB/boot policy to dedicated metadata/build layers that own board-specific behavior. Operational impact - Reduces implicit side effects in generated GRUB config. - Improves portability and maintainability of rootfs construction across product lines. Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
1 parent 127416c commit a1e3eb6

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

rootfs/scripts/build-rootfs.sh

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -675,32 +675,6 @@ sed -i 's/search --no-floppy --fs-uuid --set=root .*/search --no-floppy --label
675675
# conflicts with our 'root=LABEL=system' argument.
676676
sed -i 's/root=\/dev\/[^ ]* //g' /boot/grub/grub.cfg
677677
678-
# ==============================================================================
679-
# Device Tree Configuration for Debian platforms
680-
# ==============================================================================
681-
682-
if [ "\${distro_lc}" = "debian" ]; then
683-
echo '[INFO][CHROOT] Debian target detected. Configuring platform Device Tree...'
684-
685-
# Locate the platform Device Tree Blob (DTB) in standard library or firmware paths
686-
DTB_PATH=\$(find /usr/lib /lib/firmware -name "glymur-crd.dtb" -print -quit)
687-
688-
if [ -n "\$DTB_PATH" ]; then
689-
echo "[INFO][CHROOT] Platform DTB resolved: \$DTB_PATH"
690-
691-
# Ensure DTB is accessible in the bootloader's filesystem scope
692-
ln -sf "\$DTB_PATH" /boot/dtb
693-
694-
# Inject the devicetree directive into the generated GRUB configuration.
695-
# This appends the command immediately following the 'initrd' load.
696-
sed -i "/^[[:space:]]*initrd/a \ devicetree /boot/dtb" /boot/grub/grub.cfg
697-
698-
echo '[SUCCESS][CHROOT] Device Tree directive injected into /boot/grub/grub.cfg'
699-
else
700-
echo '[WARN][CHROOT] Target DTB (glymur-crd.dtb) not found. Skipping injection.'
701-
fi
702-
fi
703-
704678
echo '[CHROOT] Capturing post-install package list...'
705679
dpkg-query -W -f='\${Package} \${Version}\n' > /tmp/\${CODENAME}_post.manifest
706680

0 commit comments

Comments
 (0)