Modify

Opened 6 years ago

Closed 6 years ago

Last modified 22 months ago

#6772 closed defect (fixed)

'opkg remove' destroys OpenWRT on RB450 (ar71xx)

Reported by: Leonardo Rodrigues <leolistas@…> Owned by: developers
Priority: high Milestone: Barrier Breaker 14.07
Component: base system Version: Kamikaze trunk
Keywords: opkg Cc:

Description

i've just compiled and installed a pretty fresh SVN version of OpenWRT (r19885). Target is ar71xx and its installed on a Routerboard 450. It's running fine, stable, no problems on that.

when trying to use opkg, i had problems. Big ones.

opkg appears to have no problem at all with the 'read-only' commands, just like 'list' or 'files' or 'info'

root@OpenWrt:/# opkg list
base-files - 39-r19885
bash - 3.2-2
[ ..... ]
zip - 2.32-1
zlib - 1.2.3-5
root@OpenWrt:/# 
root@OpenWrt:/# opkg files bash
Package bash (3.2-2) is installed on root and has the following files:
/
/bin/
/bin/bash
root@OpenWrt:/#
root@OpenWrt:/# opkg info bash
Package: bash
Version: 3.2-2
Provides:
Status: install ok installed
Architecture: ar71xx

opkg 'install' seems to run fine as well, no problems on that.

root@OpenWrt:/# opkg info dhcp-server
root@OpenWrt:/#

root@OpenWrt:/# ls -lsa dhcp-server_3.1.0-1_ar71xx.ipk 
 586 -rw-r--r--    1 root     root       599663 Mar  1 10:22 dhcp-server_3.1.0-1
_ar71xx.ipk
root@OpenWrt:/#

root@OpenWrt:/# opkg install dhcp-server_3.1.0-1_ar71xx.ipk 
Installing dhcp-server (3.1.0-1) to root...
Configuring dhcp-server.
root@OpenWrt:/# 

root@OpenWrt:/# opkg files dhcp-server
Package dhcp-server (3.1.0-1) is installed on root and has the following files:
/usr/local/lib/libomapi.a
/usr/local/lib/libdhcpctl.a
/usr/bin/omshell
/usr/sbin/dhcpd
/etc/init.d/dhcpd
root@OpenWrt:/#

root@OpenWrt:/# opkg info dhcp-server
Package: dhcp-server
Version: 3.1.0-1
Provides:
Status: install user installed
Architecture: ar71xx
Installed-Time: 1267438995
root@OpenWrt:/# 

but when i tried 'opkg remove' .... oh man ....

root@OpenWrt:/# opkg remove wget
Removing package wget from root...
Segmentation fault
root@OpenWrt:/# 

another try on a new install, tried to remove another package

root@OpenWrt:~# opkg remove rsync
Removing package rsync from root...
Segmentation fault
root@OpenWrt:~# 

and worst .... besides the 'Segmentation fault', which alone would be bad but not a big problem, this trying to 'opkg remove' completly trashed the whole sistem !

root@OpenWrt:/# ps auwx
/bin/ash: ps: not found
root@OpenWrt:/# wget
/bin/ash: wget: not found
root@OpenWrt:/# zip
/bin/ash: zip: not found
root@OpenWrt:/# du   
/bin/ash: du: not found
root@OpenWrt:/# /etc/init.d/dropbear stop
root@OpenWrt:/# /etc/init.d/dropbear start
/etc/rc.common: eval: line 1: /usr/sbin/dropbear: not found
root@OpenWrt:/# ls -lsa /usr/sbin
ls: /usr/sbin: No such file or directory
root@OpenWrt:/# ls -lsa usr
ls: usr: No such file or directory
root@OpenWrt:/# 

trying the remove again, now with -V 10 on another fresh new install, may give us a good hint:

Removing package joe from root...
pkg_run_script: Running script //usr/lib/opkg/info/joe.prerm.
remove_data_files_and_list: Deleting /usr/bin/joe.
remove_data_files_and_list: Deleting /usr/.
pkg_run_script: Running script //usr/lib/opkg/info/joe.postrm.
write_status_files_if_changed: Writing status file.
Segmentation fault
root@OpenWrt:~# 

deleting /usr ?????????

and system didnt reboot anymore


root@OpenWrt:~# reboot
save exit: isCheckpointed 0
root@OpenWrt:~# /sbin/ifdown: line 27: env: not found
/sbin/ifdown: line 27: env: not found
br-lan: port 1(eth0) entering disabled state
eth0: link down
eth1: link down
umount: tmpfs busy - remounted read-only
Restarting system.

(RB450 reboots)

eth0: link up (100Mbps/Full duplex)
- regular preinit -

- init -
Kernel panic - not syncing: Attempted to kill init!

interesting is that, when writing this ticket, i've tried to remove the package installed (dhcp-server) some steps ago and it works fine. Problems seems to happen when trying to remove packages installed from the .tgz image with wget2nand.

root@OpenWrt:/# opkg remove dhcp-server
Removing package dhcp-server from root...
root@OpenWrt:/# 

opkg.conf is default from compilation process, i didnt changed it at all

root@OpenWrt:/etc# cat opkg.conf 
src/gz snapshots http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /jffs
root@OpenWrt:/etc# 

please take a look on this .... because at least I could completly trash a full working installation with a simple 'opkg remove' and could reproduce this several times in a row.

i'm sure this really shouldnt be happening

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

I believe the removal-of-/usr was actually triggered by faulty package file listings generated by the host ipkg script used to preinstall .ipk archives at build time, this should be fixed by r19936 now.

The segfault-on-remove is not addressed yet, please run such a failing remove attempt under strace, open a separate ticket and attach the trace log to it. You may assign the ticket to me, I'll look into it then.

comment:2 Changed 6 years ago by Leonardo Rodrigues <leolistas@…>

jow, just to let you know, after building with the r19936 patch, 'opkg remove' removes offline installed packages with no problem at all.

i couldnt even reproduce the 'Segmentation Fault' error.

seems that the segfault was related to removing libraries or opened binaries, something like that.

comment:3 Changed 22 months ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.