[OpenWrt-Devel] How to execute python script in rpc shell script

2018-02-14 Thread Phani Siriki
 Hi All

I want to execute my custom python scripts in rpc shell script. However,
they are not executed. Could someone help me on this?

*Example Python script:*
*===*
root@OpenWrt:~# cat hello.py
from subprocess import call

call(["touch", "/root/ap1", "down"])

print "{'status':'True'}"

*Shell script:*
*==*
root@OpenWrt:~# cat /usr/libexec/rpcd/foo
#!/bin/sh
. /usr/share/libubox/jshn.sh
case "$1" in
list)
echo '{ "bar": { "arg1": true, "arg2": 32, "arg3": "str" },
"toto": { } }'
;;
call)
case "$2" in
bar)
# read the arguments
read input;

# optionally log the call
logger -t "foo" "call" "$2" "$input"

*python /root/hello.py*

# return json object or an array
echo '{ "hello": "world" }'
;;
toto)
# return json object or an array
echo '[ "item1", "item2", "item3" ]'
;;
esac
;;
esac
root@OpenWrt:~#
root@OpenWrt:~# ubus call -S foo bar '{"arg1": true }'
{"hello":"world"}
root@OpenWrt:~#
root@OpenWrt:~# ls  ==> Files are not created.
Math  foo   hello.py
root@OpenWrt:~#

Best Regards
Phani
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Building own kernel in OpenWRT

2017-12-02 Thread Phani Siriki
Hi Ronaldo

Thank you for your reply.

I referred to the link you suggested. But I couldn't find any information
which tells how to point to my modified linux code (either github link or
local repo).

Could you please help me on this?

Best Regards
Phani

On Tue, Nov 28, 2017 at 5:16 AM, Ronaldo Afonso <
rona...@ronaldoafonso.com.br> wrote:

>  Hi Phani,
>
>  Take a look at the "make kernel_menuconfig" or this link:
> https://wiki.openwrt.org/doc/howto/build#kernel_configuration_optional
>
>  Regards ...
>
> 2017-11-27 19:03 GMT-02:00 Phani Siriki <yvsg.pha...@gmail.com>:
>
>> Dear All
>>
>> I want to change the linux kernel in my OpenWrt build.
>>
>> I made changes to the kernel and committed to my github account.
>>
>> Could someone let me know the makefiles I need to change to get the
>> kernel of my own?
>>
>> Thanks in Advance.
>>
>> Best Regards
>> Phani
>>
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
>>
>
>
> --
> Ronaldo Afonso
> 11 9 5252 0484
> www.ronaldoafonso.com.br
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Building own kernel in OpenWRT

2017-11-27 Thread Phani Siriki
Dear All

I want to change the linux kernel in my OpenWrt build.

I made changes to the kernel and committed to my github account.

Could someone let me know the makefiles I need to change to get the kernel
of my own?

Thanks in Advance.

Best Regards
Phani
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel