QCOM: do not assume we know the kernel version
So far, this script assumes we know the kernel version
installed. Let's assume we don't, so we use -k all for the generation
of the initramfs, which will create the initramfs for all installed
versions. We might install one or more kernel versions, so it makes
sense to generate all corresponding initramfs. Most of the time there
will be just one anyways. We also need to ensure we will copy to $OUT
all versions if needed.
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Change-Id: I286b526fa6d09b96b8a4de1a67b0822abd55bb5f
diff --git a/scripts/QCOM/21-customize b/scripts/QCOM/21-customize
index 1bc0c5e..6c30d6a 100755
--- a/scripts/QCOM/21-customize
+++ b/scripts/QCOM/21-customize
@@ -11,26 +11,17 @@
# Add tsched=0 on module-udev-detect to fix distorted sound
sed -i "s|^load-module module-udev-detect|load-module module-udev-detect tsched=0|" $target/etc/pulse/default.pa
-# In case initrd doesn't exist, create it, else update
-if [ -f $target/boot/initrd.img-${KVERS} ]
-then
- chroot $target /usr/sbin/update-initramfs -u -k ${KVERS}
-else
- chroot $target /usr/sbin/update-initramfs -c -k ${KVERS}
-fi
-
-# Hold the kernel package to avoid kernel upgrade
-# This is a workaround to avoid upgrade the kernel (hence the modules in /lib/modules)
-# without updating the boot image
-$ROOTCMD apt-mark hold linux-image-${KVERS}
+# Rebuild all initramfs/initrd
+rm -f $target/boot/initrd.img-*
+chroot $target /usr/sbin/update-initramfs -c -k all
OUT=$FAI/out
mkdir -p $OUT
-cp $target/boot/vmlinuz-${KVERS} $OUT/
-cp $target/usr/lib/linux-image-${KVERS}/$fdtfile $OUT/
-cp $target/boot/initrd.img-${KVERS} $OUT/
-cp $target/boot/config-${KVERS} $OUT/
-cp $target/boot/System.map-${KVERS} $OUT/
+cp $target/boot/vmlinuz-* $OUT/
+cp -a $target/usr/lib/linux-image-*/ $OUT/dtbs
+cp $target/boot/initrd.img-* $OUT/
+cp $target/boot/config-* $OUT/
+cp $target/boot/System.map-* $OUT/
# Disable GDM3 suspend causes problems in DB845c
# GDM provides PostLogin hook but dosen't set DISPLAY and dconf.