void-packages/srcpkgs/OpenRC/patches/xbps_changes.diff

275 lines
9.3 KiB
Diff

xbps changes:
* Installs a "locale" service into the "boot" runlevel to set
a global system locale.
* Adds consolefont by default in "boot" runlevel.
* Removes hardcoded rpath for bins/lib.
* Modified inittab to pass correct parameters to reboot(8).
* Sets unicode, rc_logger and rc_shell in /etc/rc.conf by default.
* Sets windowkeys and fix_euro in /etc/conf.d/keymaps by default.
* The bootmisc service no longer cleans up /var/run, as it is now mounted tmpfs
(symlinked to /run, which is tmpfs).
* The mtab service checks if / is of type rootfs and tmpfs, and don't add it
into /etc/mtab, which is redundant.
* mount_svcdir() doesn't mount any tmpfs or ramfs anymore, rather mounts an
tmpfs in /run and creates a compat symlink for /dev/shm.
* Backported a patch to skip unmounting the /run mountpoint from upstream
git repo (Gentoo).
--- runlevels/Makefile.Linux.orig 2009-05-07 15:48:37.075825332 +0000
+++ runlevels/Makefile.Linux 2009-05-07 15:48:52.008557039 +0000
@@ -1,3 +1,3 @@
SYSINIT+= devfs dmesg
-BOOT+= hwclock keymaps modules mtab procfs termencoding
+BOOT+= consolefont hwclock keymaps modules mtab procfs termencoding locale
SHUTDOWN+= killprocs mount-ro
--- init.d/Makefile.Linux.orig 2009-05-07 15:55:26.156910483 +0000
+++ init.d/Makefile.Linux 2009-05-07 15:55:35.682853819 +0000
@@ -2,7 +2,7 @@ NET_LO= net.lo
SRCS+= devfs.in dmesg.in hwclock.in consolefont.in keymaps.in killprocs.in \
modules.in mount-ro.in mtab.in numlock.in procfs.in sysfs.in \
- termencoding.in
+ termencoding.in locale.in
.SUFFIXES: .Linux.in
--- support/sysvinit/inittab.orig 2009-05-07 12:03:07.533948107 +0000
+++ support/sysvinit/inittab 2009-05-07 12:04:45.178070711 +0000
@@ -18,7 +18,7 @@ l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
-l6r:6:wait:/sbin/reboot -dk
+l6r:6:wait:/sbin/reboot -dfi
#z6:6:respawn:/sbin/sulogin
# new-style single-user
.Linux.in:
--- conf.d/keymaps.orig 2009-10-09 17:09:02.537481085 +0200
+++ conf.d/keymaps 2009-10-09 17:12:19.694535631 +0200
@@ -1,10 +1,14 @@
# Use KEYMAP to specify the default console keymap. There is a complete tree
# of keymaps in /usr/share/keymaps to choose from.
-keymap="us"
+#
+# Please note that is mandatory to also specify the keyboard layout model,
+# i.e qwerty, dvorak, etc; because otherwise loadkeys(1) will use the first
+# one it finds and some keymaps do have the same name.
+keymap="qwerty/us"
# Should we first load the 'windowkeys' console keymap? Most x86 users will
# say "yes" here. Note that non-x86 users should leave it as "no".
-windowkeys="NO"
+windowkeys="yes"
# The maps to load for extended keyboards. Most users will leave this as is.
extended_keymaps=""
@@ -18,4 +22,4 @@ dumpkeys_charset=""
# Some fonts map AltGr-E to the currency symbol ¤ instead of the Euro €
# To fix this, set to "yes"
-fix_euro="NO"
+fix_euro="yes"
--- mk/lib.mk.orig 2009-10-21 11:00:57.000000000 +0200
+++ mk/lib.mk 2009-10-21 11:01:17.000000000 +0200
@@ -32,7 +32,7 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS}
${SHLIB_NAME}: ${VERSION_MAP}
LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
# We need to ensure we use libraries in /lib
-LDFLAGS+= -L/${LIBNAME} -Wl,-rpath=/${LIBNAME}
+LDFLAGS+= -L/${LIBNAME}
${SHLIB_NAME}: ${SOBJS}
@${ECHO} building shared library $@
--- etc/rc.conf.in.orig 2009-12-05 03:30:48.675483763 +0100
+++ etc/rc.conf.in 2009-12-05 03:31:13.034222373 +0100
@@ -18,7 +18,7 @@
# If not specified we use $SHELL, otherwise the one specified in /etc/passwd,
# otherwise /bin/sh
# Linux users could specify /sbin/sulogin
-#rc_shell=/bin/sh
+rc_shell=/sbin/sulogin
# Do we allow any started service in the runlevel to satisfy the depedency
# or do we want all of them regardless of state? For example, if net.eth0
@@ -44,7 +44,7 @@
# /var/log/rc.log
# NOTE: Linux systems require the devfs service to be started before
# logging can take place and as such cannot log the sysinit runlevel.
-#rc_logger="YES"
+rc_logger="YES"
# By default we filter the environment for our running scripts. To allow other
# variables through, add them here. Use a * to allow all variables through.
@@ -73,7 +73,7 @@
# There variables are shared between many init scripts
# Set unicode to YES to turn on unicode support for keyboards and screens.
-#unicode="NO"
+unicode="YES"
# Network fstypes. Below is the default.
net_fs_list="afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs nfs nfs4 ocfs2 shfs smbfs"
--- init.d/mtab.in.orig 2011-01-16 12:44:28.947251849 +0100
+++ init.d/mtab.in 2011-01-16 12:44:37.896926832 +0100
@@ -28,7 +28,7 @@ start()
# makes / readonly and dismounts all tmpfs even if in use which is
# not good. Luckily, umount uses /etc/mtab instead of /proc/mounts
# which allows this hack to work.
- grep -v "^[^ ]* / tmpfs " /proc/mounts > /etc/mtab
+ egrep -v "^[^ ]* / (rootfs|tmpfs) " /proc/mounts > /etc/mtab
# Remove stale backups
rm -f /etc/mtab~ /etc/mtab~~
--- init.d/bootmisc.in.orig 2011-01-16 12:45:10.633395765 +0100
+++ init.d/bootmisc.in 2011-01-16 12:46:00.591163353 +0100
@@ -97,31 +97,6 @@ start()
done
[ -e /var/log/wtmp ] || mkutmp /var/log/wtmp
eend 0
-
- ebegin "Cleaning /var/run"
- for x in $(find /var/run ! -type d ! -name utmp \
- ! -name random-seed ! -name dev.db \
- ! -name ld-elf.so.hints ! -name ld.so.hints);
- do
- # Clean stale sockets
- if [ -S "$x" ]; then
- if type fuser >/dev/null 2>&1; then
- fuser "$x" >/dev/null 2>&1 || rm -- "$x"
- else
- rm -- "$x"
- fi
- fi
- [ ! -f "$x" ] && continue
- # Do not remove pidfiles of already running daemons
- case "$x" in
- *.pid)
- start-stop-daemon --test --quiet \
- --stop --pidfile "$x" && continue
- ;;
- esac
- rm -f -- "$x"
- done
- eend 0
fi
# Clean up /tmp directories
--- init.d/devfs.in.orig 2011-02-10 06:15:24.000000000 +0100
+++ init.d/devfs.in 2011-04-29 18:12:48.983999871 +0200
@@ -13,7 +13,6 @@ start() {
# Mount required stuff as user may not have then in /etc/fstab
for x in \
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
- "tmpfs /dev/shm 1777 ,nodev shm" \
; do
set -- $x
grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue
--- sh/init.sh.Linux.in.orig 2011-02-10 06:15:24.000000000 +0100
+++ sh/init.sh.Linux.in 2011-05-04 13:03:07.481471247 +0200
@@ -3,59 +3,22 @@
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
-# This basically mounts $RC_SVCDIR as a ramdisk.
-# The tricky part is finding something our kernel supports
-# tmpfs and ramfs are easy, so force one or the other.
-svcdir_restorecon()
-{
- local rc=0
- if [ -x /usr/sbin/selinuxenabled -a -c /selinux/null ] &&
- selinuxenabled; then
- restorecon $RC_SVCDIR
- rc=$?
- fi
- return $rc
-}
-
mount_svcdir()
{
- # mount from fstab if we can
- fstabinfo --mount "$RC_SVCDIR" && return 0
-
- local fs= fsopts="-o rw,noexec,nodev,nosuid"
- local svcsize=${rc_svcsize:-1024}
-
- # Some buggy kernels report tmpfs even when not present :(
- if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems; then
- local tmpfsopts="${fsopts},mode=755,size=${svcsize}k"
- mount -n -t tmpfs $tmpfsopts rc-svcdir "$RC_SVCDIR"
- if [ $? -eq 0 ]; then
- svcdir_restorecon
- [ $? -eq 0 ] && return 0
- fi
- fi
-
- if grep -Eq "[[:space:]]+ramfs$" /proc/filesystems; then
- fs="ramfs"
- # ramfs has no special options
- elif [ -e /dev/ram0 ] \
- && grep -Eq "[[:space:]]+ext2$" /proc/filesystems; then
- devdir="/dev/ram0"
- fs="ext2"
- dd if=/dev/zero of="$devdir" bs=1k count="$svcsize"
- mkfs -t "$fs" -i 1024 -vm0 "$devdir" "$svcsize"
- else
- echo
- eerror "OpenRC requires tmpfs, ramfs or a ramdisk + ext2"
- eerror "compiled into the kernel"
- echo
- return 1
- fi
+ # Mount /run as tmpfs.
+ mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
- mount -n -t "$fs" $fsopts rc-svcdir "$RC_SVCDIR"
- if [ $? -eq 0 ]; then
- svcdir_restorecon
- [ $? -eq 0 ] && return 0
+ for d in init.d udev; do
+ mkdir -m0755 /run/${d}
+ done
+ for d in lock tmp shm; do
+ mkdir -m1777 /run/${d}
+ done
+
+ # Create /dev/shm -> /run/shm compat symlink.
+ if [ "$(readlink -f /dev/shm)" != "/run/shm" ]; then
+ rm -rf /dev/shm
+ ln -sf /run/shm /dev/shm
fi
}
--- init.d/localmount.in.orig 2011-02-10 06:15:24.000000000 +0100
+++ init.d/localmount.in 2011-05-20 09:44:24.445841901 +0200
@@ -34,7 +34,7 @@ start()
stop()
{
# We never unmount / or /dev or $RC_SVCDIR
- local x= no_umounts_r="/|/dev|/dev/.*|${RC_SVCDIR}"
+ local x= no_umounts_r="/|/dev|/dev/.*"
no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib|/libexec"
# RC_NO_UMOUNTS is an env var that can be set by plugins
OIFS=$IFS SIFS=${IFS-y}
@@ -49,7 +49,7 @@ stop()
fi
if [ "$RC_UNAME" = Linux ]; then
- no_umounts_r="$no_umounts_r|/proc|/proc/.*|/sys|/sys/.*"
+ no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*|/cow|/rofs|/cdrom"
fi
no_umounts_r="^($no_umounts_r)$"
--- init.d/mount-ro.in.orig 2011-05-20 09:45:08.199841890 +0200
+++ init.d/mount-ro.in 2011-05-20 09:45:33.285841883 +0200
@@ -19,7 +19,7 @@ start()
# We need the do_unmount function
. "$RC_LIBEXECDIR"/sh/rc-mount.sh
eindent
- local m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|${RC_SVCDIR}" x= fs=
+ local m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|/run|/cow|/rofs|/cdrom" x= fs=
m="$m|/bin|/sbin|/lib|/libexec"
# RC_NO_UMOUNTS is an env var that can be set by plugins
local OIFS=$IFS SIFS=${IFS-y} IFS=$IFS