Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/rocko3 #75

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions meta-iot2000-bsp/conf/machine/iot2000.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ require conf/machine/include/meta-intel.inc
require conf/machine/include/intel-quark-common.inc
require conf/machine/include/intel-common-pkgarch.inc

#Avoid pulling in GRUB
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""

MACHINE_FEATURES = "efi usb"

MACHINE_EXTRA_RRECOMMENDS += "kernel-modules linux-firmware"

SERIAL_CONSOLE = "115200 ttyS1"
APPEND += "rootwait console=ttyS1,115200 console=tty0"

EFI_PROVIDER = "systemd-boot"
EFI_PROVIDER = "efibootguard"

# Ensure that the Lock prefix is omitted for the kernel"
# Ensure that the Lock prefix is omitted for the kernel
KERNEL_EXTRA_ARGS = "EXTRA_CFLAGS=-Wa,-momit-lock-prefix=yes"

# Machine specific Image packages:
Expand All @@ -33,3 +30,11 @@ IMAGE_INSTALL_append = " kernel-modules"
PACKAGE_EXTRA_ARCHS_append = " intel-quark quark i586 x86"

INITRD_LIVE_prepend = "${DEPLOY_DIR_IMAGE}/acpi-upgrades-${MACHINE}.cpio "

# runqemu configuration
QB_MEM = "-m 1024"
QB_CPU = "-cpu pentium"
QB_CPU_KVM = "-cpu pentium"
QB_KERNEL_CMDLINE_APPEND = "console=ttyS1"
QB_OPT_APPEND = "-serial pty -serial mon:stdio -device virtio-rng-pci"
QB_NETWORK_DEVICE = "-device virtio-net-pci -device virtio-net-pci,netdev=net0,mac=@MAC@"
6 changes: 3 additions & 3 deletions meta-iot2000-bsp/kas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ repos:

poky:
url: https://git.yoctoproject.org/git/poky
refspec: 7d5822bf4cb2089687c3c9a908cf4a4ef4e9a53a
refspec: 16e22f3e37788afb83044f5089d24187d70094bd
layers:
meta:
meta-poky:
meta-yocto-bsp:

meta-intel:
url: https://git.yoctoproject.org/git/meta-intel
refspec: 6add41510412ca196efb3e4f949d403a8b6f35d7
refspec: aa246ba9855d35d454ddcf041578310cbaa90250

meta-openembedded:
url: http://git.openembedded.org/meta-openembedded
refspec: fe5c83312de11e80b85680ef237f8acb04b4b26e
refspec: 29a4983d5a4462d8e7b9abcd55bfb3013f578fdd
layers:
meta-oe:

Expand Down
8 changes: 0 additions & 8 deletions meta-iot2000-bsp/recipes-core/images/acpi-upgrades.inc

This file was deleted.

2 changes: 0 additions & 2 deletions meta-iot2000-bsp/recipes-core/images/wic-image.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ IMAGE_FSTYPES_append_iot2000 = " wic"
WKS_FILE = "wic-image.${MACHINE}.wks"

WKS_FILE_DEPENDS_BOOTLOADERS_x86 = "systemd-boot"

require recipes-core/images/acpi-upgrades.inc
23 changes: 17 additions & 6 deletions meta-iot2000-bsp/recipes-kernel/linux/configs/defconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.4.92 Kernel Configuration
# Linux/x86 4.4.98 Kernel Configuration
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
Expand Down Expand Up @@ -976,6 +976,7 @@ CONFIG_BRIDGE=m
CONFIG_BRIDGE_IGMP_SNOOPING=y
# CONFIG_BRIDGE_VLAN_FILTERING is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_NET_DSA is not set
CONFIG_VLAN_8021Q=m
# CONFIG_VLAN_8021Q_GVRP is not set
# CONFIG_VLAN_8021Q_MVRP is not set
Expand Down Expand Up @@ -1212,6 +1213,7 @@ CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_RSXX is not set
Expand Down Expand Up @@ -1389,6 +1391,7 @@ CONFIG_SCSI_LOWLEVEL=y
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_VIRTIO is not set
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
# CONFIG_ATA is not set
Expand Down Expand Up @@ -1453,6 +1456,7 @@ CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=m
# CONFIG_TUN_VNET_CROSS_LE is not set
# CONFIG_VETH is not set
CONFIG_VIRTIO_NET=m
# CONFIG_NLMON is not set
# CONFIG_ARCNET is not set

Expand Down Expand Up @@ -1887,13 +1891,15 @@ CONFIG_SERIAL_PCH_UART_CONSOLE=y
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=m
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
CONFIG_HW_RANDOM_INTEL=m
CONFIG_HW_RANDOM_AMD=m
CONFIG_HW_RANDOM_GEODE=m
CONFIG_HW_RANDOM_VIA=m
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_GEODE is not set
# CONFIG_HW_RANDOM_VIA is not set
CONFIG_HW_RANDOM_VIRTIO=m
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
Expand Down Expand Up @@ -2307,6 +2313,7 @@ CONFIG_INTEL_QUARK_DTS_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
# CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED is not set

#
# Watchdog Device Drivers
Expand Down Expand Up @@ -3029,11 +3036,15 @@ CONFIG_UIO=m
# CONFIG_UIO_PRUSS is not set
# CONFIG_UIO_MF624 is not set
# CONFIG_VIRT_DRIVERS is not set
CONFIG_VIRTIO=y

#
# Virtio drivers
#
# CONFIG_VIRTIO_PCI is not set
CONFIG_VIRTIO_PCI=y
# CONFIG_VIRTIO_PCI_LEGACY is not set
# CONFIG_VIRTIO_BALLOON is not set
# CONFIG_VIRTIO_INPUT is not set
# CONFIG_VIRTIO_MMIO is not set

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# long-description: Creates a partitioned EFI disk image for the SIMATIC IOT2000
# that the user can directly dd to boot media.

part /boot --source bootimg-efi --sourceparams="loader=gummiboot" --ondisk mmcblk0 --label msdos --active --align 1024
part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=acpi-upgrades-iot2000.cpio" --ondisk mmcblk0 --label msdos --active --align 1024

part / --source rootfs --ondisk mmcblk0 --fstype=ext3 --label platform --align 1024

bootloader --timeout=0 --append="console=ttyS1,115200n8 reboot=efi,warm rw debugshell=5 rootwait initrd=EFI/BOOT/acpi-upgrades-iot2000.cpio"
bootloader --timeout=0 --append="console=ttyS1,115200n8 reboot=efi,warm rw debugshell=5 rootwait"
35 changes: 35 additions & 0 deletions meta-iot2000-example/README.SWUPDATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Example for efibootguard + SWUpdate support with meta-iot2000

The [kas](https://pypi.python.org/pypi/kas) recipes in

```
meta-iot2000/meta-iot2000-example/kas-update{,-rt}.yml
```

build the base image as well as an update artifact without and with a
real-time kernel respectively, ready to be fed to `SWUpdate`. The recipes contain all needed layer
references.

For `SWUpdate` integration, the official [meta-swupdate](https://github.com/sbabic/meta-swupdate)
layer is used. Per default it installs an init script to start up a webserver for update purposes,
which is not needed for manual updates. For this purpose, it is replaced by an empty
init script.

This example of `SWUpdate` and `efibootguard` integration provides manual update capability only.


The manual update process means, that the `swu` file must be copied onto the finished SD-card. To use it with swupdate, the following command is used:

```
swupdate -i <filepath>.swu
```

Copy link
Collaborator

@jan-kiszka jan-kiszka Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I need reboot (swupdate tells me, but better state this again). But how do I declare the update successful after the reboot? Without that, I will fall back into v1 again.

bg_setenv -c is what I want, I suppose.

## Created artifacts

The aforementioned kas yml files produce the folllowing artifacts in the build folder:

* A flashable image: `tmp/deploy/images/iot2000/iot2000-example-image-iot2000.wic`
* An update artifact: `tmp/deploy/images/iot2000/iot2000-update-image-iot2000.swu`

*Note*:
Per default, the root filesystem included in the update artifact is identical to the one contained in the wic file. The simplest way to enhance the update artifact is to make it depend on a different image and set `SWUPDATE_IMAGES, SWUPDATE_IMAGES_FSTYPES, and IMAGE_DEPENDS` accordingly. See `meta-iot2000-example/recipes-core/images/iot2000-update-image.bb` for example.
6 changes: 6 additions & 0 deletions meta-iot2000-example/classes/npm-manual-inst.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
inherit npm

do_install() {
mkdir -p ${NPM_INSTALLDIR}/
cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership
}
2 changes: 2 additions & 0 deletions meta-iot2000-example/conf/distro/poky-iot2000.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ LINUXLIBCVERSION = "4.4%"

PREFERRED_VERSION_nodejs = "6.12%"
PREFERRED_VERSION_nodejs-native = "6.12%"

BINDINGS_pn-mraa = "python nodejs"
1 change: 0 additions & 1 deletion meta-iot2000-example/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ BBFILE_PRIORITY_iot2000-example = "6"

LAYERDEPENDS_iot2000-example += " \
iot2000-bsp \
intel-iot-mw \
nodejs \
"

Expand Down
2 changes: 1 addition & 1 deletion meta-iot2000-example/kas-sdk-windows-i586.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ task: populate_sdk
repos:
meta-mingw:
url: https://git.yoctoproject.org/git/meta-mingw
refspec: 58dda8440c1943c15ee750eb40f0fc651e316f51
refspec: a2c5fb82e5595d5bb56b579b7c93147c4fb065a5

local_conf_header:
sdk_machine: |
Expand Down
10 changes: 10 additions & 0 deletions meta-iot2000-example/kas-update-rt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
header:
version: 2
includes:
- kas.yml

target: iot2000-update-image

local_conf_header:
rt_kernel: |
PREFERRED_PROVIDER_virtual/kernel = "linux-cip-rt"
7 changes: 7 additions & 0 deletions meta-iot2000-example/kas-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
header:
version: 2
includes:
- kas.yml

target: iot2000-update-image

30 changes: 24 additions & 6 deletions meta-iot2000-example/kas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,32 @@ repos:
layers:
meta-iot2000-example:

meta-intel-iot-middleware:
url: https://git.yoctoproject.org/git/meta-intel-iot-middleware
refspec: fc8eabfa4fb54802d3f97123b9d2954450175e33

meta-nodejs:
url: https://github.com/imyller/meta-nodejs
refspec: eec531e97a17bfd406f3bf76dee4057dcf5286a4
url: https://github.com/ninox92/meta-nodejs
refspec: 7e90d506488036cf1c490d1ac1086675eb2805b6

meta-efibootguard:
url: https://github.com/siemens/meta-efibootguard
refspec: 0d8218a7693b80c4672abde206ac89b941c74737

meta-swupdate:
url: https://github.com/sbabic/meta-swupdate
refspec: 145736d31a557a4ee0ec1746ab14fec5eeb0a667

local_conf_header:
package_ipk: |
PACKAGE_CLASSES = "package_ipk"
wicvars: |
WICVARS += "BBLAYERS \
HDDDIR \
RECIPE_SYSROOT_NATIVE \
IMAGE_ROOTFS DEPLOY_DIR_IMAGE \
FAKEROOTCMD \
FAKEROOTDIRS \
FAKEROOTENV \
FAKEROOTNOENV \
PSEUDO_PREFIX \
PSEUDO_LOCALSTATEDIR \
PSEUDO_PASSWD \
PSEUDO_NOSYMLINKEXP \
"
29 changes: 29 additions & 0 deletions meta-iot2000-example/recipes-core/images/files/sw-description
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
software =
{
version = "0.1.0";
bootenv: ({
name = "kernelfile";
value = "C:BOOT1:bzImage";
},
{
name = "kernelparams";
value = "root=/dev/mmcblk0p3 console=ttyS1,115200 earlyprintk";
},
{
name = "watchdog_timeout_sec";
value = "60";
}
);
images: ({
filename = "iot2000-example-image-iot2000.ext4.gz";
device = "/dev/mmcblk0p3";
compressed = true;
});
files: ({
filename = "bzImage";
path = "bzImage";
device = "/dev/mmcblk0p5";
filesystem = "vfat";
});
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
IMAGE_FSTYPES += "ext4.gz"

require recipes-core/images/core-image-minimal.bb
require recipes-core/images/core-image-iot2000.inc
require iot2000-example-image.inc

IMAGE_INSTALL_append += "swupdate efibootguard-tools"

DEPENDS += "gptfdisk-native efibootguard-native"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ IMAGE_INSTALL_append = " modules-load-entries"
IMAGE_INSTALL_append = " dmidecode"
IMAGE_INSTALL_append = " openssh"
IMAGE_INSTALL_append = " screen minicom"
IMAGE_INSTALL_append = " mraa upm"
IMAGE_INSTALL_append = " mraa-utils upm"
IMAGE_INSTALL_append = " parted e2fsprogs dosfstools"
IMAGE_INSTALL_append = " nodejs nodejs-npm"
IMAGE_INSTALL_append = " node-red node-red-dashboard node-mraa node-red-node-intel-gpio"
Expand All @@ -37,3 +37,6 @@ IMAGE_INSTALL_append = " tzdata-africa tzdata-americas tzdata-antarctica"
IMAGE_INSTALL_append = " tzdata-arctic tzdata-asia tzdata-atlantic"
IMAGE_INSTALL_append = " tzdata-australia tzdata-europe tzdata-pacific"
IMAGE_INSTALL_append = " cronie"

# The following is needed for correct EFI deployment
do_image_wic[depends] += "${PN}:do_bootimg"
17 changes: 17 additions & 0 deletions meta-iot2000-example/recipes-core/images/iot2000-update-image.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DESCRIPTION = "iot2000 example update image"

DEPENDS += "iot2000-example-image"

SRC_URI = "file://sw-description"

IMAGE_DEPENDS = "iot2000-example-image"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

SWUPDATE_IMAGES = "iot2000-example-image bzImage"

SWUPDATE_IMAGES_FSTYPES[iot2000-example-image] = ".ext4.gz"
SWUPDATE_IMAGES_NOAPPEND_MACHINE[bzImage] = "1"

inherit swupdate
Loading