From 47075ccee979311920e3f72b764073f3dd47b428 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 16 Jan 2011 12:54:35 +0100 Subject: [PATCH] OpenRC: added some more XBPS custom patches, bumprev. * Do not add / with rootfs type in /etc/mtab in devfs service. * Mount /var/run, /var/lock and /var/tmp as tmpfs in sysfs service. * Do not clean up /var/run as it is redundant now in bootmisc service. --- .../OpenRC/patches/define_xbps_branding.diff | 11 -- srcpkgs/OpenRC/patches/xbps_changes.diff | 109 ++++++++++++++++++ srcpkgs/OpenRC/template | 20 ++-- 3 files changed, 121 insertions(+), 19 deletions(-) delete mode 100644 srcpkgs/OpenRC/patches/define_xbps_branding.diff diff --git a/srcpkgs/OpenRC/patches/define_xbps_branding.diff b/srcpkgs/OpenRC/patches/define_xbps_branding.diff deleted file mode 100644 index 0061c43f8e6..00000000000 --- a/srcpkgs/OpenRC/patches/define_xbps_branding.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- src/rc/Makefile.orig 2010-02-27 07:08:19.436866107 +0100 -+++ src/rc/Makefile 2010-02-27 07:08:36.174882315 +0100 -@@ -34,6 +34,8 @@ CPPFLAGS+= -I../includes -I../librc -I.. - LDFLAGS+= -L../librc -L../libeinfo - LDADD+= -lutil -lrc -leinfo - -+BRANDING= XBPS Linux -+ - include ../../Makefile.inc - MK= ../../mk - include ${MK}/debug.mk diff --git a/srcpkgs/OpenRC/patches/xbps_changes.diff b/srcpkgs/OpenRC/patches/xbps_changes.diff index 1db6b5e8e1c..7daf57b702a 100644 --- a/srcpkgs/OpenRC/patches/xbps_changes.diff +++ b/srcpkgs/OpenRC/patches/xbps_changes.diff @@ -3,10 +3,17 @@ 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. * In local service, start/stop vmware-tools services if script exists. +* The sysfs service mounts /var/run, /var/lock and /var/tmp as tmpfs with + appropiate permissions. +* The bootmisc service no longer cleans up /var/run, as it is now mounted tmpfs. +* The devfs service mounts /dev/shm with type tmpfs rather than "shm". +* The mtab service checks if / is of type rootfs and tmpfs, and don't add it + into /etc/mtab, which is redundant. --- runlevels/Makefile.Linux.orig 2009-05-07 15:48:37.075825332 +0000 +++ runlevels/Makefile.Linux 2009-05-07 15:48:52.008557039 +0000 @@ -139,3 +146,105 @@ xbps changes: # 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/sysfs.in.orig 2011-01-16 12:42:39.930029312 +0100 ++++ init.d/sysfs.in 2011-01-16 12:43:08.090153349 +0100 +@@ -52,13 +52,39 @@ mount_misc() + fi + } + ++mount_var_run_lock() ++{ ++ local _args _mode _mnt ++ ++ for _mnt in run lock tmp; do ++ if [ "${_mnt}" != "run" ]; then ++ _mode=1777 ++ _args="mode=${_mode},nosuid,noexec,nodev" ++ else ++ _mode=0755 ++ _args="mode=${_mode},nosuid" ++ fi ++ if [ ! -d /var/${_mnt} ]; then ++ if ! mkdir -m ${_mode} /var/${_mnt}; then ++ ewarn "Could not create /var/${_mnt}!" ++ return 1 ++ fi ++ fi ++ ++ ebegin "Mounting /var/${_mnt}" ++ if ! fstabinfo --mount /var/${_mnt}; then ++ mount -n -t tmpfs -o ${_args} tmpfs /var/${_mnt} ++ fi ++ eend $? ++ done ++} ++ + start() + { +- local retval + mount_sys +- retval=$? +- if [ $retval -eq 0 ]; then ++ if [ $? -eq 0 ]; then + mount_misc + fi +- return $retval ++ mount_var_run_lock ++ return $? + } +--- 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-01-16 12:46:46.645636416 +0100 ++++ init.d/devfs.in 2011-01-16 12:46:58.783551737 +0100 +@@ -13,7 +13,7 @@ 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" \ ++ "tmpfs /dev/shm 1777 ,nodev tmpfs" \ + ; do + set -- $x + grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue diff --git a/srcpkgs/OpenRC/template b/srcpkgs/OpenRC/template index dd527cf8087..046cbb9f2cb 100644 --- a/srcpkgs/OpenRC/template +++ b/srcpkgs/OpenRC/template @@ -1,10 +1,10 @@ # Template file for 'OpenRC' pkgname=OpenRC version=0.6.1 -revision=1 +revision=2 wrksrc=openrc-${version} distfiles="http://roy.marples.name/downloads/openrc/openrc-$version.tar.bz2" -build_style=gnu_makefile +build_style=custom-install short_desc="Universal init system" maintainer="Juan RP " checksum=c7847254e41b613b76ae570cf786ce8164d637962ad4580d0825b4b62b475e07 @@ -18,10 +18,10 @@ long_desc=" keep_empty_dirs=yes conf_files="/etc/rc.conf /etc/conf.d/bootmisc /etc/conf.d/consolefont - /etc/conf.d/dmesg /etc/conf.d/fsck /etc/conf.d/hostname /etc/conf.d/hwclock - /etc/conf.d/keymaps /etc/conf.d/local /etc/conf.d/locale - /etc/conf.d/localmount /etc/conf.d/modules /etc/conf.d/network - /etc/conf.d/urandom /etc/conf.d/staticroute /etc/inittab" +/etc/conf.d/dmesg /etc/conf.d/fsck /etc/conf.d/hostname /etc/conf.d/hwclock +/etc/conf.d/keymaps /etc/conf.d/local /etc/conf.d/locale +/etc/conf.d/localmount /etc/conf.d/modules /etc/conf.d/network +/etc/conf.d/urandom /etc/conf.d/staticroute /etc/inittab" subpackages="$pkgname-devel" Add_dependency full glibc @@ -29,7 +29,7 @@ Add_dependency full psmisc Add_dependency full sysvinit Add_dependency build diffutils -pre_build() +do_build() { # Use cmp(1) from diffutils. export PATH="/usr/bin:$PATH" @@ -41,10 +41,14 @@ pre_build() for f in init.d/consolefont.in conf.d/consolefont; do sed -i -e "s|/usr/share|/lib/kbd|g" ${wrksrc}/${f} done + + make ${makejobs} BRANDING="XBPS GNU/Linux" } -post_install() +do_install() { + make DESTDIR=${DESTDIR} install + install -D -m755 ${wrksrc}/support/sysvinit/inittab \ ${DESTDIR}/etc/inittab install -D -m644 ${FILESDIR}/$pkgname.logrotate \