Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Making a custom gentoo livecd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
bperegrine
n00b
n00b


Joined: 23 Dec 2017
Posts: 37

PostPosted: Mon Dec 25, 2017 9:32 am    Post subject: Making a custom gentoo livecd Reply with quote

I was wondering what the essential packages (ebuilds) are for a stripped-down (lightweight) gentoo livecd ?
My intent would be to make a gentoo livecd that fits on a standard cd (not DVD !). Also, it should be stripped to its essentials, but still be practical for use by everyday users. A generic x86 version and a generic x86_64 version would need to be made (by generic I mean it should run on any x86 architecture, so the x86 version for example should need to be able to run on intel pentium 2, 3, 4, D, M as well as AMD Athlon, Zen, Ryzen, ...). I heard making such a small livecd should be possible (uncompressed a size of 1,2 gb is possible, and when this is compressed, as always the case on a livecd, it should be possible to have the size reduced to say 500 mb or so).

I made a list of packages (ebuilds) that definitely need to be in the livecd, see
https://github.com/ecocomputing/TAZ/blob/master/gentoo_ebuilds_and_tbz2s/Catalyst_specfile.txt

Can you guys tell me what packages are still missing and which I need for a fully functional gentoo distro ?

Once I have a list of all the needed ebuilds, I would need to download all the ebuilds, upload them to github, and then make binaries from them (tbz2's), using my cflags text. These would be uploaded to github again, and then the livecd would be made using the tbz2's and the image of the livecd would be uploaded again to github.

How do I best go about this ? I don't have gentoo running on my pc, nor have I ever used it in the past (I'm new to it).

PS: Note that one of the reasons why I want to use tbz2's is because that way, a sort of "many-in-one iso" livecd can be made. This allows to load only those programs that are needed for that computing session. See the 8 boot setups mentioned at the catalyst specfile link.
I assume this will be possible in gentoo ?


Last edited by bperegrine on Tue Dec 26, 2017 12:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54263
Location: 56N 3W

PostPosted: Mon Dec 25, 2017 10:59 am    Post subject: Reply with quote

bperegrine,

Welcome to Gentoo

The gentoo solution to this is the catalyst tool.
Its scrpit driven and it used by all the autobuilds. LiveCD, LiveDVD and stages.

Code:
emerge catalyst


You can make an i686 version that will run almost anywhere.
How far back in time do you want to go?
i586, i486 ?
i386 is out as glibc dropped support at glibc-2.3

Optical media are going the way of the floppy, Why not a liveUSB stick?
Where will your writeable space be?
With root on read only media, you need an overlay filesystem to allow writing to root.
Think about updating /etc/resolv.conf and friends.

You appear to be missing a bootloader for the CD too. What you choose depends on how far back you go.
Older systems expect a fake floppy image that the BIOS boots as if it were booting a floppy.
Newer systems don't have that constraint. Use syslinux.

You can build on the Gentoo liveCD, System Rescue CD, as its Gentoo based, and even the liveDVD.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
bperegrine
n00b
n00b


Joined: 23 Dec 2017
Posts: 37

PostPosted: Mon Dec 25, 2017 3:57 pm    Post subject: Reply with quote

NeddySeagoon wrote:

The gentoo solution to this is the catalyst tool.
Its script driven and it used by all the autobuilds. LiveCD, LiveDVD and stages.
Code:
emerge catalyst


Yup, I know.
Thing is though that I don't have gentoo running on any pc, so I was wondering which of the work needed I can do already, without needing to install gentoo. I guess that I could get gentoo running btw, if there was a gentoo livecd. I haven't found any though, I only found a livedvd (which I can't run -no dvd player-) and a gentoo install cd (which too if of no use). See https://www.gentoo.org/downloads/

NeddySeagoon wrote:

You can make an i686 version that will run almost anywhere.
How far back in time do you want to go?
i586, i486 ? i386 is out as glibc dropped support at glibc-2.3

I think i686 is far enough. It just needs to go as far back as the pentium 2/3, say 500 mhz cpu's.

NeddySeagoon wrote:

Optical media are going the way of the floppy, Why not a liveUSB stick?
Where will your writeable space be?
With root on read only media, you need an overlay filesystem to allow writing to root.
Think about updating /etc/resolv.conf and friends.

Yes I first used a liveUSB thinking that would be better than livecd's. I thought wrong.
Live usb's don't boot on older machines since they don't have support for booting from usb (BIOS doesn't allow it).

NeddySeagoon wrote:

You appear to be missing a bootloader for the CD too. What you choose depends on how far back you go.
Older systems expect a fake floppy image that the BIOS boots as if it were booting a floppy.
Newer systems don't have that constraint. Use syslinux.

Yup, syslinux was my first choice too.

Anyway, what I can I do right now to work on it, as I don't have gentoo running.
Can I just clone the ebuilds needed directly at github ?
I found https://github.com/gentoo/gentoo but these don't seem to be the ebuilds as I assume the ebuild is a single file (script) ? I guess that making the binaries will be out of the question since I then need gentoo running (and even then it might not work since I don't have a powerful machine), but I'm hoping I could at least work on (clone) the ebuilds at github.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54263
Location: 56N 3W

PostPosted: Mon Dec 25, 2017 7:40 pm    Post subject: Reply with quote

bperegrine,

An ebuild is a recipe for the portage package manager to build a package and install it in Gentoo.
Itself, its a single file but on its own its not complete. You can't use it wiithout a Gentoo install.

There are several Gentoo LiveCDs. The traditional minimal CD only provides enough to install Gentoo at the ronsole.
System Rescue CD is gentoo based and gives you a GUI.

Older PCs can boot from CD, but the method is a bit convoluted. You can't use syslinux but need to create a bootable floppy image that contains the kernel and initrd.
That's a challenge with modern software, since you will have at most 2.88Mb and possibly only 1.44Mb to work with.
It might be possible just to include a boot loader in that image.
Then there is the complication that the floppy image needs to be in the right place on the CD.

That github link is the Gentoo ebuild repository.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
bperegrine
n00b
n00b


Joined: 23 Dec 2017
Posts: 37

PostPosted: Tue Dec 26, 2017 12:31 pm    Post subject: Reply with quote

NeddySeagoon wrote:

An ebuild is a recipe for the portage package manager to build a package and install it in Gentoo.
Itself, its a single file but on its own its not complete. You can't use it wiithout a Gentoo install.

That github link is the Gentoo ebuild repository.


I know I can't use the ebuilds without gentoo. I just want to do some of the work already (so just clone the single ebuild files/recipes, not the entire repo), without needing to use gentoo already (because it will run slow or not at all, seeing that most gentoo distro's are not minimal but rather quite heavy and my machine isn't all that fast).
Can't the ebuild recipe's (not repos) be found somewhere on github so i can clone them ?

NeddySeagoon wrote:

Older PCs can boot from CD, but the method is a bit convoluted. You can't use syslinux but need to create a bootable floppy image that contains the kernel and initrd.
That's a challenge with modern software, since you will have at most 2.88Mb and possibly only 1.44Mb to work with.
It might be possible just to include a boot loader in that image.
Then there is the complication that the floppy image needs to be in the right place on the CD.

I'll stick to syslinux. In any way, the choice of whether I want to create a live usb or live cd seems besides the point anyhow as I just want to make an image (=iso) and post that on github for others to download. The iso should be below say 650 mb so it can fit on a cd or usb stick. The iso can be made into a bootable usb stick then by means of a program like unetbootin, multibootusb, ...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54263
Location: 56N 3W

PostPosted: Tue Dec 26, 2017 1:07 pm    Post subject: Reply with quote

bperegrine,

The entire repo is available as a read only squashfs image.
You may not need it all but you will go mad trying to get single ebuilds. Each ebuild lists almost all the packages that the given package depends on.
Its 'almost' as ebuilds are permitted to assume that the @system set is always available.
A lot of the complexity is hidden in eclasses, which are like libraries called by ebuilds.
Code:
Filesystem                  1K-blocks      Used Available Use% Mounted on
/dev/mapper/static-portage    3144274    327672   2602791  12% /usr/portage

So, my portage tree is 320Mb on a filesystem with a 1k block size.
As its a large number of small files, it would be 1.28Gb on a filesystem with a 4k block size.

You are trying to make disk space saving in the wrong place.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
bperegrine
n00b
n00b


Joined: 23 Dec 2017
Posts: 37

PostPosted: Tue Dec 26, 2017 4:37 pm    Post subject: Reply with quote

NeddySeagoon wrote:
bperegrine,

The entire repo is available as a read only squashfs image.
You may not need it all but you will go mad trying to get single ebuilds. Each ebuild lists almost all the packages that the given package depends on.
You are trying to make disk space saving in the wrong place.


The reason I preferred the single file scripts was that I wanted to make the gentoo distro using catalyst, using cflags.
I'm not sure whether those ebuild repo's allow that (making custom distro's using cflags, so stripping off some dependencies) ? Another thing I don't know is whether those ebuild repos allow binaries (again customised using cflags) to be made. That too is pretty important since the final version of the live cd should have the "many-in-one" ability mentioned at my first post. Also, isn't the file compression (squashfs) put unto the binary (or is it normally left uncompressed) ?

BTW: Since I doubt I'll be able to do some tasks myself (making the binaries for instance), I was wondering where I might find gentoo developers that can do this task for me (voluntary or payed). Are there any sites where I can find developers, specialised in gentoo linux ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54263
Location: 56N 3W

PostPosted: Tue Dec 26, 2017 5:11 pm    Post subject: Reply with quote

bperegrine,

You need to understand how portage works.
The portage package manager works with the Gentoo repo and overlays to build the distro that you have designed.

Catalyst is a layer on top of the portage package manager and Gentoo repo to automate rebuilding the distro that you have designed.

You need to use Portage and the Gentoo repo to get to grips with how it works.
Portage, the Gentoo repo, the toolchain, headers and so on are required at build time, they are not required at run time.
Thus building Gentoo and running Gentoo can be two different things.

Try the minimal CD. It is a running Gentoo. You can't use it for building things. It runs almost anywhere but only has the tools needed to install Gentoo.
That does not include the Gentoo repo, the toolchain, headers ... Its run time only.
The System Rescue CD is similar.

You are repeating work that others have already done. In the open source way, you should build on that or you will repeat it.

Portage allows per package settings, including CFLAGS. CFLAGS do not affect the dependency tree.
They change how gcc works, not what it works on.

You will not understand how portage works without using it.

Catalyst outputs an .ISO file if that's what you want.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
bperegrine
n00b
n00b


Joined: 23 Dec 2017
Posts: 37

PostPosted: Fri Dec 29, 2017 3:55 pm    Post subject: Reply with quote

bperegrine wrote:

Also, isn't the file compression (squashfs) put unto the binary (or is it normally left uncompressed) ?


Made a mistake here: I forgot the binaries aren't bootable, so I need to compress them manually into 8 different squashfs archives.

I also made it clear in the text now that the aim is to have them written to/loaded from RAM, so a tmpfs is used for this.
See the new text at https://github.com/ecocomputing/TAZ/blob/master/gentoo_ebuildlist_and_tbz2s/live_cd_overview.txt

A few things I still don't know though:
Do I actually need to download the individual ebuild repo's in advance at all, or will catalyst allow to download the repo's USING A LIST (textfile) and convert it to individual tbz2's during the livecd creation process ? If catalyst can use a list that can be loaded, there's actually little point in me storing the ebuilds (scripts or repo's) at github at all.

Will it also allow to use tbz2's that have been created in advance (so that for making the livecd, not all binaries need to be made at once, but rather existing ones can be used, together with new ones that need to be made in situ from the ebuilds) ?

The aim of storing the tbz2's at github is to allow to download old tbz2's (for instance: programs that are still the same version as the year before) for making a newer version of the livecd. That way, it will take less time/effort when making a new version of the livecd.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54263
Location: 56N 3W

PostPosted: Fri Dec 29, 2017 4:09 pm    Post subject: Reply with quote

bperegrine,

1) Install Gentoo and get a feel for it.
2) Make your ISO distribution system support zsync.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
stolar
n00b
n00b


Joined: 15 Sep 2007
Posts: 49
Location: Zgierz, Poland

PostPosted: Thu Oct 11, 2018 9:50 pm    Post subject: Reply with quote

NeddySeagoon,

Could You please leave a tip here on how to modify a Gentoo LiveCD so that it contains a specified kernel drivers?
Shortly speaking, i wanted to use current minimalCD to install Gentoo on some old x86 laptop. Unfortunately neither the current MinimalCD nor the one from 2011 works for me to boot on this laptop since it uses PCMCIA CD-ROM. However, my oldest found Gentoo 2004 CD boots on this laptop (after passing
Code:
gentoo ide2=0x180
as kernel parameters).
I think that i found a driver on this CD that is responsible for handling this PCMCIA CD-ROM (
Code:
sbp2
). This is however not present in the currently available minimal CD. I would like to learn how modify the Gentoo minimal CD drivers using the best engineering practices in order to add some drivers there to make me able to boot the newest minimal CD on this old subnootebook. It the already mentioned by You
Code:
 catalyst
option rather only way?

Thanks,
Piotr
_________________
Best Regards,
Piotr
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum