[OpenWrt-Devel] [PATCH v2] fstools: add a hook before mounting the overlay

Alin Năstac alin.nastac at gmail.com
Thu Oct 31 08:21:10 EDT 2019

On Thu, Oct 24, 2019 at 11:24 PM Karl Palsson <karlp at tweak.net.au> wrote:
> Alin Nastac <alin.nastac at gmail.com> wrote:
> > From: Alin Nastac <alin.nastac at gmail.com>
> >
> > Scripts located in the directory /etc/mount_root.d will be
> > executed before mounting the overlay. It can be used to
> > implement configuration merges between old & new setup after
> > doing sysupgrade.
> >From the name of the directory it's unclear when these would be
> executed. (You say pre, it's what you needed, but what if I
> wanted afterwards? where would they go?)
> Perhaps these could be made compatible with the hotplug.d
> scripts, where they have environment variables passed to them
> with the ACTION (pre/post) and so on. See
> https://openwrt.org/docs/guide-user/base-system/hotplug
> You could even just have another directory under /etc/hotplug.d ?

The only action handled in my scripts is "pre-overlay-activation" and
I used it to merge parts of the old config into the new overlay file
system. If community finds this useful, I can move the scripts to
/etc/hotplug.d/overlay and run the equivalent of the shell command
   ACTION=activate /sbin/hotplug-call overlay

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list