Starting from:
$30

$24

Assignment 5 Udev Solution




Overview




In this assignment, you will be writing a udev rule to react to a flash drive being plugged into your system, and broadcast a message in response. Due to your servers being hosted on GCP (can’t plug a flash drive into it), I’ve provided a script to emulate a flash drive being plugged in (see usage below).




Submission

Submit via the provided git repo by 11:59pm Monday, April 1st. Place your udev rule in a .rules file as specified in the lecture slides.




Tips




`wall "Message"` Will broadcast "Message" to all logged in users, use that in conjunction with your udev rule.




Provided Scripts




flashdrive.sh

Uses loop devices and `losetup` to emulate a device being added.




Usage




`./flashdrive.sh plugin` "Plugs in" flash drive to your system, outputs the device file.




`./flashdrive.sh unplug` "Unplugs" flash drive, outputs the device file.




update-udev.sh

Script for convenience, copies *.rules to proper path for udev rules and reloads.

More products