opkginstall.patch 4.4 KB

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