Custom OS

From Hack Sphere Labs Wiki
Jump to: navigation, search




<babble> but have you seen remastersys? 
<babble> or there's a fork of it, called re-linux that's also under active development 
<webdawg_> Hmm.
<webdawg_> googling.
<webdawg_> That is very interesting.
<babble> it makes a 'livecd' (or live usb drive, or whatever) out of your installed debian (or ubuntu) system 
<webdawg_> That would make making your own custom distro real easy.
<babble> and THAT will do all the stuff the regular debian and ubuntu installer(s) do, including grub setup and user config 
<babble> it's how I back up my system 
<babble> I back up to a live bootable system every couple of weeks, so if I really bugger something, I can nuke my system and reinstall it 
<webdawg_> Can you boot live from the cd and use it like it was your own?
<babble> it's no different than booting a debian or ubuntu livecd :) 
<webdawg_> It can make a distributable copy you can share with friends.  This will not have any of your personal user data in it.
<babble> it just as all of your apps installed. 
<webdawg_> hmm.  I wonder if I can have it include my data.
<webdawg_> Im sure I can
<webdawg_> nice.
<babble> yes, it's distributable, no it won't have your home directory by default 
<webdawg_> ahhhh
<babble> there's a backup option in the script that optionally includes your home if you want 
<babble> or actually, it's a subset of /home/user with essential config files. 
<babble> or if you go the 'roll your own distro' option, it makes a generic livecd user with no personal info 
<babble> (I back up my home separately with rsync; this just saves me time and hassle reinstalling all of my apps) 
<babble> if you want to use it, let me give you a couple of workarounds. 
<webdawg_> Allright.
<webdawg_> Thanks.
<babble> if you make a live iso with it, include dists and pool from an existing debian live cd. 
<babble> the scripts in both remastersys and re-linux *don't* by default and Ubiquity will hang on install without them. 
<webdawg_> hmm
<babble> as long as everything in your system is newer, it won't actually install anything out of them, but the installer will hang looking for extras to install through apt without SOMETHING to scan 
<babble> and it will leave the resulting system unconfigured and unbootable if it crashes there. 
<babble> the script generates an ISOTMP folder that it uses to build the iso image; put dists and pool from your live installer in there, and regenerate the ISO and it'll install successfully 
<webdawg_> nice.
<babble> now the OTHER bit: 
<babble> if you're installing in place with an existing user folder in /home, it will again crash at the END of the install 
<babble> trying to configure /home/user
<babble> you can get around THAT by making a dummy user in the installer, then making your regular user again once you get to a desktop 
<babble> the regular Ubuntu installer does this gracefully (I've ALSO nuked my system and installed clean, with my home folder in place, using the regular Ubuntu installer) 
<babble> I'm not SURE what remastersys is doing differently, yet 
<babble> I haven't looked all the way through the build script 
<webdawg_> hmm
<babble> or just make your normal user (it won't overwrite your home folder) and just let it crash 
<babble> in that case, it's a trivial crash at the end, configuring .gconf
<babble> which it can't do, if there's a home folder named /home/youruser in place
<babble> but it doesn't matter, since the gconf database is yours already anyway, from the install 
webdawg_> aight.
<babble> (this all assumes Gnome; I dunno if it does something similar in KDE) 
<webdawg_> I wonder if it works with lxde
<webdawg_> err
<webdawg_> xfce
<babble> it should be desktop independent 
<webdawg_> Yeh.
<babble> I'm using Xfce :) 
<babble> it's not running anything specifc to Gnome necessarily 
<webdawg_> Right.
<babble> it's running dpkg on the installed squashfs image
<babble> like the Debian and Ubuntu gui installers do 
<babble> do you know how the livecd installer works? 
<webdawg_> Nope.
<webdawg_> Imma have to look into it.
<babble> okay, have time? 
<webdawg_> Yup.
<babble> I can tell you exactly what it's doing 
<webdawg_> Nice.
<babble> having destroyed my system multiple times experimenting with this. hehe. 
<babble> the way there's enough room on the cd for a bootable system with apps AND a full installation is that the installer doesn't install from packages, really  
<babble> yes, there are a few packages on there, for late additions and updates
<babble> but the bulk of the system is a compressed SquashFS image that the system mounts and uses as root when you're running off the live cd
<babble> OR Ubiquity copies the *exact same image* to your HD 
<babble> that's the 'copying files' step 
<babble> then it runs dpkg on the installed image to configure all of the applications from the dpkg defaults 
<babble> so if you're installing something that's using Gnome on the Live desktop, all the gnome configs get done. 
<babble> if you're using KDE on the live desktop, all the KDE configs get done. 
<babble> etc etc etc
<babble> it doesn't matter *what* the specific package set is, it just runs dpkg on the copied image 
<webdawg_> hmm
<babble> that's how remastersys can make an installable 'distro' out of YOUR system 
<babble> it just builds a squashfs image out of your installed system folders. 
<webdawg_> Seems simples.
<webdawg_> simple.
<babble> it's handy, for sure. 
<webdawg_> I wonder how it handles all the predone config files.  Must not proccess the dpkg.
<babble> if you've got various custom configs in /etc, for example, you can make a 'distro' that installs YOUR configs 
<webdawg_> Yeh./
<babble> no, that's exactly what dpkg DOES do 
<webdawg_> Ohh.
<webdawg_> Reads the configs?
<babble> dpkg-reconfigure reruns dpkg and builds from dpkg templates unless there's a custom config file in place. 
<babble> dpkg is more than just a list of installed applications. 
<babble> it's a whole database in place 
<babble> that tracks all sorts of stuff 
<babble> including a default config image supplied by the package 
<webdawg_> What database type does it use?
<babble> you know, I'm not entirely sure. 
<babble> I think it's SQLite but don't quote me. 
<babble> dpkg is ooooooold 
<babble> as old as debian itself nearly 
<babble> lemme see if I can find what it uses under the hood. 
<webdawg_> AIght.