Public bug reported:

On a Dell 7000 Micro (Intel 12700T), plugged into mains power,
on_ac_power reports false.

As the micro computer is plugged into mains power, I had expected it
instead to report true.

/sys/class/power_supply$ ls
ucsi-source-psy-USBC000:001

/sys/class/power_supply/ucsi-source-psy-USBC000:001$ cat type
USB

/sys/class/power_supply/ucsi-source-psy-USBC000:001$ cat online
0

The initial logic in /usr/bin/on_ac_power goes:
if [ -d /sys/class/power_supply/ ]; then
    for FN in /sys/class/power_supply/*; do
        if test -d "${FN}" && test -r "${FN}/type"; then
            type="$(cat "${FN}/type")"
            case "${type}" in
            Mains|USB*|BrickID|Wireless)
                if [ -r "${FN}/online" ]; then
                    online="$(cat "${FN}/online")"
                    [ "$online" = 1 ] && exit 0
                    [ "$online" = 0 ] && OFF_LINE_P=yes
                fi;;
            esac
        fi
    done
    [ "${OFF_LINE_P}" = "yes" ] && exit 1
fi

Due the adapter being of type USB and the online status being 0,
OFF_LINE_P is set to "yes" and the script exits with status code 1.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: powermgmt-base 1.36
Uname: Linux 5.17.0-051700-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
Date: Fri May 13 11:50:59 2022
Dependencies:
 
InstallationDate: Installed on 2022-04-22 (21 days ago)
InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Release amd64 
(20220421)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: powermgmt-base
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: powermgmt-base (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug jammy uec-images

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to powermgmt-base in Ubuntu.
https://bugs.launchpad.net/bugs/1973359

Title:
  on_ac_power says false, but real answer is true

Status in powermgmt-base package in Ubuntu:
  New

Bug description:
  On a Dell 7000 Micro (Intel 12700T), plugged into mains power,
  on_ac_power reports false.

  As the micro computer is plugged into mains power, I had expected it
  instead to report true.

  /sys/class/power_supply$ ls
  ucsi-source-psy-USBC000:001

  /sys/class/power_supply/ucsi-source-psy-USBC000:001$ cat type
  USB

  /sys/class/power_supply/ucsi-source-psy-USBC000:001$ cat online
  0

  The initial logic in /usr/bin/on_ac_power goes:
  if [ -d /sys/class/power_supply/ ]; then
      for FN in /sys/class/power_supply/*; do
          if test -d "${FN}" && test -r "${FN}/type"; then
              type="$(cat "${FN}/type")"
              case "${type}" in
              Mains|USB*|BrickID|Wireless)
                  if [ -r "${FN}/online" ]; then
                      online="$(cat "${FN}/online")"
                      [ "$online" = 1 ] && exit 0
                      [ "$online" = 0 ] && OFF_LINE_P=yes
                  fi;;
              esac
          fi
      done
      [ "${OFF_LINE_P}" = "yes" ] && exit 1
  fi

  Due the adapter being of type USB and the online status being 0,
  OFF_LINE_P is set to "yes" and the script exits with status code 1.

  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: powermgmt-base 1.36
  Uname: Linux 5.17.0-051700-generic x86_64
  ApportVersion: 2.20.11-0ubuntu82
  Architecture: amd64
  Date: Fri May 13 11:50:59 2022
  Dependencies:
   
  InstallationDate: Installed on 2022-04-22 (21 days ago)
  InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Release amd64 
(20220421)
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: powermgmt-base
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/powermgmt-base/+bug/1973359/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to