-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from katlapinka/kasiat/initramfs-update
Add method for updating initramfs accordingly to OS version
- Loading branch information
Showing
2 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# Copyright(c) 2024 Huawei Technologies Co., Ltd. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# | ||
|
||
from core.test_run import TestRun | ||
from test_utils.os_utils import get_distro, Distro | ||
|
||
|
||
def update(): | ||
distro = get_distro() | ||
TestRun.LOGGER.info("Updating initramfs") | ||
match distro: | ||
case Distro.DEBIAN | Distro.UBUNTU: | ||
TestRun.executor.run_expect_success("update-initramfs -u") | ||
case Distro.OPENEULER | Distro.CENTOS | Distro.REDHAT: | ||
TestRun.executor.run_expect_success( | ||
"dracut -f /boot/initramfs-$(uname -r).img $(uname -r)" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters