[Merge] ~cpete/ubuntu/+source/apport:updated-subiquity-hook into ~ubuntu-core-dev/ubuntu/+source/apport:ubuntu/devel

Chris Peterson mp+454563 at code.launchpad.net
Tue Jan 23 21:16:36 UTC 2024



Diff comments:

> diff --git a/debian/package-hooks/subiquity.py b/debian/package-hooks/subiquity.py
> index 948a8e7..0786582 100644
> --- a/debian/package-hooks/subiquity.py
> +++ b/debian/package-hooks/subiquity.py
> @@ -30,22 +38,41 @@ def add_info(report, unused_ui):
>  }
>  """
>  
> -    # add in subiquity stuff
> -    hookutils.attach_file_if_exists(
> -        report, "/var/log/installer/subiquity-curtin-install.conf", "CurtinConfig"
> -    )
> -    hookutils.attach_file_if_exists(
> -        report, "/var/log/installer/curtin-install.log", "CurtinLog"
> -    )
> -    hookutils.attach_file_if_exists(
> -        report, "/var/log/installer/block/probe-data.json", "ProbeData"
> -    )
> -
> -    # collect desktop installer details if available
> -    desktoplog = os.path.realpath("/var/log/installer/ubuntu_desktop_installer.log")
> -    if os.path.exists(desktoplog):
> -        hookutils.attach_file(report, desktoplog, "DesktopInstallerLog")
> -        report.add_tags(["ubuntu-desktop-installer"])

Missing the DesktopInstallerRev key and the ubuntu-desktop-installer tag was an oversight on my part. I'll update with a fix for this. The desktop log is still attached under UdiLog

> -        snapdir = os.path.realpath("/snap/ubuntu-desktop-installer/current")
> -        if os.path.exists(snapdir):
> -            report["DesktopInstallerRev"] = os.path.basename(snapdir)
> +    # add in hardware information
> +    hookutils.attach_hardware(report)
> +
> +    # static subiquity generated logs
> +    log_map = {
> +        "InstallerServerLog": "/var/log/installer/subiquity-server-debug.log",
> +        "InstallerServerLogInfo": "/var/log/installer/subiquity-server-info.log",
> +        "InstallerClientLog": "/var/log/installer/subiquity-client-debug.log",
> +        "InstallerClientLogInfo": "/var/log/installer/subiquity-client-info.log",
> +        "CurtinLog": "/var/log/installer/curtin-install.log",
> +        "CurtinAptConfig": "var/log/installer/curtin-install/subiquity-curtin-apt.conf",
> +        "CurtinCurthooksConfig": "/var/log/installer/curtin-install/subiquity-curthooks.conf",
> +        "CurtinExtractConfig": "/var/log/installer/curtin-install/subiquity-extract.conf",
> +        "CurtinInitialConfig": "/var/log/installer/curtin-install/subiquity-initial.conf",
> +        "CurtinPartitioningConfig": "/var/log/installer/curtin-install/subiquity-partitioning.conf",
> +        "ProbeData": "/var/log/installer/block/probe-data.json",
> +        "Traceback": "/var/log/installer/subiquity-traceback.txt",
> +        "NetplanInstallerConfig": "/etc/netplan/00-installer-config.yaml",
> +        "NetplanSnapdConfig": "/etc/netplan/00-snapd-config.yaml",
> +    }
> +
> +    # Add journal log - from the installer if it exists or from the system
> +    if "InstallerJournal" not in report:
> +        installer_journal = "/var/log/installer/installer-journal.txt"
> +        if os.path.exists(installer_journal):
> +            log_map["InstallerJournal"] = installer_journal
> +        else:
> +            report["SystemJournal"] = hookutils.recent_syslog(re.compile("."))
> +
> +    # Avoid adding udi log when symlink is incorrectly set
> +    UdiLog = os.path.realpath("/var/log/installer/ubuntu_desktop_installer.log")
> +    if os.path.exists(UdiLog):
> +        log_map["UdiLog"] = UdiLog
> +
> +    # Attach logs if they exist
> +    for name, path in log_map.items():
> +        real_path = os.path.realpath(path)
> +        hookutils.attach_file_if_exists(report, real_path, name)


-- 
https://code.launchpad.net/~cpete/ubuntu/+source/apport/+git/apport/+merge/454563
Your team Ubuntu Core Development Team is subscribed to branch ~ubuntu-core-dev/ubuntu/+source/apport:ubuntu/devel.




More information about the Ubuntu-reviews mailing list