Contents of /mcore-src/trunk/mcore-tools/daemon/client/include/fbsplash.client.class
Parent Directory | Revision Log
Revision 2079 -
(show annotations)
(download)
Fri May 10 11:37:38 2013 UTC (11 years, 4 months ago) by niro
File size: 1682 byte(s)
Fri May 10 11:37:38 2013 UTC (11 years, 4 months ago) by niro
File size: 1682 byte(s)
-split systemd, sysvinit, fbsplash and plymouth functions in single classes so no runtime checks are required and the correct version get installed right away
1 | # $Id$ |
2 | |
3 | provide basic-splash fbsplash |
4 | require basic-boot |
5 | |
6 | get_boot_splash() |
7 | { |
8 | local var |
9 | var=$(grep "^export GRUB_CMDLINE_BOOTSPLASH=" ${MROOT}/etc/conf.d/grub | sed "s:.*splash=\(.*\),.*:\1:") |
10 | |
11 | case "${var}" in |
12 | silent|"") mecho "bootsplash currently enabled"; rvecho "1" ;; |
13 | verbose) mecho "bootsplash currently disabled"; rvecho "0" ;; |
14 | *) eecho "unkown state" ;; |
15 | esac |
16 | } |
17 | |
18 | set_boot_splash() |
19 | { |
20 | local action="$1" |
21 | [[ -z ${action} ]] && help_boot_splash && return 1 |
22 | |
23 | case "${action}" in |
24 | enable) |
25 | sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash=silent,theme=default\":" ${MROOT}/etc/conf.d/grub |
26 | helper_boot_rebuild_bootconfig |
27 | mecho "bootsplash enabled" |
28 | ;; |
29 | disable) |
30 | sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash=verbose,theme=default\":" ${MROOT}/etc/conf.d/grub |
31 | helper_boot_rebuild_bootconfig |
32 | mecho "bootsplash disabled" |
33 | ;; |
34 | *) help_system_autologon && return 1 ;; |
35 | esac |
36 | } |
37 | |
38 | get_boot_theme() |
39 | { |
40 | local action="$1" |
41 | local themedir="${MROOT}/etc/splash/themes" |
42 | local theme |
43 | local i |
44 | |
45 | case "${action}" in |
46 | current) |
47 | if [[ -L ${themedir}/default ]] |
48 | then |
49 | theme=$(readlink ${themedir}/default) |
50 | rvecho "${theme}" |
51 | else |
52 | rvecho "none" |
53 | fi |
54 | ;; |
55 | system) |
56 | list_files_in_directory -type d -mindepth 1 -maxdepth 1 ${themedir} |
57 | ;; |
58 | *) |
59 | help_boot_theme |
60 | return 1 |
61 | ;; |
62 | esac |
63 | } |
64 | |
65 | set_boot_theme() |
66 | { |
67 | local theme="$1" |
68 | local themedir="${MROOT}/etc/splash/themes" |
69 | [[ -z ${theme} ]] && help_boot_theme && return 1 |
70 | |
71 | if [[ -d ${themedir}/${theme} ]] |
72 | then |
73 | ln -snf ${theme} ${themedir}/default |
74 | mecho "Selected theme '${theme}'." |
75 | else |
76 | eecho "Theme '${theme}' not available on this system. Aborted!" |
77 | fi |
78 | } |