Tuesday, 2023-09-05

atmarkhello, I'm unable to build a Ubuntu Focal image18:39
atmarkI'm seeing this `/tmp/in_target.d/finalise.d/50-bootloader: line 49: type: grub2-mkconfig: not found`18:39
atmarkBuild command: `DIB_RELEASE=focal disk-image-create -o ubuntu-focal.qcow2 vm ubuntu` 18:40
clarkbatmark: that platform may need to use grub-mkconfig instead? However, we build focal images using ubuntu-minimal (not ubuntu) and that works last I saw and the finalize code is common I thought18:42
atmarkok, let me try ubuntu-minimal 18:43
clarkbatmark: note ubuntu-minimal builds from scratch using debootstrap so you amy need to add more packages to the total list18:43
clarkbalso you can edit the element and stick a `bash` command in there before it fails to debug. It acts like a debugger breakpoint and drops you into an interactive shell. When you exit the build will continue. Maybe you need to install extar packages or maybe the command is grub-mkconfig and we need to fix the finalize code18:44
atmarkthe build still fails 18:46
atmarkI used `DIB_RELEASE=focal disk-image-create -o ubuntu-focal.qcow2 vm ubuntu-minimal`18:46
atmarklet me try adding `bash` to bootloader element18:47
clarkbatmark: that error is a result of the element trying to determine which grub command to use to make the config18:49
clarkbI don't think it is fatal and it shows up in our focal builds too18:49
clarkband then our builds run grub-mkconfig later instead18:50
clarkbmaybe you can use a paste service (like https://paste.opendev.org) to share your build log?18:50
atmarkone sec18:50
atmarkclarkb: https://clbin.com/aw4fH18:59
atmarkpaste.opendev.org is limited to a number of lines 18:59
clarkbI think the fatal issue may be the unknown filesystem errors. Those don't occur in our logs https://nb01.opendev.org/ubuntu-focal-d6501fe174b54f9896797cc1cc0900e4.log19:00
clarkbare you supplying a custom disk mapping?19:01
atmarknope19:01
atmarkDIB_RELEASE=focal disk-image-create -o ubuntu-focal.qcow2 vm ubuntu --logfile focal.log19:01
atmarkthat's the command 19:01
atmarkno other extra parameters 19:01
clarkbya the mkfs calls indicate a single device being created with ext4 which is the default19:04
atmarklet me see if bionic hits same the fatal issue 19:09
clarkbI think that error indicates that grub doesn't know which device to install to? Looking at our successful log the /dev/loop1 device is supplied on the command line. Also the flow of that grub install process seems to differ with your log19:10
clarkbare you running latest disk image builder?19:10
atmarkI'm getting fatal issue building bionic too19:10
atmarkyes19:10
atmark(env) ➜  iaas-imagebuilder (c2site-proxmox) ✗ pip freeze | grep diskimage-builder19:11
atmarkdiskimage-builder==3.31.019:11
atmarky19:11
clarkbIthink the difference in the logs is due to us running with debug enabled. If you rerun with -x set it should enable the debug tracing and then hopefully we get a bit more info19:17
clarkbIn particular I think that will give us the exact grub commands used so that we can see if it is targetting the right device19:19
atmarkhere's with -x https://clbin.com/3vdEP19:20
clarkbok that shows it using /dev/loop0 and mkfs makes an ext4 device on /dev/mapper/loop0p1 which lines up. Is it possible that the host system's mkfs is creating an ext4 that the chroot doesn't understand? I would try that bash trick and see if it looks off19:25
clarkboh though grub is also going to install content to the mbr? I don't remember how bios grub works19:26
clarkbbut possibly the partition formatting style matters here too19:26
clarkblooks like MBR according to the log though which is what I would expect19:28
clarkbgoogling around it does sound like ext4 options can do this though19:28
clarkbso maybe grub doesn't like the ext4 filesystem that was created by the host system19:29
atmarkyou are indeed correct, my hostsytem is ext4 19:30
atmarkhost system*19:30
clarkbmore specifically if your host system's mkfs.ext4 tool is creating an ext4 filesystem that is too new for the focal/bionic grub version to install it19:30
clarkb*to install into19:30
clarkbwe currently use debian bullseye mkfs19:31
clarkbbut that may explain it19:31
clarkbatmark: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/184401219:43
clarkbatmark: maybe you can do the bash breakpoint trick and then check if the ext4 fs that is created has that feature enabled. If so I think that would explain it and you can modify mkfs settings to avoid that feature19:43
clarkband maybe dib can be updated to avoid that feature somehow19:43
atmarkclarkb: which line should I append `bash` https://github.com/openstack/diskimage-builder/blob/master/diskimage_builder/elements/bootloader/finalise.d/50-bootloader ?20:07
atmarkI'm guessing between 251 and 25220:11
clarkbatmark: i woudl do it before 24020:38
clarkbreally the main think you need to do is check if the ext4 featuer in the bug above is enabled and then you can tune2fs disable it and then proceed with the build from there20:39
atmarkFilesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum20:48
atmarkis metadata_csum same with metadata_csum_seed ?20:48
atmarkboth are different https://man7.org/linux/man-pages/man8/tune2fs.8.html20:49
clarkbya they are separate. metadata_csum is default since 2012 apparently so should be fine20:49
clarkbatmark: grub-install has a --verbose flag might try adding that to see if unknown filesystem gets extra info?20:51
atmarkI'm going to workaround it for now by building the image inside a VM. I'll play with verbose option and let you know if provides more info. 20:56
atmarkThanks for the help20:56

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!