samples: zephyr: use unified application
Replace the hello1 and hello2 applications with hello-world.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
diff --git a/samples/zephyr/Makefile b/samples/zephyr/Makefile
index 2b82982..a2b68b5 100644
--- a/samples/zephyr/Makefile
+++ b/samples/zephyr/Makefile
@@ -100,18 +100,18 @@
# Build and sign "hello1".
hello1: check
- $(MAKE) -C hello1 BOARD=$(BOARD) -j$(nproc)
+ $(MAKE) -C hello-world FROM_WHO="hello1" O=outdir/hello1/$(BOARD) BOARD=$(BOARD) -j$(nproc)
$(IMGTOOL) sign \
--key $(SIGNING_KEY) \
--header-size $(BOOT_HEADER_LEN) \
--align $(FLASH_ALIGNMENT) \
--version 1.2 \
--included-header \
- hello1/outdir/$(BOARD)/zephyr.bin \
+ hello-world/outdir/hello1/$(BOARD)/zephyr.bin \
signed-hello1.bin
clean_hello1: check
- rm -rf hello1/outdir/$(BOARD)
+ rm -rf hello-world/outdir/hello1/$(BOARD)
# Build and sign "hello2".
# This is the same signing command as above, except that it adds the
@@ -119,7 +119,7 @@
# this image is intended to be an upgrade. It should be flashed into
# slot1 instead of slot0.
hello2: check
- $(MAKE) -C hello2 BOARD=$(BOARD) -j$(nproc)
+ $(MAKE) -C hello-world FROM_WHO="hello2" O=outdir/hello2/$(BOARD) BOARD=$(BOARD) -j$(nproc)
$(IMGTOOL) sign \
--key $(SIGNING_KEY) \
--header-size $(BOOT_HEADER_LEN) \
@@ -127,11 +127,11 @@
--version 1.2 \
--included-header \
--pad 0x60000 \
- hello2/outdir/$(BOARD)/zephyr.bin \
+ hello-world/outdir/hello2/$(BOARD)/zephyr.bin \
signed-hello2.bin
clean_hello2: check
- rm -rf hello2/outdir/$(BOARD)
+ rm -rf hello-world/outdir/hello2/$(BOARD)
flash_boot:
$(PYOCD_FLASHTOOL) -ce -a 0 mcuboot.bin
diff --git a/samples/zephyr/README.md b/samples/zephyr/README.md
index 1aaa8c1..cd99247 100644
--- a/samples/zephyr/README.md
+++ b/samples/zephyr/README.md
@@ -8,6 +8,3 @@
Please see the comments in the Makefile in this directory for more
details on how to build and test this application.
-
-The hello applications were taken directly from the Zephyr source
-tree.
diff --git a/samples/zephyr/hello1/Makefile b/samples/zephyr/hello1/Makefile
deleted file mode 100644
index e70a750..0000000
--- a/samples/zephyr/hello1/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-BOARD ?= qemu_x86
-CONF_FILE = prj.conf
-
-include ${ZEPHYR_BASE}/Makefile.test
diff --git a/samples/zephyr/hello1/README.rst b/samples/zephyr/hello1/README.rst
deleted file mode 100644
index 52a25d7..0000000
--- a/samples/zephyr/hello1/README.rst
+++ /dev/null
@@ -1,38 +0,0 @@
-.. _hello_world:
-
-Hello World
-###########
-
-Overview
-********
-A simple Hello World example that can be used with any supported board and
-prints 'Hello World' to the console. This application can be built into modes:
-
-* single thread
-* multi threading
-
-Building and Running
-********************
-
-This project outputs 'Hello World' to the console. It can be built and executed
-on QEMU as follows:
-
-.. code-block:: console
-
- $ cd samples/hello_world
- $ make run
-
-
-To build the single thread version, use the supplied configuration file for
-single thread: :file:`prj_single.conf`:
-
-.. code-block:: console
-
- $ make CONF_FILE=prj_single.conf run
-
-Sample Output
-=============
-
-.. code-block:: console
-
- Hello World! x86
diff --git a/samples/zephyr/hello1/frdm_k64f.overlay b/samples/zephyr/hello1/frdm_k64f.overlay
deleted file mode 100644
index 8ca56d7..0000000
--- a/samples/zephyr/hello1/frdm_k64f.overlay
+++ /dev/null
@@ -1,9 +0,0 @@
-/* DTS overlay file.
- * vim: ft=dts
- */
-
-/ {
- chosen {
- zephyr,code-partition = &slot0_partition;
- };
-};
diff --git a/samples/zephyr/hello1/prj.conf b/samples/zephyr/hello1/prj.conf
deleted file mode 100644
index b5d941b..0000000
--- a/samples/zephyr/hello1/prj.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-# Enable the console
-CONFIG_CONSOLE_SHELL=y
-CONFIG_KERNEL_SHELL=y
-
-# Use the bootloader.
-CONFIG_BOOT_HEADER=y
-CONFIG_TEXT_SECTION_OFFSET=0x200
diff --git a/samples/zephyr/hello1/sample.yaml b/samples/zephyr/hello1/sample.yaml
deleted file mode 100644
index 47396bf..0000000
--- a/samples/zephyr/hello1/sample.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-sample:
- name: hello world
- description: Hello World sample, the simplest Zephyr application
- platforms: all
-tests:
- - test:
- build_only: true
- tags: samples tests
- min_ram: 16
- - singlethread:
- build_only: true
- extra_args: CONF_FILE=prj_single.conf
- filter: not CONFIG_BLUETOOTH and not CONFIG_GPIO_SCH
- tags: samples tests
- min_ram: 16
diff --git a/samples/zephyr/hello1/src/Makefile b/samples/zephyr/hello1/src/Makefile
deleted file mode 100644
index 00066e1..0000000
--- a/samples/zephyr/hello1/src/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-obj-y = main.o
diff --git a/samples/zephyr/hello1/src/main.c b/samples/zephyr/hello1/src/main.c
deleted file mode 100644
index 3acc91d..0000000
--- a/samples/zephyr/hello1/src/main.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2012-2014 Wind River Systems, Inc.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-#include <zephyr.h>
-#include <misc/printk.h>
-
-void main(void)
-{
- printk("Hello World number 1! %s\n", CONFIG_ARCH);
-}
diff --git a/samples/zephyr/hello2/Makefile b/samples/zephyr/hello2/Makefile
deleted file mode 100644
index e70a750..0000000
--- a/samples/zephyr/hello2/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-BOARD ?= qemu_x86
-CONF_FILE = prj.conf
-
-include ${ZEPHYR_BASE}/Makefile.test
diff --git a/samples/zephyr/hello2/README.rst b/samples/zephyr/hello2/README.rst
deleted file mode 100644
index 52a25d7..0000000
--- a/samples/zephyr/hello2/README.rst
+++ /dev/null
@@ -1,38 +0,0 @@
-.. _hello_world:
-
-Hello World
-###########
-
-Overview
-********
-A simple Hello World example that can be used with any supported board and
-prints 'Hello World' to the console. This application can be built into modes:
-
-* single thread
-* multi threading
-
-Building and Running
-********************
-
-This project outputs 'Hello World' to the console. It can be built and executed
-on QEMU as follows:
-
-.. code-block:: console
-
- $ cd samples/hello_world
- $ make run
-
-
-To build the single thread version, use the supplied configuration file for
-single thread: :file:`prj_single.conf`:
-
-.. code-block:: console
-
- $ make CONF_FILE=prj_single.conf run
-
-Sample Output
-=============
-
-.. code-block:: console
-
- Hello World! x86
diff --git a/samples/zephyr/hello2/frdm_k64f.overlay b/samples/zephyr/hello2/frdm_k64f.overlay
deleted file mode 100644
index 8ca56d7..0000000
--- a/samples/zephyr/hello2/frdm_k64f.overlay
+++ /dev/null
@@ -1,9 +0,0 @@
-/* DTS overlay file.
- * vim: ft=dts
- */
-
-/ {
- chosen {
- zephyr,code-partition = &slot0_partition;
- };
-};
diff --git a/samples/zephyr/hello2/prj.conf b/samples/zephyr/hello2/prj.conf
deleted file mode 100644
index b5d941b..0000000
--- a/samples/zephyr/hello2/prj.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-# Enable the console
-CONFIG_CONSOLE_SHELL=y
-CONFIG_KERNEL_SHELL=y
-
-# Use the bootloader.
-CONFIG_BOOT_HEADER=y
-CONFIG_TEXT_SECTION_OFFSET=0x200
diff --git a/samples/zephyr/hello2/sample.yaml b/samples/zephyr/hello2/sample.yaml
deleted file mode 100644
index 47396bf..0000000
--- a/samples/zephyr/hello2/sample.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-sample:
- name: hello world
- description: Hello World sample, the simplest Zephyr application
- platforms: all
-tests:
- - test:
- build_only: true
- tags: samples tests
- min_ram: 16
- - singlethread:
- build_only: true
- extra_args: CONF_FILE=prj_single.conf
- filter: not CONFIG_BLUETOOTH and not CONFIG_GPIO_SCH
- tags: samples tests
- min_ram: 16
diff --git a/samples/zephyr/hello2/src/Makefile b/samples/zephyr/hello2/src/Makefile
deleted file mode 100644
index 00066e1..0000000
--- a/samples/zephyr/hello2/src/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-obj-y = main.o
diff --git a/samples/zephyr/hello2/src/main.c b/samples/zephyr/hello2/src/main.c
deleted file mode 100644
index 784f206..0000000
--- a/samples/zephyr/hello2/src/main.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2012-2014 Wind River Systems, Inc.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-#include <zephyr.h>
-#include <misc/printk.h>
-
-void main(void)
-{
- printk("Upgraded hello! %s\n", CONFIG_ARCH);
-}