-
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
12 changed files
with
220 additions
and
40 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,72 @@ | ||
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), 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", | ||
"ignore_devices": [ "/dev/sr0", "/dev/loop0" ] | ||
})); | ||
window.open("/cockpit/@localhost/storage/index.html", "storage-tab"); | ||
``` | ||
|
||
Ignoring storage devices | ||
------------------------ | ||
|
||
Anaconda needs to tell the storaged page which devices can not be used | ||
to install the OS on. This is done with the "ignore_devices" entry, | ||
which is a array of strings. | ||
|
||
``` | ||
{ | ||
"ignore_devices": [ "/dev/sda" ] | ||
} | ||
``` | ||
|
||
Entries in that array can refer to block devices, LVM2 volume groups | ||
(/dev/vgroup-name/), and Stratis pools (/dev/stratis/pool-name/). | ||
|
||
Mount point prefix | ||
------------------ | ||
|
||
The storaged page 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. 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). | ||
|
||
Anaconda will read the real /etc/fstab and reverse engineer the | ||
storage configuration from it. |
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.