2 unstable releases
0.3.1 | Mar 4, 2025 |
---|---|
0.1.0 | Feb 2, 2025 |
#607 in Filesystem
90 downloads per month
79KB
1.5K
SLoC
Squinter-CLI
![Documentation]
A set of command-line utilities that make use of the Squinter SquashFS interface library. Currently, two commands are included.
sqcmd
This command allows you to perform read operations within a SquashFS image as if it were a mounted filesystem. The command live-parses the SquashFS to provide output and behavior similar to well- known UNIX shell commands.
General syntax:
sqcmd <FILESYSTEM> <COMMAND> [COMMAND ARGUMENTS]
where
- FILESYSTEM: The SquashFS image file or device to act on
- COMMAND: The command to run within the SquashFS (ls, cat)
- COMMAND ARGUMENTS: Command-specific arguments (see below)
Individual commands are described below.
ls
List directory contents. Supports the '-l' flag for detailed listing. Does not support other options supported by the real ls command.
$ sqcmd test.squashfs ls /bin
ash dd gzip mount ps traceroute
board_detect df ipcalc.sh mv pwd traceroute6
busybox dmesg kill netmsg rm true
cat echo ln netstat rmdir ubus
chgrp egrep lock nice sed uclient-fetch
chmod false login opkg sh umount
chown fgrep ls passwd sleep uname
config_generate fsync mkdir pidof sync vi
cp grep mknod ping tar zcat
date gunzip mktemp ping6 touch
$ sqcmd test.squashfs ls -l /bin
total 59
lrwxrwxrwx - ash -> busybox
-rwxr-xr-x 205 board_detect
-rwxr-xr-x 458773 busybox
lrwxrwxrwx - cat -> busybox
...output lines omitted...
lrwxrwxrwx - uname -> busybox
lrwxrwxrwx - vi -> busybox
lrwxrwxrwx - zcat -> busybox
cat
Output file contents to stdout. Does not support any additional options beyond the files to output.
$ sqcmd test.squashfs cat /etc/passwd
root:x:0:0:root:/root:/bin/ash
daemon:*:1:1:daemon:/var:/bin/false
ftp:*:55:55:ftp:/home/ftp:/bin/false
network:*:101:101:network:/var:/bin/false
nobody:*:65534:65534:nobody:/var:/bin/false
ntp:x:123:123:ntp:/var/run/ntp:/bin/false
dnsmasq:x:453:453:dnsmasq:/var/run/dnsmasq:/bin/false
logd:x:514:514:logd:/var/run/logd:/bin/false
ubus:x:81:81:ubus:/var/run/ubus:/bin/false
unsqfs
This is a mostly useless partial clone of unsquashfs. It currently does not support filesystem extraction. It only supports listing (-l) and cat'ing (--cat) the filesystem contents.
General syntax:
unsqfs [OPTIONS] <FILESYSTEM> [FILES]...
where
- FILESYSTEM: The SquashFS image file or device to act on
- Options:
- -l: List all files under the given paths (default: /)
- --cat: Print the contents of all files under the given paths (default: /)
Dependencies
~3.5MB
~68K SLoC