[LEDE-DEV] [PATCH 00/12] alternatives support
Matthias Schiffer
mschiffer at universe-factory.net
Tue Mar 7 08:00:59 PST 2017
On 03/06/2017 05:27 PM, Yousong Zhou wrote:
> On 5 March 2017 at 23:06, Matthias Schiffer
> <mschiffer at universe-factory.net> wrote:
>> On 03/05/2017 10:31 AM, Yousong Zhou wrote:
>>> This patch set tries to make it possible that files serving the same purpose
>>> and installed to different locations can be available under the same name
>>> through a symbolic link
>>>
>>> The idea is from alternatives of debian system [1,2]. "ip" command is a good
>>> example of the problem it tries to solve [3]. Files provided by different
>>> packages cannot be installed to the same location, so we have busybox ip,
>>> ip-tiny, ip-full all installed to different locations
>>>
>>> It works by first adding to CONTROL file of each ipkg a new field "Alternatives",
>>> which is a list of specs of the following form seprated by commas to describe
>>> alternatives provided by this package
>>>
>>> <prio>:<path>:<altpath>
>>>
>>> The new field will be interpreted by postinst and prerm script. <path> will be
>>> a symbolic link to <altpath> of the highest <prio>, and updates will be made to
>>> UCI config "opkg"
>>>
>>> Several patches for uci are also included here to support usage at build-time.
>>> The whole series is available in my staging tree [4]
>>>
>>> [1] https://wiki.debian.org/DebianAlternatives
>>> [2] https://debian-administration.org/article/91/Using_the_Debian_alternatives_system
>>> [3] https://bugs.lede-project.org/index.php?do=details&task_id=428
>>> [4] https://git.lede-project.org/?p=lede/yousong/staging.git;a=summary
>>
>> First of all, thank you very much for working on this, I've been missing
>> this feature for a long time. I have some comments though:
>>
>> I see that the opkg UCI config contains a lot of redundant data when many
>> alternatives are installed (for example, many busybox applets and their
>> corresponding coreutils/util-linux/... variants); AFAICT, the same
>> information is also available in the opkg status files.
>>
>> I think I'd opt for not making this list of alternatives configurable
>> independently of opkg. Adding configuration to UCI would only be necessary
>> when a user overrides the automatic selection. This could also avoid adding
>> host UCI support to the build system, making the whole patchset a lot smaller.
>>
>> Matthias
>>
>
> Thanks for the feedback. I agree that it should be sealed inside opkg
> and could be more neat that way. Probably I decided to code it with
> shell scripting just because the task seemed to be a more "low-hanging
> fruit" with that approach ;) Lazy me!
>
> Anyway, I will investigate the opkg-lede codebase and report back at a
> later time.
>
> Cheers,
> yousong
>
I wouldn't say it can't be implemented in shell. Our user creation logic is
part of our default postinst script, but the data is uses is contained in
the opkg database. I would try implementing it in a similar way.
Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20170307/e1b6021d/attachment.sig>
More information about the Lede-dev
mailing list