Example debootstrap minimal version to work from
This vmdebootstrap command will set up a minimal Debian Jessie in a 4GB image file, with networking, sudo, the usual Debian live user and ready for running in kvm:
Code:
sudo vmdebootstrap --image net_test.img --size 4g --enable-dhcp --sudo --user=user/live --log test.log --log-level debug --verbose
It gives a login console, from where one may proceed. The necessary packages for running a minimal X11 environment in kvm seem to be:
X11-server-utils, Xorg, xserver-xorg-video-cirrus, xfce4, xfwm4.
In addition, I have installed editors, iceweasel, rxvt-unicode (terminal urxvt), curl, ssh etc. Compressed, it will be about 350MB.
It is easily booted in kvm
Code:
sudo kvm net_test.img -m 1024 &
And X is started with old startx.
Instead of running (vm)deboostrap several times, this image can be copied and modified. E.g. changing to sysvinit and introducing Knoppix packages. When a robust procedure is found for this, debootstrap can be modified (to "knxbootstrap") to produce exactly what is needed.
It can also be used for making a squashfs image - but I haven't seen form the sparse documentation how to do this after the initial image creating process.
Small script to automate the repackaging step of knoppification
There are quite a few Knoppix packages involved, with a small minority installable from repos.
Here is a small script, called knoppify_deb_1.sh, for faster and safer creation of packages. It creates a list of all installed packages in subdirectory knxdata, using dpkg-query, and uses that list.
It creates the full list of knoppix-branded packages that may be created this way in directory deb - with no guarantee of usability :-)
I try with arch=all first - to see how it works out.
Code:
#!/bin/bash
# 20160327
# Usage
# sudo ./knoppify_deb_1.sh create package-list-1
# sudo ./knoppify_deb_1.sh create package-list-2
# sudo ./knoppify_deb_1.sh repackage knoppix-debs
#
function repackage_knoppix() {
command=$1; shift;
operand=$1; shift;
[ -d knxdata ] || mkdir knxdata ;
case "${command} ${operand}" in
"create package-list-1")
dpkg-query -W --showformat='${Section} ${Package}\n' | sort -n > knxdata/knx761_DVD_sect1.txt ;
;;
"create package-list-2")
dpkg-query -W --showformat='${Section} ${Package} ${Installed-Size}\n' | sort -n > knxdata/knx761_DVD_sect2.txt ;
;;
"repackage knoppix-debs")
[ -d deb ] || mkdir deb ;
cd deb ;
dpkg-repack -arch=all `cat ../knxdata/knx761_DVD_sect1.txt | grep ^knoppix | cut -d' ' -f2` ;
cd .. ;
;;
*) echo oops - no executable command
;;
esac
}
repackage_knoppix $1 $2 ;