diff --git a/configs/raspberrypi3_config b/configs/raspberrypi3_config index 702af90..cce6d89 100644 --- a/configs/raspberrypi3_config +++ b/configs/raspberrypi3_config @@ -3,6 +3,6 @@ # https://d1b0l86ne08fsf.cloudfront.net/mender-convert/raspberrypi/raspberrypi-integration-scripts.tar.gz RASPBERRYPI_BINARIES="raspberrypi3-integration-2018.07.002.tar.gz" RASPBERRYPI_KERNEL_IMAGE="kernel7.img" -MENDER_KERNEL_IMAGETYPE=zImage +MENDER_KERNEL_IMAGETYPE="zImage" source configs/raspberrypi_config diff --git a/configs/raspberrypi_config b/configs/raspberrypi_config index 82846ed..42f3720 100644 --- a/configs/raspberrypi_config +++ b/configs/raspberrypi_config @@ -43,12 +43,22 @@ function platform_modify() { # the service. run_and_log_cmd "sudo ln -sf /dev/null work/rootfs/etc/systemd/system/udisks2.service" + # Ubuntu Server images actually use U-boot by default on RPi3 and the + # layout is slightly different on the boot partition. That is why we need + # additional logic here to determinant what we are converting. + if [ -e work/boot/uboot.bin ] && [ -e work/boot/vmlinuz ]; then + RASPBERRYPI_KERNEL_IMAGE="vmlinuz" + RASPBERRYPI_BOOTLOADER_IMAGE="uboot.bin" + else + RASPBERRYPI_BOOTLOADER_IMAGE="${RASPBERRYPI_KERNEL_IMAGE}" + fi + # Extract Linux kernel and install to /boot directory on rootfs run_and_log_cmd "sudo cp work/boot/${RASPBERRYPI_KERNEL_IMAGE} work/rootfs/boot/${MENDER_KERNEL_IMAGETYPE}" # Replace kernel with U-boot and add boot script run_and_log_cmd "sudo mkdir -p work/rootfs/uboot" - run_and_log_cmd "sudo cp work/rpi/binaries/u-boot.bin work/boot/${RASPBERRYPI_KERNEL_IMAGE}" + run_and_log_cmd "sudo cp work/rpi/binaries/u-boot.bin work/boot/${RASPBERRYPI_BOOTLOADER_IMAGE}" run_and_log_cmd "sudo cp work/rpi/binaries/boot.scr work/boot" run_and_log_cmd "sudo cp work/rpi/binaries/fw_env.config work/rootfs/etc/" @@ -62,6 +72,8 @@ function platform_modify() { run_and_log_cmd "sudo ln -fs /sbin/fw_printenv work/rootfs/sbin/fw_setenv" # Remove original 'resize2fs_once' script and its symbolic link. - run_and_log_cmd "sudo unlink work/rootfs/etc/rc3.d/S01resize2fs_once" - run_and_log_cmd "sudo rm work/rootfs/etc/init.d/resize2fs_once" + if [ -L work/rootfs/etc/rc3.d/S01resize2fs_once ]; then + run_and_log_cmd "sudo unlink work/rootfs/etc/rc3.d/S01resize2fs_once" + fi + run_and_log_cmd "sudo rm -f work/rootfs/etc/init.d/resize2fs_once" } diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 452725f..b0d17c0 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -25,6 +25,9 @@ TINKER_IMAGE_URL="http://dlcdnet.asus.com/pub/ASUS/mb/Linux/Tinker_Board_2GB/${T UBUNTU_IMAGE="Ubuntu-Bionic-x86-64.img" UBUNTU_IMAGE_URL="https://d1b0l86ne08fsf.cloudfront.net/mender-convert/images/${UBUNTU_IMAGE}.gz" +UBUNTU_SERVER_RPI_IMAGE="ubuntu-18.04.3-preinstalled-server-armhf+raspi3.img" +UBUNTU_SERVER_RPI_IMAGE_URL="http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/${UBUNTU_SERVER_RPI_IMAGE}.xz" + MENDER_ACCEPTANCE_URL="https://raw.githubusercontent.com/mendersoftware/meta-mender/master/tests/acceptance" # Some distros do not have /sbin in path for "normal users" @@ -159,4 +162,11 @@ convert_and_test "beaglebone" \ "${BBB_DEBIAN_IMAGE}" \ "${BBB_DEBIAN_IMAGE}.xz" || test_result=$? +convert_and_test "ubuntu" \ + "release-1" \ + "${UBUNTU_SERVER_RPI_IMAGE_URL}" \ + "${UBUNTU_SERVER_RPI_IMAGE}" \ + "${UBUNTU_SERVER_RPI_IMAGE}.xz" \ + "configs/raspberrypi3_config" || test_result=$? + exit $test_result