Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:advanced:opkg_extras [2022/12/04 15:29] – [Instructions] restore each profile listed in uci unless specified explicitly vgaetera | docs:guide-user:advanced:opkg_extras [2023/10/03 18:19] – [Instructions] delay for networking to become ready vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Opkg extras ====== | ====== Opkg extras ====== | ||
| - | {{section> | + | {{section> |
| ===== Introduction ===== | ===== Introduction ===== | ||
| Line 13: | Line 13: | ||
| * Restore automatically after firmware upgrade. | * Restore automatically after firmware upgrade. | ||
| * Upgrade all upgradable packages. | * Upgrade all upgradable packages. | ||
| - | * Find new configurations. | + | |
| + | | ||
| ===== Implementation ===== | ===== Implementation ===== | ||
| Line 20: | Line 21: | ||
| * Identify package types with [[man> | * Identify package types with [[man> | ||
| * Support importing [[https:// | * Support importing [[https:// | ||
| - | * Use [[docs: | + | * Use [[docs: |
| * Utilize lockfiles with [[https:// | * Utilize lockfiles with [[https:// | ||
| * Perform [[man> | * Perform [[man> | ||
| - | * Write and read non-interactive logs with [[docs: | ||
| * Fetch the default profile to restore and roll back from UCI, unless specified manually. | * Fetch the default profile to restore and roll back from UCI, unless specified manually. | ||
| * Take precedence for remove over install to avoid package conflicts while restoring profile. | * Take precedence for remove over install to avoid package conflicts while restoring profile. | ||
| Line 41: | Line 41: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| - | | '' | + | | '' |
| + | | '' | ||
| ===== Instructions ===== | ===== Instructions ===== | ||
| Line 53: | Line 54: | ||
| local OPKG_UCI=" | local OPKG_UCI=" | ||
| case " | case " | ||
| - | (init|uci|import|save|restore|rollback\ | + | (init|uci|import|save|restore|rollback|upgr\ |
| - | |upgr|export|newconf|proc|reinstall) opkg_" | + | |export|proc|reinstall|altlink|newconf) opkg_" |
| (*) command opkg " | (*) command opkg " | ||
| esac | esac | ||
| Line 240: | Line 241: | ||
| local OPKG_OPT=" | local OPKG_OPT=" | ||
| opkg install " | opkg install " | ||
| + | } | ||
| + | |||
| + | opkg_altlink() { | ||
| + | sed -n -e "/ | ||
| + | {s/ | ||
| + | | sort -n -t ":" | ||
| + | | while IFS=":" | ||
| + | do ln -f -s " | ||
| + | done | ||
| } | } | ||
| Line 256: | Line 266: | ||
| do if [ ! -e / | do if [ ! -e / | ||
| && lock -n / | && lock -n / | ||
| + | && sleep 10 \ | ||
| && opkg update | && opkg update | ||
| then . / | then . / | ||
| - | opkg restore " | + | opkg restore " |
| - | | logger -t opkg | + | /var/log/opkg-restore-" |
| touch / | touch / | ||
| lock -u / | lock -u / | ||
| Line 284: | Line 295: | ||
| opkg rollback | opkg rollback | ||
| - | # Set up a custom | + | # Set up Opkg profiles |
| - | uci set opkg.defaults.restore=" | + | uci set opkg.defaults.restore=" |
| + | uci set opkg.init=" | ||
| + | uci add_list opkg.init.ipkg=" | ||
| + | uci add_list opkg.init.ipkg=" | ||
| + | uci add_list opkg.init.ipkg=" | ||
| uci set opkg.custom=" | uci set opkg.custom=" | ||
| uci add_list opkg.custom.rpkg=" | uci add_list opkg.custom.rpkg=" | ||
| Line 295: | Line 310: | ||
| # Check Opkg log | # Check Opkg log | ||
| - | logread | + | tail -f /var/log/opkg-* |
| # Upgrade packages | # Upgrade packages | ||
| opkg update | opkg update | ||
| opkg upgr | opkg upgr | ||
| + | |||
| + | # Maintenance | ||
| + | opkg altlink | ||
| + | opkg newconf | ||
| </ | </ | ||
| ===== Automated ===== | ===== Automated ===== | ||
| <code bash> | <code bash> | ||
| - | uclient-fetch -O opkg-extras.sh " | + | wget -U "" |
| . ./ | . ./ | ||
| </ | </ | ||
| - | ===== See also ===== | ||
| - | |||
| - | Attended sysUpgrade: '' | ||