Debian User Forums Forum Index Debian User Forums
Go to Debian website
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   You have no new messagesYou have no new messages   Log out [ Bro.Tiag ]Log out [ Bro.Tiag ] 

live-helper create image and customize environment howto!
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    Debian User Forums Forum Index -> Docs, Howtos, Tips & Tricks
View previous topic :: View next topic  
Author Message
MeanDean



Joined: 31 Aug 2007
Posts: 1205

PostPosted: 2008-04-05 19:21    Post subject: live-helper create image and customize environment howto! Reply with quote

CREATE A LIVE IMAGE USING LIVE-HELPER

You should have the following installed:
live-helper - recent version

basic commands are:
lh_config - creates the configuration file, this is where you specify desktop, architecture, extra software, include installer, and so forth.
lh_build - command to start the build

some other commands are:
lh_clean --binary use this to clean things up before building another image using the same config
lh_clean use this to clean things up before building another image when the config has changed
lh_clean --purge use this to do a super-clean, this will purge all packages from the cache

some lh_config options:
-p use a package list from /usr/share/live-helper/lists or specify your own file
-d specify the distribution (etch/lenny/sid)
-a specify the architecture (i386/amd64/?)
--debian-installer=businesscard include the business card installer
--debian-installer=enabled include the installer
--packages specify packages you want to include

Now for the fun part....some examples:
open a terminal
su to root or sudo appropriately

The following commands will build a sid live image for i386 with gnome-core predefined package list and medit
mkdir livebuild
cd livebuild
lh_config -d sid -a i386 -p gnome-core --packages medit
lh_build

when it is done, look in the livebuild folder for the binary.iso


The following commands will build a lenny live image for i386 with kde predefined package list

mkdir livebuild
cd livebuild
lh_config -d lenny -a i386 -p kde
lh_build

when it is done, look in the livebuild folder for the binary.iso

The following commands will build a sid live image for i386 with gnome-core predefined package list and medit
mkdir livebuild
cd livebuild
lh_config -d sid -a i386 -p gnome-core --packages medit
lh_build

when it is done, look in the livebuild folder for the binary.iso


The following commands will build a lenny live image for amd64 with kde predefined package list, audacious and the debian installer

mkdir livebuild
cd livebuild
lh_config -d lenny -a amd64 -p kde --packages audacious --debian-installer=enabled
lh_build

when it is done, look in the livebuild folder for the binary.iso

The following commands will build a sid live image for i386 with studio-xfce predefined package list, cowsay and the debian installer
mkdir livebuild
cd livebuild
lh_config -d sid -a i386 -p studio-xfce --packages cowsay --debian-installer=enabled
lh_build

when it is done, look in the livebuild folder for the binary.iso

The following commands will build a lenny live image for i386 with myfavs package list and the debian installer
mkdir livebuild
cd livebuild
lh_config -d lenny -a i386 -p myfavs --debian-installer=enabled
lh_build

when it is done, look in the livebuild folder for the binary.iso

IMPORTANT
This howto does not even scratch the surface of what you can do with live-helper. You can inject files into the build so if you had some custom config files you wanted in the build. You can call a interactive shell during the chroot stage to tweak things. You can use custom repos or even a local repo. man lh_config gives you the multitude of options available and the wiki and mailing list provides plenty more info and help...
http://wiki.debian.org/DebianLive/FAQ
http://wiki.debian.org/DebianLive/Examples
http://wiki.debian.org/DebianLive/Configuration
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel/

FYI
fyi - a basic GUI called live-magic is available in lenny/sid for building live images

fyi - you can also just download a prebuilt image from http://live.debian.net/cdimage/


Last edited by MeanDean on 2008-04-15 11:55; edited 27 times in total
Back to top
View user's profile Send private message Send e-mail  
MeanDean



Joined: 31 Aug 2007
Posts: 1205

PostPosted: 2008-04-05 19:24    Post subject: Reply with quote

METHODS TO CUSTOMIZE THE USER ENVIRONMENT

Probably the best way to customize the user environment is to use live-helper to inject the files into the build. I am not familiar with that method but it is probably the 'right' method to use!
Some good info about it here
http://wiki.debian.org/DebianLive/FAQ#head-b01328e3d5e76c7ca04f7266fc813079dd350520
and more here
http://wiki.debian.org/DebianLive/Howto/Customising_Using_QEMU


A couple other ways to do it are:

1 - Unpack the iso you made with live-helper, unpack the squashfs, chroot into the squashfs, su to the user you want to configure, startup the environment in a Xnest window. see the next post for this method

2 - Create a new user on your current system. Login as that user. Customize anything you wish. Save the config files that are created in /home/username. Now unpack the iso you made with live-helper, unpack the squashfs, move those config files to /etc/skel then chroot into the squashfs and create a new user and that user automatically inherits those config files. Bascially it is the same method as 1 but you simply skip the xnest part and instead move the config files and create a new user.


Last edited by MeanDean on 2008-04-15 11:54; edited 30 times in total
Back to top
View user's profile Send private message Send e-mail  
MeanDean



Joined: 31 Aug 2007
Posts: 1205

PostPosted: 2008-04-05 19:32    Post subject: Reply with quote

CUSTOMIZE A USER ENVIRONMENT FOR THE LIVE IMAGE USING XNEST

as a user
binary.iso is on the Desktop
open terminal
su to root

cd Desktop
mkdir iso
mkdir temp
mount binary.iso -o loop temp/
cp -a temp/* iso/
umount temp/

mount -t squashfs -o loop iso/live/filesystem.squashfs temp/
mkdir fs
cp -a temp/* fs/
umount temp/
rm -rf temp/

rm iso/live/filesystem.squashfs

Xnest -ac :2 &

ignore the xnest window for now, we will use it later
if :2 does not work then use a different number
just be sure to use the same number later also

cp /etc/hosts fs/etc/
cp /etc/resolv.conf fs/etc/

chroot fs mount -t proc none /proc
chroot fs mount -t sysfs none /sys
chroot fs mount -t devpts none /dev/pts

chroot fs
export LC_ALL=C

You are now using the CLI in the system you want to customize.
You are root and all that implies.
I usually add software, add users, set passwords, edit files, etc...

switch to the user whose environment you want to customize
su username

Now you can start the graphical environment in the xnest window.
if you have e17 installed then start it with the following command
env DISPLAY=":2" enlightenment_start &
or if you have icewm installed then start it with the following command
env DISPLAY=":2" icewm-session &
or if you have fluxbox installed then start it with the following command
env DISPLAY=":2" startfluxbox &
or if you have a environment that is very 'component-ized' then you probably need to startup the seperate components
env DISPLAY=":2" sawfish &
env DISPLAY=":2" pypanel &


You should see the environment startup in the xnest window.
Make whatever changes you wish then logout of environment.
Close the xnest window.

exit the user su
exit

exit the chroot
exit

chroot fs umount /proc
chroot fs umount /sys
chroot fs umount /dev/pts
chroot fs rm -rf /tmp/*

rm fs/etc/resolv.conf
rm fs/etc/hosts
touch fs/etc/resolv.conf
touch fs/etc/hosts


mksquashfs fs/ iso/live/filesystem.squashfs

mkisofs -r -V "cd" -cache-inodes -J -l -o newcd.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table iso/

if you copy/paste the above commands be sure not to have a space after the \

newcd.iso should be on your desktop...but is owned by root so we need to chown/chgrp it
chgrp YourUserName newcd.iso
chown YourUserName newcd.iso


you can test your newcd.iso using qemu
qemu -cdrom newcd.iso

If you aren't happy with newcd.iso (forgot to include something or forgot to tweak something)
delete newcd.iso and you can keep the work you have done so far
start back at rm iso/live/filesystem.squashfs

otherwise remove the following folders
rm -rf fs/
rm -rf iso/


exit

All done!


FYI
fyi - The file fs/etc/inittab is setup to automatically login the 'user' user when running live. Edit the file if that is not the desired behavior. You can edit inside the chroot or outside - but you need to have root privys

fyi - you can open a filemanager as root and move custom content from your system to the fs/ folder at any time but I would suggest doing it before you start chroot'ing


Last edited by MeanDean on 2008-04-15 11:26; edited 36 times in total
Back to top
View user's profile Send private message Send e-mail  
Bro.Tiag



Joined: 02 Jun 2007
Posts: 524

PostPosted: 2008-04-05 19:45    Post subject: Reply with quote Edit/Delete this post

Well I can confirm that at least the binary.iso was built in the time it tock you to make this post. Now as to whether it's bootable, I'll let ya know once my cd-rw is finished writing & I've tested it.

Cheers
Back to top
View user's profile Send private message  
Bro.Tiag



Joined: 02 Jun 2007
Posts: 524

PostPosted: 2008-04-05 19:55    Post subject: Reply with quote Edit/Delete this post

Bro.Tiag wrote:
Well I can confirm that at least the binary.iso was built in the time it tock you to make this post. Now as to whether it's bootable, I'll let ya know once my cd-rw is finished writing & I've tested it.

Cheers


You've got to be kidding! I'm back & can confirm that it does make a LiveCD that quickly. I'd like to say I'm posting from said LiveCD, but I figured the 19 sec reboot to sid would be faster then my sorting out links to post a reply.

Well done Dean, Well Done!

Cheers
Back to top
View user's profile Send private message  
MeanDean



Joined: 31 Aug 2007
Posts: 1205

PostPosted: 2008-04-05 20:46    Post subject: Reply with quote

Now that you have the basic idea, some great examples are listed here
http://wiki.debian.org/DebianLive/Examples

I test the images using qemu
qemu -cdrom binary.iso

The guy to thank is Daniel Baumann for his awesome work! live-helper is amazing IMO, as simple or as complex as you want to make it.

The debian live mailing list is a superb mailing list to subscribe to!
Back to top
View user's profile Send private message Send e-mail  
Bro.Tiag



Joined: 02 Jun 2007
Posts: 524

PostPosted: 2008-04-05 21:01    Post subject: Reply with quote Edit/Delete this post

MeanDean wrote:
Now that you have the basic idea, some great examples are listed here
http://wiki.debian.org/DebianLive/Examples

I test the images using qemu
qemu -cdrom binary.iso

The guy to thank is Daniel Baumann for his awesome work! live-helper is amazing IMO, as simple or as complex as you want to make it.

The debian live mailing list is a superb mailing list to subscribe to!


Go on dean, you did the second hardest part, reading. Thanks.

I'm working through a package list I want to include. That seems to be the long part right now. Should have a nice new LiveCD tonight, least I run out of beer.

Cheers
Back to top
View user's profile Send private message  
Bro.Tiag



Joined: 02 Jun 2007
Posts: 524

PostPosted: 2008-04-06 00:33    Post subject: Reply with quote Edit/Delete this post

Hum, things seemed to work OK. But somehow I wound up with a gnome desktop & not e17. Me thinks you tricked me. Very Happy I'll sort it out tomorrow.

Cheers
ps - this time I am posting from said LiveCD.
Back to top
View user's profile Send private message  
MeanDean



Joined: 31 Aug 2007
Posts: 1205

PostPosted: 2008-04-06 00:59    Post subject: Reply with quote

Bro.Tiag wrote:
But somehow I wound up with a gnome desktop & not e17.

too much beer?
Back to top
View user's profile Send private message Send e-mail  
Noven



Joined: 17 Mar 2007
Posts: 189

PostPosted: 2008-04-06 01:38    Post subject: Reply with quote

How would I make a Lenny livecd with openbox and that uses gdm? I know I can add packages with --packages, but how do I have those packages automatically configured, IE: pypanel is installed, but configured to start when openbox starts, or tilda is installed, but has a certain configuration and starts upon login.
_________________
Back to top
View user's profile Send private message  
Bro.Tiag



Joined: 02 Jun 2007
Posts: 524

PostPosted: 2008-04-06 06:14    Post subject: Reply with quote Edit/Delete this post

MeanDean wrote:
Bro.Tiag wrote:
But somehow I wound up with a gnome desktop & not e17.

too much beer?

Is there such a thing?

Actually, I used the package list from yur sid-e17 LiveCD, but must have missed removing something gnome related.

Cheers
Back to top
View user's profile Send private message  
ingo



Joined: 15 Apr 2007
Posts: 180
Location: capital of beer

PostPosted: 2008-04-07 14:47    Post subject: Reply with quote

Yeah, live-helper is nice but I am not sure to what extend I can customise my live CD with it. I am not saying that it isn't possible, but I can't see the wood for all the trees at the mo...

You see, I've got a splashy theme (I know...), a kdm theme, a ksplash theme, a totally different looking kde desktop not using any of the menus out there but my own and I only know how to do that by mounting the squashfs from a normal live CD (building as I type), chrooting into it and doing it all from there.

Having said that - I am not sure how to pack the squashfs into the new iso again, but that cannot be too difficult Rolling Eyes

Anyway, thank you MeanDean for getting this rolling!

Hm, just read that lh_config starts a proper config file. One should be able to do a fair amount of tweaking there... Got to look into it.
_________________
AMD Athlon XP 2600+ - nVidia GeForce FX 5200 - 1024MB Ram on Debian Lenny / T41 on Kubuntu 7.10
Back to top
View user's profile Send private message  
MeanDean



Joined: 31 Aug 2007
Posts: 1205

PostPosted: 2008-04-08 08:54    Post subject: Reply with quote

part2 is done...I think...

feel free to ask any questions (even i f I do crack a joke about your sweaty little hand)

need any or all the sections explained then just let me know but don't forget that man is your friend too and is always there to help you

Laughing
_________________
How to ask questions the smart way!
Back to top
View user's profile Send private message Send e-mail  
MeanDean



Joined: 31 Aug 2007
Posts: 1205

PostPosted: 2008-04-08 09:01    Post subject: Reply with quote

ingo wrote:

You see, I've got a splashy theme (I know...), a kdm theme, a ksplash theme, a totally different looking kde desktop not using any of the menus out there but my own and I only know how to do that by mounting the squashfs from a normal live CD (building as I type), chrooting into it and doing it all from there.

Having said that - I am not sure how to pack the squashfs into the new iso again, but that cannot be too difficult

part2 is where I would probably start integrating my custom stuff and then I would finish it up in part3 if I needed to do more

extract the filesystem contained within the squash to folderX, move the stuff in, chroot in, configure and tweak, exit chroot, then simply squash folderX again with mksquashfs folderX/ path/to/filesystem.squashfs

hope this helps....always welcome...
_________________
How to ask questions the smart way!
Back to top
View user's profile Send private message Send e-mail  
ingo



Joined: 15 Apr 2007
Posts: 180
Location: capital of beer

PostPosted: 2008-04-08 09:03    Post subject: Reply with quote

Funny you should say that Wink

I made myself a basic lenny kde cd last night (weyhey!), so far so good. I checked the man pages and found them to be either non-existent or just as helpful - but that is just me, my brain is not sufficiently geeky to make sense of ANY man pages (I can just about make sense of the flags...).

Anyway, I have a working system to play with. Aim is to mount the squashfs, chroot into it, mount proc and sys, get on the net and do what a man has got to do - no sweat.

If you could now supply me with the proper mkisofs command to tie my work up and pack it into a nice iso I'd be more than grateful!!! I'd like to extract it from live-helper but that is a closed book as far as I am concerned...

Right, time to crack your jokes Embarassed
_________________
AMD Athlon XP 2600+ - nVidia GeForce FX 5200 - 1024MB Ram on Debian Lenny / T41 on Kubuntu 7.10
Back to top
View user's profile Send private message  
Display posts from previous:   
Post new topic   Reply to topic    Debian User Forums Forum Index -> Docs, Howtos, Tips & Tricks All times are GMT - 4 Hours
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5
Stop watching this topic
 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum


Powered by phpBB 2.0.21-6fdn4 (Debian) © 2001, 2005 phpBB Group