Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a systemd mount unit for CD-ROM devices #1290

Merged
merged 1 commit into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/filesystem/filesystem.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mkdir -p %{buildroot}%{_cross_mandir}
mkdir -p %{buildroot}%{_cross_localstatedir}
mkdir -p %{buildroot}/{boot,dev,proc,root,run,sys,tmp}
mkdir -p %{buildroot}/{home,local,media,mnt,opt,srv}
mkdir -p %{buildroot}/media/cdrom

ln -s .%{_cross_prefix} %{buildroot}%{_prefix}
ln -s .%{_cross_bindir} %{buildroot}/bin
Expand Down
21 changes: 21 additions & 0 deletions packages/release/media-cdrom.mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=CD-ROM mount (/media/cdrom)
# Only run this unit if /dev/cdrom exists and is tracked via systemd. (systemd
# ships with a udev rule to tag and symlink the first suspected cdrom device to
# /dev/cdrom)
Requires=dev-cdrom.device
After=dev-cdrom.device
zmrow marked this conversation as resolved.
Show resolved Hide resolved
zmrow marked this conversation as resolved.
Show resolved Hide resolved
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target

[Mount]
What=/dev/cdrom
Where=/media/cdrom
Type=iso9660
Options=defaults,noexec

[Install]
# This dependency ensures that systemd attempts to run this unit if the device
# exists.
WantedBy=dev-cdrom.device
6 changes: 5 additions & 1 deletion packages/release/release.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Source1008: opt.mount
Source1009: var-lib-bottlerocket.mount
Source1010: etc-cni.mount

# CD-ROM mount
Source1015: media-cdrom.mount

# Mounts that require build-time edits.
Source1020: var-lib-kernel-devel-lower.mount.in
Source1021: usr-src-kernels.mount.in
Expand Down Expand Up @@ -104,7 +107,7 @@ EOF

install -d %{buildroot}%{_cross_unitdir}
install -p -m 0644 \
%{S:1002} %{S:1006} %{S:1007} %{S:1008} %{S:1009} %{S:1010} \
%{S:1002} %{S:1006} %{S:1007} %{S:1008} %{S:1009} %{S:1010} %{S:1015} \
%{buildroot}%{_cross_unitdir}

LOWERPATH=$(systemd-escape --path %{_cross_sharedstatedir}/kernel-devel/lower)
Expand Down Expand Up @@ -138,6 +141,7 @@ install -p -m 0644 %{S:201} %{buildroot}%{_cross_templatedir}/proxy-env
%{_cross_unitdir}/var.mount
%{_cross_unitdir}/opt.mount
%{_cross_unitdir}/etc-cni.mount
%{_cross_unitdir}/media-cdrom.mount
%{_cross_unitdir}/*-lower.mount
%{_cross_unitdir}/*-kernels.mount
%{_cross_unitdir}/*-licenses.mount
Expand Down