Live-build

NetInstall >

updated June 2020

Back in 2012, I was trying everything I could do to get a customised Live CD put together so that I could start installing Debian on other PC's. I spent a long time learning how to use Live build, and I tweaked it so that I could make a Live CD with about 95% of the apps and config I wanted. But then how about updating the Live CD? It required another build process over the internet that could take hours (it's a lot faster with apt caching though).

But what if you install a heap of apps that a user will want to remove? That could be a waste of time. Better, I think, to make a basic Live CD to install a base system with the bare minimal needed for a desktop and internet connectivity, and then install other packages later on, per user requirement. You could even include some guides to installing software.

If you want to install with a much larger choice of software ready to go, it would be better to build that system in a real desktop, with all your menus and other tweaks, and then run refractasnapshot (see my system backup page) on it, to make a Live CD from the installed system.

So my strategy would be:
1. Initially, Netinstall/Server ISO or Live Build or Debootstrap followed by system backup with dd - minimal base install (easy to keep cleaning and re-building it)
2. Later, Refractasnapshot - a grander Live CD with much more choice installed.


Man page: http://live-systems.org/manual/...
useful read: live-manual/customization-overview....


1. install

 
and it will be essential to make sure you have these installed too:
 

now find some space on a partition where all the live-build work will take place (up to 4Gb for basic) and run the initial setup command, `lb config`:
 
(that will build the basic config tree)




2. Congfigure the live cd build

The command is run with options to build what you want:

example 1.
 

example 2.
 

example 3.
 

You can keep using `lb config` with different parameters to set up the configuration before building -but note that you can't override one that's been set unless you do a `lb clean` -it is better to use an auto script (see below).

The "chroot" mirror is where packages will come from and the "binary" is what the Live CD will be set to (chroot mirror should default to --mirror-bootstrap). See http://manpages.ubuntu.com/

The 686 flavour with amd64, is essential for the live installer to work, or else you will just have a Live CD without installer, so the man page says.


Or use an auto script
All config options can be put into an auto script so that you only need to run `lb config` and the options are set from the script.
http://live-systems.org/manual/...

 

edit auto/config to look something like this -adapt to your preference, with amd64/686 or whatever. Here's how it looks with my example 3,
 


The script is read when lb config is run. but you may need to run `lb config --conffile auto/config`

I set the mirrors to devuan and lb config still set up for a Debian Jessie build. So following that you will need to edit the files in config/ to enable a devuan build.

config/binary LB_BOOTAPPEND_LIVE="boot=live components keyboard-layouts=us,us keyboard-variants=colemak username=bob"

to set the keyboard to colemak and change username for live

set Disribution to Devuan and mirrors to
http://deb.devuan.org/merged chimaera
http://deb.devuan.org/merged chimaera-security
http://deb.devuan.org/merged chimaera-updates


config/build
Mirror-Bootstrap: http://deb.devuan.org/merged chimaera

config/chroot
LB_SECURITY="true"
LB_UPDATES="true"

config/common
LB_APT_HTTP_PROXY="http://localhost:3142/"
LB_APT_RECOMMENDS="false"

The proxy line is for Apt-cacher-ng APT proxy.

Note: to speed up the process and avoid downloading all the packages again and again with each new build attempt, it is highly recomended that you set up a good APT caching proxy that live-build will retrieve packages from (and being downloaded already through the proxy they are kept in the proxy cache to be retrieved much faster the next time).

See my APT proxy page for notes how to do that.




3. Add package name lists before the build


su to root and run these in the build directory, to create lists which will be used to install whatever you need added to the build:

First of all, those needed for successful build as some are possibly excluded by the "no-recommends" option, and the dependencies for live-build (need to be installed into the chroot system before creation of the squash filesystem and ISO).
 


then do either
1. minimal LXDE install

or
2. plain openbox install
The problem with a plain -no DM- install is that the live ISO may have problems at login or launching Xorg. So it might be advisable to add a DM, such as lightdm.

3. Ranger


If you are making a Live CD for a basic install (further packages to be added post-install) then no point in making the build too complex or over-sized, and I would leave it at that.

but if you have ny othe specific areas of packages needed, such as samba, then you can create more package lists like these.


http://live-systems.org/manual/...




4. Add other/customised packages

You can put .deb archives in config/packages.chroot, such as any packages made from source (compton, checkinstall etc)

! Check the packages names with running dpkg-name *.deb in the dir as they must comply to be included.
http://live-systems.org/manual/...

Some packages might snag the chroot stage, giving an error such as: /usr/bin/env: 'gpg': No such file or directory


Package pinning
with thunar a few years back, the latest was found in experimental, but it had so many dependencies it failed to install just using packages.

Therefore it was necessary to pin it to the experimental repository, with all other packages defaulting to the config repository, like this
 

 

add this content
 


Omit a package from the build
-say, if it is a recommended package or installed by a metapackage, you give it a negative Pin-Priority in config/apt/preferences,
 
 

see: .../customizing-package-installation.en.html#466






5. Add files to be included in the Live cd

If you'd like to customize the Live CD environment, with autostart, no recommends files etc, you simply add the files to config/includes.chroot directory with the same dir tree as they need in a real file system.



http://live-systems.org/manual/...


Set groups for the Live user
make a file
 
and fill with [include whatever groups you require]
 



6. Building the live cd

to run live build, cd to my_live_build and enter (sudo or as root)
 

and this command can be split into four parts:
 
where bootstrap caches all the necessary packages
chroot unpacks and installs them and carries out tasks in the chroot env
binary creates a squashfs compressed archive
source puts it into a bootable ISO image


to cleanup the working directory to build again
 

to build again with changes to config (this cleans chroot so all the packages will need unpacking again with the next build)
 

to build with interactive options
 


The iso file will be created (if successful) in the "my_live_build" directory, which just needs (renaming and) burning to disk or sending to a usb stick.

remember that to login the live CD, user=user, passwd=live


You can make a live build from your installed system with (haven't tested it myself)
 
But this won't build a devuan system




Build Notes



Install problems
 





Simple-CDD

http://wiki.debian.org/...
 

Firstly, make a working directory where you've got some space
 

this is the basic build command, which may be out-dated by now:
 
fill in your own preferred mirror!

to make the profiles file (with package names), in my-simple-cdd dir:
 


simple-cdd defaults to just using main, so to also use contrib and non-free, put this in profiles/default.conf:
 



lastly, invoke simple-cdd to pull from approx cache
 

Home | Content | Site Map | TOP