Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 23 Dec 2015 23:00:52 -0800
From: Isaac Dunham <ibid.ag@...il.com>
To: musl@...ts.openwall.com
Subject: Re: musl & proprietary programs

On Wed, Dec 23, 2015 at 06:00:12PM -0200, Alba Pompeo wrote:
> I also don't want to pollute my system with glibc. That's why I asked
> if there was any plan to improve musl support of proprietary programs
> like the ones I listed.

I looked through the thread and saw no list of proprietary programs.
(Is this undelivered mail? is google bouncing random emails?)

> But as a last resort, I think Rich's method is the best so far, but
> I'm a bit lost on the details since I'm not a libc expert.
> I couldn't find a wiki page detailing Rich's method on Void or Alpine
> (the 2 distros I know use musl). Is there a step-by-step for a novice
> somewhere?

I don't know of any step-by-step guide that covers what you're asking about,
but I have done it before. The important things:
* glibc uses paths configured in /etc/ld.so.conf, which these days
 usually just says "include /etc/ld.so.conf.d/*.conf".
 Those files, in turn, contain a newline-separated list of directories
 which are searched for libraries.
 musl uses /etc/ld-musl-$ARCH.path instead; this is a simple newline or
 colon separated list of directories.
* with Debian's default configuration, the directories which glibc searches
 are {/usr/,/}lib/linux-$CPU-gnu, and /usr/local/lib.
 Delete /etc/ld.so.conf.d/libc.conf, and the library directory structure
 will have no conflicts with musl.
* there are two possible approaches:
 - build a glibc chroot, drop a few links in /lib, put a few files in
   /etc, and you redirect glibc applications to the libraries in the
   chroot.
 - assemble a set of library packages, extract them, make sure there won't
   be conflicts, and copy it over into the root (so that you have both
   an Alpine install and a portion of a Debian install, with the same root)
   Only feasible with "multiarch-enabled" guest distros, meaning Debian and
   relatives.

For the "use a chroot" approach, you will probably want to do something
like this (assumes "guest" chroot in /opt/glibc-sys)
touch /etc/ld.so.nohwcap
sed -e 's|^/|/opt/glibc-sys/|' /opt/glibc-sys/etc/ld.so.conf.d/*.conf \
	>/etc/ld.so.conf

For the "parallel install" approach, I'd create a list of files that are
both the glibc library set and the host, sort through them to figure out
if they're needed/how to change them, and then do something like this
(from the root of wherever you've extracted the libs to):
rm ./etc/ld.so.conf.d/libc.conf
find ./ | grep -v -x -F -f ../glibc-alpine-dupes | cpio -p /
touch /etc/ld.so.nohwcap

(This assumes that the list of duplicates is in the format:
./etc/passwd
...)

HTH,
Isaac Dunham

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.