summaryrefslogtreecommitdiff
path: root/configs/releng/root-image/etc/rc.d
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-09-13 21:54:55 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-09-13 21:54:55 -0300
commitb11fa2ad388eaaa3776a3d3c99fb30d6ddb111b0 (patch)
treec5386f2d16ed5ff4170f4915fbf07c6f478f8599 /configs/releng/root-image/etc/rc.d
parent64a660adb9a1ad658874759c186e0e9cbf138e63 (diff)
parent0d04c89e6bfee46477ef08030654a0b421ba86ae (diff)
Merge branch 'master' of https://projects.archlinux.org/git/archiso
Conflicts: README archiso/mkarchiso configs/baseline/build.sh configs/baseline/syslinux/syslinux.cfg configs/releng/build.sh configs/releng/packages.i686 configs/releng/packages.x86_64 configs/releng/root-image/etc/arch-release configs/releng/root-image/etc/hosts configs/releng/root-image/etc/issue configs/releng/root-image/etc/motd configs/releng/root-image/etc/rc.conf configs/releng/root-image/libre/report-issues configs/releng/root-image/libre/setup configs/releng/syslinux.dual/archiso_head.cfg configs/releng/syslinux.dual/archiso_sys32.cfg configs/releng/syslinux.dual/archiso_sys64.cfg configs/releng/syslinux.dual/archiso_tail.cfg configs/releng/syslinux/syslinux.cfg
Diffstat (limited to 'configs/releng/root-image/etc/rc.d')
-rw-r--r--configs/releng/root-image/etc/rc.d/functions.d/automated_script12
-rw-r--r--configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client8
-rw-r--r--configs/releng/root-image/etc/rc.d/functions.d/prepare_locale_gen11
-rwxr-xr-xconfigs/releng/root-image/etc/rc.d/pacman-init34
4 files changed, 40 insertions, 25 deletions
diff --git a/configs/releng/root-image/etc/rc.d/functions.d/automated_script b/configs/releng/root-image/etc/rc.d/functions.d/automated_script
index 7a35acb..f3e9018 100644
--- a/configs/releng/root-image/etc/rc.d/functions.d/automated_script
+++ b/configs/releng/root-image/etc/rc.d/functions.d/automated_script
@@ -1,18 +1,18 @@
automated_script ()
{
script="$(kernel_cmdline script)"
- if [[ -n "$script" ]]; then
+ if [[ -n "${script}" ]]; then
stat_busy "Configuring $script"
- if [[ "$script" =~ ^http:// || "$script" =~ ^ftp:// ]]; then
- wget "$script" -q -O /tmp/startup_script >/dev/null
+ if [[ "${script}" =~ ^http:// || "${script}" =~ ^ftp:// ]]; then
+ wget "${script}" -q -O /tmp/startup_script >/dev/null
rt=$?
else
- cp "$script" /tmp/startup_script
+ cp "${script}" /tmp/startup_script
rt=$?
fi
- if [ $rt -eq 0 ]; then
+ if [ ${rt} -eq 0 ]; then
chmod +x /tmp/startup_script
- echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.bash_profile
+ echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.zprofile
stat_done
else
stat_fail
diff --git a/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client b/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client
deleted file mode 100644
index b72f168..0000000
--- a/configs/releng/root-image/etc/rc.d/functions.d/omit_kill_nbd_client
+++ /dev/null
@@ -1,8 +0,0 @@
-if [[ -f /run/nbd_client.pid ]]; then
- omit_kill_nbd_client() {
- add_omit_pids $(< /run/nbd_client.pid)
- }
-
- add_hook shutdown_prekillall omit_kill_nbd_client
- add_hook single_prekillall omit_kill_nbd_client
-fi
diff --git a/configs/releng/root-image/etc/rc.d/functions.d/prepare_locale_gen b/configs/releng/root-image/etc/rc.d/functions.d/prepare_locale_gen
deleted file mode 100644
index 47ed79d..0000000
--- a/configs/releng/root-image/etc/rc.d/functions.d/prepare_locale_gen
+++ /dev/null
@@ -1,11 +0,0 @@
-prepare_locale_gen ()
-{
- if [[ ${LOCALE} != "en_US.UTF-8" ]]; then
- stat_busy "Generating locales..."
- sed -i "s/#\(${LOCALE/[@.]*}\)/\1/" /etc/locale.gen
- /usr/sbin/locale-gen > /dev/null
- stat_done
- fi
-}
-
-add_hook sysinit_postmount prepare_locale_gen
diff --git a/configs/releng/root-image/etc/rc.d/pacman-init b/configs/releng/root-image/etc/rc.d/pacman-init
new file mode 100755
index 0000000..bbbd719
--- /dev/null
+++ b/configs/releng/root-image/etc/rc.d/pacman-init
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Initializing pacman keyring"
+ if { pacman-key --init && pacman-key --populate archlinux; } &>/dev/null; then
+ add_daemon pacman-init
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Removing pacman keyring"
+ rm -rf /etc/pacman.d/gnupg
+ rm_daemon pacman-init
+ stat_done
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+
+exit 0