State-scripts documentation: how to use them without Yocto

The more I read about this more complicate it sounds

So to give an example of what I am trying to achieve.

Recently I found out that I had provide a patch to systemd so that I could change timezone in read only root file system.
So the fix was in two areas.

  1. I had to update rootfs
  2. Add necessary file in persistent data section

As shown below

root@raspberrypi-cm3:/etc# ls -lrt | grep localtime
lrwxrwxrwx 1 root root 22 Aug 19 11:56 localtime → /data/system/localtime
root@raspberrypi-cm3:/etc#

So now I have to create that structure (/data/system/localtime) in persistent data location.

And to achieve point 2, I have to create a state script to do so (As shown below)

#!/bin/sh
#
# Retain provide configuration files for timedatectl
#

mkdir /data/system/
if [[ $? -eq 0 ]] ; then
	echo "Universal" > /data/system/timezone
else
	exit 1
fi

ln -s /usr/share/zoneinfo/Universal /data/system/localtime

if [[ $? -ne 0 ]]; then
	exit 1
fi  

Then I need to name that state script (example Download_Leave_02)
So once I create the state script then I run this command

mender-artifact --compression "lzma" write rootfs-image   \
   --file "$releaseName-mender.ext4"      \
   --device-type "raspberrypi3"           \
   --artifact-name "$releaseName-mender.mender"  \
   --script "$scriptsDir/Download_Leave_02" \ 
   --script "$scriptsDir/another_script"

And then create a delta update and use that output to update my machine?

Other question I do have a .ext4 file but I don’t have an mender.ext4 file. Is the naming convention that important?