aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2017-10-09 11:52:05 +0000
committerLinaro Code Review <review@review.linaro.org>2017-10-09 11:52:05 +0000
commit4526fa99681961592c637956b3a4ececaea1e599 (patch)
treed35e7e085dcb2961d34069285d08f795fd1b7b0a /scripts
parent38db4758f19d0181e36a982a1f109391880c97df (diff)
parent0cc70ab20e04b61131fabf81ac99e9bbaf7373db (diff)
Merge "Split out u-boot, copy artifacts for mkbootimage"
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/DB410C/21-customize44
-rw-r--r--scripts/UBOOT/70-customize18
2 files changed, 41 insertions, 21 deletions
diff --git a/scripts/DB410C/21-customize b/scripts/DB410C/21-customize
index 504e68b..6eb0b6c 100755
--- a/scripts/DB410C/21-customize
+++ b/scripts/DB410C/21-customize
@@ -1,7 +1,10 @@
-#!/bin/sh
+#!/bin/bash
+set -e
+
# Download license file and firmware
if [ -n "${QCOM_FIRMWARE}" ]; then
- rm -rf qcom_firmware && mkdir qcom_firmware && cd qcom_firmware
+ fwdir=`mktemp -d qcom_fwXXXXXX`
+ cd $fwdir
wget -q ${QCOM_FIRMWARE}
echo "${QCOM_FIRMWARE_MD5} $(basename ${QCOM_FIRMWARE})" > MD5
md5sum -c MD5
@@ -10,11 +13,11 @@ if [ -n "${QCOM_FIRMWARE}" ]; then
echo "${QCOM_FIRMWARE_LICENSE_MD5} " linux-board-support-package-*/LICENSE > MD5
md5sum -c MD5
cd -
- MTOOLS_SKIP_CHECK=1 mcopy -i qcom_firmware/linux-board-support-package-*/bootloaders-linux/NON-HLOS.bin \
- ::image/modem.* ::image/mba.mbn ::image/wcnss.* qcom_firmware/linux-board-support-package-*/proprietary-linux
- cp -f qcom_firmware/linux-board-support-package-*/LICENSE $target/etc/QCOM-LINUX-BOARD-SUPPORT-LICENSE
- cp -a qcom_firmware/linux-board-support-package-*/proprietary-linux/* $target/lib/firmware
-
+ MTOOLS_SKIP_CHECK=1 mcopy -i $fwdir/linux-board-support-package-*/bootloaders-linux/NON-HLOS.bin \
+ ::image/modem.* ::image/mba.mbn ::image/wcnss.* $fwdir/linux-board-support-package-*/proprietary-linux
+ cp -f $fwdir/linux-board-support-package-*/LICENSE $target/etc/QCOM-LINUX-BOARD-SUPPORT-LICENSE
+ cp -a $fwdir/linux-board-support-package-*/proprietary-linux/* $target/lib/firmware
+ rm -rf $fwdir
fi
if [ -f $target/etc/NetworkManager/NetworkManager.conf ]; then
@@ -24,22 +27,21 @@ wifi.scan-rand-mac-address=no
EOF
fi
-cat << EOF > $target/etc/default/u-boot
-U_BOOT_FDT=qcom/apq8016-sbc.dtb
-U_BOOT_PARAMETERS="rw rootwait"
-EOF
-
cat << EOF > $target/etc/fstab
/dev/disk/by-partlabel/rootfs / ext4 rw,relatime,data=ordered 0 1
EOF
-# hack - the "make deb" kernel package should handle this
-for kernel in $target/boot/vmlinuz-*
-do
- mv $kernel $kernel.gz
- gunzip $kernel
- ver=$(echo $kernel|sed -e 's,.*vmlinuz-,,')
- chroot $target /usr/sbin/update-initramfs -c -k $ver
-done
+WORKSPACE=${WORKSPACE:-$HOME}
+OUT=$WORKSPACE/out
+mkdir -p $OUT
+cat $target/boot/vmlinuz-${KVERS} $target/usr/lib/linux-image-${KVERS}/$fdtfile >> $OUT/Image.gz
+
+# 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
+cp $target/boot/initrd.img-${KVERS} $OUT/initrd.img
-chroot $target /usr/sbin/u-boot-update||true
diff --git a/scripts/UBOOT/70-customize b/scripts/UBOOT/70-customize
new file mode 100644
index 0000000..5429175
--- /dev/null
+++ b/scripts/UBOOT/70-customize
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+cat << EOF > $target/etc/default/u-boot
+U_BOOT_FDT=$fdtfile
+U_BOOT_PARAMETERS="rw rootwait"
+EOF
+
+# hack - the "make deb" kernel package should handle this
+for kernel in $target/boot/vmlinuz-*
+do
+ mv $kernel $kernel.gz
+ gunzip $kernel
+ ver=$(echo $kernel|sed -e 's,.*vmlinuz-,,')
+ chroot $target /usr/sbin/update-initramfs -c -k $ver||true
+done
+
+chroot $target /usr/sbin/u-boot-update||true