Getting started with Debian live-build

Kernels & Hardware, configuring network, installing services

Getting started with Debian live-build

Postby tjcw » 2019-12-08 21:49

I've just managed to build my first iso with live-build. I can boot it in a virtual machine with
qemu-system-x86_64 -monitor stdio -serial none -parallel none -enable-kvm -name guest -m 1024 -mem-prealloc -usb -device usb-ehci,id=ehci -machine pc,accel=kvm,kernel_irqchip=on,mem-merge=off -cdrom /home/tjcw/Downloads/live-image-amd64-hybrid.iso -boot order=d -device usb-tablet -vnc :1

and then access its display with
vncviewer :1
, but there are some problems.
1) It takes several minutes to boot. It displays http://tjcw.freeshell.org/live-build-slow-boot/wait-1.png while I am waitng. After it boots, I can get at the logs; here http://tjcw.freeshell.org/live-build-slow-boot/journalctl.log is 'journalctl' and here http://tjcw.freeshell.org/live-build-slow-boot/dmesg.log is 'dmesg'. Can anyone tell me what I need to change to have the boot go smoothly ?
2) If I put the iso on a USB stick and boot a real machine with it, 'X' doesn't start. The packages I have installed for X11 support are somewhat questionable; can anyone give me a good list of packages ? Look in the 'config' tarball (config/package-lists/desktop.list.chroot ) to see the list I am currently using.
3) If I try to run it with
qemu-system-x86_64 -cdrom live-image-amd64-hybrid.iso -m 1G
it takes a long time to boot and doesn't start X and the window manager fully (at least, as long as I waited)

I am building a 'buster' iso.

My 'config' directory tarball is here http://tjcw.freeshell.org/live-build-slow-boot/config.tar.z, if anyone would like to look at it and tell me what I have wrong. I have uploaded the iso to Google Drive here https://drive.google.com/file/d/1vBDNoff5d3DChYHA7mPFUGiUK-Rcuzxz/view?usp=sharing ; I'm not sure how long I will be able to keep it there as space is limited. All the packages in the iso are from Debian.

I think the boot taking several minutes may be a bug with the live-boot package, but I don't want to bother the maintainer just yet in case it is just my finger trouble.

All help appreciated !
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby pcalvert » 2019-12-09 00:01

You may want to try using open-infrastructure-system-build instead of live-build. A couple of years ago I read that the live-build maintainer (Daniel Baumann) quit and started a new project after live-build was essentially hijacked.

Phil
“Property is the fruit of labor; property is desirable; it is a positive good
in the world. That some should be rich shows that others may become
rich, and hence is just encouragement to industry and enterprise.”
— Abraham Lincoln
pcalvert
 
Posts: 1873
Joined: 2006-04-21 11:19
Location: Sol Sector

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-09 08:32

OK, I'll try that package instead. Presumably I need to do
apt-get remove live-build
apt-get install open-infrastructure-system-build

It looks like the command ( lb ) is the same. Is the documentation the same ?
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby pcalvert » 2019-12-09 09:00

tjcw wrote:It looks like the command ( lb ) is the same. Is the documentation the same ?

Yes, that appears to be the case.

Phil
“Property is the fruit of labor; property is desirable; it is a positive good
in the world. That some should be rich shows that others may become
rich, and hence is just encouragement to industry and enterprise.”
— Abraham Lincoln
pcalvert
 
Posts: 1873
Joined: 2006-04-21 11:19
Location: Sol Sector

Re: Getting started with Debian live-build

Postby Head_on_a_Stick » 2019-12-09 16:40

Try adding haveged to desktop.list.chroot, the journal prints "random: crng init done" just after the delay so maybe it's entropy-related. FWIW the ISO images in my signature link were created with live-build and they have no startup delay so the problem isn't with live-build. This problem also cropped up over at the Devuan forums but that was with an image built using Refractasnapshot so it's probably not related.

In respect of X, use the metapackage to ensure all the stuff you need is installed. A more general use of metapackages would help you reduce that long package list. Check the GitHub repository linked in the title of my website for the full live-build configuration for SharpBang, that may help.

EDIT: I got your image to the desktop with
Code: Select all
kvm -m 1G -cdrom live-image-amd64-freeduc.hybrid.iso

I haven't tried it on a real machine.
User avatar
Head_on_a_Stick
 
Posts: 11190
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-10 19:31

OK, time for the next try. Now I am using open-infrastructure-system-build instead of live-boot; I have added 'haveged' and changed to 'xorg'. Now the iso runs reasonably well under qemu when I use vncviewer to look at its console, and it also runs well copied to a usb stick and booted on a real machine; but it is very slow to start using qemu's built-in display with 'qemu-system-x86_64 -cdrom ~/Downloads/system-amd64-freeduc.hybrid.iso' . So slow that I left the machine and when I came back, the screen locker for 'user' had kicked in, and 'user' does not have a password so I could not unlock the machine to get at log files to diagnose the problem. Does anyone know how to suppress the screen locker ?
If anyone wants to work along with me, the iso is on Google Drive here https://drive.google.com/file/d/1XBUBLr ... sp=sharing and you can rebuild it with the config tarball here http://tjcw.freeshell.org/open-infrastr ... nfig.tar.z

While getting started with with open-infrastructure-system-build, I noticed that if you try to download Debian from an https:// URL, you get a failure during build; this seems to be that Debian's mirrors generally have certificates that do not match the machine name in the URL. I changed to downloading from http:// URLs and then all worked for me. Maybe the defaults in open-infrastructure-system-build should change; I'm not sure if that opens the build up to the possibility of tampering during download.

Also, the first time I issue 'lb build' with this config, the build halts before doing the 'squashfs'. I think this is that installing one of the packages leaves a mount point in a state that 'lb' fails to unmount it, but I do not know which package causes the problem. Unmounting the mount by hand and reissuing the 'lb build' goes on to create the iso.

The boot splash screen offers 'install' and 'graphical install' options, but selecting these results in a failed boot and falling back to the splash screen again. Does anyone know how to set up an installer in a live iso ?
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-10 20:01

The problem with slow boot is that qemu was running without acceleration. Expanding the command to
qemu-system-x86_64 -monitor stdio \
-serial none \
-parallel none \
-enable-kvm \
-name "guest" \
-m 1024 \
-mem-prealloc \
-usb \
-device usb-ehci,id=ehci \
-machine pc,accel=kvm,kernel_irqchip=on,mem-merge=off \
-cdrom ${HOME}/Downloads/system-amd64-freeduc.hybrid.iso \
-boot order=d \
-device usb-tablet

got good performance. I'd still like to know how to suppress the screen locker, though !
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-10 21:32

Out of curiosity, can I use the tooling to build a live iso without squashing the root file system ?
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby Head_on_a_Stick » 2019-12-11 16:53

tjcw wrote:'user' does not have a password

The password is live.
User avatar
Head_on_a_Stick
 
Posts: 11190
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-14 13:32

I'm building another USB stick (with a different set of packages). This one runs fine on a real system, but hangs during boot as a virtual system running under qemu; and this time I am running with acceleration. The screen at the hang is http://tjcw.freeshell.org/live-hang/live-hang.png ; it makes no progress for at least 20 minutes, either at run level 3 or run level 5.
How do I diagnose and fix the problem ?
If anyone wants to work along with me, a tarball of the config is here http://tjcw.freeshell.org/live-hang/config.tar.z , and the iso is here https://drive.google.com/file/d/14kLnvW ... sp=sharing (need to 'gunzip' it before using); again I'm not sure how long I can keep the iso there due to space limitations. This one is all made from the Debian buster repository, from 'main', 'non-free', and 'contrib'. I am using open-infrastructure-system-build .

I had an idea that sending Ctrl-Alt-number to the hung virtual machine might give me a text-mode console to try and diagnose the problem, so I started an 'install' from my iso with virt-manager, which lets me send these keys. However nothing happened when I sent the keys; presumably the hang happens before linux enables console switching. Then I tried changing the run level for the boot (press 'tab' on the boot splash screen and put a number at the end of the line). Run level 3 didn't help, but run level 1 caused a few error messages to be issued and the system came up into graphical mode (presumably run level 5) at normal speed without the hang. This would give me a workaround for the problem, but gets me no nearer to diagnosing the problem for a proper fix.
I also noticed that if I press 'enter' while the boot was hanging, the system proceeded to boot normally. This may give me a way in to find what is going on.
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-14 14:35

I got into the system with that, and I have put the output from 'journalctl' here http://tjcw.freeshell.org/live-hang/jc.log . The hang is here
Dec 14 15:16:54 debian sudo[776]: pam_unix(sudo:session): session closed for user user
Dec 14 15:18:07 debian kernel: random: crng init done
so it looks like some problem setting up the random number generator. Does anyone know what I should do about this ?
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby Dai_trying » 2019-12-14 15:03

How do you get your config? I use a script to create mine and one of the benefits is I can view and edit it easily when debugging, I am not an expert with live build and could not decipher your complete config folder without a considerable effort on my part, but if you could post the commands you are using to get your build made it might make things easier (for me at least) to understand and maybe help.
Dai_trying
 
Posts: 868
Joined: 2016-01-07 12:25

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-14 15:35

I did 'lb config --distribution buster', then changed 'squashfs' to 'ext4' (because I have in mind a particular usage which is best without a squashed root) and changed 'main' to 'main non-free contrib' because some of the packages are in 'non-free' or 'contrib' areas of Debian. I may have changed some of the mirrors from deb.debian.org because at one time I was having problems with what that redirected to. Then I put in the package list I wanted, and ran 'lb build'. A few hours later I had an iso.
I have just noticed that I didn't include the 'haveged' package; I'm trying a rebuild now, including this.

All help appreciated !
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby tjcw » 2019-12-14 17:15

Adding 'haveged' seems to solve the hang; now I get messages about 'hostapd' failing to start, so I'm removing this package and trying again.
tjcw
 
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

Postby Dai_trying » 2019-12-14 18:43

I would find it difficult to follow your instructions to re-create what you are doing, if you could maybe add a little more information or better still take a look at a live build script I posted in another thread to see how I build mine, I do it like this as I have several machines and wanted to be able to simply run the script on any machine to get the same results. Also have a search online for eznix he builds his the same way and is where I got started and could help you too.
Dai_trying
 
Posts: 868
Joined: 2016-01-07 12:25

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable