# verification steps 1-3: installation in a chroot

I set up 2 chroots - one w/ the normal sources.list, the other w/
proposed enabled, and did a side by side install test.

$ for chroot in mantic mantic-proposed jammy jammy-proposed; do sudo chroot 
$chroot apt list kdump-tools; done
Listing... Done
kdump-tools/mantic,now 1:1.8.1ubuntu1 amd64 [installed]
Listing... Done
kdump-tools/mantic-proposed,now 1:1.8.1ubuntu1.1 amd64 [installed]
N: There is 1 additional version. Please use the '-a' switch to see it
Listing... Done
kdump-tools/jammy-updates,now 1:1.6.10ubuntu2.1 amd64 [installed]
N: There is 1 additional version. Please use the '-a' switch to see it
Listing... Done
kdump-tools/jammy-proposed,now 1:1.6.10ubuntu2.2 amd64 [installed]
N: There are 2 additional versions. Please use the '-a' switch to see them.

## mantic

### first w/ only updates enabled

dannf@lakitu:~$ sudo chroot mantic-proposed apt install kdump-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
kdump-tools is already the newest version (1:1.8.1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
Setting up linux-image-6.5.0-15-generic (6.5.0-15.15) ...
Processing triggers for linux-image-6.5.0-15-generic (6.5.0-15.15) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.5.0-15-generic
/etc/kernel/postinst.d/kdump-tools:
kdump-tools: Generating /var/lib/kdump/initrd.img-6.5.0-15-generic
mkinitramfs: failed to determine device for /
mkinitramfs: workaround is MODULES=most, check:
grep -r MODULES /var/lib/kdump/initramfs-tools

Error please report bug on initramfs-tools
Include the output of 'mount' and 'cat /proc/mounts'
update-initramfs: failed for /var/lib/kdump/initrd.img-6.5.0-15-generic with 1.
run-parts: /etc/kernel/postinst.d/kdump-tools exited with return code 1
dpkg: error processing package linux-image-6.5.0-15-generic (--configure):
 installed linux-image-6.5.0-15-generic package post-installation script 
subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-6.5.0-15-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

### and now w/ proposed

$ sudo chroot mantic-proposed apt install kdump-tools -t mantic-proposed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
  kdump-tools
1 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.
1 not fully installed or removed.
Need to get 30.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu mantic-proposed/main amd64 
kdump-tools amd64 1:1.8.1ubuntu1.1 [30.8 kB]
Fetched 30.8 kB in 0s (1216 kB/s)   
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database ... 46941 files and directories currently installed.)
Preparing to unpack .../kdump-tools_1%3a1.8.1ubuntu1.1_amd64.deb ...
Unpacking kdump-tools (1:1.8.1ubuntu1.1) over (1:1.8.1ubuntu1) ...
Setting up linux-image-6.5.0-15-generic (6.5.0-15.15) ...
Setting up kdump-tools (1:1.8.1ubuntu1.1) ...
Installing new version of config file /etc/kernel/postinst.d/kdump-tools ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Running in chroot, ignoring request.
Processing triggers for initramfs-tools (0.142ubuntu15.1) ...
update-initramfs: Generating /boot/initrd.img-6.5.0-15-generic
Processing triggers for linux-image-6.5.0-15-generic (6.5.0-15.15) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.5.0-15-generic
/etc/kernel/postinst.d/kdump-tools:
W: kdump-tools: Executing in a chroot, skipping initramfs generation.

## jammy

### first w/ only updates enabled
$ sudo chroot jammy apt install linux-kvm -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-kvm is already the newest version (5.15.0.1049.45).
0 upgraded, 0 newly installed, 0 to remove and 99 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
Setting up linux-image-5.15.0-1049-kvm (5.15.0-1049.54) ...
Processing triggers for linux-image-5.15.0-1049-kvm (5.15.0-1049.54) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.15.0-1049-kvm
/etc/kernel/postinst.d/kdump-tools:
kdump-tools: Generating /var/lib/kdump/initrd.img-5.15.0-1049-kvm
mkinitramfs: failed to determine device for /
mkinitramfs: workaround is MODULES=most, check:
grep -r MODULES /var/lib/kdump/initramfs-tools

Error please report bug on initramfs-tools
Include the output of 'mount' and 'cat /proc/mounts'
update-initramfs: failed for /var/lib/kdump/initrd.img-5.15.0-1049-kvm with 1.
run-parts: /etc/kernel/postinst.d/kdump-tools exited with return code 1
dpkg: error processing package linux-image-5.15.0-1049-kvm (--configure):
 installed linux-image-5.15.0-1049-kvm package post-installation script 
subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-5.15.0-1049-kvm
E: Sub-process /usr/bin/dpkg returned an error code (1)

### now with -proposed enabled
$ sudo chroot jammy-proposed apt install linux-kvm -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-kvm is already the newest version (5.15.0.1050.46).
0 upgraded, 0 newly installed, 0 to remove and 110 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
Setting up linux-image-5.15.0-1050-kvm (5.15.0-1050.55) ...
Processing triggers for linux-image-5.15.0-1050-kvm (5.15.0-1050.55) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.15.0-1050-kvm
/etc/kernel/postinst.d/kdump-tools:
W: kdump-tools: Executing in a chroot, skipping initramfs generation.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-nvidia in Ubuntu.
https://bugs.launchpad.net/bugs/2043059

Title:
  Installation errors out when installing in a chroot

Status in kdump-tools package in Ubuntu:
  Fix Released
Status in linux-nvidia package in Ubuntu:
  Invalid
Status in kdump-tools source package in Jammy:
  Fix Committed
Status in linux-nvidia source package in Jammy:
  Invalid
Status in kdump-tools source package in Mantic:
  Fix Committed
Status in linux-nvidia source package in Mantic:
  Invalid
Status in kdump-tools source package in Noble:
  Fix Released
Status in linux-nvidia source package in Noble:
  Invalid

Bug description:
  [Impact]
  When installing in a chroot environment, the kdump-tools kernel hook will 
fail. This breaks certain OS image creation tools, such as BCM (which I assume 
is NVIDIA Base Command Manager from context). While BCM's image generation tool 
requires some additional tweaks to consume this, the proposed fix is necessary, 
and should be sufficient for other tools that use chroots.

  [Test Plan]
  1) debootstrap a chroot environment for the target Ubuntu release
  2) Install kdump-tools within that environment
  3) Install a kernel package and make sure it succeeds.
  4) do the same steps in a virtual machine, but with `ischroot` symlinked to 
/dev/true at install time. This should simulate a system that was just 
installed with an image prepared as above.
  5) Then restore ischroot, and reboot.
  6) Confirm the systemd service does generate an initramfs at boot, and
  7) that a crash dump can be triggered afterwords.

  [Where Problems Could Occur]
  The solution we implemented in noble was simply to detect a chroot 
environment with ischroot, and disable initramfs generation. The systemd 
service will detect that an initrd is missing, and generate one on first boot. 
A source of potential problems is if that does not happen for some reason, 
resulting in a kdump-tools service failure on first boot.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/kdump-tools/+bug/2043059/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to