-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
482 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
Cockpit Storage in Anaconda Mode | ||
================================ | ||
|
||
Anaconda (the OS Installer) can open the Cockpit "storaged" page for | ||
advanced setup of the target storage devices. When this is done, | ||
storaged is in a special "Anaconda mode" and behaves significantly | ||
different. | ||
|
||
In essence, the storaged page restricts itself to working with the | ||
target environment. It will hide the real root filesystem (on the USB | ||
stick that the Live environment was booted from, say), but let the | ||
user create a "fake" root filesystem on some block device. | ||
|
||
Entering Anaconda mode | ||
---------------------- | ||
|
||
The "storaged" page is put into Anaconda mode by storing a | ||
"cockpit_anaconda" item in its `window.localStorage`. The value | ||
should be a JSON encoded object, the details of which are explained | ||
below. | ||
|
||
Since both Anaconda and the storaged page are served from the same | ||
origin, Anaconda can just execute something like this: | ||
|
||
``` | ||
window.localStorage.setItem("cockpit_anaconda", | ||
JSON.stringify({ | ||
"mount_point_prefix": "/sysroot", | ||
"available_devices": [ "/dev/sda" ] | ||
})); | ||
window.open("/cockpit/@localhost/storage/index.html", "storage-tab"); | ||
``` | ||
|
||
Ignoring storage devices | ||
------------------------ | ||
|
||
Anaconda needs to tell Cockpit which devices can be used to install | ||
the OS on. This is done with the "available_devices" entry, which is | ||
an array of strings. | ||
|
||
``` | ||
{ | ||
"available_devices": [ "/dev/sda" ] | ||
} | ||
``` | ||
|
||
This list should only contain entries for top-level block devices. It | ||
should not contain things like partitions, device mapper devices, or | ||
mdraid devices. | ||
|
||
Mount point prefix | ||
------------------ | ||
|
||
Cockpit can be put into a kind of "chroot" environment by giving it a | ||
mount point prefix like so: | ||
|
||
``` | ||
{ | ||
"mount_point_prefix": "/sysroot" | ||
} | ||
``` | ||
|
||
This works at the UI level: filesystems that have mount points outside | ||
of "/sysroot" are hidden from the user, and when letting the user work | ||
with mount points below "/sysroot", the "/sysroot" prefix is omitted | ||
in the UI. So when the user says to create a filesystem on "/var", | ||
they are actually creating one on "/sysroot/var". | ||
|
||
However, Cockpit (via UDisks2) will still write the new mount point | ||
configuration into the real /etc/fstab (_not_ | ||
/sysroot/etc/fstab). This is done for the convenience of Cockpit, and | ||
Anaconda is not expected to read it. | ||
|
||
If and how Cockpit communicates back to Anaconda is still open. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* This file is part of Cockpit. | ||
* | ||
* Copyright (C) 2023 Red Hat, Inc. | ||
* | ||
* Cockpit is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Cockpit is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Cockpit; If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import client from "./client.js"; | ||
|
||
export const AnacondaAdvice = () => { | ||
if (!client.in_anaconda_mode()) | ||
return null; | ||
|
||
// Nothing yet. | ||
return null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.