#!/bin/bash

%for %%dev in %%cdrom_devices
# cdrom %%dev
mknod ${LXC_ROOTFS_MOUNT}%%dev b %%dev.cdrom_major %%dev.cdrom_minor
chmod 664 ${LXC_ROOTFS_MOUNT}%%dev
chgrp cdrom ${LXC_ROOTFS_MOUNT}%%dev
%end for

%if 'disknods' in %%current_container and %%len(%%current_container.disknods) > 0
#
## Extra devices of %%current_container.name
#
  %for %%dev in %%current_container.disknods
# %%dev.name
%set %%device = %%get_mount_point_device(%%dev.name)
mkdir -p $(dirname ${LXC_ROOTFS_MOUNT}%%device.name)
mknod ${LXC_ROOTFS_MOUNT}%%device.name %%dev.type %%dev.major %%dev.minor
chmod %%device.mode ${LXC_ROOTFS_MOUNT}%%device.name
chown %%device.uid:%%device.gid ${LXC_ROOTFS_MOUNT}%%device.name
  %end for
%end if

