summaryrefslogtreecommitdiffstats
path: root/main/busybox-initscripts/xvd_links
blob: 8874d869169876a267a1feab424f615231ac6dc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
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