Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Create a live cd with Catalyst 2.0
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2144
Location: Europe

PostPosted: Wed Sep 19, 2007 3:15 pm    Post subject: [HOWTO] Create a live cd with Catalyst 2.0 Reply with quote

Hi folks,

I found no howto for Catalyst 2.0 and its documentation is not really good I decided to write my own howto.
Comments are welcome.

Here I present how to create a minimal live CD with Catalyst 2.0 with automated hardware detection. I do not guarantee that it is complete and has no failures. If you find a failure or have ideas how to expand this howto send me a personal mail.

As nopaste deletes posts so fast I attached the needed files to this post.
Catalyst currently only works as superuser.

Contents
1. Installing and configurating Catalyst 2.0
2. Creating a portage snapshot
3. Creating a live cd stage 1
4. Creating a live cd stage 2

Appendix
- Troubleshooting
- Needed files

1. Installing and configurating Catalyst 2.0
Unmask it and install it the getnoo way
Code:
mkdir /etc/portage/package.keywords
echo "=dev-util/catalyst-2.0.5_pre3 ~*" >> /etc/portage/package.keywords/catalyst
emerge -av catalyst

Now you can adjust the numbers of CPUs used to compile the live cd's ebuilds. Edit /etc/catalyst/catalystrc and add this line
Code:
export MAKEOPTS="-jN"
Replace N with the number of CPUs to use +1.
You can do further configuration in /etc/catalyst/catalyst.conf but I didn't need this yet. If you want to do so you probably need the the documentation.


2. Creating a portage snapshot
You must create a portage snapshot of your current system's portage tree. So to use up to date ebuilds you should call
Code:
emerge --sync
if you didn't already execute it today.
Now we can create the snapshot:
Code:
catalyst -C target=snapshot version_stamp=my_date
You can replace my_date with the current date but then you must make sure that you change it in the .spec file (see below) too!


3. Creating a live cd stage 1
Please note that a "live cd stage 1" has nothing to do with a "stage 1 gentoo linux installation"!
First he must get the current gentoo linux stage 3 installation tar ball from your gentoo linux mirror:
Code:

cd /var/tmp/catalyst/builds/default/
wget <your mirror>/releases/x86/2007.0/stages/stage3-x86-2007.0.tar.bz2

And now we create some directories:
Code:
mkdir -p /root/catalyst/portage/package.keywords
mkdir -p /root/catalyst/kernel

Download the live cd stage 1 .spec file livecd-stage1.spec (see appendix below) and edit it.
You should adjust following values:
version_stamp
think about a nice name for your livecd
snapshot
paste portage snapshot name here
livecd/use
if you need global use flags put them here
livecd/packages
ebuilds that should be installed on the livecd are placed here if they do not depend on a configured kernel

now call
Code:
catalyst -f /root/catalyst/livecd-stage1.spec
to create the live cd stage 1.


4. Creating a live cd stage 2
Now it's time to create the live cd stage 2.
First get a kernel config file (see appendix below, there is knoppix's .config file (slightly modify to work with catalyst)). Paste it to /root/catalyst/kernel/current.config
Download the livecd-stage2.spec file (see appendix below) to /root/catalyst/ and edit it.
You should be interested in following values:
version_stamp
once again the name of your live cd
snapshot
and the portage snapshots name
source_subpath
subpath (relative to /var/tmp/catalyst/builds/) of the live cd stage1. Probably something like default/livecd-stage1-i586-my_livecd
livecd/iso
output iso file (your live cd image)
livecd/rcadd
If you want to start some /etc/init.d/ services at boot put them here
livecd/rcdel
Or do you want to remove some?
livecd/root_overlay
If you want to put some files on the live cd that are not included in any ebuild (like custom configuration files) you can specify a directory with root directory tree (eg. /etc-directory, /root/-directory)
livecd/xdm
You'd like to start kdm at start up? put it here
livecd/volid
Your custom Volume ID
boot/kernel/gentoo/config
Path to kernel config file (eg. /root/catalyst/kernel/current.config)
boot/kernel/gentoo/packages
Kernel dependent ebuilds must be written down here

Now run
Code:
catalyst -f livecd-stage2.spec
and catalyst will bake the kernel and place your live cd's iso image in livecd/iso (see above).

Good luck.


Appendix
Troubleshooting
I get an error like "System.map not found"
This is a bug in genkernel. Use the latest genkernel version:
Code:
echo "=sys-kernel/genkernel-3.4.9_pre2        ~*      # otherwise we get a --System.map not found-- error" > /root/catalyst/portage/package.keywords/genkernel
Please also note the error described below!

(livecd stage2) I have changed files in the livecd's portage directory but it doesn't take effect.
If you change something in /root/catalyst/portage you must recreate live cd stage 1!


Needed files
current.config
livecd-stage1.spec
livecd-stage2.spec
_________________
Build your own live cd with catalyst 2.0!


Last edited by manuels on Wed Oct 24, 2007 11:50 am; edited 1 time in total
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2164
Location: The Peanut Gallery

PostPosted: Sun Oct 14, 2007 2:23 am    Post subject: Reply with quote

WOW! Thanks manuels, I gave up on catalyst, but this means I might be able to get somewhere with it.

I'll have a go with this next week. Very much appreciated.
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2144
Location: Europe

PostPosted: Tue Oct 16, 2007 10:28 am    Post subject: Reply with quote

You're welcome. Let me know whether it works or there are any errors.

Cheers,
Manuel
_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
jfall
n00b
n00b


Joined: 01 Jun 2007
Posts: 2

PostPosted: Tue Oct 23, 2007 2:55 pm    Post subject: System.map bug problems... Reply with quote

I'm getting "ERROR: Could not copy System.map for the kernel package!", and I modified portage/package.keywords/genkernel according to your suggestion and re-ran stage1. When I did, I kept getting an error message about an invalid atom in package.keywords (the line I just added) and of course when I ran stage2, it failed on me with the same error message. So, I tried adding an = sign in front of the line in portage/package.keywords/genkernel, and re-ran stage1. No complaints about an invalid atom, however when I run stage2 it still emerges genkernel-3.4.8, not 3.4.9_pre2.

So, I looked into /var/tmp/catalyst/tmp/default/livecd-stage1-i686-2007.7/etc/portage/package.keywords, and there is a genkernel file that is a copy of the one I setup. However, in /var/tmp/catalyst/tmp/default/livecd-stage2-i686-2007.7/etc/portage, there is no package.keywords at all, and that's probably why it's still emerging the old version. The question is, why is catalyst not copying the file into stage2? I have the portage_confdir listed in my spec file. Is there a way to get catalyst to re-create stage2 from scratch?

Or, do you have any other ideas?

Thanks
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2144
Location: Europe

PostPosted: Wed Oct 24, 2007 11:54 am    Post subject: Reply with quote

Hi,

I've corrected this = sign in my howto, thanks.

I think you can delete the whole /var/tmp/catalyst/tmp/default/livecd-stage2-i686-2007.7/ directory so catalyst will recreate it from scratch.
Did stage1 finish without any errors?

Cheers
Manuel
_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
Januszzz
Guru
Guru


Joined: 04 Feb 2006
Posts: 367
Location: Opole, Poland

PostPosted: Wed Oct 24, 2007 12:56 pm    Post subject: Reply with quote

Hmm very nice!

But for beginners there is also good start point here: http://www.gentoo.org/proj/en/base/embedded/gnap.xml

Should be faster and easier to start, but if you become more advanced you just finish with... catalyst. Although GNAP isn't very frequently updated, its as good written as Portage (btw GNAP depends on Portage heavily). Because of some "little breaks" GNAP is ultimate introduction to Catalyst, which any serious Linux and especially Gentoo Fan should take!

Regards.
Back to top
View user's profile Send private message
Januszzz
Guru
Guru


Joined: 04 Feb 2006
Posts: 367
Location: Opole, Poland

PostPosted: Thu Oct 25, 2007 11:16 am    Post subject: Reply with quote

Hey, what's that:

Quote:
mkdir /etc/portage/package.keywords


shouldn't it be i.e. "touch /etc/portage/package.keywords?" ;-)

Regards, I will try to follow your howto anyway in just minutes so expect some more reports ;-)
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2144
Location: Europe

PostPosted: Thu Oct 25, 2007 12:01 pm    Post subject: Reply with quote

It can be both.
You can either create a file /etc/portage/packages.keywords and put all your lines in there or you can create a directory /etc/portage/packages.keywords and create files like /etc/portage/packages.keywords/gentoolkit and /etc/portage/packages.keywords/gentoo-sources and put your lines into these files.
I like the second way because it is more cheerful. :D
_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
Treggats
n00b
n00b


Joined: 04 Aug 2007
Posts: 46
Location: 127.0.0.1/24

PostPosted: Thu Oct 25, 2007 2:50 pm    Post subject: Reply with quote

My stage1 fails. Catalyst thinks my portage version is too low.
But as shown it is not.
Code:
ERROR: Your portage version is too low in your seed stage.  Portage version
2.0.51 or greater is required.

Traceback (most recent call last):
  File "modules/livecd_stage1_target.py", line 21, in run_local
    cmd("/bin/bash "+self.settings["sharedir"]+\
  File "/usr/lib/catalyst/modules/catalyst_support.py", line 102, in cmd
    raise CatalystError,myexc
CatalystError: <unprintable instance object>
None

!!! catalyst: LiveCD stage1 build aborting due to error.

Zebaoth catalyst # emerge -V
Portage 2.1.3.9 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r8 x86_64)


Any ideas how this can be fixed?
_________________
/* Insert funny quote */
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2144
Location: Europe

PostPosted: Thu Oct 25, 2007 7:42 pm    Post subject: Reply with quote

from which date is your catalyst portage snapshot?
_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Fri Nov 02, 2007 2:11 pm    Post subject: Reply with quote

Does catalyst support creating LiveUSB's? I assume not since booting live cd's off usb flash memory is not supported by the developers. But if you know how to do it it would be a great addition to the howto.

See https://forums.gentoo.org/viewtopic-t-590705-highlight-.html
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 731
Location: Brooklyn, New York

PostPosted: Fri Nov 02, 2007 4:20 pm    Post subject: Reply with quote

see www.gentoo.org/doc/en/liveusb.xml
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Mon Nov 05, 2007 3:50 pm    Post subject: Reply with quote

That how-to led to the problem I mentioned in the post I linked to. JackFrost showed me a work around but I would like to know if there is a cleaner way to do it. Specifically, if I can change some catalyst settings to target usb booting?
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2144
Location: Europe

PostPosted: Mon Nov 05, 2007 6:26 pm    Post subject: Reply with quote

not to my knowledge
_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 731
Location: Brooklyn, New York

PostPosted: Mon Nov 05, 2007 7:31 pm    Post subject: Reply with quote

tcostigl wrote:
That how-to led to the problem I mentioned in the post I linked to. JackFrost showed me a work around but I would like to know if there is a cleaner way to do it. Specifically, if I can change some catalyst settings to target usb booting?


no, you're best bet is to setup tinygentoo, google for it or search the wiki on it. I run a tinygentoo of my own on a usb stick loaded with extlinux.
Back to top
View user's profile Send private message
alienhunter3
n00b
n00b


Joined: 26 Jan 2008
Posts: 1

PostPosted: Sat Jan 26, 2008 12:33 am    Post subject: Reply with quote

i'm having a problem after i run
Code:
catalyst -f livecd-stage1.spec


here's a snippet of the error:

Code:

emerge --quiet --usepkg --buildpkg --newuse livecd-tools dhcpcd acpid gentoo-sources syslog-ng links dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs pwgen iputils hwsetup lvm2 evms wireless-tools app-misc/livecd-tools

!!! Error: the <sys-fs/udev-115-r1 package conflicts with another package;
!!!        the two packages cannot be installed on the same system together.
!!!        Please use 'emerge --pretend' to determine blockers.

!!! catalyst: Error in attempt to build packages


any suggestions? do you require more information for a diagnosis?

thanks
Back to top
View user's profile Send private message
jaylmaz
Tux's lil' helper
Tux's lil' helper


Joined: 18 Feb 2006
Posts: 80

PostPosted: Fri Feb 01, 2008 3:50 pm    Post subject: Catalyst-2.0.5 and UDEV Reply with quote

I'm trying to create a minimal livecd by following the [HOWTO] Create a live cd with Catalyst 2.0 in this forum. When I try to create the livecd-stage1, I get an error message about UDEV is blocked, cannot be installed with another package, run --pretend.
When I try the emerge --pretend (with all the packages Catalyst is trying to emerge), nothing shows up as blocked.
I'm trying to do this from a minimal fresh install, no use flags set. Maybe that's the problem?

All suggestions will be appreciated.
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 7825

PostPosted: Sat Feb 02, 2008 9:15 am    Post subject: Reply with quote

Merged the above post.
Back to top
View user's profile Send private message
Shamus397
Tux's lil' helper
Tux's lil' helper


Joined: 03 Apr 2005
Posts: 126
Location: Ur-th

PostPosted: Wed Feb 06, 2008 1:29 am    Post subject: Reply with quote

I'm running into this too when trying to make a stage1 CD install. It's udev-115-r1 blocking against device-mapper-1.02.22-r5. A quick look at the ebuild for device-mapper shows:
Code:
RDEPEND="!<sys-fs/udev-115-r1
                ${DEPEND}"

And, of course, the latest stable version of udev is 115-r1. So this looks like a bug in portage to me. Any devs care to comment? :)

EDIT:

It seems that you need to update udev from inside the chroot. So run catalyst, wait for the part where it says it will merge packages in reverse order and press a key when it says 'press any key within 15 seconds'. Then:
Code:
cd /var/tmp/catalyst/tmp/default/livecd-stage1-[arch]-[livecdname]
chroot . /bin/bash
emerge udev
exit

Then you can press any key again and it should get past the block. Apparently the udev from the 2007.1 snapshot is too old for the latest device-mapper and must be updated by hand. If you ask me, this is stupid and something that portage should be able to handle automatically--simply putting udev before device-mapper in the merge order would do it. *shrug*
Back to top
View user's profile Send private message
jaylmaz
Tux's lil' helper
Tux's lil' helper


Joined: 18 Feb 2006
Posts: 80

PostPosted: Wed Feb 06, 2008 4:02 pm    Post subject: Reply with quote

Quote:
It seems that you need to update udev from inside the chroot. So run catalyst, wait for the part where it says it will merge packages in reverse order and press a key when it says 'press any key within 15 seconds'. Then:
Code:
cd /var/tmp/catalyst/tmp/default/livecd-stage1-[arch]-[livecdname]
chroot . /bin/bash
emerge udev
exit


How do you actually do this? After it says "press any key within 15 seconds", it immediately continues when I try to cd /var/tmp etc.. since I'm pressing another key.
Back to top
View user's profile Send private message
jaylmaz
Tux's lil' helper
Tux's lil' helper


Joined: 18 Feb 2006
Posts: 80

PostPosted: Thu Feb 07, 2008 6:47 pm    Post subject: Reply with quote

Quote:
How do you actually do this? After it says "press any key within 15 seconds", it immediately continues when I try to cd /var/tmp etc.. since I'm pressing another key.


OK, got past this by opening another console, no more blocking problem.

But, now stage2 fails, callback fails. I'm not at home and don't have the whole error message. I can post more when I get home. What information should I post that would be the most useful in troubleshooting?

Thanks.
Back to top
View user's profile Send private message
aZZe
l33t
l33t


Joined: 20 Feb 2003
Posts: 955
Location: Dinslaken, Germany

PostPosted: Sun Feb 10, 2008 2:14 am    Post subject: Reply with quote

To fix the udev Problem do a chroot as Shamus397 has described in his post. But you don't need to press any key to stop the process. When the command fails first do the chroot, do a emerge --sync, then emerge udev an leave the chroot. Then run catalyst again.
_________________
ASUS 4A785TD-V EVO with AMD Phenom(tm) II X4 965
4GB RAM DDR3-1333
ATI Radeon HD4870
Back to top
View user's profile Send private message
energyman76b
Advocate
Advocate


Joined: 26 Mar 2003
Posts: 2025
Location: Germany

PostPosted: Fri Feb 15, 2008 10:37 pm    Post subject: Reply with quote

Hi,

I get this error:
* Messages for package x11-libs/gtk+-2.12.5-r1:

* Please re-emerge x11-libs/cairo with the X USE flag set
*
* ERROR: x11-libs/gtk+-2.12.5-r1 failed.
* Call stack:
* ebuild.sh, line 49: Called pkg_setup
* gtk+-2.12.5-r1.ebuild, line 54: Called die
* The specific snippet of code:
* die "cairo needs the X flag set"
* The die message:
* cairo needs the X flag set
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/x11-libs/gtk+-2.12.5-r1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/x11-libs/gtk+-2.12.5-r1/temp/die.env'.
*

!!! catalyst: Error in attempt to build packages


Traceback (most recent call last):
File "modules/generic_stage_target.py", line 1392, in build_packages
"Error in attempt to build packages",env=self.env)
File "/usr/lib64/catalyst/modules/catalyst_support.py", line 535, in cmd
raise CatalystError,myexc
CatalystError
None

!!! catalyst: livecdbuild aborting due to error.

!!! catalyst: Error encountered during run of target livecd-stage1

Catalyst aborting....

so how do I get catalyst to rebuilt the cairo package? Or accept the cairo package that I built with the X flag and copied in?

EDIT:

nevermind, the chroot did the trick. Thank you guys.
_________________
AidanJT wrote:

Libertardian denial of reality is wholly unimpressive and unconvincing, and simply serves to demonstrate what a bunch of delusional fools they all are.

Satan's got perfectly toned abs and rocks a c-cup.
Back to top
View user's profile Send private message
jaylmaz
Tux's lil' helper
Tux's lil' helper


Joined: 18 Feb 2006
Posts: 80

PostPosted: Thu Apr 03, 2008 1:57 pm    Post subject: Reply with quote

I have now managed to produce a livecd that will boot, but not do much else. I have attempted to X working and firefox. During stage2, I get an error that says both xorg-server and mesa must be built with the same nptl flag set. So I tried package.use with nptl set, no go, same error. Tried package.use with -nptl set, same error again.
I'm stuck, any suggestions?
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2144
Location: Europe

PostPosted: Tue Apr 08, 2008 10:19 am    Post subject: Reply with quote

Perhaps FAQ point two can help:
Quote:
(livecd stage2) I have changed files in the livecd's portage directory but it doesn't take effect.
If you change something in /root/catalyst/portage you must recreate live cd stage 1!

_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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