This script will do the following:
- Gather list of installed packages that does not exist in the ROM
- Create a script to reinstall the packages
- Add the newly created script to
/etc/rc.local
Run this script before the sysupgrade process. Once flashing has started, wait for the router to reboot two times. The script will remove itself after successful execution.