How to use AutoFS4/automount?

I want to mount on demand some filesystems (nfs/cifs) on local network which are not always available and remote davfs2. I've enabled/installed "CONFIG_PACKAGE_kmod-fs-autofs4". The module was loaded automatically after flash.

But how can i configure settings of autofs4?
And how to install automount? I cant find a package with it

the automount package is blockd

but by looking at source of this package I think it is designed for local storage (i.e. automount a usb drive when you plug it) and is mostly automatic, there is not much to configure. You just set the partitions in the /etc/config/fstab and install the package.

Afaik if you need to automount network filesystems you need to define them in the /etc/config/fstab as normal and then make your own script, see How shoud you auto-mount an NFS share in LEDE - #12 by chr0mag
and this is the hotplug script documentation (the modern version of the broken link in that thread) https://openwrt.org/docs/guide-user/base-system/hotplug

Thx, but is not what im searching for. This needs manual mounting or at system start the remote has to be up
https://www.kernel.org/doc/html/latest/filesystems/autofs.html does mount when needd and unmount after idle time.
Does this package not exists, even the autofs4 kernel module is available?

blockd is doing autofs, the kernel module is used by it.
https://git.openwrt.org/?p=project/fstools.git;a=blob;f=blockd.c;h=541fedcefe99c836c18ba28f0a870c20d0da806d;hb=HEAD#l24

the autofs settings are hard-coded in the source


  24 #define AUTOFS_MOUNT_PATH       "/tmp/run/blockd/"
  25 #define AUTOFS_TIMEOUT          30
  26 #define AUTOFS_EXPIRE_TIMER     (5 * 1000)

I do not know if blockd can work with remote filesystems, from what I see it is working only with local filesystems. But it is using autofs.

It is triggered if you enable autofs mount option in OpenWrt config files (see "mount options" table) https://openwrt.org/docs/guide-user/storage/fstab

I don't see any other package that requires autofs dependency.
either in core repo https://github.com/openwrt/openwrt/search?q=autofs4&type=code
or in community packages https://github.com/openwrt/packages/search?q=autofs4&type=code

Thx, when it work with remote fs, it lacks still of the trigger "when directory is accessed".
So when my Avm 1200 is working with openwrt, ill try to add the daemon but i have no experience with openwrt yet. This should help: https://github.com/Freetz-NG/freetz-ng/blob/master/make/autofs/autofs.mk if someone else want to try... As tirpc is available in openwrt its a good start
All the time i was using freetz i though openwrt is better and has more packages :slight_smile: