It seems that we're hitting this issue again with the subiquity
installer. The installer fails at the "installing kernel" stage, when
zipl is called. These are the last lines of the installer log
(retrieving the full log is not trivial because of LP: #1823797):


Setting up linux-image-5.0.0-8-generic (5.0.0-8.9) ...                          
   
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.0.0-8-generic                
   
I: /initrd.img.old is now a symlink to boot/initrd.img-5.0.0-8-generic          
   
I: /vmlinuz is now a symlink to boot/vmlinuz-5.0.0-8-generic                    
   
I: /initrd.img is now a symlink to boot/initrd.img-5.0.0-8-generic              
   
Not invoking zipl: initrd doesn't exist yet                                     
   
/etc/kernel/postinst.d/zz-zipl:                                                 
   
Not invoking zipl: initrd doesn't exist yet                                     
   
Setting up linux-generic (5.0.0.8.9) ...                                        
   
/etc/kernel/postinst.d/initramfs-tools:                                         
   
update-initramfs: Generating /boot/initrd.img-5.0.0-8-generic                   
   
Not invoking zipl: initrd doesn't exist yet                                     
   
/etc/kernel/postinst.d/zz-zipl:                                                 
   
Not invoking zipl: initrd doesn't exist yet                                     
   
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/target', 
'zipl']
Error: Image file '/boot/vmlinuz' in section 'ubuntu': No such file or directory


The qcow2 disk image can be mounted like this:

$ sudo modprobe nbd max_part=8
$ sudo qemu-nbd --connect=/dev/nbd0 /path/to/CE-install-test.qcow2
$ sudo mount /dev/nbd0p1 /mnt/guest

and it contains the expected target filesystem, but the vmlinuz and
initrd.img symlink are in / instead of being in /boot, where zipl
expects them:

lrwxrwxrwx  1 root root    31 Apr   9 08:11 initrd.img ->
boot/initrd.img-5.0.0-8-generic
lrwxrwxrwx  1 root root    28 Apr   9 08:11 vmlinuz ->
boot/vmlinuz-5.0.0-8-generic


Moving the symlinks in /boot and chrooting in the target partition makes zipl 
work:


$ for i in sys dev proc; do sudo mount -o bind /$i /mnt/guest/$i; done
$ sudo chroot /mnt/guest/
groups: cannot find name for group ID 129
root@s1lp04:/# rm initrd.img* vmlinuz*
root@s1lp04:/# cd /boot/
root@s1lp04:/boot# ln -s vmlinuz-5.0.0-8-generic vmlinuz
root@s1lp04:/boot# ln -s initrd.img-5.0.0-8-generic initrd.img
root@s1lp04:/boot# cd ..
root@s1lp04:/# zipl -V
Using config file '/etc/zipl.conf'
Warning: Could not remove temporary file : No such file or
directoryfree(): double free detected in tcache 2
Aborted


(It still errors, but we go past the "No such file or directory" error, and 
this error is probably related to the chroot.)

It seems that the location of the vmlinuz and initrd symlinks can be
configured with the /etc/kernel-img.conf file. On the host system we
have:

$ cat /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
do_bootloader = yes
do_initrd = yes
link_in_boot = yes

and the symlinks are indeed created in /boot. In the (subiquity
installed, non functional) guest system the /etc/kernel-img.conf is
missing. The package responsible of installing kernel-img.conf is
kernel-common, but it is *not* installed in the host system, so the file
is probably (supposed to be) copied from the installer system. My
supposition is that this step is missing in the subiquity installer.

I am reopening this and setting it as Confirmed as it was verified
together by me and cpaelzer.

Dimitri: do you remember how this was fixed with the debian-installer?

** Changed in: linux (Ubuntu)
       Status: Invalid => Confirmed

** Changed in: zipl-installer (Ubuntu)
       Status: Invalid => Confirmed

** Changed in: livecd-rootfs (Ubuntu)
       Status: Invalid => New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1534162

Title:
  symlinks managed by kernel postinst are different from zipl-installer
  and livefs-rootfs

To manage notifications about this bug go to:
https://bugs.launchpad.net/subiquity/+bug/1534162/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to