merge core systemd in core testing

This commit is contained in:
Anke 2012-09-09 04:17:16 +00:00
parent 9c2537ea7c
commit cff6e49dc2
112 changed files with 759 additions and 6917 deletions

29
chakra-init/PKGBUILD Normal file
View File

@ -0,0 +1,29 @@
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer: abveritas[at]chakra-project[dot]org>
pkgname=chakra-init
pkgver=2012.08
pkgrel=1
pkgdesc="Transitional systemd scripts"
arch=('i686' 'x86_64')
url="http://www.chakra-project.org"
license=('GPL2')
depends=('filesystem')
makedepends=('asciidoc')
install=chakra-init.install
source=('rc.shutdown' 'rc.local.shutdown' 'inittab')
md5sums=('e4798daef2b565e3b6f2ec5e0d5ce3d2'
'669ce6d766dd9deb86686219f3763fe4'
'ec5d68e47feac3fb486b72f82ddabfb5')
package() {
cd ${srcdir}
# setup /etc
mkdir ${pkgdir}/etc
install -m644 -t ${pkgdir}/etc inittab
install -m755 -t ${pkgdir}/etc rc.local.shutdown
install -m755 -t ${pkgdir}/etc rc.shutdown
}

View File

@ -0,0 +1,7 @@
post_install() {
grep "KEYMAP=" /etc/rc.conf.pacsave >> /etc/vconsole.conf
grep "HOSTNAME=" /etc/rc.conf.pacsave | awk -F'"' '{print $2}' > /etc/hostname
sed -i -e 's/halt/poweroff/' /usr/share/config/kdm/kdmrc
systemctl enable NetworkManager.service
systemctl enable kdm.service
}

View File

@ -13,15 +13,15 @@
## Only one of the following two lines can be uncommented!
# Boot to console
id:3:initdefault:
#id:3:initdefault:
# Boot to X11
#id:5:initdefault:
rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
#rc::sysinit:/etc/rc.sysinit
#rs:S1:wait:/etc/rc.single
#rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p
#su:S:wait:/sbin/sulogin -p
# -8 options fixes umlauts problem on login
c1:2345:respawn:/sbin/agetty -8 -s 38400 tty1 linux
@ -40,7 +40,7 @@ c6:2345:respawn:/sbin/agetty -8 -s 38400 tty6 linux
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
# Example lines for starting a login manager
x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1

View File

@ -6,12 +6,12 @@
pkgname=crda
pkgver=1.1.2
pkgrel=2
pkgrel=3
pkgdesc="Central Regulatory Domain Agent"
arch=('i686' 'x86_64')
url="http://wireless.kernel.org/en/developers/Regulatory/CRDA"
license=('custom')
depends=('wireless-regdb' 'libnl' 'libgcrypt' 'udev' 'iw')
depends=('wireless-regdb' 'libnl' 'libgcrypt' 'systemd' 'iw')
makedepends=('python-m2crypto')
install=crda.install
source=(http://wireless.kernel.org/download/crda/${pkgname}-${pkgver}.tar.bz2

View File

@ -1,67 +1,54 @@
#
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer abveritas@chakra-project.org
# maintainer: abveritas@chakra-project.org
pkgname=dbus-core
pkgver=1.4.14
pkgrel=4
pkgdesc="Freedesktop.org message bus system."
pkgver=1.6.4
pkgrel=1
pkgdesc="Freedesktop.org message bus system"
url="http://www.freedesktop.org/Software/dbus"
arch=('i686' 'x86_64')
arch=(i686 x86_64)
license=('GPL' 'custom')
depends=('expat>=2.0.1' 'coreutils' 'filesystem' 'shadow')
depends=('expat' 'coreutils' 'filesystem' 'shadow' 'systemd') # shadow for install scriptlet FS#29341
makedepends=('libx11')
conflicts=('dbus<1.2.3-2')
options=(!libtool)
install="dbus.install"
source=("http://dbus.freedesktop.org/releases/dbus/dbus-${pkgver}.tar.gz"
'dbus')
md5sums=('ae6de2562a57516cfabaf56903375ba9'
'81eb58bbe2b2212210e592ccd1eb5c3c')
install=dbus.install
source=(http://dbus.freedesktop.org/releases/dbus/dbus-$pkgver.tar.gz{,.asc}
dbus)
md5sums=('5ec43dc4554cba638917317b2b4f7640'
'3d4482ee39b49da334441c76f83bf1cb'
'f0364f3f5dc5f653bb05d39aa36e3264')
build() {
cd "${srcdir}/dbus-${pkgver}"
./configure --prefix=/usr \
--sysconfdir=/etc --localstatedir=/var \
--libexecdir=/usr/lib/dbus-1.0 \
--with-dbus-user=81 \
--with-system-pid-file=/var/run/dbus.pid \
--enable-inotify \
--disable-dnotify \
--disable-verbose-mode \
--disable-static \
--disable-tests \
--disable-asserts \
--with-systemdsystemunitdir=/usr/lib/systemd/system
cd dbus-$pkgver
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--libexecdir=/usr/lib/dbus-1.0 --with-dbus-user=81 \
--with-system-pid-file=/run/dbus/pid \
--with-system-socket=/run/dbus/system_bus_socket \
--with-console-auth-dir=/run/console/ \
--enable-inotify --disable-dnotify \
--disable-verbose-mode --disable-static \
--disable-tests --disable-asserts \
--with-systemdsystemunitdir=/usr/lib/systemd/system \
--enable-systemd
make
}
package(){
cd "${srcdir}/dbus-${pkgver}"
make DESTDIR="${pkgdir}" install
cd dbus-$pkgver
make DESTDIR="$pkgdir" install
rm -f "${pkgdir}/usr/bin/dbus-launch"
rm -f "${pkgdir}/usr/share/man/man1/dbus-launch.1"
rm -f "$pkgdir/usr/bin/dbus-launch"
rm -f "$pkgdir/usr/share/man/man1/dbus-launch.1"
rm -rf "$pkgdir/var/run"
chown 81:81 "${pkgdir}/var/run/dbus"
install -m755 -d "${pkgdir}/etc/rc.d"
install -m755 "${srcdir}/dbus" "${pkgdir}/etc/rc.d/"
install -m755 -d "$pkgdir/etc/rc.d"
install -m755 ../dbus "$pkgdir/etc/rc.d/"
#Fix configuration file
sed -i -e 's|<user>81</user>|<user>dbus</user>|' "${pkgdir}/etc/dbus-1/system.conf"
sed -i -e 's|<user>81</user>|<user>dbus</user>|' "$pkgdir/etc/dbus-1/system.conf"
# Install .keep files so pacman doesn't delete empty dirs
touch "${pkgdir}/usr/share/dbus-1/services/.keep"
touch "${pkgdir}/usr/share/dbus-1/system-services/.keep"
touch "${pkgdir}/etc/dbus-1/session.d/.keep"
touch "${pkgdir}/etc/dbus-1/system.d/.keep"
install -d -m755 "${pkgdir}/usr/share/licenses/dbus-core"
install -m644 COPYING "${pkgdir}/usr/share/licenses/dbus-core/"
install -dm755 "$pkgdir/usr/share/licenses/dbus-core"
install -m644 COPYING "$pkgdir/usr/share/licenses/dbus-core/"
}
# vim:set ts=2 sw=2 et:

View File

@ -4,19 +4,14 @@
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
case $1 in
start)
stat_busy "Starting D-BUS system messagebus"
if [ ! -x /var/run/dbus ] ; then
install -m755 -g 81 -o 81 -d /var/run/dbus
if [[ ! -d /run/dbus ]] ; then
install -m755 -g 81 -o 81 -d /run/dbus
fi
if [ -x /usr/bin/dbus-uuidgen ] ; then
/usr/bin/dbus-uuidgen --ensure
fi
if ! /usr/bin/dbus-daemon --system; then
if ! dbus-daemon --system; then
stat_fail
else
add_daemon dbus
@ -25,27 +20,25 @@ case "$1" in
;;
stop)
stat_busy "Stopping D-BUS system messagebus"
[ -f /var/run/dbus.pid ] && kill "$(cat /var/run/dbus.pid)" &>/dev/null
if [ ${?} -gt 0 ]; then
if ! { [[ -f /run/dbus/pid ]] && kill $(</run/dbus/pid); }; then
stat_fail
else
rm -f /var/run/dbus.pid
rm -f /run/dbus/pid
rm_daemon dbus
stat_done
fi
;;
restart)
"${0}" stop
$0 stop
sleep 1
"${0}" start
$0 start
;;
reload)
stat_busy "Reloading D-BUS configuration"
[ -f /var/run/dbus.pid ] && /usr/bin/dbus-send \
if ! { [[ -f /run/dbus/pid ]] && dbus-send \
--system --type=method_call \
--dest=org.freedesktop.DBus \
/org.freedesktop.DBus.ReloadConfig
if [ ${?} -gt 0 ]; then
/ org.freedesktop.DBus.ReloadConfig; }; then
stat_fail
else
stat_done

View File

@ -1,39 +1,23 @@
post_install() {
if ! getent group dbus >/dev/null; then
/usr/sbin/groupadd -g 81 dbus || {
echo 'Could not set up the dbus group!'
return 1
}
fi
if ! getent passwd dbus >/dev/null; then
/usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus || {
echo 'Could not set up the dbus user!'
return 1
}
fi
usr/bin/passwd -l dbus >/dev/null
dbus-uuidgen --ensure
getent group dbus >/dev/null || groupadd -g 81 dbus
getent passwd dbus >/dev/null || useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus
passwd -l dbus &>/dev/null
}
post_upgrade() {
post_install
# Make sure new rc script can shutdown running dbus
if [ -f /var/run/dbus/pid ]; then
mv /var/run/dbus/pid /var/run/dbus.pid
if [ -f run/dbus.pid -a -d run/dbus ]; then
mv run/dbus.pid run/dbus/pid
fi
}
post_remove() {
if getent passwd dbus >/dev/null; then
/usr/sbin/userdel dbus
userdel dbus
fi
if getent group dbus >/dev/null; then
/usr/sbin/groupdel dbus
groupdel dbus
fi
}
# vim:set ts=2 sw=2 et:

View File

@ -5,9 +5,9 @@
# maintainer Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=filesystem
pkgver=2012.2
pkgrel=3
_codename=Archimedes
pkgver=2012.8
pkgrel=1
_codename=Claire
pkgdesc='Base filesystem'
arch=('any')
license=('GPL')
@ -18,11 +18,13 @@ options=('force')
depends=('iana-etc' 'bash' 'coreutils')
backup=('etc/fstab' 'etc/crypttab' 'etc/group' 'etc/hosts' 'etc/ld.so.conf' 'etc/passwd'
'etc/shadow' 'etc/gshadow' 'etc/resolv.conf' 'etc/motd' 'etc/nsswitch.conf'
'etc/shells' 'etc/host.conf' 'etc/securetty' 'etc/profile' 'etc/issue')
'etc/shells' 'etc/host.conf' 'etc/securetty' 'etc/profile' 'etc/issue' 'etc/hostname'
'etc/machine-info' 'etc/vconsole.conf')
source=('group' 'issue' 'nsswitch.conf' 'securetty' 'host.conf' 'ld.so.conf'
'passwd' 'shadow' 'fstab' 'crypttab' 'hosts' 'motd' 'resolv.conf' 'shells'
'gshadow' 'profile' 'modprobe.d.usb-load-ehci-first')
md5sums=('772fe869b921698cc3e6fde73c4ac85a'
'passwd' 'shadow' 'fstab' 'crypttab' 'hosts' 'hostname' 'motd' 'resolv.conf' 'shells'
'gshadow' 'profile' 'modprobe.d.usb-load-ehci-first' 'machine-info' 'os-release'
'vconsole.conf')
md5sums=('45940618da782cc391c59f88ab3333c3'
'8266bc7566e99f2b5f5e0b5b1ac17241'
'13753e4e0964f3652b0cc60a28528bdf'
'4c4540eeb748bf1f71d631b8c1dcf0b3'
@ -30,15 +32,19 @@ md5sums=('772fe869b921698cc3e6fde73c4ac85a'
'6e488ffecc8ba142c0cf7e2d7aeb832e'
'8a9042a2cedf6b6b47eb8973f14289cb'
'b8355d9d2782f424f4cedcf682651be0'
'18854ca68f1edc5777e6cb1cace1ffd9'
'e5d8323a4dbee7a6d0d2a19cbf4b819f'
'ca716f853860199c1286e7939b2f2666'
'a367150bd0fe6b02114365121de64a53'
'7bc65f234dfb6abf24e7c3b03e86f4ff'
'b7244a8455581eeb441edeec03495054'
'd41d8cd98f00b204e9800998ecf8427e'
'6f48288b6fcaf0065fcb7b0e525413e0'
'22518e922891f9359f971f4f5b4e793c'
'd2dc4e39dbdea75b107f91789e3274ab'
'f95416882cef800edef08382a1176b7d'
'f3b6ae7db8adffaaa4bffc6099dcbd50'
'a8a962370cd0128465d514e6a1f74130')
'a8a962370cd0128465d514e6a1f74130'
'8aba0b33527e812211b9e5f9b87887ae'
'ad64ad33ec45e4f87c6bf225a91ff484'
'201bbb8b4734d2f46afe1e24d7cc6173')
package() {
cd ${pkgdir}
@ -46,10 +52,11 @@ package() {
#
# setup root filesystem
#
for d in bin boot dev etc home media mnt sbin usr var opt srv/http sys run; do
for d in boot dev etc home media mnt usr var opt srv/http run; do
install -d -m755 ${d}
done
install -d -m555 proc
install -d -m555 sys
install -d -m0750 root
install -d -m1777 tmp
# vsftpd won't run with write perms on /srv/ftp
@ -57,7 +64,7 @@ package() {
# setup /etc
install -d etc/{ld.so.conf.d,skel,profile.d}
for f in fstab group host.conf hosts issue ld.so.conf motd nsswitch.conf passwd resolv.conf securetty shells profile; do
for f in fstab group host.conf hostname hosts issue ld.so.conf motd nsswitch.conf passwd resolv.conf securetty shells profile machine-info os-release vconsole.conf; do
install -m644 ${srcdir}/${f} etc/
done
ln -s /proc/self/mounts etc/mtab
@ -68,17 +75,15 @@ package() {
install -D -m644 ${srcdir}/modprobe.d.usb-load-ehci-first usr/lib/modprobe.d/usb-load-ehci-first.conf
# setup /var
for d in cache/man local opt log/old lib/misc empty run; do
for d in cache/man local opt log/old lib/misc empty; do
install -d -m755 var/${d}
done
install -d -m1777 var/{tmp,spool/mail,lock}
install -d -m1777 var/{tmp,spool/mail}
# allow setgid games to write scores
install -d -m775 -g games var/games
ln -s spool/mail var/mail
# not ready yet, needs possible change in pacman or other magic
# is fixed by initscripts on next boot
# ln -s ../run var/run
# ln -s ../run/lock var/lock
ln -s ../run var/run
ln -s ../run/lock var/lock
#
# setup /usr hierarchy
@ -99,8 +104,4 @@ package() {
done
ln -s ../man usr/local/share/man
}
#
# setup chakra tags
#
#echo "Chakra Linux release ${pkgver} (${_codename})" > "${pkgdir}/etc/chakra-release"
#sed -i -e "s~Chakra Linux~Chakra Linux (${pkgver} - ${_codename})~g" "${pkgdir}/etc/issue"

View File

@ -1,33 +1,17 @@
# crypttab: Mappings for encrypted partitions
# crypttab: mappings for encrypted partitions
#
# Each mapped device will be created in /dev/mapper, so your /etc/fstab
# should use the /dev/mapper/{NAME} paths for encrypted devices.
# should use the /dev/mapper/<name> paths for encrypted devices.
#
# Each PASSWORD field can be an absolute pathname to a key file (starting
# with a slash, recommended) or a literal string that will be used as
# a passphrase. To use special characters in the passphrase, surround it
# by quotes, the usual bash quoting rules apply.
# There are two special keywords that cannot be used as passphrases:
# - ASK ask for a passphrase on boot
# - SWAP use a random key and create a swapspace afterwards
# WARNING: use the SWAP keyword carefully, as it overwrites the data
# on the specified partition
#
# To create a key file:
# hashalot -n 32 ripemd160 >/etc/crytfs.key
# or
# dd if=/dev/urandom of=/etc/cryptfs.key bs=256 count=1
#
# To pass additional options to cryptsetup for non-LUKS partitions, use the
# fourth column.
# The Chakra specific syntax has been deprecated, see crypttab(5) for the
# new supported syntax.
#
# NOTE: Do not list your root (/) partition here, it must be set up
# beforehand by the initramfs (/etc/mkinitcpio.conf).
# NAME SOURCE DEVICE PASSWORD OPTIONS
#home /dev/hda4 mypassword
#data1 /dev/hda3 "my \"password\""
# <name> <device> <password> <options>
# home /dev/hda4 /etc/mypassword1
# data1 /dev/hda3 /etc/mypassword2
# data2 /dev/hda5 /etc/cryptfs.key
#swap /dev/hdx4 SWAP -c aes-cbc-essiv:sha256 -s 256
#vol /dev/hdb7 ASK
# swap /dev/hdx4 /dev/urandom swap,cipher=aes-cbc-essiv:sha256,size=256
# vol /dev/hdb7 none

View File

@ -1,9 +1,11 @@
post_install() {
[ -f var/log/lastlog ] || : >var/log/lastlog
[ -f var/log/wtmp ] || : >var/log/wtmp
[ -f var/log/btmp ] || (: >var/log/btmp && chmod 600 var/log/btmp)
[ -f var/log/btmp ] || { : >var/log/btmp && chmod 600 var/log/btmp; }
# workaround for bug #7194
# readded due to bug #9465
# please do not remove!
chmod 1777 var/spool/mail tmp var/tmp var/lock
chmod 1777 var/spool/mail tmp var/tmp
}
# args: <group> [options]
@ -38,9 +40,10 @@ post_upgrade() {
_adduser http -u 33 -d /srv/http -g http -s /bin/false
_addgroup scanner -g 96
_addgroup rfkill -g 24
_addgroup lock -g 54
# sync gshadow to group
if ! grep -q '^rfkill:' etc/gshadow; then
# sync gshadow to group (fixes FS#19869
if ! grep -q '^lock:' etc/gshadow; then
grpconv >/dev/null
fi

View File

@ -19,6 +19,7 @@ rfkill:x:24:
smmsp:x:25:
http:x:33:
games:x:50:
lock:x:54:
network:x:90:
video:x:91:
audio:x:92:

View File

@ -19,6 +19,7 @@ rfkill:x::
smmsp:::
http:::
games:::
lock:::
network:x::
video:x::
audio:::

1
filesystem/hostname Normal file
View File

@ -0,0 +1 @@
localhost

2
filesystem/machine-info Normal file
View File

@ -0,0 +1,2 @@
PRETTY_NAME="Chakra computer"
ICON_NAME="chakra-pc"

8
filesystem/os-release Normal file
View File

@ -0,0 +1,8 @@
NAME="The Chakra-Project"
VERSION="Claire"
ID=chakra
PRETTY_NAME="The Chakra-Project (Claire)"
ANSI_COLOR="0;36"
HOME_URL="http://www.chakra-project.org/"
BUG_REPORT_URL="http://chakra-linux.org/bugs/"

2
filesystem/vconsole.conf Normal file
View File

@ -0,0 +1,2 @@
FONT=
FONT_MAP=

View File

@ -1,20 +1,21 @@
#
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer abveritas@chakra-project.org
# maintainer: abveritas@chakra-project.org
pkgname=hwids
pkgver=20120512
pkgver=20120815
pkgrel=1
pkgdesc="hardware identification databases"
url=https://github.com/Flameeyes/hwids
url="https://github.com/gentoo/hwids"
license=('GPL2')
arch=('any')
source=("https://github.com/Flameeyes/${pkgname}/tarball/${pkgname}-${pkgver}")
md5sums=('d530009df4967b5ece996262f4e39851')
source=("https://github.com/gentoo/${pkgname}/tarball/${pkgname}-${pkgver}")
md5sums=('7a3addeab3fa94e7ce946a5eb8549775')
package() {
cd ${srcdir}/*
mkdir -p "${pkgdir}/usr/share/hwdata"
cp pci.ids usb.ids "${pkgdir}/usr/share/hwdata/"
}

View File

@ -1,8 +0,0 @@
tags
*.tar.xz*
hostname.5
locale.conf.5
vconsole.conf.5
rc.conf.5
rc.d.8
pkg/

View File

@ -1,67 +0,0 @@
VER := $(shell git describe)
DIRS := \
/etc/rc.d \
/etc/conf.d \
/etc/rc.d/functions.d \
/etc/logrotate.d \
/etc/profile.d \
/usr/sbin \
/etc/tmpfiles.d \
/usr/lib/tmpfiles.d \
/etc/binfmt.d \
/usr/lib/binfmt.d \
/etc/sysctl.d \
/usr/lib/sysctl.d \
/usr/lib/initscripts \
/usr/share/bash-completion/completions \
/usr/share/zsh/site-functions \
/usr/share/man/man5 \
/usr/share/man/man8
MAN_PAGES := \
rc.d.8 \
rc.conf.5 \
locale.conf.5 \
vconsole.conf.5 \
hostname.5
all: doc
installdirs:
install -dm755 $(foreach DIR, $(DIRS), $(DESTDIR)$(DIR))
install: installdirs doc
install -m644 -t $(DESTDIR)/etc inittab rc.conf
install -m755 -t $(DESTDIR)/etc rc.local rc.local.shutdown rc.multi rc.shutdown rc.single rc.sysinit
install -m644 -t $(DESTDIR)/etc/logrotate.d bootlog
install -m644 -t $(DESTDIR)/etc/rc.d functions
install -m755 -t $(DESTDIR)/etc/rc.d hwclock network netfs
install -m755 -t $(DESTDIR)/etc/profile.d locale.sh
install -m755 -t $(DESTDIR)/usr/sbin rc.d
install -m644 -t $(DESTDIR)/usr/share/man/man5 $(filter %.5, $(MAN_PAGES))
install -m644 -t $(DESTDIR)/usr/share/man/man8 $(filter %.8, $(MAN_PAGES))
install -m755 -t $(DESTDIR)/usr/lib/initscripts chakra-tmpfiles chakra-sysctl chakra-binfmt
install -m644 tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d/chakra.conf
install -m644 -T bash-completion $(DESTDIR)/usr/share/bash-completion/completions/rc.d
install -m644 -T zsh-completion $(DESTDIR)/usr/share/zsh/site-functions/_rc.d
%.5: %.5.txt
a2x -d manpage -f manpage $<
%.8: %.8.txt
a2x -d manpage -f manpage $<
doc: $(MAN_PAGES)
clean:
rm -f $(MAN_PAGES)
tar:
git archive HEAD --prefix=initscripts-$(VER)/ | xz > initscripts-$(VER).tar.xz
release: tar
scp initscripts-$(VER).tar.xz gerolde.archlinux.org:/srv/ftp/other/initscripts/
scp initscripts-$(VER).tar.xz pkgbuild.com:~/packages/initscripts/trunk/
.PHONY: all installdirs install doc clean tar release

View File

@ -1,73 +0,0 @@
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer abveritas@chakra-project.org
_origname=initscripts
pkgname=initscripts-live
pkgver=2012.05
pkgrel=2
pkgdesc="System initialization/bootup scripts"
arch=('i686' 'x86_64')
url="http://www.chakra-project.org"
license=('GPL2')
groups=('livecd')
provides=("initscripts=${pkgver}")
conflicts=('initscripts' 'chakra-initscripts')
backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown etc/conf.d/wireless)
depends=('glibc' 'bash' 'grep' 'coreutils' 'udev>=182' 'iproute2'
'ncurses' 'kbd' 'findutils' 'sysvinit')
optdepends=('net-tools: legacy networking support'
'bridge-utils: Network bridging support'
'dhcpcd: DHCP network configuration'
'wireless_tools: Wireless networking')
makedepends=('asciidoc')
install=initscripts.install
source=('Makefile' 'binfmt.d.5.txt' 'chakra-tmpfiles' 'hostname.5.txt' 'locale.conf.5.txt'
'network' 'rc.d.8.txt' 'rc.shutdown' 'wireless.conf.d' 'bootlog' 'chakra-tmpfiles'
'hwclock' 'locale.conf.5.txt' 'rc.conf' 'rc.local' 'rc.single' 'zsh-completion'
'chakra-binfmt' 'functions' 'initscripts.install' 'locale.sh' 'rc.conf.5.txt'
'rc.local.shutdown' 'rc.sysinit' 'bash-completion' 'chakra-sysctl' 'inittab' 'netfs'
'rc.d' 'rc.multi' 'tmpfiles.conf' 'vconsole.conf.5.txt' 'initscripts-live-2012.06.patch')
md5sums=('022d743d6c324fa1325d8187e9354365'
'94bf95df61a06ec45107c4ce9bb59439'
'e5e9f79dac305c9a0ffa2077a817d354'
'bdb87ed9c8bd97fcc8ae0c643909c813'
'b772c5a6489881f796a6ec13a4e48cc3'
'e886ba94b6d5fd7987ecf9dfee7cbab3'
'52e1a2dd6339d88eda50d7c990a4513c'
'e4798daef2b565e3b6f2ec5e0d5ce3d2'
'dc5462ed765fa34c907f974d67fb776a'
'5d253f4da16e543efaff53ac9684c1c6'
'e5e9f79dac305c9a0ffa2077a817d354'
'75e147e59b91751b451dcc7bab225278'
'b772c5a6489881f796a6ec13a4e48cc3'
'727e677a2dca88a9dde4fc5846076b69'
'bd236a57bc00aa4727b98c5ae401c457'
'bbdeefad2a1732af6b04484b02527266'
'00ee10313b866a3fe6520a86f6318518'
'f9b3005a8eaae5eb69d2c3d5641534ed'
'a6affe9c73bd416a97d727a54b0b40dd'
'c366072d0b230eb9ee7ab31dd77cf245'
'b910fd6e0b5c421d083de72da03d9d1a'
'ac2d6d1cf7df7d65efc90b7766fceae1'
'669ce6d766dd9deb86686219f3763fe4'
'9b0244348a8acdf179026f46b3cd4d30'
'7d4981aa562187a5fc163ca2677a7cc1'
'1e799eb4a685c494613cb4249feeeb24'
'da9949f67b9100f8b03f4f2c81ff1108'
'5f61e38df0816d4a265f7c27958f2411'
'f528320f16c50d2cb5ad71079bf5f957'
'f3f55aa80da56b1435e8a876bbe18c72'
'2eb9f00e48115a7d19365872cddaa04d'
'7a1e90a17a9f6a89817fb9800fbc54a2'
'82b4149e8f2c461880faa39fb3d710b0')
package() {
cd ${srcdir}
make DESTDIR=${pkgdir} install
install -D -m644 ${srcdir}/wireless.conf.d ${pkgdir}/etc/conf.d/wireless
cd ${pkgdir}
patch -p1 -i ${srcdir}/${pkgname}-2012.06.patch
#rm -v $(find . -type f -name '*.orig')
}

View File

@ -1,39 +0,0 @@
Releasing
1) create an anotated tag on the format YYYY.MM.X, where YYYY is the year,
MM is the month and X is a number starting from 1. E.g.:
$ git tag -a 2011.04.1
2) create a tarball and push it to gerolde and pkgbuild.com (needs 4.3.2 to be done...(
$ make release
3) check that the PKGBUILD in git is in sync with the PKGBUILD to be released
4) create package and push to testing:
4.1) [first time only] set up ssh forwarding so you can connect to gerolde from alderaan
4.1.1) Add "ForwardAgent=yes" to ~/.ssh/config
4.1.2) Add your private key to the authentication agent "ssh-add"
4.2) ssh pkgbuild.com
4.3) [first time only] check out initscripts from svn
4.3.1) svn checkout -N svn+ssh://gerolde.archlinux.org/srv/svn-packages
4.3.2) "cd svn-packages && svn update initscripts"
4.4) get the latest version of initscripts: "cd svn-packages && svn update"
4.5) update the version field in the PKGBUILD
4.6) build the package for both arches: "sudo testing-{i686,x86_64}-build"
4.7) run checkpkg, namcap, and install test at least one of the two packages
4.8) commit to svn and move package to your staging folder (which needs to exist on gerolde):
'testingpkg "commit message"'

View File

@ -1,24 +0,0 @@
# rc.d bash completion by Seblu <seblu@seblu.net>
_rc_d()
{
local action cur prev
actions='help list start stop reload restart'
options='-s --started -S --stopped -a --auto -A --noauto'
_get_comp_words_by_ref cur prev
_get_first_arg
if [[ -z "$arg" ]]; then
COMPREPLY=($(compgen -W "${actions} ${options}" -- "$cur"))
elif [[ "$arg" == help ]]; then
COMPREPLY=()
elif [[ "$arg" == start ]]; then
COMPREPLY=($(comm -23 <(cd /etc/rc.d && compgen -f -X 'functions*' "$cur"|sort) <(cd /run/daemons/ && compgen -f "$cur"|sort)))
elif [[ "$arg" =~ stop|restart|reload ]]; then
COMPREPLY=($(cd /run/daemons/ && compgen -f "$cur"|sort))
else
COMPREPLY=($(compgen -W "${options} $(cd /etc/rc.d && compgen -f -X 'functions*')" -- "$cur"))
fi
}
complete -F _rc_d rc.d
# vim: set ts=2 sw=2 ft=sh noet:

View File

@ -1,57 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
binfmt.d(5)
===========
NAME
----
binfmt.d - Configure additional binary formats at boot
SYNOPSIS
--------
/usr/lib/binfmt.d/*.conf
/etc/binfmt.d/*.conf
/run/binfmt.d/*.conf
DESCRIPTION
-----------
*initscripts* uses files from the above directories to configure additional
binary formats to register during boot in the kernel.
CONFIGURATION FORMAT
--------------------
Each file contains a list of binfmt_misc kernel binary format rules.
Consult *binfmt_misc.txt*[1] for more information on registration of
additional binary formats and how to write rules.
Empty lines and lines beginning with ; and # are ignored. Note that this
means you may not use ; and # as delimiter in binary format rules.
Each configuration file is named in the style of <program>.conf. Files in
/etc/ overwrite files with the same name in /usr/lib/. Files in /run
overwrite files with the same name in /etc/ and /usr/lib/. Packages
should install their configuration files in /usr/lib/, files in /etc/ are
reserved for the local administration, which possibly decides to
overwrite the configurations installed from packages. All files are
sorted by filename in alphabetical order, regardless in which of the
directories they reside, to ensure that a specific configuration file
takes precedence over another file with an alphabetically later name.
EXAMPLE
-------
*Example 1. /etc/binfmt.d/wine.conf example:*
# Start WINE on Windows executables
:DOSWin:M::MZ::/usr/bin/wine:
NOTES
-----
*1. binfmt_misc.txt:*
http://www.kernel.org/doc/Documentation/binfmt_misc.txt
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Sébastien Luttringer.

View File

@ -1,9 +0,0 @@
/var/log/boot {
compress
rotate 1
size=+1024k
notifempty
missingok
copytruncate
noolddir
}

View File

@ -1,45 +0,0 @@
#!/bin/bash
#
# /usr/lib/initscripts/chakra-binfmt
#
# Configure additional binary formats at boot
#
shopt -s nullglob
declare -a binfmt_d
# files given has argv supersede config files
if (( $# > 0 )); then
for arg; do [[ -r "$arg" ]] && binfmt_d+=("$arg"); done
else
binfmt_d=(
/usr/lib/binfmt.d/*.conf
/etc/binfmt.d/*.conf
/run/binfmt.d/*.conf
)
fi
# check there is file to load
(( ${#binfmt_d[@]} > 0 )) || exit 1
# mount binfmt_misc if api filesystem is missing
mountpoint -q /proc/sys/fs/binfmt_misc ||
mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc
# files declared later in the binfmt_d array will override earlier
# Example: `/etc/binfmt.d/foo.conf' supersedes `/usr/lib/binfmt.d/foo.conf'.
declare -A fragments
for path in "${binfmt_d[@]}"; do
[[ -f $path ]] && fragments[${path##*/}]=$path
done
for path in "${fragments[@]}"; do
while read -r line; do
[[ ${line:0:1} == '#' ]] && continue
printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register
done < "$path"
done
:
# vim: set ts=2 sw=2 noet:

View File

@ -1,29 +0,0 @@
#!/bin/bash
#
# /usr/lib/initscripts/chakra-sysctl
#
# Load sysctl configuration files following
# http://0pointer.de/public/systemd-man/sysctl.d.html
#
shopt -s nullglob
declare -a sysctl_d=(
/usr/lib/sysctl.d/*.conf
/etc/sysctl.d/*.conf
/run/sysctl.d/*.conf
/etc/sysctl.conf
)
declare -A fragments
# files declared later in the sysctl_d array will override earlier
# Example: `/etc/sysctl.d/foo.conf' supersedes `/usr/lib/sysctl.d/foo.conf'.
for path in "${@:-${sysctl_d[@]}}"; do
[[ -f $path ]] && fragments[${path##*/}]=$path
done
for path in "${fragments[@]}"; do
sysctl -q -p "$path"
done
# vim: set ts=2 sw=2 noet:

View File

@ -1,297 +0,0 @@
#!/bin/bash
#
# /usr/lib/initscripts/chakra-tmpfiles
#
# Control creation, deletion, and cleaning of volatile and temporary files
#
warninvalid() {
printf "chakra-tmpfiles: ignoring invalid entry on line %d of \`%s'\n" "$LINENUM" "$FILE"
(( ++error ))
} >&2
checkparams() {
local parmreq=$1; shift
local path=$1 mode=$2 uid=$3 gid=$4
# parmcount must be >= parmreq
if (( $# < parmreq )); then
return 1
fi
# mode must be valid octal and 3 or 4 digits
if [[ $mode && ! $mode =~ ^[0-7]{3,4}$ ]]; then
return 1
fi
# uid must be numeric or a valid user name
# don't try to resolve numeric IDs in case they don't exist
if [[ $uid ]]; then
if [[ $uid != +([0-9]) ]] && ! getent passwd "$uid" >/dev/null; then
return 1
fi
fi
# gid must be numeric or a valid group name
# don't try to resolve numeric IDs in case they don't exist
if [[ $gid ]]; then
if [[ $gid != +([0-9]) ]] && ! getent group "$gid" >/dev/null; then
return 1
fi
fi
return 0
}
relabel() {
local -a paths=($1)
local mode=$2 uid=$3 gid=$4
if ! checkparams 4 "$@"; then
warninvalid
return
fi
for path in "${paths[@]}"; do
if [[ -e $path ]]; then
[[ $uid != '-' ]] && chown $CHOPTS "$uid" "$path"
[[ $gid != '-' ]] && chgrp $CHOPTS "$gid" "$path"
[[ $mode != '-' ]] && chmod $CHOPTS "$mode" "$path"
fi
done
}
_f() {
# Create a file if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ ! -e $path ]]; then
install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path"
fi
}
_F() {
# Create or truncate a file
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path"
}
_d() {
# Create a directory if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ ! -d "$path" ]]; then
install -d -m"$mode" -o"$uid" -g"$gid" "$path"
fi
}
_D() {
# Create or empty a directory
local path=$1 mode=$2 uid=$3 gid=$4
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ -d $path ]] && (( REMOVE )); then
find "$path" -mindepth 1 -maxdepth 1 -xdev -exec rm -rf {} +
fi
if (( CREATE )); then
install -d -m"$mode" -o"$uid" -g"$gid" "$path"
fi
}
_p() {
# Create a named pipe (FIFO) if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ ! -p "$path" ]]; then
mkfifo -m$mode "$path"
chown "$uid:$gid" "$path"
fi
}
_x() {
# Ignore a path during cleaning. Use this type to exclude paths from clean-up as
# controlled with the Age parameter. Note that lines of this type do not
# influence the effect of r or R lines. Lines of this type accept shell-style
# globs in place of of normal path names.
:
# XXX: we don't implement this
}
_r() {
# Remove a file or directory if it exists. This may not be used to remove
# non-empty directories, use R for that. Lines of this type accept shell-style
# globs in place of normal path names.
local path
local -a paths=($1)
(( REMOVE )) || return 0
if ! checkparams 1 "$@"; then
warninvalid
return
fi
for path in "${paths[@]}"; do
if [[ -f $path ]]; then
rm -f "$path"
elif [[ -d $path ]]; then
rmdir "$path"
fi
done
}
_R() {
# Recursively remove a path and all its subdirectories (if it is a directory).
# Lines of this type accept shell-style globs in place of normal path names.
local path
local -a paths=($1)
(( REMOVE )) || return 0
if ! checkparams 1 "$@"; then
warninvalid
return
fi
for path in "${paths[@]}"; do
[[ -d $path ]] && rm -rf --one-file-system "$path"
done
}
_z() {
# Set ownership, access mode and relabel security context of a file or
# directory if it exists. Lines of this type accept shell-style globs in
# place of normal path names.
local -a paths=($1)
local mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
relabel "$@"
}
_Z() {
# Recursively set ownership, access mode and relabel security context of a
# path and all its subdirectories (if it is a directory). Lines of this type
# accept shell-style globs in place of normal path names.
(( CREATE )) || return 0
CHOPTS=-R relabel "$@"
}
shopt -s nullglob
declare -i CREATE=0 REMOVE=0 CLEAN=0 error=0 LINENO=0
declare FILE=
declare -A fragments
declare -a tmpfiles_d=(
/usr/lib/tmpfiles.d/*.conf
/etc/tmpfiles.d/*.conf
/run/tmpfiles.d/*.conf
)
while (( $# )); do
case $1 in
--create) CREATE=1 ;;
--remove) REMOVE=1 ;;
esac
shift
done
if (( !(CREATE + REMOVE) )); then
printf 'usage: %s [--create] [--remove]\n' "${0##*/}"
exit 1
fi
# directories declared later in the tmpfiles_d array will override earlier
# directories, on a per file basis.
# Example: `/etc/tmpfiles.d/foo.conf' supersedes `/usr/lib/tmpfiles.d/foo.conf'.
for path in "${@:-${tmpfiles_d[@]}}"; do
[[ -f $path ]] && fragments[${path##*/}]=${path%/*}
done
# catch errors in functions so we can exit with something meaningful
set -E
trap '(( ++error ))' ERR
# loop through the gathered fragments, sorted globally by filename.
# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf'
while read -d '' fragment; do
LINENUM=0
printf -v FILE '%s/%s' "${fragments[$fragment]}" "$fragment"
### FILE FORMAT ###
# XXX: We ignore the final 'Age' parameter
# 0 1 2 3 4 5
# Type Path Mode UID GID Age
# d /run/user 0755 root root 10d
# omit read's -r flag to honor escapes here, so that whitespace can be
# escaped for paths. We will _not_ honor quoted paths.
while read -a line; do
(( ++LINENUM ))
# skip over comments and empty lines
if (( ! ${#line[*]} )) || [[ ${line[0]:0:1} = '#' ]]; then
continue
fi
# whine about invalid entries
if ! type -t _${line[0]} >/dev/null; then
warninvalid
continue
fi
# fall back on defaults when parameters are passed as '-'
if [[ ${line[2]} = '-' ]]; then
case ${line[0]} in
p|f|F) line[2]=0644 ;;
d|D) line[2]=0755 ;;
esac
fi
[[ ${line[3]} = '-' ]] && line[3]='root'
[[ ${line[4]} = '-' ]] && line[4]='root'
"_${line[@]}"
done <"$FILE"
done < <(printf '%s\0' "${!fragments[@]}" | sort -z)
exit $error
# vim: set ts=2 sw=2 noet:

View File

@ -1,726 +0,0 @@
#!/bin/bash
# initscripts functions
#
# sanitize PATH (will be overridden later when /etc/profile is sourced, but is useful for UDev)
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
localevars=(LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE
LC_MEASUREMENT LC_IDENTIFICATION LC_ALL)
vconsolevars=(KEYMAP KEYMAP_TOGGLE FONT FONT_MAP FONT_UNIMAP)
if [[ $1 == "start" ]]; then
if [[ $STARTING ]]; then
echo "A daemon is starting another daemon, this is unlikely to work as intended."
else
export STARTING=1
fi
fi
# width:
calc_columns () {
STAT_COL=80
if [[ ! -t 1 ]]; then
USECOLOR=""
elif [[ -t 0 ]]; then
# stty will fail when stdin isn't a terminal
STAT_COL=$(stty size)
# stty gives "rows cols"; strip the rows number, we just want columns
STAT_COL=${STAT_COL##* }
elif tput cols &>/dev/null; then
# is /usr/share/terminfo already mounted, and TERM recognized?
STAT_COL=$(tput cols)
fi
if (( STAT_COL == 0 )); then
# if output was 0 (serial console), set default width to 80
STAT_COL=80
USECOLOR=""
fi
# we use 13 characters for our own stuff
STAT_COL=$(( STAT_COL - 13 ))
if [[ -t 1 ]]; then
SAVE_POSITION="\e[s"
RESTORE_POSITION="\e[u"
DEL_TEXT="\e[$(( STAT_COL + 4 ))G"
else
SAVE_POSITION=""
RESTORE_POSITION=""
DEL_TEXT=""
fi
}
calc_columns
# disable colors on broken terminals
TERM_COLORS=$(tput colors 2>/dev/null)
if (( $? != 3 )); then
case $TERM_COLORS in
*[!0-9]*) USECOLOR="";;
[0-7]) USECOLOR="";;
'') USECOLOR="";;
esac
fi
unset TERM_COLORS
# clear the TZ envvar, so daemons always respect /etc/localtime
unset TZ
# sanitize the locale settins
unset "${localevars[@]}"
parse_envfile() {
local file=$1 validkeys=("${@:2}") ret=0 lineno=0 key= val=
local -r quotes=$'[\'"]' comments=$'[;#]*'
if [[ -z $file ]]; then
printf "error: no environment file specified\n"
return 1
fi
if [[ ! -f $file ]]; then
printf "error: cannot parse \`%s': No such file or directory\n" "$file"
return 1
fi
if [[ ! -r $file ]]; then
printf "error: cannot read \`%s': Permission denied\n" "$file"
return 1
fi
while IFS='=' read -r key val; do
(( ++lineno ))
# trim whitespace, avoiding usage of a tempfile
key=$(echo "$key" | { read -r key; echo "$key"; })
# key must exist and line must not be a comment
[[ -z $key || ${key:0:1} = $comments ]] && continue
# trim whitespace, strip matching quotes
val=$(echo "$val" | { read -r val; echo "$val"; })
[[ ${val:0:1} = $quotes && ${val:(-1)} = "${val:0:1}" ]] && val=${val:1:(-1)}
if [[ -z $val ]]; then
printf "error: found key \`%s' without value on line %s of %s\n" \
"$key" "$lineno" "$file"
(( ++ret ))
continue
fi
# ignore invalid keys if we have a list of valid ones
if (( ${#validkeys[*]} )) && ! in_array "$key" "${validkeys[@]}"; then
continue
fi
export "$key=$val" || (( ++ret ))
done <"$file"
return $ret
}
# functions:
deltext() {
printf "${DEL_TEXT}"
}
printhl() {
printf "${C_OTHER}${PREFIX_HL} ${C_H1}${1}${C_CLEAR} \n"
}
printsep() {
printf "\n${C_SEPARATOR} ------------------------------\n"
}
stat_bkgd() {
printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} "
deltext
printf " ${C_OTHER}[${C_BKGD}BKGD${C_OTHER}]${C_CLEAR} \n"
}
stat_busy() {
printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} "
printf "${SAVE_POSITION}"
deltext
printf " ${C_OTHER}[${C_BUSY}BUSY${C_OTHER}]${C_CLEAR} "
}
stat_append() {
printf "${RESTORE_POSITION}"
printf -- "${C_MAIN}${1}${C_CLEAR}"
printf "${SAVE_POSITION}"
}
stat_done() {
deltext
printf " ${C_OTHER}[${C_DONE}DONE${C_OTHER}]${C_CLEAR} \n"
}
stat_fail() {
deltext
printf " ${C_OTHER}[${C_FAIL}FAIL${C_OTHER}]${C_CLEAR} \n"
}
stat_die() {
stat_fail
exit ${1:-1}
}
status() {
[[ $1 = '-v' ]] && { local v=1; shift; }
stat_busy "$1"
shift
if (( v )); then
"$@"
else
"$@" &>/dev/null
fi
local ret=$?
(( ret == 0 )) && stat_done || stat_fail
return $ret
}
# usage : in_array( $needle, $haystack )
# return : 0 - found
# 1 - not found
in_array() {
local needle=$1; shift
local item
for item; do
[[ $item = "${needle}" ]] && return 0
done
return 1 # Not Found
}
# daemons:
add_daemon() {
[[ -d /run/daemons ]] || mkdir -p /run/daemons
>| /run/daemons/"$1"
}
rm_daemon() {
rm -f /run/daemons/"$1"
}
ck_daemon() {
[[ ! -f /run/daemons/$1 ]]
}
# Check if $1 is a valid daemon name
have_daemon() {
[[ -f /etc/rc.d/$1 && -x /etc/rc.d/$1 ]]
}
# Check if $1 is started at boot
ck_autostart() {
local daemon
for daemon in "${DAEMONS[@]}"; do
[[ $1 = "${daemon#@}" ]] && return 1
done
return 0
}
start_daemon() {
have_daemon "$1" && /etc/rc.d/"$1" start
}
# Never use this function, it causes daemons to be stoped in the wrong order.
# The only way to start a daemon at boot is to add it to the DAEMONS array.
ck_depends() {
local daemon
for daemon; do
ck_daemon "$daemon" && start_daemon "$daemon"
done
}
start_daemon_bkgd() {
stat_bkgd "Starting $1"
(start_daemon "$1") >/dev/null &
}
stop_daemon() {
have_daemon "$1" && /etc/rc.d/"$1" stop
}
# Status functions
status_started() {
deltext
echo -ne "$C_OTHER[${C_STRT}STARTED$C_OTHER]$C_CLEAR "
}
status_stopped() {
deltext
echo -ne "$C_OTHER[${C_STRT}STOPPED$C_OTHER]$C_CLEAR "
}
ck_status() {
! ck_daemon "$1" && status_started || status_stopped
}
# Return PID of $1
get_pid() {
pidof -o %PPID $1 || return 1
}
# Check if PID-file $1 is still the active PID-file for command $2
ck_pidfile() {
if [[ -f $1 ]]; then
local fpid ppid
read -r fpid <"$1"
ppid=$(get_pid "$2")
[[ $fpid = "${ppid}" ]] && return 0
fi
return 1
}
# PIDs to be omitted by killall5
declare -a omit_pids
add_omit_pids() {
omit_pids+=( $@ )
}
# Stop all daemons
# This function should *never* ever perform any other actions beside calling stop_daemon()!
# It might be used by a splash system etc. to get a list of daemons to be stopped.
stop_all_daemons() {
# Find daemons NOT in the DAEMONS array. Shut these down first
local daemon
for daemon in /run/daemons/*; do
[[ -f $daemon ]] || continue
daemon=${daemon##*/}
ck_autostart "$daemon" && stop_daemon "$daemon"
done
# Shutdown daemons in reverse order
local i daemon
for (( i=${#DAEMONS[@]}-1; i>=0; i-- )); do
[[ ${DAEMONS[i]} = '!'* ]] && continue
daemon=${DAEMONS[i]#@}
ck_daemon "$daemon" || stop_daemon "$daemon"
done
}
# $1 - signal
# $2 - iterations
kill_all_wait() {
# Send SIGTERM/SIGKILL all processes and wait until killall5
# reports all done or timeout.
# Unfortunately killall5 does not support the 0 signal, so just
# use SIGCONT for checking (which should be ignored).
local i
killall5 -${1} ${omit_pids[@]/#/-o } &>/dev/null
for (( i=0; i<${2}; i++ )); do
sleep .25 # 1/4 second
# sending SIGCONT to processes to check if they are there
killall5 -18 ${omit_pids[@]/#/-o } &>/dev/null
if (( $? == 2 )); then
return 0
fi
done
return 1
}
kill_all() {
stat_busy "Sending SIGTERM To Processes"
kill_all_wait 15 40
if (( $? == 0 )); then
stat_done
else
stat_fail
status "Sending SIGKILL To Processes" kill_all_wait 9 60
fi
}
# Start/trigger UDev, load MODULES and settle UDev
udevd_modprobe() {
# $1 = where we are being called from.
# This is used to determine which hooks to run.
status "Starting UDev Daemon" /usr/lib/udev/udevd --daemon
run_hook "$1_udevlaunched"
stat_busy "Triggering UDev uevents"
udevadm trigger --action=add --type=subsystems
udevadm trigger --action=add --type=devices
stat_done
# Load modules from the MODULES array defined in rc.conf
(( ${#MODULES[*]} )) &&
status -v "Loading User-specified Modules" modprobe -ab "${MODULES[@]}"
status "Waiting for UDev uevents to be processed" \
udevadm settle
run_hook "$1_udevsettled"
# in case loading a module changed the display mode
calc_columns
}
activate_vgs() {
[[ $USELVM = [yY][eE][sS] && -x $(type -P lvm) && -d /sys/block ]] || return 0
stat_busy "Activating LVM2 groups"
vgchange --sysinit -a y >/dev/null
(( $? == 0 )) && stat_done || stat_fail
}
do_unlock() {
# $1 = requested name
# $2 = source device
# $3 = password
# $4 = options
stat_append "${1}.."
local open=create a=$1 b=$2 failed=0
# Ordering of options is different if you are using LUKS vs. not.
# Use ugly swizzling to deal with it.
# isLuks only gives an exit code but no output to stdout or stderr.
if cryptsetup isLuks "$2" 2>/dev/null; then
open=luksOpen
a=$2
b=$1
fi
case $3 in
SWAP)
local _overwriteokay=0
if [[ -b $2 && -r $2 ]]; then
# This is DANGEROUS! If there is any known file system,
# partition table, RAID or LVM volume on the device
# we don't overwrite it.
#
# 'blkid' returns 2 if no valid signature has been found.
# Only in this case we should allow overwriting the device.
#
# This sanity check _should_ be sufficient, but it might not.
# This may cause dataloss if it is not used carefully.
blkid -p "$2" &>/dev/null
(( $? == 2 )) && _overwriteokay=1
fi
if (( _overwriteokay == 0 )); then
false
elif cryptsetup -d /dev/urandom $4 $open "$a" "$b" >/dev/null; then
stat_append "creating swapspace.."
mkswap -f -L $1 /dev/mapper/$1 >/dev/null
fi;;
ASK)
printf "\nOpening '$1' volume:\n"
cryptsetup $4 $open "$a" "$b" < /dev/console;;
/dev*)
local ckdev=${3%%:*}
local cka=${3#*:}
local ckb=${cka#*:}
local cka=${cka%:*}
local ckfile=/dev/ckfile
local ckdir=/dev/ckdir
case ${cka} in
*[!0-9]*)
# Use a file on the device
# cka is not numeric: cka=filesystem, ckb=path
mkdir ${ckdir}
mount -r -t ${cka} ${ckdev} ${ckdir}
dd if=${ckdir}/${ckb} of=${ckfile} >/dev/null 2>&1
umount ${ckdir}
rmdir ${ckdir};;
*)
# Read raw data from the block device
# cka is numeric: cka=offset, ckb=length
dd if=${ckdev} of=${ckfile} bs=1 skip=${cka} count=${ckb} >/dev/null 2>&1;;
esac
cryptsetup -d ${ckfile} $4 $open "$a" "$b" >/dev/null
dd if=/dev/urandom of=${ckfile} bs=1 count=$(stat -c %s ${ckfile}) conv=notrunc >/dev/null 2>&1
rm ${ckfile};;
/*)
cryptsetup -d "$3" $4 $open "$a" "$b" >/dev/null;;
*)
printf "${C_FAIL}crypttab contains a literal encryption key. This will stop working in the future.${C_OTHER}\n"
echo "$3" | cryptsetup $4 $open "$a" "$b" >/dev/null;;
esac
if (( $? )); then
failed=1
stat_append "failed "
else
stat_append "ok "
fi
return $failed
}
read_crypttab() {
# $1 = function to call with the split out line from the crypttab
local line nspo failed=0
while read line; do
[[ $line && $line != '#'* ]] || continue
eval nspo=("${line%#*}")
if $1 "${nspo[0]}" "${nspo[1]}" "${nspo[2]}" "${nspo[*]:3}"; then
crypto_unlocked=1
else
failed=1
fi
done < /etc/crypttab
return $failed
}
set_timezone() {
local tz=$1 zonefile=/usr/share/zoneinfo/$1
[[ $tz ]] || return 1
if [[ ! -e $zonefile ]]; then
printf "error: \`%s' is not a valid timezone\n" "$tz"
return 1
fi
if [[ -L /etc/localtime && /etc/localtime -ef $zonefile ]]; then
return 0
else
ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime
fi
}
# Filesystem functions
# These can be overridden/reused for customizations like shutdown/loop-fsck.
NETFS="nfs,nfs4,smbfs,cifs,codafs,ncpfs,shfs,fuse,fuseblk,glusterfs,davfs,fuse.glusterfs"
# Check local filesystems
fsck_all() {
[[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-f"
if [[ ! -n $FORCEFSCK ]] && { [[ -f /fastboot ]] || in_array fastboot $(< /proc/cmdline); }; then
return 0
fi
if [[ -e /run/initramfs/root-fsck ]]; then
IGNORE_MOUNTED="-M"
fi
fsck -A -T -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${IGNORE_MOUNTED} -- ${FORCEFSCK}
}
# Single-user login and/or automatic reboot after fsck (if needed)
fsck_reboot() {
# $1 = exit code returned by fsck
# Ignore conditions 'FS errors corrected' and 'Cancelled by the user'
(( ($1 | 33) == 33 )) && return 0
if (( $1 & 2 )); then
echo
echo "********************** REBOOT REQUIRED *********************"
echo "* *"
echo "* The system will be rebooted automatically in 15 seconds. *"
echo "* *"
echo "************************************************************"
echo
sleep 15
else
echo
echo "***************** FILESYSTEM CHECK FAILED ****************"
echo "* *"
echo "* Please repair manually and reboot. Note that the root *"
echo "* file system is currently mounted read-only. To remount *"
echo "* it read-write type: mount -o remount,rw / *"
echo "* When you exit the maintenance shell the system will *"
echo "* reboot automatically. *"
echo "* *"
echo "************************************************************"
echo
sulogin -p
fi
echo "Automatic reboot in progress..."
umount -a
mount -o remount,ro /
reboot -f
exit 0
}
mount_all() {
mount -a -t "nosysfs,no${NETFS//,/,no}" -O no_netdev
}
umount_all() {
# $1: restrict to fstype
findmnt -mrunRo TARGET,FSTYPE,OPTIONS / | {
while read -r target fstype options; do
# match only targetted fstypes
if [[ $1 && $1 != "$fstype" ]]; then
continue
fi
# don't unmount API filesystems
if [[ $target = /@(proc|sys|run|dev|dev/pts) ]]; then
continue
fi
# avoid networked devices
IFS=, read -ra opts <<< "$options"
if in_array _netdev "${opts[@]}"; then
continue
fi
mounts=("$target" "${mounts[@]}")
done
if (( ${#mounts[*]} )); then
umount -r "${mounts[@]}"
fi
}
}
remove_leftover() {
stat_busy "Removing Leftover Files"
/usr/lib/initscripts/chakra-tmpfiles --create --remove && stat_done || stat_fail
# move from static /var/{run,lock} to /run
if [[ ! -L /var/lock ]]; then
rm -rf /var/lock
ln -s /run/lock /var/lock
fi
if [[ ! -L /var/run ]]; then
rm -rf /var/run
ln -s /run /var/run
fi
}
bootlogd_stop() {
[[ -f /run/bootlogd.pid ]] || return 0
touch /var/log/boot
kill $(< /run/bootlogd.pid)
rm -f /run/bootlogd.pid
sed -i -r -e 's/\^\[\[[0-9]?;?[0-9]?[0-9]?;?[0-9]?[0-9]?[ms]//g' \
-e 's/\^\[(\[1?[0-9][0-9]|%)G//g' -e 's/\^\[\[0;1//g' /var/log/boot
}
###############################
# Custom hooks in initscripts #
###############################
# Hooks can be used to include custom code in various places in the rc.* scripts
#
# Define a hook function in a functions.d file using:
# function_name() {
# ...
# }
# add_hook hook_name function_name
# It is allowed to register several hook functions for the same hook
# Is is also allowed to register the same hook function for several hooks
#
# Currently, the following hooks exist:
# sysinit_start: at the beginning of rc.sysinit
# multi_start: at the beginning of rc.multi
# single_start: at the beginning of rc.single
# shutdown_start: at the beginning of rc.shutdown
# sysinit_end: at the end of rc.sysinit
# multi_end: at the end of rc.multi
# single_end: at the end of rc.single
# sysinit_udevlaunched: after udev has been launched in rc.sysinit
# single_udevlaunched: after udev has been launched in rc.single
# sysinit_udevsettled: after uevents have settled in rc.sysinit
# single_udevsettled: after uevents have settled in rc.single
# sysinit_premount: before local filesystems are mounted, but after root is mounted read-write in rc.sysinit
# sysinit_postmount: after local filesystems are mounted
# shutdown_prekillall: before all processes are being killed in rc.shutdown
# single_prekillall: before all processes are being killed in rc.single
# shutdown_postkillall: after all processes have been killed in rc.shutdown
# single_postkillall: after all processes have been killed in rc.single
# shutdown_preumount: after last filesystem write, but before filesystems are unmounted
# shutdown_postumount: after filesystems are unmounted
# shutdown_poweroff: directly before powering off in rc.shutdown
#
# Declare add_hook and run_hook as read-only to prevent overwriting them.
# Too bad we cannot do the same thing with hook_funcs
if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then
declare -A hook_funcs
add_hook() {
[[ $1 && $2 ]] || return 1
hook_funcs[$1]+=" $2"
}
run_hook() {
[[ $1 ]] || return 1
local func
for func in ${hook_funcs["$1"]}; do
"${func}"
done
}
declare -fr add_hook run_hook
declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1
fi
# Function for setting console font if required
set_consolefont() {
[[ $CONSOLEFONT ]] || return 0
stat_busy "Loading Console Font: $CONSOLEFONT"
#CONSOLEMAP in UTF-8 shouldn't be used
[[ $CONSOLEMAP && ${LOCALE,,} =~ utf ]] && CONSOLEMAP=""
local i
for i in /dev/tty[0-9]*; do
setfont ${CONSOLEMAP:+-m "${CONSOLEMAP}"} \
"$CONSOLEFONT" -C ${i} &>/dev/null
done
if (( $? )); then
stat_fail
else
stat_done
fi
}
if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then
export LANG=${LOCALE:-C}
if [[ -r /etc/locale.conf ]]; then
parse_envfile /etc/locale.conf "${localevars[@]}"
fi
else
export LANG=C
fi
# set colors
if [[ $USECOLOR = [yY][eE][sS] ]]; then
if tput setaf 0 &>/dev/null; then
C_CLEAR=$(tput sgr0) # clear text
C_MAIN=${C_CLEAR}$(tput bold) # main text
C_OTHER=${C_MAIN}$(tput setaf 4) # prefix & brackets
C_SEPARATOR=${C_MAIN}$(tput setaf 0) # separator
C_BUSY=${C_CLEAR}$(tput setaf 6) # busy
C_FAIL=${C_MAIN}$(tput setaf 1) # failed
C_DONE=${C_MAIN} # completed
C_BKGD=${C_MAIN}$(tput setaf 5) # backgrounded
C_H1=${C_MAIN} # highlight text 1
C_H2=${C_MAIN}$(tput setaf 6) # highlight text 2
else
C_CLEAR="\e[m" # clear text
C_MAIN="\e[;1m" # main text
C_OTHER="\e[1;34m" # prefix & brackets
C_SEPARATOR="\e[1;30m" # separator
C_BUSY="\e[;36m" # busy
C_FAIL="\e[1;31m" # failed
C_DONE=${C_MAIN} # completed
C_BKGD="\e[1;35m" # backgrounded
C_H1=${C_MAIN} # highlight text 1
C_H2="\e[1;36m" # highlight text 2
fi
fi
# prefixes:
PREFIX_REG="::"
PREFIX_HL=" >"
# Source additional functions at the end to allow overrides
for f in /etc/rc.d/functions.d/*; do
[[ -e $f ]] && . "$f"
done
# End of file
# vim: set ts=2 sw=2 noet:

View File

@ -1,34 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
hostname(5)
===========
NAME
----
hostname - Local host name configuration file
SYNOPSIS
--------
*/etc/hostname*
DESCRIPTION
-----------
The /etc/hostname file configures the name of the local system that is set during boot. It
should contain a single newline-terminated host name string. The host name may be a free-form string up to 64 characters in length,
however it is recommended that it consists only of 7bit ASCII lower-case characters and no spaces or dots, and limits itself to the
format allowed for DNS domain name labels, even though this is not a strict requirement.
In Chakra-Project GNU/Linux the HOSTNAME variable in /etc/rc.conf is checked for the host name as well, however only as fallback.
HISTORY
-------
The simple configuration file format of /etc/hostname originates from Debian GNU/Linux.
SEE ALSO
--------
systemd.hostname(5), hostname(1), hostname(7), rc.conf(5)
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen.

View File

@ -1,26 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case $HARDWARECLOCK in
UTC) HWCLOCK_PARAMS="--utc";;
localtime) HWCLOCK_PARAMS="--localtime";;
*) HWCLOCK_PARAMS="";;
esac
case "$1" in
start)
add_daemon hwclock;;
stop)
hwclock --adjust $HWCLOCK_PARAMS
rm_daemon hwclock
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

View File

@ -1,774 +0,0 @@
diff -Npur pkg.orig/etc/rc.d/functions pkg/etc/rc.d/functions
--- pkg.orig/etc/rc.d/functions 2012-06-10 22:24:42.000000000 -0400
+++ pkg/etc/rc.d/functions 2012-06-14 02:13:37.827906645 -0400
@@ -132,6 +132,14 @@
printf "${C_OTHER}${PREFIX_HL} ${C_H1}${1}${C_CLEAR} \n"
}
+printhl2() {
+ printf "${C_OTHER2}${PREFIX_HL} ${C_H1}${1}${C_CLEAR}\n"
+}
+
+printhl3() {
+ printf "${C_OTHER3}${PREFIX_HL} ${C_H1}${1}${C_CLEAR}\n"
+}
+
printsep() {
printf "\n${C_SEPARATOR} ------------------------------\n"
}
@@ -546,37 +554,6 @@
mount -a -t "nosysfs,no${NETFS//,/,no}" -O no_netdev
}
-umount_all() {
- # $1: restrict to fstype
-
- findmnt -mrunRo TARGET,FSTYPE,OPTIONS / | {
- while read -r target fstype options; do
- # match only targetted fstypes
- if [[ $1 && $1 != "$fstype" ]]; then
- continue
- fi
-
- # don't unmount API filesystems
- if [[ $target = /@(proc|sys|run|dev|dev/pts) ]]; then
- continue
- fi
-
- # avoid networked devices
- IFS=, read -ra opts <<< "$options"
- if in_array _netdev "${opts[@]}"; then
- continue
- fi
-
- mounts=("$target" "${mounts[@]}")
- done
-
- if (( ${#mounts[*]} )); then
- umount -r "${mounts[@]}"
- fi
- }
-
-}
-
remove_leftover() {
stat_busy "Removing Leftover Files"
/usr/lib/initscripts/chakra-tmpfiles --create --remove && stat_done || stat_fail
@@ -688,13 +665,15 @@
# set colors
if [[ $USECOLOR = [yY][eE][sS] ]]; then
if tput setaf 0 &>/dev/null; then
- C_CLEAR=$(tput sgr0) # clear text
+ C_CLEAR=$(tput sgr0) # clear text
C_MAIN=${C_CLEAR}$(tput bold) # main text
C_OTHER=${C_MAIN}$(tput setaf 4) # prefix & brackets
+ C_OTHER2=${C_MAIN}$(tput setaf 2) # prefix & brackets (green)
+ C_OTHER3=${C_MAIN}$(tput setaf 1) # prefix & brackets (red)
C_SEPARATOR=${C_MAIN}$(tput setaf 0) # separator
C_BUSY=${C_CLEAR}$(tput setaf 6) # busy
C_FAIL=${C_MAIN}$(tput setaf 1) # failed
- C_DONE=${C_MAIN} # completed
+ C_H1=${C_MAIN} # highlight text 1
C_BKGD=${C_MAIN}$(tput setaf 5) # backgrounded
C_H1=${C_MAIN} # highlight text 1
C_H2=${C_MAIN}$(tput setaf 6) # highlight text 2
@@ -702,6 +681,8 @@
C_CLEAR="\e[m" # clear text
C_MAIN="\e[;1m" # main text
C_OTHER="\e[1;34m" # prefix & brackets
+ C_OTHER2="\e[1;32m" # prefix & brackets (green)
+ C_OTHER3="\e[1;31m" # prefix & brackets (red)
C_SEPARATOR="\e[1;30m" # separator
C_BUSY="\e[;36m" # busy
C_FAIL="\e[1;31m" # failed
diff -Npur pkg.orig/etc/rc.d/functions.d/cmdline pkg/etc/rc.d/functions.d/cmdline
--- pkg.orig/etc/rc.d/functions.d/cmdline 1970-01-01 01:00:00.000000000 +0100
+++ pkg/etc/rc.d/functions.d/cmdline 2012-01-22 13:26:17.000000000 +0100
@@ -0,0 +1,52 @@
+get_bootparam_value()
+{
+ [ -z "$CMDLINE" ] && CMDLINE="$(< /proc/cmdline)"
+ case "$CMDLINE" in *\ $1=*) ;; *) return 1; ;; esac
+ local result="${CMDLINE##*$1=}"
+ echo ${result%%[ ]*}
+}
+
+get_country()
+{
+ local COUNTRY=`get_bootparam_value lang`
+ echo $COUNTRY
+}
+
+get_xmode()
+{
+ local XMODE=`get_bootparam_value xmode`
+ echo $XMODE
+}
+
+get_xdepth()
+{
+ local XDEPTH=`get_bootparam_value xdepth`
+ echo $XDEPTH
+}
+
+get_xres()
+{
+ local XRES=`get_bootparam_value xres`
+ echo $XRES
+}
+
+get_xdisplay()
+{
+ local XDISP=`get_bootparam_value xdisplay`
+ echo $XDISP
+}
+
+get_nonfree()
+{
+ local NONFREE=`get_bootparam_value nonfree`
+ echo $NONFREE
+}
+
+get_xdriver()
+{
+ local XDRIVER=`get_bootparam_value xdriver`
+ echo $XDRIVER
+}
+
+# End of file
+# vim: set ts=2 noet:
diff -Npur pkg.orig/etc/rc.local pkg/etc/rc.local
--- pkg.orig/etc/rc.local 2012-01-22 13:12:50.000000000 +0100
+++ pkg/etc/rc.local 2012-01-22 13:26:17.000000000 +0100
@@ -3,4 +3,15 @@
# /etc/rc.local: Local multi-user startup script.
#
+# set correct permissions for live user
+/bin/chown -R live:users /home/live
+# fix sudoers file
+/bin/chown root:root /etc/sudoers
+/bin/chmod 0440 /etc/sudoers
+
+# misc exports
+export KDE_NO_IPV6="TRUE"
+export OPERAPLUGINWRAPPER_PRIORITY=0
+export OOO_FORCE_DESKTOP=kde4
+export SAL_NOOPENGL=true
diff -Npur pkg.orig/etc/rc.shutdown pkg/etc/rc.shutdown
--- pkg.orig/etc/rc.shutdown 2012-01-22 13:12:50.000000000 +0100
+++ pkg/etc/rc.shutdown 2012-01-22 13:26:17.000000000 +0100
@@ -52,16 +52,11 @@ run_hook shutdown_postkillall
run_hook shutdown_preumount
-# unmount any non-api partitions that are backed by swap, we don't want to
-# move their contents into memory (waste of time and might caues OOM).
-status "Unmounting Swap-backed Filesystems" umount_all "tmpfs"
# almost everything is dead now, so the swap should hopefully be relatively
# empty, and quick to switch off
status "Deactivating Swap" swapoff -a
-status "Unmounting Non-API Filesystems" umount_all
-
run_hook shutdown_postumount
# Kill non-root encrypted partition mappings
diff -Npur pkg.orig/etc/rc.sysinit pkg/etc/rc.sysinit
--- pkg.orig/etc/rc.sysinit 2012-06-10 18:33:37.000000000 -0400
+++ pkg/etc/rc.sysinit 2012-06-14 01:57:23.682683596 -0400
@@ -6,6 +6,10 @@
. /etc/rc.conf
. /etc/rc.d/functions
+# clear screen
+# (we can do that safely in the live system)
+/usr/bin/clear
+
echo " "
printhl "${C_CLEAR}CH${C_MAIN}A${C_OTHER}K${C_CLEAR}RA Linux\n"
printhl "${C_H2}http://www.chakra-project.org"
@@ -24,18 +28,553 @@
mountpoint -q /dev/shm || mount /dev/shm &>/dev/null ||
mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
-if [[ ! -e /run/initramfs/fsck-root ]]; then
- # remount root ro to allow for fsck later on, we remount now to
- # make sure nothing can open files rw on root which would block a remount
- findmnt / --options ro &>/dev/null ||
- status "Mounting Root Read-Only" mount -o remount,ro /
-fi
run_hook sysinit_start
# log all console messages
bootlogd -p /run/bootlogd.pid
+#
+# hack to be able to set the locale on bootup
+#
+COUNTRY=`get_country`
+[ -n "$COUNTRY" ] || COUNTRY="enus"
+
+ case "$COUNTRY" in
+ ast)
+ # Asturian
+ LOCALE="ast_ES.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Madrid"
+ KEYMAP="es"
+ XKEYMAP="es"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"es"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ at)
+ # Austrian
+ LOCALE="de_AT.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Vienna"
+ KEYMAP="de"
+ XKEYMAP="de"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"de"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ be)
+ # Belarusian
+ LOCALE="be_BY.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Brussels"
+ KEYMAP="be"
+ XKEYMAP="be"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"be"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ bg)
+ # Bulgarian
+ LOCALE="bg_BG.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Sofia"
+ KEYMAP="bg"
+ XKEYMAP="bg"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"bg"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ ca)
+ # Catalan
+ LOCALE="ca_ES.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Madrid"
+ KEYMAP="es"
+ XKEYMAP="es"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"es"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ cs)
+ # Czech
+ LOCALE="cs_CZ.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Prague"
+ KEYMAP="cz-lat2"
+ XKEYMAP="cz"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"cz"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ de)
+ # German
+ LOCALE="de_DE.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Berlin"
+ KEYMAP="de"
+ XKEYMAP="de"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"de"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ dk)
+ # Danish
+ LOCALE="da_DK.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Copenhagen"
+ KEYMAP="dk"
+ XKEYMAP="dk"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"dk"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ el)
+ # Greek
+ LOCALE="el_GR.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Athens"
+ KEYMAP="el"
+ XKEYMAP="el"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"el"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ engb)
+ # British
+ LOCALE="en_GB.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/London"
+ KEYMAP="gb"
+ XKEYMAP="uk"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"gb"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ ennz)
+ # New Zealand
+ LOCALE="en_NZ.utf"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARMEZONE="Pacific/Auckland"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ enus)
+ # English
+ LOCALE="en_US.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Canada/Pacific"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ es)
+ # Spain
+ LOCALE="es_ES.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Madrid"
+ KEYMAP="es"
+ XKEYMAP="es"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"es"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ esar)
+ # Argetina
+ LOCALE="es_AR.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="America/Argentina"
+ KEYMAP="la-latin1"
+ XKEYMAP="la-latin1"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"es"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ eu)
+ # Basque
+ LOCALE="eu_ES.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Madrid"
+ KEYMAP="es"
+ XKEYMAP="es"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"es"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ fi)
+ # Finland
+ LOCALE="fi_FI.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Helsinki"
+ KEYMAP="fi"
+ XKEYMAP="fi"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"fi"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ fr)
+ # France
+ LOCALE="fr_FR.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Paris"
+ KEYMAP="fr"
+ XKEYMAP="fr"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"fr"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ gl)
+ # Galician
+ LOCALE="gl_ES.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Madrid"
+ KEYMAP="es"
+ XKEYMAP="es"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"es"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ hu)
+ # Hungary
+ LOCALE="hu_HU.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Budapest"
+ KEYMAP="hu"
+ XKEYMAP="hu"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"hu"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ hr)
+ # Croatian
+ LOCALE="hr_HR.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Zagreb"
+ KEYMAP="hr"
+ XKEYMAP="hr"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"hr"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ it)
+ # Italy
+ LOCALE="it_IT.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Rome"
+ KEYMAP="it"
+ XKEYMAP="it"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"it"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ ja)
+ # Japanese
+ LOCALE="ja_JP.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Asia/Tokyo"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ nl)
+ # Dutch
+ LOCALE="nl_NL.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Amsterdam"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ nlbe)
+ # Belgium
+ LOCALE="nl_BE.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Brussels"
+ KEYMAP="be"
+ XKEYMAP="be"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"be"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ no)
+ # Norway
+ LOCALE="nb_NO.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Oslo"
+ KEYMAP="no"
+ XKEYMAP="no"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"no"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ pl)
+ # Poland
+ LOCALE="pl_PL.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Warsaw"
+ KEYMAP="pl"
+ XKEYMAP="pl"
+ CONSOLEFONT="lat2-16.psfu.gz"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"pl"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ ptbr)
+ # Brazilian Portuguese
+ LOCALE="pt_BR.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="America/Sao_Paulo"
+ KEYMAP="br-abnt2"
+ XKEYMAP="pt"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"br"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ ru)
+ # Russia
+ LOCALE="ru_RU.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Moscow"
+ KEYMAP="ru"
+ XKEYMAP="ru"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"ru"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ sk)
+ # Slovak
+ LOCALE="sk_SK.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Bratislava"
+ KEYMAP="sk"
+ XKEYMAP="sk"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"sk"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ sl)
+ # Slovenian
+ LOCALE="sl_SI.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Ljubljana"
+ KEYMAP="slovene"
+ XKEYMAP="si"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"si"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ sr)
+ # Serbian
+ LOCALE="sr_RS.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Belgrade"
+ KEYMAP="sr"
+ XKEYMAP="sr"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"sr"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ sv)
+ # Swedish
+ LOCALE="sv_SE.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Stockholm"
+ KEYMAP="se"
+ XKEYMAP="se"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"se"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ tr)
+ # Turkish
+ LOCALE="tr_TR.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Istanbul"
+ KEYMAP="tr"
+ XKEYMAP="trq"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"tr"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ vcia)
+ # Catalan (valencia)
+ LOCALE="ca_ES.utf8@valencia"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Europe/Madrid"
+ KEYMAP="es"
+ XKEYMAP="es"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"es"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ zhcn)
+ # Simplified Chinese
+ LOCALE="zh_CN.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Asia/Shanghai"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ zhhk)
+ # Traditional Chinese (Hong Kong)
+ LOCALE="zh_HK.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Asia/Hong Kong"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ zhtw)
+ # Traditional Chinese (Taiwan)
+ LOCALE="zh_TW.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Asia/Taipei"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ *)
+ # American
+ LOCALE="en_US.utf8"
+ sed -i -e "s/^LOCALE=.*/LOCALE=\"$LOCALE\"/" /etc/rc.conf
+ echo "LANG=$LOCALE" > /etc/locale.conf
+ echo "LC_MESSAGES=$LOCALE" >> /etc/locale.conf
+ HARDWARECLOCK="UTC"
+ TIMEZONE="Canada/Pacific"
+ KEYMAP="us"
+ XKEYMAP="us"
+ # add HAL config for Xorg input stuff
+ cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
+ sed -i "/XkbLayout/ s/us/"us"/" /etc/X11/xorg.conf.d/10-keyboard.conf
+ ;;
+ esac
+
if [[ -s /etc/locale.conf ]]; then
parse_envfile /etc/locale.conf "LANG"
[[ $LANG ]] && LOCALE=$LANG
@@ -147,9 +686,6 @@
# Single-user login and/or automatic reboot if needed
fsck_reboot $fsckret
-status "Remounting Root" \
- mount -o remount /
-
# now mount all the local filesystems
run_hook sysinit_premount
status "Mounting Local Filesystems" \
diff -Npur pkg.orig/etc/skel/10-keyboard.conf pkg/etc/skel/10-keyboard.conf
--- pkg.orig/etc/skel/10-keyboard.conf 1970-01-01 01:00:00.000000000 +0100
+++ pkg/etc/skel/10-keyboard.conf 2012-01-22 13:26:17.000000000 +0100
@@ -0,0 +1,5 @@
+Section "InputClass"
+ Identifier "Keyboard Defaults"
+ MatchIsKeyboard "yes"
+ Option "XkbLayout" "us"
+EndSection
\ Kein Zeilenumbruch am Dateiende.

View File

@ -1,19 +0,0 @@
post_upgrade() {
if [ "$(vercmp $2 2009.07)" -lt 0 ]; then
echo "==> Adjusting /etc/inittab for transition to /dev/tty standard."
echo "==> Original file saved as /etc/inittab.pacsave"
sed -i'.pacsave' 's#vc/\([0-9]\)#tty\1#' /etc/inittab
fi
if [ "$(vercmp $2 2011.06.1)" -lt 0 ]; then
echo "Blacklisting of modules is no longer supported in rc.conf,"
echo "please add blacklist entries to /etc/modprobe.d/ instead."
fi
if [ "$(vercmp $2 2011.07.2)" -lt 0 ]; then
echo "VERBOSE= in rc.conf no longer has any effect."
echo "Please append 'quiet' to your kernel command line."
fi
if [ "$(vercmp $2 2011.10.1)" -lt 0 ]; then
echo "If using non-bash-compatible shell, please set LANG in /etc/locale.conf,"
echo "as LOCALE in /etc/rc.conf no longer works."
fi
}

View File

@ -1,40 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
locale.conf(5)
==============
NAME
----
locale.conf - configuration file for locale settings
SYNOPSIS
--------
*/etc/locale.conf*
DESCRIPTION
-----------
The /etc/locale.conf file configures system-wide locale settings.
The basic file format of locale.conf is a newline-separated list of environment-like shell-compatible variable assignments. It is
possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported,
allowing applications to read the file without implementing a shell compatible execution engine.
The locale settings configured in /etc/locale.conf are system-wide and are inherited by every service or user, unless overridden or
unset by individual programs or individual users. To avoid services inheriting the locale settings on sysvinit systems, the
DAEMON_LOCALE variable in rc.conf can be set to "no".
In Chakra-Project /etc/rc.conf is checked for locale configuration as well, however only as fallback.
OPTIONS
-------
The following locale settings may be set using /etc/locale.conf: *LANG=*, *LANGUAGE=*, *LC_CTYPE=*, *LC_NUMERIC=*, *LC_TIME=*, *LC_COLLATE=*,
*LC_MONETARY=*, *LC_MESSAGES=*, *LC_PAPER=*, *LC_NAME=*, *LC_ADDRESS=*, *LC_TELEPHONE=*, *LC_MEASUREMENT=*, *LC_IDENTIFICATION=*. Note that *LC_ALL* may not be be configured in this file. For details about the meaning and semantics of these settings, refer to locale(7). The LANG variable overrides LOCALE from /etc/rc.conf.
SEE ALSO
--------
systemd.locale.conf(5), locale(7), rc.conf(5)
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen.

View File

@ -1,83 +0,0 @@
unset LANG
if [ -s /etc/locale.conf ]; then
. /etc/locale.conf
fi
if [ -z "$LANG" ] && [ -s /etc/rc.conf ]; then
LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
fi
export LANG=${LANG:-C}
if [ -n "$LC_CTYPE" ]; then
export LC_CTYPE
else
unset LC_CTYPE
fi
if [ -n "$LC_NUMERIC" ]; then
export LC_NUMERIC
else
unset LC_NUMERIC
fi
if [ -n "$LC_TIME" ]; then
export LC_TIME
else
unset LC_TIME
fi
if [ -n "$LC_COLLATE" ]; then
export LC_COLLATE
else
unset LC_COLLATE
fi
if [ -n "$LC_MONETARY" ]; then
export LC_MONETARY
else
unset LC_MONETARY
fi
if [ -n "$LC_MESSAGES" ]; then
export LC_MESSAGES
else
unset LC_MESSAGES
fi
if [ -n "$LC_PAPER" ]; then
export LC_PAPER
else
unset LC_PAPER
fi
if [ -n "$LC_NAME" ]; then
export LC_NAME
else
unset LC_NAME
fi
if [ -n "$LC_ADDRESS" ]; then
export LC_ADDRESS
else
unset LC_ADDRESS
fi
if [ -n "$LC_TELEPHONE" ]; then
export LC_TELEPHONE
else
unset LC_TELEPHONE
fi
if [ -n "$LC_MEASUREMENT" ]; then
export LC_MEASUREMENT
else
unset LC_MEASUREMENT
fi
if [ -n "$LC_IDENTIFICATION" ]; then
export LC_IDENTIFICATION
else
unset LC_IDENTIFICATION
fi

View File

@ -1,36 +0,0 @@
#!/bin/bash
# sourcing our current rc.conf requires this to be a bash script
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Mounting Network Filesystems"
mount -a -t "$NETFS"
rc=$?
mount -a -O _netdev
(( rc || $? )) && stat_die
add_daemon netfs
stat_done
;;
stop)
stat_busy "Unmounting Network Filesystems"
umount -a -f -O _netdev
rc=$?
umount -a -f -t "$NETFS"
(( rc || $? )) && stat_die
rm_daemon netfs
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
exit 1
esac
# vim: set ts=2 noet:

View File

@ -1,320 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
for s in wireless bonding bridges dhcpcd; do
[[ -f /etc/conf.d/$s ]] && . "/etc/conf.d/$s"
done
# helper function to determine if legacy network support is needed
need_legacy() {
# complain when `interface' is unset and `INTERFACES' has profiles enabled
if [[ -z $interface && ${INTERFACES[@]##!*} ]]; then
return 0 # need legacy
fi
return 1 # enough present for iproute2 support
}
deprecated() {
printf "${C_FAIL}Warning:${C_CLEAR} Your network settings are deprecated.\n"
printf " Please refer to 'man 5 rc.conf' on how to define a single wired\n"
printf " connection, or use a utility such as netcfg.\n"
}
have_interface() {
if [[ -z $1 ]]; then
printf "\n${C_FAIL}Error:${C_CLEAR} \`interface' is undefined in /etc/rc.conf\n"
return 1
fi
if [[ ! -d /sys/class/net/$1 ]]; then
printf "\n${C_FAIL}Error:${C_CLEAR} unknown interface in /etc/rc.conf: \`%s'\n" "$1"
return 1
fi
}
network_up() {
have_interface "$interface" || return 1
ip link set dev $interface up || return 1
if [[ $address ]]; then
ip addr add $address/${netmask:-24} broadcast ${broadcast:-+} dev $interface || return 1
[[ $gateway ]] && { ip route add default via $gateway || return 1; }
else
dhcpcd $DHCPCD_ARGS $interface || return 1
fi
}
network_down() {
have_interface "$interface" || return 1
if [[ -f /run/dhcpcd-$interface.pid ]]; then
dhcpcd -qk $interface || return 1
else
ip addr flush dev $interface || return 1
fi
ip link set dev $interface down || return 1
}
ifup() {
local ifcfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 ifup <interface_name>"
return 1
fi
# Get the name of the interface from the first token in the string
if [[ $ifcfg = dhcp ]]; then
ifname=$1
else
ifname=${ifcfg%% *}
fi
ifconfig $ifname up
wi_up $1 || return 1
if [[ $ifcfg = dhcp ]]; then
# remove the .pid file if it exists
rm -f /run/dhcpcd-${1}.pid >/dev/null 2>&1
rm -f /run/dhcpcd-${1}.cache >/dev/null 2>&1
dhcpcd $DHCPCD_ARGS ${1}
else
ifconfig $ifcfg
fi
}
wi_up() {
local iwcfg=wlan_$1
[[ ${!iwcfg} ]] || return 0
iwconfig ${!iwcfg}
[[ $WIRELESS_TIMEOUT ]] || WIRELESS_TIMEOUT=2
sleep $WIRELESS_TIMEOUT
bssid=$(iwgetid $1 -ra)
if [[ $bssid = 00:00:00:00:00:00 ]]; then
printhl "Could not associate $1 - try increasing WIRELESS_TIMEOUT and check network is WEP or has no security"
return 1
fi
return 0
}
ifdown() {
local ifcfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 ifdown <interface_name>"
return 1
fi
if [[ $ifcfg = dhcp && -f /run/dhcpcd-${1}.pid ]]; then
dhcpcd -k ${1} >/dev/null 2>&1
fi
# Always bring the interface itself down
ifconfig ${1} down >/dev/null 2>&1
}
iflist() {
for ifline in ${INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
printf " $ifline:\t"
else
printf "$ifline:\t"
fi
echo ${!ifline#!}
done
}
rtup() {
local routecfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 rtup <route_name>"
return 1
fi
if [[ $routecfg =~ :: ]]; then
route -A inet6 add $routecfg
else
route add $routecfg
fi
}
rtdown() {
local routecfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 rtdown <route_name>"
return 1
fi
if [[ $routecfg =~ :: ]]; then
route -A inet6 del $routecfg
else
route del $routecfg
fi
}
rtlist() {
for rtline in ${ROUTES[@]}; do
if [[ $rtline = ${rtline#!} ]]; then
printf " $rtline:\t"
else
printf "$rtline:\t"
fi
echo ${!rtline#!}
done
}
bond_up() {
for ifline in ${BOND_INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
bondcfg="bond_$ifline"
if [[ ${!bondcfg} ]]; then
ifenslave $ifline ${!bondcfg} || error=1
fi
fi
done
}
bond_down() {
for ifline in ${BOND_INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
bondcfg="bond_$ifline"
ifenslave -d $ifline ${!bondcfg} || error=1
fi
done
}
bridge_up() {
for br in ${BRIDGE_INTERFACES[@]}; do
if [[ $br = ${br#!} ]]; then
# if the bridge already exists, remove it
if [[ $(ifconfig $br 2>/dev/null) ]]; then
ifconfig $br down
brctl delbr $br
fi
brctl addbr $br
brifs="bridge_$br"
for brif in ${!brifs}; do
if [[ $brif = ${brif#!} ]]; then
for ifline in ${BOND_INTERFACES[@]}; do
if [[ $brif = $ifline && $ifline = ${ifline#!} ]]; then
ifup $ifline
bondcfg="bond_$ifline"
ifenslave $ifline ${!bondcfg} || error=1
unset bond_$ifline
fi
done
brctl addif $br $brif || error=1
fi
done
fi
done
}
bridge_down() {
for br in ${BRIDGE_INTERFACES[@]}; do
if [[ $br = ${br#!} ]]; then
brctl delbr $br
fi
done
}
case "$1" in
start)
# deprecation check
need_legacy && deprecated
if ! ck_daemon network; then
echo "Network is already running. Try 'network restart'"
exit
fi
stat_busy "Starting Network"
error=0
if need_legacy; then
# bring up bridge interfaces
bridge_up
# bring up ethernet interfaces
for ifline in ${INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
ifup $ifline || error=1
fi
done
# bring up bond interfaces
bond_up
# bring up routes
for rtline in "${ROUTES[@]}"; do
if [ "$rtline" = "${rtline#!}" ]; then
rtup $rtline || error=1
fi
done
else
network_up
fi
if (( ! error )); then
add_daemon network
stat_done
else
stat_fail
fi
;;
stop)
# deprecation check
need_legacy && deprecated
if [[ $NETWORK_PERSIST =~ yes|YES && $RUNLEVEL == [06] ]]; then
status "Skipping Network Shutdown" true
exit 0
fi
stat_busy "Stopping Network"
rm_daemon network
error=0
if need_legacy; then
for rtline in "${ROUTES[@]}"; do
if [[ $rtline = ${rtline#!} ]]; then
rtdown $rtline || error=1
fi
done
# bring down bond interfaces
bond_down
for ifline in ${INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
ifdown $ifline || error=1
fi
done
# bring down bridge interfaces
bridge_down
else
network_down
fi
if (( ! error )); then
stat_done
else
stat_fail
fi
;;
restart)
$0 stop
sleep 2
$0 start
;;
ifup|ifdown|iflist|rtup|rtdown|rtlist)
# deprecation check
deprecated
$1 $2
;;
*)
echo "usage: $0 {start|stop|restart}"
echo " $0 {ifup|ifdown|iflist|rtup|rtdown|rtlist}";;
esac
# vim: set ts=2 sw=2 noet:

View File

@ -1,40 +0,0 @@
#
# /etc/rc.conf - Main Configuration for Chakra GNU/Linux
#
# See 'man 5 rc.conf' for more details
#
# LOCALIZATION
# ------------
HARDWARECLOCK=
TIMEZONE=
KEYMAP=
CONSOLEFONT=
CONSOLEMAP=
LOCALE=
DAEMON_LOCALE="yes"
USECOLOR="yes"
# HARDWARE
# --------
MODULES=()
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"
# NETWORKING
# ----------
HOSTNAME=
interface=
address=
netmask=
broadcast=
gateway=
NETWORK_PERSIST="no"
# DAEMONS
# -------
#
DAEMONS=(syslog-ng network crond)

View File

@ -1,223 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
rc.conf(5)
==========
NAME
----
rc.conf - Chakra GNU/Linux main configuration file
SYNOPSIS
--------
/etc/rc.conf
DESCRIPTION
-----------
The /etc/rc.conf file is the system configuration file for Arch-specific
settings. The format is bash. It contains several commonly-edited settings such
as timezone; keymap; kernel modules; daemons to load at start-up; etc. It is
split up in a few sections to categorize configuration settings: localization,
hardware, networking and daemons.
LOCALIZATION[[L]]
-----------------
*TIMEZONE=*
Specifies the timezone. The setting takes effect on boot by ensuring that /etc/localtime is a symlink
to the correct zoneinfo file. Possible timezones are the relative path to a zoneinfo file starting
from the directory /usr/share/zoneinfo. For example, a German timezone would be Europe/Berlin,
which refers to the file /usr/share/zoneinfo/Europe/Berlin.
Note: if empty, /etc/localtime is not changed. This is useful if /etc/localtime is maintained manually
or by a third-party tool; or if there is no reason to change it from what was set during install.
Default: empty
*HARDWARECLOCK=*
How to interpret/update the hardware clock. (used by hwclock)
Options:
- empty: fall back to the value in /var/lib/hwclock/adjtime, which defaults to UTC. This is recommended
as other users of hwclock might change the adjtime file and hence cause rc.conf and adjtime to be out of sync.
- "UTC": most robust, allows operating systems to abstract local time and ease DST.
- "localtime": apply timezone (and DST) in hardwareclock: discouraged.
Choose this if you dualboot with an OS which cannot handle UTC BIOS times correctly, like Windows (note
that recent Windows'es can use UTC, which is preferable).
- any other value will result in the hardware clock being left untouched (useful for virtualization)
Default: empty
*KEYMAP=*
Defines the keymap to load with the loadkeys program on boot. Possible keymaps are
found in /usr/share/kbd/keymaps. Please note that this setting is only valid for
your TTYs, not any graphical window managers or X. KEYMAP in /etc/vconsole.conf takes
precedence.
Default: empty
*CONSOLEFONT=*
Defines the console font to load with the setfont program on boot.
Possible fonts are found in /usr/share/kbd/consolefonts (only needed for non-US).
FONT in /etc/vconsole.conf takes precedence.
Default: empty
*CONSOLEMAP=*
Defines the console map to load with the setfont program on boot. Possible maps are found in
/usr/share/kbd/consoletrans. Set this to a map suitable for the appropriate locale (8859-1 for Latin1,
for example) if you're using an UTF-8 locale and use programs that generate 8-bit output. If you're
using X11 for everyday work, don't bother, as it only affects the output of Linux console applications.
FONT_MAP in /etc/vconsole.conf takes precedence.
Default: empty
*LOCALE=*
This sets your system language, which will be used by all i18n-friendly applications and utilities.
See `locale -a` (or locale.gen) for available options. LANG in /etc/locale.conf takes precedence.
If unset, it falls back to the C locale.
Default: empty
*DAEMON_LOCALE=*
- If set to 'yes', use $LOCALE as the locale during daemon startup and during the boot process.
- If set to 'no', the C locale is used.
Default: "yes"
*USECOLOR=*
Use ANSI color sequences in startup messages
Default: "yes"
HARDWARE[[H]]
-------------
*MODULES=*
Modules to load at boot-up. To blacklist modules, see "man modprobe.d".
Default: ().
*USEDMRAID=*
Scan for FakeRAID (dmraid) Volumes at startup.
Default: "no"
*USEBTRFS=*
Scan for BTRFS volumes at startup.
Default: "no"
*USELVM=*
Scan for LVM volume groups at startup, required if you use LVM.
Default: "no"
NETWORKING[[N]]
---------------
*HOSTNAME=*
Hostname of machine. Should also be put in /etc/hosts. The contents of
/etc/hostname (if not empty) takes precedence.
Default: empty
The following settings help you setting up a wired network.
*interface=*
Name of device. Use 'ip addr' or 'ls /sys/class/net/' to see all available interfaces.
Default: empty
Required for manual configuration as well as DHCP.
*address=*
IP address.
Default: empty
Required for manual configuration, empty for DHCP.
*netmask=*
Subnet mask.
Default: empty (which means 255.255.255.0)
Optional for manual configuration, ignored for DHCP.
*broadcast=*
Broadcast address.
Default: empty
Optional for manual configuration, ignored for DHCP.
*gateway=*
Default route.
Default: empty
Required for manual configuration, ignored for DHCP.
*Static IP example*
interface=eth0
address=192.168.0.2
netmask=255.255.255.0
broadcast=192.168.0.255
gateway=192.168.0.1
*DHCP example*
interface=eth0
address=
netmask=
gateway=
The following options might be needed for advanced use-cases.
*NETWORK_PERSIST=*
Setting this to "yes" will skip network shutdown. This is required if your root device is on NFS.
Default: "no"
*NETWORKS=*
This functionality is deprecated, please refer to the 'netcfg' documentation.
DAEMONS[[D]]
------------
*DAEMONS=*
Daemons to start at boot-up (in this order)
- prefix a daemon with a ! to disable it
- prefix a daemon with a @ to start it up in the background
If you are sure nothing else touches your hardware clock (such as ntpd or
a dual-boot), you might want to enable 'hwclock'. Note that this will only
make a difference if the hwclock program has been calibrated correctly.
If you use a network filesystem you should enable 'netfs'.
Default: (syslog-ng network crond)
AUTHORS
-------
Written by Dieter Plaetinck, Tom Gundersen and others.

View File

@ -1,135 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
# print usage and exit
usage() {
local name=${0##*/}
cat >&2 << EOF
usage: $name <action> [options] [daemons]
options:
-s, --started Filter started daemons
-S, --stopped Filter stopped daemons
-a, --auto Filter auto started daemons
-A, --noauto Filter manually started daemons
<daemons> is a space separated list of script in /etc/rc.d
<action> can be a start, stop, restart, reload, status, ...
WARNING: initscripts are free to implement or not the above actions.
e.g: $name list
$name list sshd gpm
$name list --started gpm
$name start sshd gpm
$name stop --noauto
$name help
EOF
exit ${1:-1}
}
# filter list of daemons
filter_daemons() {
local -a new_daemons=()
for daemon in "${daemons[@]}"; do
# check if daemons is valid
if ! have_daemon "$daemon"; then
printf "${C_FAIL}:: ${C_DONE}Daemon script ${C_FAIL}${daemon}${C_DONE} does \
not exist or is not executable.${C_CLEAR}\n" >&2
exit 2
fi
# check filter
(( ${filter[started]} )) && ck_daemon "$daemon" && continue
(( ${filter[stopped]} )) && ! ck_daemon "$daemon" && continue
(( ${filter[auto]} )) && ck_autostart "$daemon" && continue
(( ${filter[noauto]} )) && ! ck_autostart "$daemon" && continue
new_daemons+=("$daemon")
done
daemons=("${new_daemons[@]}")
}
(( $# < 1 )) && usage
# ret store the return code of rc.d
declare -i ret=0
# daemons store daemons on which action will be executed
declare -a daemons=()
# filter store current filter mode
declare -A filter=([started]=0 [stopped]=0 [auto]=0 [noauto]=0)
# parse options
argv=$(getopt -l 'started,stopped,auto,noauto' -- 'sSaA' "$@") || usage
eval set -- "$argv"
# create an initial daemon list
while [[ "$1" != -- ]]; do
case "$1" in
-s|--started) filter[started]=1 ;;
-S|--stopped) filter[stopped]=1 ;;
-a|--auto) filter[auto]=1 ;;
-A|--noauto) filter[noauto]=1 ;;
esac
shift
done
# remove --
shift
# get action
action=$1
shift
# get initial daemons list
for daemon; do
daemons+=("$daemon")
done
# going into script directory
cd /etc/rc.d
case $action in
help)
usage 0 2>&1
;;
list)
# list take all daemons by default
[[ -z $daemons ]] && for d in *; do have_daemon "$d" && daemons+=("$d"); done
filter_daemons
for daemon in "${daemons[@]}"; do
# print running / stopped satus
if ! ck_daemon "$daemon"; then
s_status="${C_OTHER}[${C_DONE}STARTED${C_OTHER}]"
else
s_status="${C_OTHER}[${C_FAIL}STOPPED${C_OTHER}]"
fi
# print auto / manual status
if ! ck_autostart "$daemon"; then
s_auto="${C_OTHER}[${C_DONE}AUTO${C_OTHER}]"
else
s_auto="${C_OTHER}[${C_FAIL} ${C_OTHER}]"
fi
printf "$s_status$s_auto${C_CLEAR} $daemon\n"
done
;;
*)
# other actions need an explicit daemons list
[[ -z $daemons ]] && usage
filter_daemons
# set same environment variables as init
runlevel=$(/sbin/runlevel)
ENV=('PATH=/bin:/usr/bin:/sbin:/usr/sbin'
"PREVLEVEL=${runlevel%% *}"
"RUNLEVEL=${runlevel##* }"
"CONSOLE=${CONSOLE:-/dev/console}"
"TERM=$TERM")
cd /
for daemon in "${daemons[@]}"; do
env -i "${ENV[@]}" "/etc/rc.d/$daemon" "$action"
(( ret += !! $? )) # clamp exit value to 0/1
done
;;
esac
exit $ret
# vim: set ts=2 sw=2 ft=sh noet:

View File

@ -1,103 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
rc.d(8)
=======
Name
----
rc.d - Initscripts power tool
Synopsis
--------
*rc.d <action> [options] [rc [rc] ...]*
Description
-----------
The *rc.d* program controls and lists rc scripts on the system. An action may be
invoked on one or more scripts using *rc.d action rc1 rc2...*. See <<A,Actions>>
below for more information.
Use *rc.d list* to get the list of all rc scripts on the system.
Actions[[A]]
------------
The actions supported by a rc scripts may be different from script to script, but
commonly supported actions include:
*start*::
Starts the script if it's not already running.
*stop*::
Stops a running script.
*restart*::
Restarts a running script.
More uncommon actions are:
*reload*::
Signals the script to reload its configuration.
*status*::
Shows the status of the script.
Options[[O]]
------------
*-s, --started*::
Filter to started scripts.
*-S, --stopped*::
Filter to stopped scripts.
*-a, --auto*::
Filter to auto started scripts.
*-A, --noauto*::
Filter to manually started scripts.
Examples[[E]]
-------------
*rc.d list*::
List all scripts.
*rc.d list sshd gpm*::
List only *sshd* and *gpm* scripts.
*rc.d list --started gpm*::
List *gpm* script only if started.
*rc.d list --started --auto*::
List all auto started scripts.
*rc.d start sshd gpm*::
Starts *sshd* and *gpm* scripts.
*rc.d start --auto --stopped*::
Starts all stopped scripts which are started at startup.
*rc.d stop crond*::
Stops the *crond* script.
*rc.d stop --noauto*::
Stop all script which are not runned at startup
*rc.d restart crond*::
Restarts the *crond* script.
*rc.d restart --stopped crond*::
Restarts the *crond* script only if stopped.
*rc.d help*::
Display help.
Directories[[D]]
----------------
'/etc/rc.d'::
Directory containing available daemons on the system.
'/usr/lib/initscripts'::
Directory containing available initscripts plugins.
Authors
-------
Written by Sebastien Luttringer and Dave Reisner.

View File

@ -1,6 +0,0 @@
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

View File

@ -1,32 +0,0 @@
#!/bin/bash
#
# /etc/rc.multi
#
. /etc/rc.conf
. /etc/rc.d/functions
run_hook multi_start
# Load sysctl config files
[[ -x /usr/lib/initscripts/chakra-sysctl ]] && /usr/lib/initscripts/chakra-sysctl
# Load additional binary formats
[[ -x /usr/lib/initscripts/chakra-binfmt ]] && /usr/lib/initscripts/chakra-binfmt
# Start daemons
for daemon in "${DAEMONS[@]}"; do
case ${daemon:0:1} in
'!') continue;; # Skip this daemon.
'@') start_daemon_bkgd "${daemon#@}";;
*) start_daemon "$daemon";;
esac
done
[[ -x /etc/rc.local ]] && /etc/rc.local
run_hook multi_end
bootlogd_stop
# vim: set ts=2 sw=2 noet:

View File

@ -1,41 +0,0 @@
#!/bin/bash
#
# /etc/rc.single: Single-user startup script.
#
. /etc/rc.conf
. /etc/rc.d/functions
run_hook single_start
if [[ $PREVLEVEL != N ]]; then
stop_all_daemons
run_hook single_prekillall
kill_all
run_hook single_postkillall
# Start/trigger UDev, load MODULES and settle UDev
udevd_modprobe single
# Removing leftover files
remove_leftover
fi
run_hook single_end
bootlogd_stop
if [[ $RUNLEVEL = 1 ]]; then
printsep
printhl "Entering single-user mode..."
# make sure /dev/initctl is in place
kill -HUP 1
exec init -t1 S
fi
# End of file
# vim: set ts=2 sw=2 noet:

View File

@ -1,196 +0,0 @@
#!/bin/bash
#
# /etc/rc.sysinit
#
. /etc/rc.conf
. /etc/rc.d/functions
echo " "
printhl "${C_CLEAR}CH${C_MAIN}A${C_OTHER}K${C_CLEAR}RA Linux\n"
printhl "${C_H2}http://www.chakra-project.org"
printsep "${C_CLEAR}Copyright 2006-2012 Chakra Developers Team"
# mount the api filesystems
# /proc, /sys, /run, /dev, /run/lock, /dev/pts, /dev/shm
mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev
mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev
mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid
mkdir -p -m 1777 /run/lock
mkdir -p /dev/{pts,shm}
mountpoint -q /dev/pts || mount /dev/pts &>/dev/null ||
mount -n -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec
mountpoint -q /dev/shm || mount /dev/shm &>/dev/null ||
mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
if [[ ! -e /run/initramfs/fsck-root ]]; then
# remount root ro to allow for fsck later on, we remount now to
# make sure nothing can open files rw on root which would block a remount
findmnt / --options ro &>/dev/null ||
status "Mounting Root Read-Only" mount -o remount,ro /
fi
run_hook sysinit_start
# log all console messages
bootlogd -p /run/bootlogd.pid
if [[ -s /etc/locale.conf ]]; then
parse_envfile /etc/locale.conf "LANG"
[[ $LANG ]] && LOCALE=$LANG
fi
if [[ ${LOCALE,,} =~ utf ]]; then
stat_busy "Setting Consoles to UTF-8 mode"
# UTF-8 consoles are default since 2.6.24 kernel
# this code is needed not only for older kernels,
# but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8.
for i in /dev/tty[0-9]*; do
kbd_mode -u < ${i}
printf "\e%%G" > ${i}
done
echo 1 >| /sys/module/vt/parameters/default_utf8
stat_done
else
stat_busy "Setting Consoles to legacy mode"
# make non-UTF-8 consoles work on 2.6.24 and newer kernels
for i in /dev/tty[0-9]*; do
kbd_mode -a < ${i}
printf "\e%%@" > ${i}
done
echo 0 >| /sys/module/vt/parameters/default_utf8
stat_done
fi
if [[ -s /etc/vconsole.conf ]]; then
parse_envfile /etc/vconsole.conf "${vconsolevars[@]}"
[[ $FONT ]] && CONSOLEFONT=$FONT
[[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP
fi
[[ $KEYMAP ]] &&
status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP
# Set console font if required
set_consolefont
if [[ ! -a /usr/lib ]] ; then
printf "${C_FAIL}/usr is not mounted. This is not supported.${C_OTHER}\n"
fi
if ! grep -q devtmpfs /proc/filesystems; then
printf "${C_FAIL}Your kernel does not have devtmpfs support. This is not supported.${C_OTHER}\n"
fi
HWCLOCK_PARAMS="--systz"
case $HARDWARECLOCK in
"") ;;
UTC) HWCLOCK_PARAMS+=" --utc --noadjfile";;
localtime) HWCLOCK_PARAMS+=" --localtime --noadjfile";;
*) HWCLOCK_PARAMS="";;
esac
if [[ $HWCLOCK_PARAMS ]]; then
stat_busy "Adjusting system time and setting kernel timezone"
# Adjust the system time for timezone offset if rtc is not in UTC
# 1. Make creation time on device nodes sane (FS#8665)
# 2. Filesystem checks can depend on system time
# 3. This also sets the kernel time zone, used by e.g. vfat
# If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime
# is used. If HARDWARECLOCK is not set in rc.conf, the value in
# /var/lib/hwclock/adjfile is used (in this case /var can not be a separate
# partition).
[[ $TIMEZONE ]] && export TZ=$TIMEZONE
hwclock $HWCLOCK_PARAMS && stat_done || stat_fail
unset TZ
fi
# Start/trigger UDev, load MODULES and settle UDev
udevd_modprobe sysinit
# bring up the loopback interface
[[ -d /sys/class/net/lo ]] &&
status "Bringing up loopback interface" ip link set up dev lo
# FakeRAID devices detection
[[ $USEDMRAID = [Yy][Ee][Ss] && -x $(type -P dmraid) ]] &&
status "Activating FakeRAID arrays" dmraid -i -ay
# BTRFS devices detection
[[ $USEBTRFS = [Yy][Ee][Ss] && -x $(type -P btrfs) ]] &&
status "Activating BTRFS volumes" btrfs device scan
# Activate LVM2 groups if any
activate_vgs
# Set up non-root encrypted partition mappings
if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then
stat_busy "Unlocking encrypted volumes:"
crypto_unlocked=0
read_crypttab do_unlock && stat_done || stat_fail
# Maybe someone has LVM on an encrypted block device
(( crypto_unlocked )) && activate_vgs
fi
# Check filesystems
run_hook sysinit_prefsck
if [[ -x $(type -P fsck) ]]; then
stat_busy "Checking Filesystems"
fsck_all >|"${FSCK_OUT:-/dev/stdout}" 2>|"${FSCK_ERR:-/dev/stdout}"
declare -r fsckret=$?
(( fsckret <= 1 )) && stat_done || stat_fail
else
declare -r fsckret=0
fi
run_hook sysinit_postfsck
# Single-user login and/or automatic reboot if needed
fsck_reboot $fsckret
status "Remounting Root" \
mount -o remount /
# now mount all the local filesystems
run_hook sysinit_premount
status "Mounting Local Filesystems" \
mount_all
run_hook sysinit_postmount
# enable monitoring of lvm2 groups, now that the filesystems are mounted rw
[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] &&
status "Activating monitoring of LVM2 groups" \
vgchange --monitor y >/dev/null
status "Activating Swap" swapon -a
[[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
RANDOM_SEED=/var/lib/misc/random-seed
[[ -f $RANDOM_SEED ]] &&
status "Initializing Random Seed" \
cp $RANDOM_SEED /dev/urandom
# Remove leftover files
remove_leftover
if [[ -s /etc/hostname ]]; then
HOSTNAME=$(< /etc/hostname)
fi
if [[ $HOSTNAME ]]; then
stat_busy "Setting Hostname: $HOSTNAME"
echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail
fi
stat_busy "Saving dmesg Log"
if [[ -e /proc/sys/kernel/dmesg_restrict ]] &&
(( $(< /proc/sys/kernel/dmesg_restrict) == 1 )); then
install -Tm 0600 <( dmesg ) /var/log/dmesg.log
else
install -Tm 0644 <( dmesg ) /var/log/dmesg.log
fi
(( $? == 0 )) && stat_done || stat_fail
run_hook sysinit_end
# End of file
# vim: set ts=2 sw=2 noet:

View File

@ -1,21 +0,0 @@
#
# /usr/lib/tmpfiles.d/chakra.conf
#
D /tmp 1777 root root 10d
d /run/daemons 0755 root root -
d /tmp/.X11-unix 1777 root root 10d
d /tmp/.ICE-unix 1777 root root 10d
d /tmp/.XIM-unix 1777 root root 10d
d /tmp/.font-unix 1777 root root 10d
d /tmp/.Test-unix 1777 root root 10d
F /run/utmp 0664 root utmp -
r /tmp/.X[0-9]-lock
r /etc/nologin
r /etc/shutdownpid
r /forcefsck
r /fastboot

View File

@ -1,58 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
vconsole.conf(5)
================
NAME
----
vconsole.conf - configuration file for the virtual console
SYNOPSIS
--------
*/etc/vconsole.conf*
DESCRIPTION
-----------
The /etc/vconsole.conf file configures the virtual console, i.e. keyboard mapping and console font.
The basic file format of the vconsole.conf is a newline-separated list environment-like shell-compatible variable assignments. It is
possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported,
allowing applications to read the file without implementing a shell compatible execution engine.
In Arch /etc/rc.conf is checked for vconsole configuration as well as described below, however only as fallback.
OPTIONS
-------
The following options are understood:
*KEYMAP=*
//, KEYMAP_TOGGLE=
//The KEYMAP_TOGGLE= can be used to configured a second toggle keymap and is by default unset.
// KEYMAP= defaults to us if not set.
Configures the key mapping table of for they keyboard. Overriding KEYMAP from rc.conf.
*FONT=*, *FONT_MAP=*
//, FONT_UNIMAP=
// the unicode font map
// FONT= defaults to latarcyrheb-sun16.
Configures the console font and the console map. Overriding respectively CONSOLEFONT and CONSOLEMAP from rc.conf.
EXAMPLE
-------
*Example 1. German keyboard and console*
/etc/vconsole.conf:
KEYMAP=de-latin1
FONT=latarcyrheb-sun16
SEE ALSO
--------
systemd.vconsole.conf(5), loadkeys(1), setfont(8), rc.conf(5)
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen.

View File

@ -1,11 +0,0 @@
#
# Settings for wireless cards
#
# For each wireless interface declared in INTERFACES (in rc.conf), declare
# a wlan_${IF} variable that contains the arguments to be passed to
# iwconfig(8). Then list the original interface name in the
# WLAN_INTERFACES array.
#
#wlan_eth0="eth0 mode managed essid default"
#WLAN_INTERFACES=(eth0)

View File

@ -1,36 +0,0 @@
#compdef rc.d
_rc.d () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments "1: :->action" "*: :->service" {-s,--started} {-S,--stopped} {-a,--auto} {-A,--noauto}
case $state in
action)
_arguments "*:action:(list help start stop restart)"
;;
service)
local action="$words[2]"
curcontext="${curcontext%:*:*}:rc.d-${action}:"
case $action in
help)
_arguments "*: :"
;;
start)
_arguments "*: :($(comm -23 <(echo /etc/rc.d/*(N-*:t)|tr ' ' '\n') <(echo /run/daemons/*(N:t)|tr ' ' '\n')))"
;;
stop|restart|reload)
_arguments "*: :(/run/daemons/*(N:t))"
;;
*)
_arguments "*: :(/etc/rc.d/*(N-*:t))"
;;
esac
;;
esac
}
_rc.d "$@"
# vim: set ts=2 sw=2 ft=sh noet:

View File

@ -1,34 +0,0 @@
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=initscripts-testing
pkgver=2010.06
pkgrel=2
pkgdesc="System initialization/bootup scripts"
arch=('i686' 'x86_64')
url="http://www.chakra-project.org"
license=('GPL')
groups=('base')
backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown)
depends=('glibc' 'bash' 'awk' 'grep' 'coreutils' 'sed' 'udev>=157-1'
'net-tools' 'ncurses' 'kbd' 'findutils' 'sysvinit')
optdepends=('bridge-utils: Network bridging support'
'dhcpcd: DHCP network configuration'
'wireless_tools: Wireless networking')
replaces=('initscripts')
conflicts=('initscripts')
provides=("initscripts=${pkgver}")
install=initscripts.install
source=(http://chakra-project.org/sources/initscripts/initscripts-${pkgver}-${pkgrel}.tar.gz)
md5sums=('6e2208b8040bba656ec1675069e713d1')
build() {
cd ${srcdir}/initscripts-${pkgver}-${pkgrel}/
DESTDIR=${pkgdir} ./install.sh
}

View File

@ -1,18 +0,0 @@
post_install() {
echo "==> Fixing /etc/rc.conf"
cp /etc/rc.conf /etc/rc.conf.pacnew
cp /etc/rc.conf.pacsave /etc/rc.conf
}
post_upgrade() {
if [ "$(vercmp $2 2009.07)" -lt 0 ]; then
echo "==> Adjusting /etc/inittab for transition to /dev/tty standard."
echo "==> Original file saved as /etc/inittab.pacsave"
sed -i'.pacsave' 's#vc/\([0-9]\)#tty\1#' /etc/inittab
fi
echo "==> Fixing /etc/rc.conf"
cp /etc/rc.conf /etc/rc.conf.pacnew
cp /etc/rc.conf.pacsave /etc/rc.conf
}

View File

@ -1,8 +0,0 @@
tags
*.tar.xz*
hostname.5
locale.conf.5
vconsole.conf.5
rc.conf.5
rc.d.8
pkg/

View File

@ -1,67 +0,0 @@
VER := $(shell git describe)
DIRS := \
/etc/rc.d \
/etc/conf.d \
/etc/rc.d/functions.d \
/etc/logrotate.d \
/etc/profile.d \
/usr/sbin \
/etc/tmpfiles.d \
/usr/lib/tmpfiles.d \
/etc/binfmt.d \
/usr/lib/binfmt.d \
/etc/sysctl.d \
/usr/lib/sysctl.d \
/usr/lib/initscripts \
/usr/share/bash-completion/completions \
/usr/share/zsh/site-functions \
/usr/share/man/man5 \
/usr/share/man/man8
MAN_PAGES := \
rc.d.8 \
rc.conf.5 \
locale.conf.5 \
vconsole.conf.5 \
hostname.5
all: doc
installdirs:
install -dm755 $(foreach DIR, $(DIRS), $(DESTDIR)$(DIR))
install: installdirs doc
install -m644 -t $(DESTDIR)/etc inittab rc.conf
install -m755 -t $(DESTDIR)/etc rc.local rc.local.shutdown rc.multi rc.shutdown rc.single rc.sysinit
install -m644 -t $(DESTDIR)/etc/logrotate.d bootlog
install -m644 -t $(DESTDIR)/etc/rc.d functions
install -m755 -t $(DESTDIR)/etc/rc.d hwclock network netfs
install -m755 -t $(DESTDIR)/etc/profile.d locale.sh
install -m755 -t $(DESTDIR)/usr/sbin rc.d
install -m644 -t $(DESTDIR)/usr/share/man/man5 $(filter %.5, $(MAN_PAGES))
install -m644 -t $(DESTDIR)/usr/share/man/man8 $(filter %.8, $(MAN_PAGES))
install -m755 -t $(DESTDIR)/usr/lib/initscripts chakra-tmpfiles chakra-sysctl chakra-binfmt
install -m644 tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d/chakra.conf
install -m644 -T bash-completion $(DESTDIR)/usr/share/bash-completion/completions/rc.d
install -m644 -T zsh-completion $(DESTDIR)/usr/share/zsh/site-functions/_rc.d
%.5: %.5.txt
a2x -d manpage -f manpage $<
%.8: %.8.txt
a2x -d manpage -f manpage $<
doc: $(MAN_PAGES)
clean:
rm -f $(MAN_PAGES)
tar:
git archive HEAD --prefix=initscripts-$(VER)/ | xz > initscripts-$(VER).tar.xz
release: tar
scp initscripts-$(VER).tar.xz gerolde.archlinux.org:/srv/ftp/other/initscripts/
scp initscripts-$(VER).tar.xz pkgbuild.com:~/packages/initscripts/trunk/
.PHONY: all installdirs install doc clean tar release

View File

@ -1,66 +0,0 @@
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer: Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=initscripts
pkgver=2012.05
pkgrel=3
pkgdesc="System initialization/bootup scripts"
arch=('i686' 'x86_64')
url="http://www.chakra-project.org"
license=('GPL2')
groups=('base')
backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown etc/conf.d/wireless etc/profile.d/locale.sh)
depends=('glibc' 'bash' 'grep' 'coreutils' 'udev>=182' 'iproute2'
'ncurses' 'kbd' 'findutils' 'sysvinit')
optdepends=('net-tools: legacy networking support'
'bridge-utils: Network bridging support'
'dhcpcd: DHCP network configuration'
'wireless_tools: Wireless networking')
makedepends=('asciidoc')
install=initscripts.install
source=('Makefile' 'binfmt.d.5.txt' 'chakra-tmpfiles' 'hostname.5.txt' 'locale.conf.5.txt'
'network' 'rc.d.8.txt' 'rc.shutdown' 'wireless.conf.d' 'bootlog' 'chakra-tmpfiles'
'hwclock' 'locale.conf.5.txt' 'rc.conf' 'rc.local' 'rc.single' 'zsh-completion'
'chakra-binfmt' 'functions' 'initscripts.install' 'locale.sh' 'rc.conf.5.txt'
'rc.local.shutdown' 'rc.sysinit' 'bash-completion' 'chakra-sysctl' 'inittab' 'netfs'
'rc.d' 'rc.multi' 'tmpfiles.conf' 'vconsole.conf.5.txt')
md5sums=('022d743d6c324fa1325d8187e9354365'
'94bf95df61a06ec45107c4ce9bb59439'
'e5e9f79dac305c9a0ffa2077a817d354'
'bdb87ed9c8bd97fcc8ae0c643909c813'
'b772c5a6489881f796a6ec13a4e48cc3'
'e886ba94b6d5fd7987ecf9dfee7cbab3'
'52e1a2dd6339d88eda50d7c990a4513c'
'e4798daef2b565e3b6f2ec5e0d5ce3d2'
'dc5462ed765fa34c907f974d67fb776a'
'5d253f4da16e543efaff53ac9684c1c6'
'e5e9f79dac305c9a0ffa2077a817d354'
'75e147e59b91751b451dcc7bab225278'
'b772c5a6489881f796a6ec13a4e48cc3'
'727e677a2dca88a9dde4fc5846076b69'
'bd236a57bc00aa4727b98c5ae401c457'
'bbdeefad2a1732af6b04484b02527266'
'00ee10313b866a3fe6520a86f6318518'
'f9b3005a8eaae5eb69d2c3d5641534ed'
'a6affe9c73bd416a97d727a54b0b40dd'
'c366072d0b230eb9ee7ab31dd77cf245'
'b910fd6e0b5c421d083de72da03d9d1a'
'ac2d6d1cf7df7d65efc90b7766fceae1'
'669ce6d766dd9deb86686219f3763fe4'
'9b0244348a8acdf179026f46b3cd4d30'
'7d4981aa562187a5fc163ca2677a7cc1'
'1e799eb4a685c494613cb4249feeeb24'
'da9949f67b9100f8b03f4f2c81ff1108'
'5f61e38df0816d4a265f7c27958f2411'
'f528320f16c50d2cb5ad71079bf5f957'
'f3f55aa80da56b1435e8a876bbe18c72'
'2eb9f00e48115a7d19365872cddaa04d'
'7a1e90a17a9f6a89817fb9800fbc54a2')
package() {
cd ${srcdir}
make DESTDIR=${pkgdir} install
install -D -m644 ${srcdir}/wireless.conf.d ${pkgdir}/etc/conf.d/wireless
}

View File

@ -1,39 +0,0 @@
Releasing
1) create an anotated tag on the format YYYY.MM.X, where YYYY is the year,
MM is the month and X is a number starting from 1. E.g.:
$ git tag -a 2011.04.1
2) create a tarball and push it to gerolde and pkgbuild.com (needs 4.3.2 to be done...(
$ make release
3) check that the PKGBUILD in git is in sync with the PKGBUILD to be released
4) create package and push to testing:
4.1) [first time only] set up ssh forwarding so you can connect to gerolde from alderaan
4.1.1) Add "ForwardAgent=yes" to ~/.ssh/config
4.1.2) Add your private key to the authentication agent "ssh-add"
4.2) ssh pkgbuild.com
4.3) [first time only] check out initscripts from svn
4.3.1) svn checkout -N svn+ssh://gerolde.archlinux.org/srv/svn-packages
4.3.2) "cd svn-packages && svn update initscripts"
4.4) get the latest version of initscripts: "cd svn-packages && svn update"
4.5) update the version field in the PKGBUILD
4.6) build the package for both arches: "sudo testing-{i686,x86_64}-build"
4.7) run checkpkg, namcap, and install test at least one of the two packages
4.8) commit to svn and move package to your staging folder (which needs to exist on gerolde):
'testingpkg "commit message"'

View File

@ -1,24 +0,0 @@
# rc.d bash completion by Seblu <seblu@seblu.net>
_rc_d()
{
local action cur prev
actions='help list start stop reload restart'
options='-s --started -S --stopped -a --auto -A --noauto'
_get_comp_words_by_ref cur prev
_get_first_arg
if [[ -z "$arg" ]]; then
COMPREPLY=($(compgen -W "${actions} ${options}" -- "$cur"))
elif [[ "$arg" == help ]]; then
COMPREPLY=()
elif [[ "$arg" == start ]]; then
COMPREPLY=($(comm -23 <(cd /etc/rc.d && compgen -f -X 'functions*' "$cur"|sort) <(cd /run/daemons/ && compgen -f "$cur"|sort)))
elif [[ "$arg" =~ stop|restart|reload ]]; then
COMPREPLY=($(cd /run/daemons/ && compgen -f "$cur"|sort))
else
COMPREPLY=($(compgen -W "${options} $(cd /etc/rc.d && compgen -f -X 'functions*')" -- "$cur"))
fi
}
complete -F _rc_d rc.d
# vim: set ts=2 sw=2 ft=sh noet:

View File

@ -1,57 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
binfmt.d(5)
===========
NAME
----
binfmt.d - Configure additional binary formats at boot
SYNOPSIS
--------
/usr/lib/binfmt.d/*.conf
/etc/binfmt.d/*.conf
/run/binfmt.d/*.conf
DESCRIPTION
-----------
*initscripts* uses files from the above directories to configure additional
binary formats to register during boot in the kernel.
CONFIGURATION FORMAT
--------------------
Each file contains a list of binfmt_misc kernel binary format rules.
Consult *binfmt_misc.txt*[1] for more information on registration of
additional binary formats and how to write rules.
Empty lines and lines beginning with ; and # are ignored. Note that this
means you may not use ; and # as delimiter in binary format rules.
Each configuration file is named in the style of <program>.conf. Files in
/etc/ overwrite files with the same name in /usr/lib/. Files in /run
overwrite files with the same name in /etc/ and /usr/lib/. Packages
should install their configuration files in /usr/lib/, files in /etc/ are
reserved for the local administration, which possibly decides to
overwrite the configurations installed from packages. All files are
sorted by filename in alphabetical order, regardless in which of the
directories they reside, to ensure that a specific configuration file
takes precedence over another file with an alphabetically later name.
EXAMPLE
-------
*Example 1. /etc/binfmt.d/wine.conf example:*
# Start WINE on Windows executables
:DOSWin:M::MZ::/usr/bin/wine:
NOTES
-----
*1. binfmt_misc.txt:*
http://www.kernel.org/doc/Documentation/binfmt_misc.txt
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Sébastien Luttringer.

View File

@ -1,9 +0,0 @@
/var/log/boot {
compress
rotate 1
size=+1024k
notifempty
missingok
copytruncate
noolddir
}

View File

@ -1,45 +0,0 @@
#!/bin/bash
#
# /usr/lib/initscripts/chakra-binfmt
#
# Configure additional binary formats at boot
#
shopt -s nullglob
declare -a binfmt_d
# files given has argv supersede config files
if (( $# > 0 )); then
for arg; do [[ -r "$arg" ]] && binfmt_d+=("$arg"); done
else
binfmt_d=(
/usr/lib/binfmt.d/*.conf
/etc/binfmt.d/*.conf
/run/binfmt.d/*.conf
)
fi
# check there is file to load
(( ${#binfmt_d[@]} > 0 )) || exit 1
# mount binfmt_misc if api filesystem is missing
mountpoint -q /proc/sys/fs/binfmt_misc ||
mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc
# files declared later in the binfmt_d array will override earlier
# Example: `/etc/binfmt.d/foo.conf' supersedes `/usr/lib/binfmt.d/foo.conf'.
declare -A fragments
for path in "${binfmt_d[@]}"; do
[[ -f $path ]] && fragments[${path##*/}]=$path
done
for path in "${fragments[@]}"; do
while read -r line; do
[[ ${line:0:1} == '#' ]] && continue
printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register
done < "$path"
done
:
# vim: set ts=2 sw=2 noet:

View File

@ -1,29 +0,0 @@
#!/bin/bash
#
# /usr/lib/initscripts/chakra-sysctl
#
# Load sysctl configuration files following
# http://0pointer.de/public/systemd-man/sysctl.d.html
#
shopt -s nullglob
declare -a sysctl_d=(
/usr/lib/sysctl.d/*.conf
/etc/sysctl.d/*.conf
/run/sysctl.d/*.conf
/etc/sysctl.conf
)
declare -A fragments
# files declared later in the sysctl_d array will override earlier
# Example: `/etc/sysctl.d/foo.conf' supersedes `/usr/lib/sysctl.d/foo.conf'.
for path in "${@:-${sysctl_d[@]}}"; do
[[ -f $path ]] && fragments[${path##*/}]=$path
done
for path in "${fragments[@]}"; do
sysctl -q -p "$path"
done
# vim: set ts=2 sw=2 noet:

View File

@ -1,297 +0,0 @@
#!/bin/bash
#
# /usr/lib/initscripts/chakra-tmpfiles
#
# Control creation, deletion, and cleaning of volatile and temporary files
#
warninvalid() {
printf "chakra-tmpfiles: ignoring invalid entry on line %d of \`%s'\n" "$LINENUM" "$FILE"
(( ++error ))
} >&2
checkparams() {
local parmreq=$1; shift
local path=$1 mode=$2 uid=$3 gid=$4
# parmcount must be >= parmreq
if (( $# < parmreq )); then
return 1
fi
# mode must be valid octal and 3 or 4 digits
if [[ $mode && ! $mode =~ ^[0-7]{3,4}$ ]]; then
return 1
fi
# uid must be numeric or a valid user name
# don't try to resolve numeric IDs in case they don't exist
if [[ $uid ]]; then
if [[ $uid != +([0-9]) ]] && ! getent passwd "$uid" >/dev/null; then
return 1
fi
fi
# gid must be numeric or a valid group name
# don't try to resolve numeric IDs in case they don't exist
if [[ $gid ]]; then
if [[ $gid != +([0-9]) ]] && ! getent group "$gid" >/dev/null; then
return 1
fi
fi
return 0
}
relabel() {
local -a paths=($1)
local mode=$2 uid=$3 gid=$4
if ! checkparams 4 "$@"; then
warninvalid
return
fi
for path in "${paths[@]}"; do
if [[ -e $path ]]; then
[[ $uid != '-' ]] && chown $CHOPTS "$uid" "$path"
[[ $gid != '-' ]] && chgrp $CHOPTS "$gid" "$path"
[[ $mode != '-' ]] && chmod $CHOPTS "$mode" "$path"
fi
done
}
_f() {
# Create a file if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ ! -e $path ]]; then
install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path"
fi
}
_F() {
# Create or truncate a file
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path"
}
_d() {
# Create a directory if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ ! -d "$path" ]]; then
install -d -m"$mode" -o"$uid" -g"$gid" "$path"
fi
}
_D() {
# Create or empty a directory
local path=$1 mode=$2 uid=$3 gid=$4
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ -d $path ]] && (( REMOVE )); then
find "$path" -mindepth 1 -maxdepth 1 -xdev -exec rm -rf {} +
fi
if (( CREATE )); then
install -d -m"$mode" -o"$uid" -g"$gid" "$path"
fi
}
_p() {
# Create a named pipe (FIFO) if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
if ! checkparams 4 "$@"; then
warninvalid
return
fi
if [[ ! -p "$path" ]]; then
mkfifo -m$mode "$path"
chown "$uid:$gid" "$path"
fi
}
_x() {
# Ignore a path during cleaning. Use this type to exclude paths from clean-up as
# controlled with the Age parameter. Note that lines of this type do not
# influence the effect of r or R lines. Lines of this type accept shell-style
# globs in place of of normal path names.
:
# XXX: we don't implement this
}
_r() {
# Remove a file or directory if it exists. This may not be used to remove
# non-empty directories, use R for that. Lines of this type accept shell-style
# globs in place of normal path names.
local path
local -a paths=($1)
(( REMOVE )) || return 0
if ! checkparams 1 "$@"; then
warninvalid
return
fi
for path in "${paths[@]}"; do
if [[ -f $path ]]; then
rm -f "$path"
elif [[ -d $path ]]; then
rmdir "$path"
fi
done
}
_R() {
# Recursively remove a path and all its subdirectories (if it is a directory).
# Lines of this type accept shell-style globs in place of normal path names.
local path
local -a paths=($1)
(( REMOVE )) || return 0
if ! checkparams 1 "$@"; then
warninvalid
return
fi
for path in "${paths[@]}"; do
[[ -d $path ]] && rm -rf --one-file-system "$path"
done
}
_z() {
# Set ownership, access mode and relabel security context of a file or
# directory if it exists. Lines of this type accept shell-style globs in
# place of normal path names.
local -a paths=($1)
local mode=$2 uid=$3 gid=$4
(( CREATE )) || return 0
relabel "$@"
}
_Z() {
# Recursively set ownership, access mode and relabel security context of a
# path and all its subdirectories (if it is a directory). Lines of this type
# accept shell-style globs in place of normal path names.
(( CREATE )) || return 0
CHOPTS=-R relabel "$@"
}
shopt -s nullglob
declare -i CREATE=0 REMOVE=0 CLEAN=0 error=0 LINENO=0
declare FILE=
declare -A fragments
declare -a tmpfiles_d=(
/usr/lib/tmpfiles.d/*.conf
/etc/tmpfiles.d/*.conf
/run/tmpfiles.d/*.conf
)
while (( $# )); do
case $1 in
--create) CREATE=1 ;;
--remove) REMOVE=1 ;;
esac
shift
done
if (( !(CREATE + REMOVE) )); then
printf 'usage: %s [--create] [--remove]\n' "${0##*/}"
exit 1
fi
# directories declared later in the tmpfiles_d array will override earlier
# directories, on a per file basis.
# Example: `/etc/tmpfiles.d/foo.conf' supersedes `/usr/lib/tmpfiles.d/foo.conf'.
for path in "${@:-${tmpfiles_d[@]}}"; do
[[ -f $path ]] && fragments[${path##*/}]=${path%/*}
done
# catch errors in functions so we can exit with something meaningful
set -E
trap '(( ++error ))' ERR
# loop through the gathered fragments, sorted globally by filename.
# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf'
while read -d '' fragment; do
LINENUM=0
printf -v FILE '%s/%s' "${fragments[$fragment]}" "$fragment"
### FILE FORMAT ###
# XXX: We ignore the final 'Age' parameter
# 0 1 2 3 4 5
# Type Path Mode UID GID Age
# d /run/user 0755 root root 10d
# omit read's -r flag to honor escapes here, so that whitespace can be
# escaped for paths. We will _not_ honor quoted paths.
while read -a line; do
(( ++LINENUM ))
# skip over comments and empty lines
if (( ! ${#line[*]} )) || [[ ${line[0]:0:1} = '#' ]]; then
continue
fi
# whine about invalid entries
if ! type -t _${line[0]} >/dev/null; then
warninvalid
continue
fi
# fall back on defaults when parameters are passed as '-'
if [[ ${line[2]} = '-' ]]; then
case ${line[0]} in
p|f|F) line[2]=0644 ;;
d|D) line[2]=0755 ;;
esac
fi
[[ ${line[3]} = '-' ]] && line[3]='root'
[[ ${line[4]} = '-' ]] && line[4]='root'
"_${line[@]}"
done <"$FILE"
done < <(printf '%s\0' "${!fragments[@]}" | sort -z)
exit $error
# vim: set ts=2 sw=2 noet:

View File

@ -1,726 +0,0 @@
#!/bin/bash
# initscripts functions
#
# sanitize PATH (will be overridden later when /etc/profile is sourced, but is useful for UDev)
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
localevars=(LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE
LC_MEASUREMENT LC_IDENTIFICATION LC_ALL)
vconsolevars=(KEYMAP KEYMAP_TOGGLE FONT FONT_MAP FONT_UNIMAP)
if [[ $1 == "start" ]]; then
if [[ $STARTING ]]; then
echo "A daemon is starting another daemon, this is unlikely to work as intended."
else
export STARTING=1
fi
fi
# width:
calc_columns () {
STAT_COL=80
if [[ ! -t 1 ]]; then
USECOLOR=""
elif [[ -t 0 ]]; then
# stty will fail when stdin isn't a terminal
STAT_COL=$(stty size)
# stty gives "rows cols"; strip the rows number, we just want columns
STAT_COL=${STAT_COL##* }
elif tput cols &>/dev/null; then
# is /usr/share/terminfo already mounted, and TERM recognized?
STAT_COL=$(tput cols)
fi
if (( STAT_COL == 0 )); then
# if output was 0 (serial console), set default width to 80
STAT_COL=80
USECOLOR=""
fi
# we use 13 characters for our own stuff
STAT_COL=$(( STAT_COL - 13 ))
if [[ -t 1 ]]; then
SAVE_POSITION="\e[s"
RESTORE_POSITION="\e[u"
DEL_TEXT="\e[$(( STAT_COL + 4 ))G"
else
SAVE_POSITION=""
RESTORE_POSITION=""
DEL_TEXT=""
fi
}
calc_columns
# disable colors on broken terminals
TERM_COLORS=$(tput colors 2>/dev/null)
if (( $? != 3 )); then
case $TERM_COLORS in
*[!0-9]*) USECOLOR="";;
[0-7]) USECOLOR="";;
'') USECOLOR="";;
esac
fi
unset TERM_COLORS
# clear the TZ envvar, so daemons always respect /etc/localtime
unset TZ
# sanitize the locale settins
unset "${localevars[@]}"
parse_envfile() {
local file=$1 validkeys=("${@:2}") ret=0 lineno=0 key= val=
local -r quotes=$'[\'"]' comments=$'[;#]*'
if [[ -z $file ]]; then
printf "error: no environment file specified\n"
return 1
fi
if [[ ! -f $file ]]; then
printf "error: cannot parse \`%s': No such file or directory\n" "$file"
return 1
fi
if [[ ! -r $file ]]; then
printf "error: cannot read \`%s': Permission denied\n" "$file"
return 1
fi
while IFS='=' read -r key val; do
(( ++lineno ))
# trim whitespace, avoiding usage of a tempfile
key=$(echo "$key" | { read -r key; echo "$key"; })
# key must exist and line must not be a comment
[[ -z $key || ${key:0:1} = $comments ]] && continue
# trim whitespace, strip matching quotes
val=$(echo "$val" | { read -r val; echo "$val"; })
[[ ${val:0:1} = $quotes && ${val:(-1)} = "${val:0:1}" ]] && val=${val:1:(-1)}
if [[ -z $val ]]; then
printf "error: found key \`%s' without value on line %s of %s\n" \
"$key" "$lineno" "$file"
(( ++ret ))
continue
fi
# ignore invalid keys if we have a list of valid ones
if (( ${#validkeys[*]} )) && ! in_array "$key" "${validkeys[@]}"; then
continue
fi
export "$key=$val" || (( ++ret ))
done <"$file"
return $ret
}
# functions:
deltext() {
printf "${DEL_TEXT}"
}
printhl() {
printf "${C_OTHER}${PREFIX_HL} ${C_H1}${1}${C_CLEAR} \n"
}
printsep() {
printf "\n${C_SEPARATOR} ------------------------------\n"
}
stat_bkgd() {
printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} "
deltext
printf " ${C_OTHER}[${C_BKGD}BKGD${C_OTHER}]${C_CLEAR} \n"
}
stat_busy() {
printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} "
printf "${SAVE_POSITION}"
deltext
printf " ${C_OTHER}[${C_BUSY}BUSY${C_OTHER}]${C_CLEAR} "
}
stat_append() {
printf "${RESTORE_POSITION}"
printf -- "${C_MAIN}${1}${C_CLEAR}"
printf "${SAVE_POSITION}"
}
stat_done() {
deltext
printf " ${C_OTHER}[${C_DONE}DONE${C_OTHER}]${C_CLEAR} \n"
}
stat_fail() {
deltext
printf " ${C_OTHER}[${C_FAIL}FAIL${C_OTHER}]${C_CLEAR} \n"
}
stat_die() {
stat_fail
exit ${1:-1}
}
status() {
[[ $1 = '-v' ]] && { local v=1; shift; }
stat_busy "$1"
shift
if (( v )); then
"$@"
else
"$@" &>/dev/null
fi
local ret=$?
(( ret == 0 )) && stat_done || stat_fail
return $ret
}
# usage : in_array( $needle, $haystack )
# return : 0 - found
# 1 - not found
in_array() {
local needle=$1; shift
local item
for item; do
[[ $item = "${needle}" ]] && return 0
done
return 1 # Not Found
}
# daemons:
add_daemon() {
[[ -d /run/daemons ]] || mkdir -p /run/daemons
>| /run/daemons/"$1"
}
rm_daemon() {
rm -f /run/daemons/"$1"
}
ck_daemon() {
[[ ! -f /run/daemons/$1 ]]
}
# Check if $1 is a valid daemon name
have_daemon() {
[[ -f /etc/rc.d/$1 && -x /etc/rc.d/$1 ]]
}
# Check if $1 is started at boot
ck_autostart() {
local daemon
for daemon in "${DAEMONS[@]}"; do
[[ $1 = "${daemon#@}" ]] && return 1
done
return 0
}
start_daemon() {
have_daemon "$1" && /etc/rc.d/"$1" start
}
# Never use this function, it causes daemons to be stoped in the wrong order.
# The only way to start a daemon at boot is to add it to the DAEMONS array.
ck_depends() {
local daemon
for daemon; do
ck_daemon "$daemon" && start_daemon "$daemon"
done
}
start_daemon_bkgd() {
stat_bkgd "Starting $1"
(start_daemon "$1") >/dev/null &
}
stop_daemon() {
have_daemon "$1" && /etc/rc.d/"$1" stop
}
# Status functions
status_started() {
deltext
echo -ne "$C_OTHER[${C_STRT}STARTED$C_OTHER]$C_CLEAR "
}
status_stopped() {
deltext
echo -ne "$C_OTHER[${C_STRT}STOPPED$C_OTHER]$C_CLEAR "
}
ck_status() {
! ck_daemon "$1" && status_started || status_stopped
}
# Return PID of $1
get_pid() {
pidof -o %PPID $1 || return 1
}
# Check if PID-file $1 is still the active PID-file for command $2
ck_pidfile() {
if [[ -f $1 ]]; then
local fpid ppid
read -r fpid <"$1"
ppid=$(get_pid "$2")
[[ $fpid = "${ppid}" ]] && return 0
fi
return 1
}
# PIDs to be omitted by killall5
declare -a omit_pids
add_omit_pids() {
omit_pids+=( $@ )
}
# Stop all daemons
# This function should *never* ever perform any other actions beside calling stop_daemon()!
# It might be used by a splash system etc. to get a list of daemons to be stopped.
stop_all_daemons() {
# Find daemons NOT in the DAEMONS array. Shut these down first
local daemon
for daemon in /run/daemons/*; do
[[ -f $daemon ]] || continue
daemon=${daemon##*/}
ck_autostart "$daemon" && stop_daemon "$daemon"
done
# Shutdown daemons in reverse order
local i daemon
for (( i=${#DAEMONS[@]}-1; i>=0; i-- )); do
[[ ${DAEMONS[i]} = '!'* ]] && continue
daemon=${DAEMONS[i]#@}
ck_daemon "$daemon" || stop_daemon "$daemon"
done
}
# $1 - signal
# $2 - iterations
kill_all_wait() {
# Send SIGTERM/SIGKILL all processes and wait until killall5
# reports all done or timeout.
# Unfortunately killall5 does not support the 0 signal, so just
# use SIGCONT for checking (which should be ignored).
local i
killall5 -${1} ${omit_pids[@]/#/-o } &>/dev/null
for (( i=0; i<${2}; i++ )); do
sleep .25 # 1/4 second
# sending SIGCONT to processes to check if they are there
killall5 -18 ${omit_pids[@]/#/-o } &>/dev/null
if (( $? == 2 )); then
return 0
fi
done
return 1
}
kill_all() {
stat_busy "Sending SIGTERM To Processes"
kill_all_wait 15 40
if (( $? == 0 )); then
stat_done
else
stat_fail
status "Sending SIGKILL To Processes" kill_all_wait 9 60
fi
}
# Start/trigger UDev, load MODULES and settle UDev
udevd_modprobe() {
# $1 = where we are being called from.
# This is used to determine which hooks to run.
status "Starting UDev Daemon" /usr/lib/udev/udevd --daemon
run_hook "$1_udevlaunched"
stat_busy "Triggering UDev uevents"
udevadm trigger --action=add --type=subsystems
udevadm trigger --action=add --type=devices
stat_done
# Load modules from the MODULES array defined in rc.conf
(( ${#MODULES[*]} )) &&
status -v "Loading User-specified Modules" modprobe -ab "${MODULES[@]}"
status "Waiting for UDev uevents to be processed" \
udevadm settle
run_hook "$1_udevsettled"
# in case loading a module changed the display mode
calc_columns
}
activate_vgs() {
[[ $USELVM = [yY][eE][sS] && -x $(type -P lvm) && -d /sys/block ]] || return 0
stat_busy "Activating LVM2 groups"
vgchange --sysinit -a y >/dev/null
(( $? == 0 )) && stat_done || stat_fail
}
do_unlock() {
# $1 = requested name
# $2 = source device
# $3 = password
# $4 = options
stat_append "${1}.."
local open=create a=$1 b=$2 failed=0
# Ordering of options is different if you are using LUKS vs. not.
# Use ugly swizzling to deal with it.
# isLuks only gives an exit code but no output to stdout or stderr.
if cryptsetup isLuks "$2" 2>/dev/null; then
open=luksOpen
a=$2
b=$1
fi
case $3 in
SWAP)
local _overwriteokay=0
if [[ -b $2 && -r $2 ]]; then
# This is DANGEROUS! If there is any known file system,
# partition table, RAID or LVM volume on the device
# we don't overwrite it.
#
# 'blkid' returns 2 if no valid signature has been found.
# Only in this case we should allow overwriting the device.
#
# This sanity check _should_ be sufficient, but it might not.
# This may cause dataloss if it is not used carefully.
blkid -p "$2" &>/dev/null
(( $? == 2 )) && _overwriteokay=1
fi
if (( _overwriteokay == 0 )); then
false
elif cryptsetup -d /dev/urandom $4 $open "$a" "$b" >/dev/null; then
stat_append "creating swapspace.."
mkswap -f -L $1 /dev/mapper/$1 >/dev/null
fi;;
ASK)
printf "\nOpening '$1' volume:\n"
cryptsetup $4 $open "$a" "$b" < /dev/console;;
/dev*)
local ckdev=${3%%:*}
local cka=${3#*:}
local ckb=${cka#*:}
local cka=${cka%:*}
local ckfile=/dev/ckfile
local ckdir=/dev/ckdir
case ${cka} in
*[!0-9]*)
# Use a file on the device
# cka is not numeric: cka=filesystem, ckb=path
mkdir ${ckdir}
mount -r -t ${cka} ${ckdev} ${ckdir}
dd if=${ckdir}/${ckb} of=${ckfile} >/dev/null 2>&1
umount ${ckdir}
rmdir ${ckdir};;
*)
# Read raw data from the block device
# cka is numeric: cka=offset, ckb=length
dd if=${ckdev} of=${ckfile} bs=1 skip=${cka} count=${ckb} >/dev/null 2>&1;;
esac
cryptsetup -d ${ckfile} $4 $open "$a" "$b" >/dev/null
dd if=/dev/urandom of=${ckfile} bs=1 count=$(stat -c %s ${ckfile}) conv=notrunc >/dev/null 2>&1
rm ${ckfile};;
/*)
cryptsetup -d "$3" $4 $open "$a" "$b" >/dev/null;;
*)
printf "${C_FAIL}crypttab contains a literal encryption key. This will stop working in the future.${C_OTHER}\n"
echo "$3" | cryptsetup $4 $open "$a" "$b" >/dev/null;;
esac
if (( $? )); then
failed=1
stat_append "failed "
else
stat_append "ok "
fi
return $failed
}
read_crypttab() {
# $1 = function to call with the split out line from the crypttab
local line nspo failed=0
while read line; do
[[ $line && $line != '#'* ]] || continue
eval nspo=("${line%#*}")
if $1 "${nspo[0]}" "${nspo[1]}" "${nspo[2]}" "${nspo[*]:3}"; then
crypto_unlocked=1
else
failed=1
fi
done < /etc/crypttab
return $failed
}
set_timezone() {
local tz=$1 zonefile=/usr/share/zoneinfo/$1
[[ $tz ]] || return 1
if [[ ! -e $zonefile ]]; then
printf "error: \`%s' is not a valid timezone\n" "$tz"
return 1
fi
if [[ -L /etc/localtime && /etc/localtime -ef $zonefile ]]; then
return 0
else
ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime
fi
}
# Filesystem functions
# These can be overridden/reused for customizations like shutdown/loop-fsck.
NETFS="nfs,nfs4,smbfs,cifs,codafs,ncpfs,shfs,fuse,fuseblk,glusterfs,davfs,fuse.glusterfs"
# Check local filesystems
fsck_all() {
[[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-f"
if [[ ! -n $FORCEFSCK ]] && { [[ -f /fastboot ]] || in_array fastboot $(< /proc/cmdline); }; then
return 0
fi
if [[ -e /run/initramfs/root-fsck ]]; then
IGNORE_MOUNTED="-M"
fi
fsck -A -T -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${IGNORE_MOUNTED} -- ${FORCEFSCK}
}
# Single-user login and/or automatic reboot after fsck (if needed)
fsck_reboot() {
# $1 = exit code returned by fsck
# Ignore conditions 'FS errors corrected' and 'Cancelled by the user'
(( ($1 | 33) == 33 )) && return 0
if (( $1 & 2 )); then
echo
echo "********************** REBOOT REQUIRED *********************"
echo "* *"
echo "* The system will be rebooted automatically in 15 seconds. *"
echo "* *"
echo "************************************************************"
echo
sleep 15
else
echo
echo "***************** FILESYSTEM CHECK FAILED ****************"
echo "* *"
echo "* Please repair manually and reboot. Note that the root *"
echo "* file system is currently mounted read-only. To remount *"
echo "* it read-write type: mount -o remount,rw / *"
echo "* When you exit the maintenance shell the system will *"
echo "* reboot automatically. *"
echo "* *"
echo "************************************************************"
echo
sulogin -p
fi
echo "Automatic reboot in progress..."
umount -a
mount -o remount,ro /
reboot -f
exit 0
}
mount_all() {
mount -a -t "nosysfs,no${NETFS//,/,no}" -O no_netdev
}
umount_all() {
# $1: restrict to fstype
findmnt -mrunRo TARGET,FSTYPE,OPTIONS / | {
while read -r target fstype options; do
# match only targetted fstypes
if [[ $1 && $1 != "$fstype" ]]; then
continue
fi
# don't unmount API filesystems
if [[ $target = /@(proc|sys|run|dev|dev/pts) ]]; then
continue
fi
# avoid networked devices
IFS=, read -ra opts <<< "$options"
if in_array _netdev "${opts[@]}"; then
continue
fi
mounts=("$target" "${mounts[@]}")
done
if (( ${#mounts[*]} )); then
umount -r "${mounts[@]}"
fi
}
}
remove_leftover() {
stat_busy "Removing Leftover Files"
/usr/lib/initscripts/chakra-tmpfiles --create --remove && stat_done || stat_fail
# move from static /var/{run,lock} to /run
if [[ ! -L /var/lock ]]; then
rm -rf /var/lock
ln -s /run/lock /var/lock
fi
if [[ ! -L /var/run ]]; then
rm -rf /var/run
ln -s /run /var/run
fi
}
bootlogd_stop() {
[[ -f /run/bootlogd.pid ]] || return 0
touch /var/log/boot
kill $(< /run/bootlogd.pid)
rm -f /run/bootlogd.pid
sed -i -r -e 's/\^\[\[[0-9]?;?[0-9]?[0-9]?;?[0-9]?[0-9]?[ms]//g' \
-e 's/\^\[(\[1?[0-9][0-9]|%)G//g' -e 's/\^\[\[0;1//g' /var/log/boot
}
###############################
# Custom hooks in initscripts #
###############################
# Hooks can be used to include custom code in various places in the rc.* scripts
#
# Define a hook function in a functions.d file using:
# function_name() {
# ...
# }
# add_hook hook_name function_name
# It is allowed to register several hook functions for the same hook
# Is is also allowed to register the same hook function for several hooks
#
# Currently, the following hooks exist:
# sysinit_start: at the beginning of rc.sysinit
# multi_start: at the beginning of rc.multi
# single_start: at the beginning of rc.single
# shutdown_start: at the beginning of rc.shutdown
# sysinit_end: at the end of rc.sysinit
# multi_end: at the end of rc.multi
# single_end: at the end of rc.single
# sysinit_udevlaunched: after udev has been launched in rc.sysinit
# single_udevlaunched: after udev has been launched in rc.single
# sysinit_udevsettled: after uevents have settled in rc.sysinit
# single_udevsettled: after uevents have settled in rc.single
# sysinit_premount: before local filesystems are mounted, but after root is mounted read-write in rc.sysinit
# sysinit_postmount: after local filesystems are mounted
# shutdown_prekillall: before all processes are being killed in rc.shutdown
# single_prekillall: before all processes are being killed in rc.single
# shutdown_postkillall: after all processes have been killed in rc.shutdown
# single_postkillall: after all processes have been killed in rc.single
# shutdown_preumount: after last filesystem write, but before filesystems are unmounted
# shutdown_postumount: after filesystems are unmounted
# shutdown_poweroff: directly before powering off in rc.shutdown
#
# Declare add_hook and run_hook as read-only to prevent overwriting them.
# Too bad we cannot do the same thing with hook_funcs
if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then
declare -A hook_funcs
add_hook() {
[[ $1 && $2 ]] || return 1
hook_funcs[$1]+=" $2"
}
run_hook() {
[[ $1 ]] || return 1
local func
for func in ${hook_funcs["$1"]}; do
"${func}"
done
}
declare -fr add_hook run_hook
declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1
fi
# Function for setting console font if required
set_consolefont() {
[[ $CONSOLEFONT ]] || return 0
stat_busy "Loading Console Font: $CONSOLEFONT"
#CONSOLEMAP in UTF-8 shouldn't be used
[[ $CONSOLEMAP && ${LOCALE,,} =~ utf ]] && CONSOLEMAP=""
local i
for i in /dev/tty[0-9]*; do
setfont ${CONSOLEMAP:+-m "${CONSOLEMAP}"} \
"$CONSOLEFONT" -C ${i} &>/dev/null
done
if (( $? )); then
stat_fail
else
stat_done
fi
}
if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then
export LANG=${LOCALE:-C}
if [[ -r /etc/locale.conf ]]; then
parse_envfile /etc/locale.conf "${localevars[@]}"
fi
else
export LANG=C
fi
# set colors
if [[ $USECOLOR = [yY][eE][sS] ]]; then
if tput setaf 0 &>/dev/null; then
C_CLEAR=$(tput sgr0) # clear text
C_MAIN=${C_CLEAR}$(tput bold) # main text
C_OTHER=${C_MAIN}$(tput setaf 4) # prefix & brackets
C_SEPARATOR=${C_MAIN}$(tput setaf 0) # separator
C_BUSY=${C_CLEAR}$(tput setaf 6) # busy
C_FAIL=${C_MAIN}$(tput setaf 1) # failed
C_DONE=${C_MAIN} # completed
C_BKGD=${C_MAIN}$(tput setaf 5) # backgrounded
C_H1=${C_MAIN} # highlight text 1
C_H2=${C_MAIN}$(tput setaf 6) # highlight text 2
else
C_CLEAR="\e[m" # clear text
C_MAIN="\e[;1m" # main text
C_OTHER="\e[1;34m" # prefix & brackets
C_SEPARATOR="\e[1;30m" # separator
C_BUSY="\e[;36m" # busy
C_FAIL="\e[1;31m" # failed
C_DONE=${C_MAIN} # completed
C_BKGD="\e[1;35m" # backgrounded
C_H1=${C_MAIN} # highlight text 1
C_H2="\e[1;36m" # highlight text 2
fi
fi
# prefixes:
PREFIX_REG="::"
PREFIX_HL=" >"
# Source additional functions at the end to allow overrides
for f in /etc/rc.d/functions.d/*; do
[[ -e $f ]] && . "$f"
done
# End of file
# vim: set ts=2 sw=2 noet:

View File

@ -1,34 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
hostname(5)
===========
NAME
----
hostname - Local host name configuration file
SYNOPSIS
--------
*/etc/hostname*
DESCRIPTION
-----------
The /etc/hostname file configures the name of the local system that is set during boot. It
should contain a single newline-terminated host name string. The host name may be a free-form string up to 64 characters in length,
however it is recommended that it consists only of 7bit ASCII lower-case characters and no spaces or dots, and limits itself to the
format allowed for DNS domain name labels, even though this is not a strict requirement.
In Chakra-Project GNU/Linux the HOSTNAME variable in /etc/rc.conf is checked for the host name as well, however only as fallback.
HISTORY
-------
The simple configuration file format of /etc/hostname originates from Debian GNU/Linux.
SEE ALSO
--------
systemd.hostname(5), hostname(1), hostname(7), rc.conf(5)
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen.

View File

@ -1,26 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case $HARDWARECLOCK in
UTC) HWCLOCK_PARAMS="--utc";;
localtime) HWCLOCK_PARAMS="--localtime";;
*) HWCLOCK_PARAMS="";;
esac
case "$1" in
start)
add_daemon hwclock;;
stop)
hwclock --adjust $HWCLOCK_PARAMS
rm_daemon hwclock
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

View File

@ -1,19 +0,0 @@
post_upgrade() {
if [ "$(vercmp $2 2009.07)" -lt 0 ]; then
echo "==> Adjusting /etc/inittab for transition to /dev/tty standard."
echo "==> Original file saved as /etc/inittab.pacsave"
sed -i'.pacsave' 's#vc/\([0-9]\)#tty\1#' /etc/inittab
fi
if [ "$(vercmp $2 2011.06.1)" -lt 0 ]; then
echo "Blacklisting of modules is no longer supported in rc.conf,"
echo "please add blacklist entries to /etc/modprobe.d/ instead."
fi
if [ "$(vercmp $2 2011.07.2)" -lt 0 ]; then
echo "VERBOSE= in rc.conf no longer has any effect."
echo "Please append 'quiet' to your kernel command line."
fi
if [ "$(vercmp $2 2011.10.1)" -lt 0 ]; then
echo "If using non-bash-compatible shell, please set LANG in /etc/locale.conf,"
echo "as LOCALE in /etc/rc.conf no longer works."
fi
}

View File

@ -1,40 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
locale.conf(5)
==============
NAME
----
locale.conf - configuration file for locale settings
SYNOPSIS
--------
*/etc/locale.conf*
DESCRIPTION
-----------
The /etc/locale.conf file configures system-wide locale settings.
The basic file format of locale.conf is a newline-separated list of environment-like shell-compatible variable assignments. It is
possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported,
allowing applications to read the file without implementing a shell compatible execution engine.
The locale settings configured in /etc/locale.conf are system-wide and are inherited by every service or user, unless overridden or
unset by individual programs or individual users. To avoid services inheriting the locale settings on sysvinit systems, the
DAEMON_LOCALE variable in rc.conf can be set to "no".
In Chakra-Project /etc/rc.conf is checked for locale configuration as well, however only as fallback.
OPTIONS
-------
The following locale settings may be set using /etc/locale.conf: *LANG=*, *LANGUAGE=*, *LC_CTYPE=*, *LC_NUMERIC=*, *LC_TIME=*, *LC_COLLATE=*,
*LC_MONETARY=*, *LC_MESSAGES=*, *LC_PAPER=*, *LC_NAME=*, *LC_ADDRESS=*, *LC_TELEPHONE=*, *LC_MEASUREMENT=*, *LC_IDENTIFICATION=*. Note that *LC_ALL* may not be be configured in this file. For details about the meaning and semantics of these settings, refer to locale(7). The LANG variable overrides LOCALE from /etc/rc.conf.
SEE ALSO
--------
systemd.locale.conf(5), locale(7), rc.conf(5)
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen.

View File

@ -1,83 +0,0 @@
unset LANG
if [ -s /etc/locale.conf ]; then
. /etc/locale.conf
fi
if [ -z "$LANG" ] && [ -s /etc/rc.conf ]; then
LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
fi
export LANG=${LANG:-C}
if [ -n "$LC_CTYPE" ]; then
export LC_CTYPE
else
unset LC_CTYPE
fi
if [ -n "$LC_NUMERIC" ]; then
export LC_NUMERIC
else
unset LC_NUMERIC
fi
if [ -n "$LC_TIME" ]; then
export LC_TIME
else
unset LC_TIME
fi
if [ -n "$LC_COLLATE" ]; then
export LC_COLLATE
else
unset LC_COLLATE
fi
if [ -n "$LC_MONETARY" ]; then
export LC_MONETARY
else
unset LC_MONETARY
fi
if [ -n "$LC_MESSAGES" ]; then
export LC_MESSAGES
else
unset LC_MESSAGES
fi
if [ -n "$LC_PAPER" ]; then
export LC_PAPER
else
unset LC_PAPER
fi
if [ -n "$LC_NAME" ]; then
export LC_NAME
else
unset LC_NAME
fi
if [ -n "$LC_ADDRESS" ]; then
export LC_ADDRESS
else
unset LC_ADDRESS
fi
if [ -n "$LC_TELEPHONE" ]; then
export LC_TELEPHONE
else
unset LC_TELEPHONE
fi
if [ -n "$LC_MEASUREMENT" ]; then
export LC_MEASUREMENT
else
unset LC_MEASUREMENT
fi
if [ -n "$LC_IDENTIFICATION" ]; then
export LC_IDENTIFICATION
else
unset LC_IDENTIFICATION
fi

View File

@ -1,36 +0,0 @@
#!/bin/bash
# sourcing our current rc.conf requires this to be a bash script
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Mounting Network Filesystems"
mount -a -t "$NETFS"
rc=$?
mount -a -O _netdev
(( rc || $? )) && stat_die
add_daemon netfs
stat_done
;;
stop)
stat_busy "Unmounting Network Filesystems"
umount -a -f -O _netdev
rc=$?
umount -a -f -t "$NETFS"
(( rc || $? )) && stat_die
rm_daemon netfs
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
exit 1
esac
# vim: set ts=2 noet:

View File

@ -1,320 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
for s in wireless bonding bridges dhcpcd; do
[[ -f /etc/conf.d/$s ]] && . "/etc/conf.d/$s"
done
# helper function to determine if legacy network support is needed
need_legacy() {
# complain when `interface' is unset and `INTERFACES' has profiles enabled
if [[ -z $interface && ${INTERFACES[@]##!*} ]]; then
return 0 # need legacy
fi
return 1 # enough present for iproute2 support
}
deprecated() {
printf "${C_FAIL}Warning:${C_CLEAR} Your network settings are deprecated.\n"
printf " Please refer to 'man 5 rc.conf' on how to define a single wired\n"
printf " connection, or use a utility such as netcfg.\n"
}
have_interface() {
if [[ -z $1 ]]; then
printf "\n${C_FAIL}Error:${C_CLEAR} \`interface' is undefined in /etc/rc.conf\n"
return 1
fi
if [[ ! -d /sys/class/net/$1 ]]; then
printf "\n${C_FAIL}Error:${C_CLEAR} unknown interface in /etc/rc.conf: \`%s'\n" "$1"
return 1
fi
}
network_up() {
have_interface "$interface" || return 1
ip link set dev $interface up || return 1
if [[ $address ]]; then
ip addr add $address/${netmask:-24} broadcast ${broadcast:-+} dev $interface || return 1
[[ $gateway ]] && { ip route add default via $gateway || return 1; }
else
dhcpcd $DHCPCD_ARGS $interface || return 1
fi
}
network_down() {
have_interface "$interface" || return 1
if [[ -f /run/dhcpcd-$interface.pid ]]; then
dhcpcd -qk $interface || return 1
else
ip addr flush dev $interface || return 1
fi
ip link set dev $interface down || return 1
}
ifup() {
local ifcfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 ifup <interface_name>"
return 1
fi
# Get the name of the interface from the first token in the string
if [[ $ifcfg = dhcp ]]; then
ifname=$1
else
ifname=${ifcfg%% *}
fi
ifconfig $ifname up
wi_up $1 || return 1
if [[ $ifcfg = dhcp ]]; then
# remove the .pid file if it exists
rm -f /run/dhcpcd-${1}.pid >/dev/null 2>&1
rm -f /run/dhcpcd-${1}.cache >/dev/null 2>&1
dhcpcd $DHCPCD_ARGS ${1}
else
ifconfig $ifcfg
fi
}
wi_up() {
local iwcfg=wlan_$1
[[ ${!iwcfg} ]] || return 0
iwconfig ${!iwcfg}
[[ $WIRELESS_TIMEOUT ]] || WIRELESS_TIMEOUT=2
sleep $WIRELESS_TIMEOUT
bssid=$(iwgetid $1 -ra)
if [[ $bssid = 00:00:00:00:00:00 ]]; then
printhl "Could not associate $1 - try increasing WIRELESS_TIMEOUT and check network is WEP or has no security"
return 1
fi
return 0
}
ifdown() {
local ifcfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 ifdown <interface_name>"
return 1
fi
if [[ $ifcfg = dhcp && -f /run/dhcpcd-${1}.pid ]]; then
dhcpcd -k ${1} >/dev/null 2>&1
fi
# Always bring the interface itself down
ifconfig ${1} down >/dev/null 2>&1
}
iflist() {
for ifline in ${INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
printf " $ifline:\t"
else
printf "$ifline:\t"
fi
echo ${!ifline#!}
done
}
rtup() {
local routecfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 rtup <route_name>"
return 1
fi
if [[ $routecfg =~ :: ]]; then
route -A inet6 add $routecfg
else
route add $routecfg
fi
}
rtdown() {
local routecfg=${!1}
if [[ ! $1 ]]; then
echo "usage: $0 rtdown <route_name>"
return 1
fi
if [[ $routecfg =~ :: ]]; then
route -A inet6 del $routecfg
else
route del $routecfg
fi
}
rtlist() {
for rtline in ${ROUTES[@]}; do
if [[ $rtline = ${rtline#!} ]]; then
printf " $rtline:\t"
else
printf "$rtline:\t"
fi
echo ${!rtline#!}
done
}
bond_up() {
for ifline in ${BOND_INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
bondcfg="bond_$ifline"
if [[ ${!bondcfg} ]]; then
ifenslave $ifline ${!bondcfg} || error=1
fi
fi
done
}
bond_down() {
for ifline in ${BOND_INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
bondcfg="bond_$ifline"
ifenslave -d $ifline ${!bondcfg} || error=1
fi
done
}
bridge_up() {
for br in ${BRIDGE_INTERFACES[@]}; do
if [[ $br = ${br#!} ]]; then
# if the bridge already exists, remove it
if [[ $(ifconfig $br 2>/dev/null) ]]; then
ifconfig $br down
brctl delbr $br
fi
brctl addbr $br
brifs="bridge_$br"
for brif in ${!brifs}; do
if [[ $brif = ${brif#!} ]]; then
for ifline in ${BOND_INTERFACES[@]}; do
if [[ $brif = $ifline && $ifline = ${ifline#!} ]]; then
ifup $ifline
bondcfg="bond_$ifline"
ifenslave $ifline ${!bondcfg} || error=1
unset bond_$ifline
fi
done
brctl addif $br $brif || error=1
fi
done
fi
done
}
bridge_down() {
for br in ${BRIDGE_INTERFACES[@]}; do
if [[ $br = ${br#!} ]]; then
brctl delbr $br
fi
done
}
case "$1" in
start)
# deprecation check
need_legacy && deprecated
if ! ck_daemon network; then
echo "Network is already running. Try 'network restart'"
exit
fi
stat_busy "Starting Network"
error=0
if need_legacy; then
# bring up bridge interfaces
bridge_up
# bring up ethernet interfaces
for ifline in ${INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
ifup $ifline || error=1
fi
done
# bring up bond interfaces
bond_up
# bring up routes
for rtline in "${ROUTES[@]}"; do
if [ "$rtline" = "${rtline#!}" ]; then
rtup $rtline || error=1
fi
done
else
network_up
fi
if (( ! error )); then
add_daemon network
stat_done
else
stat_fail
fi
;;
stop)
# deprecation check
need_legacy && deprecated
if [[ $NETWORK_PERSIST =~ yes|YES && $RUNLEVEL == [06] ]]; then
status "Skipping Network Shutdown" true
exit 0
fi
stat_busy "Stopping Network"
rm_daemon network
error=0
if need_legacy; then
for rtline in "${ROUTES[@]}"; do
if [[ $rtline = ${rtline#!} ]]; then
rtdown $rtline || error=1
fi
done
# bring down bond interfaces
bond_down
for ifline in ${INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
ifdown $ifline || error=1
fi
done
# bring down bridge interfaces
bridge_down
else
network_down
fi
if (( ! error )); then
stat_done
else
stat_fail
fi
;;
restart)
$0 stop
sleep 2
$0 start
;;
ifup|ifdown|iflist|rtup|rtdown|rtlist)
# deprecation check
deprecated
$1 $2
;;
*)
echo "usage: $0 {start|stop|restart}"
echo " $0 {ifup|ifdown|iflist|rtup|rtdown|rtlist}";;
esac
# vim: set ts=2 sw=2 noet:

View File

@ -1,40 +0,0 @@
#
# /etc/rc.conf - Main Configuration for Chakra GNU/Linux
#
# See 'man 5 rc.conf' for more details
#
# LOCALIZATION
# ------------
HARDWARECLOCK=
TIMEZONE=
KEYMAP=
CONSOLEFONT=
CONSOLEMAP=
LOCALE=
DAEMON_LOCALE="yes"
USECOLOR="yes"
# HARDWARE
# --------
MODULES=()
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"
# NETWORKING
# ----------
HOSTNAME=
interface=
address=
netmask=
broadcast=
gateway=
NETWORK_PERSIST="no"
# DAEMONS
# -------
#
DAEMONS=(syslog-ng network crond)

View File

@ -1,223 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
rc.conf(5)
==========
NAME
----
rc.conf - Chakra GNU/Linux main configuration file
SYNOPSIS
--------
/etc/rc.conf
DESCRIPTION
-----------
The /etc/rc.conf file is the system configuration file for Arch-specific
settings. The format is bash. It contains several commonly-edited settings such
as timezone; keymap; kernel modules; daemons to load at start-up; etc. It is
split up in a few sections to categorize configuration settings: localization,
hardware, networking and daemons.
LOCALIZATION[[L]]
-----------------
*TIMEZONE=*
Specifies the timezone. The setting takes effect on boot by ensuring that /etc/localtime is a symlink
to the correct zoneinfo file. Possible timezones are the relative path to a zoneinfo file starting
from the directory /usr/share/zoneinfo. For example, a German timezone would be Europe/Berlin,
which refers to the file /usr/share/zoneinfo/Europe/Berlin.
Note: if empty, /etc/localtime is not changed. This is useful if /etc/localtime is maintained manually
or by a third-party tool; or if there is no reason to change it from what was set during install.
Default: empty
*HARDWARECLOCK=*
How to interpret/update the hardware clock. (used by hwclock)
Options:
- empty: fall back to the value in /var/lib/hwclock/adjtime, which defaults to UTC. This is recommended
as other users of hwclock might change the adjtime file and hence cause rc.conf and adjtime to be out of sync.
- "UTC": most robust, allows operating systems to abstract local time and ease DST.
- "localtime": apply timezone (and DST) in hardwareclock: discouraged.
Choose this if you dualboot with an OS which cannot handle UTC BIOS times correctly, like Windows (note
that recent Windows'es can use UTC, which is preferable).
- any other value will result in the hardware clock being left untouched (useful for virtualization)
Default: empty
*KEYMAP=*
Defines the keymap to load with the loadkeys program on boot. Possible keymaps are
found in /usr/share/kbd/keymaps. Please note that this setting is only valid for
your TTYs, not any graphical window managers or X. KEYMAP in /etc/vconsole.conf takes
precedence.
Default: empty
*CONSOLEFONT=*
Defines the console font to load with the setfont program on boot.
Possible fonts are found in /usr/share/kbd/consolefonts (only needed for non-US).
FONT in /etc/vconsole.conf takes precedence.
Default: empty
*CONSOLEMAP=*
Defines the console map to load with the setfont program on boot. Possible maps are found in
/usr/share/kbd/consoletrans. Set this to a map suitable for the appropriate locale (8859-1 for Latin1,
for example) if you're using an UTF-8 locale and use programs that generate 8-bit output. If you're
using X11 for everyday work, don't bother, as it only affects the output of Linux console applications.
FONT_MAP in /etc/vconsole.conf takes precedence.
Default: empty
*LOCALE=*
This sets your system language, which will be used by all i18n-friendly applications and utilities.
See `locale -a` (or locale.gen) for available options. LANG in /etc/locale.conf takes precedence.
If unset, it falls back to the C locale.
Default: empty
*DAEMON_LOCALE=*
- If set to 'yes', use $LOCALE as the locale during daemon startup and during the boot process.
- If set to 'no', the C locale is used.
Default: "yes"
*USECOLOR=*
Use ANSI color sequences in startup messages
Default: "yes"
HARDWARE[[H]]
-------------
*MODULES=*
Modules to load at boot-up. To blacklist modules, see "man modprobe.d".
Default: ().
*USEDMRAID=*
Scan for FakeRAID (dmraid) Volumes at startup.
Default: "no"
*USEBTRFS=*
Scan for BTRFS volumes at startup.
Default: "no"
*USELVM=*
Scan for LVM volume groups at startup, required if you use LVM.
Default: "no"
NETWORKING[[N]]
---------------
*HOSTNAME=*
Hostname of machine. Should also be put in /etc/hosts. The contents of
/etc/hostname (if not empty) takes precedence.
Default: empty
The following settings help you setting up a wired network.
*interface=*
Name of device. Use 'ip addr' or 'ls /sys/class/net/' to see all available interfaces.
Default: empty
Required for manual configuration as well as DHCP.
*address=*
IP address.
Default: empty
Required for manual configuration, empty for DHCP.
*netmask=*
Subnet mask.
Default: empty (which means 255.255.255.0)
Optional for manual configuration, ignored for DHCP.
*broadcast=*
Broadcast address.
Default: empty
Optional for manual configuration, ignored for DHCP.
*gateway=*
Default route.
Default: empty
Required for manual configuration, ignored for DHCP.
*Static IP example*
interface=eth0
address=192.168.0.2
netmask=255.255.255.0
broadcast=192.168.0.255
gateway=192.168.0.1
*DHCP example*
interface=eth0
address=
netmask=
gateway=
The following options might be needed for advanced use-cases.
*NETWORK_PERSIST=*
Setting this to "yes" will skip network shutdown. This is required if your root device is on NFS.
Default: "no"
*NETWORKS=*
This functionality is deprecated, please refer to the 'netcfg' documentation.
DAEMONS[[D]]
------------
*DAEMONS=*
Daemons to start at boot-up (in this order)
- prefix a daemon with a ! to disable it
- prefix a daemon with a @ to start it up in the background
If you are sure nothing else touches your hardware clock (such as ntpd or
a dual-boot), you might want to enable 'hwclock'. Note that this will only
make a difference if the hwclock program has been calibrated correctly.
If you use a network filesystem you should enable 'netfs'.
Default: (syslog-ng network crond)
AUTHORS
-------
Written by Dieter Plaetinck, Tom Gundersen and others.

View File

@ -1,135 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
# print usage and exit
usage() {
local name=${0##*/}
cat >&2 << EOF
usage: $name <action> [options] [daemons]
options:
-s, --started Filter started daemons
-S, --stopped Filter stopped daemons
-a, --auto Filter auto started daemons
-A, --noauto Filter manually started daemons
<daemons> is a space separated list of script in /etc/rc.d
<action> can be a start, stop, restart, reload, status, ...
WARNING: initscripts are free to implement or not the above actions.
e.g: $name list
$name list sshd gpm
$name list --started gpm
$name start sshd gpm
$name stop --noauto
$name help
EOF
exit ${1:-1}
}
# filter list of daemons
filter_daemons() {
local -a new_daemons=()
for daemon in "${daemons[@]}"; do
# check if daemons is valid
if ! have_daemon "$daemon"; then
printf "${C_FAIL}:: ${C_DONE}Daemon script ${C_FAIL}${daemon}${C_DONE} does \
not exist or is not executable.${C_CLEAR}\n" >&2
exit 2
fi
# check filter
(( ${filter[started]} )) && ck_daemon "$daemon" && continue
(( ${filter[stopped]} )) && ! ck_daemon "$daemon" && continue
(( ${filter[auto]} )) && ck_autostart "$daemon" && continue
(( ${filter[noauto]} )) && ! ck_autostart "$daemon" && continue
new_daemons+=("$daemon")
done
daemons=("${new_daemons[@]}")
}
(( $# < 1 )) && usage
# ret store the return code of rc.d
declare -i ret=0
# daemons store daemons on which action will be executed
declare -a daemons=()
# filter store current filter mode
declare -A filter=([started]=0 [stopped]=0 [auto]=0 [noauto]=0)
# parse options
argv=$(getopt -l 'started,stopped,auto,noauto' -- 'sSaA' "$@") || usage
eval set -- "$argv"
# create an initial daemon list
while [[ "$1" != -- ]]; do
case "$1" in
-s|--started) filter[started]=1 ;;
-S|--stopped) filter[stopped]=1 ;;
-a|--auto) filter[auto]=1 ;;
-A|--noauto) filter[noauto]=1 ;;
esac
shift
done
# remove --
shift
# get action
action=$1
shift
# get initial daemons list
for daemon; do
daemons+=("$daemon")
done
# going into script directory
cd /etc/rc.d
case $action in
help)
usage 0 2>&1
;;
list)
# list take all daemons by default
[[ -z $daemons ]] && for d in *; do have_daemon "$d" && daemons+=("$d"); done
filter_daemons
for daemon in "${daemons[@]}"; do
# print running / stopped satus
if ! ck_daemon "$daemon"; then
s_status="${C_OTHER}[${C_DONE}STARTED${C_OTHER}]"
else
s_status="${C_OTHER}[${C_FAIL}STOPPED${C_OTHER}]"
fi
# print auto / manual status
if ! ck_autostart "$daemon"; then
s_auto="${C_OTHER}[${C_DONE}AUTO${C_OTHER}]"
else
s_auto="${C_OTHER}[${C_FAIL} ${C_OTHER}]"
fi
printf "$s_status$s_auto${C_CLEAR} $daemon\n"
done
;;
*)
# other actions need an explicit daemons list
[[ -z $daemons ]] && usage
filter_daemons
# set same environment variables as init
runlevel=$(/sbin/runlevel)
ENV=('PATH=/bin:/usr/bin:/sbin:/usr/sbin'
"PREVLEVEL=${runlevel%% *}"
"RUNLEVEL=${runlevel##* }"
"CONSOLE=${CONSOLE:-/dev/console}"
"TERM=$TERM")
cd /
for daemon in "${daemons[@]}"; do
env -i "${ENV[@]}" "/etc/rc.d/$daemon" "$action"
(( ret += !! $? )) # clamp exit value to 0/1
done
;;
esac
exit $ret
# vim: set ts=2 sw=2 ft=sh noet:

View File

@ -1,103 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
rc.d(8)
=======
Name
----
rc.d - Initscripts power tool
Synopsis
--------
*rc.d <action> [options] [rc [rc] ...]*
Description
-----------
The *rc.d* program controls and lists rc scripts on the system. An action may be
invoked on one or more scripts using *rc.d action rc1 rc2...*. See <<A,Actions>>
below for more information.
Use *rc.d list* to get the list of all rc scripts on the system.
Actions[[A]]
------------
The actions supported by a rc scripts may be different from script to script, but
commonly supported actions include:
*start*::
Starts the script if it's not already running.
*stop*::
Stops a running script.
*restart*::
Restarts a running script.
More uncommon actions are:
*reload*::
Signals the script to reload its configuration.
*status*::
Shows the status of the script.
Options[[O]]
------------
*-s, --started*::
Filter to started scripts.
*-S, --stopped*::
Filter to stopped scripts.
*-a, --auto*::
Filter to auto started scripts.
*-A, --noauto*::
Filter to manually started scripts.
Examples[[E]]
-------------
*rc.d list*::
List all scripts.
*rc.d list sshd gpm*::
List only *sshd* and *gpm* scripts.
*rc.d list --started gpm*::
List *gpm* script only if started.
*rc.d list --started --auto*::
List all auto started scripts.
*rc.d start sshd gpm*::
Starts *sshd* and *gpm* scripts.
*rc.d start --auto --stopped*::
Starts all stopped scripts which are started at startup.
*rc.d stop crond*::
Stops the *crond* script.
*rc.d stop --noauto*::
Stop all script which are not runned at startup
*rc.d restart crond*::
Restarts the *crond* script.
*rc.d restart --stopped crond*::
Restarts the *crond* script only if stopped.
*rc.d help*::
Display help.
Directories[[D]]
----------------
'/etc/rc.d'::
Directory containing available daemons on the system.
'/usr/lib/initscripts'::
Directory containing available initscripts plugins.
Authors
-------
Written by Sebastien Luttringer and Dave Reisner.

View File

@ -1,6 +0,0 @@
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

View File

@ -1,5 +0,0 @@
#!/bin/bash
#
# /etc/rc.local.shutdown: Local shutdown script.
#

View File

@ -1,32 +0,0 @@
#!/bin/bash
#
# /etc/rc.multi
#
. /etc/rc.conf
. /etc/rc.d/functions
run_hook multi_start
# Load sysctl config files
[[ -x /usr/lib/initscripts/chakra-sysctl ]] && /usr/lib/initscripts/chakra-sysctl
# Load additional binary formats
[[ -x /usr/lib/initscripts/chakra-binfmt ]] && /usr/lib/initscripts/chakra-binfmt
# Start daemons
for daemon in "${DAEMONS[@]}"; do
case ${daemon:0:1} in
'!') continue;; # Skip this daemon.
'@') start_daemon_bkgd "${daemon#@}";;
*) start_daemon "$daemon";;
esac
done
[[ -x /etc/rc.local ]] && /etc/rc.local
run_hook multi_end
bootlogd_stop
# vim: set ts=2 sw=2 noet:

View File

@ -1,143 +0,0 @@
#!/bin/bash
#
# /etc/rc.shutdown
#
. /etc/rc.conf
. /etc/rc.d/functions
# avoid staircase effect
stty onlcr
echo " "
printhl "Initiating Shutdown..."
echo " "
run_hook shutdown_start
[[ -x /etc/rc.local.shutdown ]] && /etc/rc.local.shutdown
stop_all_daemons
stat_busy "Saving Random Seed"
RANDOM_SEED=/var/lib/misc/random-seed
install -TDm 0600 /dev/null $RANDOM_SEED
POOL_FILE=/proc/sys/kernel/random/poolsize
if [[ -r $POOL_FILE ]]; then
read POOL_SIZE < $POOL_FILE
(( POOL_SIZE /= 8 ))
else
POOL_SIZE=512
fi
dd if=/dev/urandom of=$RANDOM_SEED count=1 bs=$POOL_SIZE &>/dev/null
stat_done
[[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
# Write to wtmp file before unmounting
halt -w
# stop monitoring of lvm2 groups before unmounting filesystems
[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) ]] &&
status "Deactivating monitoring of LVM2 groups" vgchange --monitor n
# any future uevents can and should be ignored
status "Shutting down UDev" udevadm control --exit
run_hook shutdown_prekillall
kill_all
run_hook shutdown_postkillall
run_hook shutdown_preumount
# unmount any non-api partitions that are backed by swap, we don't want to
# move their contents into memory (waste of time and might caues OOM).
status "Unmounting Swap-backed Filesystems" umount_all "tmpfs"
# almost everything is dead now, so the swap should hopefully be relatively
# empty, and quick to switch off
status "Deactivating Swap" swapoff -a
status "Unmounting Non-API Filesystems" umount_all
run_hook shutdown_postumount
# Kill non-root encrypted partition mappings
if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then
stat_busy "Deactivating encrypted volumes:"
# Maybe someone has LVM on an encrypted block device
# executing an extra vgchange is errorless
[[ $USELVM = [Yy][Ee][Ss] ]] && vgchange --sysinit -a n &>/dev/null
do_lock() {
stat_append "${1}.."
if cryptsetup remove "$1" &>/dev/null; then
stat_append "ok "
else
stat_append "failed "
fi
}
read_crypttab do_lock
stat_done
fi
[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] &&
status "Deactivating LVM2 groups" vgchange --sysinit -a n &>/dev/null
run_hook shutdown_poweroff
if [[ -x /run/initramfs/shutdown ]]; then
# decide what we want to do
if [[ $RUNLEVEL = 0 ]]; then
action="poweroff"
else
action="reboot"
fi
# make /run/initrafs a mount
mount --bind /run/initramfs /run/initramfs
# in case someone has shared our mountpoints, unshare them
mount --make-private /run/initramfs
mount --make-private /
# bind all api mounts
mkdir -p /run/initramfs/{sys,proc,dev,run,oldroot}
mount --bind /sys /run/initramfs/sys
mount --bind /proc /run/initramfs/proc
mount --bind /dev /run/initramfs/dev
mount --bind /run /run/initramfs/run
# enter shutdownramfs
cd /run/initramfs
pivot_root . oldroot
#reexec init
/oldroot/sbin/init u
# run /shutdown in the new root
exec chroot . /shutdown $action </dev/console >/dev/console 2>&1
else
status "Remounting Root Filesystem Read-only" \
mount -o remount,ro /
# Power off or reboot
printsep
if [[ $RUNLEVEL = 0 ]]; then
printhl "${C_H2}POWER OFF"
poweroff -d -f -h -i
else
printhl "${C_H2}REBOOTING"
# if kexec is installed and a kernel is loaded, use it
[[ -x $(type -P kexec) ]] && kexec -e &>/dev/null
reboot -d -f -i
fi
fi
# End of file
# vim: set ts=2 sw=2 noet:

View File

@ -1,41 +0,0 @@
#!/bin/bash
#
# /etc/rc.single: Single-user startup script.
#
. /etc/rc.conf
. /etc/rc.d/functions
run_hook single_start
if [[ $PREVLEVEL != N ]]; then
stop_all_daemons
run_hook single_prekillall
kill_all
run_hook single_postkillall
# Start/trigger UDev, load MODULES and settle UDev
udevd_modprobe single
# Removing leftover files
remove_leftover
fi
run_hook single_end
bootlogd_stop
if [[ $RUNLEVEL = 1 ]]; then
printsep
printhl "Entering single-user mode..."
# make sure /dev/initctl is in place
kill -HUP 1
exec init -t1 S
fi
# End of file
# vim: set ts=2 sw=2 noet:

View File

@ -1,196 +0,0 @@
#!/bin/bash
#
# /etc/rc.sysinit
#
. /etc/rc.conf
. /etc/rc.d/functions
echo " "
printhl "${C_CLEAR}CH${C_MAIN}A${C_OTHER}K${C_CLEAR}RA Linux\n"
printhl "${C_H2}http://www.chakra-project.org"
printsep "${C_CLEAR}Copyright 2006-2012 Chakra Developers Team"
# mount the api filesystems
# /proc, /sys, /run, /dev, /run/lock, /dev/pts, /dev/shm
mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev
mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev
mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid
mkdir -p -m 1777 /run/lock
mkdir -p /dev/{pts,shm}
mountpoint -q /dev/pts || mount /dev/pts &>/dev/null ||
mount -n -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec
mountpoint -q /dev/shm || mount /dev/shm &>/dev/null ||
mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
if [[ ! -e /run/initramfs/fsck-root ]]; then
# remount root ro to allow for fsck later on, we remount now to
# make sure nothing can open files rw on root which would block a remount
findmnt / --options ro &>/dev/null ||
status "Mounting Root Read-Only" mount -o remount,ro /
fi
run_hook sysinit_start
# log all console messages
bootlogd -p /run/bootlogd.pid
if [[ -s /etc/locale.conf ]]; then
parse_envfile /etc/locale.conf "LANG"
[[ $LANG ]] && LOCALE=$LANG
fi
if [[ ${LOCALE,,} =~ utf ]]; then
stat_busy "Setting Consoles to UTF-8 mode"
# UTF-8 consoles are default since 2.6.24 kernel
# this code is needed not only for older kernels,
# but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8.
for i in /dev/tty[0-9]*; do
kbd_mode -u < ${i}
printf "\e%%G" > ${i}
done
echo 1 >| /sys/module/vt/parameters/default_utf8
stat_done
else
stat_busy "Setting Consoles to legacy mode"
# make non-UTF-8 consoles work on 2.6.24 and newer kernels
for i in /dev/tty[0-9]*; do
kbd_mode -a < ${i}
printf "\e%%@" > ${i}
done
echo 0 >| /sys/module/vt/parameters/default_utf8
stat_done
fi
if [[ -s /etc/vconsole.conf ]]; then
parse_envfile /etc/vconsole.conf "${vconsolevars[@]}"
[[ $FONT ]] && CONSOLEFONT=$FONT
[[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP
fi
[[ $KEYMAP ]] &&
status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP
# Set console font if required
set_consolefont
if [[ ! -a /usr/lib ]] ; then
printf "${C_FAIL}/usr is not mounted. This is not supported.${C_OTHER}\n"
fi
if ! grep -q devtmpfs /proc/filesystems; then
printf "${C_FAIL}Your kernel does not have devtmpfs support. This is not supported.${C_OTHER}\n"
fi
HWCLOCK_PARAMS="--systz"
case $HARDWARECLOCK in
"") ;;
UTC) HWCLOCK_PARAMS+=" --utc --noadjfile";;
localtime) HWCLOCK_PARAMS+=" --localtime --noadjfile";;
*) HWCLOCK_PARAMS="";;
esac
if [[ $HWCLOCK_PARAMS ]]; then
stat_busy "Adjusting system time and setting kernel timezone"
# Adjust the system time for timezone offset if rtc is not in UTC
# 1. Make creation time on device nodes sane (FS#8665)
# 2. Filesystem checks can depend on system time
# 3. This also sets the kernel time zone, used by e.g. vfat
# If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime
# is used. If HARDWARECLOCK is not set in rc.conf, the value in
# /var/lib/hwclock/adjfile is used (in this case /var can not be a separate
# partition).
[[ $TIMEZONE ]] && export TZ=$TIMEZONE
hwclock $HWCLOCK_PARAMS && stat_done || stat_fail
unset TZ
fi
# Start/trigger UDev, load MODULES and settle UDev
udevd_modprobe sysinit
# bring up the loopback interface
[[ -d /sys/class/net/lo ]] &&
status "Bringing up loopback interface" ip link set up dev lo
# FakeRAID devices detection
[[ $USEDMRAID = [Yy][Ee][Ss] && -x $(type -P dmraid) ]] &&
status "Activating FakeRAID arrays" dmraid -i -ay
# BTRFS devices detection
[[ $USEBTRFS = [Yy][Ee][Ss] && -x $(type -P btrfs) ]] &&
status "Activating BTRFS volumes" btrfs device scan
# Activate LVM2 groups if any
activate_vgs
# Set up non-root encrypted partition mappings
if [[ -f /etc/crypttab ]] && type -p cryptsetup >/dev/null; then
stat_busy "Unlocking encrypted volumes:"
crypto_unlocked=0
read_crypttab do_unlock && stat_done || stat_fail
# Maybe someone has LVM on an encrypted block device
(( crypto_unlocked )) && activate_vgs
fi
# Check filesystems
run_hook sysinit_prefsck
if [[ -x $(type -P fsck) ]]; then
stat_busy "Checking Filesystems"
fsck_all >|"${FSCK_OUT:-/dev/stdout}" 2>|"${FSCK_ERR:-/dev/stdout}"
declare -r fsckret=$?
(( fsckret <= 1 )) && stat_done || stat_fail
else
declare -r fsckret=0
fi
run_hook sysinit_postfsck
# Single-user login and/or automatic reboot if needed
fsck_reboot $fsckret
status "Remounting Root" \
mount -o remount /
# now mount all the local filesystems
run_hook sysinit_premount
status "Mounting Local Filesystems" \
mount_all
run_hook sysinit_postmount
# enable monitoring of lvm2 groups, now that the filesystems are mounted rw
[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] &&
status "Activating monitoring of LVM2 groups" \
vgchange --monitor y >/dev/null
status "Activating Swap" swapon -a
[[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
RANDOM_SEED=/var/lib/misc/random-seed
[[ -f $RANDOM_SEED ]] &&
status "Initializing Random Seed" \
cp $RANDOM_SEED /dev/urandom
# Remove leftover files
remove_leftover
if [[ -s /etc/hostname ]]; then
HOSTNAME=$(< /etc/hostname)
fi
if [[ $HOSTNAME ]]; then
stat_busy "Setting Hostname: $HOSTNAME"
echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail
fi
stat_busy "Saving dmesg Log"
if [[ -e /proc/sys/kernel/dmesg_restrict ]] &&
(( $(< /proc/sys/kernel/dmesg_restrict) == 1 )); then
install -Tm 0600 <( dmesg ) /var/log/dmesg.log
else
install -Tm 0644 <( dmesg ) /var/log/dmesg.log
fi
(( $? == 0 )) && stat_done || stat_fail
run_hook sysinit_end
# End of file
# vim: set ts=2 sw=2 noet:

View File

@ -1,21 +0,0 @@
#
# /usr/lib/tmpfiles.d/chakra.conf
#
D /tmp 1777 root root 10d
d /run/daemons 0755 root root -
d /tmp/.X11-unix 1777 root root 10d
d /tmp/.ICE-unix 1777 root root 10d
d /tmp/.XIM-unix 1777 root root 10d
d /tmp/.font-unix 1777 root root 10d
d /tmp/.Test-unix 1777 root root 10d
F /run/utmp 0664 root utmp -
r /tmp/.X[0-9]-lock
r /etc/nologin
r /etc/shutdownpid
r /forcefsck
r /fastboot

View File

@ -1,58 +0,0 @@
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
vconsole.conf(5)
================
NAME
----
vconsole.conf - configuration file for the virtual console
SYNOPSIS
--------
*/etc/vconsole.conf*
DESCRIPTION
-----------
The /etc/vconsole.conf file configures the virtual console, i.e. keyboard mapping and console font.
The basic file format of the vconsole.conf is a newline-separated list environment-like shell-compatible variable assignments. It is
possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported,
allowing applications to read the file without implementing a shell compatible execution engine.
In Arch /etc/rc.conf is checked for vconsole configuration as well as described below, however only as fallback.
OPTIONS
-------
The following options are understood:
*KEYMAP=*
//, KEYMAP_TOGGLE=
//The KEYMAP_TOGGLE= can be used to configured a second toggle keymap and is by default unset.
// KEYMAP= defaults to us if not set.
Configures the key mapping table of for they keyboard. Overriding KEYMAP from rc.conf.
*FONT=*, *FONT_MAP=*
//, FONT_UNIMAP=
// the unicode font map
// FONT= defaults to latarcyrheb-sun16.
Configures the console font and the console map. Overriding respectively CONSOLEFONT and CONSOLEMAP from rc.conf.
EXAMPLE
-------
*Example 1. German keyboard and console*
/etc/vconsole.conf:
KEYMAP=de-latin1
FONT=latarcyrheb-sun16
SEE ALSO
--------
systemd.vconsole.conf(5), loadkeys(1), setfont(8), rc.conf(5)
AUTHORS
-------
Original by Lennart Poettering, adapted to Arch Linux by Tom Gundersen.

View File

@ -1,11 +0,0 @@
#
# Settings for wireless cards
#
# For each wireless interface declared in INTERFACES (in rc.conf), declare
# a wlan_${IF} variable that contains the arguments to be passed to
# iwconfig(8). Then list the original interface name in the
# WLAN_INTERFACES array.
#
#wlan_eth0="eth0 mode managed essid default"
#WLAN_INTERFACES=(eth0)

View File

@ -1,36 +0,0 @@
#compdef rc.d
_rc.d () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments "1: :->action" "*: :->service" {-s,--started} {-S,--stopped} {-a,--auto} {-A,--noauto}
case $state in
action)
_arguments "*:action:(list help start stop restart)"
;;
service)
local action="$words[2]"
curcontext="${curcontext%:*:*}:rc.d-${action}:"
case $action in
help)
_arguments "*: :"
;;
start)
_arguments "*: :($(comm -23 <(echo /etc/rc.d/*(N-*:t)|tr ' ' '\n') <(echo /run/daemons/*(N:t)|tr ' ' '\n')))"
;;
stop|restart|reload)
_arguments "*: :(/run/daemons/*(N:t))"
;;
*)
_arguments "*: :(/etc/rc.d/*(N-*:t))"
;;
esac
;;
esac
}
_rc.d "$@"
# vim: set ts=2 sw=2 ft=sh noet:

View File

@ -33,10 +33,10 @@ index 36ca629..12c1112 100644
* configuration should not be read. This array must be null
* terminated.
*
diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c
diff --git a/tools/depmod.c b/tools/depmod.c
index 1871e18..7bb1c5d 100644
--- a/tools/kmod-depmod.c
+++ b/tools/kmod-depmod.c
--- a/tools/depmod.c
+++ b/tools/epmod.c
@@ -58,6 +58,7 @@ static const char *default_cfg_paths[] = {
"/run/depmod.d",
SYSCONFDIR "/depmod.d",

View File

@ -13,9 +13,9 @@ all we have to do is revert this patch.
Signed-off-by: Tom Gundersen <teg@jklm.no>
---
libkmod/libkmod.c | 2 +-
tools/kmod-depmod.c | 2 +-
tools/kmod-modinfo.c | 4 ++--
tools/kmod-modprobe.c | 4 ++--
tools/depmod.c | 2 +-
tools/modinfo.c | 4 ++--
tools/modprobe.c | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
@ -31,10 +31,10 @@ index 12c1112..11edfa0 100644
static char *get_kernel_release(const char *dirname)
{
diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c
diff --git a/tools/depmod.c b/tools/depmod.c
index 7bb1c5d..454d538 100644
--- a/tools/kmod-depmod.c
+++ b/tools/kmod-depmod.c
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2634,7 +2634,7 @@ static int do_depmod(int argc, char *argv[])
}
@ -44,10 +44,10 @@ index 7bb1c5d..454d538 100644
root == NULL ? "" : root, cfg.kversion);
if (optind == argc)
diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c
diff --git a/tools/modinfo.c b/tools/modinfo.c
index aa5223f..b13cd4b 100644
--- a/tools/kmod-modinfo.c
+++ b/tools/kmod-modinfo.c
--- a/tools/modinfo.c
+++ b/tools/modinfo.c
@@ -339,7 +339,7 @@ static void help(const char *progname)
"\t-0, --null Use \\0 instead of \\n\n"
"\t-F, --field=FIELD Print only provided FIELD\n"
@ -66,10 +66,10 @@ index aa5223f..b13cd4b 100644
root, kversion);
dirname = dirname_buf;
}
diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
diff --git a/tools/modprobe.c b/tools/modprobe.c
index 4760682..ccb41d8 100644
--- a/tools/kmod-modprobe.c
+++ b/tools/kmod-modprobe.c
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -128,7 +128,7 @@ static void help(const char *progname)
"\t-n, --show Same as --dry-run\n"

View File

@ -4,8 +4,8 @@
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=kmod
pkgver=8
pkgrel=1
pkgver=9
pkgrel=2
pkgdesc="Linux kernel module handling"
arch=('i686' 'x86_64')
url='http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary'
@ -21,22 +21,22 @@ source=("ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.t
"0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch"
"0001-libkmod-file-gracefully-handle-errors-from-zlib.patch"
"0002-depmod-report-failures-in-loading-symbols.patch")
md5sums=('d4e3d038b5370b1e8ff237c55666aa64'
md5sums=('c8ae2d2694fbca2b28e238b30543a0cd'
'285fc738c220ff84419995fc8c6d6ca1'
'1a1feb93633384655e668eb3a22729ac'
'bcd3a0b2d1922f4960e7f7778ae2577f'
'925cf8994139370113319e5ad7eeadc8'
'5fc146b486f4c164ad8316b90b6c9aec'
'ce4b6a0679a0c933251b20b848d6a524'
'1f443aba41dee586d46c3abb35912c6a')
build() {
cd "$pkgname-$pkgver"
patch -Np1 <"$srcdir"/0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch
patch -Np1 <"$srcdir"/0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch
patch -p1 <"$srcdir"/0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch
patch -p1 <"$srcdir"/0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch
# fix crash on corrupted zlib compression
patch -Np1 <"$srcdir"/0001-libkmod-file-gracefully-handle-errors-from-zlib.patch
patch -Np1 <"$srcdir"/0002-depmod-report-failures-in-loading-symbols.patch
#patch -Np1 <"$srcdir"/0001-libkmod-file-gracefully-handle-errors-from-zlib.patch
#patch -Np1 <"$srcdir"/0002-depmod-report-failures-in-loading-symbols.patch
./configure \
--sysconfdir=/etc \

9
kmod/kmod.install Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
post_upgrade() {
if [ "$(vercmp 9-2 "$2")" -eq 1 ]; then
echo "==> Kernel modules are now only read from /usr/lib/modules, all custom"
echo " built kernels and modules must be moved there before rebooting."
fi
}

View File

@ -4,26 +4,31 @@
# maintainer: abveritas@chakra-project.org
pkgname=libusbx
pkgver=1.0.11
pkgver=1.0.12
pkgrel=1
depends=('glibc')
pkgdesc="Library that provides generic access to USB device"
arch=('i686' 'x86_64')
arch=(i686 x86_64)
url="http://libusbx.org"
license=('LGPL')
source=(http://sourceforge.net/projects/${pkgname}/files/releases/${pkgver}/source/${pkgname}-${pkgver}.tar.bz2)
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2)
options=(!libtool)
replaces=('libusb1' 'libusb')
provides=("libusb=$pkgver")
conflicts=("libusb")
md5sums=('9aaab6aee72f65900cc731ecbffb4cf4')
md5sums=('c41352ac755c7992edfcbb2ea4ad1349')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure --prefix=/usr
./configure --prefix=/usr --disable-static
make
}
check() {
cd "${srcdir}/${pkgname}-${pkgver}"
make check
}
package () {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install

View File

@ -1,45 +1,48 @@
#
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer abveritas@chakra-project.org
# maintainer: abveritas@chakra-project.org
pkgbase=lvm2
pkgname=('lvm2' 'device-mapper')
pkgver=2.02.95
pkgrel=2
pkgver=2.02.97
pkgrel=1
arch=('i686' 'x86_64')
url="http://sourceware.org/lvm2/"
license=('GPL2' 'LGPL2.1')
groups=('base')
source=(ftp://sources.redhat.com/pub/lvm2/LVM2.${pkgver}.tgz
source=(ftp://sources.redhat.com/pub/lvm2/LVM2.${pkgver}.tgz{,.asc}
lvm2_install
lvm2_hook
11-dm-initramfs.rules
lvm.service
lvm2.conf
11-dm-initramfs.rules)
md5sums=('bd470a802046c807603618a443732ea7'
'd2a2376dd247ae15044dbc5f28479b23'
'14b42c38324160d79b63743b62cb45c4'
'a9019147f885ab81ce0f582a2d3f2b90'
'89adcaa1c019d6f494f5714ebf733265'
'69e40679cd8b3658bfc619e48baae125')
lvm-on-crypt.service
lvm2.conf)
sha1sums=('ca92d976628246745f0981d1514a79a4a8e32314'
'9f0c6047fe3c275db7af20f383bd41744fcafc33'
'3e1680f9b76ce9150d08865d99db90fd15532271'
'cedc9948123c870f9c5aa3357d0075b41a9c8135'
'f6a554eea9557c3c236df2943bb6e7e723945c41'
'17df8689630a77e46899a8bd56997d9db896d5af'
'7336aa1d53db9c843916b2cbb433434e4e354a24'
'ccefad65fde3d50331a42b0e90a1539dc7c8b9e4')
build() {
cd "${srcdir}/LVM2.${pkgver}"
unset LDFLAGS
./configure --prefix=/ --sysconfdir=/etc --localstatedir=/var --datarootdir=/usr/share \
./configure --prefix=/ --sbindir=/sbin --sysconfdir=/etc --localstatedir=/var --datarootdir=/usr/share \
--includedir=/usr/include --with-usrlibdir=/usr/lib --libdir=/usr/lib --with-udev-prefix=/usr \
--enable-pkgconfig --enable-readline --enable-dmeventd --enable-cmdlib --enable-applib \
--enable-udev_sync --enable-udev_rules
--with-systemdsystemunitdir=/usr/lib/systemd/system --enable-pkgconfig --enable-readline \
--enable-dmeventd --enable-cmdlib --enable-applib --enable-udev_sync --enable-udev_rules \
--with-default-locking-dir=/run/lock/lvm
make
}
package_device-mapper() {
pkgdesc="Device mapper userspace library and tools"
url="http://sourceware.org/dm/"
depends=('glibc' 'udev')
depends=('glibc' 'systemd')
cd "${srcdir}/LVM2.${pkgver}"
make DESTDIR="${pkgdir}" install_device-mapper
@ -49,7 +52,7 @@ package_device-mapper() {
package_lvm2() {
pkgdesc="Logical Volume Manager 2 utilities"
depends=('bash' "device-mapper>=${pkgver}" 'udev' 'readline')
depends=('bash' "device-mapper>=${pkgver}" 'systemd' 'readline')
conflicts=('lvm' 'mkinitcpio<0.7')
backup=('etc/lvm/lvm.conf')
options=('!makeflags')
@ -63,8 +66,8 @@ package_lvm2() {
# mkinitcpio hook
install -D -m644 "${srcdir}/lvm2_hook" "${pkgdir}/usr/lib/initcpio/hooks/lvm2"
install -D -m644 "${srcdir}/lvm2_install" "${pkgdir}/usr/lib/initcpio/install/lvm2"
# install systemd unit
install -Dm 644 "$srcdir/lvm.service" "$pkgdir/usr/lib/systemd/system/lvm.service"
install -Dm 644 "$srcdir/lvm2.conf" "$pkgdir/usr/lib/tmpfiles.d/lvm2.conf"
# systemd support
install -D -m644 "${srcdir}/lvm.service" "${pkgdir}/usr/lib/systemd/system/lvm.service"
install -D -m644 "${srcdir}/lvm-on-crypt.service" "${pkgdir}/usr/lib/systemd/system/lvm-on-crypt.service"
install -D -m644 "${srcdir}/lvm2.conf" "${pkgdir}/usr/lib/tmpfiles.d/lvm2.conf"
}

16
lvm2/lvm-on-crypt.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=LVM activation of encrypted devices
DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service cryptsetup.target
Before=shutdown.target
Conflicts=shutdown.target
[Service]
ExecStart=/sbin/vgchange --sysinit --available y
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
[Install]
WantedBy=basic.target

View File

@ -1,8 +1,8 @@
[Unit]
Description=LVM activation
DefaultDependencies=no
Requires=udev-settle.service
After=udev-settle.service
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
Before=basic.target shutdown.target
Conflicts=shutdown.target

View File

@ -21,3 +21,4 @@ run_hook() {
fi
}
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -28,3 +28,4 @@ before trying to scan and activate any volume groups.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et:

View File

@ -1,41 +1,28 @@
#
# Chakra Packages for Chakra, part of chakra-project.org
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# maintainer: abveritas@chakra-project.org
pkgname=mkinitcpio
pkgver=0.8.8
pkgrel=1
pkgver=0.10
pkgrel=2
pkgdesc="Modular initramfs image creation utility"
arch=('any')
url="http://www.archlinux.org/"
license=('GPL')
depends=('awk' 'mkinitcpio-busybox>=1.16.1-2' 'kmod>=3' 'util-linux>=2.20.1-2' 'libarchive' 'coreutils'
'bash' 'findutils' 'sed' 'grep' 'filesystem>=2011.10-1' 'file' 'gzip' 'udev')
depends=('awk' 'mkinitcpio-busybox>=1.19.4-2' 'kmod' 'util-linux>=2.21' 'libarchive' 'coreutils'
'bash' 'findutils' 'grep' 'filesystem>=2011.10-1' 'file' 'gzip' 'systemd')
optdepends=('xz: Use lzma or xz compression for the initramfs image'
'bzip2: Use bzip2 compression for the initramfs image'
'lzop: Use lzo compression for the initramfs image'
'mkinitcpio-nfs-utils: Support for root filesystem on NFS')
backup=('etc/mkinitcpio.conf')
source=("ftp://ftp.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz")
#'0001-autodetect-resolve-guessed-filesystem-modules.patch')
sha256sums=('b63d273c899732e7919a956937a4e187d2780f010b0f4774756d58451271269f')
#'769e7a5eabb9b77802b1b55f4d123566e13c26dc4966189e4101a38069b6fe8f')
#build() {
# cd "$pkgname-$pkgver"
# patch -Np1 <"$srcdir/0001-autodetect-resolve-guessed-filesystem-modules.patch"
#}
source=("ftp://ftp.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig})
install=mkinitcpio.install
sha256sums=('cd3526b135ede8ca60e05222b1e86cdf3a917947d4fd5b6e6a0a34ec408bc494'
'21bd8a75203d15706fd66bfc9520ea1eb728736ee8f6c6a595f63f997b2673e3')
package() {
make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
# compat symlink
install -dm755 "$pkgdir/sbin"
ln -s /usr/bin/mkinitcpio "$pkgdir/sbin/mkinitcpio"
# XXX: remove udev hooks -- they belong to the udev package
#rm "$pkgdir"/lib/initcpio/{hooks,install}/udev
}

View File

@ -0,0 +1,8 @@
#!/bin/sh
post_upgrade() {
if [ "$(vercmp 0.9.0 "$2")" -eq 1 ]; then
printf '==> If your /usr is on a separate partition, you must add the "usr" hook\n'
printf ' to /etc/mkinitcpio.conf and regenerate your images before rebooting\n'
fi
}

View File

@ -5,13 +5,13 @@
pkgname=pcmciautils
pkgver=018
pkgrel=3
pkgrel=4
pkgdesc="Utilities for inserting and removing PCMCIA cards"
arch=('i686' 'x86_64')
url="http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html"
license=('GPL')
groups=('base')
depends=('sysfsutils' 'udev')
depends=('sysfsutils' 'systemd')
conflicts=('pcmcia-cs')
options=(!makeflags)
# The sources on kernel.org seem to be missing after the server got hacked...

View File

@ -0,0 +1,124 @@
From 2127f99fb43d2ef950e95329ce40bdd5da8b015c Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Fri, 25 May 2012 19:43:24 -0400
Subject: [PATCH] Reinstate TIMEOUT= handling
This is mostly to deal with ipw2?00 drivers which have yet to be fixed
in the kernel.
---
src/libudev/libudev-device.c | 19 +++++++++++++++++++
src/libudev/libudev-private.h | 1 +
src/udev/udevd.c | 13 ++++++++++---
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index a8277d1..5966189 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -68,6 +68,7 @@ struct udev_device {
struct udev_list tags_list;
unsigned long long int seqnum;
unsigned long long int usec_initialized;
+ int timeout;
int devlink_priority;
int refcount;
dev_t devnum;
@@ -89,6 +90,21 @@ struct udev_device {
bool db_persist;
};
+int udev_device_get_timeout(struct udev_device *udev_device)
+{
+ return udev_device->timeout;
+}
+
+static int udev_device_set_timeout(struct udev_device *udev_device, int timeout)
+{
+ char num[32];
+
+ udev_device->timeout = timeout;
+ snprintf(num, sizeof(num), "%u", timeout);
+ udev_device_add_property(udev_device, "TIMEOUT", num);
+ return 0;
+}
+
/**
* udev_device_get_seqnum:
* @udev_device: udev device
@@ -362,6 +378,8 @@ void udev_device_add_property_from_string_parse(struct udev_device *udev_device,
util_strscpyl(path, sizeof(path), TEST_PREFIX "/sys", &property[8], NULL);
udev_device_set_syspath(udev_device, path);
+ } else if (strncmp(property, "TIMEOUT=", 8) == 0) {
+ udev_device_set_timeout(udev_device, strtoull(&property[8], NULL, 10));
} else if (startswith(property, "SUBSYSTEM=")) {
udev_device_set_subsystem(udev_device, &property[10]);
} else if (startswith(property, "DEVTYPE=")) {
@@ -605,6 +623,7 @@ struct udev_device *udev_device_new(struct udev *udev)
udev_list_init(udev, &udev_device->sysattr_value_list, true);
udev_list_init(udev, &udev_device->sysattr_list, false);
udev_list_init(udev, &udev_device->tags_list, true);
+ udev_device->timeout = -1;
udev_device->watch_handle = -1;
/* copy global properties */
udev_list_entry_foreach(list_entry, udev_get_properties_list_entry(udev))
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
index 4eb4a59..99aefeb 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -70,6 +70,7 @@ const char *udev_device_get_id_filename(struct udev_device *udev_device);
void udev_device_set_is_initialized(struct udev_device *udev_device);
int udev_device_add_tag(struct udev_device *udev_device, const char *tag);
void udev_device_cleanup_tags_list(struct udev_device *udev_device);
+int udev_device_get_timeout(struct udev_device *udev_device);
unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_device);
void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized);
int udev_device_get_devlink_priority(struct udev_device *udev_device);
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 0d85960..cd24462 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -384,7 +384,7 @@ out:
}
}
-static void event_run(struct event *event)
+static void event_run(struct event *event, bool force)
{
struct udev_list_node *loop;
@@ -410,7 +410,7 @@ static void event_run(struct event *event)
return;
}
- if (children >= children_max) {
+ if (!force && children >= children_max) {
if (children_max > 1)
log_debug("maximum number (%i) of children reached\n", children);
return;
@@ -444,6 +444,13 @@ static int event_queue_insert(struct udev_device *dev)
event->state = EVENT_QUEUED;
udev_list_node_append(&event->node, &event_list);
+
+ /* run all events with a timeout set immediately */
+ if (udev_device_get_timeout(dev) > 0) {
+ event_run(event, true);
+ return 0;
+ }
+
return 0;
}
@@ -549,7 +556,7 @@ static void event_queue_start(struct udev *udev)
if (is_devpath_busy(event))
continue;
- event_run(event);
+ event_run(event, false);
}
}
--
1.7.10.2

17
systemd/99-default.preset Normal file
View File

@ -0,0 +1,17 @@
# Also see
# https://fedoraproject.org/wiki/Starting_services_by_default
# Enable Avahi by default
enable avahi-daemon.*
# Enable KDM by default
enable kdm.service
# Enforce Fedora's disable-by-default policy
disable *
# Enable NetworkManager by default
enable NetworkManager.service
# Enable NTP by default
enable ntpd.service

137
systemd/PKGBUILD Normal file
View File

@ -0,0 +1,137 @@
#
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer: abveritas@chakra-project.org
pkgname=systemd
pkgver=189
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.freedesktop.org/wiki/Software/systemd"
license=('GPL2' 'LGPL2.1' 'MIT')
depends=('acl' 'bash' 'glibc' 'glib2' 'kmod' 'hwids' 'util-linux' 'kbd' 'kmod' 'libcap' 'libxslt'
'linux-api-headers' 'pam' 'xz' 'libgcrypt')
makedepends=('docbook-xsl' 'gobject-introspection' 'gperf' 'intltool')
optdepends=('pycairo: systemd-analyze'
'dbus-python: systemd-analyze')
backup=(etc/dbus-1/system.d/org.freedesktop.systemd1.conf
etc/dbus-1/system.d/org.freedesktop.hostname1.conf
etc/dbus-1/system.d/org.freedesktop.login1.conf
etc/dbus-1/system.d/org.freedesktop.locale1.conf
etc/dbus-1/system.d/org.freedesktop.timedate1.conf
etc/systemd/system.conf
etc/systemd/user.conf
etc/systemd/logind.conf
etc/systemd/journald.conf
etc/udev/udev.conf)
provides=("udev=$pkgver")
conflicts=('udev' 'sysvinit' 'initscripts' 'initscripts-systemd')
replaces=('udev')
group=('base')
install="systemd.install"
options=('!libtool')
source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
'initcpio-hook-udev'
'initcpio-install-udev'
'initcpio-install-timestamp'
'0001-Reinstate-TIMEOUT-handling.patch'
'locale.sh'
'use-split-usr-path.patch'
'99-default.preset')
md5sums=('ac2eb313f5dce79622f60aac56bca66d'
'e99e9189aa2f6084ac28b8ddf605aeb8'
'59e91c4d7a69b7bf12c86a9982e37ced'
'df69615503ad293c9ddf9d8b7755282d'
'5543be25f205f853a21fa5ee68e03f0d'
'f15956945052bb911e5df81cf5e7e5dc'
'482dba45a783f06c2239f1355f4ce72f'
'a1bf25da736d3719e9720b2e4caea341')
build() {
cd "$pkgname-$pkgver"
# still waiting on ipw2x00 to get fixed...
patch -p1 -i "$srcdir/0001-Reinstate-TIMEOUT-handling.patch"
patch -p1 -i "$srcdir/use-split-usr-path.patch"
./configure \
--libexecdir=/usr/lib \
--localstatedir=/var \
--sysconfdir=/etc \
--enable-introspection \
--disable-gtk-doc \
--disable-audit \
--disable-ima \
--with-distro=other \
--with-usb-ids-path=/usr/share/hwdata/usb.ids \
--with-pci-ids-path=/usr/share/hwdata/pci.ids \
--with-firmware-path=/usr/lib/firmware/updates:/lib/firmware/updates:/usr/lib/firmware:/lib/firmware
make
}
package() {
make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
printf "d /run/console 0755 root root\n" > "$pkgdir/usr/lib/tmpfiles.d/console.conf"
install -dm755 "$pkgdir/bin"
ln -s ../usr/lib/systemd/systemd "$pkgdir/bin/systemd"
# move bash-completion and symlink for loginctl
install -Dm644 "$pkgdir/etc/bash_completion.d/systemd-bash-completion.sh" \
"$pkgdir/usr/share/bash-completion/completions/systemctl"
ln -s systemctl "$pkgdir/usr/share/bash-completion/completions/loginctl"
rm -rf "$pkgdir/etc/bash_completion.d"
# don't write units to /etc by default -- we'll enable this on post_install
# as a sane default
rm "$pkgdir/etc/systemd/system/getty.target.wants/getty@tty1.service"
rmdir "$pkgdir/etc/systemd/system/getty.target.wants"
# Remove rpm dir
rm -r "$pkgdir/etc/rpm"
# can't use py3k yet with systemd-analyze -- the 'plot' verb will not work.
# https://pokersource.info/show_bug.cgi?id=50989
sed -i '1s/python$/python2/' "$pkgdir/usr/bin/systemd-analyze"
install -dm755 "$pkgdir/sbin"
for tool in runlevel reboot shutdown poweroff halt telinit; do
ln -s '/usr/bin/systemctl' "$pkgdir/sbin/$tool"
done
ln -s '../usr/lib/systemd/systemd' "$pkgdir/sbin/init"
install -Dm755 "$srcdir/locale.sh" "$pkgdir/etc/profile.d/locale.sh"
# the path to udevadm is hardcoded in some places
install -d "$pkgdir/sbin"
ln -s ../usr/bin/udevadm "$pkgdir/sbin/udevadm"
# udevd is no longer udevd because systemd. why isn't udevadm now udevctl?
ln -s ../lib/systemd/systemd-udevd "$pkgdir/usr/bin/udevd"
# add back tmpfiles.d/legacy.conf
install -m644 "systemd-$pkgver/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d"
# Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
sed -i 's#GROUP="dialout"#GROUP="uucp"#g;
s#GROUP="tape"#GROUP="storage"#g;
s#GROUP="cdrom"#GROUP="optical"#g' "$pkgdir"/usr/lib/udev/rules.d/*.rules
# add mkinitcpio hooks
install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev"
install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev"
install -Dm644 "$srcdir/initcpio-install-timestamp" "$pkgdir/usr/lib/initcpio/install/timestamp"
# XXX: kill off coredump rule until the journal can recover coredumps
# this file needs to come back as part of systemd, not systemd-tools
rm "$pkgdir/usr/lib/sysctl.d/coredump.conf"
# Chakra specific .preset
install -Dm644 "$srcdir/99-default.preset" "$pkgdir/usr/lib/systemd/system-preset/99-default.preset "
}
# vim: ft=sh syn=sh et

Some files were not shown because too many files have changed in this diff Show More