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

John Crispin john at phrozen.org
Fri Oct 11 02:51:10 EDT 2019


On 10/10/2019 13:02, Alin Năstac wrote:
> On Wed, Oct 9, 2019 at 4:52 PM Alin Năstac <alin.nastac at gmail.com> wrote:
>> On Wed, Oct 9, 2019 at 4:41 PM John Crispin <john at phrozen.org> wrote:
>>>
>>> On 09/10/2019 16:34, Alin Năstac wrote:
>>>> On Wed, Oct 9, 2019 at 2:59 PM John Crispin <john at phrozen.org> wrote:
>>>>> On 09/10/2019 14:41, Alin Nastac wrote:
>>>>>> Scripts located in the directory /lib/mount_root will be executed
>>>>>> before mounting the overlay.
>>>>>>
>>>>>> Signed-off-by: Alin Nastac <alin.nastac at gmail.com>
>>>>> Hi,
>>>>>
>>>>> should it not be /etc/mount_root.d/ ? what do you need this for if I may
>>>>> ask ?
>>>>>
>>>>> further comments inline ...
>>>>>
>>>>>        John
>>>>>
>>>> Hi John,
>>>>
>>>> My target is dual bank and I need to copy parts of the customization
>>>> from the old bank after upgrade.
>>> please dont remove the CC tot he mailing list
>> Sorry, I pushed the wrong reply button.
>>
>>> I dont understamd this part, should sysupgrade not be able to handle
>>> this for you ?
>> Well, it is not that straightforward as saving & restoring the old
>> configuration files. Only parts of the UCI configuration must be
>> migrated. For instance, UCI option a.b.c must be copied from the old
>> image, but a.b.d must be reset to the value found in the new image.
>>
> Is this use case a good enough reason to implement this feature?
>
>>>> To resume your observations:
>>>>    - scripts must be relocated to /etc/mount_root.d/
>>>>    - use runqueue API
>>>>    - implement the necessary functions in overlay.c
>>>> Would that be OK? If so, I will be back with a 2nd version of this patch.
>>> I would first like to understand the use-case
>>>
>>>       John
> I've tried to use runqueue API... This API is designed to be used in
> conjunction with uloop, which is designed to be used within daemons.
> mount_root is not a daemon and it does not have a main loop, so IMHO
> it does not fit well in this place.

Of course you are right about runqueue, I dont quite follow the actual 
use case but the feature wont harm i guess

     John


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list