[LEDE-DEV] [PATCH 1/2] apm821xx: detect sd-card media changes for the WNDR4700

Daniel Golle daniel at makrotopia.org
Wed Aug 31 08:58:47 PDT 2016


Hi Christian,

On Wed, Aug 31, 2016 at 05:43:28PM +0200, Christian Lamparter wrote:
> PS.: What should be done about stale mounts? Because currently removing
> the sd-card will cause all affected partitions to be automatically
> unmounted as well. So, please keep this also in mind. Doing this in a
> different fashion is not as easy as it might look on the first glance.

A long time ago, mountd was made for that purpose and we used autofs to
unmount devices once no longer in use. I reckon, mountd can die and the
relevant parts providing the autofs-daemon-part can move into
block-mount (just incase you are looking for a place to work on...)


Cheers


Daniel


> 
> > > 
> > > Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
> > > ---
> > >  target/linux/apm821xx/base-files/etc/rc.button/BTN_1 | 19 +++++++++++++++++++
> > >  target/linux/apm821xx/dts/wndr4700.dts               |  2 +-
> > >  2 files changed, 20 insertions(+), 1 deletion(-)
> > >  create mode 100755 target/linux/apm821xx/base-files/etc/rc.button/BTN_1
> > > 
> > > diff --git
> > > a/target/linux/apm821xx/base-files/etc/rc.button/BTN_1
> > > b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 new file
> > > mode 100755 index 0000000..9956412
> > > --- /dev/null
> > > +++ b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1
> > > @@ -0,0 +1,19 @@
> > > +#!/bin/sh
> > > +
> > > +. /lib/functions.sh
> > > +. /lib/apm821xx.sh
> > > +
> > > +BOARD=$(apm821xx_board_name)
> > > +
> > > +if [ $BOARD == "wndr4700" ]; then
> > > +	case "$ACTION" in
> > > +	released)
> > > +		rmmod dwc2
> > > +	;;
> > > +	pressed)
> > > +		modprobe dwc2
> > > +	;;
> > > +	esac
> > > +fi
> > > +
> > > +return 0
> > > diff --git a/target/linux/apm821xx/dts/wndr4700.dts
> > > b/target/linux/apm821xx/dts/wndr4700.dts index 9a2ceb9..caaf05b
> > > 100644
> > > --- a/target/linux/apm821xx/dts/wndr4700.dts
> > > +++ b/target/linux/apm821xx/dts/wndr4700.dts
> > > @@ -432,7 +432,7 @@
> > >  
> > >  				sdcard {
> > >  					label = "SDCard inserted";
> > > -					gpios = <&GPIO0 7 0>;
> > > +					gpios = <&GPIO0 7 1>;
> > >  					linux,code = <0x101>; /* BTN_1 */
> > >  				};
> > >  			};
> > 
> 
> 
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



More information about the Lede-dev mailing list