Merge branch 'develop' into kirkstone

This commit is contained in:
Alexandre Bard 2023-07-24 15:01:19 +02:00
commit 34c69f68ab
9 changed files with 47 additions and 46 deletions

View File

@ -1,11 +0,0 @@
PACKAGE_PREPROCESS_FUNCS += "${@ 'clean_pycache' if not bb.utils.to_boolean(d.getVar('INCLUDE_PYCS')) else '' }"
clean_pycache(){
find ${PKGD} | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
}
do_install:append(){
cd ${D}${libdir}/python${PYTHON_MAJMIN}
rm -rf turtle.py turtledemo/
cd -
}

View File

@ -1 +0,0 @@
PACKAGECONFIG:append = " tftp"

View File

@ -1,52 +1,51 @@
diff --git a/init.sh
index 4818a07..c2b2c64 100644
diff --git a/init.sh b/init.sh
index e599451..ab6e016 100644
--- a/init.sh
+++ b/init.sh
@@ -3,20 +3,17 @@ set -eu
# -------------------------------------------
@@ -1,20 +1,17 @@
#!/bin/sh
set -eu
-log_info() { echo "$0[$$]: $*" >&2; }
log_error() { echo "$0[$$]: ERROR $*" >&2; }
do_mount_fs() {
- log_info "mounting FS: $*"
[[ -e /proc/filesystems ]] && { grep -q "$1" /proc/filesystems || { log_error "Unknown filesystem"; return 1; } }
[[ -d "$2" ]] || mkdir -p "$2"
- [[ -e /proc/mounts ]] && { grep -q -e "^$1 $2 $1" /proc/mounts && { log_info "$2 ($1) already mounted"; return 0; } }
+ [[ -e /proc/mounts ]] && { grep -q -e "^$1 $2 $1" /proc/mounts && { return 0; } }
mount -t "$1" "$1" "$2"
- log_info "mounting FS: $*"
[ -e /proc/filesystems ] && { grep -q "$1" /proc/filesystems || { log_error "Unknown filesystem"; return 1; } }
[ -d "$2" ] || mkdir -p "$2"
- [ -e /proc/mounts ] && { grep -q -e "^$1 $2 $1" /proc/mounts && { log_info "$2 ($1) already mounted"; return 0; } }
+ [ -e /proc/mounts ] && { grep -q -e "^$1 $2 $1" /proc/mounts && { return 0; } }
mount -t "$1" "$1" "$2"
}
bail_out() {
log_error "$@"
- log_info "Rebooting..."
#exec reboot -f
exec sh
log_error "$@"
- log_info "Rebooting..."
#exec reboot -f
exec sh
}
@@ -34,7 +31,6 @@ get_ostree_sysroot() {
@@ -33,8 +30,6 @@ get_ostree_sysroot() {
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree
-log_info "Starting OSTree initrd script"
-
do_mount_fs proc /proc
do_mount_fs sysfs /sys
@@ -58,14 +54,13 @@ ostree_sysroot=$(get_ostree_sysroot)
do_mount_fs devtmpfs /dev
@@ -57,14 +52,12 @@ ostree_sysroot=$(get_ostree_sysroot)
mount "$ostree_sysroot" /sysroot || {
# The SD card in the R-Car M3 takes a bit of time to come up
# Retry the mount if it fails the first time
- log_info "Mounting $ostree_sysroot failed, waiting 5s for the device to be available..."
sleep 5
mount "$ostree_sysroot" /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot"
# The SD card in the R-Car M3 takes a bit of time to come up
# Retry the mount if it fails the first time
- log_info "Mounting $ostree_sysroot failed, waiting 5s for the device to be available..."
sleep 5
mount "$ostree_sysroot" /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot"
}
-ostree-prepare-root /sysroot
+ostree-prepare-root /sysroot > /dev/null 2>&1
+
-log_info "Switching to rootfs"
# shellcheck disable=SC2093
exec switch_root /sysroot /sbin/init
bail_out "Failed to switch_root to $ostree_sysroot"

View File

@ -2,7 +2,6 @@ require netmodule-linux.conf
DISTRO = "netmodule-linux-minimal"
DISTRO_VARIANT = " for minimal fitImage"
INCLUDE_PYCS:pn-python3 = "0"
#export SOURCE_DATE_EPOCH ?= "0"
#REPRODUCIBLE_TIMESTAMP_ROOTFS = ""

View File

@ -1,11 +1,14 @@
# Global
TARGET_VENDOR = "-netmodule"
SANITY_TESTED_DISTROS ?= " \
debian-10 \n \
debian-11 \n \
debian-12 \n \
"
# Make shared states compatible with all build host
require conf/distro/include/yocto-uninative.inc
INHERIT += "uninative"
# Don't append libc name in tmp directory
# eg. build/tmp instead of build/tmp-glibc
# Since we only support glibc, we don't need different tmp directories
@ -34,7 +37,9 @@ EXTRA_IMAGECMD:append_ota-ext4 = " -O ^64bit"
# Packages
PACKAGECONFIG:append:pn-curl = " openssl"
PACKAGECONFIG:append:pn-curl = " tftp openssl"
# dunfell: ssl the former equivalent of openssl
PACKAGECONFIG:append:pn-curl = " ssl"
PACKAGECONFIG:remove:pn-curl = "gnutls"
PACKAGECONFIG:append:pn-wget = " openssl"
@ -45,6 +50,9 @@ PACKAGECONFIG:append:pn-networkmanager = " modemmanager"
PACKAGECONFIG:pn-gpsd = ""
PACKAGECONFIG:append:pn-openssl = " cryptodev-linux"
PACKAGECONFIG:pn-lmsensors = ""
PACKAGECONFIG:pn-libqmi = ""
# These rules may make gpsd start automatically when detecting a
# receiver. We don't want that since gpsd is started by gnss-mgr
PACKAGE_EXCLUDE = "gpsd-udev"

View File

@ -14,13 +14,13 @@ RDEPENDS:${PN}-base = " \
iproute2 \
packagegroup-core-ssh-openssh \
openssh-sftp-server \
ethtool \
"
RDEPENDS:${PN}-extended= " \
ethtool \
iptables \
iptables-module-ipt-masquerade \
iptables-module-ip6t-masquerade \
bridge-utils \
openvpn \
networkmanager-openvpn \
"

View File

@ -7,5 +7,6 @@ inherit populate_sdk
TOOLCHAIN_TARGET_TASK:append = " \
cpputest-staticdev \
libnmapp-staticdev \
libc-staticdev \
"

View File

@ -4,7 +4,7 @@ LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1f002990697cc3f88357d1c0790d47b2"
SRC_URI = "git://gitlab.com/netmodule/tools/libnmapp.git;protocol=ssh;user=git;branch=develop"
SRCREV ?= "09aafd5ac85cc277cd1d9bb5cd922520b9a3dddb"
SRCREV ?= "dcf72e619b3a5085bba14db42e3a0d86cb4acdc8"
PV = "0.0.1+git${SRCPV}"
LIB_SHORT_NAME = "nmapp"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
UM_CONFIG_PATH=/etc/user-module
UM_CONFIG_FILE=network.conf
@ -37,16 +37,22 @@ done
source $UM_CONFIG
max_retry=30
max_retry=15
counter=0
until [[ counter -ge $max_retry ]]
do
echo "Probing um. #$counter"
ping -qc 1 -W 1 $USER_MODULE_ipv4_addr && break
sleep 1
((counter++))
done
if ! ping -qc 1 -W 1 $USER_MODULE_ipv4_addr
then
echo "UM not reachable"
exit 1
fi
# Decide which config to load depending on the sw revision
if `nc -z $USER_MODULE_ipv4_addr 7000` ; then