Commit Graph

73 Commits

Author SHA1 Message Date
Isaac Hermida e2caf16da4 mount: use the ubi class to check for attached devices
Use the generic sys class to check if a mtd device is attached.
The virtual node may not be present in some kernel versions.

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
2024-04-26 14:10:14 +02:00
Francisco Gil 0aa5003267 read only: fix problem when mounting external devices
In commit a84d011 this was fixed for mount_digiparts.sh, but
was missing the fix in the mount.sh script.

In that commit there is a full explanation about why this
solves the issue.

https://onedigi.atlassian.net/browse/DEL-8721

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2024-01-09 16:36:20 +01:00
Francisco Gil 0cba27a016 udev: mount only media devices with filesystem on them
With this new rule, only the medias that contain a filesystem
on them are mounted, filtering several calls to mount.sh.

I have checked that this change doesn't increase the boot time
at all.

https://onedigi.atlassian.net/browse/DEL-8826

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2024-01-08 16:43:26 +01:00
Francisco Gil 7c6967d5d6 dualboot: avoid the mount of alternative rootfs partition
In a dualboot system the alternative rootfs was mounted by default.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2023-11-13 17:23:06 +01:00
Francisco Gil 01c5b1f329 mount: remove dependencies from fw_getenv in mount script
https://onedigi.atlassian.net/browse/DEL-8582

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2023-11-13 17:23:06 +01:00
Francisco Gil 014667b41c udev: automount: add exception to mount loop and ram block devices
The nodes "/dev/ramX" and "/dev/loopX" are mounted on boot.
Each node calls the mount.sh script, but they are not mounted
because these nodes are blacklisted in the "blacklist.conf" file.

In the ccmp13 adding this modification in the rule saves
around 4 seconds per boot.
In the ccmp15 and ccimx6ul around 2 seconds are saved.

https://onedigi.atlassian.net/browse/DEL-8725

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2023-11-02 09:48:58 +01:00
Hector Palacios 12c14ffc18 nativesdk: add STM signtools to SDK
The appropriate way to add STM signtools to the SDK is via RDEPENDS on
nativesdk-packagegroup-sdk-host, not through the parent recipe of STM
signtools recipe itself.

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

https://onedigi.atlassian.net/browse/DEL-8720
2023-10-09 15:36:44 +02:00
Mike Engel b4e886f216 Revert "udev: disable uSD card mounting for the CCMP1"
Reverted due to u-boot mtd environment partition change (DEL-8652)

This reverts commit a3af0c8597.

https://onedigi.atlassian.net/browse/DEL-8502
2023-09-07 10:32:37 +02:00
Hector Palacios 8c0dc9af13 udev-extraconf: adapt mount rules and script for new ccmp1 partition table
The ccmp1 has two MTD partitions (UBI, UBI_2) with different system
volumes.
Previously, the fact of having two ubi devices was taken as proof of
being on a multi-MTD system (one that has one UBI volume per partition).
Instead, this commit reformulates the condition to having a partition of
the same name than the UBI volume.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-09-01 17:16:32 +02:00
David Escalona 1fe98681ac meta-digi-arm: udev: mount_digiparts: minor script syntax fix
Signed-off-by: David Escalona <david.escalona@digi.com>
2023-08-02 10:22:13 +02:00
David Escalona a84d011f16 meta-digi-arm: udev: mount_digiparts: fix script for R/O systems
When the system runs as read-only with '/etc' overlayfs enabled, '/sbin/init' is not a symlink
to 'systemd', but '/sbin/init.orig' is. This causes the script to wrongly think than 'systemd'
is not being used. The outcome is that partitions are not being automatically mounted in R/O
systems running in mmc with '/etc' overlayfs enabled, as the specific '/usr/bin/systemd-mount'
binary needs to be invoked in these cases.

The proposed fix performs a second check with '/sbin/init.orig' to determine whether systemd is
being used or not. While on it, add an early check to determine if the partition is already
mounted to exit the script.

Signed-off-by: David Escalona <david.escalona@digi.com>
2023-07-27 10:13:50 +02:00
Francisco Gil 02f7753918 udev: dualboot: include linux_a/b to partitions to be mounted as ro
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2023-06-07 16:36:54 +02:00
Mike Engel a3af0c8597 udev: disable uSD card mounting for the CCMP1
This commit disables the uSD mounting, due to issues
detected during the boot process when UBIFS starts
with the wear-leveling process to erase NAND blocks.

https://onedigi.atlassian.net/browse/DEL-8415

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2023-05-11 09:25:29 +02:00
Hector Palacios 3229e37e88 trustfence-sign-tools: make dependency of cst-tool NXP-specific
While on it, merge the two RDEPENDS assignments in one.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-05-10 17:33:23 +02:00
Hector Palacios 56f323044c global: rename DEY_BUILD_PLATFORM to DEY_SOC_VENDOR
The name of the variable was not very intuitive of what
it contains. This variable expands to the SoC vendor
(NXP or STM).

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2023-05-10 17:33:23 +02:00
Javier Viguera 7581e76560 nativesdk-packagegroup-sdk-host: add requirementes to build optee-os
Building optee-os with a Yocto generated SDK, fails due to those missing
packages.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2023-04-17 12:37:32 +02:00
David Escalona bf88deb602 mount_digiparts.sh: add unit running check for systemd devices
For devices running 'systemd', the mount process is done through 'systemd-mount', which
spawns a system unit. Trying to mount the partition again throws an error stating that a
unit with the same name is already running. To avoid it, check if the unit is already
spawned before mounting the partition and, if so, just restart the unit.

Signed-off-by: David Escalona <david.escalona@digi.com>
2023-03-27 17:36:32 +02:00
Isaac Hermida 484214dc71 udev: mount.sh: force to find files in /tmp
Our /tmp file is a symbolic link to /var/tmp, therefore a "find /tmp" returns
nothing. Force to search files inside tmp folder by using "find /tmp/".

https://onedigi.atlassian.net/browse/DEL-8410

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
2023-03-03 12:06:33 +01:00
Hector Palacios 70a3a11a44 udev-extraconf: remove 'mount.sh' provided by poky
In the past, this file was cloned from poky to skip mounting
an already mounted device. This condition was done on poky's
version so the cloned file is no longer needed.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2022-11-28 13:40:14 +01:00
Tatiana Leon 1d813fe460 cc6ul: mount_digiparts.sh: fix mount of 'update' partition
This commit fixes the issue in Jira
https://onedigi.atlassian.net/browse/DEL-7827 (and in GitHub
91bfa01a52#),
that is being manifest again in a CC6UL with 1GB although it may affect other
hardware.

Partitions are mounted:
   * For multi-MTD systems, when an MTD subsystem event is received.
   * For single-MTD systems, when a UBI subsystem event is received.

This commit avoids process UBI subsystem events in multi-MTD systems.
The automount rules filter UBI subsystem events to only process 'ubi0*' (the
only UBI device/volumes in a single-MTD) and then the executed script
'mount_digiparts.sh' checks for the existance of '/dev/ubi1' node to consider
the system multi-MTD instead of using 'singlemtdsys' U-Boot variable that only
exists on CC6UL.

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-18 14:41:17 +01:00
Tatiana Leon 883141830a mount_digiparts.sh: some script improvements
* Use 'MOUNT' variable instead of 'mount' command
* On the MTD subsystem event, stop looping once the UBI device number is found

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-11-18 14:41:17 +01:00
Arturo Buzarra 26535326f9 udev-extraconf: create mount points only for read-only filesystems
Commit b8d46f01 ("read_only: create folders in build time") creates
unconditionally default folders in spite of we are in a read-only filesystem or
not, however there are different models (dual boot, single boot..) where these
partitions exist or not, so this commit only creates these default partitions
for a read-only filesystem.

https://onedigi.atlassian.net/browse/DEL-8193

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-17 17:48:34 +01:00
Arturo Buzarra 4d07069448 mount_digiparts.sh: add support to dualboot volumes on read-only mode
This commit allows to mount only the linux partition active in read-only mode.

https://onedigi.atlassian.net/browse/DEL-8193

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-17 17:48:34 +01:00
Arturo Buzarra 5be7db1f9f mount_digiparts.sh: fix support to UBI volumes on systemd
According to udev documentation running programs that access to mount/umount
filesystems is not allowed due to the default sandbox that is enforced on
systemd-udevd.service, so on systemd systems we must to use systemd-mount
binary instead of mount. Also systemd-mount does not support mount ubi devices
by volume name, so we need to use the absolute device path.

https://onedigi.atlassian.net/browse/DEL-8193

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2022-11-17 17:48:34 +01:00
Gonzalo Ruiz 2a40141c88 udev: fix RTC rule filename
Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
2022-11-16 17:43:40 +01:00
Mike Engel 81faeb3a05 udev: enable external RTC as wakeup source
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2022-11-16 12:22:32 +01:00
Hector Palacios e346958131 ccmp1: remove usage of $singlemtdsys variable
On the CCMP1 SOMs, we only consider a single system partition called UBI,
with many UBI volumes.
The variable 'singlemtdsys' allowed to change between this and
a system with multiple MTD partitions with one UBI volume each
(old approach on CC6UL).
This commit removes the variable and uses the logic as if it was set.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2022-10-25 16:57:02 +02:00
Javier Viguera 6d425d407e udev-extraconf: fix udev rule to prevent spidev module autoload
The modalias changed as part of the kernel update to version 5.15.

See commit dd545833b773b20aa7cec10f89bff96014ccb64f in kernel tree.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-09-05 18:22:40 +02:00
Tatiana Leon 93e69dfb3e crank: recipe for crank demos
This recipe downloads a tarball with Crank demos
(http://log-sln-jenkins.digi.com/yocto/downloads/crank-demos-7.1.tar.gz)

NOTE: Currently it will only includes the 'Thermostat' sample.

It installs these demos inside '/usr/share/crank/apps' and configures one of
them (Thermostat application) to be launched on boot.

https://onedigi.atlassian.net/browse/DEL-7969

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
2022-08-26 13:34:59 +02:00
Javier Viguera 17e12fe926 nativesdk-packagegroup-sdk-host: fix SDK build for ccmp15
Building a toolchain/SDK fails for ccmp15-dvk, because the NXP-based
trustfence tools (for example the cst) are not available. Fix the build
by filtering out those tools when the build platform is not NXP based.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-07-14 15:44:41 +02:00
Gonzalo Ruiz ba035acb22 trustfence: add Trustfence tools in default toolchain
In order to perform the standalone signature process, it was required
to rebuild the Toolchain with Trustfence support enabled.

CST source code is now available for downloading in the Digi FTP, so add
Trustfence sign scripts and cst/srktool to the default toolchain for it
to be used for standalone signature without rebuilding.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
(cherry picked from commit 2c9b721fb9ce38dcd0034e22d95db6e0ee068955)
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-07-05 17:36:12 +02:00
Javier Viguera 2452e85a6b kirkstone migration: cosmetic, clean build warnings
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-06-21 16:49:56 +02:00
Javier Viguera 065cf3e9c4 kirkstone migration: general update to the new override syntax
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2022-06-20 11:39:57 +02:00
Mike Engel 8f63ae3764 udev: move recipes into dynamic-layers for NXP
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2022-05-04 14:01:05 +02:00
Gabriel Valcazar 600c3d7790 mount_digiparts.sh: run single MTD layout code path only when appropriate
This code path was added in the context of single MTD layout support for
ccimx6ul boards, but it was being executed in the default storage layout use
case as well. This could trigger a race condition in which one code path
deletes the mount point while the other one is still setting it up, causing
partitions to not be mounted automatically (specifically, the "update"
partition).

Since both code paths are mutually exclusive in our implementation, reflect
this by making sure that the single MTD layout path is executed only when said
layout is enabled in the U-Boot environment.

https://onedigi.atlassian.net/browse/DEL-7827

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
(cherry picked from commit 9a7ea10a4dfb74651f865f125372604fe6840a10)
2022-04-06 10:51:30 +02:00
Gabriel Valcazar 641501cc04 hardknott: udev: sync with meta-imx hardknott-5.10.72-2.2.0 branch
Update the 10-imx.rules file

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2022-01-05 11:09:46 +01:00
Francisco Gil b8d46f0120 read_only: create folders in build time
These folders /mnt/linux, /mnt/update and /mnt/data are
created by the automount_block.sh script. In a read only
system, these folders are not created raising some errors.

Creating these folders solves the issue.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2021-11-25 12:42:59 +01:00
Hector Palacios 91bfa01a52 udev: automount UBI volumes named "linux" or "recovery"
Traditionally, platforms based on NAND, used one UBI volume
per MTD partition.
Now it's possible to use only one MTD partition containing many
UBI volumes.

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

https://onedigi.atlassian.net/browse/DEL-7614
2021-09-09 17:38:44 +02:00
Francisco Gil Martinez 1436126eae udev: missing rules since 5.4.70 migration
Signed-off-by: Francisco Gil Martinez <francisco.gilmartinez@digi.com>
2021-05-18 13:55:22 +02:00
Gabriel Valcazar 96c2b2f759 wireless: rework regulatory domain dependencies depending on the platform
Starting with Linux v4.15, regulatory domains are no longer handled via CRDA,
but via the kernel and a flexible database instead. Said database is included
in the wireless-regdb-static package, which conflicts with the old
wireless-regdb package.

To accomodate for this new package, add CRDA as a dependency for ccimx6
platforms only, and incorporate wireless-regdb-static for the rest of the
platforms. Additionally, the ccimx6 kernel should inherit the
kernel_wireless_regdb .bbclass so the plaintext database is copied to the
kernel sources, but since we use the same recipe for all kernel versions and
ccimx6 platforms are not yet supported in zeus, omit this change for now.

Remove the package-base .bbappend, since only ccimx6ulstarter images include
that packagegroup and they require wireless-regdb-static, anyway.

By adding the regulatory database, we avoid delays when going to suspend,
caused by the kernel waiting for the database to appear.

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

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
2020-06-16 12:56:35 +02:00
Arturo Buzarra da4145dd13 imx-mkimage: move recipe to native and include its binaries in the SDK
imx-mkimage is a host recipe to provide the mkimage_imx8 binaries, required
for the trustfence support with platform based on AHAB (ccimx8x). Since
these binaries are required to the sign process we need to export it in the
SDK to allow the standalone sign mode, and with that we can simplify the
mechanism to share these binaries with another recipes (u-boot, linux).

Also the do_deploy() from imx-mkimage recipe was removed to avoid overriding
the implementation from the native class and allow populating the mkimage
binaries.

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-06-01 08:56:20 +02:00
Arturo Buzarra 2cfae815ea zeus migration: packagegroup-base: remove wireless-regdb-static package dependency
packagegroup-base includes wireless-regdb-static package unconditionally,
however it conflicts with wireless-regdb that it is required by crda,
which is included as a dependency to packagagroup-dey-wireless.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2020-05-04 15:09:37 +02:00
Javier Viguera c959a88393 udev-extraconf: create /dev/ttyXBee symlink to XBee uart
https://jira.digi.com/browse/DEL-6903

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2020-01-15 18:05:48 +01:00
Hector Palacios 359ade52ac udev-extraconf: mount.sh with skip of already-mounted partitions
Default poky's version of the 'mount.sh' script doesn't account
for the possibility of udev calling twice the script for the 'add'
action. This has been observed on USB sticks connected to a USB hub
and, although the script eventually fails, for already mounted
partitions, in that case the script tries to remove the created
mountpoint, when it shouldn't.

This patch checks for already mounted partitions earlier (before
creating the mount point) and returns with no actions.

The patch that it adds (with respect to poky's thud default) is
the following:

  diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
  index 3ee67b13183a..e6882a69c223 100644
  --- a/meta/recipes-core/udev/udev-extraconf/mount.sh
  +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
  @@ -38,6 +38,12 @@ done
   automount_systemd() {
       name="`basename "$DEVNAME"`"

  +    # Skip already mounted partitions
  +    if [ -f /run/systemd/transient/run-media-$name.mount ]; then
  +        logger "mount.sh/automount" "/run/media/$name already mounted"
  +        return
  +    fi
  +
       # Skip the partition which are already in /etc/fstab
       grep "^[[:space:]]*$DEVNAME" /etc/fstab && return
       for n in LABEL PARTLABEL UUID PARTUUID; do

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

https://jira.digi.com/browse/DEL-6759
2019-09-18 09:13:41 +02:00
Hector Palacios 435e085690 udev-extraconf: update mount scripts to support systemd
The current scripts used the standard mount binary at /bin/mount
for mounting the partitions. Systemd however seems to have a monitor
that eventually umounts such partitions if not mounted by systemd's
specific command 'systemd-mount`.

For platforms using systemd, we need to use this binary together with
parameter --no-block so that partitions are mounted correctly during
the boot process.

This commit merges the two scripts for Digi-handled partitions into
just one:

	mount_bootparts.sh
                          \
                           +--> mount_digiparts.sh
                          /
        mount_partition.sh

The merged script:
 - checks if running with systemd, to use its binary.
 - checks if running with busybox, to not use the unsupported '-o'
   attribute.
 - checks if mounting the 'linux' partition, to mount it read-only.
 - checks for already-attached UBI devices, to avoid re-attaching.

This commit also combines the Digi-handled partitions (linux, update)
into the same udev rule, to simplify it, and breaks the rules lines
for readability.

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

https://jira.digi.com/browse/DEL-6744
2019-09-13 10:54:58 +02:00
Arturo Buzarra 5eb88b8c5d sumo migration: meta-digi: replace the deprecated base_conditional function
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2019-01-11 13:26:44 +01:00
Alex Gonzalez 30fde4487b meta-digi-arm: udev-extraconf: Avoid loading evbug by default
This kernel module is used for debugging and when available it spams the
log file with every input event.

This patch avoid it being loaded by default but the user can still load
it manually if required.

Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
2018-10-09 14:57:59 +02:00
Jose Diaz de Grenu f3c7f91d90 trustfence-cst: include in SDK
Generate and include the host tools in the SDK when Trustfence is enabled.
This makes it easier to use the standalone signing and encrypting scripts.

Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
2018-01-29 18:33:53 +01:00
Jose Diaz de Grenu 8a81b2cb25 rocko migration: trustfence: fix dependencies
https://jira.digi.com/browse/DEL-5518

Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
2018-01-12 15:59:04 +01:00
Arturo Buzarra faabf6ebbb udev-extraconf: add rule not to autoload spidev module
Prevents loading the spidev module at boot time to avoid
the undesired warning message from driver.

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

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
2017-11-17 15:57:03 +01:00