create a debian live image

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#31 Post by MeanDean »

part 3 is posted!

If anyone can help out with the proper commands to start the various desktop environments in the xnest window that would be swell. If not I will update them as I go along...

If anyone knows a better way of doing any of this, please share.

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#32 Post by Bro.Tiag »

MeanDean wrote:part 3 is posted!

If anyone can help out with the proper commands to start the various desktop environments in the xnest window that would be swell. If not I will update them as I go along...

If anyone knows a better way of doing any of this, please share.
Thanks.

OK, Xnest , installed on the host OS, the extractedfs OS or both? Also while in the chrooted filesystem.squashfs you then unmount /proc, /sys & /dev/pts then;
  • chroot fs mount -t proc none /proc
    chroot fs mount -t sysfs none /sys
    chroot fs mount -t devpts none /dev/pts
then Xnest -ac :1 &

And what can one do in the PART 3 - START A GRAPHICAL ENVIRONMENT ? Set up logins, run applications what not, just as if running in an emulator?

Cheers
ps - Me thinks that this is where I'd sort out my query I left you to CW's forum, right?

eazy24
Posts: 7
Joined: 2008-03-07 13:05

#33 Post by eazy24 »

Big tnx MeanDean,i am waited for this long time,i got my lenny livecd sucessfully built with all programs what i need included,but i didnt know how to include installer,so thanks again for this howto,its very very helpful :D

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#34 Post by MeanDean »

Bro.Tiag wrote:Thanks.
welcome!
OK, Xnest , installed on the host OS, the extractedfs OS or both?
Installed on your current OS, the one you are using. I guess I should mention that somewhere....just where... That does bring up a interesting thought - would it be possible to somehow start X or xnest from the chroot???
Also while in the chrooted filesystem.squashfs you then unmount /proc, /sys & /dev/pts then;
Yea, I did it that way to keep it separate steps. But if you wanted to leave those mounted, exit the chroot and then jump to step 3 it should be fine. Or in part2 if instead of chroot fs you just wanted to pass commands via chroot like chroot fs apt-get install beep then that is should be fine. Chroot works both ways. Either you can tell chroot to execute commands in a certain folder, like in part3 where we tell it to mount that stuff in the fs folder. Or you can simply 'change root' to a certain folder and you are working in that folder until you exit - like we do in part2.

I hope that made some sense... :)

I keep them as separate steps simply to have a process to follow depending on what I want to do, instead of trying to figure out what parts I need to skip. Keeps me from having to think about it. Do you think I should integrate part3 into part2? Or maybe make a separate post with them integrated together?How about if I made one post with part3 integrated and one post without part 3 integrated. Might be more sensible...
And what can one do in the PART 3 - START A GRAPHICAL ENVIRONMENT ? Set up logins, run applications what not, just as if running in an emulator?
Anything you want to do. You can do anything in any of the steps. Once you chroot you ARE in the new system so anything you do will apply to that new system. Install, remove, tweak, adjust, edit, add users, add groups, whatever.... The graphical environment is probably a more obvious(?) to adjust themes and so forth. But anything you want to do should be fine....if you blow it up then it isn't fine though. :)
- Me thinks that this is where I'd sort out my query I left you to CW's forum, right?
me thinks you are probably on your own with that one...
I wonder if it has to do with the 'live' user account conflicting with whomever you are trying to autologin. Not sure, but I would start by playing around with user accounts and trying to setup a new one to use for the autologin. If you figure it out I would be very interested in the solution!

* I also added back the part about copying resolv.conf since some may need it and it shouldnt hurt anything.
Last edited by MeanDean on 2008-04-09 20:09, edited 1 time in total.

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#35 Post by MeanDean »

eazy24 wrote:Big tnx MeanDean
big welcome!
As soon as I get a chance I will update the following howto about manually installing a livecd http://forums.debian.net/viewtopic.php?p=98455
of course, it is sort of a moot issue now :)

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#36 Post by Bro.Tiag »

MeanDean wrote:
Bro.Tiag wrote:Thanks.
And what can one do in the PART 3 - START A GRAPHICAL ENVIRONMENT ? Set up logins, run applications what not, just as if running in an emulator?
Anything you want to do. You can do anything in any of the steps. Once you chroot you ARE in the new system so anything you do will apply to that new system. Install, remove, tweak, adjust, edit, add users, add groups, whatever.... The graphical environment is probably a more obvious(?) to adjust themes and so forth. But anything you want to do should be fine....if you blow it up then it isn't fine though. :)
- Me thinks that this is where I'd sort out my query I left you to CW's forum, right?
me thinks you are probably on your own with that one...
I wonder if it has to do with the 'live' user account conflicting with whomever you are trying to autologin. Not sure, but I would start by playing around with user accounts and trying to setup a new one to use for the autologin. If you figure it out I would be very interested in the solution!

* I also added back the part about copying resolv.conf since some may need it and it shouldnt hurt anything.
OK, thanks. Man I hate that my day job interfears with fun.

I'll try a new user for the autologin & let ya know. Although there has to be a way to bring up the gui without having a login manager. I tryed searching the Debian Live Wiki, but again, work got in the way.

Cheers
btw - I still needed to copy my resolv.conf before chroot in order to apt-get. Although I've noticed that in time apt-get will work even if resolv.conf is not copied.

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#37 Post by Bro.Tiag »

MeanDean wrote:
eazy24 wrote:Big tnx MeanDean
big welcome!
As soon as I get a chance I will update the following howto about manually installing a livecd http://forums.debian.net/viewtopic.php?p=98455
of course, it is sort of a moot issue now :)
I still think it's needed & not a moot issue. Then again, I still have/use my floppy drive.

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#38 Post by Bro.Tiag »

Well dean, you know me & the whole root v. user issue, but I think that it's a permission issue within the home/user directory of the filesystem.squashfs. I think I've sorted it out, but will have to give it another test tonight. Still no autologin, but at least I can start the gui now from the user with out any errors.

Cheers

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#39 Post by Bro.Tiag »

Well, not sure that it's the best way, but I got the autologin sorted.

Cheers

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#40 Post by MeanDean »

well....share.....

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#41 Post by Bro.Tiag »

MeanDean wrote:well....share.....
As soon as I sort out exactly what I did, and can redo it I will.

Cheers

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#42 Post by MeanDean »

Actually, that does bring up a good point.

If you create anything when you are in the chroot then it needs to have the proper ownership/permission. If you create a folder in /home/user1 then you must chown/chgrp it properly.

If you want all users to have certain folders/settings then you are probably better off putting those things in /etc/skel and then creating users.

....at least that is my best guess/opinion :)

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#43 Post by Bro.Tiag »

MeanDean wrote:Actually, that does bring up a good point.

If you create anything when you are in the chroot then it needs to have the proper ownership/permission. If you create a folder in /home/user1 then you must chown/chgrp it properly.

If you want all users to have certain folders/settings then you are probably better off putting those things in /etc/skel and then creating users.

....at least that is my best guess/opinion :)
Aye, something along that line. I used adduser as well as passwd to set things up, but wound up with root privileges for everything in home/user. I change home/user privileges to user & that sorted things.

Cheers

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#44 Post by Bro.Tiag »

Bro.Tiag wrote:
MeanDean wrote:well....share.....
As soon as I sort out exactly what I did, and can redo it I will.

Cheers

OK, once you've finished mucking 'bout within the chroot fs but before ya exit try the following to get it to go straight to the gui.
adduser user

Code: Select all

Adding user `user' ...
Adding new group `user' (1000) ...
Adding new user `user' (1000) with group `user' ...
Creating home directory `/home/user' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for user
Enter the new value, or press ENTER for the default
        Full Name []: 
        Room Number []: 
        Work Phone []: 
        Home Phone []: 
        Other []: 
Is the information correct? [y/N] y
Open a console and then create the file autologin.c ;

Code: Select all

nano autologin.c
Add the following for user;

Code: Select all

int main() { execlp( "login", "login", "-f", "user", 0); }
Complie autologin.c

Code: Select all

gcc -o autologin autologin.c
mind your compiler.

Copy/move to some place useful;

Code: Select all

cp autologin /usr/local/sbin
Edit /etc/inittab

Code: Select all

nano /etc/inittab
search for this:

Code: Select all

1:2345:respawn:/sbin/getty 38400 tty1
Do this to it;

Code: Select all

#1:2345:respawn:/sbin/getty 38400 tty1
1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologin 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
Make it autostart:

Code: Select all

nano home/user/.bash_profile
Add thus at the bottom;

Code: Select all

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
       startx
fi
Now add .xsession;

Code: Select all

echo "path_to_what_ever_it_is_you_want_to_start" > home/user/.xsession
Change the permission stuff.

Code: Select all

chmod -R -v 0777 /home
mode of `/home' retained as 0777 (rwxrwxrwx)
mode of `/home/user' retained as 0777 (rwxrwxrwx)
mode of `/home/user/.config' changed to 0777 (rwxrwxrwx)
mode of `/home/user/.config/menus' changed to 0777 (rwxrwxrwx)
mode of `/home/user/.config/menus/applications.menu' changed to 0777 (rwxrwxrwx)
mode of `/home/user/.xsession' retained as 0777 (rwxrwxrwx)
mode of `/home/user/.bash_profile' retained as 0777 (rwxrwxrwx)
mode of `/home/user/.bash_logout' retained as 0777 (rwxrwxrwx)
mode of `/home/user/.bashrc' retained as 0777 (rwxrwxrwx)
I used 0777, but that's just me.

I'm sure that there is a better way, but this works.

Cheers

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#45 Post by MeanDean »

Bro.Tiag wrote: I'm sure that there is a better way, but this works.

Cheers
I wonder if you could just edit /etc/inittab and use -f user
1:2345:respawn:/bin/login -f user </dev/tty1 >/dev/tty1 2>&1
and then edit bash profile to startx...

so much fun stuff....so little time...

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#46 Post by MeanDean »

MeanDean wrote: As soon as I get a chance I will update the following howto about manually installing a livecd http://forums.debian.net/viewtopic.php?p=98455
It has been updated....some things have changed and may change again in the future so I have no idea how long it will be applicable. I tried to explain what I was doing so it will at least be a rough guide to follow. Basically it involves copying everything over except stuff that is dynamic and anything that should not be copied - use your best judgment - then edit fstab to look normal, install grub (if needed)...

User avatar
Bro.Tiag
Posts: 1937
Joined: 2007-06-02 19:14

#47 Post by Bro.Tiag »

MeanDean wrote:
Bro.Tiag wrote: I'm sure that there is a better way, but this works.

Cheers
I wonder if you could just edit /etc/inittab and use -f user
1:2345:respawn:/bin/login -f user </dev/tty1 >/dev/tty1 2>&1
and then edit bash profile to startx...

so much fun stuff....so little time...
Aye, that just worked. Mind you all I did was modify my /etc/inittab on my previous working auto login set up. But it did work. Also this was the first time I actually was able to boot to the gui in qemu.

Cheers
ps - stop editing your post's, you keep confusing me.
pss - so I guess I was not the only one with problems trying Xnest?

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#48 Post by MeanDean »

Bro.Tiag wrote: ps - stop editing your post's, you keep confusing me.
pss - so I guess I was not the only one with problems trying Xnest?
gotta keep up....!!!!

Well, i assume you are running as root so I am not sure how you would need to adjust anything. I don't have a problem running xnest but it ends up running the environment as root instead of a user.....trying to figure out how to explain how to start the environment as the desired user.

I think I am also going to put in about editing inittab to remove the autologin user.

trying to make this as universal as possible instead of someone having to create a certain user, and do certain things and just following along instead of being free to do what they want....probably failing miserably though...

Penguin Skinner
Posts: 709
Joined: 2005-09-15 20:37
Location: North by Northwest

Re: live-helper create image and customize environment howto

#49 Post by Penguin Skinner »

MeanDean wrote: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.is
Great how-to, Dean. One question: what is the correct format/syntax for the "myfavs" package list file? A brief example would be helpful. Can this list be created, for example, using dpkg or maybe apt-cache to generate a list of installed packages on an existing install?

User avatar
MeanDean
Posts: 3953
Joined: 2007-09-01 01:14

#50 Post by MeanDean »

Examples are in /usr/share/live-helper/lists :)

I think it can be packagnames seperated by a space or blank line So I guess something like:

Code: Select all

icewm medit audacious
or even

Code: Select all

icewm

medit

audacious
I think you can include other predefined package lists from /usr/share/live-helper/lists in your package list like so:

Code: Select all

#<include> standard-x11
icewm medit audacious
dpkg --get-selections could be used....I am more familiar with
dpkg-query -W --showformat='${Package} ' | sort -n >> packs.txt

Post Reply