summaryrefslogtreecommitdiffstats
path: root/main/busybox-initscripts/xvd_links
diff options
context:
space:
mode:
Diffstat (limited to 'main/busybox-initscripts/xvd_links')
-rw-r--r--main/busybox-initscripts/xvd_links12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/busybox-initscripts/xvd_links b/main/busybox-initscripts/xvd_links
new file mode 100644
index 000000000..8874d8691
--- /dev/null
+++ b/main/busybox-initscripts/xvd_links
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+[ -f /sys/block/$MDEV/capability ] || exit
+
+caps="0x`cat /sys/block/$MDEV/capability`"
+
+if [ $(($caps & 8)) -gt 0 ]; then
+ case $ACTION in
+ add|"") ln -sf $MDEV cdrom ;;
+ remove) [ "`readlink cdrom 2>/dev/null`" = $MDEV ] && rm -f cdrom ;;
+ esac
+fi