Changeset 13273


Ignore:
Timestamp:
2008-11-18T00:22:27+01:00 (8 years ago)
Author:
jow
Message:

make mmc_over_gpio init uci-aware

Location:
trunk/package/mmc_over_gpio
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/mmc_over_gpio/Makefile

    r11887 r13273  
    99 
    1010PKG_NAME:=mmc-over-gpio 
    11 PKG_RELEASE:=2 
     11PKG_RELEASE:=3 
    1212 
    1313include $(INCLUDE_DIR)/package.mk 
     
    3535 
    3636define KernelPackage/mmc-over-gpio/install 
     37        $(INSTALL_DIR) $(1)/etc/config 
     38        $(INSTALL_DATA) ./files/mmc_over_gpio.config $(1)/etc/config/mmc_over_gpio 
    3739        $(INSTALL_DIR) $(1)/etc/init.d 
    3840        $(INSTALL_BIN) ./files/mmc_over_gpio.init $(1)/etc/init.d/mmc_over_gpio 
  • trunk/package/mmc_over_gpio/files/mmc_over_gpio.init

    r11887 r13273  
    99        local dir="$CONFIGFS_DIR/$1" 
    1010 
    11         mkdir $dir 
     11        mkdir -p $dir 
    1212        [ $? -eq 0 ] || return 1 
    1313        echo $2 > $dir/gpio_data_in 
     
    5151} 
    5252 
     53start_service() { 
     54        local section="$1" 
     55        config_get "name" "$section" "name" 
     56        config_get "DI_pin" "$section" "DI_pin" 
     57        config_get "DO_pin" "$section" "DO_pin" 
     58        config_get "CLK_pin" "$section" "CLK_pin" 
     59        config_get "CS_pin" "$section" "CS_pin" 
     60        config_get "mode" "$section" "mode" 
     61        config_get_bool "enabled" "$section" "enabled" '1' 
     62        [ "$enabled" -gt 0 ] && add_device "$name" $DI_pin $DO_pin $CLK_pin $CS_pin $mode & 
     63} 
     64 
     65stop_service() { 
     66        local section="$1" 
     67        config_get "name" "$section" "name" 
     68        remove_device "$name" 
     69} 
     70 
    5371start() { 
    5472        # Make sure configfs is mounted 
     
    5674        [ $? -eq 0 ] || return 1 
    5775 
    58         #FIXME we should use a config file, but I dunno how that parser works. 
    59         add_device "default" 5 4 3 7 0 
     76        config_load "mmc_over_gpio" 
     77        config_foreach start_service "mmc_over_gpio" 
    6078} 
    6179 
    6280stop() { 
    63         remove_device "default" 
     81        config_load "mmc_over_gpio" 
     82        config_foreach stop_service "mmc_over_gpio" 
    6483} 
Note: See TracChangeset for help on using the changeset viewer.