summaryrefslogtreecommitdiffstats
path: root/abs/core/sysvinit
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
commit2648e999d277eac5c3d331a3609bcc73fafbea71 (patch)
tree40951fb8e7fdbe28a0baa324ae615055203f1e2e /abs/core/sysvinit
parentc759b5e0c4aa6fc37412b4dee2cf9ad993fd376d (diff)
parent7e6f7ca174e1af67178dc5293a312a4a733eb095 (diff)
downloadlinhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.zip
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.gz
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.bz2
Merge branch 'testing'
# By James Meyer (1091) and others # Via James Meyer (5) and others * testing: (1148 commits) LinHES-config: during install don't kill off lirc. This keeps the remote active all the way to the finish Change version numbers to 8.0 to match the release number. LinHES-conifg LinHES-system mythdb-initial runit-scripts supplemental-web LinHES-conifig: mv_install.py for the last partition don't go all the way to the end. Gotta leave room for gpt tables. xf86-video-ati: xorg ati driver. LinHES-config: timezip.py add syncing up of parental lvl passwords and starting level with MBE. LinHES-system: correct the logic for breaking out of the wmctrl loop. As written it would break out of the inner loop..but not the 60 iteration loop. e16_theme_settings: remove slide-in prop for new windows. For whatever reason this was preventing mplayer from being positioned correctly for appletrailers. LinHES-config, mythinstall: change case of hd_pvr and serial to all lower refs #902 zilog-firmware: firmware for TX support of the hdpvr and pvr-150 In general I can't recommend anybody using these transmitters but including the firmware just in case someone really wants to linhes-udev-rules: added hdprv_lirc rule. All of these lirc rules are limited to exactly one device. If more then one device is present then only the last device in init will get the symlink runit-scripts: fix logging for igdeamon, add support to remote init script so that the blaster is always the first device in the chain. added support specificly for hd_pvr LinHES-system: add lh_system_restore and lh_system_backup. These scripts are called from the mythmenu. refs #900 iguanair: rebuild with python 2.7 LinHES-system: msg_daemon.py fix init and nasty bug related to timeout. In a nutshell timeout wouldn't work unless a msg without a timeout was called first. linhes-udev-rules: add rules for mce,streamzap,serial lirc devices. mythinstall: recompile for matching libs mythtv: latest .25-fixes and change mythbackup/restore call lh_system_$op to replace mythbackup/mythrestore. mythbackup no longer works correctly with the new windowmanager linhes-scripts: myth2mp3, myth2x264, myth2xvid: use mythutil to get cutlist LinHES-config, supplimental-web: Fix proxy numbering for Ceton infiniTV linhes-system: add additional stuff to the system backup and also introduced an exclude file. The exclude/include files are locate in /home/mythtv/backup_config/ ...
Diffstat (limited to 'abs/core/sysvinit')
-rw-r--r--abs/core/sysvinit/0001-simplify-writelog.patch126
-rw-r--r--abs/core/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch80
-rw-r--r--abs/core/sysvinit/PKGBUILD73
-rw-r--r--abs/core/sysvinit/__changelog34
-rw-r--r--abs/core/sysvinit/halt_init.patch (renamed from abs/core/sysvinit/halt-init.patch)9
-rw-r--r--abs/core/sysvinit/sysvinit.install3
6 files changed, 270 insertions, 55 deletions
diff --git a/abs/core/sysvinit/0001-simplify-writelog.patch b/abs/core/sysvinit/0001-simplify-writelog.patch
new file mode 100644
index 0000000..cc28f14
--- /dev/null
+++ b/abs/core/sysvinit/0001-simplify-writelog.patch
@@ -0,0 +1,126 @@
+From 5577552eb1344ddd661893564b1e628f8edcf13d Mon Sep 17 00:00:00 2001
+From: Florian Pritz <bluewind@xinu.at>
+Date: Fri, 15 Jun 2012 16:41:52 +0200
+Subject: [PATCH 1/2] simplify writelog()
+
+All we do is prepend the date and remove \r. We don't handle color
+codes, but the user can just cat the log file in a terminal and it will
+interpret the codes correctly.
+
+Signed-off-by: Florian Pritz <bluewind@xinu.at>
+---
+ bootlogd.c | 76 +++++++++++++++++-------------------------------------------
+ 1 file changed, 21 insertions(+), 55 deletions(-)
+
+diff --git a/bootlogd.c b/bootlogd.c
+index 570d382..e36e261 100644
+--- a/bootlogd.c
++++ b/bootlogd.c
+@@ -68,11 +68,6 @@ int didnl = 1;
+ int createlogfile = 0;
+ int syncalot = 0;
+
+-struct line {
+- char buf[256];
+- int pos;
+-} line;
+-
+ /*
+ * Console devices as listed on the kernel command line and
+ * the mapping to actual devices in /dev
+@@ -351,63 +346,34 @@ int consolename(char *res, int rlen)
+ */
+ void writelog(FILE *fp, unsigned char *ptr, int len)
+ {
+- time_t t;
+- char *s;
+- char tmp[8];
+- int olen = len;
+- int dosync = 0;
+- int tlen;
+-
+- while (len > 0) {
+- tmp[0] = 0;
+- if (didnl) {
++ int dosync = 0;
++ int i;
++ static int first_run = 1;
++
++ for (i = 0; i < len; i++) {
++ int ignore = 0;
++
++ /* prepend date to every line */
++ if (*(ptr-1) == '\n' || first_run) {
++ time_t t;
++ char *s;
+ time(&t);
+ s = ctime(&t);
+ fprintf(fp, "%.24s: ", s);
+- didnl = 0;
++ dosync = 1;
++ first_run = 0;
+ }
+- switch (*ptr) {
+- case 27: /* ESC */
+- strcpy(tmp, "^[");
+- break;
+- case '\r':
+- line.pos = 0;
+- break;
+- case 8: /* ^H */
+- if (line.pos > 0) line.pos--;
+- break;
+- case '\n':
+- didnl = 1;
+- dosync = 1;
+- break;
+- case '\t':
+- line.pos += (line.pos / 8 + 1) * 8;
+- if (line.pos >= (int)sizeof(line.buf))
+- line.pos = sizeof(line.buf) - 1;
+- break;
+- case 32 ... 127:
+- case 161 ... 255:
+- tmp[0] = *ptr;
+- tmp[1] = 0;
+- break;
+- default:
+- sprintf(tmp, "\\%03o", *ptr);
+- break;
+- }
+- ptr++;
+- len--;
+
+- tlen = strlen(tmp);
+- if (tlen && (line.pos + tlen < (int)sizeof(line.buf))) {
+- memcpy(line.buf + line.pos, tmp, tlen);
+- line.pos += tlen;
++ if (*ptr == '\r') {
++ ignore = 1;
+ }
+- if (didnl) {
+- fprintf(fp, "%s\n", line.buf);
+- memset(&line, 0, sizeof(line));
++
++ if (!ignore) {
++ fwrite(ptr, sizeof(char), 1, fp);
+ }
+- }
+
++ ptr++;
++ }
+ if (dosync) {
+ fflush(fp);
+ if (syncalot) {
+@@ -415,7 +381,7 @@ void writelog(FILE *fp, unsigned char *ptr, int len)
+ }
+ }
+
+- outptr += olen;
++ outptr += len;
+ if (outptr >= endptr)
+ outptr = ringbuf;
+
+--
+1.7.10.4
+
diff --git a/abs/core/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch b/abs/core/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch
new file mode 100644
index 0000000..89b3280
--- /dev/null
+++ b/abs/core/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch
@@ -0,0 +1,80 @@
+From 8d0022d9540112a92ce8d88c91c4ac10bad8c9ef Mon Sep 17 00:00:00 2001
+From: Florian Pritz <bluewind@xinu.at>
+Date: Sun, 24 Jun 2012 15:49:51 +0200
+Subject: [PATCH 2/2] remove ansi escape codes from log file
+
+References: https://en.wikipedia.org/wiki/ANSI_escape_code
+
+Signed-off-by: Florian Pritz <bluewind@xinu.at>
+---
+ bootlogd.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 43 insertions(+), 2 deletions(-)
+
+diff --git a/bootlogd.c b/bootlogd.c
+index e36e261..88e610d 100644
+--- a/bootlogd.c
++++ b/bootlogd.c
+@@ -349,6 +349,7 @@ void writelog(FILE *fp, unsigned char *ptr, int len)
+ int dosync = 0;
+ int i;
+ static int first_run = 1;
++ static int inside_esc = 0;
+
+ for (i = 0; i < len; i++) {
+ int ignore = 0;
+@@ -364,10 +365,50 @@ void writelog(FILE *fp, unsigned char *ptr, int len)
+ first_run = 0;
+ }
+
+- if (*ptr == '\r') {
+- ignore = 1;
++ /* remove escape sequences, but do it in a way that allows us to stop
++ * in the middle in case the string was cut off */
++ if (inside_esc == 1) {
++ /* first '[' is special because if we encounter it again, it should be considered the final byte */
++ if (*ptr == '[') {
++ /* multi char sequence */
++ ignore = 1;
++ inside_esc = 2;
++ } else {
++ /* single char sequence */
++ if (*ptr >= 64 && *ptr <= 95) {
++ ignore = 1;
++ }
++ inside_esc = 0;
++ }
++ } else if (inside_esc == 2) {
++ switch (*ptr) {
++ case '0' ... '9': /* intermediate chars of escape sequence */
++ case ';':
++ case 32 ... 47:
++ if (inside_esc) {
++ ignore = 1;
++ }
++ break;
++ case 64 ... 126: /* final char of escape sequence */
++ if (inside_esc) {
++ ignore = 1;
++ inside_esc = 0;
++ }
++ break;
++ }
++ } else {
++ switch (*ptr) {
++ case '\r':
++ ignore = 1;
++ break;
++ case 27: /* ESC */
++ ignore = 1;
++ inside_esc = 1;
++ break;
++ }
+ }
+
++
+ if (!ignore) {
+ fwrite(ptr, sizeof(char), 1, fp);
+ }
+--
+1.7.10.4
+
diff --git a/abs/core/sysvinit/PKGBUILD b/abs/core/sysvinit/PKGBUILD
index c3ba701..f5aeb5e 100644
--- a/abs/core/sysvinit/PKGBUILD
+++ b/abs/core/sysvinit/PKGBUILD
@@ -1,42 +1,67 @@
-# $Id: PKGBUILD 92996 2010-10-02 19:26:38Z eric $
+# $Id: PKGBUILD 168539 2012-10-13 09:28:52Z thomas $
# Maintainer: Eric Belanger <eric@archlinux.org>
-# Contributor: judd <jvinet@zeroflux.org>
-pkgname=sysvinit
+pkgbase=sysvinit
+pkgname=('sysvinit-tools' 'sysvinit' )
pkgver=2.88
-pkgrel=6
-pkgdesc="Linux System V Init"
+pkgrel=9
arch=('i686' 'x86_64')
url="http://savannah.nongnu.org/projects/sysvinit"
license=('GPL')
-groups=('base')
-depends=('shadow' 'util-linux' 'coreutils' 'glibc' 'awk' 'poweroff-scripts')
-source=(http://download.savannah.gnu.org/releases/sysvinit/${pkgname}-${pkgver}dsf.tar.bz2 halt-init.patch)
+depends=('util-linux' 'coreutils' 'glibc' 'awk' 'poweroff-scripts')
+source=(http://download.savannah.gnu.org/releases/sysvinit/${pkgbase}-${pkgver}dsf.tar.bz2
+ "0001-simplify-writelog.patch"
+ "0002-remove-ansi-escape-codes-from-log-file.patch"
+ "halt_init.patch")
build() {
- cd "${srcdir}/${pkgname}-${pkgver}dsf"
- patch -p0 < ${srcdir}/halt-init.patch
- make || return 1
+ cd "${srcdir}/${pkgbase}-${pkgver}dsf"
+
+ # FS#30005
+ patch -p1 -d "src" -i "${srcdir}/0001-simplify-writelog.patch"
+ patch -p1 -d "src" -i "${srcdir}/0002-remove-ansi-escape-codes-from-log-file.patch"
+ patch -p0 < ${srcdir}/halt_init.patch
+ make
}
-package() {
- cd "${srcdir}/${pkgname}-${pkgver}dsf"
+package_sysvinit-tools() {
+ pkgdesc="Linux System V Init Tools"
+ depends=('poweroff-scripts')
+ cd "${srcdir}/${pkgbase}-${pkgver}dsf"
make ROOT="${pkgdir}" install
- # Rename some stuff so it does not bigfoot changes needed for runit
- cd "${pkgdir}/sbin"
- rm -f reboot poweroff
- #These will be created in the poweroff-scripts post-install section
- #This should be removed when moving to 64 and we have no legacy to worry about
- #ln -s halt.init reboot.init
- #ln -s halt.init poweroff.init
-
+ # provided by util-linux
+ cd "${pkgdir}"
+ rm bin/mountpoint
+ rm usr/share/man/man1/mountpoint.1
+ rm usr/bin/{mesg,utmpdump,wall}
+ rm usr/share/man/man1/{mesg,utmpdump,wall}.1
+ rm sbin/sulogin
+ rm usr/share/man/man8/sulogin.8
+ ### split out sysvinit
+ rm -rf ${srcdir}/_sysvinit
+ install -dm755 \
+ ${srcdir}/_sysvinit/sbin \
+ ${srcdir}/_sysvinit/usr/share/man/man8
+ cd ${srcdir}/_sysvinit
+ mv ${pkgdir}/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} sbin/
+ mv ${pkgdir}/usr/share/man/man5 usr/share/man/
+ mv ${pkgdir}/usr/share/man/man8/{halt,init,poweroff,reboot,runlevel,shutdown,telinit}.8 usr/share/man/man8/
+}
+package_sysvinit() {
+ pkgdesc="Linux System V Init"
+ depends=('sysvinit-tools')
+ install=sysvinit.install
+ # Rename some stuff so it does not bigfoot changes needed for runit
+ cd "${srcdir}/_sysvinit/sbin"
+ rm -f reboot poweroff
mv halt halt.init
mv shutdown shutdown.init
-
-
+ mv "${srcdir}"/_sysvinit/* $pkgdir
}
md5sums=('6eda8a97b86e0a6f59dabbf25202aa6f'
- 'cd4c5767f63ca5881e3e1f1c4f10f896')
+ 'e3e82a3a38415518f52f78a622ef0262'
+ '04f0ab28340df08bb47d066669bc4519'
+ 'aec0de91c1d2f56e78393d400fd238a7')
diff --git a/abs/core/sysvinit/__changelog b/abs/core/sysvinit/__changelog
index f249199..03f6f3f 100644
--- a/abs/core/sysvinit/__changelog
+++ b/abs/core/sysvinit/__changelog
@@ -1,30 +1,12 @@
-patch halt to work with runit
+depends on poweroff-scripts
+sysvinit.install
---- src/halt.c.orig 2008-08-30 17:25:02.000000000 +0000
-+++ src/halt.c 2008-08-30 18:10:29.000000000 +0000
-@@ -186,6 +186,14 @@
- if (!strcmp(progname, "reboot")) do_reboot = 1;
- if (!strcmp(progname, "poweroff")) do_poweroff = 1;
-
-+ if (!strcmp(progname, "reboot.init")) do_reboot = 1;
-+ if (!strcmp(progname, "poweroff.init")) do_poweroff = 1;
-+
-+ //fprintf(stderr, "%d: do_reboot \n ", do_reboot);
-+ //fprintf(stderr, "%d: do_poweroff \n ", do_poweroff);
-+ //fprintf(stderr, "%s: \n", progname);
-+ //do_nothing = 1;
-+
- /*
- * Get flags
- */
+halt_init.patch
+ # Rename some stuff so it does not bigfoot changes needed for runit
+ cd "${pkgdir}/sbin"
+ rm -f reboot poweroff
+ mv halt halt.init
+ mv shutdown shutdown.init
-# mjh 08-17-2011
-* mv halt to halt-init
-* mv shutdown shutdown-init
-* rm -f reboot poweroff
-* remove sysvinit.install
-
-#add -jm
-'poweroff-scripts' as a depend
diff --git a/abs/core/sysvinit/halt-init.patch b/abs/core/sysvinit/halt_init.patch
index 0885252..4f10932 100644
--- a/abs/core/sysvinit/halt-init.patch
+++ b/abs/core/sysvinit/halt_init.patch
@@ -1,12 +1,11 @@
--- src/halt.c.orig 2010-02-26 13:45:49.000000000 +0000
-+++ src/halt.c 2010-12-02 17:42:51.000000000 +0000
-@@ -198,6 +198,9 @@
++++ src/halt.c 2012-08-07 23:13:06.321378085 +0000
+@@ -197,6 +197,8 @@
+
if (!strcmp(progname, "reboot")) do_reboot = 1;
if (!strcmp(progname, "poweroff")) do_poweroff = 1;
-
+ if (!strcmp(progname, "reboot.init")) do_reboot = 1;
+ if (!strcmp(progname, "poweroff.init")) do_poweroff = 1;
-+
+
/*
* Get flags
- */
diff --git a/abs/core/sysvinit/sysvinit.install b/abs/core/sysvinit/sysvinit.install
new file mode 100644
index 0000000..2f0e62e
--- /dev/null
+++ b/abs/core/sysvinit/sysvinit.install
@@ -0,0 +1,3 @@
+post_upgrade() {
+ [ -x sbin/init ] && sbin/init u
+}