Commit Graph

306 Commits

Author SHA1 Message Date
Hector Bujanda 2efc2c3e42 base-files: fix checks done to execute resize2fs postinst function in kernel 5.4
MMC core block has changed in kernel 5.4 so Replay Protected Memory Block (RPMB)
and boot partitions are not listed under /proc/partitions anymore.

get_emmc_block_device() function in pkg_postinst_ontarget() method was looking
for these entries to identify the MMC partition where to execute resize2fs.

This function has been modified to do the checks inside /dev/mmcblk* where RPMB
and boot entries are still listed.

https://jira.digi.com/browse/DEL-7094

Signed-off-by: Hector Bujanda <hector.bujanda@digi.com>
2020-05-11 16:04:57 +02:00
Hector Palacios ab98e928f5 machines: move common recipes to all packagegroup-dey-core
- u-boot-fw-utils
- cryptodev-module

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2020-05-06 17:02:28 +02:00
Arturo Buzarra 1efd3f9ba8 zeus migration: systemd: update recipe to v243.2
https://jira.digi.com/browse/DEL-7013

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-04-27 16:01:07 +02:00
Arturo Buzarra a5a0a52d18 zeus migration: busybox: update to version 1.31.0
https://jira.digi.com/browse/DEL-7001

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-04-27 16:01:07 +02:00
Francisco Gil Martinez f99ae24162 recovery: allow the user to cancel the recovery process
https://jira.digi.com/browse/DEL-6982

Signed-off-by: Francisco Gil Martinez <francisco.gilmartinez@digi.com>
2020-03-20 08:23:43 +01:00
Hector Bujanda baa4a6f57e packagegroup-dey-core: add libgpiod
Add support for handling the GPIOs through char device and the kernel API.

https://jira.digi.com/browse/DEL-6426
https://jira.digi.com/browse/DEL-6423

Signed-off-by: Hector Bujanda <hector.bujanda@digi.com>
2020-03-09 12:50:22 +01:00
Francisco Gil 1d91d3411b br0: move the br0 interface to the bottom
This interface should be the last item defined in the
/etc/network/interfaces file.

When you try to enable the interface br0 (bridge interface),
all the other interfaces should be available.
If the br0 interface is located before the other interfaces
involved in the bridge, it will fail.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2020-02-24 13:14:53 +01:00
Hector Palacios 8320168821 trustfence: homogenize SIGN_MODE variables
* prefix TRUSTFENCE_ to variable SIGN_MODE for DEY
* prefix CONFIG_ to variable SIGN_MODE for script

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2020-02-12 18:50:19 +01:00
Gabriel Valcazar 6caecc5c53 trustfence-initramfs: use "busybox halt" instead of "poweroff"
The poweroff command is not available in the initramfs due to a missing
sysvinit/systemd dependency. Use the busybox "halt" command, since it's
available regardless of the init manager used. Rework the error message and
script variables accordingly.

https://jira.digi.com/browse/DEL-6983

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-02-12 18:31:33 +01:00
Mike Engel 5beec04b6a trustfence: Add Trustfence support for CCMX8X
This commit adds Trustfence support for the CCMX8X
platform.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://jira.digi.com/browse/DEL-6917
2020-02-04 12:20:38 +01:00
Gabriel Valcazar 0765189c93 systemd: add firmware loading support
Userspace firmware loading support is required for the Linux imx-sdma driver.
The patches that accomplish this were originally in poky, but were removed in
the thud upgrade. Re-work the patches so they apply over systemd v239.

https://jira.digi.com/browse/DEL-6932

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-01-16 13:27:54 +01:00
Arturo Buzarra 3c5fd58866 trusfence-initramfs: generalize recipe to avoid redefinitions
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-01-10 13:37:39 +01:00
Arturo Buzarra 95c636d327 trustfence-initramfs: add support for ccimx8mn platform
https://jira.digi.com/browse/DEL-6911

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-01-10 13:37:39 +01:00
Arturo Buzarra d430cc3bab recovery-initramfs: generalize recipe to avoid redefinitions
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-01-10 13:36:21 +01:00
Arturo Buzarra 188df6fee3 recovery-initramfs: add support for ccimx8mn platform
https://jira.digi.com/browse/DEL-6911

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-01-10 13:36:21 +01:00
Arturo Buzarra 1fd0e8d6d8 init-ifupdown: generalize recipe to avoid redefinitions
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-01-10 13:36:21 +01:00
Arturo Buzarra a93a05a8af init-ifupdown: add support for ccimx8x platform
https://jira.digi.com/browse/DEL-6911

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-01-10 13:21:27 +01:00
Arturo Buzarra 8e853e76d1 busybox: add support to ccimx8mn platform
Add initial support cloned from ccimx8x-sbc-pro.

https://jira.digi.com/browse/DEL-6806

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-01-10 11:42:58 +01:00
Gabriel Valcazar 2a0636760e systemd: decrease timeout when stopping services
In very rare cases, random services would hang when powering off the system,
causing the poweroff process to stall for 90 seconds before timing out the stop
job. To avoid this behaviour, minimize the effect of these random freezes by
decreasing the timeout.

The default services in our system take well under 15 seconds to stop
gracefully, so we can guarantee that a timeout will never happen under normal
circumstances.

https://jira.digi.com/browse/DEL-6794

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-10-17 16:17:14 +02:00
Javier Viguera 7013acc439 init-ifupdown: p2plink: allow to set persistent parameters
Use ifupdown variable 'p2p-network-id' to pass a WPA supplicant network
id, to pre-populate some parameters (SSID/passphrase) when creating the
group where this device is the GO.

Also replace go_intent=7 with the auto parameter. According to the
documentation:

    "auto" can be used to request wpa_supplicant to automatically
    figure out whether the peer device is operating as a GO and if so,
    use join-a-group operation rather than GO Negotiation.

https://jira.digi.com/browse/DEL-6741

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2019-09-10 11:49:00 +02:00
Mike Engel 3ac4ce1959 meta-digi-dey: fix systemd-cat not found in network scripts
This commit fixes the error message when specific network scripts
are launched.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://jira.digi.com/browse/DEL-6728
2019-09-06 11:03:18 +02:00
Gabriel Valcazar acff25cf80 trustfence-tool: update to v2.3
This version adds support for the ccimx8x.

https://jira.digi.com/browse/DEL-6684

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-09-04 15:12:06 +02:00
Arturo Buzarra d8614f748e recovery-initramfs: Set cryptsetup dependency only for platforms with block devices
Commit 074e3ba3 ("meta-digi-dey: add cryptsetup tool into initramfs") added
the runtime dependency to cryptsetup for all platforms, but it is
required only to encrypt/decrypt block devices.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-07-30 10:29:31 +02:00
Mike Engel 42612e112e meta-digi-dey: base-file: disable file system check on the root file system partition when encrypted
This commit disables file system check on the root file system when it is encrypted.
This prevents the service from failing on encrypted rootfs with the message:

[FAILED] Failed to mount /run/media/mmcblk0p3.
See 'systemctl status run-media-mmcblk0p3.mount' for details.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://jira.digi.com/browse/DEL-6655
2019-07-22 09:39:43 +02:00
Arturo Buzarra 1d68514a50 packagegroup-dey-core: add pciutils package for platforms that support PCI
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-07-16 16:38:28 +02:00
Mike Engel 4a3e9531b3 meta-digi-dey: add initramfs-init file to initramfs.
Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://jira.digi.com/browse/DEL-6652
2019-07-08 17:41:01 +02:00
Mike Engel 074e3ba368 meta-digi-dey: add cryptsetup tool into initramfs.
Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://jira.digi.com/browse/DEL-6652
2019-07-08 17:41:01 +02:00
Gabriel Valcazar 0228ad8587 systemd: don't include systemd-networkd
To avoid possible conflicts with NetworkManager, remove systemd-networkd
entirely.

https://jira.digi.com/browse/DEL-6610

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-06-12 10:54:41 +02:00
Arturo Buzarra 8c0aaf79b6 base-files: add filter to ignore mmc RPMB partitions
The Replay Protected Memory Block (RPMB) is an special storage
partition that cannot be accessed via standard block layer.
When a user space tool like blkid, tries to read it the kernel
suffers buffer I/O errors and timeouts.

This commit modifies the post installation script to filter the RPMB
partitions from the mmc block devices, to avoid multiple kernel
errors during the script execution.

https://jira.digi.com/browse/DEL-6609

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-05-17 10:27:11 +02:00
Arturo Buzarra 1fe9ca04c2 base-files: remove platform dependency to execute the postinst function
Removed the platform dependency to apply the resize to all platforms.

https://jira.digi.com/browse/DEL-6609

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-05-17 10:27:11 +02:00
Jose Diaz de Grenu aad38d49c8 system-monitor: add system-monitor example
This recipe is an example for customer for a system-monitor. Scripts that
verify the system status can be added to /etc/system-monitor.d

The recovery mechanisms can be implemented on those scripts or in the
system-monitor script. The software watchdog systemd support is used to
guarantee that the system-monitor is running.

When using this it is recommended to enable the systemd hardware watchdog
support, refer to the systemd documentation for this.

The systemd service provided by this recipe is not enabled by default as it
is an example that needs customization.

https://jira.digi.com/browse/DEL-6593

Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
2019-05-17 09:38:24 +02:00
Javier Viguera ba93fb6d76 init-ifupdown: support establishing a P2P link
Co-authored-by: Isaac Hermida <isaac.hermida@digi.com>
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2019-05-17 09:38:24 +02:00
Javier Viguera bc5c64571a busybox http: add systemd service
Currently in a systemd based init, the httpd server is not launched. A
systemd service is needed, so add it.

Also install a CGI script that allows to use the device for the
NetworkManager connectivity check.

https://jira.digi.com/browse/DEL-6577

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2019-05-17 09:38:24 +02:00
Gabriel Valcazar 5a14bd9666 standby: add systemd standby-actions script for ccimx6/ccimx6qp platforms
Even though systemd support is not yet available for these platforms, add the
scripts so bitbake doesn't fail when building the busybox package.

https://jira.digi.com/browse/DEL-6565

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-05-07 09:55:19 +02:00
Gabriel Valcazar f1ce4bfbc8 standby: homogenize standby script across all platforms
* Use the same operation order when resuming interfaces
* Remove unnecessary delay in ccimx6sbc standby script

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-05-07 09:55:19 +02:00
Gabriel Valcazar 982102fb68 core-image-base: don't override default IMAGE_INSTALL values
Otherwise, packagegroup-dey-core won't get included in ccimx6ulstarter images.
This packagegroup contains fundamental OS elements, such as sysvinit, kernel
modules and so on. Use CORE_IMAGE_BASE_INSTALL instead and make sure to append
to the default value instead of overwriting it.

https://jira.digi.com/browse/DEL-6536

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-04-03 18:00:28 +02:00
Gabriel Valcazar df3858f473 systemd: add patch to avoid spurious stalling during reboots
This modifies the behavior of the sd-resolve libsystemd component to prevent
the system from freezing whenever a service that uses said component is
stopped. Even though this doesn't free the terminated thread's resources
properly, this procedure only gets executed during the final moments of a
service's process before it exits, so resource leaks aren't an issue.

https://jira.digi.com/browse/DEL-6523

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-03-28 18:08:19 +01:00
Hector Palacios 42d28c76cb dey-examples: remove old examples now superseeded by digiapix
This commit removes the following examples that were accessing
hardware interfaces:
 - dey-examples-adc
 - dey-examples-can
 - dey-examples-gpio-sysfs
 - dey-examples-spidev
 - dey-examples-watchdog

The recipe 'dey-examples-digiapix' builds similar examples that make
use of Digi's APIX for accessing the hardware. Add this recipe to images
 - dey-image-qt
 - core-image-base

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-5169
2019-03-27 10:58:40 +01:00
Gabriel Valcazar 12e603021c init-ifupdown: add virtwlans script to pre-up and post-down hook directories
This way, the wlan1 interface will only be created whenever a user wants to
bring the interface up with ifupdown. Modify the script to be able to delete
the interface whenever it gets brought down and remove its .sh file extension
so run-parts can run it properly during the ifup process.

https://jira.digi.com/browse/DEL-6353

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-03-22 09:46:51 +01:00
Gabriel Valcazar 26df169ea2 init-ifupdown: don't bring wlan1 up automatically
Tests have shown that having this interface up hinders wlan0's performance,
so don't bring it up by default.

https://jira.digi.com/browse/DEL-6353

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-03-22 09:46:51 +01:00
Arturo Buzarra 626d594952 bridgeifupdown: fix bridge initialization timing issue with wireless interface
This script introduces a minor delay when the own script
launch the wpa_supplicant daemon, however this minor delay
is needed in the boot process when the wireless interface
is loaded, if not the bridge mechanism throws an unexpected
error trying to add the interface to the bridge before the
wireless is ready to use.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-03-18 18:41:54 +01:00
Gabriel Valcazar 6e282ec51b bluez: rework bluetooth and bluetooth-init services
Soften the dependencies between the services and start the bluetooth stack
regardless of the existence of a bluetooth chip. Also, update the standby
script to reflect that there is no longer a strong dependency between the
services.

https://jira.digi.com/browse/DEL-6452

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-03-14 17:27:00 +01:00
Gabriel Valcazar 1ddd7e57ee systemd: add upstream patch to expand the list of rules.d directories
Unlike eudev, which is used on images without systemd, the list of paths
systemd-udev uses to look for rules is very limited. Include an upstream patch
(commit 116b91e8ccfee1d44fc2b140d831d688e3747902 in the systemd repo) that
expands said list.

This fixes an issue with crda's regulatory domain rule file, which was being
excluded due to it being in a path systemd-udev was ignoring (/usr/lib/udev).
Because of this, the regulatory domain was never set properly and hostapd was
failing when configured to use 5GHz channels (which is the default config).

https://jira.digi.com/browse/DEL-6504

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-03-14 13:34:16 +01:00
Gabriel Valcazar ae2abd926a init-ifupdown: add systemd support
To avoid bringing up interfaces before they're created by udev scripts
(specifically wlan1), wait until udev settles before starting the service.

https://jira.digi.com/browse/DEL-6504

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-03-14 13:34:16 +01:00
Gabriel Valcazar b957f0ef75 hostapd: add systemd support
When using systemd, putting the wlan1 interface up wasn't working because it
was relying on initscripts that are no longer in the filesystem.

Add a parametrized version of the upstream hostapd service to be able to use a
configuration that's different from the default one. Also, modify the
generation of the wlan1 entry in /etc/network/interfaces to be able to use
different post-up/pre-down hooks depending on the init manager that's being
used.

https://jira.digi.com/browse/DEL-6504

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-03-14 13:34:07 +01:00
Arturo Buzarra bccb5890b8 busybox: generalize bbappend to support different revisions
Latest update to version 1.29.3 in upstream breaks the compatibility
of our bbappend, to avoid it in future updates, this commit
generalizes the bbappend to apply all the 1.29 series.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-02-26 16:47:06 +01:00
Gabriel Valcazar 803dde16b0 busybox: add suspend-actions script for the ccimx8x and ccimx6ul
This script behaves the same way as our custom standby script, with a few
modifications, for example:

 * instead of using initscripts to stop/start daemons, it uses systemctl calls
 * save variables that are needed when resuming in /tmp, because the script is
executed twice instead of once (when suspending and when resuming)
 * remove the locking/unlocking of the critical section and the actual state
change, since that is handled by systemd-suspend now

Also, add a different standby script for when systemd is enabled. Said script
acts as a wrapper for systemd's suspend mechanism.

https://jira.digi.com/browse/DEL-6415

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-02-18 18:01:57 +01:00
Gabriel Valcazar dbd68f87d5 systemd: remove NXP patches
These patches don't apply on the latest version of systemd used in Yocto 2.6.

https://jira.digi.com/browse/DEL-6415

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-02-18 18:01:57 +01:00
Gabriel Valcazar 670491e287 systemd: remove patch that makes systemd-logind ignore KEY_POWER events
Without systemd, our KEY_POWER events were handled by the ACPI daemon, which in
turn issued a "poweroff" command. With systemd, the ACPI daemon is no longer
available and the events are handled by systemd-logind instead, which also
powers down the system properly. However, NXP added a patch that prevents
system-logind from handling the events, since they use the sc_powerkey instead.

Remove this patch to be able to power the target off via our power button.

https://jira.digi.com/browse/DEL-6415

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-02-18 18:01:57 +01:00
Gabriel Valcazar 2c544a2241 meta-digi: remove initscript package dependencies when systemd is enabled
Otherwise, there will be errors due to missing dependencies.

https://jira.digi.com/browse/DEL-6415

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2019-02-18 18:01:57 +01:00