The following changes were made:

* Split off separate dev package
  * Moved config to usr/share/eudev (managed by usher)
  * Added init file
This commit is contained in:
2017-05-05 18:03:04 -05:00
parent 999694fe4c
commit 3e831956ff
4 changed files with 86 additions and 20 deletions

37
SNAP/udevd.init Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: udev $time
# Required-Start:
# Required-Stop:
# Should-Start: modules mountkernfs
# Should-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Populate /dev and load kernel modules
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
start)
log_info_msg "Starting udevd"
/sbin/udevd --daemon || error=1
/sbin/udevadm trigger --action=add --type=subsystems || error=1
/sbin/udevadm trigger --action=add --type=devices || error=1
/sbin/udevadm trigger --action=change --type=devices || error=1
/sbin/udevadm settle
[ -z $error ] && log_success_msg || log_failure_msg
;;
restart)
log_info_msg "Reloading udev"
udevadm control --reload-rules && udevadm trigger && \
log_success_msg || log_failure_msg
;;
*)
echo "Usage $0 [start|stop|restart]"
;;
esac
exit 0

View File

@@ -7,22 +7,16 @@ case $1 in
exit 0
;;
postinst)
KERNEL_VER=`ls -C1rt ${TARGET}/boot/vmlinuz*|sed 's/.*vmlinuz-//'`
if [ ! -f ${TARGET}/etc/udev/udev.conf ]; then
install -m 644 ${TARGET}/usr/share/eudev/udev.conf \
${TARGET}/etc/udev/udev.conf
fi
if [[ ${TARGET} ]]; then
echo "Running within ${TARGET} for kernel $KERNEL_VER"
if ! mountpoint -q ${TARGET}/proc; then
mount -t proc none ${TARGET}/proc
fi
chroot ${TARGET} /bin/bash -c "/sbin/mkinitramfs $KERNEL_VER"
if mountpoint -q ${TARGET}/proc; then
umount ${TARGET}/proc
fi
if [[ ! ${TARGET} ]]; then
/etc/init.d/udevd restart
update-rc enable udevd
else
echo "Running for kernel $KERNEL_VER"
mkinitramfs $KERNEL_VER
chroot ${TARGET} 'update-rc enable udevd'
fi
;;
prerm)