Skip to content

fix(linbo_sync): fall back to the plain group for windows boot files - #181

Open
TomlDev wants to merge 2 commits into
linuxmuster:7.4from
TomlDev:fix/linbo-sync-group-fallback
Open

TomlDev wants to merge 2 commits into
linuxmuster:7.4from
TomlDev:fix/linbo-sync-group-fallback

Conversation

@TomlDev

@TomlDev TomlDev commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Part of #178, the linbo_sync fallback agreed there.

Problem

linbo_create_image stores the Windows boot files BCD.$HOSTGROUP[.<part>] and bsmbr.$HOSTGROUP inside the image, and linbo_sync restores them by the same name. Older images may also carry gptlabel.$HOSTGROUP (and the older winmbr* names), which linbo_sync still restores. Once hardware groups of non-default schools are school-qualified (<school>+<group>, see linuxmuster/linuxmuster-base7#206), a migrated client syncing an image created before looks for BCD.abc+raum101 and finds only BCD.raum101. It then skips the BCD and boot sector restore (and the GPT label restore for older images). On EFI that can leave Windows unbootable.

Change

New group_bootfile path [suffix] returns path.$HOSTGROUP[suffix]. If that file doesn't exist but the one for the plain group (${HOSTGROUP#*+}) does, it returns that one instead. It is used for BCD, bsmbr, the older winmbr446/winmbr/win7mbr names and gptlabel.

For default-school groups (no +) both names are the same, so behaviour there is unchanged. A qualified file is always preferred, so images re-created after the migration use their own files.

This is a linbofs change, so clients need the rebuilt linbofs. It should be released before the base7 migration reaches clients.

Testing

  • New tests/shell/test_linbo_sync.sh, 6 tests: default-school unchanged, qualified file preferred, fallback to the plain group, suffix kept on fallback, qualified name when neither exists, and group names containing -/_.
  • sh tests/shell/run.sh and busybox ash tests/shell/run.sh: all test files OK.
  • Still to do in the lab, as listed in Feature request: per-school hardware groups (start.conf) on multi-school servers #178: restoring an existing Windows image on a migrated non-default-school client, BIOS and EFI.

@HappyBasher

Copy link
Copy Markdown
Member

Thanks, this matches what we agreed in #178. I went through all uses of HOSTGROUP in linbo_sync; the helper covers every one of them (BCD, bsmbr, the older winmbr names and gptlabel). I ran the new shell tests locally: all OK.

We'll merge once the lab test is done: restoring an existing Windows image on a migrated non-default-school client, BIOS and EFI, as you listed in the PR description. Please post the result here. This is a linbofs change and has to reach the clients before the base7 migration does, so we'll release it first.

Before merging, please change two things in the commit:

  1. Add a Signed-off-by: trailer. It has to come from you as the author, so we can't add it for you. git rebase --signoff origin/7.4 and git push --force-with-lease will do it. We merge contributor PRs with a merge commit, so the commit message stays in the history.
  2. Replace Co-Authored-By: Claude <noreply@anthropic.com> with Assisted-by: Claude, as in your file headers.

Also, please use fix(linbo_sync): instead of feat(linbo_sync): in the subject. The subject becomes the changelog entry, and for existing images this is a compatibility fix.

@TomlDev
TomlDev force-pushed the fix/linbo-sync-group-fallback branch from 25ea853 to 37a173e Compare October 1, 2026 10:11
@TomlDev TomlDev changed the title feat(linbo_sync): fall back to the plain group for windows boot files fix(linbo_sync): fall back to the plain group for windows boot files Oct 1, 2026
linbo_create_image stores the windows boot files BCD and bsmbr in the
image keyed by $HOSTGROUP (older images may also carry gptlabel), and
linbo_sync restores them by the same name. Once hardware groups of
non-default schools become school qualified (<school>+<group>, linuxmuster#178), a
migrated client syncing an image created before looks for e.g.
BCD.abc+raum101, finds only BCD.raum101 and skips the BCD and boot sector
restore (and the gpt label restore for older images). On EFI that can
leave Windows unbootable.

Look the files up through a new group_bootfile(), which falls back to
the plain group (the part after the "+") when only that file exists.
For default-school groups (no "+") both names are the same, so behaviour
there is unchanged.

Refs linuxmuster#178

Signed-off-by: Tom Lehmann <tom.lehmann@netzint.de>
Assisted-by: Claude
@TomlDev
TomlDev force-pushed the fix/linbo-sync-group-fallback branch from 37a173e to b4fabfb Compare October 1, 2026 10:43
@TomlDev

TomlDev commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The three commit changes are in: the Signed-off-by: trailer, the trailer replacement you asked for, and the subject is now fix(linbo_sync):. I also merged 7.4 into the branch.

Lab test, status. It is set up but blocked, and I found an issue that affects the whole #178 design; details are in #178.

What is in place on the 7.4 dev server (school agy):

  • The live linbofs contains this PR's linbo_sync (same sha256 as the branch, 9fca8a8e…).
  • An EFI test client (Proxmox VM) in group agy+win11_edu, with the DHCP entry, start.conf and grub cfg that import-devices from #207 generates.
  • The existing image win11_pro_edu (built in August) holds EFI/Microsoft/Boot/BCD.win11_edu.sda3 and bsmbr.win11_edu, so it is the case this PR is for.

What blocks it: the client's udhcpc replaces agy+win11_edu with bad, so HOSTGROUP='bad' on the client and the fallback has nothing to match (${HOSTGROUP#*+} of bad is bad). The cause is BusyBox sanitising option 40; see the #178 comment for the evidence and the options. I'll run the restore test once the group reaches the client and post the result here.

Two limits of the test, so you know in advance:

  • The only Windows image on the server is an EFI image: it has no /Boot directory, so the BIOS branch of linbo_sync cannot be exercised with it. That path is covered by the shell tests only, unless you have a BIOS image we can use.
  • The image has no gptlabel.* file, so that restore is covered by the shell tests only as well.

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.

2 participants