diff options
| author | Nippy <nippy@rp1.hu> | 2026-07-18 09:31:11 +0200 |
|---|---|---|
| committer | Nippy <nippy@rp1.hu> | 2026-07-18 09:31:41 +0200 |
| commit | e8fb93649bbceb314c691493dbc1cda2e7a0ffa6 (patch) | |
| tree | 1fe5a43ffb6fc22efab06024b254eb3178a11282 /releng/airootfs/usr/share/calamares/kernel-install | |
| parent | 38dc95bc02f867462ee4ad0f542501c95ad1219f (diff) | |
| download | RaveOS-build-iso-e8fb93649bbceb314c691493dbc1cda2e7a0ffa6.tar.gz RaveOS-build-iso-e8fb93649bbceb314c691493dbc1cda2e7a0ffa6.zip | |
new btrfs
Diffstat (limited to 'releng/airootfs/usr/share/calamares/kernel-install')
| -rwxr-xr-x | releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install b/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install index fc31285..316204c 100755 --- a/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install +++ b/releng/airootfs/usr/share/calamares/kernel-install/95-raveos.install @@ -32,11 +32,36 @@ MICROCODE="" # -------------------------------------------------- # Root device detection # -------------------------------------------------- -ROOT_SRC="$(findmnt -no SOURCE /)" -ROOT_FS="$(findmnt -no FSTYPE /)" -ROOT_OPTS="$(findmnt -no OPTIONS /)" +# findmnt can come back empty depending on the chroot/mount-namespace +# context this hook runs in (e.g. during pacstrap). Fall back to +# /proc/mounts, and finally /etc/fstab (once it exists), before giving up. +ROOT_SRC="$(findmnt -no SOURCE / || true)" +ROOT_FS="$(findmnt -no FSTYPE / || true)" +ROOT_OPTS="$(findmnt -no OPTIONS / || true)" -OPTIONS="rw quiet" +if [ -z "$ROOT_SRC" ]; then + ROOT_SRC="$(awk '$2 == "/" {print $1; exit}' /proc/mounts)" + ROOT_FS="$(awk '$2 == "/" {print $3; exit}' /proc/mounts)" + ROOT_OPTS="$(awk '$2 == "/" {print $4; exit}' /proc/mounts)" +fi + +if [ -z "$ROOT_SRC" ] && [ -f /etc/fstab ]; then + ROOT_SRC="$(awk '$2 == "/" {print $1; exit}' /etc/fstab)" + ROOT_FS="$(awk '$2 == "/" {print $3; exit}' /etc/fstab)" + ROOT_OPTS="$(awk '$2 == "/" {print $4; exit}' /etc/fstab)" +fi + +# /proc/mounts and /etc/fstab may give "UUID=xxxx"/"PARTUUID=xxxx" directly +# instead of a /dev/ path -- resolve to an actual device node so the blkid +# lookups below work either way. +case "$ROOT_SRC" in + UUID=*|PARTUUID=*|LABEL=*) + RESOLVED="$(blkid -t "$ROOT_SRC" -o device 2>/dev/null || true)" + [ -n "$RESOLVED" ] && ROOT_SRC="$RESOLVED" + ;; +esac + +OPTIONS="rw quiet splash" # LUKS if [[ "$ROOT_SRC" == /dev/mapper/* ]]; then |