Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: Fix for the /opt/bin/update-alternatives problem!!!

  1. #1

    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:
    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.
    Last edited by sollie; 09-11-2007 at 07:52.

  2. #2
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    33

    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.

  3. #3
    Did you install uclibc-opt?

  4. #4
    The second and third commands didn't work, already existed files.
    I had that also.

    Test:
    - rm /opt/bin/sort
    - sort
    - ln -s /opt/bin/busybox sort /opt/bin/sort
    - sort

    You will see it workes.

  5. #5
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    33

    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.

  6. #6

    Same problem as Rejan

    Hi Sollie,

    I've the same problems as reported by Rejan, lots of erros as below:

    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 sysctl to /opt/sbin/sysctl since it is already registered to

    How can we solve this?

    Regards,

    PVarela

  7. #7
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    33

    Smile Found it...

    The update-alternatives defaults the "head" command to old busybox from /apps/bin hence the 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

    Workaround:

    Edit row in /opt/bin/update-alternatives from:

    local olink=`head -n 1 $ad/$name`

    to:

    local olink=`$IPKG_OFFLINE_ROOT/opt/bin/busybox head -n 1 $ad/$name`


    And then run:

    /opt/lib/ipkg/info/busybox-links.postinst


    Rejan.

  8. #8
    Rejan, is this possible (step 3a)?:

    ln -s /opt/bin/busybox head /opt/bin/head

  9. #9
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    33

    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.

  10. #10
    Hi Sollie, tried ln -s /opt/bin/busybox head /opt/bin/head but got file exist, even after rm /opt/bin/head
    Thats what it says all the time, but its making the file.

    Sollie.

  11. #11
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    33

    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.

  12. #12
    K, thanks.

    Sollie.

  13. #13
    Ok, I've tried everything time to ask.

    I have the same problem, syntax error in update-alternatives.
    I tried everything on this post, and still nothing.

    Right now, if I type 'head -?' I get the 'error while loading shared libraries'
    if I type '/opt/bin/head -?' I get 'Busybox v1.7.2 blah,blah,blah' so I guess that's ok.

    I changed the /opt/bin/update-alternatives line from:
    local olink=`head -n 1 $ad/$name`
    to:
    local olink=`/opt/bin/busybox head -n 1 $ad/$name` and
    local olink=`/opt/bin/head -n 1 $ad/$name`

    and neither worked. Help please?

    BTW, 'ln -s /opt/bin/busybox head /opt/bin/head' gave me an error message, 'ln -s /opt/bin/busybox /opt/bin/head' worked ok.

  14. #14
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    33

    Perhaps this will help?

    Did you use full path as I described it:
    local olink=`$IPKG_OFFLINE_ROOT/opt/bin/busybox head -n 1 $ad/$name`

    Also

    'ln -s /opt/bin/busybox head /opt/bin/head' gave me an error message, 'ln -s /opt/bin/busybox /opt/bin/head' worked ok.
    The last one I think links busybox to the command /opt/bin/head instead of command '/opt/bin/busybox head' to '/opt/bin/head' which seems like a bad idea. So the linkname for you will be wrong according to syntax, or?

    Usage: ln [OPTION] TARGET... LINK_NAME|DIRECTORY

    Rejan.

  15. #15
    Just to confirm,

    The problem is "Syntax error" comes up when installing / running some busybox commands particularly at configuration of ipkg installs correct?

    when you complete the tasks as defined by Sollie and Rejan is the expected output as per below?
    update-alternatives: Linking //opt/sbin/losetup to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/lsmod to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/mkswap to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/modprobe to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/pivot_root to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/rdate to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/rmmod to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/route to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/start-stop-daemon to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/swapoff to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/swapon to /opt/bin/busybox
    update-alternatives: Linking //opt/sbin/sysctl to /opt/bin/busybox
    One suggestion for those of you struggling to get this going is to do an install of uclibc-opt first, then reinstall busybox and then do the edits per sollie's info
    Last edited by Gizmo1007; 08-11-2007 at 19:28.

Page 1 of 2 12 LastLast

Similar Threads

  1. Problem with OpenWrt FW (Kami 7.07/9)
    By bado in forum WL-700g Firmware Discussion
    Replies: 5
    Last Post: 22-10-2007, 20:43
  2. WL-500gP and Asus support experience
    By Blezi in forum WL-500gP Q&A
    Replies: 6
    Last Post: 03-12-2006, 12:59
  3. complete changelog up to 1.8.2.1
    By Antiloop in forum WL-500g Firmware Releases
    Replies: 0
    Last Post: 27-10-2004, 09:27
  4. Problem with dieing AIR-connection
    By BòóN in forum WL-500g Q&A
    Replies: 7
    Last Post: 26-10-2004, 12:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •