A year ago, in Aug 2012, I was trying everything to get a customised Live CD put together so that I could start installing Debian on other PC's (my friends' not any odd person's). I spent a long time learning how to use Live Helper, and tweaked it so that I could get a Live CD to install with about 95% of the apps and config I wanted. But then how about updating the Live CD? Another build process over the internet that can take hours.
More recently I've had success with refractasnapshot (system backup page), which makes a Live CD from an installed system. So from the system installed with my Live Helper-made Live CD, which I upgraded and dist-upgraded, and tweaked with all the config I wanted, I made a snapshot of it and now I have a grand "2nd generation" Live CD.
So, if you were to use Live Helper, you probably shouldn't spend so much time getting the config files into it, but try to build a basic Live Debian to install on a test-bed partition. Then boot into that and make all the fine tuning you need. Finally build your 2nd and better Live CD with refractasnapshot.
Cloning the apt-cache!
I've been pondering on the task of installing Linux (Debian wheezy LXDE) to remote laptops (zero internet connectivity), but having a connected laptop at base.
Obviously, a customised Live CD would be the ideal option of installing the system with all the app's needed.
Otherwise, I could "clone" my install on the connected laptop by using the same Live CD on the remote PC's and copying the apt index and apt cache onto them. But would it work?
On connected laptop (a)
on remote laptop (b)
Future update of laptop (b) should be possible too.
This page here http://gnuser.wordpress.com... is very helpful method for installing packages on a PC with no internet connection. If it is an unknown Debian install, or it's out of date, or out of sync with the connected machine (a), then it would be necessary to find out which packages are needed as there may well be many more needed than the base PC (a) needs.
Methods to test for remote Debian installs
sudo apt-get install simple-cdd approx
make a build directory, my-simple-cdd, cd there
make a working directory where you've got some space
this is the basic build command:
build-simple-cdd --dist wheezy --debian-mirror http://cdn.debian.net/debian --profiles NAME
fill in your own preferred mirror!
to make the profiles file (with package names), in my-simple-cdd dir:
for p in <packages to include> ; do echo $p >> profiles/NAME.packages ; done
simple-cdd defaults to just using main.
so to also use contrib and non-free, in profiles/default.conf:
mirror_components="main contrib non-free"
set up approx to cache packages http://www.debianadmin.com/...
I still can't get this to work.
set the mirror and un-comment the lines
sudo nano /etc/approx/approx.conf
import the apt cache into approx cache (only if deb files are recent)
sudo approx-import /var/cache/apt/archives/*.deb
sudo service networking restart
sudo service openbsd-inetd restart
invoke simple-cdd to pull from approx cache
build-simple-cdd --dist wheezy --debian-mirror http://localhost:9999/debian --profiles NAME
add sid snapshots to sources listsu
sh -c 'echo "deb http://live.debian.net/debian/ sid-snapshots main contrib non-free" >> /etc/apt/sources.list'
wget http://live.debian.net/debian/project/keys/archive-key.asc -O - | apt-key add -
apt-get install live-helper
now find some space on a partition where all the live-build work will take place
mk dir my-livecd
(that will build the basic config tree)
2. Congfiguring how the live cd will be built
lh config --architecture i386 -d wheezy -p lxde --archive-areas "main contrib non-free" --debian-installer live
lh config -d squeeze -p xfce --archive-areas "main contrib non-free" --debian-installer live --linux-flavours 686
lh config --mirror-bootstrap "http://cdn.debian.net/debian/" --mirror-chroot "http://cdn.debian.net/debian/" --mirror-chroot-security "http://security.debian.org/debian/" --apt-recommends disabled --architecture i386 --linux-flavours 486 --archive-areas "main contrib non-free" -d wheezy --debian-installer live --apt aptitude
You can keep using "lh 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 "lh 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 486 flavour with i386 architecture, or 686 with amd64, is essential for the live installer to work, or else you will just have a Live CD, so the man page says.
-Use an auto script
All config options can be put into an auto script so that one only needs to run "lh config" and the options are set from the script.
cp /usr/share/doc/live-build/examples/auto/* auto/
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,#!/bin/sh
lb config noauto \
--architectures i386 \
--linux-flavours 486 \
--mirror-bootstrap http://ftp.uk.debian.org/debian/ \
--mirror-chroot http://ftp.uk.debian.org/debian/ \
--mirror-binary http://ftp.uk.debian.org/debian/ \
--mirror-chroot-security http://security.debian.org/ \
--archive-areas "main contrib non-free" \
--apt-recommends disabled \
--apt aptitude \
-d wheezy \
--debian-installer live \
The script is read when lh build is run.
Note: in the file config/bootstrap there is also LB_PARENT_MIRROR_BOOTSTRAP... LB_PARENT_MIRROR_CHROOT... which seem to override the --mirror-bootstrap and --mirror-chroot parameters so that during the build packages are retrieved from ftp.debian.org, not from your prefered mirror.
3. Add package lists before the build
su to root and run these in the build directory:
needed for successful build as they are possibly excluded by the "no-recommends" option.
for p in eject file live-boot-doc rsync uuid-runtime live-config-doc live-tools sudo user-setup grub ;do echo $p >> config/package-lists/needed.list.chroot ;done
minimal LXDE install
for p in xorg lxde lightdm lxtask xfce4-power-manager locales pm-utils hdparm cpufrequtils alsa-utils network-manager-gnome chromium-browser firestarter thunar thunar-volman thunar-archive-plugin thunar-media-tags-plugin tumbler tumbler-plugins-extra zip unzip bzip2 p7zip-full imagemagick openjdk-7-jre icedtea-7-plugin bluetooth blueman ntfs-3g blktool testdisk unetbootin bash-completion tango-icon-theme openbox-themes xcursor-themes moblin-cursor-theme gtk2-engines gtk2-engines-xfce gtk2-engines-murrine debian-installer-launcher ;do echo $p >> config/package-lists/base.list.chroot ;done
apps (copy to a text editor and omit/add what you like)
for p in ffmpeg x264 mplayer gnome-mplayer vlc avidemux handbrake-gtk bombono-dvd k3b libk3b6-extracodecs normalize-audio dvdrip audacious feh gimp pinta marble gcalctool clipit clamav clamtk catfish pidgin uget xfce4-notes-plugin gdmap gparted qshutdown ksnapshot kcharselect luckybackup cheese meld regexxer furiousisomount bleachbit ardour easytag viking libcurl4-openssl-dev gnome-doc-utils celestia stellarium htop etherape yelp xiphos fonts-sil-ezra gnome-color-chooser systemsettings ;do echo $p >> config/package-lists/my.list.chroot ;done
for p in build-essential intltool pkg-config libalglib-dev libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libx11-dev libgtk2.0-dev libwnck-dev x11-xserver-utils libgudev-1.0-dev libgtkmm-2.4-dev libssl-dev libnotify-dev gcc make cmake checkinstall ;do echo $p >> config/package-lists/build.list.chroot ;done
4. Add other/customised packages
Put their .deb archives in config/packages.chroot -for example, most recent Libre Office, XnviewMP, refractasnapshot etc.
! Check the packages names with running dpkg-name *.deb in the dir as they must comply to be included.
Note with thunar: the latest is found in experimental, but it has so many dependencies it failed to install for me using packages.
Therefore it is wiser to pin it to the experimental repository, with all other packages defaulting to the config repository, like this
echo "deb http://ftp.uk.debian.org/debian/ experimental main" > config/archives/experimental.list.chroot
sudo leafpad config/archives/experimental.pref.chroot
Package: thunar libexo-1-0 libxfce4ui-1-0 libxfce4util6 thunar-data libxfce4ui-1-dev libthunarx-2-0 exo-utils libxfce4util-dev libxfconf-0-dev libxfconf-0-2
Pin: release n=experimental
Pin: release n=experimental
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,
sudo leafpad config/apt/preferences
Pin: version *
5. add the multimedia repo
add the multimedia repository (or any repo you like, same method), in my-livecd dir:
echo "deb http://www.deb-multimedia.org testing main non-free" > config/archives/deb-multimedia.list.chroot
copy /usr/share/keyrings/deb-multimedia-keyring.gpg to config/archives/deb-multimedia.key.chroot
cp /usr/share/keyrings/deb-multimedia-keyring.gpg config/archives/deb-multimedia.key.chroot
Enable live-helper to use the latest snapshot of live-initramfs with a sources list entry (run in my-livecd dir)
sh -c 'echo "deb http://live.debian.net/ sid-snapshots main contrib non-free" > config/chroot_sources/debian-live_sid-snapshots.chroot'
and at binary stage with
cp config/chroot_sources/debian-live_sid-snapshots.chroot config/chroot_sources/debian-live_sid-snapshots.binary
get the gpg key:
wget http://live.debian.net/debian/project/keys/archive-key.asc -O config/chroot_sources/debian-live_sid-snapshots.chroot.gpg
copy it to the binary
cp config/chroot_sources/debian-live_sid-snapshots.chroot.gpg config/chroot_sources/debian-live_sid-snapshots.binary.gpgto run live build cd to my-livecd and enter (sudo or as root)
or get the live-boot-initramfs-tools deb file and put it in config/packages.chroot
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.
Add config files to config/includes.chroot/etc/skel/ so that they will be used to create the live user's home directory... and the installed user's?
Set groups for the Live user
make a file
and fill with [include whatever groups you require]
LIVE_USER_DEFAULT_GROUPS="plugdev netdev powerdev dialout lpadmin admin clamav"
8. Building the live cd
debian live manual now uses lb build (same thing?)
to cleanup the working directory to build again
lh clean --binary
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
lh config --interactive shell
The iso file will be created (if successful) in the "my-livecd" directory, which just needs (renaming and) burning to disk or sending to a usb stick.
You can make a live build from your installed system with (haven't tested it myself)
lh config --bootstrap copy --debian installer live
lh clean --purge && lh build
but it will clean out the cache!
Example, the build fails with an error:
P: Configuring file /etc/debian_chroot
/usr/share/live/build/scripts/build/lb_chroot_debianchroot: 50: /usr/share/live/build/scripts/build/lb_chroot_debianchroot: cannot create chroot/etc/debian_chroot: Directory nonexistent
P: Begin unmounting filesystems...
P: Saving caches...
chroot: failed to run command `/usr/bin/env': No such file or directory
Another one would be:
P: Begin install linux-image... cp: cannot stat `chroot/boot/vmlinuz-*': No such file or directory
P: Begin unmounting filesystems
And this error would require unmounting the file system where the build was in process in order to build successfully. mail-archive...
Another error I had was aptitude failing to download packages and reporting:
E: Cannot get debconf version. Is debconf installed?
try fixing this with
#cp available-old available && cp diversions-old diversions && cp status-old status
for p in binutils build-essential debhelper dpatch dpkg-dev g++ g++-4.7 gcc gcc-4.7 gettext gettext-base html2text intltool-debian libasprintf0c2 libc-dev-bin libc6-dev libdpkg-perl libgettextpo0 libitm1 libstdc++6-4.7-dev linux-libc-dev make patch po-debconf ;do echo $p >> config/package-lists/catfishdep.list.chroot ;done
for p inautoconf automake autotools-dev binutils build-essential debhelper dpkg-dev g++ g++-4.7 gcc gcc-4.7 gettext gettext-base gir1.2-notify-0.7 gir1.2-polkit-1.0 html2text intltool intltool-debian libasprintf0c2 libatk1.0-dev libc-dev-bin libc6-dev libcairo-script-interpreter2 libcairo2-dev libdbus-1-dev libdbus-glib-1-dev libdpkg-perl libexpat1-dev libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libgettextpo0 libglib2.0-bin libglib2.0-dev libgtk2.0-dev libice-dev libitm1 libnotify-dev libpango1.0-dev libpcre3-dev libpixman-1-dev libpng12-dev libpolkit-gobject-1-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev libstdc++6-4.7-dev libx11-dev libxau-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfce4ui-1-dev libxfce4util-dev libxfconf-0-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev linux-libc-dev m4 make patch pkg-config po-debconf x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xinerama-dev xfce4-panel-dev xorg-sgml-doctools xtrans-dev zlib1g-dev ;do echo $p >> config/package-lists/xfce4-pman-dep.list.chroot ;done
sudo apt-get install grubsudo grub-install /dev/sda
my tutorials >