opkginstall.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. --- a/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
  2. +++ b/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
  3. @@ -19,7 +19,7 @@ case "$action" in
  4. while [ -n "$1" ]; do
  5. case "$1" in
  6. - --autoremove|--force-overwrite|--force-removal-of-dependent-packages)
  7. + --autoremove|--force-overwrite|--force-removal-of-dependent-packages|--force-checksum|--force-depends)
  8. opkg="$opkg $1"
  9. shift
  10. ;;
  11. @@ -34,6 +34,12 @@ case "$action" in
  12. if flock -x 200; then
  13. $opkg $action "$@" </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
  14. + sed -i "/resolve_conffiles/d" /tmp/opkg.err || true
  15. + sed -i "/uci: Entry not found/d" /tmp/opkg.err || true
  16. + sed -i "/Existing conffile/d" /tmp/opkg.err || true
  17. + sed -i "/Couldn't unlink/d" /tmp/opkg.err || true
  18. + sed -i "/pkg_hash_check_unresolved/d" /tmp/opkg.err || true
  19. + [ "`cat /tmp/opkg.err`" == "Collected errors:" ] && rm -f /tmp/opkg.err || true
  20. code=$?
  21. stdout=$(cat /tmp/opkg.out)
  22. stderr=$(cat /tmp/opkg.err)
  23. --- a/package/base-files/files/lib/functions.sh
  24. +++ b/package/base-files/files/lib/functions.sh
  25. @@ -199,6 +199,10 @@ default_prerm() {
  26. fi
  27. done
  28. + grep -q '"nas",' /usr/lib/lua/luci/controller/*.lua ||
  29. + sed -i '/_("NAS")/d' /usr/lib/lua/luci/controller/turboacc.lua
  30. + rm -Rf /tmp/luci-*
  31. +
  32. return $ret
  33. }
  34. @@ -250,6 +254,10 @@ default_postinst() {
  35. ret=$?
  36. fi
  37. + grep -q '"nas",' /usr/lib/lua/luci/controller/*.lua && ! grep -q '_("NAS")' /usr/lib/lua/luci/controller/*.lua &&
  38. + sed -i 's/local page/local page\nentry({"admin", "nas"}, firstchild(), _("NAS") , 45).dependent = false/' /usr/lib/lua/luci/controller/turboacc.lua
  39. + sed -i 's/ifname/device/' /etc/config/network
  40. +
  41. if [ -d "$root/rootfs-overlay" ]; then
  42. cp -R $root/rootfs-overlay/. $root/
  43. rm -fR $root/rootfs-overlay/
  44. @@ -272,7 +279,7 @@ default_postinst() {
  45. uci commit
  46. fi
  47. - rm -f /tmp/luci-indexcache
  48. + rm -Rf /tmp/luci-*
  49. fi
  50. local shell="$(command -v bash)"
  51. @@ -287,6 +294,8 @@ default_postinst() {
  52. fi
  53. done
  54. + /etc/init.d/ucitrack reload
  55. +
  56. return $ret
  57. }
  58. --- a/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
  59. +++ b/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
  60. @@ -203,6 +203,7 @@ return view.extend({
  61. }, this, ev.target))
  62. .then(L.bind(function(btn, res) {
  63. var keep = E('input', { type: 'checkbox' }),
  64. + keep_opkg = E('input', { type: 'checkbox' }),
  65. force = E('input', { type: 'checkbox' }),
  66. is_valid = res[1].valid,
  67. is_forceable = res[1].forceable,
  68. @@ -220,6 +221,10 @@ return view.extend({
  69. body.push(E('p', {}, E('label', { 'class': 'btn' }, [
  70. keep, ' ', _('Keep settings and retain the current configuration')
  71. ])));
  72. + body.push(E('p', {}, E('label', { 'class': 'btn' }, [
  73. + keep_opkg, ' ', _('Retain the current packages')
  74. + ])));
  75. + keep_opkg.checked = true;
  76. if (!is_valid || is_too_big)
  77. body.push(E('hr'));
  78. @@ -257,7 +262,7 @@ return view.extend({
  79. var cntbtn = E('button', {
  80. 'class': 'btn cbi-button-action important',
  81. - 'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, force),
  82. + 'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, keep_opkg, force),
  83. 'disabled': (!is_valid || is_too_big) ? true : null
  84. }, [ _('Continue') ]);
  85. @@ -282,7 +287,7 @@ return view.extend({
  86. }, this, ev.target));
  87. },
  88. - handleSysupgradeConfirm: function(btn, keep, force, ev) {
  89. + handleSysupgradeConfirm: function(btn, keep, keep_opkg, force, ev) {
  90. btn.firstChild.data = _('Flashing…');
  91. ui.showModal(_('Flashing…'), [
  92. @@ -294,6 +299,9 @@ return view.extend({
  93. if (!keep.checked)
  94. opts.push('-n');
  95. + if (keep_opkg.checked)
  96. + opts.push('-k');
  97. +
  98. if (force.checked)
  99. opts.push('--force');
  100. --- a/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
  101. +++ b/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
  102. @@ -140,6 +140,7 @@
  103. "/sbin/sysupgrade --force /tmp/firmware.bin": [ "exec" ],
  104. "/sbin/sysupgrade -n --force /tmp/firmware.bin": [ "exec" ],
  105. "/sbin/sysupgrade -n /tmp/firmware.bin": [ "exec" ],
  106. + "/sbin/sysupgrade -k /tmp/firmware.bin": [ "exec" ],
  107. "/sbin/sysupgrade --restore-backup /tmp/backup.tar.gz": [ "exec" ],
  108. "/sbin/sysupgrade --test /tmp/firmware.bin": [ "exec" ],
  109. "/sbin/sysupgrade /tmp/firmware.bin": [ "exec" ],