Page: 1, 2  Next

Build from scratch: debootstrap, chroot and smxi
dzz
Status: Interested
Joined: 15 Sep 2008
Posts: 44
Location: Devon, England
Reply Quote
I am experimenting with building Debian (currently Lenny) from scratch, using debootstrap and a chroot. Good success, from that method I got a proper installation and a livecd.

I suppose I'm just fed up with "distros" and want my own customised Debian. I looked at remastersys and debian-live. Neither did quite what and how I wanted, or had other problems.

For obvious reasons smxi would be great asset to building such a system, in a similar way to using Debian bizcard as the base. However, smxi, not being designed to be called in a chroot, will shut down the host desktop.

Is there any possible workaround to do that, without killing X?
Back to top
eriefisher
Status: Contributor
Joined: 21 Jun 2008
Posts: 59
Reply Quote
WOW! This sounds like a cool idea. smxi could help build the system nicely.

About X shutting down, what about building in a VM(vitualbox or vmware). This would avoid shutting down the host X server.

I wonder if H2 could modify smxi just for this reason(chroot-smxi)?
Back to top
dzz
Status: Interested
Joined: 15 Sep 2008
Posts: 44
Location: Devon, England
Reply Quote
I would not ask our tech admin to mod the script, more looking for ideas with what we have.

Since last post I tried outside X, smxi in a basic debootstrap chroot (with grub and kernel). It worked as hoped, got smxi fully-function. A few, fixable blips. I used the result for a livecd with decent defaults and remastersys installer built-in.

I did wonder about doing this in vb. The vm would have to be very large also if a livecd is wanted the building of squashfs gets cpu-intensive. No machine here is fit for that

I (very scrappily) documented the process, if anyone is interested.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
If there were some way to identify the presence of a chroot base for the smxi install, sure, otherwise it would just be abused by people trying to avoid the x check routine, then their systems would break, and then they'd come asking here and irc for help, and after 15 or 30 minutes they might or might not admit that they upgraded in X, didn't restart the desktop, and lost everything. That's what used to happen in kanotix days before I added the X kill feature.
Back to top
dzz
Status: Interested
Joined: 15 Sep 2008
Posts: 44
Location: Devon, England
Reply Quote
No need for that. I suppose this is a rather unusual use of smxi

It's easier than I first thought to do the job outside X anyway. Forgetting commands and paths is the only problem, when one's notes are harder to get at.
Back to top
sickie
Status: Interested
Joined: 17 Jun 2009
Posts: 19
Reply Quote
:: dzz wrote ::
...
I (very scrappily) documented the process, if anyone is interested...

I'm interested. I built a live-cd + debian-installer (I used lh_scripts) already in a virtual machine but Im interested in alternative methods.
Back to top
dzz
Status: Interested
Joined: 15 Sep 2008
Posts: 44
Location: Devon, England
Reply Quote
I'm not saying debian-live is not good I just never got my head around how to use it. I thought I had, then I ended up with 4 kernels, the chroot disappeared, what I got was yet again someone elses defaults. Started again for the 10th time. Also, as much as I like Debian, the official installer is a PATA. I started looking at alternative, non-distro-specific, solutions.

I investigated remastersys geekconnection.org/remastersys/ As interesting as that project is, that method is not designed for "build from scratch". However i found from there geekconnection.org/remastersys/capink.html That info proved to be mainly correct. I made a set of bash scripts to do the entire job based on that.

My scripting ability is extremely minimal and probably full of horrible quirks, however I ended up with a very nice livecd, exactly as I wanted, with working GUI installer. (remastersys installer works without using the other bits) I have yet to find a problem with my result.

It would be good if someone with reasonable bash experience could clean up my effort, however I am well accustomed to being in a minority of 1 in this world.

I can probably not post my script set here as it is a tar of some MB (maybe I could mail it arranged via a PM, or at some stage I could host it somewhere) The link above is mostly what you need to know anyway.

After you do a debootstrap you need to mount /dev and /proc, copy in resolv.conf sources.list and hosts. You can then chroot it. Use apt, install locales, keymap, grub, a kernel, and build from there as if it's a real system, using (with X closed) smxi if you want. An "approx" server really helps. Copy it all to a partition and/or make a livecd.

Who needs 3rd party distros when that is possible? Some 3rd party scripts sure help though.
Back to top
sickie
Status: Interested
Joined: 17 Jun 2009
Posts: 19
Reply Quote
Thanks. I'll make a note of your post so next time I'll be building a live-cd (maybe when squeeze gets stable) with that method.
Building with live helper was very easy following those instructions on Debian forums. I like it because I prefer debian installer over installers in a live environment and actually this time I needed it as I built a customized system for a friend of mine whose machine have very little ram. What I don't like in live helper is that I had to delete the normal user before building the live cd or the installer would recreate him instead of making a new one.
Overall I'm pleased of my custom Lenny.
Back to top
dzz
Status: Interested
Joined: 15 Sep 2008
Posts: 44
Location: Devon, England
Reply Quote
:: Quote ::
If there were some way to identify the presence of a chroot base

I needed for myself a check for chroot, realising that a command meant for chroot might do horrible damage if executed by mistake on the main system.

The only way I found was
:: Code ::
ls -1A /home | wc -l

which will return the number of files/directories in /home. If you are in a debootstrap it will be 0, since no users exist yet.
Back to top
aus9
Status: Assistant
Joined: 21 Sep 2008
Posts: 358
Location: Australia
Reply Quote
dzz

if keeping notes is a problem, why not control + alt + 2 and login to a second terminal or more and cat the file?
cat /root/mynotes

yes verrry ms...lol

2) But I would like to do slight hijack to my experience of goingeasy9's way of netinstall.

In australia isp download upload speeds tend to be slow.
to do a min. install then use net with or without smxi to apt-get your packages takes too long for me.

I have reverted to sidux ...running on momos xfce preview .

Install takes about 5 minutes, then run packagesearch to find what is installed..then I run apt-get remove --purge string*

and press n for no more frequently than y...but fine tune with
string-app*....or string-app-fullname and I can cut most of the junk out. I then add LXDE and some other stuff.

I have not total timed it, but I feel its a lot easier for most ppl to try this way...especially if they have slow net?

regards
Back to top
Display posts from previous:   
Page: 1, 2  Next
All times are GMT - 8 Hours