Gentoo Archives: gentoo-embedded

From: Ned Ludd <solar@g.o>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] small replacement for emerge for live package-management?
Date: Mon, 04 Feb 2008 00:38:13
Message-Id: 1202085490.5025.60.camel@localhost
In Reply to: [gentoo-embedded] small replacement for emerge for live package-management? by Christopher Friedt
1 On Sun, 2008-02-03 at 15:30 +0100, Christopher Friedt wrote:
2 > Hi everyone,
3 >
4 > Are there any pointers for a light(er) weight package manager for
5 > embedded devices with <= 16 MB of flash storage ?
6 >
7 > I've grown accustomed to using emerge to build binary packages for all
8 > of my boards. Up until now we've just blasted the binary packages onto
9 > our boards in the shop, but we're turning towards updates on live
10 > systems in the field.
11 >
12 > Paludis has struck my interest but I'm just not sure what the runtime
13 > requirements are, and how well it deals with normal gentoo binary tbz2's
14 > (and their metadata). I think that libstdc++.so is a bit too big for our
15 > boards, so any options with C++ dependencies are likely out the door.
16 >
17 > Having python on our boards is not really an option either, and
18 > therefore the factory 'emerge' also won't work (or will it??).
19 >
20 > Does anyone have any suggestions? I'm sure that some of you have dealt
21 > with the same problem before.
22
23 Having has the same need myself I wrote in c a util called qmerge.
24 qmerge is apart of portage-utils. portage-utils provides applets much in
25 the same way as busybox does that can be disabled at compile time.
26 qmerge only deals with gentoo based binary.tbz2 files.
27
28 # Setup basic embedded ROOT...
29
30 uClibc shm # mkdir ROOT; cd ROOT ; mkdir proc root sys dev
31 uClibc ROOT # \
32 INSTALL_MASK="*.a /bin/bb /usr/lib/*.o /usr/include" \
33 ROOT=$PWD/ \
34 emerge -KOq uclibc busybox portage-utils
35
36 uClibc ROOT # tar -xf /usr/share/busybox/busybox-links.tar
37 uClibc ROOT # rm -rf usr/share/busybox
38 uClibc ROOT # du -hcs .
39 2.2M .
40 uClibc ROOT # mkdir usr/portage/packages/ var/tmp/portage/portage
41 uClibc ROOT # cp /etc/resolv.conf etc/
42 uClibc ROOT # mount -obind /proc/ proc/ ; mount -obind /sys/ sys/ ;
43 mount -obind /dev/ dev/
44
45 uClibc ROOT # chroot . /bin/sh --login
46
47 # Inside of the chroot or on an embedded device with networking.
48 / # export QMERGE=1
49 / # qmerge -KOq dropbear
50 MD5: [OK] 4176096ccf8680d595de20514e65d928 net-misc/dropbear-0.50
51
52 / # dbclient
53 dbclient: can't load library 'libz.so.1'
54 / # qmerge -K zlib
55 Connecting to tinderbox.dev.gentoo.org (140.211.166.181:80)
56 zlib-1.2.3-r1.tbz2 100% |
57 ***************************************************************************************************************************************************| 139k --:--:-- ETA
58 MD5: [OK] 5db12eac15c6910c179e4be1fd7bf030 sys-libs/zlib-1.2.3-r1
59 === sys-libs/zlib-1.2.3-r1
60 +++ sys-libs/zlib-1.2.3-r1 == sys-libs/zlib-1.2.3-r1
61 >>> //lib/libz.so.1.2.3
62 >>> //usr/lib/libz.so
63 >>> //usr/lib/libz.a
64 >>> //usr/include/zconf.h
65 >>> //usr/include/zlib.h
66 >>> //var/db/pkg/sys-libs/zlib-1.2.3-r1
67
68
69 # opps looks like we never set up a make.conf and made sure to set an
70 INSTALL_MASK=..
71
72 / # dbclient
73 Dropbear client v0.50
74 Usage: dbclient [options] [user@]host [command]
75 Options are:
76 -p <remoteport>
77 -l <username>
78 -t Allocate a pty
79 -T Don't allocate a pty
80 -N Don't run a remote command
81 -f Run in background after auth
82 -y Always accept remote host key if unknown
83 -i <identityfile> (multiple allowed)
84 -L <listenport:remotehost:remoteport> Local port forwarding
85 -g Allow remote hosts to connect to forwarded ports
86 -R <listenport:remotehost:remoteport> Remote port forwarding
87 -W <receive_window_buffer> (default 24576, larger may be faster, max
88 1MB)
89 -K <keepalive> (0 is never, default 0)
90
91
92
93 # well there we go.. One portage gentoo pkg built on a remote host and
94 installed on the local one that we did not have to alter server side in
95 any way..
96
97
98 / # qsize portage-utils
99 app-portage/portage-utils-0.1.29: 17 files, 2 non-files, 163.667 KB
100
101
102 ###########
103 Few notes.. These can be mounted by the embedded device as a tmpfs.
104 $ROOT/usr/portage/packages/ var/tmp/portage. You can/should delete the
105 contents in there on embedded devices.
106
107 1) Never make/allow qmerge to touch the libc
108 2) Never make/allow qmerge to touch the *busybox*/bin/sh..
109
110 Final note.. It's still an applet in development. If you find a bug in
111 it. I'd much would rather have a patch that fixes it up vs a bugzilla
112 entry telling me whats wrong with it. Good luck.
113
114
115
116 --
117 gentoo-embedded@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-embedded] small replacement for emerge for live package-management? Christopher Friedt <cfriedt@××××××××××××××.com>