Commit e4f6b72e authored by Harald Sitter's avatar Harald Sitter

attempt to useful output out of sfdisk

hijack sfdisk calls and route their output through tee into a log we can
archive
parent 95898fdd
......@@ -29,3 +29,18 @@ settings = YAML.load_file(file)
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)
#!/bin/sh
set -ex
echo "" >> /tmp/sfdisk.log
echo "" >> /tmp/sfdisk.log
echo "" >> /tmp/sfdisk.log
echo "sfdisk $@" >> /tmp/sfdisk.log
/sbin/sfdisk.orig "$@" 2>&1 | tee -a /tmp/sfdisk.log
EOF
File.chmod(0o755, '/sbin/sfdisk')
......@@ -195,6 +195,8 @@ sub upload_calamares_logs {
upload_logs '/home/neon/.cache/Calamares/session.log', failok => 1;
# Even newer:
upload_logs '/home/neon/.cache/calamares/session.log', failok => 1;
upload_logs '/tmp/sfdisk.log', failok => 1;
}
sub post_fail_hook {
......
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