Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 492c65a32a4ae44c34580ed8ac5d3f50a155cfef Mon Sep 17 00:00:00 2001 |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 2 | From: Martin Jansa <Martin.Jansa@gmail.com> |
| 3 | Date: Wed, 11 Apr 2012 14:36:02 +0200 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 4 | Subject: [PATCH] use own functions file instead /etc/init.d/functions |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 5 | |
| 6 | * so we don't have to depend on initscripts |
| 7 | |
| 8 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 9 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 10 | --- |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 11 | Makefile | 1 + |
| 12 | X11/Xinit.d/11zaurus | 2 +- |
| 13 | X11/Xinit.d/12keymap | 2 +- |
| 14 | X11/functions | 11 +++++++++++ |
| 15 | X11/xserver-common | 2 +- |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 16 | 5 files changed, 15 insertions(+), 3 deletions(-) |
| 17 | create mode 100644 X11/functions |
| 18 | |
| 19 | diff --git a/Makefile b/Makefile |
| 20 | index e2d9af9..caa5de1 100644 |
| 21 | --- a/Makefile |
| 22 | +++ b/Makefile |
| 23 | @@ -23,6 +23,7 @@ install-program: |
| 24 | install -m 755 X11/Xserver $(DESTDIR)/etc/X11/Xserver |
| 25 | install -m 755 X11/Xsession $(DESTDIR)/etc/X11/Xsession |
| 26 | install -m 755 X11/xserver-common $(DESTDIR)/etc/X11/xserver-common |
| 27 | + install -m 755 X11/functions $(DESTDIR)/etc/X11/functions |
| 28 | install -d $(DESTDIR)/etc/X11/xmodmap |
| 29 | install -m 644 X11/xmodmap/*.xmodmap $(DESTDIR)/etc/X11/xmodmap |
| 30 | install -m 644 X11/xmodmap/xmodmap-* $(DESTDIR)/etc/X11/xmodmap |
| 31 | diff --git a/X11/Xinit.d/11zaurus b/X11/Xinit.d/11zaurus |
| 32 | index 54ea6f5..23e7713 100644 |
| 33 | --- a/X11/Xinit.d/11zaurus |
| 34 | +++ b/X11/Xinit.d/11zaurus |
| 35 | @@ -8,7 +8,7 @@ else |
| 36 | CHCK=chkhinge |
| 37 | fi |
| 38 | |
| 39 | -. /etc/init.d/functions |
| 40 | +. /etc/X11/functions |
| 41 | |
| 42 | $CHCK -e |
| 43 | if [ $? = 12 ]; then |
| 44 | diff --git a/X11/Xinit.d/12keymap b/X11/Xinit.d/12keymap |
| 45 | index 7eac296..b7a7f2d 100644 |
| 46 | --- a/X11/Xinit.d/12keymap |
| 47 | +++ b/X11/Xinit.d/12keymap |
| 48 | @@ -1,6 +1,6 @@ |
| 49 | #!/bin/sh |
| 50 | |
| 51 | -. /etc/init.d/functions |
| 52 | +. /etc/X11/functions |
| 53 | |
| 54 | # since kdrive 1.4 there is no default keymap in server |
| 55 | xmodmap - </etc/X11/xmodmap/default.xmodmap |
| 56 | diff --git a/X11/functions b/X11/functions |
| 57 | new file mode 100644 |
| 58 | index 0000000..a1311ad |
| 59 | --- /dev/null |
| 60 | +++ b/X11/functions |
| 61 | @@ -0,0 +1,11 @@ |
| 62 | +# -*-Shell-script-*- |
| 63 | +# |
| 64 | +# functions This file contains functions shared by few X11 scripts |
| 65 | +# machine_id also exists in /etc/init.d/functions but some |
| 66 | +# people don't use initscripts anymore |
| 67 | +# |
| 68 | + |
| 69 | +machine_id() { # return the machine ID |
| 70 | + awk 'BEGIN { FS=": " } /Hardware/ \ |
| 71 | + { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo |
| 72 | +} |
| 73 | diff --git a/X11/xserver-common b/X11/xserver-common |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 74 | index bb7c2ff..d622f2a 100644 |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 75 | --- a/X11/xserver-common |
| 76 | +++ b/X11/xserver-common |
| 77 | @@ -30,7 +30,7 @@ if [ -f /etc/profile ]; then |
| 78 | . /etc/profile |
| 79 | fi |
| 80 | |
| 81 | -. /etc/init.d/functions |
| 82 | +. /etc/X11/functions |
| 83 | |
| 84 | fallback_screen_arg() { |
| 85 | geom=`fbset | grep geometry` |