Skip to content

Instantly share code, notes, and snippets.

@m000
Created July 28, 2023 17:49
Show Gist options
  • Save m000/1d42afed7dc26d511738f3655398c256 to your computer and use it in GitHub Desktop.
Save m000/1d42afed7dc26d511738f3655398c256 to your computer and use it in GitHub Desktop.
OpenWRT installed package list creator
#!/bin/sh
# Outputs a list of openwrt installed packages, in the same format as the one
# used by sysupgrade to create /etc/backup/installed_packages.txt.
# This can be useful to diff the currently installed packages with the packages
# installed during a upgrade.
#
# Based-off of sysupgrade code:
# https://github.com/openwrt/openwrt/blob/master/package/base-files/files/sbin/sysupgrade
find_extra='(
( -exec test -f /rom/{} ; -exec echo {} rom ; )
-o ( -exec test -f /overlay/upper/{} ; -exec echo {} overlay ; )
-o ( -exec echo {} unknown ; )
)
'
find /usr/lib/opkg/info -name "*.control" $find_extra | sed -e 's,.*/,,;s/\.control /\t/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment