Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random losetup errors while building inside mock #238

Closed
benzea opened this issue Aug 10, 2017 · 5 comments
Closed

Random losetup errors while building inside mock #238

benzea opened this issue Aug 10, 2017 · 5 comments

Comments

@benzea
Copy link

benzea commented Aug 10, 2017

I am trying to build a Fedora 26 live image inside mock. For this I am currently using "--old-chroot" option for mock as otherwise /dev/loop does not even exist.

(The -squashfs_args "-noD -noI -noF -noX -no-duplicates" was me trying to speed up mksquashfs, not that it worked.)

2017-08-10 16:15:46,260: Configuring installed system
2017-08-10 16:15:46,312: .
2017-08-10 16:15:46,313: Creating users
2017-08-10 16:15:46,327: .
2017-08-10 16:15:46,327: Configuring addons
2017-08-10 16:15:59,737: .
2017-08-10 16:15:59,738: Generating initramfs
2017-08-10 16:16:01,522: .
2017-08-10 16:16:01,522: Running post-installation scripts
2017-08-10 16:16:01,523: .
2017-08-10 16:16:01,523: Storing configuration files and kickstarts
2017-08-10 16:16:01,524: .
2017-08-10 16:16:34,460: Shutting down log processing
2017-08-10 16:16:35,316: Disk Image install successful
2017-08-10 16:16:35,316: working dir is /var/tmp/lmc-work-_eugkhmt
2017-08-10 16:31:10,101: Rebuilding initrds
2017-08-10 16:31:10,101: dracut args = ['--xz', '--add', 'livenet dmsquash-live convertfs pollcdrom qemu qemu-net', '--omit', 'plymouth', '--no-hostonly', '--debug', '--no-early-microcode']
2017-08-10 16:31:10,103: rebuilding boot/initramfs-4.11.11-300.fc26.x86_64.img
2017-08-10 16:31:52,932: Building boot.iso
2017-08-10 16:31:52,981: running x86.tmpl
2017-08-10 16:32:00,012: command output:
Traceback (most recent call last):
  File "/usr/sbin/mkefiboot", line 167, in <module>
    main()
  File "/usr/sbin/mkefiboot", line 160, in main
    mkefiboot(opt.bootdir, opt.outfile, opt.label)
  File "/usr/sbin/mkefiboot", line 33, in mkefiboot
    mkdosimg(None, outfile, label=label, graft={'EFI/BOOT':bootdir})
  File "/usr/lib/python3.6/site-packages/pylorax/imgutils.py", line 437, in mkdosimg
    mkfsargs=["-n", label], graft=graft)
  File "/usr/lib/python3.6/site-packages/pylorax/imgutils.py", line 417, in mkfsimage
    with LoopDev(outfile, size) as loopdev:
  File "/usr/lib/python3.6/site-packages/pylorax/imgutils.py", line 297, in __enter__
    self.loopdev = loop_attach(self.filename)
  File "/usr/lib/python3.6/site-packages/pylorax/imgutils.py", line 154, in loop_attach
    dev = runcmd_output(["losetup", "--find", "--show", outfile])
  File "/usr/lib/python3.6/site-packages/pylorax/executils.py", line 347, in runcmd_output
    return execWithCapture(cmd[0], cmd[1:], **kwargs)
  File "/usr/lib/python3.6/site-packages/pylorax/executils.py", line 249, in execWithCapture
    reset_handlers=reset_handlers, reset_lang=reset_lang)[1]
  File "/usr/lib/python3.6/site-packages/pylorax/executils.py", line 201, in _run_program
    raise subprocess.CalledProcessError(proc.returncode, argv, output)
subprocess.CalledProcessError: Command '['losetup', '--find', '--show', '/var/tmp/lmc-work-_eugkhmt/images/efiboot.img']' returned non-zero exit status 1.

2017-08-10 16:32:00,012: command returned failure (1)
2017-08-10 16:32:00,013: template command error in x86.tmpl:
2017-08-10 16:32:00,013:   runcmd mkefiboot --label=ANACONDA /var/tmp/lmc-work-_eugkhmt/EFI/BOOT /var/tmp/lmc-work-_eugkhmt/images/efiboot.img
2017-08-10 16:32:00,015:   subprocess.CalledProcessError: Command '['mkefiboot', '--label=ANACONDA', '/var/tmp/lmc-work-_eugkhmt/EFI/BOOT', '/var/tmp/lmc-work-_eugkhmt/images/efiboot.img']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/usr/sbin/livemedia-creator", line 1476, in <module>
    main()
  File "/usr/sbin/livemedia-creator", line 1413, in main
    result_dir = make_livecd(opts, mount_dir, work_dir)
  File "/usr/sbin/livemedia-creator", line 637, in make_livecd
    tb.build()
  File "/usr/lib/python3.6/site-packages/pylorax/treebuilder.py", line 311, in build
    self._runner.run(templatefile, kernels=self.kernels)
  File "/usr/lib/python3.6/site-packages/pylorax/ltmpl.py", line 220, in run
    self._run(commands)
  File "/usr/lib/python3.6/site-packages/pylorax/ltmpl.py", line 239, in _run
    f(*args)
  File "/usr/lib/python3.6/site-packages/pylorax/ltmpl.py", line 515, in runcmd
    stdout = runcmd_output(cmd)
  File "/usr/lib/python3.6/site-packages/pylorax/executils.py", line 347, in runcmd_output
    return execWithCapture(cmd[0], cmd[1:], **kwargs)
  File "/usr/lib/python3.6/site-packages/pylorax/executils.py", line 249, in execWithCapture
    reset_handlers=reset_handlers, reset_lang=reset_lang)[1]
  File "/usr/lib/python3.6/site-packages/pylorax/executils.py", line 201, in _run_program
    raise subprocess.CalledProcessError(proc.returncode, argv, output)
subprocess.CalledProcessError: Command '['mkefiboot', '--label=ANACONDA', '/var/tmp/lmc-work-_eugkhmt/EFI/BOOT', '/var/tmp/lmc-work-_eugkhmt/images/efiboot.img']' returned non-zero exit status 1.
Finish: chroot ['livemedia-creator --squashfs_args "-noD -noI -noF -noX -no-duplicates" --ks flat-hwtest-live.ks --no-virt --resultdir /var/lmc --project Fedora-HWTest --make-iso --kernel-args="crashkernel=256M" --volid Fedora-HWTest-26 --iso-only --iso-name Fedora-HWTest-26-x86_64.iso --releasever 26 --title Fedora-HWTest-live --macboot']
ERROR: Command failed: 
 # /bin/sh -c livemedia-creator --squashfs_args "-noD -noI -noF -noX -no-duplicates" --ks flat-hwtest-live.ks --no-virt --resultdir /var/lmc --project Fedora-HWTest --make-iso --kernel-args="crashkernel=256M" --volid Fedora-HWTest-26 --iso-only --iso-name Fedora-HWTest-26-x86_64.iso --releasever 26 --title Fedora-HWTest-live --macboot
@bcl
Copy link
Contributor

bcl commented Aug 14, 2017

Try adding this patch to mock and see if it works better for you: rpm-software-management/mock#107

@benzea
Copy link
Author

benzea commented Aug 16, 2017

OK, seems pretty good. I have done 3 builds in a row without an issue so far.

@bleve
Copy link

bleve commented Aug 18, 2017

Noticed same error with epel7 mock. Patch fixed the issue here too.

@yuvalturg
Copy link
Contributor

loop-control creates loop devices under /dev outside mock even if the request is from inside - just add a few loop devices before calling lmc if it's still an issue... something like:
seq 0 9 | xargs -I {} mknod /dev/loop{} b 7 {}

@bcl
Copy link
Contributor

bcl commented Sep 28, 2017

mock --old-chroot now creates the loop devices even if they aren't present on the host. Closing this.

@bcl bcl closed this as completed Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants