Fix for the /opt/bin/update-alternatives problem!!!
0a: ipkg-opt install uclibc-opt
0b: ipkg-opt install busybox-links
1: change first line (/opt/bin/update-alternatives):
- nano /opt/bin/update-alternatives
- #!/bin/sh ---> #!/opt/bin/bash
2: ln -s /opt/bin/busybox sort /opt/bin/sort
3: ln -s /opt/bin/busybox dirname /opt/bin/dirname
4: /opt/lib/ipkg/info/busybox-links.postinst
When you get this error:
Quote:
head: error while loading shared libraries: head: symbol vprintf, version GLIBC_2.0 not defined in file libc.so.6 with link time reference update-alternatives: Error: cannot register alternative [ to /opt/bin/[ since it is already registered to
Do this: nano /opt/bin/update-alternatives and change tho folowing line:
local olink=`head -n 1 $ad/$name` ---> local olink=`$IPKG_OFFLINE_ROOT/opt/bin/busybox head -n 1 $ad/$name`
Sollie.
Solves some but gives other errors
Hi Sollie and thanx for the effort!
The second and third commands didn't work, already existed files.
The fourth gave this error:
head: error while loading shared libraries: head: symbol vprintf, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
update-alternatives: Error: cannot register alternative [ to /opt/bin/[ since it is already registered to
Still doesn't work but it created the files in /opt/lib/ipkg/alternatives
Rejan.
Must be something else...
I did as you described and installed uclibc-opt
Still gets:
head: error while loading shared libraries: head: symbol vprintf, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
Seems to hang aswell... break it with ctrl-c
Rejan.
Nope tried didn't work to do ln
Hi Sollie, tried ln -s /opt/bin/busybox head /opt/bin/head but got file exist, even after rm /opt/bin/head
Editing the the file /opt/bin/update-alternatives with qualified path to head was the thing that helped.
After editing I did the /opt/lib/ipkg/info/busybox-links.postinst, checked everything and did a ipkg upgrade and all linked well and works again.
Rejan.
anyhow - linking doesnt work with ln for me
Hi Sollie, even though the file is made, the postinst-file didn't work until I did a fully qualified path in update_alternatives.
The link still defaults to the old busybox, easy way to test is to write the command: head-? and check versioninfo on Busybox. That was how I found out that it defaulted wrong version of Busybox.
Correct and not :-) for me that is
Hi Gizmo1007!
The error is the way you stated 'Syntax error' also the expected result after change.
The problem was that: install of uclibc-opt first, then reinstall busybox and then do the edits per sollie's info did not work for me. Struggled for hours with it different solutions and that didn't work got the error everytime. Tried to downgrade to 1.5.1-1 didn't work either. The qualified path to the right busybox command 'head' in the 'update-alternatives' did it for me. The default 'head' command came from the wrong busybox (probably the one ASUS shipped it with)
Rejan.
Aha, get rid of syntax error from ipkg... that's it
Maybe superfluous, but the original title Sollie gave: Fix for the /opt/bin/update-alternatives problem!!!, did not tell me very much, when I first saw it. I really never had heard of update-alternatives. Hence, also not of any problem arising from it...
But, after installing a new package with ipkg these days, which I had not done for months, gave me all sorts of syntax errors and post-errors, as with so many people here.
But NOW I understand that's because the newer ipkg scripts in /opt/bin/update-alternatives use /bin/sh in stead of /opt/bin/bash. AHA.
I changed step 2 and 3 from Sollie in:
2: ln -s /opt/bin/busybox /opt/bin/sort
3: ln -s /opt/bin/busybox /opt/bin/dirname
and added:
3b: ln -s /opt/bin/busybox /opt/bin/head
Now ipkg does its job fine.
So I guess this is the final recipe (partly), let alone that if you run K.C.Furge's latest 1.0.7.8 firmware with KCSHELL set, this should not be needed anymore.:p
Marc
Ok...managed to completed screw up my postini script...
Can someone post their full, working copy?
Thanks!
Actually it's the update-alternatives config file I need.