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

logging: log content of /root/lorax-packages if available #5247

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions anaconda.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def setup_environment():
sys.exit(0)

log.info("%s %s", sys.argv[0], util.get_anaconda_version_string(build_time_version=True))
log.debug("Image packages list: %s", util.get_image_packages_info())

if opts.updates_url:
log.info("Using updates from: %s", opts.updates_url)
Expand Down
2 changes: 2 additions & 0 deletions pyanaconda/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ class SecretStatus(Enum):
# screenshots
SCREENSHOTS_DIRECTORY = "/tmp/anaconda-screenshots"

PACKAGES_LIST_FILE = "/root/lorax-packages.log"

CMDLINE_FILES = [
"/proc/cmdline",
"/run/install/cmdline",
Expand Down
9 changes: 8 additions & 1 deletion pyanaconda/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from pyanaconda.core.path import make_directories, open_with_perm, join_paths
from pyanaconda.core.process_watchers import WatchProcesses
from pyanaconda.core.constants import DRACUT_SHUTDOWN_EJECT, \
IPMI_ABORTED, X_TIMEOUT
IPMI_ABORTED, X_TIMEOUT, PACKAGES_LIST_FILE
from pyanaconda.core.live_user import get_live_user
from pyanaconda.errors import RemovedModuleError

Expand Down Expand Up @@ -972,3 +972,10 @@ def restorecon(paths, root, skip_nonexistent=False):
return False
else:
return True


def get_image_packages_info():
if os.path.exists(PACKAGES_LIST_FILE):
return ' '.join(line.strip() for line in open(PACKAGES_LIST_FILE).readlines())
else:
return ''