• Bug#1109348: unblock: chiark-utils/8.0.1

    From Ian Jackson@21:1/5 to All on Tue Jul 15 18:30:01 2025
    XPost: linux.debian.devel.release

    This is a multi-part MIME message sent by reportbug.


    Package: release.debian.org
    Severity: normal
    X-Debbugs-Cc: [email protected]
    Control: affects -1 + src:chiark-utils
    User: [email protected]
    Usertags: unblock

    Please unblock package chiark-utils

    (Please provide enough (but not too much) information to help
    the release team to judge the request efficiently. E.g. by
    filling in the sections below.)

    [ Reason ]

    One of the programs in chiark-utils-bin.deb, xbatmon-simple,
    suffered regression with kernel 6.12.35.

    [ Impact ]

    This program is severely dysfunctional with newer kernels.

    (Even with 6.12.33 it prints a spurious warning, but this is not a
    serious bug. I fixed it on the way as part of diagnosing the serious
    problem.)

    [ Tests ]

    I have tested the fixes manually on the affected system.
    There are no autopkgtests.

    [ Risks ]

    It's possible that I have messed up the algorithms. The code is
    complex and not written in a very obvious style.

    In that case, this one program might be broken on some other kernel
    versions which report differently-weird information in /sys/class/power_supply/*/uevent.

    My ad-hoc tests of the new code are good enough that I think I can be
    confident that it will work correctly with kernels with behaviour
    similar to 6.12.33 and 6.12.33.

    The last time this particular kernel behaviour changed was many years
    ago when USB-C PD power supplies became common.

    There is no risk to other functionality of the package, since that
    code hasn't been touched.

    [ Checklist ]
    [Y] all changes are documented in the d/changelog
    [Y] I reviewed all changes and I approve them
    [Y] attach debdiff against the package in testing

    [ Other info ]
    (Anything else the release team should know.)

    unblock chiark-utils/8.0.1

    diff --git a/cprogs/xbatmon-simple.c b/cprogs/xbatmon-simple.c
    index 8fe9b06..69b07d9 100644
    --- a/cprogs/xbatmon-simple.c
    +++ b/cprogs/xbatmon-simple.c
    @@ -123,7 +123,7 @@ typedef struct batinfo_field {

    #define UEVENT_ENUM_FIELDS(_) \
    _(state, BATTERY, STATUS, "Discharging","Charging","Full","Unknown" ) \ - _(type, BOTH, TYPE, "Mains", "Battery" )
    + _(type, BOTH, TYPE, "Mains", "Battery", "USB" )

    #define CHGST_DISCHARGING 0 /* Reflects order in _(state,...) above */
    #define CHGST_CHARGING 1 /* Also, much code assumes exactly */
    @@ -132,8 +132,9 @@ typedef struct batinfo_field {
    #define CHGST_ERROR 8 /* Except that this one is an extra bit. */

    #define TYPE_MAINS 0 /* Reflects order in _(type,...) above */ -#define TYPE_BATTERY 1 /* Also, much code assumes exactly these two */ -#define TYPE_BOTH 100 /* Except this is a magic invalid value. */ +#define TYPE_BATTERY 1 /* We want exactly one of MAINS & BATTERY */ +#define TYPE_USB 2 /* These get i