summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2021-12-23 17:42:32 +0200
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2021-12-23 17:42:32 +0200
commit0d94aeefa9a29d6b58d1c481d60b85858bd4599a (patch)
tree468f6bdd31d8d55a4ae0e47a72faeaff2aeeda1d
parentdf6472d2d744a0adcc93b24575a24851fba50248 (diff)
parentbe0069adf8794e129cd5b01d4b1052677136d82c (diff)
downloadmeta-mlinux-0d94aeefa9a29d6b58d1c481d60b85858bd4599a.tar.gz
meta-mlinux-0d94aeefa9a29d6b58d1c481d60b85858bd4599a.tar.bz2
meta-mlinux-0d94aeefa9a29d6b58d1c481d60b85858bd4599a.zip
Merge remote-tracking branch 'origin/6' into mpower-dev-nxp
-rw-r--r--recipes-connectivity/ppp/files/init.patch16
-rw-r--r--recipes-connectivity/ppp/ppp_%.bbappend2
-rw-r--r--recipes-core/initscripts/initscripts-1.0/README77
-rw-r--r--recipes-core/initscripts/initscripts-1.0/umountfs85
-rw-r--r--recipes-core/initscripts/initscripts_1.0.bbappend2
-rwxr-xr-xrecipes-core/multitech/config/chat_wrapper3
-rw-r--r--recipes-core/multitech/config/chat_wrapper.default5
-rw-r--r--recipes-core/udev/eudev/init2
-rw-r--r--recipes-core/udev/eudev_%.bbappend2
-rw-r--r--recipes-navigation/gpsd/gpsd-3.20/0008-timebase.patch25
-rw-r--r--recipes-navigation/gpsd/gpsd/gpsd-default7
-rw-r--r--recipes-navigation/gpsd/gpsd_3.20.bb1
12 files changed, 206 insertions, 21 deletions
diff --git a/recipes-connectivity/ppp/files/init.patch b/recipes-connectivity/ppp/files/init.patch
index 5aacfae..00ae09a 100644
--- a/recipes-connectivity/ppp/files/init.patch
+++ b/recipes-connectivity/ppp/files/init.patch
@@ -1,19 +1,23 @@
diff -Naru orig/init new/init
---- orig/init 2021-09-01 04:13:34.868409735 -0500
-+++ new/init 2021-09-03 11:00:53.480385352 -0500
-@@ -8,6 +8,11 @@
+--- orig/init 2021-10-26 09:22:52.464566921 -0500
++++ new/init 2021-10-26 09:24:31.144568910 -0500
+@@ -8,6 +8,15 @@
# Source function library.
. /etc/init.d/functions
-+if [[ $RADIORESETWAIT == yes ]]
++. /etc/default/ppp
++if [[ $RADIORESETWAIT == yes ]] ; then
+ . /usr/libexec/ppp/wait_for_reset
+else
+ function wait_for_reset { :; }
+fi
++
++mkdir -p /run/ppp || true
++touch /run/ppp/resolv.conf
test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0
if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi
-@@ -15,7 +20,9 @@
+@@ -15,7 +24,9 @@
case "$1" in
start)
echo -n "Starting up PPP link: pppd"
@@ -23,7 +27,7 @@ diff -Naru orig/init new/init
/etc/ppp/ppp_on_boot
else
pppd call provider
-@@ -37,13 +44,15 @@
+@@ -37,13 +48,15 @@
;;
restart|force-reload)
echo -n "Restarting PPP link: pppd"
diff --git a/recipes-connectivity/ppp/ppp_%.bbappend b/recipes-connectivity/ppp/ppp_%.bbappend
index 510765b..fafe176 100644
--- a/recipes-connectivity/ppp/ppp_%.bbappend
+++ b/recipes-connectivity/ppp/ppp_%.bbappend
@@ -13,7 +13,7 @@ SRC_URI_append = "\
file://wait_for_reset \
file://default"
-PR = "r11"
+PR = "r12"
PACKAGES =+ "${PN}-radioresetwait ${PN}-waitforresetfunc"
FILES_${PN}-waitforresetfunc = "${libexecdir}/ppp/wait_for_reset"
diff --git a/recipes-core/initscripts/initscripts-1.0/README b/recipes-core/initscripts/initscripts-1.0/README
new file mode 100644
index 0000000..d2b67e1
--- /dev/null
+++ b/recipes-core/initscripts/initscripts-1.0/README
@@ -0,0 +1,77 @@
+# Procedure for flashing MTRV1-0.4
+
+cd /var/volatile
+find . -type f | xargs rm
+# Now copy the upgrade image to /var/volatile
+mlinux-firmware-upgrade -f upgrade-image.bin
+
+#
+# Requirements for upgrade-image.bin
+
+# All partition images (at91bootstrap, u-boot,
+# uImage, and rootfs.jffs2) must have md5sums.
+# rootfs.jffs2 should be padded with 1's to
+# the next even multiple of dd blocks.
+# In this example the dd "blocksz" is set to
+# 131072 (128*1024).
+#
+# Find the size of the jffs2:
+# ls -l
+# total 50040
+# -rw-r--r-- 1 jklug jklug 51232792 Nov 1 11:30 rootfs.jffs2
+# In this case it is 51232792. This is then divided by
+# 131072. This is 390.87 ... so we round up to 391.
+#
+# This means we must pad the file to 391*131072 or
+# 51249152.
+#
+# We can use objcopy to enlarge the file:
+#
+# mkdir padded
+# objcopy -I binary -O binary --pad-to 51249152 --gap-fill 0xff rootfs.jffs2 padded/rootfs.jffs2
+#
+# This puts the padded version of the jffs2 file in the padded directory.
+# Now we must calculate the md5sum of the new padded file:
+# cd padded
+# cat rootfs.jffs2 | md5sum >rootfs.jffs2.md5
+#
+# Now we must replace the files in the archive with the
+# padded file and its md5sum.
+#
+# We must also add a new file. do_flash_upgrade. It must
+# be created like this:
+#
+# echo 131072 391 >do_flash_upgrade
+#
+# These two parameters are used by dd to read the correct
+# size of the flash. The first parameter is the block size,
+# and the second parameter is the number of blocks of the
+# padded file.
+#
+# The result tar file is not compressed:
+#
+# tar -cf ~/rcell-padded-5.3.6.bin bstrap* do* model mpo* root* ub* uI*
+#
+# and the contents of the tar file are these:
+#
+# tar -tvf rcell-padded-5.3.6.bin
+# -rw-rw-r-- jklug/jklug 10360 2021-11-01 11:30 bstrap.bin
+# -rw-rw-r-- jklug/jklug 36 2021-11-01 11:30 bstrap.bin.md5
+# -rw-rw-r-- jklug/jklug 11 2021-11-17 12:35 do_flash_upgrade
+# -rw-rw-r-- jklug/jklug 6 2021-11-01 11:30 model
+# -rw-rw-r-- jklug/jklug 6 2021-11-01 11:30 mpower_version
+# -rw-rw-r-- jklug/jklug 51249152 2021-11-17 06:23 rootfs.jffs2
+# -rw-rw-r-- jklug/jklug 36 2021-11-17 06:36 rootfs.jffs2.md5
+# -rwxr-xr-x jklug/jklug 473720 2021-11-01 11:30 uboot.bin
+# -rw-rw-r-- jklug/jklug 36 2021-11-01 11:30 uboot.bin.md5
+# -rw-r--r-- jklug/jklug 3435940 2021-11-01 11:30 uImage.bin
+# -rw-rw-r-- jklug/jklug 36 2021-11-01 11:30 uImage.bin.md5
+#
+# The changes are as follows:
+# do_flash_upgrade -- new file
+# rootfs.jffs2 -- padded with 0xff at the end of the file
+# rootfs.jffs2.md5 -- new md5 sum to reflect the added padding
+
+
+
+
diff --git a/recipes-core/initscripts/initscripts-1.0/umountfs b/recipes-core/initscripts/initscripts-1.0/umountfs
index c3d217e..14aa441 100644
--- a/recipes-core/initscripts/initscripts-1.0/umountfs
+++ b/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -43,6 +43,19 @@ umount_all() {
mount -o remount,ro /
}
+get_file_size() {
+ local file_size=0
+ local regex='[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+([^[:space:]]+)'
+ local upgrade_file="$1"
+ local file="$2"
+ if [[ $(tar -tvf ${upgrade_file} ${file}) =~ ${regex} ]] ; then
+ file_size=${BASH_REMATCH[1]}
+ echo "${file_size}"
+ else
+ echo "0"
+ fi
+}
+
blink_leds() {
led_dir=/sys/class/leds
# blink all programmable LEDs except status
@@ -232,7 +245,11 @@ flash_upgrade() {
cd /var/volatile
# rootfs should always be flashed last, so always keep it last here
- local files=(${bootstrap_file} ${uboot_file} ${config_file} ${oem_file} ${kernel_file} ${rootfs_file} ${install_file})
+ if ((factory_up == 0)) ; then
+ local files=(${bootstrap_file} ${uboot_file} ${config_file} ${oem_file} ${kernel_file} ${rootfs_file} ${install_file})
+ else
+ local files=(${bootstrap_file} ${uboot_file} ${config_file} ${oem_file} ${kernel_file} ${rootfs_file})
+ fi
local devs=(${bootstrap_mtd} ${uboot_mtd} ${config_mtd} ${oem_mtd} ${kernel_mtd} ${rootfs_mtd})
if [ -f "${upgrade_file}" ]; then
@@ -295,9 +312,9 @@ flash_upgrade() {
fi
if ! cp ${reboot_cmd} ${flash_dir}/upgrade-reboot ; then
- echo "Aborting upgrade. Failed \"cp ${reboot_cmd} ${flash_dir}/upgrade-reboot\""
- err_leds
- return 1
+ echo "Aborting upgrade. Failed \"cp ${reboot_cmd} ${flash_dir}/upgrade-reboot\""
+ err_leds
+ return 1
fi
if ! cp ${nandwrite_cmd} ${flash_dir}/nandwrite.static ; then
echo "Aborting upgrade. Failed \"cp ${nandwrite_cmd} ${flash_dir}/nandwrite.static\""
@@ -329,25 +346,60 @@ flash_upgrade() {
sed -i -e "\\|${flash_root}| d" /etc/mtab
umount_all
+ mount -o remount,rw /var/volatile
+ grep volatile /proc/mounts
if [ -f "${upgrade_file}" ]; then
for (( i = 0; i < ${#files[@]}; i++ )); do
local file=${files[i]}
local dev=${devs[i]}
+ echo "Processing file $file"
if tar -t -f ${upgrade_file} | grep -F -q "${file}"; then
if [ "${file}" == "${bootstrap_file}" ] || [ "${file}" == "${uboot_file}" ]; then
- local file_size=$(tar -xO -f ${upgrade_file} ${file} | wc -c)
+ file_size=$(get_file_size "${upgrade_file}" "${file}")
if dd if=${dev} bs=${file_size} count=1 | md5sum -c ${file}.md5; then
echo "Found ${file} in upgrade but it is the same as current. Continuing..."
continue
fi
- fi
+ elif ((factory_up == 1)) ; then # Not AT91Bootstrap or U-Boot.
+ file_size=$(get_file_size "${upgrade_file}" "${file}")
+ if [ "${file}" == "${kernel_file}" ]; then
+ if dd if=${dev} bs=${file_size} count=1 | md5sum -c ${file}.md5; then
+ echo "Found ${file} in upgrade but it is the same as current. Continuing..."
+ continue
+ fi # Matching md5sum
+ fi # kernel_file case
+ fi # factory upgrade
echo "Flashing ${dev} with ${file}..."
flash_erase ${extraopt} -j ${dev} 0 0
tar -xO -f ${upgrade_file} ${file} | ${flash_dir}/nandwrite.static ${extraopt} -p ${dev}
- fi
- done
+ if ((factory_up == 1)) ; then
+ if [[ ${file} == rootfs.jffs2 ]] ; then
+ pwd
+ rm -f ${upgrade_file}
+ echo "Block size is $rootbs, count=$rootcount"
+ dd if=${dev} bs=${rootbs} count=${rootcount} | md5sum -c ${file}.md5
+ result=$?
+ else
+ dd if=${dev} bs=${file_size} count=1 | md5sum -c ${file}.md5
+ result=$?
+ fi
+ if ((result == 0)); then
+ echo "SUCCESS: File ${file} was written successfully"
+ else
+ if [[ ${file} == rootfs.jffs2 ]] ; then
+ echo "dd if=${dev} bs=${rootbs} count=${rootcount} | md5sum"
+ dd if=${dev} bs=${rootbs} count=${rootcount} | md5sum
+ else
+ echo "dd if=${dev} bs=${file_size} count=1 | md5sum -c ${file}.md5"
+ dd if=${dev} bs=${file_size} count=1 | md5sum -c ${file}.md5
+ fi
+ echo "ERROR: File ${file} is bad"
+ fi
+ fi # factory upgrade
+ fi # Found a file in the upgrade package
+ done # Loop through the files in an upgrade package
else
if [ -f ${uboot_solo_file} ]; then
echo "Flashing ${uboot_mtd} (u-boot) with ${uboot_solo_file}..."
@@ -384,9 +436,14 @@ flash_upgrade() {
flash_erase ${extraopt} ${ubootenv1_mtd} 0 0
flash_erase ${extraopt} ${ubootenv2_mtd} 0 0
fi
- echo "Rebooting..."
- ${flash_dir}/upgrade-reboot
+ if ((factory_up == 1)) ; then
+ echo "Finished upgrade. Halting."
+ while : ; do : ; done # Wait forever
+ else
+ echo "Rebooting..."
+ ${flash_dir}/upgrade-reboot
+ fi
# Should not get here normally
echo "upgrade-reboot failed"
@@ -404,6 +461,14 @@ if [[ -f ${wipe_fname} ]] ; then
fi
fi
if [[ -f ${upgrade_fname} ]] ; then
+ read rootbs rootcount < ${upgrade_fname}
+ echo "Root Block Size is $rootbs, rootcount is $rootcount"
+ if [[ -n $rootbs ]] ; then
+ factory_up=1
+ extraopt="-q"
+ else
+ factory_up=0
+ fi
owner=$(stat -c%u "${upgrade_fname}")
if ((${#owner} > 0)) && ((owner == 0)) ; then
flash_upgrade /var/volatile
diff --git a/recipes-core/initscripts/initscripts_1.0.bbappend b/recipes-core/initscripts/initscripts_1.0.bbappend
index bec5d5a..f4edd90 100644
--- a/recipes-core/initscripts/initscripts_1.0.bbappend
+++ b/recipes-core/initscripts/initscripts_1.0.bbappend
@@ -3,4 +3,4 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
# flash on reboot/umountfs needs regular umount (not busybox)
RDEPENDS_${PN} += "util-linux-umount util-linux-mount bash"
-PR .= ".48"
+PR .= ".49"
diff --git a/recipes-core/multitech/config/chat_wrapper b/recipes-core/multitech/config/chat_wrapper
index 8c2edcc..a693661 100755
--- a/recipes-core/multitech/config/chat_wrapper
+++ b/recipes-core/multitech/config/chat_wrapper
@@ -338,9 +338,10 @@ else
cops=$(/usr/bin/radio-cmd ${RADIOOPTION} -t10000 'AT+COPS?')
result0=$?
- if ((result0 != 0)) || ! [[ $cops =~ ^\+COPS:\ 0, ]] ; then
+ if ((result0 != 0)) || ! [[ $cops =~ ^\+COPS:[[:space:]]0[,[:space:]] ]] ; then
/usr/bin/radio-cmd ${RADIOOPTION} -t10000 'AT+COPS=0'
((WAITREG++))
+ ${LOG} "Cops status was $cops"
${LOG} "Just set COPS=0 so wait ${COPSWAIT} seconds"
sleep ${COPSWAIT}
fi
diff --git a/recipes-core/multitech/config/chat_wrapper.default b/recipes-core/multitech/config/chat_wrapper.default
index 164086a..b6e7f33 100644
--- a/recipes-core/multitech/config/chat_wrapper.default
+++ b/recipes-core/multitech/config/chat_wrapper.default
@@ -28,3 +28,8 @@ COPSWAIT=10
# How long to wait when CFUN is set to 1
CFUNWAIT=10
+
+# Set AT&T Data mode. Modem must be in
+# data mode when using an AT&T SIM
+SETATTDATAMODE=1
+
diff --git a/recipes-core/udev/eudev/init b/recipes-core/udev/eudev/init
index d941401..4cec70b 100644
--- a/recipes-core/udev/eudev/init
+++ b/recipes-core/udev/eudev/init
@@ -97,7 +97,7 @@ case "$1" in
kill_udevd > "/dev/null" 2>&1
# trigger the sorted events
- echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+ [ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug
@UDEVD@ -d
udevadm control --env=STARTUP=1
diff --git a/recipes-core/udev/eudev_%.bbappend b/recipes-core/udev/eudev_%.bbappend
index 539cfb2..a7b0d67 100644
--- a/recipes-core/udev/eudev_%.bbappend
+++ b/recipes-core/udev/eudev_%.bbappend
@@ -1,7 +1,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
RDEPENDS_${PN} += "bash"
-PR .= ".mlinux7"
+PR .= ".mlinux8"
# add custom rules for persistent modem device names
SRC_URI += "file://cellular_radios.rules \
diff --git a/recipes-navigation/gpsd/gpsd-3.20/0008-timebase.patch b/recipes-navigation/gpsd/gpsd-3.20/0008-timebase.patch
new file mode 100644
index 0000000..a61d6b0
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.20/0008-timebase.patch
@@ -0,0 +1,25 @@
+#
+# gpsd 3.20 thinks that 2021 never happened, and we roll back the time 19
+# years. Need to allow for 2021.
+#
+===============================================================================
+diff --git a/timebase.c b/timebase.c
+index 85cfd90..8e08b18 100644
+--- a/timebase.c
++++ b/timebase.c
+@@ -385,6 +385,7 @@ timespec_t gpsd_gpstime_resolv(struct gps_device_t *session,
+ /* sanity check week number, GPS epoch, against leap seconds
+ * Does not work well with regressions because the leap_sconds
+ * could be from the receiver, or from BUILD_LEAPSECONDS. */
++#ifdef YESTERDAY
+ if (0 < session->context->leap_seconds &&
+ 19 > session->context->leap_seconds &&
+ 2180 < week) {
+@@ -395,6 +396,7 @@ timespec_t gpsd_gpstime_resolv(struct gps_device_t *session,
+ "GPS week confusion. Adjusted week %u for leap %d\n",
+ week, session->context->leap_seconds);
+ }
++#endif
+
+ // gcc needs the (time_t)week to not overflow. clang got it right.
+ // if time_t is 32-bits, then still 2038 issues
diff --git a/recipes-navigation/gpsd/gpsd/gpsd-default b/recipes-navigation/gpsd/gpsd/gpsd-default
index a3245a3..4c92ea2 100644
--- a/recipes-navigation/gpsd/gpsd/gpsd-default
+++ b/recipes-navigation/gpsd/gpsd/gpsd-default
@@ -55,6 +55,13 @@ function SET_GPS_SPEED {
((maxtries = 20))
if [[ $(cat /run/config/gpstype) == u-blox ]] ; then
+ # If the U-Blox is connected via USB, it shows
+ # up as using the ACM serial driver. This greatly
+ # simplifies setting up the U-Blox GNSS.
+ if [[ $(readlink $GPS_LINE) =~ ^ttyACM ]] ; then
+ stty -F $GPS_LINE 115200
+ return 0
+ fi
while ((maxtries >= 0)) ; do
((maxtries--))
if ((maxtries % 5 == 0)) ; then
diff --git a/recipes-navigation/gpsd/gpsd_3.20.bb b/recipes-navigation/gpsd/gpsd_3.20.bb
index eeaf0a3..9afe0fe 100644
--- a/recipes-navigation/gpsd/gpsd_3.20.bb
+++ b/recipes-navigation/gpsd/gpsd_3.20.bb
@@ -19,6 +19,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
file://0006-ubxtimelps.patch \
file://0006-itu_r_tf_460_6.patch \
file://0007-add-gll-vtg.patch \
+ file://0008-timebase.patch \
file://gpsd-default \
file://gpsd \
file://gpsd_ubx_fixed.sh \