Re: update-alternatives question

2008-09-14 Thread Rod Whitby
Charles-Henri Gros wrote:
> Joel Newkirk wrote:
>> Quick question, hopefully someone can instantly see my error:
>>
>> I've built the full iproute2 toolset, and am working on an ipk/opk for ip
>> and tc.  
>>
>> The default om2008 at least, has /bin/ip linked to /bin/busybox.  So that
>> should be changed.  For inspiration, I looked at the postinst script for
>> grep, since it must perform the same changes.  (point at full bin instead
>> of busybox in postinst, restore in prerm)  So I took the
>> update-alternatives line from grep's postinst and simply replaced 'grep'
>> with 'ip' everywhere.
>>
>> [EMAIL PROTECTED]:~# update-alternatives --install /usr/bin/ip ip ip.ip 100
>> update-alternatives: Error: cannot register alternative ip to /usr/bin/ip
>> since it is already registered to /bin/ip
>>
>> Isn't this the point of update-alternatives - to allow multiple possible
>> binaries, and 'register' the one with highest priority?  What have I done
>> wrong?  And why is the  component grep.grep (or in my case ip.ip)??
> 
> grep.grep is the binary that contains what the "grep" package installs.
> You should probably install your "ip" as "ip.ip", or use /usr/bin/ip (if
> that's where you install it)
> 
> So the command would look like (I think):
> update-alternatives --install /bin/ip ip /usr/bin/ip 100

I would not recommend that command.

For update-alternatives to work, all the packages which install that binary
have to agree on the final path of the binary.  You can't have one package
wanting to install it in /bin and the other wanting to install it in /usr/bin.

So first you need to modify all the packages so they install into the same
directory.

Then you go and put the update-alternatives stuff in, and you make each
package install the binary in /path/. (e.g.
/bin/ip.ip and /bin/ip.busybox).  Then you get update-alternatives to
symlink one of those to the final binary filename in the postinst.

-- Rod


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: update-alternatives question

2008-09-13 Thread Joel Newkirk
That did it, thanks.

j

On Sat, 13 Sep 2008 21:09:11 -0700, Charles-Henri Gros
<[EMAIL PROTECTED]> wrote:
> Joel Newkirk wrote:
>> Quick question, hopefully someone can instantly see my error:

>> [EMAIL PROTECTED]:~# update-alternatives --install /usr/bin/ip ip ip.ip 100
>> update-alternatives: Error: cannot register alternative ip to
>> /usr/bin/ip since it is already registered to /bin/ip
>>
>> Isn't this the point of update-alternatives - to allow multiple possible
>> binaries, and 'register' the one with highest priority?  What have I
> done
>> wrong?  And why is the  component grep.grep (or in my case
> ip.ip)??
> 
> grep.grep is the binary that contains what the "grep" package installs.
> You should probably install your "ip" as "ip.ip", or use /usr/bin/ip (if
> that's where you install it)
> 
> So the command would look like (I think):
> update-alternatives --install /bin/ip ip /usr/bin/ip 100
> 
> --
> Charles-Henri
> 
> 
> ___
> Openmoko community mailing list
> community@lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: update-alternatives question

2008-09-13 Thread Charles-Henri Gros
Joel Newkirk wrote:
> Quick question, hopefully someone can instantly see my error:
> 
> I've built the full iproute2 toolset, and am working on an ipk/opk for ip
> and tc.  
> 
> The default om2008 at least, has /bin/ip linked to /bin/busybox.  So that
> should be changed.  For inspiration, I looked at the postinst script for
> grep, since it must perform the same changes.  (point at full bin instead
> of busybox in postinst, restore in prerm)  So I took the
> update-alternatives line from grep's postinst and simply replaced 'grep'
> with 'ip' everywhere.
> 
> [EMAIL PROTECTED]:~# update-alternatives --install /usr/bin/ip ip ip.ip 100
> update-alternatives: Error: cannot register alternative ip to /usr/bin/ip
> since it is already registered to /bin/ip
> 
> Isn't this the point of update-alternatives - to allow multiple possible
> binaries, and 'register' the one with highest priority?  What have I done
> wrong?  And why is the  component grep.grep (or in my case ip.ip)??

grep.grep is the binary that contains what the "grep" package installs.
You should probably install your "ip" as "ip.ip", or use /usr/bin/ip (if
that's where you install it)

So the command would look like (I think):
update-alternatives --install /bin/ip ip /usr/bin/ip 100

-- 
Charles-Henri


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


update-alternatives question

2008-09-13 Thread Joel Newkirk
Quick question, hopefully someone can instantly see my error:

I've built the full iproute2 toolset, and am working on an ipk/opk for ip
and tc.  

The default om2008 at least, has /bin/ip linked to /bin/busybox.  So that
should be changed.  For inspiration, I looked at the postinst script for
grep, since it must perform the same changes.  (point at full bin instead
of busybox in postinst, restore in prerm)  So I took the
update-alternatives line from grep's postinst and simply replaced 'grep'
with 'ip' everywhere.

[EMAIL PROTECTED]:~# update-alternatives --install /usr/bin/ip ip ip.ip 100
update-alternatives: Error: cannot register alternative ip to /usr/bin/ip
since it is already registered to /bin/ip

Isn't this the point of update-alternatives - to allow multiple possible
binaries, and 'register' the one with highest priority?  What have I done
wrong?  And why is the  component grep.grep (or in my case ip.ip)??

I checked and /usr/lib/opkg/alternatives/ip and
/usr/lib/opkg/alternatives/grep are the same - busybox 50.

j



___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community