Skip to content

os: drop the duplicated licence header that #1544 left in base-modes-keep — main is red on the copyright gate - #1565

Closed
bong-water-water-bong wants to merge 1 commit into
mainfrom
fix/base-modes-keep-header
Closed

bong-water-water-bong wants to merge 1 commit into
mainfrom
fix/base-modes-keep-header

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

tools/copyright.py --check fails on main since #1544 merged, and it fails every PR opened against main for a reason none of them caused — I hit it on my own engine#823 work:

run: python3 tools/copyright.py --fix
copyright notice duplicated inside the header window (delete the second copy): os/v3/puppy/base-modes-keep

What is wrong

The file carries the Apache notice twice — lines 1-14, then a second copy at lines 15-17:

# limitations under the License.
# Copyright 2026 bong-water-water-bong      <- duplicated
# SPDX-License-Identifier: Apache-2.0       <- duplicated
#                                           <- duplicated
# Paths in the BASE Puppy layer that must stay group/other-writable (engine#1474). …

Fix

Delete the three duplicated lines. Nothing else changes: the keep-list's explanation and all 11 entries are byte-identical to main (non-comment line count before and after: 11 and 11), and git diff --cached shows exactly the three removed lines.

Verified

python3 tools/copyright.py --check (tree staged)   -> rc 0   (rc 1 before the change)
git diff --cached                                  -> the three removed lines only
git add <paths> only                               -> one file

Fixes the red introduced by #1544; refs #1474, whose keep-list this is — the fix is mechanical and touches no entry.

…keep -- main is red on the copyright gate

`tools/copyright.py --check` fails on main since #1544 merged:

  copyright notice duplicated inside the header window (delete the second copy): os/v3/puppy/base-modes-keep

The file carries the Apache notice twice: lines 1-14, then a second `# Copyright 2026 … / # SPDX-License-Identifier: Apache-2.0 / #`
at lines 15-17 before the keep-list's own explanation. `copyright.py` treats the second copy as a defect, so **every PR opened
against main right now fails the copyright step for a reason none of them caused** (I hit it on my own #823 work).

Fix: delete the three duplicated lines. Nothing else changes -- the keep-list's explanation and all **11** entries are byte-identical
to main (checked by counting non-comment lines before and after: 11 and 11).

Verified: `python3 tools/copyright.py --check` -> rc 0 with the tree staged (rc 1 before); `git diff --cached` shows exactly the
three removed lines; `git add <paths>` only.

Fixes the red introduced by #1544; refs #1474 (whose row the file belongs to).
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

#1565 ready for review at 1df22f3 — mechanical fix for a red that landed with #1544: copyright.py --check fails on main with "copyright notice duplicated inside the header window" on os/v3/puppy/base-modes-keep. Three duplicated lines deleted, keep-list entries unchanged (11 before, 11 after). Every PR against main is red on that step until this lands, mine included.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at 1df22f3d7bde71756dd575b98b7a904369bfb0b0

Verified: os/v3/puppy/base-modes-keep is at one notice pair (2 header lines) at this head — the duplicate #1544 introduced is gone.

Same file as #1562, same one-pair removal, same 0 insertions. Two PRs for one deletion: whichever merges second is a no-op or a conflict, so one should be closed with a pointer at the other. The content is right either way.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: CLOSE — already fixed on main. main carries 1571366 "os: drop the duplicated notice in base-modes-keep, so the copyright gate passes on main (#1560)", and the file at that head has a single SPDX-License-Identifier with no duplicate pair. Verified just now on a main-based tree: python3 tools/copyright.py --check → rc=0.

So the red build this PR fixes no longer exists on the base. Nothing to merge here: rebasing this branch onto main would produce an empty diff.

Worth stating because it affects the queue: #1562/#1565/#1566 are three PRs for one 2-line fix — #1562 and #1566 are byte-identical (both land blob 59852cd8 for os/v3/puppy/base-modes-keep), and #1565 is a 3-line variant that lands a different blob. Merging more than one would conflict. All three are now superseded by #1560; closing them also stops new branches from inheriting the stale red gate (see my verdicts on #1563/#1568, whose build fails on this very message from their base).

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Superseded by #1560 (merged as 1571366), which removed the same duplicated notice in os/v3/puppy/base-modes-keep; main is green again. Closing as a duplicate of the same fix.

bong-water-water-bong pushed a commit that referenced this pull request Nov 8, 2026
…nd (engine#823)

#823 is "only the front USB-A port works on this board", and its remaining step is one plug on a 1bit-OS boot. That step has a
precondition nobody could check in one command -- is the shipped keepawake rule even applicable to the machine in front of me, and
are the controllers awake right now? -- so the one thing that would make the plug meaningful could not be verified before doing it.

  tools/xhci_keepawake_check.sh                    # read-only: DMI match, per-controller power state, verdict
  tools/xhci_keepawake_check.sh --require-awake    # exit 1 unless every controller the rule matches is in D0

It reads the rule's own predicates (board_name == AXB35-02, vendor 0x1022, devices 0x1587/0x1588/0x1589/0x158b, driver xhci_hcd)
and walks every PCI function rather than a hardcoded list, because a BIOS update can move them and a hardcoded list is how a check
silently stops checking anything. Four verdicts, only one of which means "go ahead and plug": NOT THIS BOARD, would bind nothing,
N asleep, all awake. Read-only by default; --apply/--revert perform the rule's single action (power/control=on|auto, root) so the
mechanism is verifiable without a reboot, and revert is the documented way back.

Measured on the board (kernel 7.4.0-rc1-1bit, stock Ubuntu dev boot i.e. WITHOUT the rule):

  0000:c5:00.4  0x1587  xhci_hcd  D3cold  auto
  0000:c7:00.0  0x1588  xhci_hcd  D0      auto     <- front USB-A / BT / JetKVM
  0000:c7:00.3  0x1589  xhci_hcd  D3cold  auto
  0000:c7:00.4  0x158b  xhci_hcd  D3cold  auto
  verdict: 4 controller(s) match the rule; 3 of them are NOT in D0

so the premise still holds on the current kernel -- the fix is not addressing something a newer kernel already fixed -- and
--apply moves all three D3cold -> D0 with --revert putting them back, which is the rule's mechanism verified on this kernel.

tests/xhci_keepawake_check_test.py builds fake sysfs trees (--sysfs-root) and asserts all four verdicts, because CI is not an
AXB35-02: a non-board machine must print NOT THIS BOARD and exit 0 rather than reporting a verdict, an unknown-id AXB35 must say the
rule would bind nothing, three-asleep must fail --require-awake, all-awake must pass it. Registered as ctest xhci_keepawake_check.

docs/axb35-usb-ports.md records the diagnosis, the rule, the measured table, the four verdicts and what is still owed (the plug, and
the _DSM comparison against Windows if a port is still dead after it).

Verified: ctest -R 'xhci_keepawake|spec_decode' in a CI-parity configure -> 2/2 Passed; the test file's 13 checks pass; bash -n;
copyright --check rc 0 for these files (main is red on an unrelated duplicated header, fixed separately in #1565).

refs #823, refs #1474's file (no entry touched).
bong-water-water-bong pushed a commit that referenced this pull request Nov 9, 2026
…nd (engine#823)

precondition nobody could check in one command -- is the shipped keepawake rule even applicable to the machine in front of me, and
are the controllers awake right now? -- so the one thing that would make the plug meaningful could not be verified before doing it.

  tools/xhci_keepawake_check.sh                    # read-only: DMI match, per-controller power state, verdict
  tools/xhci_keepawake_check.sh --require-awake    # exit 1 unless every controller the rule matches is in D0

It reads the rule's own predicates (board_name == AXB35-02, vendor 0x1022, devices 0x1587/0x1588/0x1589/0x158b, driver xhci_hcd)
and walks every PCI function rather than a hardcoded list, because a BIOS update can move them and a hardcoded list is how a check
silently stops checking anything. Four verdicts, only one of which means "go ahead and plug": NOT THIS BOARD, would bind nothing,
N asleep, all awake. Read-only by default; --apply/--revert perform the rule's single action (power/control=on|auto, root) so the
mechanism is verifiable without a reboot, and revert is the documented way back.

Measured on the board (kernel 7.4.0-rc1-1bit, stock Ubuntu dev boot i.e. WITHOUT the rule):

  0000:c5:00.4  0x1587  xhci_hcd  D3cold  auto
  0000:c7:00.0  0x1588  xhci_hcd  D0      auto     <- front USB-A / BT / JetKVM
  0000:c7:00.3  0x1589  xhci_hcd  D3cold  auto
  0000:c7:00.4  0x158b  xhci_hcd  D3cold  auto
  verdict: 4 controller(s) match the rule; 3 of them are NOT in D0

so the premise still holds on the current kernel -- the fix is not addressing something a newer kernel already fixed -- and
--apply moves all three D3cold -> D0 with --revert putting them back, which is the rule's mechanism verified on this kernel.

tests/xhci_keepawake_check_test.py builds fake sysfs trees (--sysfs-root) and asserts all four verdicts, because CI is not an
AXB35-02: a non-board machine must print NOT THIS BOARD and exit 0 rather than reporting a verdict, an unknown-id AXB35 must say the
rule would bind nothing, three-asleep must fail --require-awake, all-awake must pass it. Registered as ctest xhci_keepawake_check.

docs/axb35-usb-ports.md records the diagnosis, the rule, the measured table, the four verdicts and what is still owed (the plug, and
the _DSM comparison against Windows if a port is still dead after it).

Verified: ctest -R 'xhci_keepawake|spec_decode' in a CI-parity configure -> 2/2 Passed; the test file's 13 checks pass; bash -n;
copyright --check rc 0 for these files (main is red on an unrelated duplicated header, fixed separately in #1565).

refs #823, refs #1474's file (no entry touched).
bong-water-water-bong added a commit that referenced this pull request Nov 9, 2026
…nd (engine#823) (#1567)

* tools+docs: the AXB35-02 plug test gets its precondition in one command (engine#823)

precondition nobody could check in one command -- is the shipped keepawake rule even applicable to the machine in front of me, and
are the controllers awake right now? -- so the one thing that would make the plug meaningful could not be verified before doing it.

  tools/xhci_keepawake_check.sh                    # read-only: DMI match, per-controller power state, verdict
  tools/xhci_keepawake_check.sh --require-awake    # exit 1 unless every controller the rule matches is in D0

It reads the rule's own predicates (board_name == AXB35-02, vendor 0x1022, devices 0x1587/0x1588/0x1589/0x158b, driver xhci_hcd)
and walks every PCI function rather than a hardcoded list, because a BIOS update can move them and a hardcoded list is how a check
silently stops checking anything. Four verdicts, only one of which means "go ahead and plug": NOT THIS BOARD, would bind nothing,
N asleep, all awake. Read-only by default; --apply/--revert perform the rule's single action (power/control=on|auto, root) so the
mechanism is verifiable without a reboot, and revert is the documented way back.

Measured on the board (kernel 7.4.0-rc1-1bit, stock Ubuntu dev boot i.e. WITHOUT the rule):

  0000:c5:00.4  0x1587  xhci_hcd  D3cold  auto
  0000:c7:00.0  0x1588  xhci_hcd  D0      auto     <- front USB-A / BT / JetKVM
  0000:c7:00.3  0x1589  xhci_hcd  D3cold  auto
  0000:c7:00.4  0x158b  xhci_hcd  D3cold  auto
  verdict: 4 controller(s) match the rule; 3 of them are NOT in D0

so the premise still holds on the current kernel -- the fix is not addressing something a newer kernel already fixed -- and
--apply moves all three D3cold -> D0 with --revert putting them back, which is the rule's mechanism verified on this kernel.

tests/xhci_keepawake_check_test.py builds fake sysfs trees (--sysfs-root) and asserts all four verdicts, because CI is not an
AXB35-02: a non-board machine must print NOT THIS BOARD and exit 0 rather than reporting a verdict, an unknown-id AXB35 must say the
rule would bind nothing, three-asleep must fail --require-awake, all-awake must pass it. Registered as ctest xhci_keepawake_check.

docs/axb35-usb-ports.md records the diagnosis, the rule, the measured table, the four verdicts and what is still owed (the plug, and
the _DSM comparison against Windows if a port is still dead after it).

Verified: ctest -R 'xhci_keepawake|spec_decode' in a CI-parity configure -> 2/2 Passed; the test file's 13 checks pass; bash -n;
copyright --check rc 0 for these files (main is red on an unrelated duplicated header, fixed separately in #1565).

refs #823, refs #1474's file (no entry touched).

* tools: --require-awake fails CLOSED on the two "cannot confirm" verdicts (engine#823 review)

The CHANGES review was right and it is the point of the tool: `--require-awake` is "the precondition in one command", so it has to fail
closed. It exited **0** on two of the four verdicts:

| verdict | before | after |
|---|---|---|
| `NOT THIS BOARD` | 0 | **1** |
| `would bind nothing` | 0 | **1** |
| `N asleep` | 1 | 1 |
| `all awake` | 0 | 0 |

A green on "not this board" reads as *the rule is in force here*, and a green on "would bind nothing" reads as *something is being kept
awake* - on a boot where a plug into a rear or Type-C port would fail for the rule's reason and be read as evidence about the ports.

Report mode is unchanged and still exits 0 on every verdict: its job is to describe a machine, and the doc's exit line now separates the
two modes instead of listing one contract for both.

The test was pinning the fail-open behaviour (`--require-awake on a non-board machine is not a failure either`), so it now pins the
opposite, and a new case covers "would bind nothing" in both modes. Verified: `tests/xhci_keepawake_check_test.py` **all checks passed**,
`bash -n` clean, `shellcheck -S warning` 0, and on this AXB35-02 the read-only run is unchanged.

---------

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
@bong-water-water-bong
bong-water-water-bong deleted the fix/base-modes-keep-header branch November 10, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant