Create mixer image

I am trying to create my custom live image of Clear Linux using mixer. The image is created using the following .yaml.

block-devices: [
   {name: "bdevice", file: "live-server.img"}
]

targetMedia:
- name: ${bdevice}
  type: disk
  children:
  - name: ${bdevice}1
    fstype: vfat
    mountpoint: /boot
    size: "150M"
    type: part
  - name: ${bdevice}2
    fstype: swap
    size: "32M"
    type: part
  - name: ${bdevice}3
    fstype: ext4
    mountpoint: /
    size: "3.0G"
    type: part

bundles: [
  os-core,
  os-core-update,
  NetworkManager,
  clr-installer,
  telemetrics,
  vim,
  ]

offline: true

autoUpdate: false
postArchive: false
postReboot: false
telemetry: false
iso: true
isoPublisher: Intel Corporation
isoApplicationId: server
keepImage: true
autoUpdate: false
copySwupd: false

keyboard: us
language: en_US.UTF-8
kernel: kernel-native

post-install: [
   {cmd: "${yamlDir}/live-image-post-update-version.py ${chrootDir}"},
   {cmd: "${yamlDir}/live-server-post-install.sh ${chrootDir}"},
]

version: 40

The mixer is in version 40 and the bundles are:

admin@clr-35fa9f575a0e451b80c8b8dc52b2d1aa~/mixer $ sudo mixer bundle list
NetworkManager        (upstream bundle) 
bootloader            (upstream bundle) 
clr-installer         (upstream bundle) 
curl                  (upstream bundle) 
editors               (local bundle)    
emacs                 (upstream bundle) 
findutils             (upstream bundle) 
glibc-locale          (upstream bundle) 
iproute2              (upstream bundle) 
joe                   (upstream bundle) 
jq                    (upstream bundle) 
kbd                   (upstream bundle) 
less                  (upstream bundle) 
lib-openssl           (upstream bundle) 
libglib               (upstream bundle) 
libstdcpp             (upstream bundle) 
linux-firmware-extras (upstream bundle) 
linux-firmware-wifi   (upstream bundle) 
openssh-client        (upstream bundle) 
openssh-server        (upstream bundle) 
os-core               (upstream bundle) 
os-core-plus          (upstream bundle) 
os-core-update        (upstream bundle) 
os-core-webproxy      (upstream bundle) 
p11-kit               (upstream bundle) 
perl-basic            (upstream bundle) 
python3-basic         (upstream bundle) 
syslinux              (upstream bundle) 
telemetrics           (upstream bundle) 
vim                   (upstream bundle) 
wpa_supplicant        (upstream bundle) 

And trying to create the image with the command:

sudo mixer build image --template $PWD/live-image.yaml

This error appears:

2020/03/05 16:19:10 [INF] Umounting rootDir: /tmp/install-238996783
2020/03/05 16:19:10 [DBG] Unmounted ok: /tmp/install-238996783/sys
2020/03/05 16:19:10 [DBG] Unmounted ok: /tmp/install-238996783/proc
2020/03/05 16:19:10 [DBG] Unmounted ok: /tmp/install-238996783/dev
2020/03/05 16:19:10 [DBG] Unmounted ok: /tmp/install-238996783/boot
2020/03/05 16:19:11 [DBG] Unmounted ok: /tmp/install-238996783
2020/03/05 16:19:11 [INF] Removing rootDir: /tmp/install-238996783
2020/03/05 16:19:11 [DBG] losetup -d /dev/loop0
2020/03/05 16:19:11 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 16:19:11 [DBG] [Previous line repeated 4 times]
2020/03/05 16:19:11 [DBG] cmd.Env: []
2020/03/05 16:19:11 [DBG] telem-record-gen --severity 3 --class org.clearlinux/clr-installer/massinstall --no-post --echo --event-id d6070882c0a11ae4f878bb730eacfa96 --payload version=2.3.7
fork/exec /tmp/install-238996783/usr/bin/clr-boot-manager: no such file or directory

Error Trace:
errors.Wrap()
     errors/errors.go:91
controller.contentInstall()
     controller/controller.go:640

2020/03/05 16:19:11 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 16:19:11 [DBG] [Previous line repeated 4 times]
2020/03/05 16:19:11 [DBG] cmd.Env: []
2020/03/05 16:19:11 [ERR] fork/exec /tmp/install-238996783/usr/bin/clr-boot-manager: no such file or directory

Error Trace:
errors.Wrap()
     errors/errors.go:91
controller.contentInstall()
     controller/controller.go:640

The mixer directory has this files, I am also using the default files from https://cdn.download.clearlinux.org/current/config/image/

admin@clr-35fa9f575a0e451b80c8b8dc52b2d1aa~/mixer $ ls
add-server-login-issue.sh  kvm.log                     live-image-post-update-version.py  live-server-post-install.sh  local-rpms               mixbundles   pre-install-clr-installer.yaml  update            upstreamversion
builder.conf               kvm.yaml                    live-server.img                    live-server.yaml             local-telemetry-post.sh  mixer.state  private.pem                     upstream-bundles  wait-to-boot-post.sh
kvm.img                    linux-5.4.6-883.x86_64.rpm  live-server.log                    local-bundles                local-yum                mixversion   Swupd_Root.pem                  upstreamurl

How can it be solved?

you are missing the (required) bootloader bundle in the image list - it’s not enough to have it in the mix, it needs to be in the image - put it in your .yaml.

I’ve just put it into my .yaml. Now another error appears. This is the result when executing the building command:

admin@clr-35fa9f575a0e451b80c8b8dc52b2d1aa~/mixer $ sudo mixer build image --template $PWD/live-server.yaml
Password: 
Config file specifies a target "version", forcing auto-update off.
Running pre-install hooks [success]
Writing partition table to: loop0 [success]
Updating partition table for: loop0 [success]
Adjusting filesystem configurations [success]
Writing vfat file system to loop0p1 '/boot' [success]
Writing swap file system to loop0p2 [success]
Writing ext4 file system to loop0p3 '/' [success]
Writing mount files [success]
Target OS: Downloading required manifests [success]
Target OS: Downloading required packs [success]
Target OS: Extracting required packs [success]
Target OS: Verifying installed files [success]
Target OS: Verifying staged files [success]
Target OS: Downloading missing files [success]
Target OS: Extracting missing files [success]
Target OS: Installing base OS and configured bundles [success]
Target OS: Running post-update scripts [success]
Offline Content: Downloading required manifests [success]
Offline Content: Downloading required packs [success]
Offline Content: Extracting required packs [success]
Offline Content: Verifying installed files [success]
Offline Content: Verifying staged files [success]
Offline Content: Downloading missing files [success]
Offline Content: Extracting missing files [success]
Disabling automatic updates [success]
Installing boot loader [success]
Running post-install hooks [success]
Saving the installation results [success]
Making temp directories for ISO creation [success]
Making squashfs of rootfs [success]
ISO Initrd: Downloading required manifests [success]
ISO Initrd: Downloading required packs [success]
ISO Initrd: Extracting required packs [success]
ISO Initrd: Verifying installed files [success]
ISO Initrd: Verifying staged files [success]
ISO Initrd: Downloading missing files [success]
ISO Initrd: Extracting missing files [success]
ISO Initrd: Installing base OS and configured bundles [success]
ISO Initrd: Running post-update scripts [success]
Installing the base system for initrd [success]
Creating and installing init script to initrd [*failed*]
Building initrd image [success]
Building efiboot image [*failed*]
Setting up BIOS boot with isolinux [*failed*]
Building ISO [*failed*]
Cleaning up from ISO creation [success]
Installation completed [success]

This is the content of the live-server.log file:

2020/03/05 17:32:50 [DBG] ISO Initrd: : Task add_missing_files completed
2020/03/05 17:32:50 [DBG] { "type" : "info", "msg" : "Inspected 5294 files" },
2020/03/05 17:32:50 [DBG] { "type" : "info", "msg" : "  5292 files were missing" },
2020/03/05 17:32:50 [DBG] { "type" : "info", "msg" : "    5292 of 5292 missing files were installed" },
2020/03/05 17:32:50 [DBG] { "type" : "info", "msg" : "    0 of 5292 missing files were not installed" },
2020/03/05 17:32:50 [DBG] { "type" : "progress", "currentStep" : 9, "totalSteps" : 9, "stepCompletion" : -1, "stepDescription" : "run_postupdate_scripts" },
2020/03/05 17:32:50 [DBG] ISO Initrd: : Setting indeterminate progress for task run_postupdate_scripts
2020/03/05 17:32:50 [DBG] { "type" : "info", "msg" : "Calling post-update helper scripts" },
2020/03/05 17:32:50 [DBG] { "type" : "warning", "msg" : "boot files update skipped due to --no-boot-update argument" },
2020/03/05 17:32:53 [DBG] { "type" : "info", "msg" : " Installation successful" },
2020/03/05 17:32:53 [DBG] { "type" : "progress", "currentStep" : 9, "totalSteps" : 9, "stepCompletion" : 100, "stepDescription" : "run_postupdate_scripts" },
2020/03/05 17:32:53 [DBG] ISO Initrd: : Task run_postupdate_scripts completed
2020/03/05 17:32:53 [DBG] { "type" : "end", "section" : "os-install", "status" : 0 }
2020/03/05 17:32:53 [DBG] ]
2020/03/05 17:32:53 [INF] Creating and installing init script to initrd
2020/03/05 17:32:53 [ERR] Failed to determine kernel revision or > 1 kernel found
2020/03/05 17:32:53 [INF] Building initrd image
2020/03/05 17:33:05 [INF] Building efiboot image
2020/03/05 17:33:05 [DBG] fallocate -l 100M /tmp/clrCdroot-141319208/EFI/efiboot.img
2020/03/05 17:33:05 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 17:33:05 [DBG] [Previous line repeated 4 times]
2020/03/05 17:33:05 [DBG] cmd.Env: []
2020/03/05 17:33:05 [DBG] mkfs.fat -n "CLEAR_EFI" /tmp/clrCdroot-141319208/EFI/efiboot.img
2020/03/05 17:33:05 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 17:33:05 [DBG] [Previous line repeated 4 times]
2020/03/05 17:33:05 [DBG] cmd.Env: []
2020/03/05 17:33:05 [DBG] mkfs.fat 4.1 (2017-01-24)
2020/03/05 17:33:05 [DBG] mount -t vfat -o loop /tmp/clrCdroot-141319208/EFI/efiboot.img /tmp/clrEfi-398611718
2020/03/05 17:33:05 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 17:33:05 [DBG] [Previous line repeated 4 times]
2020/03/05 17:33:05 [DBG] cmd.Env: []
2020/03/05 17:33:05 [DBG] cp -pr /tmp/install-310749108/boot/. /tmp/clrEfi-398611718
2020/03/05 17:33:05 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 17:33:05 [DBG] [Previous line repeated 4 times]
2020/03/05 17:33:05 [DBG] cmd.Env: []
2020/03/05 17:33:05 [ERR] Failed to modify efi entries file
2020/03/05 17:33:05 [INF] Setting up BIOS boot with isolinux
2020/03/05 17:33:05 [INF] Building ISO
2020/03/05 17:33:05 [DBG] xorriso -as mkisofs -o live-server.iso -V CLR_ISO -isohybrid-mbr /tmp/clrCdroot-141319208/isolinux/isohdpfx.bin -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e EFI/efiboot.img -no-emul-boot -isohybrid-gpt-basdat /tmp/clrCdroot-141319208
2020/03/05 17:33:05 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 17:33:05 [DBG] [Previous line repeated 4 times]
2020/03/05 17:33:05 [DBG] cmd.Env: []
2020/03/05 17:33:05 [DBG] GNU xorriso 1.5.2 : RockRidge filesystem manipulator, libburnia project.
2020/03/05 17:33:05 [DBG] Drive current: -outdev 'stdio:live-server.iso'
2020/03/05 17:33:05 [DBG] Media current: stdio file, overwriteable
2020/03/05 17:33:05 [DBG] Media status : is blank
2020/03/05 17:33:05 [DBG] Media summary: 0 sessions, 0 data blocks, 0 data, 23.2g free
2020/03/05 17:33:05 [DBG] Added to ISO image: directory '/'='/tmp/clrCdroot-141319208'
2020/03/05 17:33:05 [DBG] xorriso : UPDATE :       8 files added in 1 seconds
2020/03/05 17:33:05 [DBG] xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/tmp/clrCdroot-141319208/isolinux/isohdpfx.bin'
2020/03/05 17:33:05 [DBG] xorriso : FAILURE : Cannot find in ISO image: -boot_image ... bin_path='/isolinux/isolinux.bin'
2020/03/05 17:33:05 [DBG] xorriso : UPDATE :       8 files added in 1 seconds
2020/03/05 17:33:05 [DBG] xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
2020/03/05 17:33:05 [INF] Cleaning up from ISO creation
2020/03/05 17:33:06 [ERR] exit status 5
2020/03/05 17:33:06 [INF] Installation completed
2020/03/05 17:33:06 [INF] Umounting rootDir: /tmp/install-310749108
2020/03/05 17:33:06 [DBG] Unmounted ok: /tmp/install-310749108/sys
2020/03/05 17:33:06 [DBG] Unmounted ok: /tmp/install-310749108/proc
2020/03/05 17:33:06 [DBG] Unmounted ok: /tmp/install-310749108/dev
2020/03/05 17:33:06 [DBG] Unmounted ok: /tmp/install-310749108/boot
2020/03/05 17:33:06 [DBG] Unmounted ok: /tmp/install-310749108
2020/03/05 17:33:06 [INF] Removing rootDir: /tmp/install-310749108
2020/03/05 17:33:06 [DBG] losetup -d /dev/loop0
2020/03/05 17:33:06 [DBG] Using default shellProxy.DefaultGetProxyValue
2020/03/05 17:33:06 [DBG] [Previous line repeated 4 times]
2020/03/05 17:33:06 [DBG] cmd.Env: []

It looks like the clr-installer config file is using the kernel-native bundle, but this bundle is not in your mix. You will need to mixer bundle add kernel-native and re-build the mix with the added bundle.

@jwakre can we maybe make the errors more specific and provide the solution?

I filed an issue to improve the clarity of error messages when missing bundle dependencies: https://github.com/clearlinux/clr-installer/issues/676

1 Like