question

Mike Dorsett avatar image
Mike Dorsett asked

Venus OS 2.66 bash missing 'dir' command?

Just started with Venus OS (2.66) on Pi3b, and having some problems trying to integrate dbus-serialbattery. In trying to debug this, the lack of the DIR command in bash became apparent - this is very useful in trying to find out where you are and navigate the directory structure. Also Venus does not seem to run an rc.local file in the /etc folder? The Three volumes created by the Venus installation are also not labeled as per the normal pi OS, and there seems to be some duplication of folders between what should be 'root' and what should be 'settings'...Please can we have the 'dir' command back?

Venus OSRaspberry Pi
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
wkirby avatar image
wkirby answered ·

Would "ls" not work for you instead of "dir"?
rc.local should go in /data
/data is preserved during updates.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mike Dorsett avatar image
Mike Dorsett answered ·

Thanks, I think there's a copy there too.... ls does work though. I'm just not used to using command line these days... last time I did a lot was like 40 years ago, when there was no choice.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image
Kevin Windrem answered ·

Venus OS is Linux, not MS DOS and there has never been a DIR command in any unix derivative.

ls -al is the closest command to DIR.

Venus OS uses a dual rootfs and there are actually 4 partitions: the running /root, a "backup" /root, /data where all persistent settings are stored and /boot (or /u-boot). The latter is used by the boot loader on the PI to initialize a few things then transfers to the Linux kernel.

When Venus OS software is updated, it is stored in the "other" root fs. If the update is successful, the "other" root fs becomes the active /root. Nothing in /root survives a software update, so any modifications you make to the system must be reinstalled after a software update.

If present, Venus OS executes the /data/rc.local and /data/rcS.local shell scripts during boot. These can be used to reinstall system modifications after a Venus OS update.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

wkirby avatar image wkirby ♦♦ commented ·
FYI, the bash terminal in Ubuntu (for example) does understand the "dir" command. It works just like "ls". I personally use "ls" but "dir" is there too, who knew!
0 Likes 0 ·
Juha Tuomala avatar image Juha Tuomala wkirby ♦♦ commented ·

dir command is a binary that resides in /usr/bin and part of Linux coreutils package. VenusOS uses busybox embedded environment which does not have coreutils - but is based on single binary.


Go to /bin directory and run ls -l command there, you see that most commands are actually symlinks to single binary busybox.nosuid (no super user id execution rights) in the same directory. That's how the busybox is built. And, it does not support dir, you can also run those commands as an argument for busybox binary:


/bin/busybox dir
dir: applet not found


Run it without argument, you see what it supports:

# /bin/busybox  
BusyBox v1.31.1 (2024-02-19 16:22:34 UTC) multi-call binary. BusyBox is copyrighted by many authors between 1998-2015. Licensed under GPLv2. See source distribution for detailed copyright notices. Usage: busybox [function [arguments]...]    or: busybox --list    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:         [, [[, ash, awk, basename, bunzip2, bzcat, bzip2, cat, chattr, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, cut, date, dc, dd, deallocvt, df, diff, dirname, dmesg,         dnsdomainname, du, dumpkmap, dumpleases, echo, egrep, env, expr, false, fbset, fdisk, fgrep, find, flock, free, fsck, fstrim, fuser, getty, grep, groups, gunzip, gzip, head,         hexdump, hostname, hwclock, i2cdetect, i2cdump, i2cget, i2cset, i2ctransfer, id, ifconfig, ifdown, ifup, insmod, ip, kill, killall, klogd, less, ln, loadfont, loadkmap,         logger, logname, logread, losetup, ls, lsmod, lzcat, md5sum, microcom, mkdir, mkfifo, mknod, mkswap, mktemp, modprobe, more, mount, mountpoint, mv, nc, netstat, nice, nohup,         nproc, nslookup, od, openvt, patch, pgrep, pidof, pivot_root, pkill, printf, ps, pstree, pwd, rdate, readlink, realpath, reboot, renice, reset, rfkill, rm, rmdir, rmmod,         route, run-parts, sed, seq, setconsole, setsid, sh, sha1sum, sha256sum, shuf, sleep, sort, stat, strings, stty, swapoff, swapon, switch_root, sync, sysctl, syslogd, tail, tar,         tee, telnet, test, tftp, time, top, touch, tr, true, truncate, ts, tty, udhcpc, udhcpd, umount, uname, uniq, unlink, unzip, uptime, users, usleep, vi, watch, wc, which, who,         whoami, xargs, xzcat, yes, zcat


Looks like it doesn't even have it in coreutils applet sources

https://git.busybox.net/busybox/tree/coreutils

Better get used to use ls.


0 Likes 0 ·