Mender-convert: mender-client.service': No such file or directory

I’m currently getting this issue:

2022-02-28 22:25:36 [INFO] [mender-convert-modify] Using configuration file: configs/mender_convert_config
2022-02-28 22:25:36 [INFO] [mender-convert-modify] Using configuration file: ./work/override_compression_config
2022-02-28 22:25:36 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi3_config
2022-02-28 22:25:36 [INFO] [mender-convert-modify] Installing Mender client and related files
2022-02-28 22:25:36 [INFO] [mender-convert-modify] Installing Mender client version latest
modules/probe.sh: line 95: VERSION_CODENAME: unbound variable
2022-02-28 22:25:39 [INFO] [mender-convert-modify] Successfully downloaded mender-client_3.2.1-1+debian+buster_amd64.deb
2022-02-28 22:25:39 [INFO] [mender-convert-modify] Successfully installed mender-client_3.2.1-1+debian+buster_amd64.deb into /mender-convert/work/rootfs/
mender-convert-modify has finished. Cleaning up...
2022-02-28 22:25:39 [ERROR] [mender-convert] mender-convert failed
2022-02-28 22:25:39 [DEBUG] [mender-convert-modify] When running: (./mender-convert-modify:112): run_and_log_cmd():

        sudo ln -sf /lib/systemd/system/mender-client.service         work/rootfs/etc/systemd/system/multi-user.target.wants/mender-client.service
        ln: failed to create symbolic link 'work/rootfs/etc/systemd/system/multi-user.target.wants/mender-client.service': No such file or directory

2022-02-28 22:25:39 [ERROR] [mender-convert] mender-convert failed
2022-02-28 22:25:39 [ERROR] [mender-convert] mender-convert exit code: 1

I think this could be because the golden IMG use’s IPK instead of DEB files?

Hi @BlueWaterCrystal!

Yes, I wouldn’t rule out the possibility of that being related to the ipkformat, however it feels strange. Can you please describe the process you employ to generate the image, respectively the build system in use so I can look into it?

Greetz,
Josef

Hi,

The Image is created with OpenWRT and then the ex4-combined-img is added to mender-convert and target_arch is manually configured in probe.sh.
Arch:x86_64
Bootloader:grub2

Build machine is running Debian 10.

Hi @BlueWaterCrystal

Okay, I’m only guessing now as I’m no OpenWRT user, but: could it be that the expected file just is not there because OpenWRT is not using systemd? In that case, please check the config file that you are using with mender-convert and make sure that MENDER_ENABLE_SYSTEMD is not set to y.

Greetz,
Josef

Hi,

Thank you, that seemed to fix the previous issue but now another issue has occurred

modules/probe.sh: line 95: VERSION_CODENAME: unbound variable
2022-03-02 18:30:12 [INFO] [mender-convert-modify] Successfully downloaded mender-client_3.2.1-1+debian+buster_amd64.deb
2022-03-02 18:30:12 [INFO] [mender-convert-modify] Successfully installed mender-client_3.2.1-1+debian+buster_amd64.deb into /mender-convert/work/rootfs/
2022-03-02 18:30:12 [INFO] [mender-convert-modify] Creating state folder in the data partition for Mender add-ons
find: 'work/rootfs/boot': No such file or directory
find: 'work/rootfs/boot': No such file or directory
find: 'work/rootfs/boot': No such file or directory
2022-03-02 18:30:13 [INFO] [mender-convert-modify] Found Linux kernel image in boot part, moving to rootfs/boot
2022-03-02 18:30:13 [INFO] [mender-convert-modify] Found Linux kernel image:

        /mender-convert/work/boot/boot/vmlinuz

2022-03-02 18:30:13 [INFO] [mender-convert-modify] Unfortunately we where not able to find the initrd image.
2022-03-02 18:30:13 [INFO] [mender-convert-modify] Please specify the image name using MENDER_GRUB_INITRD_IMAGETYPE (only required if your board is using this)
mender-convert-modify has finished. Cleaning up...
2022-03-02 18:30:13 [ERROR] [mender-convert] mender-convert failed
2022-03-02 18:30:13 [DEBUG] [mender-convert-modify] When running: (./mender-convert-modify:165): run_and_log_cmd():

        sudo ln -s vmlinuz work/rootfs/boot/kernel
        ln: failed to create symbolic link 'work/rootfs/boot/kernel': Not a directory

2022-03-02 18:30:13 [ERROR] [mender-convert] mender-convert failed
2022-03-02 18:30:13 [ERROR] [mender-convert] mender-convert exit code: 1

Setting MENDER_GRUB_INITRD_IMAGETYPE yields similar result.
Does the golden img partition size need to be a certain size or is it automatically increased by the media-convert?

Hi @BlueWaterCrystal

More guesswork here, but the /boot/boot/vmlinuz path sounds strange. Is the kernel and initrd actually located right under /boot, or are there additional hierarchy layers? And are you actually using an initrd?

Basically you seem to be on the right track, but the configuration file needs proper tweaking

Greetz,
Josef

Hi,

I don’t believe it has an initrd, could that be the issue?

BOOT Partition:

BOOT:
/GRUB
VMLINZ

Hi @BlueWaterCrystal

Hmhmhm. It might diverging here now a bit, but is there any specific reason why you want to use mender-convert to modify the image, instead of integrating into the OpenWRT build process? Generally speaking, mender-convert is targetted at debianoids, and therefore making it work in your situation seems to be problematic.

Greetz,
Josef