Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
1 answers
3659 views
GRUB install on Debian 11 live image failed to get canonical path of 'overlay'
We're building a Debian based product. To simplify building these in the factory, I'm trying to build a live disk that will install the main OS. We have an older product that uses this processbut was based on Debian 7. I'm using Debian 11. I've based my Debian 11 recovery process and image on the De...
We're building a Debian based product. To simplify building these in the factory, I'm trying to build a live disk that will install the main OS. We have an older product that uses this processbut was based on Debian 7. I'm using Debian 11. I've based my Debian 11 recovery process and image on the Debian 7 one. Both use live-build. The Debian 11 system pulls the OS from mainline bullseye repos plus my repo for the one package that carries our bits. It's a multistep process where we run live-build to build the operational system's OS, squash it into a squashfs, then build a live OS around it with a script that does things like partition the driven, unsquash the squashfs file to the appropriate partition, and, most critically not working, apply GRUB. Part of the build does:
install -d /boot/seed
grub-mkimage -Ox86_64-efi -o /boot/seed/BOOTX64.EFI -p '(hd0,1)/EFI/BOOT/grub' \
	part_gpt part_msdos fat
grub-mkimage -Oi386-pc -o /boot/seed/mbr-core.img -p '(hd0,msdos1)/biosgrub' \
	part_msdos fat biosdisk
grub-mkimage -Oi386-pc -o /boot/seed/gpt-core.img -p '(hd0,gpt1)/biosgrub' \
	part_gpt fat biosdisk
cp -a /usr/lib/grub/i386-pc/boot.img /boot/seed/boot.img
cp -a /usr/lib/grub/i386-pc/modinfo.sh /boot/seed/modinfo.sh
grub-editenv /boot/seed/grubenv create
These files end up in the live OS and get copied to the ESP partition prior to attempting to install GRUB. Those files and all the various GRUB modules are copied midway through the install script. Later on in the script, we call grub-install.
grub-install \
    --directory /mnt/biosgrub \
    --boot-image boot.img \
    --core-image core_img \
    /dev/sda
The problem here is that the newer versions of grub-install no longer support core-image and boot-image switches like the version from Debian 7 did so that fails immediately. I took out the boot-image and core-image switches and now it fails with:
grub-install: error: failed to get canonical path of `overlay'.
And yes, there really is an opening backtick with a closing single quote on overlay. I've tried removing the GRUB step, letting it unsquash everything, then booting to a graphical live disk running Manjaro (had it laying about) to try to get more info on the GRUB situation. Running grub-install there fails in the same way. From googling, I've learned that this is because grub-install thinks the target device is using an overlayfs and can't figure out which actual device to use but I'm not really sure where to go from here nor am I certain what questions to ask. I'm happy to provide more details although somethings will have to be redacted for proprietary software reasons. If it matters, manually mounting the created OS partition off-system shows everything to be in the right place, our code is in place and would probably run well if there were a bootloader. ETA: I've made some progress here, mounting the unsquashed OS into a directory in the live disk, mounting /proc, /sys, and /dev into that directory, mounting my EFI partition into it, and chrooting into it. Then running grub-install /dev/sda but grub is still missing on startup.
jsimon (121 rep)
Dec 21, 2021, 08:52 PM • Last activity: Jul 9, 2025, 07:05 PM
1 votes
1 answers
249 views
How to make GRUB set the root device as the EFI booted device?
**XY problem:** I have multiple Debian Live OSes (made through `live-build`) on multiple drives in my system, but whichever drive is booted to it just loads the squashFS from the first drive. It looks like the `boot=live` parameter is looking for the files in the `/live` directory (which contains `f...
**XY problem:** I have multiple Debian Live OSes (made through live-build) on multiple drives in my system, but whichever drive is booted to it just loads the squashFS from the first drive. It looks like the boot=live parameter is looking for the files in the /live directory (which contains filesystem.squashfs), however it appears that GRUB is just getting this folder from the root device (which is seemingly static depending on how the BIOS sees the drives) and not the device which is chosen to be booted from*. **Is there a way to make GRUB set the root device as the drive which the EFI booted to?** Or is there another scalable/non-hardcoded way to load the desired squashFS? *It's also a bit odd because when the live OS is 'burnt' to the drive there is no option in the EFI to boot to the drive, yet it is still bootable 🤔
Synthetic Ascension (249 rep)
Nov 8, 2024, 10:19 PM • Last activity: Nov 9, 2024, 03:00 PM
0 votes
0 answers
41 views
How do I create a restorable Clonezilla image from a rootfs directory?
I've built a Debian rootfs for an embedded Linux platform using `debootstrap` et al. My goal is to make this installable to my devices over the network. I previously built [my own solution](https://github.com/rgov/netinstall) using iPXE but I'm evaluating switching to Clonezilla. However, I am not c...
I've built a Debian rootfs for an embedded Linux platform using debootstrap et al. My goal is to make this installable to my devices over the network. I previously built [my own solution](https://github.com/rgov/netinstall) using iPXE but I'm evaluating switching to Clonezilla. However, I am not cloning an existing drive; I want to make the restorable image from my rootfs directory, and populate the necessary metadata fields about the partitions for Clonezilla to recreate on restore. What is the process for "manually" creating a Clonezilla restore image? E.g., should I create a disk image with mkfs && mount -o loop and then clone it? Is there some incantation of partclone that supports this? (A process that doesn't require root and/or that works inside a Docker container would be preferred, since that's easier to deploy via CI.)
rgov (253 rep)
Nov 4, 2024, 10:25 PM • Last activity: Nov 4, 2024, 10:54 PM
0 votes
2 answers
1910 views
Debian LiveBuild: How to make the bootloader to directly boot to live?
I just start learning on using LiveBuild. I want it to boot directly in 'Live' mode, no other boot choice(s) Here is my auto/config #!/bin/sh set -e lb config noauto \ --mode debian \ --distribution buster \ --architectures i386 \ --linux-flavours 686-pae \ --debian-installer false \ --apt-recommend...
I just start learning on using LiveBuild. I want it to boot directly in 'Live' mode, no other boot choice(s) Here is my auto/config #!/bin/sh set -e lb config noauto \ --mode debian \ --distribution buster \ --architectures i386 \ --linux-flavours 686-pae \ --debian-installer false \ --apt-recommends false \ --debootstrap-options "--variant=minbase" \ --firmware-chroot false \ --apt-indices false \ --bootloaders syslinux \ --memtest none \ "${@}" here is my config/bootloaders/syslinux/syslinux.cfg include menu.cfg #default vesamenu.c32 default live-@FLAVOUR@ prompt 0 timeout 1 And here is config/bootloaders/syslinux/menu.cfg menu hshift 0 menu width 82 menu title Boot menu #include stdmenu.cfg timeout 1 label live-@FLAVOUR@ menu label ^Live (@FLAVOUR@) menu default linux @LINUX@ initrd @INITRD@ append @APPEND_LIVE@ But still when booted, it always show the standard boot menu and do nothing until I press ENTER. Stdandard Boot Menu Kindly please give me some clue to fix this problem
Bino Oetomo (103 rep)
Jul 8, 2021, 08:01 AM • Last activity: Apr 26, 2023, 01:45 PM
4 votes
0 answers
1351 views
How to create a live-cd that launches debian-installer and works properly?
I'm trying to create a custom `Debian live-cd` with [`live-build`][1] and [`debian-installer`][2]. I need a [`"Desktop" Debian Installer`][3]. As described in the manual: > "Desktop" Debian Installer: Regardless of the type of Debian Installer included, d-i can be launched from the Desktop by clicki...
I'm trying to create a custom Debian live-cd with live-build and debian-installer . I need a "Desktop" Debian Installer . As described in the manual: > "Desktop" Debian Installer: Regardless of the type of Debian Installer included, d-i can be launched from the Desktop by clicking > on an icon. This is user friendlier in some situations. In order to > make use of this, the debian-installer-launcher package needs to be > included. > > Note that by default, live-build does not include Debian > Installer images in the images, it needs to be specifically enabled > with lb config. Also, please note that for the "Desktop" installer to > work, the kernel of the live system must match the kernel d-i uses for > the specified architecture. For example: > >
> $ lb config --architectures i386 --linux-flavours 586 \
>     --debian-installer live 
> $ echo debian-installer-launcher >> config/package-lists/my.list.chroot
>
So, I used lb config to create a live-cd with debian-installer and debian-installer-launcher included and a kernel matching d-i's kernel version. I don't want to install the live system to disk, so I pass --debian-installer cdrom to install Debian by fetching and installing .deb packages using debootstrap, from local media.
lb config \
  --apt-recommends false \
  --apt-indices false \
  --architectures amd64 \
  --binary-images iso-hybrid \
  --debian-installer cdrom \
  --debian-installer-gui true \
  --distribution bullseye \
  --linux-packages "linux-image-5.10.0-20"

cat  config/package-lists/my.list.chroot
user-setup
sudo
debian-installer-launcher
task-lxde-desktop
EOF

lb build
The whole build process occurred well and finished with a live-image-amd64.hybrid.iso file. I successfully booted this ISO and started the live-cd, but when I click on Menu > System Tools > Install Debian the Install process is stuck at the Configure the package manager step and I can't proceed. The Start Installer option from the GRUB menu works nicely. I found this old bug report on Debian mail list : > Unfortunately, what you're probably running into is a battle between > the live image and the installer about what to do with the network. > The live image will configure the network one way (usually > NetworkManager), then the installer will attempt to configure it its > own way (using ifupdown, dropping connection in the live system). > There are a couple of possible workarounds I can think of (but have > not tested): > > 1. disconnect the network in the live system before doing an install and see what happens > > 2. run the installer with the network still up in the live system, but don't configure the network (d-i doesn't really give you an option to > do this; choose a network interface you know will fail because it's > not plugged in). since the live-installer installs from the contents > of the image, it doesn't actually need the network. unfortunately, > configuration of apt and the network then becomes a post-install step > the user has to deal with later. But none of the workarounds work. How can I create a live-cd that launches debian-installer and works properly?
wiltonsr (91 rep)
Dec 15, 2022, 03:58 PM • Last activity: Apr 5, 2023, 12:34 PM
1 votes
1 answers
834 views
Manually install a printer without running any cups command
I need to manually install a printer without running any cups command, by copying files from a Debian system where the printer is already installed. I have to proceed by this way in order to make a Debian live DVD where the printer will be installed. So, if I use the Canon installer, it will connect...
I need to manually install a printer without running any cups command, by copying files from a Debian system where the printer is already installed. I have to proceed by this way in order to make a Debian live DVD where the printer will be installed. So, if I use the Canon installer, it will connect to the cups server of the host, and will install the printer on the host, instead of installing it in the chroot. The printer is a Canon G3560, connected on usb. The device URI is cnijbe2://Canon/?port=usb&serial=60A386. I have copied the driver's Debian package cnijfilter2_6.10-1_amd64.deb in config/packages.chroot/ of the live DVD building directory. And I have copied the files /etc/cups/ppd/G3060USB.ppd and /etc/cups/printers.conf to the live DVD building directory: config/includes.chroot_after_packages/etc/cups/. When I run the live system, it shows the printer, but the system is unable to print any document.
Bertrand125 (1070 rep)
Feb 18, 2023, 10:10 AM • Last activity: Feb 18, 2023, 12:01 PM
0 votes
0 answers
89 views
Want to customize install option using live build in linux
Using live build tool to create ISO image. Want to customize the install wizard to provide more flexibility for ISO installation. Any idea which files we need to edit for this or how to approach for the customization.
Using live build tool to create ISO image. Want to customize the install wizard to provide more flexibility for ISO installation. Any idea which files we need to edit for this or how to approach for the customization.
md sajid (1 rep)
Oct 11, 2022, 08:36 PM
0 votes
1 answers
302 views
Custom Debian Live-Build final IMG folder
The default output **img** file was at the ```lb config``` used Is there any way to custom output img directory ? like output img to directory IMG_1, IMG_2, etc ``` # mkdir /customlive # cd /customlive # lb config --binary-image hdd --apt-indices false --apt-recommends false --debootstrap-options "-...
The default output **img** file was at the
config
used Is there any way to custom output img directory ? like output img to directory IMG_1, IMG_2, etc
# mkdir /customlive

# cd /customlive

# lb config --binary-image hdd --apt-indices false --apt-recommends false --debootstrap-options "--variant=minbase" --firmware-chroot false --memtest none

# echo "user-setup sudo" > config/package-lists/recommends.list.chroot

# echo "ifupdown isc-dhcp-client" >> config/package-lists/recommends.list.chroot

# lb build 2>&1 | tee build.log
Default output: /customlive/linux-image-amd64.img What I want is : /customlive/lb config /customlive/IMG_1/lb build /customlive/IMG_1/linux-image-amd64.img
TyaCode (21 rep)
Mar 16, 2022, 06:23 AM • Last activity: Mar 19, 2022, 06:03 AM
0 votes
0 answers
499 views
Unable to auto-mount encrypted filesystem.squashfs of Debian Live CD
Part 1 I've created a live ISO image of my system using 'live build' tool on a Debian system. For automated installation i've used a preseeding file. To protect my senstive data I'm using LUKS encryption to encrypt the squashfs file of the ISO and the process is as follow - Extract the IOS image. Cr...
Part 1 I've created a live ISO image of my system using 'live build' tool on a Debian system. For automated installation i've used a preseeding file. To protect my senstive data I'm using LUKS encryption to encrypt the squashfs file of the ISO and the process is as follow - Extract the IOS image. Create a LUKS encrypted container. Put the unencrypted filesystem.squashfs file into the container. Rename the container to filesystem.squashfs. Recreate the ISO image. I've tried this method but was unsuccessful. During the installation the system shows an error 'could not find filesystem.squashfs' After some googling I found that the boot process should be - ...the encrypted filesystem.squashfs is mounted in the memory then it will asks for a password which will decrypt the encrypted filesystem.squashfs and then rest of the boot process resumes normally. The problem is that I don't know how I can make the encrypted squashfs mount in the memory during the installation process. I've found this link https://askubuntu.com/questions/1041916/booting-encrypted-squashfs-from-live-cd which performs similar functionality on an Ubuntu system. In ubuntu, the 'casper' tool is used for creating live cd which creates 'script' files in initrd of the ISO. In the above link we can see that a file named 'casper-helper' is edited to tell the system to mount the encrypted squashfs during the boot process. But I couldn't find its alternative on the debian system. Any help is welcome. Part 2 Is it possible to attain automatic decryption as I want fully automated installation I don't want it to ask for the password. Somehow if I can save a keyfile in the ISO which will decrypt it automatically during installation. If yes then please help
Dheeraj - (1 rep)
Dec 7, 2021, 02:03 PM
0 votes
0 answers
349 views
how to add multiple packages to build debian-live using live-wrapper
The only manual I could find is [readthedocs](http://live-wrapper.readthedocs.io). So far I have understood the following: 1. I have to start working in a dedicated directory 1. It needs the latest `debian-archive-keyring` not necessarily provided by other debian based OS 1. `-d` is distro `-m` is m...
The only manual I could find is [readthedocs](http://live-wrapper.readthedocs.io) . So far I have understood the following: 1. I have to start working in a dedicated directory 1. It needs the latest debian-archive-keyring not necessarily provided by other debian based OS 1. -d is distro -m is mirror server -e is package to be installed with only dependencies -t is package installed with recommendations and -f is installed firmware packages Did I get it right? Also I couldn't pass more then one package in either of the parameters. Could anyone lead me to the right direction? My command so far goes like this: lwr -d bullseye -m http://mirror.xeonbd.com/debian/ -e kde-full -t debian-installer-launcher -f firmware-realtek I haven't used either live-wrapper or live-build before.
user375870
Oct 4, 2021, 01:41 PM • Last activity: Oct 5, 2021, 07:42 AM
2 votes
0 answers
1202 views
Make custom Kali ISO launch into unattended installer immediately
So I built a custom Kali ISO, which is based on Debian 10, with the help of the documentation here: https://www.kali.org/docs/development/dojo-mastering-live-build/. They use the following repo as a base: https://gitlab.com/kalilinux/build-scripts/live-build-config. I added an option for an unattend...
So I built a custom Kali ISO, which is based on Debian 10, with the help of the documentation here: https://www.kali.org/docs/development/dojo-mastering-live-build/ . They use the following repo as a base: https://gitlab.com/kalilinux/build-scripts/live-build-config . I added an option for an unattended/automated install and custom packages through a preseed file, which is working as expected. My goal now is that the ISO should always select my custom option when booting up, so the whole setup will run without any user input when I create a new VM in VMWare. I have tried two approaches: 1. Modify grub.cfg at kali-config/common/bootloaders/grub-pc and remove config.cfg. The contents of my custom grub.cfg were as follows:
# Live Image (UEFI boot)
set default=0
set timeout=1

loadfont $prefix/dejavu-bold-16.pf2
loadfont $prefix/dejavu-bold-14.pf2
loadfont $prefix/unicode.pf2
set gfxmode=auto
insmod all_video
insmod gfxterm
insmod png

source /boot/grub/theme.cfg

terminal_output gfxterm

# Comment these two lines out to disable the beep on boot
insmod play
play 960 440 1 0 4 440 1


menuentry "Unattended Install" {
	linux /install/vmlinuz vga=788 -- quiet file=/cdrom/install/preseed.cfg locale=en_US keymap=de hostname=kali domain=bufu-sec.local
	/install/initrd.gz
}
This did not change anything in the boot menu, it simply fell back to the default boot menu. 2. Modify the files at kali-config/common/includes.binary/isolinux. This worked better, as the boot menu now only showed my custom boot option. I divided my configuration into four files while also placing the splash.png for the background in the same folder: **syslinux.cfg**
PROMPT 0
TIMEOUT 0
NOESCAPE 1
DEFAULT install

INCLUDE menu.cfg
**menu.cfg**
MENU hshift 0
MENU width 82

MENU title Boot menu
INCLUDE stdmenu.cfg
INCLUDE install.cfg
MENU clear
**install.cfg**
LABEL install
    MENU label ^Unattended Install
    LINUX /install/vmlinuz
    INITRD /install/initrd.gz
    APPEND vga=788 -- quiet file=/cdrom/install/preseed.cfg locale=en_US keymap=de hostname=kali domain=bufu-sec.local
**stdmenu.cfg**
MENU background     splash.png
MENU color title        * #FFFFFFFF *
MENU color border       * #00000000 #00000000 none
MENU color sel          * #ffffffff #76a1d0ff *
MENU color hotsel       1;7;37;40 #ffffffff #76a1d0ff *
MENU color tabmsg       * #ffffffff #00000000 *
MENU color help         37;40 #ffdddd00 #00000000 none
MENU vshift 10
MENU hshift 4
MENU width 70
MENU margin 5
MENU rows 10
MENU helpmsgrow 15
# The command line must be at least one line from the bottom.
MENU cmdlinerow 16
MENU timeoutrow 16
MENU tabmsgrow 18
MENU tabmsg Press ENTER to boot or TAB to edit a menu entry
This correctly display only my custom boot option, but still stops at the boot menu dispite me setting PROMPT 0, TIMEOUT 0 and NOESCAPE 1 in syslinux.cfg. An issue I encountered with this version was that if I placed all of the config in syslinux.cfg, it would also default back to the initial boot menu and not show my custom option at all. I have also tried to combine both of the above methods, meaning that I included both configurations and then built the ISO, but also no luck. If anyone wants to try reproducing my error, I have uploaded all of the files to a git repository here: https://github.com/xbufu/custom-kali-iso/ . It also contains the resources and documentation I used to build my config. The command I used to build the ISO was with the inlcuded build script: ./build.sh -v. I hope someone can point out where I went wrong or knows some other approach, I would greately appreciate it.
xbufu (121 rep)
Sep 10, 2021, 11:14 AM • Last activity: Sep 12, 2021, 09:48 AM
3 votes
0 answers
517 views
Building Custom Kali Linux ISO Image Failed
I'm using a Kali Linux on virtual box and I'm currently trying to create a custom Kali Linux ISO using the following commands: apt-get install git live-build cdebootstrap git clone https://gitlab.com/kalilinux/build-scripts/live-build-config.git cd live-build-config/ ./build.sh --distribution kali-r...
I'm using a Kali Linux on virtual box and I'm currently trying to create a custom Kali Linux ISO using the following commands: apt-get install git live-build cdebootstrap git clone https://gitlab.com/kalilinux/build-scripts/live-build-config.git cd live-build-config/ ./build.sh --distribution kali-rolling --verbose Everything works fine and the process takes around 30 mins until it fails to create the Image. Checking the build.log file I find the last lines saying the following: mkfs.fat 4.2 (2021-01-31) Volume ID does not fit in 32 bit E: An unexpected failure occurred , exiting ... P: Begin unmounting filesystems ... P: Saving caches ... Reading package lists ... Building dependency tree ... Reading state information ... Screenshot attached below. enter image description here
Karim (31 rep)
Feb 22, 2021, 03:12 PM
Showing page 1 of 12 total questions