Skip to content

Commit

Permalink
Merge pull request #19983 from pevik/fix/add_custom_grub_entries
Browse files Browse the repository at this point in the history
LTP: Adapt record_info() output to Micro
  • Loading branch information
czerw authored Aug 22, 2024
2 parents 2e12332 + 80bee23 commit 29c0b44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/LTP/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use Utils::Architectures;
use repo_tools 'add_qa_head_repo';
use utils;
use kernel 'get_kernel_flavor';
use transactional;

our @EXPORT = qw(
check_kernel_taint
Expand Down Expand Up @@ -97,6 +98,9 @@ sub log_versions {
(is_rt ? 'kernel-rt' : get_kernel_flavor);
my $kernel_pkg_log = '/tmp/kernel-pkg.txt';
my $ver_linux_log = '/tmp/ver_linux_before.txt';

enter_trup_shell(global_options => '-c') if is_transactional;

my $kernel_config = script_output('for f in "/boot/config-$(uname -r)" "/usr/lib/modules/$(uname -r)/config" /proc/config.gz; do if [ -f "$f" ]; then echo "$f"; break; fi; done');

script_run("rpm -qi $kernel_pkg > $kernel_pkg_log 2>&1");
Expand Down Expand Up @@ -139,6 +143,7 @@ sub log_versions {

script_run('env');
script_run('aa-enabled; aa-status');
exit_trup_shell if is_transactional;
}

sub export_ltp_env {
Expand Down
4 changes: 2 additions & 2 deletions lib/bootloader_setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ sub add_custom_grub_entries {
$distro = "SLES" . ' \\?' . get_required_var('VERSION');
}

bmwqemu::diag("Trying to trigger purging old kernels before changing grub menu");
script_run('/sbin/purge-kernels');
bmwqemu::diag("Trying to trigger purging old kernels before changing grub menu (if /sbin/purge-kernels installed)");
script_run('[ -x /sbin/purge-kernels ] && /sbin/purge-kernels');

assert_script_run("cp " . GRUB_CFG_FILE . " $cfg_old");
upload_logs($cfg_old, failok => 1);
Expand Down

0 comments on commit 29c0b44

Please sign in to comment.