-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tool to create distro compatibility table, and initial data for it (
#1390) Signed-off-by: Jamon Camisso <[email protected]>
- Loading branch information
1 parent
aa7756a
commit ce98fdf
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"alpine": { | ||
"busybox": ["[", "[[", "acpid", "add-shell", "addgroup", "adduser", "adjtimex", "arch", "arp", "arping", "ash", "awk", "base64", "basename", "bbconfig", "bc", "beep", "blkdiscard", "blkid", "blockdev", "brctl", "bunzip2", "bzcat", "bzip2", "cal", "cat", "chattr", "chgrp", "chmod", "chown", "chpasswd", "chroot", "chvt", "cksum", "clear", "cmp", "comm", "cp", "cpio", "crond", "crontab", "cryptpw", "cut", "date", "dc", "dd", "deallocvt", "delgroup", "deluser", "depmod", "df", "diff", "dirname", "dmesg", "dnsdomainname", "dos2unix", "du", "dumpkmap", "echo", "egrep", "eject", "env", "ether-wake", "expand", "expr", "factor", "fallocate", "false", "fatattr", "fbset", "fbsplash", "fdflush", "fdisk", "fgrep", "find", "findfs", "flock", "fold", "free", "fsck", "fstrim", "fsync", "fuser", "getopt", "getty", "grep", "groups", "gunzip", "gzip", "halt", "hd", "head", "hexdump", "hostid", "hostname", "hwclock", "id", "ifconfig", "ifdown", "ifenslave", "ifup", "init", "inotifyd", "insmod", "install", "ionice", "iostat", "ip", "ipaddr", "ipcalc", "ipcrm", "ipcs", "iplink", "ipneigh", "iproute", "iprule", "iptunnel", "kbd_mode", "kill", "killall", "killall5", "klogd", "last", "less", "link", "linux32", "linux64", "ln", "loadfont", "loadkmap", "logger", "login", "logread", "losetup", "ls", "lsattr", "lsmod", "lsof", "lsusb", "lzcat", "lzma", "lzop", "lzopcat", "makemime", "md5sum", "mdev", "mesg", "microcom", "mkdir", "mkdosfs", "mkfifo", "mkfs.vfat", "mknod", "mkpasswd", "mkswap", "mktemp", "modinfo", "modprobe", "more", "mount", "mountpoint", "mpstat", "mv", "nameif", "nanddump", "nandwrite", "nbd-client", "nc", "netstat", "nice", "nl", "nmeter", "nohup", "nologin", "nproc", "nsenter", "nslookup", "ntpd", "od", "openvt", "partprobe", "passwd", "paste", "pgrep", "pidof", "ping", "ping6", "pipe_progress", "pivot_root", "pkill", "pmap", "poweroff", "printenv", "printf", "ps", "pscan", "pstree", "pwd", "pwdx", "raidautorun", "rdate", "rdev", "readahead", "readlink", "realpath", "reboot", "reformime", "remove-shell", "renice", "reset", "resize", "rev", "rfkill", "rm", "rmdir", "rmmod", "route", "run-parts", "sed", "sendmail", "seq", "setconsole", "setfont", "setkeycodes", "setlogcons", "setpriv", "setserial", "setsid", "sh", "sha1sum", "sha256sum", "sha3sum", "sha512sum", "showkey", "shred", "shuf", "slattach", "sleep", "sort", "split", "stat", "strings", "stty", "su", "sum", "swapoff", "swapon", "switch_root", "sync", "sysctl", "syslogd", "tac", "tail", "tar", "tee", "test", "time", "timeout", "top", "touch", "tr", "traceroute", "traceroute6", "tree", "true", "truncate", "tty", "ttysize", "tunctl", "udhcpc", "udhcpc6", "umount", "uname", "unexpand", "uniq", "unix2dos", "unlink", "unlzma", "unlzop", "unshare", "unxz", "unzip", "uptime", "usleep", "uudecode", "uuencode", "vconfig", "vi", "vlock", "volname", "watch", "watchdog", "wc", "wget", "which", "who", "whoami", "whois", "xargs", "xxd", "xzcat", "yes", "zcat", "zcip"], | ||
"coreutils": ["[", "b2sum", "base32", "base64", "basename", "basenc", "cat", "chcon", "chgrp", "chmod", "chown", "chroot", "cksum", "comm", "coreutils", "cp", "csplit", "cut", "date", "dd", "df", "dir", "dircolors", "dirname", "du", "echo", "expand", "expr", "factor", "false", "fold", "head", "hostid", "id", "install", "join", "link", "ln", "logname", "ls", "md5sum", "mkdir", "mkfifo", "mknod", "mktemp", "mv", "nice", "nl", "nohup", "nproc", "numfmt", "od", "paste", "pathchk", "pinky", "pr", "printenv", "printf", "ptx", "pwd", "readlink", "realpath", "rm", "rmdir", "runcon", "seq", "sha1sum", "sha224sum", "sha256sum", "sha384sum", "shred", "shuf", "sleep", "sort", "split", "stat", "stdbuf", "stty", "sum", "sync", "tac", "tail", "tee", "test", "timeout", "touch", "tr", "true", "truncate", "tsort", "tty", "uname", "unexpand", "uniq", "unlink", "users", "vdir", "wc", "who", "whoami", "yes"] | ||
}, | ||
"debian": { | ||
"busybox": ["[", "[[", "acpid", "adjtimex", "ar", "arch", "arp", "arping", "ascii", "ash", "awk", "base64", "basename", "bc", "blkdiscard", "blkid", "blockdev", "brctl", "bunzip2", "bzcat", "bzip2", "cal", "cat", "chgrp", "chmod", "chown", "chroot", "chvt", "clear", "cmp", "cp", "cpio", "crc32", "cttyhack", "cut", "date", "dc", "dd", "deallocvt", "depmod", "devmem", "df", "diff", "dirname", "dmesg", "dnsdomainname", "dos2unix", "du", "dumpkmap", "dumpleases", "echo", "egrep", "env", "expand", "expr", "factor", "fallocate", "false", "fatattr", "fdisk", "fgrep", "find", "findfs", "fold", "free", "freeramdisk", "fsfreeze", "fstrim", "ftpget", "ftpput", "getopt", "getty", "grep", "groups", "gunzip", "gzip", "halt", "head", "hexdump", "hostid", "hostname", "httpd", "hwclock", "i2cdetect", "i2cdump", "i2cget", "i2cset", "i2ctransfer", "id", "ifconfig", "ifdown", "ifup", "init", "insmod", "ionice", "ip", "ipcalc", "ipneigh", "kill", "killall", "klogd", "last", "less", "link", "linux32", "linux64", "linuxrc", "ln", "loadfont", "loadkmap", "logger", "login", "logname", "logread", "losetup", "ls", "lsmod", "lsscsi", "lzcat", "lzma", "lzop", "md5sum", "mdev", "microcom", "mim", "mkdir", "mkdosfs", "mke2fs", "mkfifo", "mknod", "mkpasswd", "mkswap", "mktemp", "modinfo", "modprobe", "more", "mount", "mt", "mv", "nameif", "nc", "netstat", "nl", "nologin", "nproc", "nsenter", "nslookup", "nuke", "od", "openvt", "partprobe", "paste", "patch", "pidof", "ping", "ping6", "pivot_root", "poweroff", "printf", "ps", "pwd", "rdate", "readlink", "realpath", "reboot", "renice", "reset", "resume", "rev", "rm", "rmdir", "rmmod", "route", "rpm", "rpm2cpio", "run-init", "run-parts", "sed", "seq", "setkeycodes", "setpriv", "setsid", "sh", "sha1sum", "sha256sum", "sha3sum", "sha512sum", "shred", "shuf", "sleep", "sort", "ssl_client", "start-stop-daemon", "stat", "strings", "stty", "svc", "svok", "swapoff", "swapon", "switch_root", "sync", "sysctl", "syslogd", "tac", "tail", "tar", "taskset", "tee", "telnet", "test", "tftp", "time", "timeout", "top", "touch", "tr", "traceroute", "traceroute6", "true", "truncate", "ts", "tty", "ubirename", "udhcpc", "udhcpd", "uevent", "umount", "uname", "uncompress", "unexpand", "uniq", "unix2dos", "unlink", "unlzma", "unshare", "unxz", "unzip", "uptime", "usleep", "uudecode", "uuencode", "vconfig", "vi", "w", "watch", "watchdog", "wc", "wget", "which", "who", "whoami", "xargs", "xxd", "xz", "xzcat", "yes", "zcat"], | ||
"coreutils": ["[", "arch", "b2sum", "base32", "base64", "basename", "basenc", "bin", "cat", "chcon", "chgrp", "chmod", "chown", "chroot", "cksum", "comm", "cp", "csplit", "cut", "date", "dd", "df", "dir", "dircolors", "dirname", "du", "echo", "env", "expand", "expr", "factor", "false", "fmt", "fold", "groups", "head", "hostid", "id", "install", "join", "link", "ln", "logname", "ls", "md5sum", "md5sum.textutils", "mkdir", "mkfifo", "mknod", "mktemp", "mv", "nice", "nl", "nohup", "nproc", "numfmt", "od", "paste", "pathchk", "pinky", "pr", "printenv", "printf", "ptx", "pwd", "readlink", "realpath", "rm", "rmdir", "runcon", "sbin", "seq", "sha1sum", "sha224sum", "sha256sum", "sha384sum", "sha512sum", "shred", "shuf", "sleep", "sort", "split", "stat", "stdbuf", "stty", "sum", "sync", "tac", "tail", "tee", "test", "timeout", "touch", "tr", "true", "truncate", "tsort", "tty", "uname", "unexpand", "uniq", "unlink", "users", "usr", "vdir", "wc", "who", "whoami", "yes"] | ||
}, | ||
"redhat-ubi": { | ||
"busybox": [], | ||
"coreutils": ["[", "arch", "b2sum", "base32", "base64", "basename", "cat", "chcon", "chgrp", "chmod", "chown", "chroot", "cksum", "comm", "coreutils", "cp", "csplit", "cut", "date", "dd", "df", "dir", "dircolors", "dirname", "du", "echo", "env", "expand", "expr", "factor", "false", "fmt", "fold", "groups", "head", "hostid", "id", "install", "join", "link", "ln", "logname", "ls", "md5sum", "mkdir", "mkfifo", "mknod", "mktemp", "mv", "nice", "nl", "nohup", "nproc", "numfmt", "od", "paste", "pathchk", "pinky", "pr", "printenv", "printf", "ptx", "pwd", "readlink", "realpath", "rm", "rmdir", "runcon", "seq", "sha1sum", "sha224sum", "sha256sum", "sha384sum", "sha512sum", "shred", "shuf", "sleep", "sort", "split", "stat", "stdbuf", "stty", "sum", "sync", "tac", "tail", "tee", "test", "timeout", "touch", "tr", "true", "truncate", "tsort", "tty", "uname", "unexpand", "uniq", "unlink", "users", "vdir", "wc", "who", "whoami", "yes"] | ||
}, | ||
"ubuntu": { | ||
"busybox": ["[", "[[", "acpid", "adjtimex", "ar", "arch", "arp", "arping", "ash", "awk", "basename", "bc", "blkdiscard", "blockdev", "brctl", "bunzip2", "bzcat", "bzip2", "cal", "cat", "chgrp", "chmod", "chown", "chpasswd", "chroot", "chvt", "clear", "cmp", "cp", "cpio", "cttyhack", "cut", "date", "dc", "dd", "deallocvt", "depmod", "devmem", "df", "diff", "dirname", "dmesg", "dnsdomainname", "dos2unix", "du", "dumpkmap", "dumpleases", "echo", "egrep", "env", "expand", "expr", "factor", "fallocate", "false", "fatattr", "fgrep", "find", "fold", "free", "freeramdisk", "fsfreeze", "fstrim", "ftpget", "ftpput", "getopt", "getty", "grep", "groups", "gunzip", "gzip", "halt", "head", "hexdump", "hostid", "hostname", "httpd", "hwclock", "i2cdetect", "i2cdump", "i2cget", "i2cset", "id", "ifconfig", "ifdown", "ifup", "init", "insmod", "ionice", "ip", "ipcalc", "ipneigh", "kill", "killall", "klogd", "last", "less", "link", "linux32", "linux64", "linuxrc", "ln", "loadfont", "loadkmap", "logger", "login", "logname", "logread", "losetup", "ls", "lsmod", "lsscsi", "lzcat", "lzma", "lzop", "md5sum", "mdev", "microcom", "mkdir", "mkdosfs", "mke2fs", "mkfifo", "mknod", "mkpasswd", "mkswap", "mktemp", "modinfo", "modprobe", "more", "mount", "mt", "mv", "nameif", "nc", "netstat", "nl", "nologin", "nproc", "nsenter", "nslookup", "nuke", "od", "openvt", "partprobe", "paste", "patch", "pidof", "ping", "ping6", "pivot_root", "poweroff", "printf", "ps", "pwd", "rdate", "readlink", "realpath", "reboot", "renice", "reset", "resume", "rev", "rm", "rmdir", "rmmod", "route", "rpm", "rpm2cpio", "run-init", "run-parts", "sed", "seq", "setkeycodes", "setpriv", "setsid", "sh", "sha1sum", "sha256sum", "sha512sum", "shred", "shuf", "sleep", "sort", "ssl_client", "start-stop-daemon", "stat", "strings", "stty", "svc", "svok", "swapoff", "swapon", "switch_root", "sync", "sysctl", "syslogd", "tac", "tail", "tar", "taskset", "tee", "telnet", "test", "tftp", "time", "timeout", "top", "touch", "tr", "traceroute", "traceroute6", "true", "truncate", "tty", "ubirename", "udhcpc", "udhcpd", "uevent", "umount", "uname", "uncompress", "unexpand", "uniq", "unix2dos", "unlink", "unlzma", "unshare", "unxz", "unzip", "uptime", "usleep", "uudecode", "uuencode", "vconfig", "vi", "w", "watch", "watchdog", "wc", "wget", "which", "who", "whoami", "xargs", "xxd", "xz", "xzcat", "yes", "zcat"], | ||
"coreutils": ["[", "arch", "b2sum", "base32", "base64", "basename", "basenc", "bin", "cat", "chcon", "chgrp", "chmod", "chown", "chroot", "cksum", "comm", "cp", "csplit", "cut", "date", "dd", "df", "dir", "dircolors", "dirname", "du", "echo", "env", "expand", "expr", "factor", "false", "fmt", "fold", "groups", "head", "hostid", "id", "install", "join", "link", "ln", "logname", "ls", "md5sum", "md5sum.textutils", "mkdir", "mkfifo", "mknod", "mktemp", "mv", "nice", "nl", "nohup", "nproc", "numfmt", "od", "paste", "pathchk", "pinky", "pr", "printenv", "printf", "ptx", "pwd", "readlink", "realpath", "rm", "rmdir", "runcon", "sbin", "seq", "sha1sum", "sha224sum", "sha256sum", "sha384sum", "sha512sum", "shred", "shuf", "sleep", "sort", "split", "stat", "stdbuf", "stty", "sum", "sync", "tac", "tail", "tee", "test", "timeout", "touch", "tr", "true", "truncate", "tsort", "tty", "uname", "unexpand", "uniq", "unlink", "users", "usr", "vdir", "wc", "who", "whoami", "yes"] | ||
}, | ||
"wolfi": { | ||
"busybox": ["[", "[[", "add-shell", "addgroup", "adduser", "adjtimex", "arch", "arping", "ash", "awk", "base64", "basename", "bbconfig", "bc", "beep", "bunzip2", "bzcat", "bzip2", "cal", "cat", "chattr", "chgrp", "chmod", "chown", "chpasswd", "chroot", "chrt", "cksum", "clear", "cmp", "comm", "cp", "cpio", "cryptpw", "cut", "date", "dc", "dd", "delgroup", "deluser", "df", "diff", "dirname", "dmesg", "dnsdomainname", "dos2unix", "du", "echo", "ed", "egrep", "env", "expand", "expr", "factor", "fallocate", "false", "fgrep", "find", "findfs", "flock", "fold", "free", "fsync", "fuser", "getopt", "getty", "grep", "groups", "gunzip", "gzip", "hd", "head", "hexdump", "hostid", "hostname", "id", "inotifyd", "install", "ionice", "iostat", "ipcrm", "ipcs", "kill", "killall", "killall5", "less", "link", "linux32", "linux64", "ln", "logger", "login", "ls", "lsattr", "lsof", "lzcat", "lzma", "lzop", "lzopcat", "md5sum", "microcom", "mkdir", "mkfifo", "mknod", "mkpasswd", "mktemp", "more", "mountpoint", "mpstat", "mv", "netstat", "nice", "nl", "nmeter", "nohup", "nologin", "nproc", "nsenter", "od", "passwd", "paste", "pgrep", "pidof", "ping", "ping6", "pipe_progress", "pivot_root", "pkill", "pmap", "printenv", "printf", "ps", "pstree", "pwd", "pwdx", "rdev", "readahead", "readlink", "realpath", "remove-shell", "renice", "reset", "resize", "rev", "rm", "rmdir", "run-parts", "sed", "seq", "setpriv", "setserial", "setsid", "sh", "sha1sum", "sha256sum", "sha3sum", "sha512sum", "shred", "shuf", "sleep", "sort", "split", "stat", "strings", "stty", "su", "sum", "sync", "sysctl", "tac", "tail", "tar", "tee", "test", "time", "timeout", "top", "touch", "tr", "traceroute", "traceroute6", "tree", "true", "truncate", "tsort", "tty", "ttysize", "tunctl", "uname", "unexpand", "uniq", "unix2dos", "unlink", "unlzma", "unlzop", "unxz", "unzip", "uptime", "usleep", "uudecode", "uuencode", "vconfig", "vi", "vlock", "watch", "wc", "which", "who", "whoami", "xargs", "xxd", "xzcat", "yes", "zcat"], | ||
"coreutils": ["[", "b2sum", "base32", "base64", "basename", "basenc", "cat", "chcon", "chgrp", "chmod", "chown", "chroot", "cksum", "comm", "coreutils", "cp", "csplit", "cut", "date", "dd", "df", "dir", "dircolors", "dirname", "du", "echo", "env", "expand", "expr", "factor", "false", "fmt", "fold", "head", "hostid", "id", "install", "join", "link", "ln", "logname", "ls", "md5sum", "mkdir", "mkfifo", "mknod", "mktemp", "mv", "nice", "nl", "nohup", "nproc", "numfmt", "od", "paste", "pathchk", "pinky", "pr", "printenv", "printf", "ptx", "pwd", "readlink", "realpath", "rm", "rmdir", "runcon", "seq", "sha1sum", "sha224sum", "sha256sum", "sha384sum", "sha512sum", "shred", "shuf", "sleep", "sort", "split", "stat", "stdbuf", "stty", "sum", "sync", "tac", "tail", "tee", "test", "timeout", "touch", "tr", "true", "truncate", "tsort", "tty", "uname", "unexpand", "uniq", "unlink", "users", "vdir", "wc", "who", "whoami", "yes"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This script will output a Markdown formatted table showing the differences between Wolfi and other distro's busybox and coreutils packages. | ||
|
||
To run it: | ||
|
||
``` | ||
python compare.py debian | ||
``` | ||
|
||
The data is stored in [../../data/distro-package-comparisons.json](../../data/distro-package-comparisons.json). | ||
|
||
Distros can be added there as needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
This script will output a Markdown formatted table showing the differences | ||
between Wolfi and other distro's busybox and coreutils packages. | ||
""" | ||
|
||
import json | ||
import sys | ||
|
||
# This ought to be turned into an argument or env variable | ||
with open("../../data/distro-package-comparisons.json", encoding="utf8") as f: | ||
all_distro_packages = json.load(f) | ||
|
||
|
||
class DistroPackages: | ||
"""glorified data storage class, but could use extended in future with other packages""" | ||
def __init__(self, distro) -> None: | ||
self.name = distro | ||
self.coreutils = self.get_package_utils("coreutils") | ||
self.busybox = self.get_package_utils("busybox") | ||
|
||
|
||
def get_package_utils(self, package): | ||
"""return unique set of utilities in a given package""" | ||
return set(all_distro_packages[self.name][package]) | ||
|
||
|
||
class TablePrinter: | ||
"""print union of sets of wolfi busybox + distro busybox + wolfi coreutils + distro coreutils""" | ||
def __init__(self, wolfi_packages, distro_packages) -> None: | ||
self.wolfi = wolfi_packages | ||
self.distro = distro_packages | ||
|
||
self.utils = self.wolfi.busybox.union(self.distro.busybox) | ||
self.utils = self.utils.union(self.wolfi.coreutils).union(self.distro.coreutils) | ||
|
||
def print(self): | ||
"""print the markdown table of the set union""" | ||
header = f'''| Utility | \ | ||
Wolfi busybox | \ | ||
{self.distro.name.capitalize()} busybox | \ | ||
Wolfi coreutils | \ | ||
{self.distro.name.capitalize()} coreutils |\ | ||
\n|:-:|:-:|:-:|:-:|:-:|\ | ||
''' | ||
print(header) | ||
for util in sorted(self.utils): | ||
# Check if the filename exists in each set | ||
in_set1 = util in self.wolfi.busybox | ||
in_set2 = util in self.distro.busybox | ||
in_set3 = util in self.wolfi.coreutils | ||
in_set4 = util in self.distro.coreutils | ||
row = f'''| `{util}` | \ | ||
{'✅' if in_set1 else ''} | \ | ||
{'✅' if in_set2 else ''} | \ | ||
{'✅' if in_set3 else ''} | \ | ||
{'✅' if in_set4 else '' } |\ | ||
''' | ||
print(row) | ||
|
||
if __name__ == "__main__": | ||
requested_distro = sys.argv[1] | ||
if requested_distro not in all_distro_packages.keys(): | ||
print(f'{requested_distro} not found in distro-package-comparisons.json') | ||
sys.exit(1) | ||
|
||
wolfi = DistroPackages("wolfi") | ||
other_distro = DistroPackages(requested_distro) | ||
TablePrinter(wolfi, other_distro).print() |