Skip to content

Commit 906c66e

Browse files
authored
Merge pull request #493 from circuitpython/revert-491-fix/issue-229-writeback
Revert "Document Linux USB mount-option workaround for OSError after Ctrl-D (#229)"
2 parents c339d4a + 4d729e5 commit 906c66e

5 files changed

Lines changed: 1 addition & 223 deletions

File tree

docs/LINUX_USB_MOUNT.md

Lines changed: 0 additions & 113 deletions
This file was deleted.

index.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,6 @@ <h1>Select Serial Device</h1>
338338
<div class="step-content">
339339
<h1>Select USB Host Folder</h1>
340340
<p>Select the root folder of your device. This is typically the CIRCUITPY Drive on your computer unless you renamed it. If your device does not appear as a drive on your computer, it will need to have the USB Host functionality enabled.</p>
341-
<details id="linux-mount-notice" class="linux-mount-notice" hidden>
342-
<summary><strong>Linux:</strong> seeing <code>OSError: [Errno 5]</code> after <kbd>Ctrl</kbd>+<kbd>D</kbd>? Click for fix.</summary>
343-
<p>Your CIRCUITPY drive is mounted with asynchronous writes. Remount it with <code>sync</code>:</p>
344-
<pre><code>udisksctl unmount -b /dev/sdX1
345-
udisksctl mount -b /dev/sdX1 -o sync</code></pre>
346-
<p>Replace <code>sdX1</code> with the correct device. Find it with:</p>
347-
<pre><code>lsblk</code></pre>
348-
<p>or:</p>
349-
<pre><code>mount | grep CIRCUITPY</code></pre>
350-
<p>For a permanent fix, see <a href="https://github.com/circuitpython/web-editor/blob/main/docs/LINUX_USB_MOUNT.md" target="_blank" rel="noopener">Linux USB mount notes</a>.</p>
351-
</details>
352341
<p>
353342
<button class="purple-button hidden" id="useHostFolder"><span id="workingFolder"></span></button>
354343
<button class="purple-button first-item" id="selectHostFolder">Select New Folder</button>

js/common/utilities.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,6 @@ function isChromeOs() {
7575
return false;
7676
}
7777

78-
// Test to see if browser is running on Linux (and is not Chrome OS or
79-
// Android, which can also report "Linux" in the legacy userAgent string).
80-
function isLinux() {
81-
// Newer test on Chromium
82-
if (navigator.userAgentData?.platform === "Linux") {
83-
return true;
84-
}
85-
// Avoid false positives for Chrome OS and Android.
86-
if (isChromeOs()) {
87-
return false;
88-
}
89-
if (navigator.userAgent.includes("Android")) {
90-
return false;
91-
}
92-
if (navigator.userAgent.includes("Linux")) {
93-
return true;
94-
}
95-
return false;
96-
}
97-
9878
// Parse out the url parameters from the current url
9979
function getUrlParams() {
10080
// This should look for and validate very specific values
@@ -187,7 +167,6 @@ export {
187167
isLocal,
188168
isMicrosoftWindows,
189169
isChromeOs,
190-
isLinux,
191170
getUrlParams,
192171
getUrlParam,
193172
timeout,

js/workflows/usb.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {GenericModal, DeviceInfoModal} from '../common/dialogs.js';
44
import {FileOps} from '@adafruit/circuitpython-repl-js'; // Use this to determine which FileTransferClient to load
55
import {FileTransferClient as ReplFileTransferClient} from '../common/repl-file-transfer.js';
66
import {FileTransferClient as FSAPIFileTransferClient} from '../common/fsapi-file-transfer.js';
7-
import { isChromeOs, isLinux, isMicrosoftWindows } from '../common/utilities.js';
7+
import { isChromeOs, isMicrosoftWindows } from '../common/utilities.js';
88

99
let btnRequestSerialDevice, btnSelectHostFolder, btnUseHostFolder, lblWorkingfolder;
1010

@@ -211,16 +211,6 @@ class USBWorkflow extends Workflow {
211211
btnUseHostFolder = modal.querySelector('#useHostFolder');
212212
lblWorkingfolder = modal.querySelector('#workingFolder');
213213

214-
// Show the Linux-only mount-option notice when relevant (#229).
215-
// CIRCUITPY mounted without `sync` on Linux can produce
216-
// "OSError: [Errno 5] Input/output error" on Ctrl-D after a save
217-
// because Chromium's File System Access writes are deferred by the
218-
// kernel writeback for up to ~30s.
219-
const linuxNotice = modal.querySelector('#linux-mount-notice');
220-
if (linuxNotice) {
221-
linuxNotice.hidden = !isLinux();
222-
}
223-
224214
// Map the button states to the buttons
225215
this.connectButtons = {
226216
request: btnRequestSerialDevice,

sass/layout/_layout.scss

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -542,70 +542,3 @@
542542
}
543543

544544
}
545-
546-
// Inline notice shown in the USB connect dialog for Linux users (#229).
547-
.linux-mount-notice {
548-
margin-top: 1rem;
549-
padding: 0.5rem 1rem;
550-
border-left: 4px solid #f0ad4e;
551-
background-color: #fff8e1;
552-
border-radius: 3px;
553-
font-size: 0.95em;
554-
555-
summary {
556-
cursor: pointer;
557-
padding: 0.25rem 0;
558-
list-style: none;
559-
position: relative;
560-
padding-left: 1.25rem;
561-
562-
&::-webkit-details-marker {
563-
display: none;
564-
}
565-
566-
&::before {
567-
content: "\25B6"; // right-pointing triangle
568-
position: absolute;
569-
left: 0;
570-
font-size: 0.8em;
571-
transition: transform 150ms ease-in-out;
572-
display: inline-block;
573-
}
574-
}
575-
576-
&[open] summary {
577-
margin-bottom: 0.5rem;
578-
579-
&::before {
580-
transform: rotate(90deg);
581-
}
582-
}
583-
584-
p {
585-
margin: 0.25rem 0;
586-
}
587-
588-
pre {
589-
margin: 0.5rem 0;
590-
padding: 0.5rem;
591-
background-color: #2d2d2d;
592-
color: #f1f1f1;
593-
border-radius: 3px;
594-
overflow-x: auto;
595-
font-size: 0.9em;
596-
}
597-
598-
code {
599-
font-family: monospace;
600-
}
601-
602-
kbd {
603-
display: inline-block;
604-
padding: 1px 4px;
605-
font-family: monospace;
606-
font-size: 0.9em;
607-
background-color: #eee;
608-
border: 1px solid #ccc;
609-
border-radius: 3px;
610-
}
611-
}

0 commit comments

Comments
 (0)