Skip to content

Commit

Permalink
factory: do not mount /lib/{modules,firmware} for run mode
Browse files Browse the repository at this point in the history
Do not mount /lib/{modules,firmware} for run mode, as in that case the
mounts will be created by snapd-generator from the base or from the
snapd deb package for hybrid systems.
  • Loading branch information
alfonsosanchezbeato committed Mar 14, 2024
1 parent 10b19cb commit 537cf31
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 75 deletions.
10 changes: 9 additions & 1 deletion factory/usr/lib/core/extra-paths
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

set -eu

cat <<EOF >>/sysroot/etc/fstab
mode="$(/usr/libexec/core/get-mode mode)" ||
mode="$(/usr/libexec/core/get-arg snapd_recovery_mode)" || mode="unknown"

cat <<'EOF' >>/sysroot/etc/fstab
/run/mnt/data /writable none bind,x-initrd.mount 0 0
EOF

if [ "$mode" != "run" ]; then
cat <<'EOF' >>/sysroot/etc/fstab
/run/mnt/kernel/firmware /usr/lib/firmware none bind,x-initrd.mount 0 0
/run/mnt/kernel/modules /usr/lib/modules none bind,x-initrd.mount 0 0
EOF
fi
57 changes: 0 additions & 57 deletions factory/usr/lib/systemd/system-generators/kernel-snap-generator

This file was deleted.

16 changes: 0 additions & 16 deletions factory/usr/lib/systemd/system/classic-mounts.service

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Description=Detect Ubuntu classic sysroot
DefaultDependencies=no
Before=initrd-root-device.target
After=snap-initramfs-mounts.service
Wants=classic-mounts.service

ConditionPathIsMountPoint=!/run/mnt/base

Expand Down

0 comments on commit 537cf31

Please sign in to comment.