Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Getting started with Debian live-build

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
tjcw
Posts: 22
Joined: 2019-12-08 21:14

Getting started with Debian live-build

#1 Post by tjcw »

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-sl ... wait-1.png while I am waitng. After it boots, I can get at the logs; here http://tjcw.freeshell.org/live-build-sl ... nalctl.log is 'journalctl' and here http://tjcw.freeshell.org/live-build-sl ... /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-sl ... nfig.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/1vBDNof ... sp=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 !

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Getting started with Debian live-build

#2 Post by pcalvert »

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
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

tjcw
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

#3 Post by tjcw »

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 ?

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Getting started with Debian live-build

#4 Post by pcalvert »

tjcw wrote: It looks like the command ( lb ) is the same. Is the documentation the same ?
Yes, that appears to be the case.

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Getting started with Debian live-build

#5 Post by Head_on_a_Stick »

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.
deadbang

tjcw
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

#6 Post by tjcw »

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

#7 Post by tjcw »

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

#8 Post by tjcw »

Out of curiosity, can I use the tooling to build a live iso without squashing the root file system ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Getting started with Debian live-build

#9 Post by Head_on_a_Stick »

tjcw wrote:'user' does not have a password
The password is live.
deadbang

tjcw
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

#10 Post by tjcw »

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

#11 Post by tjcw »

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 ?

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Getting started with Debian live-build

#12 Post by Dai_trying »

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.

tjcw
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

#13 Post by tjcw »

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

#14 Post by tjcw »

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.

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Getting started with Debian live-build

#15 Post by Dai_trying »

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.

tjcw
Posts: 22
Joined: 2019-12-08 21:14

Re: Getting started with Debian live-build

#16 Post by tjcw »

OK, will do.

My next try is configured with http://tjcw.freeshell.org/live-gk/config.tar.z , iso here https://drive.google.com/file/d/1AUVzwO ... sp=sharing . With this one, it should go straight to a desktop; but I get several desktop login prompts (which can be ignored) and then the desktop proper starts. Any ideas how to fix this ?

Post Reply