Annotation of /mcore-src/trunk/mcore-tools/dracut/mcored/module-setup.sh.in
Parent Directory | Revision Log
Revision 2340 -
(hide annotations)
(download)
Mon Jul 14 09:20:43 2014 UTC (9 years, 10 months ago) by niro
File size: 1807 byte(s)
Mon Jul 14 09:20:43 2014 UTC (9 years, 10 months ago) by niro
File size: 1807 byte(s)
-suppress some errors
1 | niro | 2042 | #!/bin/sh |
2 | |||
3 | check() { | ||
4 | local _program | ||
5 | . $dracutfunctions | ||
6 | |||
7 | niro | 2324 | for _program in iwconfig wpa_supplicant localectl \ |
8 | niro | 2114 | chroot systemd-nspawn vncpasswd hostname mcored; do |
9 | niro | 2042 | if ! type -P $_program >/dev/null; then |
10 | niro | 2066 | derror "Could not find program \"$_program\" required by mcored." |
11 | niro | 2042 | return 1 |
12 | fi | ||
13 | done | ||
14 | |||
15 | return 255 | ||
16 | } | ||
17 | |||
18 | depends() { | ||
19 | niro | 2324 | echo busybox systemd network |
20 | niro | 2042 | } |
21 | |||
22 | install() { | ||
23 | local __file | ||
24 | |||
25 | niro | 2338 | # add missing users |
26 | niro | 2340 | if ! egrep '^lp:' "$initdir@@SYSCONFDIR@@/passwd" 2> /dev/null |
27 | niro | 2338 | then |
28 | egrep '^lp:' @@SYSCONFDIR@@/passwd >> "$initdir@@SYSCONFDIR@@/passwd" | ||
29 | fi | ||
30 | niro | 2334 | # add MCORE_UNPRIV_USER |
31 | niro | 2340 | if ! egrep '^@@MCORE_UNPRIV_USER@@:' "$initdir@@SYSCONFDIR@@/passwd" 2> /dev/null |
32 | niro | 2338 | then |
33 | egrep '^@@MCORE_UNPRIV_USER@@:' @@SYSCONFDIR@@/passwd >> "$initdir@@SYSCONFDIR@@/passwd" | ||
34 | fi | ||
35 | niro | 2042 | |
36 | niro | 2338 | # add missing groups |
37 | niro | 2340 | if ! egrep '^lp:' "$initdir@@SYSCONFDIR@@/group" 2> /dev/null |
38 | niro | 2338 | then |
39 | egrep '^lp:' @@SYSCONFDIR@@/group >> "$initdir@@SYSCONFDIR@@/group" | ||
40 | fi | ||
41 | niro | 2340 | if ! egrep '^@@MCORE_UNPRIV_GROUP@@:' "$initdir@@SYSCONFDIR@@/group" 2> /dev/null |
42 | niro | 2338 | then |
43 | egrep '^@@MCORE_UNPRIV_GROUP@@:' @@SYSCONFDIR@@/group >> "$initdir@@SYSCONFDIR@@/group" | ||
44 | fi | ||
45 | |||
46 | niro | 2297 | # other stuff required by mcored |
47 | dracut_install iwconfig wpa_supplicant chroot systemd-nspawn | ||
48 | niro | 2042 | |
49 | niro | 2066 | # mcored config stuff |
50 | niro | 2324 | dracut_install hwinfo vncpasswd localectl |
51 | niro | 2042 | |
52 | # mcored | ||
53 | # install things which are needed but not provided by our busybox | ||
54 | dracut_install find install sslsvd touch | ||
55 | niro | 2239 | inst @@SYSCONFDIR@@/mageversion |
56 | inst @@SSLDIR@@/certs/mcored.pem | ||
57 | inst @@SSLDIR@@/private/mcored.key | ||
58 | inst_dir @@MCORE_CHROOTDIR@@ | ||
59 | inst @@CONFDDIR@@/mcored | ||
60 | inst @@SYSCONFDIR@@/mcoredpasswd | ||
61 | niro | 2324 | for __file in $(find @@SYSCONFDIR@@/mcore @@MCORE_LIBDIR@@ -type f) |
62 | niro | 2042 | do |
63 | niro | 2080 | inst ${__file} |
64 | niro | 2042 | done |
65 | niro | 2239 | inst_symlink @@SBINDIR@@/mcored |
66 | inst_symlink @@SBINDIR@@/mcorepasswd | ||
67 | niro | 2042 | |
68 | inst_hook pre-pivot 90 "$moddir"/run-mcored.sh | ||
69 | } |