If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.

0
U

Property:rpc (avmcmd)

From BoxMatrix


BoxMatrix >> Shell-Commands >> rpc (avmcmd) @ BoxMatrix   -   IRC-Chat   -   Translate: de es fr it nl pl
News Selectors Models Accessories Components Environment Config Commands System Webif Software Develop Lexicon Community Project Media

Startup-Scr Hotplug-Scr BusyBox-Cmds Bash-Cmds AVM-Cmds Chipset-Cmds Linux-Cmds Shared-Libs Kernel-Mods Research

Info
  
Name-Collision - multiple objects in this wiki use the name rpc!
rpc (avmcmd) Remote command executer for Puma6 / Puma7 models.
rpc (event) ptestd remote commands
rpc (static) TODO
rpc (tmpdir) TODO
rpc (vartar) TODO

AVM-Command

Goto:   Examples  -  Source  -  Dependencies   -   Model-Matrix   -   Symbols   -   SMW-Browser

Details

rpc is a remote command executer for Puma6 / Puma7 models, runing the passed command on 'the other' CPU.
Since FRITZ!OS is completely ported to ATOM rpc is installed on the ATOM side to run a command on the ARM CPU.
In early 64xx firmware when FRITZ!OS was running on the ARM rpc was installed there to run a command on the ATOM CPU.

The arguments passed to rpc are launched in a remote sh invocation which redirects its stdin, stdout and stderr back to rpc.
There is no way to do input or output redirection or use piping on the target side. This has to be done on the rpc side.

The error handling is special. The redirection of stderr only works as long as the target command does not fail.
Whenever a command fails the hardcoded string rpc: call failed: file or directory not found is printed to stdout.
This means redirecting stderr with 2> only makes sense if the target command prints something to stderr without failing.

This works since dd prints the report to stderr without failing:

root@fritz2:/var/mod/root# rpc dd if=/dev/zero of=/dev/null count=1

1+0 records in
1+0 records out

root@fritz2:/var/mod/root# rpc dd if=/dev/zero of=/dev/null count=1 2>/dev/null

Here redirection fails, dd fails on the invalid option and the default error is reported to stdout (not stderr):

root@fritz2:/var/mod/root# rpc dd invalid=2 if=/dev/zero of=/dev/null count=1 2>/dev/null

rpc: call failed: file or directory not found

dd did print its help text to stderr on the target side, but it is dropped to report the hardcoded error to stdout.
This means you never get a real error message from the target side unless you use an armconsole.

fw 7.29 help:

root@fritz2:/var/mod/root# rpc -?

Usage: rpc remote_command_line
       rpc [OPTIONS] -- remote_command_line

         -t SEC           timeout SEC seconds
         -s               connect over socket
         -f="src:tgt"   file transfer

There's a limit for the remote_command_line length, if it's exceeded rpc reports:

rpc: ERROR 0x86 (errno 0): remote command line too long, max. size:
     4*argc + strlen(argv[0]) + ... + strlen(argv[argc-1]) <= 224

Examples

Let's compare the kernels running both Linux instances in fw 7.29:

root@fritz2:/var/mod/root# uname -a

Linux fritz2 2.6.39.4 #1 SMP PREEMPT 2021-06-04 i686 GNU/Linux

root@fritz2:/var/mod/root# rpc uname -a

Linux FRITZ!Box Cable 2.6.39.4 #1 PREEMPT 2021-06-04 armv6b

Let's peek the ARM Linux acc0 interface from the ATOM Linux in fw 7.29;

root@fritz2:/var/mod/root# rpc ifconfig acc0

acc0      Link encap:Ethernet  HWaddr 4A:1B:86:XX:XX:XX  
          inet addr:169.254.1.2  Bcast:0.0.0.0  Mask:255.255.255.252
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2353120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2348476 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:121915139 (116.2 MiB)  TX bytes:1012745287 (965.8 MiB)

Source

The names of source files compiled into an executable often help to understand function blocks (and show gaps in the docs).
fw 7.29 source files:

$ strings /usr/bin/rpc | grep -e '\.c$' -e '\.cpp$'

src/rexec.c
src/message.c  

Dependencies

Daily updated index of all dependencies of this command. Last update: 2024-04-18 19:26 GMT.
A * in the Mod column marks info from Supportdata-Probes, which will always stay incomplete.

Relation Typ Object Mod Firmware Info Origin
Depends on lib ld.so 4 7.08 - 7.13 Dynamic linker / loader Linux
Depends on lib libavmcsock.so 44 6.20 - 7.62 Networking, I/O and helper functions AVM
Depends on lib libc.so 44 6.20 - 7.62 Standard C library Linux
Depends on lib libgcc_s.so 6 6.20 - 6.110 GCC low-level runtime library Linux
4 dependencies for this command

Model-Matrix

Daily updated index of the presence, path and size of this command for each model. Last update: 2024-04-18 15:53 GMT.
Showing all models using this command. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom) label in the Model column shows which CPU is meant for models with multiple Linux instances.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.

Model Firmware Path Size
FRITZ!Box 4020 7.39 /usr/bin 17.4k
FRITZ!Box 4040 7.39 /usr/bin 17.4k
FRITZ!Box 4060 7.39 /usr/bin 17.4k
FRITZ!Box 5530 Fiber (main) 7.39 /usr/bin 17.4k
FRITZ!Box 5590 Fiber (arm) 7.39 /usr/bin 17.4k
FRITZ!Box 6430 Cable (arm) 6.84 - 7.57 /usr/bin 9.7k - 17.4k
FRITZ!Box 6430 Cable (atom) 6.84 - 7.29 /usr/bin 10.5k - 13.2k
FRITZ!Box 6490 Cable (arm) 6.20 - 7.57 /usr/bin 9.7k - 17.4k
FRITZ!Box 6490 Cable (atom) 6.20 - 7.51 /usr/bin 10.5k - 13.2k
FRITZ!Box 6590 Cable (arm) 6.83 - 7.57 /usr/bin 9.7k - 17.4k
FRITZ!Box 6590 Cable (atom) 6.83 - 7.51 /usr/bin 10.5k - 13.2k
FRITZ!Box 6591 Cable (arm) 7.04 - 7.57 /usr/bin 11.8k - 17.4k
FRITZ!Box 6591 Cable (atom) 7.04 - 7.57 /usr/bin 11.8k - 17.4k
FRITZ!Box 6660 Cable (arm) 7.14 - 7.57 /usr/bin 13.3k - 17.4k
FRITZ!Box 6660 Cable (atom) 7.14 - 7.57 /usr/bin 13.3k - 17.4k
FRITZ!Box 6670 Cable (arm) 7.57 - 7.62 /usr/bin 13.6k - 17.4k
FRITZ!Box 6670 Cable (atom) 7.61 - 7.62 /usr/bin 17.4k
FRITZ!Box 6690 Cable (arm) 7.28 - 7.57 /usr/bin 13.3k - 17.4k
FRITZ!Box 6690 Cable (atom) 7.28 - 7.57 /usr/bin 13.3k - 17.4k
FRITZ!Box 6820 LTE v1 7.39 /usr/bin 17.4k
FRITZ!Box 6820 LTE v2 7.39 /usr/bin 17.4k
FRITZ!Box 6840 LTE 7.39 /usr/bin 17.4k
FRITZ!Box 6850 LTE 7.39 /usr/bin 17.4k
FRITZ!Box 6850 5G 7.39 /usr/bin 17.4k
FRITZ!Box 6890 LTE 7.39 /usr/bin 17.4k
FRITZ!Box 6890 LTE v1 7.39 /usr/bin 17.4k
FRITZ!Box 6890 LTE v2 7.39 /usr/bin 17.4k
FRITZ!Box 7272 7.39 /usr/bin 17.4k
FRITZ!Box Fon WLAN 7390 /usr/bin 542
FRITZ!Box 7430 7.39 /usr/bin 17.4k
FRITZ!Box 7490 (main) 7.39 - 7.57 /usr/bin 17.4k
FRITZ!Box 7520 7.39 /usr/bin 17.4k
FRITZ!Box 7520 v2 (arm) 7.39 /usr/bin 17.4k
FRITZ!Box 7530 7.39 /usr/bin 17.4k
FRITZ!Box 7530 AX 7.39 /usr/bin 17.4k
FRITZ!Box 7560 7.39 /usr/bin 17.4k
FRITZ!Box 7590 7.39 /usr/bin 17.4k
FRITZ!Box 7590 AX 7.39 /usr/bin 17.4k
FRITZ!Repeater 600 7.39 /usr/bin 17.4k
FRITZ!Repeater 1200 7.39 /usr/bin 17.4k
FRITZ!WLAN Repeater 1750E 7.39 /usr/bin 17.4k
FRITZ!Repeater 2400 7.39 /usr/bin 17.4k
FRITZ!Repeater 3000 7.39 /usr/bin 17.4k
FRITZ!Repeater 3000 AX 7.39 /usr/bin 17.4k
FRITZ!Powerline 1260E 7.39 /usr/bin 17.4k
45 models use this command

Symbols

Daily updated index of all symbols of this command. Last update: 2024-04-18 19:26 GMT.

Firmware Symbol
7.08 - 7.51 main
1 symbol for this command

SMW-Browser

Information is currently being retrieved from the backend.