Allow support for uImage and Zimage
PATCH 1/1 Allow support for uImage and Zimage
* There is a possibility some SDKs will use uImage while others will use zImage.
* Support both choices.
--- lib/oesdk/bitbake-test-sdk-image | 2 +- lib/oesdk/package-sdks | 11 ++++++----- lib/run-opentest | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-)
lib/oesdk/bitbake-test-sdk-image +1 -1
@@ -174,7 +174,7 @@ extract_sdk_image() { cp $sdk_path/$filesys $test_dir/temp/filesystem # Find the kernel image - kernel=`find ./$sdk_path -name "uImage-$m.bin" | xargs basename` + kernel=`find ./$sdk_path -name "[uz]Image-$m.bin" | xargs basename` # This is a critical failure and will not be able to be skipped if [ -z "$kernel" ] then
lib/oesdk/package-sdks +6 -5
@@ -48,18 +48,19 @@ create_sd_card_content() { rm u-boot-spl.bin-$m fi - # For some devices the uImage and dtb files are read from the /boot - # directory of the rootfs. In this case do not package the uImage + # For some devices the uImage/zImage and dtb files are read from the /boot + # directory of the rootfs. In this case do not package the uImage/zImage # and device tree files into the boot partition as it will cause # confusion. if [ "$PACKAGE_BOOT_KERNEL_FILES" = "true" ] then - if [ -e uImage-$m.bin ] + if [ -e uImage-$m.bin -o -e zImage-$m.bin ] then - mv uImage-$m.bin uImage + kernel_image=`ls | grep [uz]Image-$m.bin | grep -o [uz]Image` + mv [uz]Image-$m.bin $kernel_name fi else - rm -f uImage* + rm -f [uz]Image* rm -f *.dtb fi
lib/run-opentest +2 -2
@@ -170,9 +170,9 @@ run_target_side_test() { return 1 fi - if [ -f $test_dir/temp/board-support/prebuilt-images/uImage-$m.bin ] + if [ -f $test_dir/temp/board-support/prebuilt-images/uImage-$m.bin -o -f $test_dir/temp/board-support/prebuilt-images/zImage-$m.bin ] then - kernel=$test_dir/temp/board-support/prebuilt-images/uImage-$m.bin + kernel=$test_dir/temp/board-support/prebuilt-images/[uz]Image-$m.bin if [ "$odtb" ] then dtb="~dtb=$test_dir/temp/board-support/prebuilt-images/$odtb"
Signature · 1 line
1.7.0.4
Quoted 31 lines · Franklin S. Cooper Jr
* There is a possibility some SDKs will use uImage while others will use zImage.
* Support both choices.Signed-off-by Franklin S. Cooper Jr <[email protected]>--- lib/oesdk/bitbake-test-sdk-image | 2 +- lib/oesdk/package-sdks | 11 ++++++----- lib/run-opentest | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-)lib/oesdk/bitbake-test-sdk-image +1
-1@@ -174,7 +174,7 @@ extract_sdk_image() { cp $sdk_path/$filesys $test_dir/temp/filesystem # Find the kernel image - kernel=`find ./$sdk_path -name "uImage-$m.bin" | xargs basename` + kernel=`find ./$sdk_path -name "[uz]Image-$m.bin" | xargs basename` # This is a critical failure and will not be able to be skipped if [ -z "$kernel" ] thenlib/oesdk/package-sdks +0
-0@@ -48,18 +48,19 @@ create_sd_card_content() { rm u-boot-spl.bin-$m fi
lib/oesdk/package-sdks create_sd_card_content() { · line 57
Quoted 10 lines
lib/oesdk/package-sdks +3
-3- # For some devices the uImage and dtb files are read from the /boot - # directory of the rootfs. In this case do not package the uImage + # For some devices the uImage/zImage and dtb files are read from the /boot + # directory of the rootfs. In this case do not package the uImage/zImage # and device tree files into the boot partition as it will cause # confusion. if [ "$PACKAGE_BOOT_KERNEL_FILES" = "true" ] then - if [ -e uImage-$m.bin ] + if [ -e uImage-$m.bin -o -e zImage-$m.bin ]
This is fine, but [ -e [uz]Image-$m.bin ] should also work...
lib/oesdk/package-sdks create_sd_card_content() { · line 59
Quoted 3 lines
lib/oesdk/package-sdks +1
-1then - mv uImage-$m.bin uImage + kernel_image=`ls | grep [uz]Image-$m.bin | grep -o [uz]Image`
Bash is capable of expanding regular expressions, so "ls [uz]Image-$m.bin" should be fine.
lib/oesdk/package-sdks create_sd_card_content() { · line 60
Quoted 1 line
lib/oesdk/package-sdks +1
-0+ mv [uz]Image-$m.bin $kernel_name
Hmm, here you set kernel_image variable and then use $kernel_name instead.
Quoted 12 lines
lib/oesdk/package-sdks +1
-1fi else - rm -f uImage* + rm -f [uz]Image* rm -f *.dtb filib/run-opentest +0
-0
lib/run-opentest run_target_side_test() { · line 173
Quoted 5 lines
lib/run-opentest +1
-1@@ -170,9 +170,9 @@ run_target_side_test() { return 1 fi - if [ -f $test_dir/temp/board-support/prebuilt-images/uImage-$m.bin ] + if [ -f $test_dir/temp/board-support/prebuilt-images/uImage-$m.bin -o -f $test_dir/temp/board-support/prebuilt-images/zImage-$m.bin ]
Same comment as above, you can pass regexp [uz]Image to [ ] test
lib/run-opentest run_target_side_test() { · line 175
Quoted 3 lines
lib/run-opentest +1
-1then - kernel=$test_dir/temp/board-support/prebuilt-images/uImage-$m.bin + kernel=$test_dir/temp/board-support/prebuilt-images/[uz]Image-$m.bin
As we found out, assigning regexp to a variable doesn't always get it expanded, so you may end up with [uz]Image literal in your $kernel variable - make sure it's being used as is later on, or you may not get the epected resukts...
Quoted 10 lines
lib/run-opentest +0
-0if [ "$odtb" ] then dtb="~dtb=$test_dir/temp/board-support/prebuilt-images/$odtb"Signature · 6 lines
1.7.0.4 _______________________________________________ meta-arago mailing list [email protected] http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago
Quoted 2 lines · Franklin S. Cooper Jr
* There is a possibility some SDKs will use uImage while others will use zImage.
* Support both choices.
And by the way, as Chase just noticed, run-opentest part has been already patched before, please rebase your tree with the mainline:
Quoted 72 lines
Signed-off-by Franklin S. Cooper Jr <[email protected]>--- lib/oesdk/bitbake-test-sdk-image | 2 +- lib/oesdk/package-sdks | 11 ++++++----- lib/run-opentest | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-)lib/oesdk/bitbake-test-sdk-image +1
-1@@ -174,7 +174,7 @@ extract_sdk_image() { cp $sdk_path/$filesys $test_dir/temp/filesystem # Find the kernel image - kernel=`find ./$sdk_path -name "uImage-$m.bin" | xargs basename` + kernel=`find ./$sdk_path -name "[uz]Image-$m.bin" | xargs basename` # This is a critical failure and will not be able to be skipped if [ -z "$kernel" ] thenlib/oesdk/package-sdks +6
-5@@ -48,18 +48,19 @@ create_sd_card_content() { rm u-boot-spl.bin-$m fi - # For some devices the uImage and dtb files are read from the /boot - # directory of the rootfs. In this case do not package the uImage + # For some devices the uImage/zImage and dtb files are read from the /boot + # directory of the rootfs. In this case do not package the uImage/zImage # and device tree files into the boot partition as it will cause # confusion. if [ "$PACKAGE_BOOT_KERNEL_FILES" = "true" ] then - if [ -e uImage-$m.bin ] + if [ -e uImage-$m.bin -o -e zImage-$m.bin ] then - mv uImage-$m.bin uImage + kernel_image=`ls | grep [uz]Image-$m.bin | grep -o [uz]Image` + mv [uz]Image-$m.bin $kernel_name fi else - rm -f uImage* + rm -f [uz]Image* rm -f *.dtb filib/run-opentest +2
-2@@ -170,9 +170,9 @@ run_target_side_test() { return 1 fi - if [ -f $test_dir/temp/board-support/prebuilt-images/uImage-$m.bin ] + if [ -f $test_dir/temp/board-support/prebuilt-images/uImage-$m.bin -o -f $test_dir/temp/board-support/prebuilt-images/zImage-$m.bin ] then - kernel=$test_dir/temp/board-support/prebuilt-images/uImage-$m.bin + kernel=$test_dir/temp/board-support/prebuilt-images/[uz]Image-$m.bin if [ "$odtb" ] then dtb="~dtb=$test_dir/temp/board-support/prebuilt-images/$odtb"Signature · 6 lines
1.7.0.4 _______________________________________________ meta-arago mailing list [email protected] http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago