Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] Best way to build a Minimal Gentoo

705 views
Skip to first unread message

Ow Mun Heng

unread,
Jun 16, 2005, 11:20:04 PM6/16/05
to
I'm talking about something stripped down. Perhaps not to a size of 8MB
but something less than 100MB would be good.

How does one do that?

This will be a box which will not have portage included once everything
is up.

Most likely will be building with uclibc and the uclibc stage1.

Any other pointers? And how does one substitute bash(and others) with
busybox can it be defined up front so it portage doesn't pull in the
dependencies etc?

--
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
98% Microsoft(tm) Free!!
Neuromancer 11:09:38 up 1 day, 28 min, 5 users, load average: 0.74,
0.57, 0.81


--
gento...@gentoo.org mailing list

Zac Medico

unread,
Jun 16, 2005, 11:30:10 PM6/16/05
to
Ow Mun Heng wrote:
> I'm talking about something stripped down. Perhaps not to a size of 8MB
> but something less than 100MB would be good.
>
> How does one do that?
>
> This will be a box which will not have portage included once everything
> is up.
>
> Most likely will be building with uclibc and the uclibc stage1.
>
> Any other pointers? And how does one substitute bash(and others) with
> busybox can it be defined up front so it portage doesn't pull in the
> dependencies etc?
>

Have you seen this howto?

http://gentoo-wiki.com/Embedded_Gentoo

It recommends for you to chroot into a stage3 and then use the ROOT evironment variable to make portage install into an empty filesystem.

Zac
--
gento...@gentoo.org mailing list

Ow Mun Heng

unread,
Jun 17, 2005, 12:00:11 AM6/17/05
to

Well, it I haven't I most certainly will this weekend then.
Thanks.

Anyone Else has experience with using GNAP? Gentoo Network Appliance


> Zac

--
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
98% Microsoft(tm) Free!!

Neuromancer 11:53:40 up 1 day, 1:13, 5 users, load average: 0.56, 0.93,
0.88


--
gento...@gentoo.org mailing list

Zac Medico

unread,
Jun 17, 2005, 12:30:11 AM6/17/05
to
Ow Mun Heng wrote:
>>>I'm talking about something stripped down. Perhaps not to a size of 8MB
>>>but something less than 100MB would be good.
>>>
>>>How does one do that?
>>>
>>>This will be a box which will not have portage included once everything
>>>is up.
>>>
>>>Most likely will be building with uclibc and the uclibc stage1.
>>>
>>>Any other pointers? And how does one substitute bash(and others) with
>>>busybox can it be defined up front so it portage doesn't pull in the
>>>dependencies etc?
>>>
>>
>>Have you seen this howto?
>>
>>http://gentoo-wiki.com/Embedded_Gentoo
>>
>>It recommends for you to chroot into a stage3 and then use the ROOT evironment variable to make portage install into an empty filesystem.
>
>
> Well, it I haven't I most certainly will this weekend then.
> Thanks.
>
> Anyone Else has experience with using GNAP? Gentoo Network Appliance
>

Also, did you know about the gentoo-embedded mailing list?

http://marc.10east.com/?l=gentoo-embedded&r=1&w=2

mic...@michaelshiloh.com

unread,
Jun 17, 2005, 1:30:07 AM6/17/05
to

On Thu, 16 Jun 2005, Zac Medico wrote:

> Ow Mun Heng wrote:
>>>> I'm talking about something stripped down. Perhaps not to a size of 8MB
>>>> but something less than 100MB would be good.
>>>>
>>>> How does one do that?
>>>>
>>>>
>>>

>>> Have you seen this howto?
>>>
>>> http://gentoo-wiki.com/Embedded_Gentoo
>>>
>>> It recommends for you to chroot into a stage3 and then use the ROOT evironment variable to make portage install into an empty filesystem.
>>
>>
>> Well, it I haven't I most certainly will this weekend then.
>> Thanks.
>>
>> Anyone Else has experience with using GNAP? Gentoo Network Appliance
>>
>
> Also, did you know about the gentoo-embedded mailing list?
>
> http://marc.10east.com/?l=gentoo-embedded&r=1&w=2

Also this is invaluable:

http://www.bulah.com/embeddedgentoo.html
--
gento...@gentoo.org mailing list

Ow Mun Heng

unread,
Jun 17, 2005, 1:40:08 AM6/17/05
to

Again.. something I didn't know.. Thanks. I do know about the
gentoo-embedded irc channel but no one ever talks in there and there's
no activity whatsover there at all.

:-)

Thanks again.
>
> Zac

--
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
98% Microsoft(tm) Free!!

Neuromancer 13:34:35 up 1 day, 2:53, 5 users, load average: 2.34, 0.98,
0.72


--
gento...@gentoo.org mailing list

Iain Buchanan

unread,
Jun 17, 2005, 3:10:10 AM6/17/05
to
On Fri, 2005-06-17 at 13:35 +0800, Ow Mun Heng wrote:
> On Thu, 2005-06-16 at 21:23 -0700, Zac Medico wrote:
> > Ow Mun Heng wrote:
> > >>>I'm talking about something stripped down. Perhaps not to a size of 8MB
> > >>>but something less than 100MB would be good.
> > >>>
> > >>>How does one do that?
> > >>>
> > >>>This will be a box which will not have portage included once everything
> > >>>is up.

I've only just noticed this thread, but I thought you might like to know
what I tried.

Some time ago I wanted to install gentoo on a flash disk that was 64Mb,
to run on an industrial pc, while leaving enough space for about 12Mb of
our applications, plus a few logs, etc. This is how I ended up doing
it:

Firstly I installed a 20Gb harddrive as well as the flash disk in the
one pc. I installed the minimal gentoo that I required on the hd (sshd,
iptables, gcc, ppp, vi, ftpd, etc)

Now, touch every file on the file system, and take note of the date.
(maybe I set the system date back a few years before I did this, I can't
remember)

Then I booted to the new system on the hd and did some basic operations
- ssh in, ftp in, etc.

Then boot again to the live cd, and use find to find all files on the
hard drive that have an access time greater than the date you just
noted. - These will be the absolute minimum set of files your pc
requires to run. Copy these files from the hd to the flashdisk, or
whatever your permanent install disk is.

That's just about it! You will now have a functioning gentoo system
which is much less than 64Mb. Well, it's not exactly a gentoo system,
because you'll skip all the portage stuff and a lot of others, but
that's the idea.

Now - there are some gotcha's!
1. make sure you _don't_ specify noatime when you mount the hd
originally.
2. make sure you copy symbolic links, as well as their targets - because
you need a lot of these symlinks for libs and so on. This one really
had me confused with lots of weird errors.
3. you may find that you didn't do enough to access all the files you
would normally need. This isn't an exact process, but its pretty good
for getting a small distro.

For a period of time while we were testing this lite-distro, we had the
harddrive installed (but unmounted) so when we needed something that we
forgot, just mount the drive and cp it over! In fact, we even left the
system dual-booting into the 'lite' and 'normal' gentoo for a while till
we ironed out all the bugs.

This may be a bit of extra work, but it creates a small install!

HTH,
--
Iain Buchanan <iai...@netspace.net.au>

--
gento...@gentoo.org mailing list

Eugene Rosenzweig

unread,
Jun 17, 2005, 3:40:07 AM6/17/05
to
Ow Mun Heng wrote:

Are you aiming for a general purpose system or an 'appliance'? I don't
have any experience with embedded stuff but if you want it as a desktop
machine there are a few things you could do.
One thing that comes to mind is to mount portage data dirs over the
network. I got a few gentoo machines and they all share
/usr/portage/distfiles over nfs and the performance is ok. I dont see a
reason why all of /usr/portage cannot be mounted over network Once you
set up your machine how you want it, maybe you can move the /var/db to
another machine and mount that over the network for infrequent updates.
I would think without these two the actual portage itself wouldn't be
very large.
Also I had an idea that you might get away with not having a compiler on
the machine. I never used distcc but I keep hearing of people using it.
I had a look at its dependencies and it doesnt depend directly on gcc so
maybe it is possible to, once its installed, to do all compilation
remotely? You would still need binutils to do the linking I guess.
All these changes are not as radical as just removing these parts of
Gentoo altogether and they would make a machine dependent on another
machine (fileserver and compilation server) but they would leave the
machine easily upgradeable. Just depends on what you want to do.
There are also couple of settings in the kernel setup under 'Configure
standard kernel features (for small systems)' which can make kernel size
smaller but I think those might be for really small embedded systems.
Another thing you could try which I haven't heard of is pick the
CFLAGS="-Os' for size rather than performance. Not sure if there are any
other flags which reduce code size. Seems to make a difference though:
http://www.inf.u-szeged.hu/csibe/s-i686-linux.php .
And there is always USE="-*" when doing the stage1 install to disable
all features by default.

Eugene.

--
gento...@gentoo.org mailing list

Ow Mun Heng

unread,
Jun 17, 2005, 4:10:07 AM6/17/05
to

I want it as an appliance.

Thanks


--
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
98% Microsoft(tm) Free!!

Neuromancer 16:06:50 up 1 day, 5:26, 5 users, load average: 0.54, 0.36,
0.32


--
gento...@gentoo.org mailing list

Ow Mun Heng

unread,
Jun 19, 2005, 10:30:09 AM6/19/05
to
On Thu, 2005-06-16 at 16:33 +0000, mic...@michaelshiloh.com wrote:
>
> On Thu, 16 Jun 2005, Zac Medico wrote:
>
> > Ow Mun Heng wrote:
> >>>> I'm talking about something stripped down. Perhaps not to a size of 8MB
> >>>> but something less than 100MB would be good.
> >>>>
> >>>> How does one do that?
> >>>>
> >>>>
> >>>
> >>> Have you seen this howto?
> >>>
> >>> http://gentoo-wiki.com/Embedded_Gentoo
> >>>

> http://www.bulah.com/embeddedgentoo.html

Thanks for all the help guys.. I've managed to get a minimal gentoo
running.

right now, the space stands at

total size = 53.6MB
ext3 journal = 33MB
kernel = 2.1MB (compiled with uclibc)
kernel-modules=9.5MB

BTW, I've subscribed to the embedded mailing list too

Thanks.


--
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
98% Microsoft(tm) Free!!

Neuromancer 22:22:10 up 1 day, 24 min, 4 users, load average: 1.10,
0.84, 0.80


--
gento...@gentoo.org mailing list

A. Khattri

unread,
Jun 19, 2005, 11:30:25 AM6/19/05
to
On Sun, 19 Jun 2005, Ow Mun Heng wrote:

> Thanks for all the help guys.. I've managed to get a minimal gentoo
> running.
>
> right now, the space stands at
>
> total size = 53.6MB
> ext3 journal = 33MB
> kernel = 2.1MB (compiled with uclibc)
> kernel-modules=9.5MB

Could you describe how you did it?


--

--
gento...@gentoo.org mailing list

Mark Knecht

unread,
Jun 19, 2005, 12:40:17 PM6/19/05
to
On 6/19/05, A. Khattri <aj...@bway.net> wrote:
> On Sun, 19 Jun 2005, Ow Mun Heng wrote:
>
> > Thanks for all the help guys.. I've managed to get a minimal gentoo
> > running.
> >
> > right now, the space stands at
> >
> > total size = 53.6MB
> > ext3 journal = 33MB
> > kernel = 2.1MB (compiled with uclibc)
> > kernel-modules=9.5MB
>
> Could you describe how you did it?
>

I'd be interested also. Hey, you could even make an iso image
available and we could try it out ourselves.

- Mark

--
gento...@gentoo.org mailing list

Ow Mun Heng

unread,
Jun 19, 2005, 10:20:08 PM6/19/05
to
On Sun, 2005-06-19 at 09:31 -0700, Mark Knecht wrote:
> On 6/19/05, A. Khattri <aj...@bway.net> wrote:
> > On Sun, 19 Jun 2005, Ow Mun Heng wrote:
> >
> > > Thanks for all the help guys.. I've managed to get a minimal gentoo
> > > running.
> > >
> > > right now, the space stands at
> > >
> > > total size = 53.6MB
> > > ext3 journal = 33MB
> > > kernel = 2.1MB (compiled with uclibc)
> > > kernel-modules=9.5MB
> >
> > Could you describe how you did it?
> >

(Oops.. the kernel and modules are NOT compiled with uclibc and not as
stated previously.)

Well, I just followed the instructions on bulah.com

though there were some obstacles which I'm still trying to get right.
(for one, modules doesn't load, dropbear doesn't start, no network etc..
in short, it's still in-progress :0

> I'd be interested also. Hey, you could even make an iso image
> available and we could try it out ourselves.

du -chs /mnt/data/devel/MINIME/
23M total

7.6M MINIME-gentoo.tar.bz2

If anyone really wants to play with it. I can send you the tar.bz2 file.
but it currently does nothing other than boots and drops you into a
prompt. (i do have the whole devel fs at ~44MB, this is the one which u
can use to "emerge" stuffs.)

It does Absolutely NOTHING right now. I'm still working on it. :-)

Let me know..


--
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
98% Microsoft(tm) Free!!

Neuromancer 10:10:44 up 1 day, 12:13, 7 users, load average: 1.62, 1.39,
1.41


--
gento...@gentoo.org mailing list

0 new messages