Permalink
Browse files

cleanup cinit-conf.svc.udev.linux

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
  • Loading branch information...
1 parent d21f69d commit 9b9d9486450940bbc25c9bb002e7a52f6b081577 Nico Schottelius committed Oct 4, 2009
Showing with 32 additions and 51 deletions.
  1. +1 −1 Makefile
  2. +4 −4 bin/cinit-conf.svc.dependency.add
  3. +27 −46 bin/cinit-conf.svc.udev.linux
View
@@ -111,7 +111,7 @@ de-install:
de-run:
ssh root@de reboot
-UBUNTUHOST=cinit@192.168.122.111
+UBUNTUHOST=cinit@192.168.122.107
UBUNTUCONF=./etc/cinit-ubuntu
UBUNTUINSTALL="cd cinit && make clean && sudo make install"
UBUNTUTEST="sudo reboot"
@@ -1,15 +1,15 @@
#!/bin/sh
#
-# 2008-2009 Nico Schottelius (nico-cinit-conf at schottelius.org)
+# 2008-2009 Nico Schottelius (nico-cinit at schottelius.org)
#
-# This file is part of cinit-conf.
+# This file is part of cinit.
#
-# cinit-conf is free software: you can redistribute it and/or modify
+# cinit is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# cinit-conf is distributed in the hope that it will be useful,
+# cinit is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -1,9 +1,25 @@
#!/bin/sh
-# Nico Schottelius
-# cinit: install udev
-# Date: 2005-10-15
-# Comment: DO NOT RSYNC TO THE WRONG SIDE!
#
+# 2009 Nico Schottelius (nico-cinit at schottelius.org)
+#
+# This file is part of cinit.
+#
+# cinit is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# cinit is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with cinit. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+# Configure the udev service
+#
. "$(dirname $0)/cinit-conf.read-conf"
@@ -14,51 +30,16 @@ if [ $# -ne 0 ]; then
exit 1
fi
-BIN_UDEVSEND=$($(dirname $0)/cinit.path-find udevsend)
-BIN_UDEVSTART=$($(dirname $0)/cinit.path-find udevstart)
-BIN_SYSCTL=$($(dirname $0)/cinit.path-find sysctl)
-BIN_MOUNT=$($(dirname $0)/cinit.path-find mount)
-SERVICE="local-tuning/udev"
-
-if [ -z "$BIN_UDEVSEND" -o -z "$BIN_UDEVSTART" -o -z "$BIN_SYSCTL" -o -z "$BIN_MOUNT" ]; then
- echo "Did not find a binary."
- exit 1
-fi
-
-if [ -d "${DESTDIR}/${CINIT_DIR}/${SERVICE}" ]; then
- echo "Service ${SERVICE} already exists."
- exit 1
-fi
-
-echo "Installing ${SERVICE} to ${DESTDIR}/${CINIT_DIR}/ ..."
+BINARY_PATH="$(which udevadm)"
-# 0. general udev
-"$INSTALL_PROG" "$INSTALL_DIRECTORY" \
- "${DESTDIR}${CINIT_DIR}/${SERVICE}"
-# 1. udevmount
-"$INSTALL_PROG" "$INSTALL_DIRECTORY" \
- "${DESTDIR}${CINIT_DIR}/mount/udev"
-ln -sf "$BIN_MOUNT" "${DESTDIR}${CINIT_DIR}/mount/udev/$C_ON"
-echo "udev" > "${DESTDIR}${CINIT_DIR}/mount/udev/$C_ON$C_PARAMS"
-echo "-t" >> "${DESTDIR}${CINIT_DIR}/mount/udev/$C_ON$C_PARAMS"
-echo "tmpfs" >> "${DESTDIR}${CINIT_DIR}/mount/udev/$C_ON$C_PARAMS"
-echo "/dev" >> "${DESTDIR}${CINIT_DIR}/mount/udev/$C_ON$C_PARAMS"
+SVC="local-tuning/udev"
-# 2. udevstart
-"$INSTALL_PROG" "$INSTALL_DIRECTORY" \
- "${DESTDIR}${CINIT_DIR}/${SERVICE}/udevstart"
-ln -sf "$BIN_UDEVSTART" "${DESTDIR}${CINIT_DIR}/${SERVICE}/udevstart/$C_ON"
+cinit-conf.svc-create.template "${SVC}"
+cinit-conf.svc-on "${SVC}" "${BINARY_PATH}"
+cinit-conf.svc-param.add "${SVC}" "${C_ON}" "settle"
# dependencies
-$(dirname $0)/cinit-conf.add.dependency ${SERVICE}/udevstart needs mount/sys
-$(dirname $0)/cinit-conf.add.dependency ${SERVICE}/udevstart needs mount/udev
-
-# 3. udev to hotplug
-"$INSTALL_PROG" "$INSTALL_DIRECTORY" \
- "${DESTDIR}/${CINIT_DIR}/${SERVICE}/hotplug"
-ln -sf "$BIN_SYSCTL" "${DESTDIR}/${CINIT_DIR}/${SERVICE}/hotplug/$C_ON"
-echo "$BIN_UDEVSEND" > "${DESTDIR}${CINIT_DIR}/${SERVICE}/hotplug/$C_ON$C_PARAMS"
-
-$(dirname $0)/cinit-conf.add.dependency ${SERVICE}/hotplug needs mount/proc
+cinit-conf.add.dependency "${SVC}" needs mount/sys
+cinit-conf.add.dependency "${SVC}" needs mount/udev
exit 0

0 comments on commit 9b9d948

Please sign in to comment.