aboutsummaryrefslogtreecommitdiff
path: root/lt-qcom-linux-integration
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linaro.org>2018-07-12 19:45:31 -0500
committerAníbal Limón <anibal.limon@linaro.org>2018-07-12 19:45:31 -0500
commitaaab8c8beac4462553818098f404dd0e6893b711 (patch)
tree833209564f6d27bafad1817b6aa507380afc84f8 /lt-qcom-linux-integration
parentc972df48018ab403c5169fec7c72265d0249a5e9 (diff)
lt-qcom-linux-integration/builders.sh: Fix functional testing in sdm845
The sdm845-mtp requires a initramfs to mount rootfs and then executes switch_rootfs because we don't have a Linux bootloader and Android bootloader tries to mount dm-1 device [1]. The Android bootloader appends: androidboot.verifiedbootstate=orange androidboot.keymaster=1 dm=\"1 vroot none ro 1,0 6241776 verity 1 PARTUUID=67df17d5-dde5-884c-5a03-f53b2a9537ed" Causing to wait until /dev/dm-1 available. [1] https://lkft-staging.validation.linaro.org/scheduler/job/4407 Change-Id: I8f5508582c6c03c60a745d7586f887ffae1e267f Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Diffstat (limited to 'lt-qcom-linux-integration')
-rwxr-xr-xlt-qcom-linux-integration/builders.sh89
1 files changed, 77 insertions, 12 deletions
diff --git a/lt-qcom-linux-integration/builders.sh b/lt-qcom-linux-integration/builders.sh
index 5c0121af65..1d2da655c8 100755
--- a/lt-qcom-linux-integration/builders.sh
+++ b/lt-qcom-linux-integration/builders.sh
@@ -1,5 +1,50 @@
#!/bin/bash
+# To use in sdm845-mtp functional testing
+INITRAMFS_ROOTFS=$(cat <<EOF
+#!/bin/sh
+
+HOME=/root
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+export HOME PATH
+
+do_mount_fs() {
+ grep -qa "\$1" /proc/filesystems || return
+ test -d "\$2" || mkdir -p "\$2"
+ mount -t "\$1" "\$1" "\$2"
+}
+
+do_mknod() {
+ test -e "\$1" || mknod "\$1" "\$2" "\$3" "\$4"
+}
+
+mkdir -p /proc
+mount -t proc proc /proc
+
+do_mount_fs sysfs /sys
+do_mount_fs debugfs /sys/kernel/debug
+do_mount_fs devtmpfs /dev
+do_mount_fs devpts /dev/pts
+do_mount_fs tmpfs /dev/shm
+
+mkdir -p /run
+mkdir -p /var/run
+
+/sbin/udevd --daemon
+/bin/udevadm trigger
+
+do_mknod /dev/console c 5 1
+do_mknod /dev/null c 1 3
+do_mknod /dev/zero c 1 5
+
+mkdir -p /rootfs
+mount /dev/__ROOTFS_PARTITION__ /rootfs
+
+echo "All done. Switching to real root."
+exec switch_root /rootfs /sbin/init
+EOF
+)
+
set -x
wget_error() {
@@ -243,19 +288,39 @@ skales-mkbootimg \
--ramdisk_base "${RAMDISK_BASE}" \
--cmdline "root=/dev/ram0 init=/init rw console=tty0 console=${SERIAL_CONSOLE},115200n8"
-# Create boot image (functional)
+# Create boot image (functional), sdm845_mtp requires an initramfs to mount the rootfs and then
+# exec switch_rootfs
boot_rootfs_file=boot-rootfs-${KERNEL_FLAVOR}-${KERNEL_VERSION}-${BUILD_NUMBER}-${MACHINE}.img
-ramdisk_dummy_file=out/initrd.img
-echo "This is not an initrd" > $ramdisk_dummy_file
-skales-mkbootimg \
- --kernel $kernel_file \
- --ramdisk $ramdisk_dummy_file \
- --output out/$boot_rootfs_file \
- $dt_mkbootimg_arg \
- --pagesize "${BOOTIMG_PAGESIZE}" \
- --base "${BOOTIMG_BASE}" \
- --ramdisk_base "${RAMDISK_BASE}" \
- --cmdline "root=${ROOTFS_PARTITION} rw rootwait console=tty0 console=${SERIAL_CONSOLE},115200n8"
+if [ "${MACHINE}" = "sdm845_mtp" ]; then
+ init_file=init
+ init_tar_file=init.tar.gz
+ echo "${INITRAMFS_ROOTFS}" | sed s/__ROOTFS_PARTITION__/${ROOTFS_PARTITION}/g > ./$init_file
+ tar -czf $init_tar_file ./$init_file
+ copy_tarball_to_rootfs "$init_tar_file" "$ramdisk_file" "$ramdisk_file_type"
+ rm -f $init_file $init_tar_file
+
+ skales-mkbootimg \
+ --kernel $kernel_file \
+ --ramdisk $ramdisk_file \
+ --output out/$boot_file \
+ $dt_mkbootimg_arg \
+ --pagesize "${BOOTIMG_PAGESIZE}" \
+ --base "${BOOTIMG_BASE}" \
+ --ramdisk_base "${RAMDISK_BASE}" \
+ --cmdline "root=/dev/ram0 init=/init rw console=tty0 console=${SERIAL_CONSOLE},115200n8"
+else
+ ramdisk_dummy_file=out/initrd.img
+ echo "This is not an initrd" > $ramdisk_dummy_file
+ skales-mkbootimg \
+ --kernel $kernel_file \
+ --ramdisk $ramdisk_dummy_file \
+ --output out/$boot_rootfs_file \
+ $dt_mkbootimg_arg \
+ --pagesize "${BOOTIMG_PAGESIZE}" \
+ --base "${BOOTIMG_BASE}" \
+ --ramdisk_base "${RAMDISK_BASE}" \
+ --cmdline "root=${ROOTFS_PARTITION} rw rootwait console=tty0 console=${SERIAL_CONSOLE},115200n8"
+fi
echo BOOT_FILE=$boot_file >> builders_out_parameters
echo BOOT_ROOTFS_FILE=$boot_rootfs_file >> builders_out_parameters