Skip to content

Commit 55cbd39

Browse files
Merge pull request #213 from BinBashBanana/main
Reland "fix up supported devices page"
2 parents 429b652 + 57c8cf7 commit 55cbd39

File tree

7 files changed

+2949
-1578
lines changed

7 files changed

+2949
-1578
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ node_modules
88
.DS_Store
99

1010
# Will be initilized on run/build time
11-
src/docs/firmware/supported-devices.md
12-
src/.vuepress/public/supported-devices.js
1311
src/.vuepress/public/devices.json
1412

1513
# old ignored stuff
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
function generateHTML(devicesJson) {
2+
let html = `
3+
<table style="font-size: 14px !important;">
4+
<tbody>`;
5+
let first = true;
6+
for (const generation in devicesJson) {
7+
let devices = devicesJson[generation];
8+
if (devices.isExperimental === true && !window.hasOwnProperty("showExperimental")) continue;
9+
devices.devices.forEach((device) => {
10+
//set defaults
11+
if (device.windows === undefined)
12+
device.windows = devices.default_windows;
13+
if (device.linux === undefined) device.linux = devices.default_linux;
14+
if (device.mac === undefined) device.mac = devices.default_mac;
15+
if (device.wpMethod === undefined)
16+
device.wpMethod = devices.default_wpmethod;
17+
if (device.fullrom === undefined)
18+
device.fullrom = devices.default_fullrom;
19+
if (device.rwLegacy === undefined)
20+
device.rwLegacy = devices.default_rwLegacy;
21+
});
22+
if (first) {
23+
first = false;
24+
} else {
25+
html += `
26+
<tr>
27+
<td colspan="8"></td>
28+
</tr>`;
29+
}
30+
html += `
31+
<tr>
32+
<th colspan="8" style="text-align:left;"> <i>${generation}</i></th>
33+
</tr>
34+
<tr>
35+
<th scope="col"> Device Name</th>
36+
<th scope="col"> Board Name</th>
37+
<th scope="col"> RW_LEGACY <br> Firmware</th>
38+
<th scope="col"> UEFI Firmware <br>(Full ROM)</th>
39+
<th scope="col"> WP Method</th>
40+
<th scope="col"> Windows Notes</th>
41+
<th scope="col"> Linux Notes</th>
42+
<th scope="col"> MacOS Notes</th>
43+
</tr>`;
44+
45+
let windows;
46+
let linux;
47+
let mac;
48+
49+
devices.devices.forEach((device, index) => {
50+
let devicename = device.device.join("<br>");
51+
let rw_legacy = "";
52+
if (device.rwLegacy === null) {
53+
rw_legacy = '<span style="color:#ff0000"><b>EOL</b></span>';
54+
} else if (device.rwLegacy === true) {
55+
rw_legacy = "✅";
56+
}
57+
let full_rom = device.fullrom ? "✅" : "";
58+
59+
let win_out = "";
60+
let linux_out = "";
61+
let mac_out = "";
62+
if (windows !== device.windows) {
63+
let length = 0;
64+
windows = device.windows;
65+
for (let i = index; i < devices.devices.length; i++) {
66+
if (devices.devices[i].windows === windows) length++;
67+
else break;
68+
}
69+
win_out = `\n <td rowspan="${length}" style=\"text-align:center;\">${windows}</td>`;
70+
}
71+
if (linux !== device.linux) {
72+
let length = 0;
73+
linux = device.linux;
74+
for (let i = index; i < devices.devices.length; i++) {
75+
if (devices.devices[i].linux === linux) length++;
76+
else break;
77+
}
78+
if (!linux) linux = devices.default_linux;
79+
linux_out = `\n <td rowspan="${length}" style=\"text-align:center;\">${linux}</td>`;
80+
}
81+
if (mac !== device.mac) {
82+
let length = 0;
83+
mac = device.mac;
84+
for (let i = index; i < devices.devices.length; i++) {
85+
if (devices.devices[i].mac === mac) length++;
86+
else break;
87+
}
88+
if (!mac) mac = devices.default_mac;
89+
mac_out = `\n <td rowspan="${length}" style=\"text-align:center;\">${mac}</td>`;
90+
}
91+
92+
html += `
93+
<tr>
94+
<td>${devicename}</td>
95+
<td style="text-align:center;"> ${device.boardname}</td>
96+
<td style="text-align:center;"> ${rw_legacy}</td>
97+
<td style="text-align:center;"> ${full_rom}</td>
98+
<td style="text-align:center;"> ${device.wpMethod}</td>
99+
${win_out}${linux_out}${mac_out}
100+
</tr>`;
101+
});
102+
}
103+
html += `
104+
</tbody>
105+
</table>`;
106+
return html;
107+
}
108+
109+
(async () => {
110+
const table = document.querySelector(".deviceTable");
111+
const searchbox = document.querySelector(".deviceSearch");
112+
let devices = [];
113+
try {
114+
devices = JSON.parse(await (await fetch("../../devices.json")).text());
115+
} catch(e) {
116+
console.warn(e);
117+
searchbox.parentElement.remove();
118+
return;
119+
}
120+
121+
table.innerHTML = generateHTML(JSON.parse(JSON.stringify(devices)));
122+
123+
function search(keyword) {
124+
let dv = JSON.parse(JSON.stringify(devices));
125+
keyword = keyword.toLowerCase().trim();
126+
if (keyword === "show hidden!") {
127+
searchbox.value = "";
128+
keyword = "";
129+
window.showExperimental = true;
130+
}
131+
if (!keyword) {
132+
table.innerHTML = generateHTML(dv);
133+
return;
134+
}
135+
for (const k in dv) {
136+
for (let i=0; i<dv[k].devices.length; i++) {
137+
let hasTerm = dv[k].devices[i].device.filter(e => e.toLowerCase().includes(keyword)).length !== 0 || dv[k].devices[i].boardname.toLowerCase().includes(keyword);
138+
if (!hasTerm) {
139+
dv[k].devices.splice(i, 1);
140+
i--;
141+
}
142+
}
143+
if (dv[k].devices.length === 0) {
144+
delete dv[k];
145+
}
146+
}
147+
if (Object.keys(dv).length === 0) {
148+
table.innerHTML = "";
149+
table.innerText = "Device not found. Did you make a typo?";
150+
return;
151+
}
152+
table.innerHTML = generateHTML(dv);
153+
}
154+
searchbox.addEventListener("keyup", (e) => search(e.target.value));
155+
})();

supported-devices/template.md renamed to src/docs/firmware/supported-devices.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ prev: system-info
33
next: known-issues
44
---
55

6-
<!--
7-
NOTE - do not edit the supported-devices.md file, edit the template file in the supported-devices folder
8-
-->
9-
106
# Supported Devices and Platforms
117

128
Supported devices are listed in the table below, grouped by platform/family. If your device is not listed, it is not supported. Support is determined entirely and exclusively by the boardname. Use your Chromebook's boardname to see if it has support.
@@ -15,21 +11,19 @@ Supported devices are listed in the table below, grouped by platform/family. If
1511

1612
What's in a name? All ChromeOS devices have a board/device name, which determines which firmware, OS build, etc a device uses. The board name is listed at the bottom of both the Recovery Mode and Developer Mode screens, as part of the hardware ID (HWID).
1713

18-
The chart below provides a full list of all ChromeOS devices currently supported by MrChromebox's Firmware Utility Script, the firmware types available for each, the hardware write-protect method used, and notes for Windows, Linux, and macOS operating systems.
19-
20-
In most cases, all of the devices in a given platform/family are supported, but sometimes there are exceptions (especially with older or newer devices). The goal is to offer both RW_LEGACY and UEFI Full ROM firmware for all devices, so you may have the option of dual booting ChromeOS, or liberating your device completely :)
14+
The chart below provides a full list of all ChromeOS devices currently supported by Chrultrabook, the firmware type available for each, and notes for Windows, Linux, and macOS operating systems.
2115

22-
Be aware that EOL (End Of Life) devices **DO NOT** have RW_Legacy avaliable
16+
In most cases, all of the devices in a given platform/family are supported, but sometimes there are exceptions (especially with older or newer devices).
2317

2418
### OS Support
2519

2620
A device having firmware available (either RW_LEGACY or UEFI Full ROM) does not imply any level of functionality when running an OS other than ChromeOS. Some devices/platforms are better supported in some Linux distros vs others. Some devices/platforms are better supported under Windows than others.
2721

2822
## Supported Platforms
2923

30-
| Intel | AMD | ARM |
31-
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32-
| Intel platforms have good support for both Linux and Windows. Some have support for macOS. | Stoneyridge support in Windows is questionable, and installing a custom kernel is required to get working audio in Linux. Ryzen has support for both Linux and Windows. MacOS is **untested** on AMD platforms. | Currently unsupported by the Chrultrabook dev team. [PostmarketOS](https://wiki.postmarketos.org/wiki/Chrome_OS_devices) has support for a few ARM Chromebooks. |
24+
| Intel | AMD | ARM |
25+
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
26+
| Intel platforms have good support for both Linux and Windows. Some have support for macOS. | Stoneyridge support in Windows is questionable, and installing a custom kernel is required to get working audio in Linux. Ryzen has support for both Linux and Windows. MacOS is **untested** on AMD platforms. | Currently unsupported (WIP). [PostmarketOS](https://wiki.postmarketos.org/wiki/Chrome_OS_devices) has support for a few ARM Chromebooks. |
3327

3428
## Firmware and OS Support
3529

@@ -42,8 +36,7 @@ If you are on a smaller screen, scroll sideways to see whole table.
4236
:::
4337

4438
<AddScript script-url="../../supported-devices.js"/>
39+
4540
<p>Search: <input type="text" class="deviceSearch"></p>
4641

47-
<div class="deviceTable">
48-
${{TABLE}}
49-
</div>
42+
<div class="deviceTable">Loading...</div>

0 commit comments

Comments
 (0)