Add support to mount NFS share
authorHugo Villeneuve <hugo@hugovil.com>
Sat, 2 Mar 2024 21:14:49 +0000 (16:14 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Tue, 28 May 2024 19:00:29 +0000 (15:00 -0400)
recipes-core/base-files/base-files_%.bbappend
recipes-core/images/include/image-hvmpd-common.inc

index 6580860..b9f8906 100644 (file)
@@ -21,6 +21,8 @@ do_install:append () {
     echo "# Manually added entries for HV MPD server project:" >> \
         ${D}${sysconfdir}/fstab
 
+    # Note: mount points will be automatically created when using systemd.
+
     if [ x"${BOOT_PART_ID}" != x"" ]; then
         echo "${ROOT_PARENT_DEV}${ROOT_PART_PREFIX}${BOOT_PART_ID}       /boot            auto       defaults              0  0" >> \
             ${D}${sysconfdir}/fstab
@@ -30,4 +32,9 @@ do_install:append () {
         echo "${ROOT_PARENT_DEV}${ROOT_PART_PREFIX}${DATA_PART_ID}       /mnt/data        auto       defaults              0  0" >> \
             ${D}${sysconfdir}/fstab
     fi
+
+    if [ "${NFS_SERVER}" != "" ]; then
+        echo "${NFS_SERVER}:${NFS_SERVER_DIR} ${NFS_MOUNT_POINT}    nfs       bg,nolock   0  0" >> \
+            ${D}${sysconfdir}/fstab
+    fi
 }
index e685439..ddee2a4 100644 (file)
@@ -16,6 +16,7 @@ IMAGE_INSTALL:append = " \
     evtest \
     i2c-tools \
     ethtool \
+    nfs-utils \
 "
 
 # Music server specific features/components: