- diff --git a/ptxdist/configs/ecu01/barebox-defaultenv-2/bin/usb_update_rootfs b/ptxdist/configs/ecu01/barebox-defaultenv-2/bin/usb_update_rootfs
- index 58cf64b..00736bb 100755
- --- a/ptxdist/configs/ecu01/barebox-defaultenv-2/bin/usb_update_rootfs
- +++ b/ptxdist/configs/ecu01/barebox-defaultenv-2/bin/usb_update_rootfs
- @@ -12,12 +12,43 @@ if [ -e ${image} ]; then
- splash -x 23 -y 159 /env/assets/panel_update.png
- fi
- + #
- + # Test whether /var/nand0.var contains a valid, mountable
- + # UBI filesystem.
- + #
- + # If the filesystem cannot be mounted we format the nand0.var
- + # partition below (this code is messy, but there seems to be no
- + # other way in barebox)
- + #
- + do_format_ubi_var=1
- + ubiattach -O 2048 /dev/nand0.var
- + if [ $? -eq 0 ] ; then
- + if [ -c /dev/nand0.var.ubi.dyn ] ; then
- + echo "# Note: var.dyn contains data."
- + do_format_ubi_var=0
- + fi
- + ubidetach /dev/nand0.var
- + fi
- +
- umount /dev/nand0.root.ubi.root
- ubidetach /dev/nand0.root
- +
- + formatting_successful=1
- ubiformat -O 2048 -y /dev/nand0.root -f ${image}
- - ubiformat -O 2048 -y /dev/nand0.var
- + if [ $? -ne 0 ] ; then
- + formatting_successful=0
- + fi
- +
- + if [ $do_format_ubi_var -eq 1 ] ; then
- + ubiformat -O 2048 -y /dev/nand0.var
- + if [ $? -ne 0 ] ; then
- + formatting_successful=0
- + fi
- + else
- + echo "## ubi.var contains data, skipping format of /dev/nand0.var."
- + fi
- - if [ $? -eq 0 ] ; then
- + if [ $formatting_successful -eq 1 ] ; then
- echo "usb_update_rootfs: OK"
- exit 0
- else
- diff --git a/ptxdist/local_src/backup-etc/lib/systemd/system/backup-etc.service b/ptxdist/local_src/backup-etc/lib/systemd/system/backup-etc.service
- index 78a6128..a7d8644 100755
- --- a/ptxdist/local_src/backup-etc/lib/systemd/system/backup-etc.service
- +++ b/ptxdist/local_src/backup-etc/lib/systemd/system/backup-etc.service
- @@ -1,6 +1,8 @@
- [Unit]
- Description=Backup service for configuration in /etc
- -Requires=local-fs.target
- +# /etc/backup-etc.conf requires /var/dyn
- +Requires=local-fs.target var-dyn.mount var-stat.mount
- +After=local-fs.target var-dyn.mount var-stat.mount
- [Service]
- Restart=always
- diff --git a/ptxdist/local_src/ecu01-basicsys/sbin/check_ubi_partitions b/ptxdist/local_src/ecu01-basicsys/sbin/check_ubi_partitions
- index 9bebc40..38b02a5 100755
- --- a/ptxdist/local_src/ecu01-basicsys/sbin/check_ubi_partitions
- +++ b/ptxdist/local_src/ecu01-basicsys/sbin/check_ubi_partitions
- @@ -1,11 +1,33 @@
- #!/bin/bash
- -
- +command exec >/dev/console 2>&1
- if [ ! -c /dev/ubi1_0 ]; then
- - ubimkvol /dev/ubi1 -N dyn -s 15000000
- + echo
- + echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
- + echo '@@@@ ----> Formatting /dev/ubi1 dyn <---- @@'
- + echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
- + echo
- + ubimkvol /dev/ubi1 -N dyn -s 15000000
- +else
- + echo
- + echo '============================================'
- + echo '= ---> No need to format /dev/ubi1 dyn <-- ='
- + echo '============================================'
- + echo
- fi
- if [ ! -c /dev/ubi1_1 ]; then
- - ubimkvol /dev/ubi1 -N stat -s 15000000
- + echo
- + echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
- + echo '@@@@ ----> Formatting /dev/ubi1 stat <----@@'
- + echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
- + echo
- + ubimkvol /dev/ubi1 -N stat -s 15000000
- +else
- + echo
- + echo '============================================'
- + echo '=---> No need to format /dev/ubi1 stat <-- ='
- + echo '============================================'
- + echo
- fi
- diff --git a/ptxdist/projectroot/lib/systemd/system/codesys3-rt.service b/ptxdist/projectroot/lib/systemd/system/codesys3-rt.service
- index 57b3e16..fe11e87 100644
- --- a/ptxdist/projectroot/lib/systemd/system/codesys3-rt.service
- +++ b/ptxdist/projectroot/lib/systemd/system/codesys3-rt.service
- @@ -4,10 +4,10 @@ Description=CoDeSys 3 runtime
- # other stuff like logins&co are ready
- # - we cannot use application.target here since it causes a dependicy loop
- # - getty.target is required so we wait until all logins are active,
- -# including those using the serial lines, before we start cdesyscontrol,
- +# including those using the serial lines, before we start codesyscontrol,
- # which itself might mess with the serial lines
- -After=basic.target local-fs.target multi-user.target getty.target
- -Requires=systemd-modules-load.service ubi-check-partitions.service
- +After=basic.target local-fs.target multi-user.target getty.target var-dyn.mount var-stat.mount
- +Requires=systemd-modules-load.service ubi-check-partitions.service var-dyn.mount var-stat.mount
- Conflicts=testing.target emvtest.target maintenance.target
- [Service]
quantron: do not format nand0.var if it is already UBIFS
Posted by Anonymous on Mon 13th May 2019 16:02
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.