elemental-toolkit icon indicating copy to clipboard operation
elemental-toolkit copied to clipboard

xorriso failure when trying to build my 1st derivative iso standard image from examples/standard

Open j-landru opened this issue 2 years ago • 5 comments

cos-toolkit version:

Latest, downloaded using git clone command

CPU architecture, OS, and Version:

Linux hlandru-ptux04 5.10.61-gentoo #1 SMP Mon Aug 30 11:05:59 CEST 2021 x86_64 Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz GenuineIntel GNU/Linux

Describe the bug

Trying to learn cOS-toolkit by building my 1st derivative iso live image from unmodified standard example, I'm unable to generate iso either with syslinux as well as grub2. Squashfs is built but xorriso step failed displaying.

  • from syslinux iso.yaml file

FAILURE : Given path does not exist on disk: -boot_image system_area='/tmp/luet-geniso2259780003/tempISO/boot/syslinux/isohdpfx.bin'

  • from grub2 iso.yaml file

FAILURE : Given path does not exist on disk: -boot_image system_area='/tmp/luet-geniso3847620838/tempISO/boot/x86_64/loader/boot_hybrid.img'

Reading the RTFM, and googling don't help me, so sorry if it's not the good space to post such beginner issue. What am I missing within the doc or doing wrong ?

Thanks

To Reproduce

Build standard image from /examples/standard/Dockerfile en push it on personal dockerhub repository

  1. docker build the image
  2. docker push the image to some registry
  3. set iso.yaml file copying/pasting from doc examples

Build the iso file following "Build iso" docker run -v $PWD:/cOS -v /var/run:/var/run --entrypoint /usr/bin/luet-makeiso -ti --rm quay.io/costoolkit/toolchain ./iso.yaml --image jlandru/example

Expected behavior

Obtaining an iso image file to VM boot it in live mode.

Logs

  • Log using syslinux iso.yaml : `. . . INFO[0443] 🍹 Generate ISO cOS-0.20220411.iso
    xorriso 1.4.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:cOS-0.20220411.iso' Media current: stdio file, overwriteable Media status : is blank Media summary: 0 sessions, 0 data blocks, 0 data, 15.5g free Added to ISO image: directory '/'='/tmp/luet-geniso2259780003/tempISO' xorriso : UPDATE : 5 files added in 1 seconds xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/tmp/luet-geniso2259780003/tempISO/boot/syslinux/isohdpfx.bin' xorriso : FAILURE : Cannot find in ISO image: -boot_image ... bin_path='/boot/syslinux/isolinux.bin' xorriso : UPDATE : 5 files added in 1 seconds xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE' INFO[0443] exit status 5
ERRO[0443] fatal error: exit status 5 Additional context`

  • Log using grub2 iso.yaml ` . . . INFO[0497] 🍹 Generate ISO cOS-0.20220411.iso
    xorriso 1.4.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:cOS-0.20220411.iso' Media current: stdio file, overwriteable Media status : is blank Media summary: 0 sessions, 0 data blocks, 0 data, 15.5g free Added to ISO image: directory '/'='/tmp/luet-geniso3847620838/tempISO' xorriso : UPDATE : 5 files added in 1 seconds xorriso : FAILURE : Given path does not exist on disk: -boot_image system_area='/tmp/luet-geniso3847620838/tempISO/boot/x86_64/loader/boot_hybrid.img' xorriso : FAILURE : Cannot find in ISO image: -boot_image ... bin_path='/boot/x86_64/loader/eltorito.img' xorriso : UPDATE : 5 files added in 1 seconds xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE' INFO[0497] exit status 5
ERRO[0498] fatal error: exit status 5 `

j-landru avatar Apr 11 '22 12:04 j-landru

Hi @j-landru thanks for reporting.

Looks like the error might be before actually calling xorriso. It just complaints about missing artifacts, so I suspect you might miss some artifacts. Could you share your iso.yaml and full logs or at least the Luet part? To me it looks like the packages for uefi and isoimage could be missing:

packages:
  uefi:
  - live/grub2-efi-image
  isoimage:
  - live/grub2
  - live/grub2-efi-image

uefi section defines the artifacts that are included within the FAT16 EFI image used to boot the ISO in EFI firmware. The isoimage section is the root tree of the ISO filesystem plus the squashfs created from your image and the EFI image. The /boot/x86_64/loader/eltorito.img file is provided into the ISO root tree by the package live/grub2, so I suspect this was not installed during the ISO creation.

davidcassany avatar Apr 11 '22 12:04 davidcassany

pretty sure its something like luet failing to install the needed packages because locally I can reproduce the missing packages somehow?

INFO[0027] 🦸  Installing EFI packages                   
                                                                     ██      ██    ██ ███████ ████████ 
                                                                     ██      ██    ██ ██         ██    
                                                                     ██      ██    ██ █████      ██    
                                                                     ██      ██    ██ ██         ██    
                                                                     ███████  ██████  ███████    ██    
                                                                     
                                                                                                                                                                             
                                                                Luet - 0-deps container-based package manager                                                                
                                                                                                                                                                             

                                                  0.30.3-g18881c3283944d9d20461e05b0a7af5a02041776 2022-03-28 02:14:41 UTC
                                                               Luet Copyright (C) 2019-2022 Ettore Di Giacinto
                                                               This program comes with ABSOLUTELY NO WARRANTY.
                                           This is free software, and you are welcome to redistribute it under certain conditions.
           
  Install  
           
 INFO   No packages to install
 INFO   Cleaned: 0 files from /tmp/luet-geniso1194497051/tempUEFI/luetdb/packages

Sounds like quay.io/costoolkit/toolchain may have an empty luet repos? Not sure if that is mentioned on the docs...

Itxaka avatar Apr 11 '22 12:04 Itxaka

umm, probably works on our side due using our make target which adds the repos directly to the iso.yaml.

@j-landru make sure your repositories are added to the iso.yaml so luet-makeiso can install the needed packages!

Itxaka avatar Apr 11 '22 12:04 Itxaka

@Itxaka Thanks for your suggestions.

I'm not familiar with luet tool, which seems cool, and that I discovered same time as cos-toolkit.
To give some additional context info, I'm a k3os orphan user, and I try an alternative to build an immutable iso file to deploy an IPv6 only k3s cluster. But I would like to stay on Alpine distro as for k3os. I found some cos-toolkit alpine Dockerfile on Mudler's c3os project which will be my reference for my own Dockerfile. C3os seems, also to me as a very interesting project I plan to explore later. On that project, iso.yaml file is completed with that stanza :

luet:
  repositories:
  - name: cOS
    enable: true
    urls:
      - quay.io/costoolkit/releases-green
    type: docker

I added that stanza end to my grub2 iso.yaml file.

Now luet actually installs missing packages and iso building goes further but still with no success.

INFO[0516] 🍹 Generate ISO cOS-0.20220411.iso            
xorriso 1.4.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:cOS-0.20220411.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 15.5g free
Added to ISO image: directory '/'='/tmp/luet-geniso3105163948/tempISO'
xorriso : UPDATE : 600 files added in 1 seconds
xorriso : UPDATE : 600 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/tmp/luet-geniso3105163948/tempISO/boot/x86_64/loader/boot_hybrid.img'
xorriso : WARNING : Boot image load size exceeds 65535 blocks of 512 bytes. Will record 0 in El Torito to extend ESP to end-of-medium.
libisofs: NOTE : Automatically adjusted MBR geometry to 1024/77/32
libisofs: NOTE : Aligned image size to cylinder size by 540 blocks
xorriso : UPDATE : Thank you for being patient. Working since 0 seconds.
libburn : SORRY : Failed to open device (a pseudo-drive) : Permission denied
libburn : FATAL : Burn run failed
xorriso : FATAL : -abort_on 'FAILURE' encountered 'FATAL' during image writing
xorriso : NOTE : libburn has now been urged to cancel its operation
xorriso : UPDATE : Thank you for being patient. Working since 1 seconds.
xorriso : UPDATE : Thank you for being patient. Working since 2 seconds.
xorriso : UPDATE : Thank you for being patient. Working since 3 seconds.
xorriso : UPDATE : Thank you for being patient. Working since 4 seconds.
libisofs: MISHAP : Image write cancelled
xorriso : FAILURE : libburn indicates failure with writing.
xorriso : NOTE : -return_with SORRY 32 triggered by problem severity FATAL
INFO[0521] exit status 32                               
ERRO[0522] fatal error: exit status 32

Seems some access rights are missing if I understand libburn error message libburn : SORRY : Failed to open device (a pseudo-drive) : Permission denied

j-landru avatar Apr 11 '22 14:04 j-landru

JFYI, Going a bit further in my quest for cos-toolkit derivative live iso....

As stated in those treads (https://stackoverflow.com/questions/55324152/create-alpine-linux-iso-from-docker-libburn-permission-denied and https://stackoverflow.com/questions/61683448/how-to-run-bash-as-user-root-on-alpine-images-with-docker-su-must-be-suid-to-w), building an iso inside a container requires root rights inside a privileged container (I know, privileged containers are probably not a good idea due to security concerns). But building the cos-toolkit derivative iso with docker --user=root --privileged --userns=host parameters did the trick for me.

docker run -v $PWD:/cOS -v /var/run:/var/run --user=root  --privileged --userns=host --entrypoint /usr/bin/luet-makeiso   -ti --rm quay.io/costoolkit/toolchain ./iso.yaml --image $image

Either grub2 or syslinux iso file can boot a livbivrt UEFI VM in live mode ... It doesn't seem that I'm impacted with Generated ISOs are not 'valid' hybrid https://github.com/rancher-sandbox/cOS-toolkit/issues/1148.

Nota : I've seen on https://github.com/rancher-sandbox/cOS-toolkit/issues/1217, there's some work in progress to port iso building code within elemental tool as build-iso command option, so I presume that iso building howto will evolve sooner or later.

j-landru avatar Apr 13 '22 15:04 j-landru