Skip to content

Commit 24dc9ae

Browse files
authored
Merge pull request #208 from BinBashBanana/main
fix up supported devices page
2 parents 2c00ee5 + 68219cb commit 24dc9ae

File tree

7 files changed

+2898
-1579
lines changed

7 files changed

+2898
-1579
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: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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"> MrChromebox Firmware</th>
38+
<th scope="col"> Windows Notes</th>
39+
<th scope="col"> Linux Notes</th>
40+
<th scope="col"> MacOS Notes</th>
41+
</tr>`;
42+
43+
let windows;
44+
let linux;
45+
let mac;
46+
47+
devices.devices.forEach((device, index) => {
48+
let devicename = device.device.join("<br>");
49+
let has_firmware = (device.fullrom || device.rwLegacy) ? "✅" : "";
50+
51+
let win_out = "";
52+
let linux_out = "";
53+
let mac_out = "";
54+
if (windows !== device.windows) {
55+
let length = 0;
56+
windows = device.windows;
57+
for (let i = index; i < devices.devices.length; i++) {
58+
if (devices.devices[i].windows === windows) length++;
59+
else break;
60+
}
61+
win_out = `\n <td rowspan="${length}" style=\"text-align:center;\">${windows}</td>`;
62+
}
63+
if (linux !== device.linux) {
64+
let length = 0;
65+
linux = device.linux;
66+
for (let i = index; i < devices.devices.length; i++) {
67+
if (devices.devices[i].linux === linux) length++;
68+
else break;
69+
}
70+
if (!linux) linux = devices.default_linux;
71+
linux_out = `\n <td rowspan="${length}" style=\"text-align:center;\">${linux}</td>`;
72+
}
73+
if (mac !== device.mac) {
74+
let length = 0;
75+
mac = device.mac;
76+
for (let i = index; i < devices.devices.length; i++) {
77+
if (devices.devices[i].mac === mac) length++;
78+
else break;
79+
}
80+
if (!mac) mac = devices.default_mac;
81+
mac_out = `\n <td rowspan="${length}" style=\"text-align:center;\">${mac}</td>`;
82+
}
83+
84+
html += `
85+
<tr>
86+
<td>${devicename}</td>
87+
<td style="text-align:center;"> ${device.boardname}</td>
88+
<td style="text-align:center;"> ${has_firmware}</td>
89+
${win_out}${linux_out}${mac_out}
90+
</tr>`;
91+
});
92+
}
93+
html += `
94+
</tbody>
95+
</table>`;
96+
return html;
97+
}
98+
99+
(async () => {
100+
const table = document.querySelector(".deviceTable");
101+
const searchbox = document.querySelector(".deviceSearch");
102+
let devices = [];
103+
try {
104+
devices = JSON.parse(await (await fetch("../../devices.json")).text());
105+
} catch(e) {
106+
console.warn(e);
107+
searchbox.parentElement.remove();
108+
return;
109+
}
110+
111+
table.innerHTML = generateHTML(JSON.parse(JSON.stringify(devices)));
112+
113+
function search(keyword) {
114+
let dv = JSON.parse(JSON.stringify(devices));
115+
keyword = keyword.toLowerCase().trim();
116+
if (keyword === "show hidden!") {
117+
searchbox.value = "";
118+
keyword = "";
119+
window.showExperimental = true;
120+
}
121+
if (!keyword) {
122+
table.innerHTML = generateHTML(dv);
123+
return;
124+
}
125+
for (const k in dv) {
126+
for (let i=0; i<dv[k].devices.length; i++) {
127+
let hasTerm = dv[k].devices[i].device.filter(e => e.toLowerCase().includes(keyword)).length !== 0 || dv[k].devices[i].boardname.toLowerCase().includes(keyword);
128+
if (!hasTerm) {
129+
dv[k].devices.splice(i, 1);
130+
i--;
131+
}
132+
}
133+
if (dv[k].devices.length === 0) {
134+
delete dv[k];
135+
}
136+
}
137+
if (Object.keys(dv).length === 0) {
138+
table.innerHTML = "";
139+
table.innerText = "Device not found. Did you make a typo?";
140+
return;
141+
}
142+
table.innerHTML = generateHTML(dv);
143+
}
144+
searchbox.addEventListener("keyup", (e) => search(e.target.value));
145+
})();

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)