Images set installed before preinstall scripts?

48 views
Skip to first unread message

Einar Jón

unread,
Dec 19, 2024, 5:18:09 AM12/19/24
to swupdate
Hello

We have a slightly annoying issue:
Our rootfs installer is gettting too big to fit completely in memory
on  all our devices, so we recently had to change the sw-description
to use "installed-directly = true;" for the rootfs (see below)

But the order seems to be:
- Extract everything to /tmp
  -- if something is "installed-directly": true  that's done now...
- run preinstall scripts
- install images from /tmp
- run postinstall scripts

This kind of kills the point of having preinstall scripts at all.

Is there a way to install the rootfs after the preinstall scripts
without extracting it to /tmp?

I could probably set $TMPDIR to a mounted partitition that's big enough and change back to "installed-directly = false;", but that seems like a bad solution...

Best Regards
Einar Jon

Relevant sw-description snippet
          images = (
            {
              filename = "@@IMG_FILE@@";
              sha256 = "$swupdate_get_sha256(@@IMG_FILE@@)";
              compressed = "zstd";
              device = "/dev/disk/by-partlabel/root";
              installed-directly = true;
            },
            {
              filename = "SPL";
              sha256 = "$swupdate_get_sha256(SPL)";
              offset = "1K";
              device = "/dev/mmcblk0boot0";
              type = "raw";
              installed-directly = false;
            },
            # more "installed-directly": false stuff skipped...
          );
          scripts = (
            {
              filename = "backup-and-restore-rootfs-files.sh";
              sha256 = "$swupdate_get_sha256(backup-and-restore-rootfs-files.sh)";
              type = "shellscript";
            }
          );

Bartel Eerdekens

unread,
Aug 29, 2025, 4:46:38 AM (13 days ago) Aug 29
to swupdate

Same question here...

If a pre-extract hook would exist that would help/solve my case.
I know you can run something in advance (preinit) by using the embedded-script, but in my special case, I need some files which are packaged in the swu itself.

So
- install files with flag 'installed-directly'
- run pre-extract
- extract all other files to TMP
- continue installation

Or having a post-install hook for a certain image would also solve my case (which I would run then after my needed files are installed with 'installed-directly')

Is there any solution/hack to make an upgrade ordered/sequenced?

Thanks
Reply all
Reply to author
Forward
0 new messages