all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Jeronimo Pellegrini <j_p@aleph0.info>
Cc: 35639@debbugs.gnu.org
Subject: bug#35639: 27.0.50; tramp fails to use ssh on LibreCMC (no base64 encoder available, and not mentioned in tramp manual)
Date: Fri, 10 May 2019 12:18:17 +0200	[thread overview]
Message-ID: <87imui1ul2.fsf@gmx.de> (raw)
In-Reply-To: <20190510094930.GF1697@socrates.lan> (Jeronimo Pellegrini's message of "Fri, 10 May 2019 06:49:31 -0300")

Jeronimo Pellegrini <j_p@aleph0.info> writes:

> Hello Michael,

Hi Jeronimo,

>> > +(defconst tramp-hexdump-awk-coding-test
>> > +  "test -c /dev/zero && \
>> > +busybox hexdump -v -e '16/1 \" %02x\" \"\\n\"' < /dev/null && \
>>
>> This must be "hexdump", not "busybox hexdump".
>
> The original tramp-awk-encode uses "busybux awk". Is there a particular
> reason for that, or could it also be changed to "awk"?

I don't remember exactly, but I believe there was a reason. Likely, a
simple "awk" didn't work, but "busybox awk" did. On whatever test machine.

> and so on, so if busybox is called and argv[0] is "awk" it knows
> the user's intention. So, using "busybox awk" and "busybox hexdump"
> would guarantee that this encoding scheme works on devices where the
> symlinks are not available (I've never seen one actually); on the other
> hand, it would break the encoding method for computers which do have
> awk and hexdump, but no busybox... What do we do? Duplicate the
> functions again?

The awk methods are intended for very leightweighted machines, like
routers or NAS devices. It is expected that they have installed busybox.

According to <https://busybox.net/downloads/BusyBox.html>, "awk",
"hexdump" and "od" are subcommands of busybox. Unfortunately, not all
busybox installations have all subcommands compiled in. For example, on
my NAS device "awk" and "hexdump" are part of busybox, "od" isn't.

--8<---------------cut here---------------start------------->8---
[~] # busybox --help
BusyBox v1.01 (2019.03.22-03:18+0000) multi-call binary

Usage: busybox [function] [arguments]...
   or: [function] [arguments]...

	BusyBox is a multi-call binary that combines many common Unix
	utilities into a single executable.  Most people will create a
	link to busybox for each function they wish to use and BusyBox
	will act like whatever it was invoked as!

Currently defined functions:
	[, addgroup, adduser, ash, awk, basename, bunzip2, busybox,
	bzcat, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp,
	cp, crond, crontab, cut, date, dc, dd, deallocvt, delgroup,
	deluser, df, dirname, dmesg, dos2unix, du, echo, egrep, env,
	expr, false, fdisk, fgrep, find, free, getty, grep, gunzip,
	gzip, halt, head, hexdump, hostname, hwclock, id, ifconfig,
	init, insmod, install, ip, kill, killall, klogd, linuxrc, ln,
	logger, login, ls, lsmod, md5sum, mkdir, mknod, mktemp, modprobe,
	more, mount, mv, nameif, netstat, nslookup, openvt, passwd,
	pidof, ping, ping6, pivot_root, poweroff, ps, pwd, rdate, readlink,
	reboot, renice, reset, rm, rmdir, rmmod, route, sed, sh, sha1sum,
	sleep, sort, strings, swapoff, swapon, switch_root, sync, sysctl,
	syslogd, tail, tar, tee, telnet, test, tftp, time, top, touch,
	tr, traceroute, true, tty, umount, uname, uniq, unix2dos, unzip,
	uptime, usleep, vi, wc, wget, which, whoami, xargs, yes, zcat
--8<---------------cut here---------------end--------------->8---

Maybe, we shall use just a template for the encoding/decoding functions,
and for all busybox subcommands we need a test, whether they can be
invoked via "busybox command" or "command". There will be sevaeral
combinations to test.

> tramp-busybox-od-awk-encode
> tramp-busybox-hexdump-awk-encode
> tramp-busybox-awk-decode
>
> tramp-od-awk-encode
> tramp-hexdump-awk-encode
> tramp-awk-decode
>
> I feel like that would be a too large amount of duplicated code...
> Or is that ok?

No, too much duplicated code. As said above, provide
tramp-od-awk-encode, tramp-hexdump-awk-encode and tramp-awk-decode, and
make intelleigent tests whether "awk", "hexdump" and "od" need to be
prefixed by "busybox".

> Thank you for your patience!
> J.

Best regards, Michael.





  reply	other threads:[~2019-05-10 10:18 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 16:25 bug#35639: 27.0.50; tramp fails to use ssh on LibreCMC (no base64 encoder available, and not mentioned in tramp manual) Jeronimo Pellegrini
2019-05-08 18:29 ` Michael Albinus
2019-05-08 23:01   ` Jeronimo Pellegrini
2019-05-09  7:35     ` Michael Albinus
2019-05-09 10:19       ` Jeronimo Pellegrini
2019-05-09 12:05         ` Michael Albinus
2019-05-09 12:37           ` Jeronimo Pellegrini
2019-05-09 12:45             ` Michael Albinus
2019-05-09 19:52               ` Jeronimo Pellegrini
2019-05-09 20:02                 ` Michael Albinus
2019-05-09 20:11                   ` Jeronimo Pellegrini
2019-05-10  8:40                     ` Michael Albinus
2019-05-10  9:07                       ` Robert Pluim
2019-05-10  9:17                         ` Michael Albinus
2019-05-10  9:49                       ` Jeronimo Pellegrini
2019-05-10 10:18                         ` Michael Albinus [this message]
2019-05-10 14:45                           ` Jeronimo Pellegrini
2019-05-11  1:57                             ` Jeronimo Pellegrini
2019-05-12  8:43                               ` Michael Albinus
2019-05-17 19:00                                 ` Jeronimo Pellegrini
2019-05-18  7:46                                   ` Michael Albinus
2019-10-11 13:14                   ` Michael Albinus
2019-10-14  1:50                     ` Jeronimo Pellegrini via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-14  7:59                       ` Michael Albinus
2019-12-27 17:26                         ` Michael Albinus
2019-12-27 18:42                           ` Eli Zaretskii
2019-12-30 13:12                           ` Jeronimo Pellegrini
2020-01-01  9:28                             ` Michael Albinus
2020-01-01 15:39                               ` Jeronimo Pellegrini via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-01-09 12:58                                 ` Michael Albinus
2020-01-11 13:07                                   ` Jeronimo Pellegrini via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-01-11 13:23                                     ` Michael Albinus
2020-01-16 20:09                                       ` Jeronimo Pellegrini via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-01-16 20:23                                         ` Michael Albinus
2019-10-15  2:38                       ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imui1ul2.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=35639@debbugs.gnu.org \
    --cc=j_p@aleph0.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.