blob: 94a35407af2d085338a5dfadca37522f587b2663 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 492c65a32a4ae44c34580ed8ac5d3f50a155cfef Mon Sep 17 00:00:00 2001
Patrick Williamsb48b7b42016-08-17 15:04:38 -05002From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Wed, 11 Apr 2012 14:36:02 +0200
Brad Bishop316dfdd2018-06-25 12:45:53 -04004Subject: [PATCH] use own functions file instead /etc/init.d/functions
Patrick Williamsb48b7b42016-08-17 15:04:38 -05005
6* so we don't have to depend on initscripts
7
8Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Brad Bishop316dfdd2018-06-25 12:45:53 -04009
Patrick Williamsb48b7b42016-08-17 15:04:38 -050010---
Brad Bishop316dfdd2018-06-25 12:45:53 -040011 Makefile | 1 +
12 X11/Xinit.d/11zaurus | 2 +-
13 X11/Xinit.d/12keymap | 2 +-
14 X11/functions | 11 +++++++++++
15 X11/xserver-common | 2 +-
Patrick Williamsb48b7b42016-08-17 15:04:38 -050016 5 files changed, 15 insertions(+), 3 deletions(-)
17 create mode 100644 X11/functions
18
19diff --git a/Makefile b/Makefile
20index 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
31diff --git a/X11/Xinit.d/11zaurus b/X11/Xinit.d/11zaurus
32index 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
44diff --git a/X11/Xinit.d/12keymap b/X11/Xinit.d/12keymap
45index 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
56diff --git a/X11/functions b/X11/functions
57new file mode 100644
58index 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+}
73diff --git a/X11/xserver-common b/X11/xserver-common
Brad Bishop316dfdd2018-06-25 12:45:53 -040074index bb7c2ff..d622f2a 100644
Patrick Williamsb48b7b42016-08-17 15:04:38 -050075--- 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`