From 9701e66e5c48130c327b4aa54d3a4cdd27ad53e3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 29 Nov 2015 09:47:36 -0600 Subject: [PATCH] SAMV71-XULT and STM32F4Discovery: Automatically mount procfs on startup --- configs/samv71-xult/src/sam_bringup.c | 11 +++++++++++ configs/samv71-xult/src/samv71-xult.h | 10 ++++++++++ configs/stm32f4discovery/src/stm32_bringup.c | 12 ++++++++++++ configs/stm32f4discovery/src/stm32f4discovery.h | 12 +++++++++++- 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/configs/samv71-xult/src/sam_bringup.c b/configs/samv71-xult/src/sam_bringup.c index f525e700fc..1074d76fa5 100644 --- a/configs/samv71-xult/src/sam_bringup.c +++ b/configs/samv71-xult/src/sam_bringup.c @@ -193,6 +193,17 @@ int sam_bringup(void) } #endif +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, SAMV71_PROCFS_MOUNTPOINT, "procfs", 0, NULL); + if (ret < 0) + { + SYSLOG("ERROR: Failed to mount procfs at %s: %d\n", + SAMV71_PROCFS_MOUNTPOINT, ret); + } +#endif + #ifdef HAVE_MTDCONFIG /* Create an AT24xx-based MTD configuration device for storage device * configuration information. diff --git a/configs/samv71-xult/src/samv71-xult.h b/configs/samv71-xult/src/samv71-xult.h index 060bc458ee..4b74c62559 100644 --- a/configs/samv71-xult/src/samv71-xult.h +++ b/configs/samv71-xult/src/samv71-xult.h @@ -188,6 +188,16 @@ # undef HAVE_MTDCONFIG #endif +/* procfs File System */ + +#ifdef CONFIG_FS_PROCFS +# ifdef CONFIG_NSH_PROC_MOUNTPOINT +# define SAMV71_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT +# else +# define SAMV71_PROCFS_MOUNTPOINT "/proc" +# endif +#endif + /* S25FL1 QuadSPI FLASH */ #ifndef CONFIG_MTD_S25FL1 diff --git a/configs/stm32f4discovery/src/stm32_bringup.c b/configs/stm32f4discovery/src/stm32_bringup.c index c296d1ea77..dc2e7c9f18 100644 --- a/configs/stm32f4discovery/src/stm32_bringup.c +++ b/configs/stm32f4discovery/src/stm32_bringup.c @@ -177,5 +177,17 @@ int stm32_bringup(void) #ifdef CONFIG_MAX6675 ret = stm32_max6675initialize("/dev/temp0"); #endif + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL); + if (ret < 0) + { + sdbg("ERROR: Failed to mount procfs at %s: %d\n", + STM32_PROCFS_MOUNTPOINT, ret); + } +#endif + return ret; } diff --git a/configs/stm32f4discovery/src/stm32f4discovery.h b/configs/stm32f4discovery/src/stm32f4discovery.h index 49d629e356..73024bc40b 100644 --- a/configs/stm32f4discovery/src/stm32f4discovery.h +++ b/configs/stm32f4discovery/src/stm32f4discovery.h @@ -1,7 +1,7 @@ /**************************************************************************** * configs/stm32f4discovery/src/stm32f4discovery.h * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -171,6 +171,16 @@ # undef HAVE_NETMONITOR #endif +/* procfs File System */ + +#ifdef CONFIG_FS_PROCFS +# ifdef CONFIG_NSH_PROC_MOUNTPOINT +# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT +# else +# define STM32_PROCFS_MOUNTPOINT "/proc" +# endif +#endif + /* STM32F4 Discovery GPIOs **************************************************/ /* LEDs */