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

Conversation

zmrow
Copy link
Contributor

@zmrow zmrow commented Jan 22, 2021

Issue number:
Related to #1288

Description of changes:
This change adds a mount unit that will mount a CD-ROM device located at
/dev/cdrom to /media/cdrom if that device exists. systemd includes a
udev rule to symlink the first suspected CD-ROM device to /dev/cdrom. The
primary use of said device to supply user data to a Bottlerocket host.

Testing done:

  • Build and ran a Bottlerocket AMI to ensure that this unit doesn't interfere with or delay boot
  • Built and ran a fake variant using the changes from Add conditional compilation to early-boot-config #1288 (based on aws-dev) locally to test the cd-rom user data capability. Both xml and user-data files worked as expected.
  • Built and ran the same fake variant without cd-rom connected and the instance booted as expected, did not delay, and early-boot-config properly exited gracefully after no user data was found at the cd-rom location.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@zmrow zmrow requested review from tjkirch, bcressey and jahkeup January 22, 2021 21:38
Copy link
Member

@jahkeup jahkeup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see a comment for the odd .mount, but otherwise looks great!

packages/release/media-cdrom.mount Show resolved Hide resolved
packages/os/early-boot-config.service Outdated Show resolved Hide resolved
packages/release/release.spec Outdated Show resolved Hide resolved
@zmrow
Copy link
Contributor Author

zmrow commented Jan 25, 2021

Addressed all comments!

This change adds a mount unit that will mount a CD-ROM device located at
/dev/cdrom to /media/cdrom if that device exists.  systemd includes a
udev rule to symlink a suspected CD-ROM device to /dev/cdrom.  The
primary use of said device to supply user data to a bottlerocket host.
@zmrow
Copy link
Contributor Author

zmrow commented Jan 26, 2021

Per offline conversation, removed context= bit from the Options line.

@zmrow zmrow merged commit 55b1c90 into bottlerocket-os:develop Jan 27, 2021
@zmrow zmrow deleted the cdrom branch January 27, 2021 16:44
@zmrow zmrow mentioned this pull request Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants