Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Functions are procedural and single-call, not pipeline-aware. Skip the blocks un
### Global state

`Initialize-*` functions populate `$global:OSDCloud*` variables; `Invoke-*` and `Get-*` functions read them.
Key globals: `$global:OSDCloudDevice`, `$global:OSDCloudDeploy`, `$global:OSDCloudWorkflowTasks`, `$global:OSDCloudWorkflowInvoke`, `$global:Architecture`, `$global:IsWinPE`, `$global:IsVM`, `$global:IsOnBattery`.
Key globals: `$global:OSDCoreDevice`, `$global:OSDCloudDeploy`, `$global:OSDCloudWorkflowTasks`, `$global:OSDCloudWorkflowInvoke`, `$global:Architecture`, `$global:IsWinPE`, `$global:IsVM`, `$global:IsOnBattery`.
Document any new global variables added.

### Naming
Expand Down
46 changes: 23 additions & 23 deletions .github/instructions/osdcloud-catalog-update.instructions.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
description: "Use when adding a new Windows OS build to catalogs/operatingsystem/, updating driver pack snapshots in core/driverpacks/, adding a new Surface model to surface.json, or adding a new Panasonic model to panasonic.json. Covers file naming, XML/JSON schemas, the build-number switch statement, and required workflow config changes."
description: "Use when adding a new Windows OS build to OSDCloud/core/operatingsystems/, updating driver pack snapshots in OSDCloud/core/driverpacks/, adding a new Surface model to OSDCloud/core/driverpacks/surface.json, or adding a new Panasonic model to OSDCloud/core/driverpacks/panasonic.json. Covers file naming, XML/JSON schemas, the build-number switch statement, and required workflow config changes."
---

# Catalog Update Guidelines

All catalog files live in `catalogs/`. They are committed snapshots used as offline fallbacks or as the primary data source. Do not edit them for content that is fetched dynamically at runtime from OEM sources.
Catalog snapshots live under the repository's OSDCloud/core tree. OS metadata is stored in `OSDCloud/core/operatingsystems/`, and driver-pack snapshots live in `OSDCloud/core/driverpacks/`. These files are committed fallbacks and should not be edited for content that is fetched dynamically at runtime from OEM sources.

---

## OS catalogs (`catalogs/operatingsystem/`)
## OS catalogs (`OSDCloud/core/operatingsystems/`)

### File naming

Expand Down Expand Up @@ -51,9 +51,9 @@ Each `<File>` element contains:

### Adding a new OS build — checklist

1. **Add the XML file** to `catalogs/operatingsystem/` following the naming convention above.
1. **Add the XML file** to `OSDCloud/core/operatingsystems/` following the naming convention above.

2. **Register the build number** in `private/Get-OSDCloudCoreOperatingSystems.ps1`.
2. **Register the build number** in `OSDCloud/private/core/Get-OSDCloudCoreOperatingSystems.ps1`.
Locate the `switch ($OSBuild)` block and add a new case:

```powershell
Expand All @@ -72,7 +72,7 @@ Each `<File>` element contains:

Without this entry, the build's ESD entries are silently skipped.

3. **Update workflow OS configs** — for every channel that should offer the new build, add the version string to `os-amd64.json` and `os-arm64.json`:
3. **Update workflow OS configs** — for every channel that should offer the new build, add the version string to `OSDCloud/workflow/<channel>/os-amd64.json` and `OSDCloud/workflow/<channel>/os-arm64.json`:

```json
{
Expand All @@ -90,27 +90,27 @@ Each `<File>` element contains:

---

## Driver pack catalogs (`core/driverpacks/`)
## Driver pack catalogs (`OSDCloud/core/driverpacks/`)

### Overview of catalog files

| File | Format | Manufacturer | Updated by |
|---|---|---|---|
| `dell.xml` | OEM XML snapshot | Dell | Download + replace |
| `hp.xml` | OEM XML snapshot | HP | Download + replace |
| `lenovo.xml` | OEM XML snapshot | Lenovo | Download + replace |
| `surface.json` | JSON array | Microsoft (Surface) | Manual edit / `Update-MicrosoftCatalog.ps1` |
| `panasonic.json` | Nested JSON | Panasonic | Manual edit |
| `generic.json` | JSON array | ARM64 / multi-OEM | Manual edit |
| `OSDCloud/core/driverpacks/dell.xml` | OEM XML snapshot | Dell | Download + replace |
| `OSDCloud/core/driverpacks/hp.xml` | OEM XML snapshot | HP | Download + replace |
| `OSDCloud/core/driverpacks/lenovo.xml` | OEM XML snapshot | Lenovo | Download + replace |
| `OSDCloud/core/driverpacks/surface.json` | JSON array | Microsoft (Surface) | Manual edit / `.github/scripts/Update-MicrosoftCatalog.ps1` |
| `OSDCloud/core/driverpacks/panasonic.json` | Nested JSON | Panasonic | Manual edit |
| `OSDCloud/core/driverpacks/generic.json` | JSON array | ARM64 / multi-OEM | Manual edit |

OEM source URLs are defined in `module.json` under each manufacturer key (`driverpackcatalogoem`).
Dell, HP, and Lenovo catalogs are fetched at runtime by their respective `Get-OSDCloudCatalog*` functions; local files are fallback only.
OEM source URLs are defined in `OSDCloud/core/module.json` under each manufacturer key (`driverpackcatalogoem`).
Dell, HP, and Lenovo catalogs are fetched at runtime by their respective `Get-OSDCoreDriverPackCatalog*` functions; local files are fallback only.

---

### Updating Dell, HP, or Lenovo snapshots

At runtime, `Get-OSDCloudCatalogDell/Hp/Lenovo` downloads the OEM CAB/XML to `$env:TEMP`, parses it, and falls back to the local snapshot on failure. To refresh the committed snapshot:
At runtime, `Get-OSDCoreDriverPackCatalogDell/Hp/Lenovo` downloads the OEM CAB/XML to `$env:TEMP`, parses it, and falls back to the local snapshot on failure. To refresh the committed snapshot:

1. Download the OEM catalog CAB from the URL in `module.json`:
- Dell: `https://downloads.dell.com/catalog/DriverPackCatalog.cab`
Expand All @@ -123,9 +123,9 @@ At runtime, `Get-OSDCloudCatalogDell/Hp/Lenovo` downloads the OEM CAB/XML to `$e
```

3. Replace the local file:
- `core/driverpacks/dell.xml`
- `core/driverpacks/hp.xml`
- `core/driverpacks/lenovo.xml`
- `OSDCloud/core/driverpacks/dell.xml`
- `OSDCloud/core/driverpacks/hp.xml`
- `OSDCloud/core/driverpacks/lenovo.xml`

4. Do not edit the OEM XML content manually — it is consumed as-is by the catalog parser.

Expand All @@ -134,9 +134,9 @@ At runtime, `Get-OSDCloudCatalogDell/Hp/Lenovo` downloads the OEM CAB/XML to `$e
### surface.json (Surface driver packs — amd64 and arm64)

Used for `Manufacturer == 'Microsoft'` on both AMD64 and ARM64 devices.
Read directly by `Get-OSDCloudCatalogSurface`, which enriches entries with live MSI URLs from each entry's `UpdatePage` at runtime. **There is no `surface.xml` to regenerate.**
Read directly by `Get-OSDCoreDriverPackCatalogSurface`, which enriches entries with live MSI URLs from each entry's `UpdatePage` at runtime. **There is no `surface.xml` to regenerate.**

`Update-MicrosoftCatalog.ps1` (run by the `update-catalog-microsoft.yaml` GitHub Actions workflow) scrapes all `UpdatePage` URLs and commits any changed MSI filenames, URLs, or release dates automatically each week.
The `.github/scripts/Update-MicrosoftCatalog.ps1` helper (run by the `.github/workflows/update-catalog-microsoft.yaml` workflow) scrapes all `UpdatePage` URLs and updates the JSON file when MSI filenames, URLs, or release dates change.

#### JSON object schema

Expand Down Expand Up @@ -168,7 +168,7 @@ Read directly by `Get-OSDCloudCatalogSurface`, which enriches entries with live

### panasonic.json (Panasonic driver packs)

This file uses a different nested schema compared to other driver pack catalogs. It is read by `Get-OSDCloudCatalogPanasonic`, which flattens the nested structure at runtime and excludes Windows 10 entries.
This file uses a different nested schema compared to other driver pack catalogs. It is read by `Get-OSDCoreDriverPackCatalogPanasonic`, which flattens the nested structure at runtime and excludes Windows 10 entries.

#### JSON structure

Expand Down Expand Up @@ -217,6 +217,6 @@ Key differences:
## Common mistakes

- **Omitting the build switch case** — a new OS XML will load without errors but produce zero OS options in the UX because every `<File>` hits the `default { continue }` branch.
- **Stale `surface.json` driver URLs** — `Get-OSDCloudCatalogSurface` serves MSI URLs from `surface.json`; if `UpdatePage` links change and the automated workflow has not run, deployed drivers may point to outdated or removed files. Run `Update-MicrosoftCatalog.ps1` manually to refresh.
- **Stale `surface.json` driver URLs** — `Get-OSDCoreDriverPackCatalogSurface` serves MSI URLs from `OSDCloud/core/driverpacks/surface.json`; if `UpdatePage` links change and the automated workflow has not run, deployed drivers may point to outdated or removed files. Run `.github/scripts/Update-MicrosoftCatalog.ps1` manually to refresh.
- **Editing OEM XML snapshots manually** — Dell/HP/Lenovo XML is replaced wholesale from upstream; manual edits will be lost on the next snapshot refresh.
- **Adding a Windows version string to workflow configs without the catalog XML** — the UX will offer the version but `Get-OSDCloudCoreOperatingSystems` will return no matching ESD entries, causing `Initialize-OSDCloudDeploy` to throw.
2 changes: 1 addition & 1 deletion .github/instructions/workflow-tasks.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function step-phase-action {
# Implementation here.
# Read context from $global:OSDCloudWorkflowInvoke (architecture, paths, OS object, etc.)
# Read deployment config from $global:OSDCloudDeploy
# Read device info from $global:OSDCloudDevice
# Read device info from $global:OSDCoreDevice

#endregion
#=================================================
Expand Down
32 changes: 16 additions & 16 deletions .github/prompts/osdcloud-update-driverpack-catalog.prompt.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
description: "Step-by-step guide for updating OSDCloud driver pack catalogs: refresh Dell/HP/Lenovo XML snapshots, add or update Surface models in surface.json, update panasonic.json, or add ARM64 entries to generic.json."
description: "Step-by-step guide for updating OSDCloud driver pack catalogs: refresh Dell/HP/Lenovo XML snapshots, add or update Surface models in OSDCloud/core/driverpacks/surface.json, update OSDCloud/core/driverpacks/panasonic.json, or add ARM64 entries to OSDCloud/core/driverpacks/generic.json."
argument-hint: "dell | hp | lenovo | microsoft | panasonic | generic | all"
agent: "agent"
---

Perform a driver pack catalog update for OSDCloud following the rules in [catalog-update.instructions.md](../instructions/catalog-update.instructions.md).
Perform a driver pack catalog update for OSDCloud following the rules in [osdcloud-catalog-update.instructions.md](../instructions/osdcloud-catalog-update.instructions.md).

## Step 1 -- Determine scope

If the user provided an argument, use it to determine which catalogs to update:

| Argument | Catalog file(s) |
|---|---|
| `dell` | `core/driverpacks/dell.xml` |
| `hp` | `core/driverpacks/hp.xml` |
| `lenovo` | `core/driverpacks/lenovo.xml` |
| `microsoft` | `core/driverpacks/surface.json` |
| `panasonic` | `core/driverpacks/panasonic.json` |
| `generic` | `core/driverpacks/generic.json` |
| `dell` | `OSDCloud/core/driverpacks/dell.xml` |
| `hp` | `OSDCloud/core/driverpacks/hp.xml` |
| `lenovo` | `OSDCloud/core/driverpacks/lenovo.xml` |
| `microsoft` | `OSDCloud/core/driverpacks/surface.json` |
| `panasonic` | `OSDCloud/core/driverpacks/panasonic.json` |
| `generic` | `OSDCloud/core/driverpacks/generic.json` |
| `all` | All of the above |

If no argument was provided, ask: **Which catalog(s) need updating?** (list the options above).
Expand All @@ -28,7 +28,7 @@ If no argument was provided, ask: **Which catalog(s) need updating?** (list the

For each OEM XML catalog being refreshed:

1. **Confirm the source URL** from `module.json`:
1. **Confirm the source URL** from `OSDCloud/core/module.json`:
- Dell: `https://downloads.dell.com/catalog/DriverPackCatalog.cab`
- HP: `https://hpia.hpcloud.hp.com/downloads/driverpackcatalog/HPClientDriverPackCatalog.cab`
- Lenovo: `https://download.lenovo.com/cdrt/td/catalogv2.xml` (direct XML -- no CAB extraction needed)
Expand All @@ -42,7 +42,7 @@ For each OEM XML catalog being refreshed:

3. **Replace the local snapshot**:
```powershell
Copy-Item "$env:TEMP\DriverPackCatalog.xml" 'core\driverpacks\dell.xml' -Force
Copy-Item "$env:TEMP\DriverPackCatalog.xml" 'OSDCloud\core\driverpacks\dell.xml' -Force
```

4. **Do not edit the XML content** -- it is consumed as-is.
Expand All @@ -53,7 +53,7 @@ For each OEM XML catalog being refreshed:

## Microsoft (Surface) -- surface.json

`surface.json` is the sole source of truth for Surface driver packs. `Get-OSDCloudCatalogSurface` reads it directly at runtime and enriches entries from live download pages for models that have an `UpdatePage` URL. **There is no `surface.xml` to regenerate.**
`surface.json` is the sole source of truth for Surface driver packs. `Get-OSDCoreDriverPackCatalogSurface` reads it directly at runtime and enriches entries from live download pages for models that have an `UpdatePage` URL. **There is no `surface.xml` to regenerate.**

### If adding or updating a model entry manually

Expand All @@ -74,12 +74,12 @@ Then:

1. Set `CatalogVersion` and `ReleaseDate` to today's date in `YY.MM.DD` format.
2. Set `Name` to `"Surface <Model> [<ReleaseDate>]"` (no "Microsoft" prefix in the Name field).
3. Edit `core/driverpacks/surface.json` -- insert the new entry in the correct position (sort by Model name).
3. Edit `OSDCloud/core/driverpacks/surface.json` -- insert the new entry in the correct position (sort by Model name).
4. Confirm the file is saved.

### Automated update via GitHub Actions

The `update-catalog-microsoft.yaml` workflow runs `.github/scripts/Update-MicrosoftCatalog.ps1` every 4 hours and on demand. It scrapes every `UpdatePage` URL in `surface.json`, selects the best available MSI, and commits any changes automatically. Run `workflow_dispatch` to trigger an immediate update.
The `.github/workflows/update-catalog-microsoft.yaml` workflow runs `.github/scripts/Update-MicrosoftCatalog.ps1` every 4 hours and on demand. It scrapes every `UpdatePage` URL in `OSDCloud/core/driverpacks/surface.json`, selects the best available MSI, and updates the JSON file when changes are detected. Trigger the workflow manually with `workflow_dispatch` to run it immediately.

---

Expand Down Expand Up @@ -125,9 +125,9 @@ Rules:
After all edits, confirm each item:

- [ ] OEM XML snapshots replaced (Dell/HP/Lenovo as applicable)
- [ ] `surface.json` edited (if applicable)
- [ ] `panasonic.json` updated with new `LastDateModified` (if applicable)
- [ ] `generic.json` updated (if applicable)
- [ ] `OSDCloud/core/driverpacks/surface.json` edited (if applicable)
- [ ] `OSDCloud/core/driverpacks/panasonic.json` updated with new `LastDateModified` (if applicable)
- [ ] `OSDCloud/core/driverpacks/generic.json` updated (if applicable)
- [ ] No manual edits made to Dell/HP/Lenovo XML content

Report a one-line summary of each file changed and what was updated.
12 changes: 6 additions & 6 deletions .github/skills/add-surface-model/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: add-surface-model
description: "Use when adding or validating a Microsoft Surface model in OSDCloud surface.json, resolving System SKU/SystemId, Surface driver pack UpdatePage, direct MSI Url, FileName, ReleaseDate, OSArchitecture, and catalog properties."
description: "Use when adding or validating a Microsoft Surface model in OSDCloud/core/driverpacks/surface.json, resolving System SKU/SystemId, Surface driver pack UpdatePage, direct MSI Url, FileName, ReleaseDate, OSArchitecture, and catalog properties."
argument-hint: "Surface model name, for example: Surface Laptop 8 Intel"
---

Expand All @@ -12,17 +12,17 @@ Use this skill to add or validate Microsoft Surface driver pack entries in `OSDC

1. Review the current catalog entry shape in `OSDCloud/core/driverpacks/surface.json` and use [the template](./assets/surface-model-template.json) for field order.
2. Follow [the Surface catalog rules](./references/surface-catalog-rules.md) to resolve each property from Microsoft sources and local catalog conventions.
3. Add or update one JSON object in `surface.json`, keeping entries sorted by `Model`.
4. Run `.\.github\scripts\Update-MicrosoftCatalog.ps1 -JsonPath 'OSDCloud\core\driverpacks\surface.json'` to refresh `FileName`, `Url`, and `ReleaseDate` from `UpdatePage`.
5. Validate JSON parsing, direct MSI URL shape, `FileName`/`Url` consistency, and runtime loading through `Get-OSDCloudCatalogSurface` when practical.
3. Add or update one JSON object in `OSDCloud/core/driverpacks/surface.json`, keeping entries sorted by `Model`.
4. Run `./.github/scripts/Update-MicrosoftCatalog.ps1 -JsonPath 'OSDCloud/core/driverpacks/surface.json'` to refresh `FileName`, `Url`, and `ReleaseDate` from `UpdatePage`.
5. Validate JSON parsing, direct MSI URL shape, `FileName`/`Url` consistency, and runtime loading through `Get-OSDCoreDriverPackCatalogSurface` when practical.

## Required Sources

- System model and System SKU reference: `https://learn.microsoft.com/en-us/surface/surface-system-sku-reference`
- Surface driver and firmware update pages: `https://learn.microsoft.com/en-us/surface/manage-surface-driver-and-firmware-updates`
- Support model pages linked from Microsoft Surface driver pages when they expose clearer Download Center IDs.
- Repo updater behavior in `.github/scripts/Update-MicrosoftCatalog.ps1`.
- Repo updater behavior in `.github/scripts/Update-MicrosoftCatalog.ps1`, including its fallback to the Microsoft confirmation page when no MSI links are found on the details page.

## Stop Conditions

Do not leave placeholder values in `surface.json`. If the Microsoft Download Center page cannot yield a direct `.msi` URL through the updater or manual verification, pause and report the blocked fields instead of committing guessed values.
Do not leave placeholder values in `OSDCloud/core/driverpacks/surface.json`. If the Microsoft Download Center page cannot yield a direct `.msi` URL through the updater or manual verification, pause and report the blocked fields instead of committing guessed values.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CatalogVersion": "<yy.MM.dd date added to surface.json>",
"CatalogVersion": "<yy.MM.dd date added to OSDCloud/core/driverpacks/surface.json>",
"ReleaseDate": "<yy.MM.dd DriverPack Date Published>",
"Name": "<Model> [<ReleaseDate>]",
"Manufacturer": "Microsoft",
Expand Down
Loading