OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Feature Request
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version lede-17.01
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Luiz Angelo Daros de Luca - 01.03.2017
Last edited by Hans Dedecker - 13.04.2017

FS#571 - opkg can be too easily removed

Hello,

opkg can remove itself too easily. Just a wrong paste can run something like;

opkg remove opkg install openvpn-openssl

It runs happily. However, without opkg, I cannot reinstall it.
This is very difficult to undo.

opkg should be somehow pre-locked in order to avoid removal. The user should need to supply some time of force or unlock the package before in order to really remove opkg.


Closed by  Hans Dedecker
13.04.2017 06:07
Reason for closing:  Fixed
Luiz Angelo Daros de Luca commented on 01.03.2017 01:25

A workaround would be to use:

 cd /overlay/upper
 rm ./bin/opkg ./etc/opkg/distfeeds.conf ./etc/opkg.conf ./lib/upgrade/keep.d/opkg ./usr/lib/opkg/inf
o/opkg.control ./usr/lib/opkg/info/opkg.conffiles ./usr/lib/opkg/info/opkg.list ./usr/sbin/opkg-key
 reboot -f
Admin
Jo-Philipp Wich commented on 01.03.2017 02:02

I think we just need to mark opkg as essential package.
You can test the effect by carefully editing /usr/lib/opkg/status. Skip to the "Package: opkg" section and add "Essential: yes" to it, afterwards opkg will refuse to uninstall itself with:

  root@LEDE:/# opkg remove opkg
  Refusing to remove essential package opkg.
  	Removing an essential package may lead to an unusable system, but if
  	you enjoy that kind of pain, you can force opkg to proceed against
  	its will with the option: --force-removal-of-essential-packages
  No packages removed.
Luiz Angelo Daros de Luca commented on 13.04.2017 05:43

Jo,

That's exactly what I was requesting :) Thanks.
Maybe ebf846b00559a326d6ea5a1711d11335d89d1218 should also be backported to 17.01.1

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing