From b9abe3de1b58034604411b6a0821ccce83481272 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 5 Mar 2019 16:53:41 +0100 Subject: Remove connman* from base IMAGE_INSTALL_append No sense to force that if poky does not, let's move it to platform-specific for now. Signed-off-by: Laurent Bonnans --- classes/sota_am335x-evm-wifi.bbclass | 1 - classes/sota_m3ulcb.bbclass | 2 ++ classes/sota_minnowboard.bbclass | 1 + classes/sota_porter.bbclass | 1 + classes/sota_qemux86-64.bbclass | 2 ++ classes/sota_raspberrypi.bbclass | 2 +- conf/distro/poky-sota-systemd.conf | 2 -- conf/distro/poky-sota.conf | 2 -- 8 files changed, 7 insertions(+), 6 deletions(-) diff --git a/classes/sota_am335x-evm-wifi.bbclass b/classes/sota_am335x-evm-wifi.bbclass index adefb47..1458d44 100644 --- a/classes/sota_am335x-evm-wifi.bbclass +++ b/classes/sota_am335x-evm-wifi.bbclass @@ -7,7 +7,6 @@ IMAGE_BOOT_FILES_sota = "bootfiles/*" OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/mmcblk0p2 console=ttyO0,115200n8l" IMAGE_INSTALL_append_sota = " uim iw wl18xx-calibrator wlconf wl18xx-fw hostapd wpa-supplicant" -IMAGE_INSTALL_remove_sota = " connman connman-client" PREFERRED_VERSION_linux-ti-staging_sota = "4.4.54+gitAUTOINC+ecd4eada6f" diff --git a/classes/sota_m3ulcb.bbclass b/classes/sota_m3ulcb.bbclass index 6b63af4..9bbd5c2 100644 --- a/classes/sota_m3ulcb.bbclass +++ b/classes/sota_m3ulcb.bbclass @@ -6,3 +6,5 @@ IMAGE_BOOT_FILES_sota += "m3ulcb-ota-bootfiles/*" OSTREE_BOOTLOADER ?= "u-boot" UBOOT_MACHINE_sota = "m3ulcb_defconfig" + +IMAGE_INSTALL_append_sota = " connman connman-client" diff --git a/classes/sota_minnowboard.bbclass b/classes/sota_minnowboard.bbclass index 63510e3..0304ef3 100644 --- a/classes/sota_minnowboard.bbclass +++ b/classes/sota_minnowboard.bbclass @@ -7,4 +7,5 @@ IMAGE_BOOT_FILES_sota = "" IMAGE_FSTYPES_remove_sota = "live hddimg" OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 console=ttyS0,115200 console=tty0" +IMAGE_INSTALL_append_sota = " connman connman-client" IMAGE_INSTALL_append = " minnowboard-efi-startup" diff --git a/classes/sota_porter.bbclass b/classes/sota_porter.bbclass index 75ae579..9beea33 100644 --- a/classes/sota_porter.bbclass +++ b/classes/sota_porter.bbclass @@ -7,3 +7,4 @@ IMAGE_BOOT_FILES_sota += "porter-bootfiles/*" OSTREE_BOOTLOADER ?= "u-boot" UBOOT_MACHINE_sota = "porter_config" +IMAGE_INSTALL_append_sota = " connman connman-client" diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index 0850af6..4a1f628 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass @@ -12,3 +12,5 @@ IMAGE_ROOTFS_EXTRA_SPACE = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '655 # fix for u-boot/swig build issue HOSTTOOLS_NONFATAL += "x86_64-linux-gnu-gcc" + +IMAGE_INSTALL_append_sota = " connman connman-client" diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index e1c0054..c603b23 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass @@ -11,6 +11,7 @@ UBOOT_DTBO_LOADADDRESS = "0x06000000" # Deploy config fragment list to OSTree root fs IMAGE_INSTALL_append = " fit-conf" +IMAGE_INSTALL_append_sota = " connman connman-client" PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" UBOOT_ENTRYPOINT_sota ?= "0x00008000" @@ -34,4 +35,3 @@ SOTA_DT_OVERLAYS_raspberrypi3 ?= "vc4-kms-v3d.dtbo rpi-ft5406.dtbo" OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=614 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 " SOTA_CLIENT_FEATURES_append = " ubootenv" - diff --git a/conf/distro/poky-sota-systemd.conf b/conf/distro/poky-sota-systemd.conf index 7d008a9..3b7de35 100644 --- a/conf/distro/poky-sota-systemd.conf +++ b/conf/distro/poky-sota-systemd.conf @@ -9,5 +9,3 @@ DISTRO_CODENAME = "sota" DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" - -IMAGE_INSTALL_append = " connman connman-client" diff --git a/conf/distro/poky-sota.conf b/conf/distro/poky-sota.conf index 2bbc62b..3fb1d20 100644 --- a/conf/distro/poky-sota.conf +++ b/conf/distro/poky-sota.conf @@ -5,5 +5,3 @@ DISTRO = "poky-sota" DISTRO_NAME = "OTA-enabled Linux" DISTRO_VERSION = "1.0" DISTRO_CODENAME = "sota" - -IMAGE_INSTALL_append = " connman connman-client" -- cgit v1.2.3-54-g00ecf From 9ff6efc8864d020b17e05a0e59e266081af4b7b3 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 5 Mar 2019 18:02:10 +0100 Subject: Replace connman with systemd-networkd on qemux86-64 Signed-off-by: Laurent Bonnans --- classes/sota_qemux86-64.bbclass | 2 +- .../networkd-dhcp-conf/files/20-wired-dhcp.network | 5 +++++ .../networkd-dhcp-conf/networkd-dhcp-conf.bb | 23 ++++++++++++++++++++++ recipes-test/images/secondary-image.bb | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network create mode 100644 recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index 4a1f628..8dae0c5 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass @@ -13,4 +13,4 @@ IMAGE_ROOTFS_EXTRA_SPACE = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '655 # fix for u-boot/swig build issue HOSTTOOLS_NONFATAL += "x86_64-linux-gnu-gcc" -IMAGE_INSTALL_append_sota = " connman connman-client" +IMAGE_INSTALL_append_sota = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'networkd-dhcp-conf', '', d)} " diff --git a/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network new file mode 100644 index 0000000..aec1849 --- /dev/null +++ b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network @@ -0,0 +1,5 @@ +[Match] +Name=en* + +[Network] +DHCP=yes diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb new file mode 100644 index 0000000..60eae44 --- /dev/null +++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb @@ -0,0 +1,23 @@ +SUMMARY = "systemd-networkd config to setup wired interface with dhcp" +DESCRIPTION = "Provides automatic dhcp network configuration for wired \ +interfaces through systemd-networkd" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" + +inherit systemd + +SRC_URI_append = " file://20-wired-dhcp.network" +PR = "r1" + +RDEPENDS_${PN} = "systemd" + +S = "${WORKDIR}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +FILES_${PN} = "${systemd_unitdir}/network/*" + +do_install() { + install -d ${D}/${systemd_unitdir}/network + install -m 0644 ${WORKDIR}/20-wired-dhcp.network ${D}/${systemd_unitdir}/network +} diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb index 1a41169..371d517 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb @@ -17,6 +17,7 @@ IMAGE_INSTALL_remove = " \ aktualizr-uboot-env-rollback \ connman \ connman-client \ + networkd-dhcp-conf \ " IMAGE_INSTALL_append = " \ -- cgit v1.2.3-54-g00ecf From 1fdd1d1ced34de8eefe6d34da03c6db20b98f141 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 6 Mar 2019 10:58:00 +0100 Subject: Define virtual/network-configuration Now provided by connman and networkd-dhcp-conf, added to images in our supported platforms Signed-off-by: Laurent Bonnans --- classes/sota_m3ulcb.bbclass | 3 ++- classes/sota_minnowboard.bbclass | 5 +++-- classes/sota_porter.bbclass | 3 ++- classes/sota_qemux86-64.bbclass | 2 +- classes/sota_raspberrypi.bbclass | 4 +++- conf/distro/poky-sota-systemd.conf | 1 + recipes-connectivity/connman/connman_%.bbappend | 1 + recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb | 2 ++ recipes-test/images/secondary-image.bb | 4 +--- 9 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 recipes-connectivity/connman/connman_%.bbappend diff --git a/classes/sota_m3ulcb.bbclass b/classes/sota_m3ulcb.bbclass index 9bbd5c2..b93cc40 100644 --- a/classes/sota_m3ulcb.bbclass +++ b/classes/sota_m3ulcb.bbclass @@ -7,4 +7,5 @@ IMAGE_BOOT_FILES_sota += "m3ulcb-ota-bootfiles/*" OSTREE_BOOTLOADER ?= "u-boot" UBOOT_MACHINE_sota = "m3ulcb_defconfig" -IMAGE_INSTALL_append_sota = " connman connman-client" +PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" +IMAGE_INSTALL_append_sota = " virtual/network-configuration " diff --git a/classes/sota_minnowboard.bbclass b/classes/sota_minnowboard.bbclass index 0304ef3..a907217 100644 --- a/classes/sota_minnowboard.bbclass +++ b/classes/sota_minnowboard.bbclass @@ -6,6 +6,7 @@ IMAGE_BOOT_FILES_sota = "" IMAGE_FSTYPES_remove_sota = "live hddimg" OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 console=ttyS0,115200 console=tty0" - -IMAGE_INSTALL_append_sota = " connman connman-client" IMAGE_INSTALL_append = " minnowboard-efi-startup" + +PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" +IMAGE_INSTALL_append_sota = " virtual/network-configuration " diff --git a/classes/sota_porter.bbclass b/classes/sota_porter.bbclass index 9beea33..80062e1 100644 --- a/classes/sota_porter.bbclass +++ b/classes/sota_porter.bbclass @@ -7,4 +7,5 @@ IMAGE_BOOT_FILES_sota += "porter-bootfiles/*" OSTREE_BOOTLOADER ?= "u-boot" UBOOT_MACHINE_sota = "porter_config" -IMAGE_INSTALL_append_sota = " connman connman-client" +PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" +IMAGE_INSTALL_append_sota = " virtual/network-configuration " diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index 8dae0c5..fc4aa7c 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass @@ -13,4 +13,4 @@ IMAGE_ROOTFS_EXTRA_SPACE = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '655 # fix for u-boot/swig build issue HOSTTOOLS_NONFATAL += "x86_64-linux-gnu-gcc" -IMAGE_INSTALL_append_sota = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'networkd-dhcp-conf', '', d)} " +IMAGE_INSTALL_append_sota = " virtual/network-configuration " diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index c603b23..1b54558 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass @@ -11,7 +11,9 @@ UBOOT_DTBO_LOADADDRESS = "0x06000000" # Deploy config fragment list to OSTree root fs IMAGE_INSTALL_append = " fit-conf" -IMAGE_INSTALL_append_sota = " connman connman-client" + +PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" +IMAGE_INSTALL_append_sota = " virtual/network-configuration " PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" UBOOT_ENTRYPOINT_sota ?= "0x00008000" diff --git a/conf/distro/poky-sota-systemd.conf b/conf/distro/poky-sota-systemd.conf index 3b7de35..b30b322 100644 --- a/conf/distro/poky-sota-systemd.conf +++ b/conf/distro/poky-sota-systemd.conf @@ -9,3 +9,4 @@ DISTRO_CODENAME = "sota" DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" +PREFERRED_RPROVIDER_virtual/network-configuration ??= "networkd-dhcp-conf" diff --git a/recipes-connectivity/connman/connman_%.bbappend b/recipes-connectivity/connman/connman_%.bbappend new file mode 100644 index 0000000..b3633cc --- /dev/null +++ b/recipes-connectivity/connman/connman_%.bbappend @@ -0,0 +1 @@ +RPROVIDES_${PN} += "virtual/network-configuration" diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb index 60eae44..39500c7 100644 --- a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb +++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb @@ -6,6 +6,8 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 inherit systemd +RPROVIDES_${PN} = "virtual/network-configuration" + SRC_URI_append = " file://20-wired-dhcp.network" PR = "r1" diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb index 371d517..61df85b 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb @@ -15,9 +15,7 @@ IMAGE_INSTALL_remove = " \ aktualizr-ca-implicit-prov-creds \ aktualizr-hsm-prov \ aktualizr-uboot-env-rollback \ - connman \ - connman-client \ - networkd-dhcp-conf \ + virtual/network-configuration \ " IMAGE_INSTALL_append = " \ -- cgit v1.2.3-54-g00ecf From 8e33202195c3e0c133ba705d6c77e669fcf3bfad Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 6 Mar 2019 12:43:33 +0100 Subject: Replace connman with systemd-networkd on raspberrypi Signed-off-by: Laurent Bonnans --- classes/sota_raspberrypi.bbclass | 2 +- recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network | 2 +- recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index 1b54558..3add247 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass @@ -12,7 +12,7 @@ UBOOT_DTBO_LOADADDRESS = "0x06000000" # Deploy config fragment list to OSTree root fs IMAGE_INSTALL_append = " fit-conf" -PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman" +DEV_MATCH_DIRECTIVE_pn-networkd-dhcp-conf = "Driver=smsc95xx lan78xx" IMAGE_INSTALL_append_sota = " virtual/network-configuration " PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" diff --git a/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network index aec1849..edb3678 100644 --- a/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network +++ b/recipes-connectivity/networkd-dhcp-conf/files/20-wired-dhcp.network @@ -1,5 +1,5 @@ [Match] -Name=en* +@MATCH_DIRECTIVE@ [Network] DHCP=yes diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb index 39500c7..1a515a2 100644 --- a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb +++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb @@ -19,7 +19,10 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" FILES_${PN} = "${systemd_unitdir}/network/*" +DEV_MATCH_DIRECTIVE ?= "Name=en*" + do_install() { install -d ${D}/${systemd_unitdir}/network install -m 0644 ${WORKDIR}/20-wired-dhcp.network ${D}/${systemd_unitdir}/network + sed -i -e 's|@MATCH_DIRECTIVE@|${DEV_MATCH_DIRECTIVE}|g' ${D}${systemd_unitdir}/network/20-wired-dhcp.network } -- cgit v1.2.3-54-g00ecf From 0599a6cb5911aa2fb546f39bab11b2b59397428c Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 6 Mar 2019 16:40:50 +0100 Subject: Document necessary integration of network connectivity Signed-off-by: Laurent Bonnans --- README.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.adoc b/README.adoc index d603ade..217f482 100644 --- a/README.adoc +++ b/README.adoc @@ -74,6 +74,8 @@ You may take a look into https://github.com/advancedtelematic/meta-updater-minno Although we have used U-Boot so far, other boot loaders can be configured work with OSTree as well. +Your images will also need network connectivity to be able to reach an actual OTA backend. Our 'poky-sota' distribution does not mandate or install a default network manager but our supported platforms use the `virtual/network-configuration` recipe, which can be used as a starting example. + == SOTA-related variables in local.conf * `OSTREE_REPO` - path to your OSTree repository. Defaults to `$\{DEPLOY_DIR_IMAGE}/ostree_repo` -- cgit v1.2.3-54-g00ecf