diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-05-09 07:38:34 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-05-10 08:14:11 +0200 |
commit | 85dffaacfa3c7eedc8fc8ea12da27a19720e2483 (patch) | |
tree | 0120a9ef4d6f0897de6d5c563b592ce70addfb7f /fs/fs.c | |
parent | dee8d2e0619f58d55553c3da6292e630e452e355 (diff) | |
download | barebox-85dffaacfa3c7eedc8fc8ea12da27a19720e2483.tar.gz barebox-85dffaacfa3c7eedc8fc8ea12da27a19720e2483.tar.xz |
fs: Create automount entries for the default mount pathes
In barebox the default mount path for a cdev is /mnt/<cdevname>
which can be mounted with "mount <cdevname>" without specifying
a target path explicitly. Simplify this further by creating automount
entries for the default mount pathes which makes a manual mount
completely unnecessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/fs.c')
-rw-r--r-- | fs/fs.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -328,6 +328,20 @@ int automount_add(const char *path, const char *cmd) } EXPORT_SYMBOL(automount_add); +void cdev_create_default_automount(struct cdev *cdev) +{ + char *path, *cmd; + + path = basprintf("/mnt/%s", cdev->name); + cmd = basprintf("mount %s", cdev->name); + + make_directory(path); + automount_add(path, cmd); + + free(cmd); + free(path); +} + void automount_print(void) { struct automount *am; |