[PATCH 4/7] arm: boards: phytec-som-am335x: Add automount script

Daniel Schultz d.schultz at phytec.de
Fri Apr 28 05:46:05 PDT 2017


Each boot source is mounted to either /mnt/mmc or /mnt/emmc. To make the
not-mounted boot source available in Barebox, an automount script mounts
this device to /mnt/{mmc, emmc}, if the directory will be accessed.

Signed-off-by: Daniel Schultz <d.schultz at phytec.de>
---
 .../defaultenv-physom-am335x/init/automount           | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount

diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
new file mode 100644
index 0000000..3d109ec
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+# automount nfs server's nfsroot
+
+mkdir -p /mnt/nfs
+automount /mnt/nfs 'ifup eth0 && mount -t nfs ${eth0.serverip}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs'
+
+#automount SD card and EMMC boot partitions
+
+if [ $bootsource = mmc -a $bootsource_instance = 1 ]; then
+	automount /mnt/mmc '[ -e /dev/mmc0.0 ] && mount /dev/mmc0.0 /mnt/mmc'
+else
+	automount /mnt/emmc '[ -e /dev/mmc1.0 ] && mount /dev/mmc1.0 /mnt/emmc'
+fi
-- 
1.9.1




More information about the barebox mailing list