Skip to content

Commit

Permalink
factory: do not mount /lib/{modules,firmware} if there is a drivers tree
Browse files Browse the repository at this point in the history
Do not mount /lib/{modules,firmware} in case snapd created a drivers
tree for our kernel snap, as in that case these mounts will be created
by snapd-generator from the base or from the snapd deb package for
hybrid systems. This situation is expected to happen only for UC24+.
  • Loading branch information
alfonsosanchezbeato committed May 16, 2024
1 parent a0ef0e0 commit 1be1983
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 75 deletions.
8 changes: 7 additions & 1 deletion factory/usr/lib/core/extra-paths
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

set -eu

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

# Mount /lib/{firmware,modules} only if there is no drivers tree created by snapd
if [ ! -d /run/mnt/data/system-data/var/lib/snapd/kernel ]; 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 1be1983

Please sign in to comment.