Gentoo Archives: gentoo-embedded

From: Natanael Copa <natanael.copa@×××××.com>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] baselayout-2, busybox and uclibc
Date: Thu, 11 Oct 2007 10:12:35
Message-Id: 1192096824.10822.154.camel@nc.nor.wtbts.org
In Reply to: [gentoo-embedded] baselayout-2, busybox and uclibc by Marc Blumentritt
1 On Wed, 2007-10-10 at 20:48 +0200, Marc Blumentritt wrote:
2 > Hi,
3 >
4 > first: Be warned, this is a long email!
5 >
6 > I'm working on my first embedded system. I plan to build for my media pc
7 > a minimal gentoo, based on uclibc, busybox, and baselayout-2. I want to
8 > use standard init.d scripts from gentoo. The root file system will be
9 > placed in initramfs for maximum boot speed. Kernel will be monolithic
10 > and device files static.
11
12 interesting!
13
14 ...
15
16 > QUESTION: Are there any useful configuration tips for dropbear?
17
18 default dropbear config have just worked for me.
19
20 > OK, the next steps are what I want to do next:
21 >
22 >
23 > 6.) Configuration of busybox: busybox provides a lot of tools, but some
24 > tools should not be used. I have so far identified:
25 > - start-stop-daemon (provided by baselayout-2)
26
27 I use bb start-stop-daemon (not with baselayout-2 though). It works for
28 almost all Gentoo scripts. (postgresql is one who does not)
29
30 > - init (provided by sysvinit)
31 > I configure busybox to not provide these tools in
32 > $PORTAGE_CONFIGROOT/etc/portage/savedefaults/sys-apps/busybox-1.6.1:
33 > Comment the following:
34 > # for start-stop-daemon
35 > CONFIG_START_STOP_DAEMON=y
36 > CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
37 > CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
38 > # for init
39 > CONFIG_INIT=y
40 > # CONFIG_DEBUG_INIT is not set
41 > CONFIG_FEATURE_USE_INITTAB=y
42 > CONFIG_FEATURE_INIT_SCTTY=y
43 > CONFIG_FEATURE_INIT_SYSLOG=y
44 > CONFIG_FEATURE_EXTRA_QUIET=y
45 > CONFIG_FEATURE_INIT_COREDUMPS=y
46 > CONFIG_FEATURE_INITRD=y
47 > After configuration reinstall busybox with USE=savedconfig
48 >
49 > QUESTION: Are there any tools I should disable, too? Do I really need
50 > coreutils (and ncurses, which is pulled in by coreutils) or are the
51 > busybox tools enough (busybox provides about 69% of the tools in coreutils)?
52
53 I think busybox coreutils should work. If it doesn not, we should fix
54 busybox. (if you give me a list, I can take a look at it when i get
55 time)
56
57 Here below you also say you use sysvinit. Then you can turn off bb init
58 i think. (unless you use it in initramfs)
59
60 > 7.) Device files: create minimum device file set. QUESTION: What is the
61 > minimum device file set for booting in ram from initramfs? The following
62 > list is taken from "Building Embedded Linux Systems":
63 > files:
64 > mem, null, zero, random, tty0, tty1, ttyS0 (QUESTION: do I need this? I
65 > do not want to use a serial port), tty, console
66 > links:
67 > fd (link to /proc/self/fd), stdin (link to fd/0), stdout (link to fd/1),
68 > stderr (link to fd/2)
69 >
70 > Are there any other files?
71
72 why not just run mdev -s and let mdev create everything.
73
74 > All files I need to fully use my media-pc I will create after booting
75 > with mdev (from busybox) and copy them to my build machine, since I want
76 > to use static device files.
77
78 You might want to have a look at my medv config and /lib/mdev/* scripts
79 shipped in my alpine-baselayout.
80
81 http://dev.alpinelinux.org/alpine/alpine-baselayout/
82
83 I have also an init.d/mdev script that let me use mdev as an udev
84 replacement.
85
86 > 8.) System configuration: up to now I have only two QUESTIONs:
87 > -How do I use locals with uclibc?
88
89 You mean locales? uclibc has locale support but its not good :-(
90
91 > -Do I have to tell baselayout-2, that I use ash as shell?
92
93 I dunno, I think /bin/sh pointing to busybox should be enough.
94
95 > 9.) install grub.
96 >
97 > 10.) Build kernel and initramfs from ROOT
98 >
99 > 11.) Boot media-pc with livecd and copy kernel, initramfs and grub files
100 > to media-pc. QUESTION: Since I have already grub installed on my
101 > media-pc, grub installation to boot sector is not a problem, but what do
102 > you do, if you do not have grub installed? Boot with livecd, extract
103 > initramfs and use installed grub to install grub to boot sector?
104
105 You can use grub on livecd.
106
107 >
108 > QUESTION: Do you have any remarks?
109
110 You could try busybox-1.7.x. Its a good release.
111
112 >
113 > OK, thanks for reading.
114
115 Thanks for sharing your experiences
116
117 > Marc
118
119 --
120 gentoo-embedded@g.o mailing list

Replies

Subject Author
[gentoo-embedded] Re: baselayout-2, busybox and uclibc Marc Blumentritt <marc.blumentritt@×××××.de>