Commit e9a32b38 authored by Harald Sitter's avatar Harald Sitter

convert sfdisk debug override to hacky workaround for bug

this turned out to be a race between udevd acting on actions taken
by calamares' mount cleanup code and sfdisk run by kpmcore.

in lieu of an upstream fix we'll force a settle before all sfdisk calls.
these should be super fast when there's nothing to settle.

this change should make the partitioning test pass reliably again
parent 18194c10
......@@ -30,23 +30,15 @@ exec_rule = settings['sequence'].find { |x| x.key?('exec') }
exec_rule['exec'] = %w[partition]
File.write(file, YAML.dump(settings))
require 'fileutils'
FileUtils.cp('/sbin/sfdisk', '/sbin/sfdisk.orig', verbose: true)
File.write('/sbin/sfdisk', <<-EOF)
set -e
udevadm settle --timeout=8
echo "" >> /tmp/sfdisk-stdout.log
echo "" >> /tmp/sfdisk-stdout.log
echo "" >> /tmp/sfdisk-stdout.log
echo "sfdisk $@" >> /tmp/sfdisk-stdout.log
echo "" >> /tmp/sfdisk-stderr.log
echo "" >> /tmp/sfdisk-stderr.log
echo "" >> /tmp/sfdisk-stderr.log
echo "sfdisk $@" >> /tmp/sfdisk-stderr.log
/sbin/sfdisk.orig "$@" > >(tee -a /tmp/sfdisk-stdout.log) 2> >(tee -a sfdisk-stderr.log >&2)
exec /sbin/sfdisk.orig "$@"
File.chmod(0o755, '/sbin/sfdisk')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment