Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/daemon/client/include/plymouth.client.class

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2086 - (show annotations) (download)
Fri May 10 13:16:45 2013 UTC (10 years, 11 months ago) by niro
File size: 1638 byte(s)
-honor $MROOT variable
1 # $Id$
2
3 provide basic-splash plymouthd
4 require basic-boot
5
6 get_boot_splash()
7 {
8 if grep "^export GRUB_CMDLINE_BOOTSPLASH=.*splash" ${MROOT}/etc/conf.d/grub
9 then
10 mecho "bootsplash currently enabled"
11 rvecho "1"
12 else
13 mecho "bootsplash currently disabled"
14 rvecho "0"
15 fi
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\":" ${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\"rd.plymouth=0\":" ${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 i
42
43 local chrooted
44 if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]
45 then
46 chrooted="system_chroot"
47 fi
48
49 case "${action}" in
50 current) rvecho "$(${chrooted} plymouth-set-default-theme)" ;;
51 system)
52 for i in $(${chrooted} plymouth-set-default-theme --list)
53 do
54 rvecho "${i}"
55 done
56 ;;
57 *)
58 help_boot_theme
59 return 1
60 ;;
61 esac
62 }
63
64 set_boot_theme()
65 {
66 local theme="$1"
67 local themedir="${MROOT}/usr/share/plymouth/themes"
68 [[ -z ${theme} ]] && help_boot_theme && return 1
69
70 local chrooted
71 if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]
72 then
73 chrooted="system_chroot"
74 fi
75
76 if [[ -d ${themedir}/${theme} ]]
77 then
78 ${chrooted} plymouth-set-default-theme ${theme}
79 mecho "Selected theme '${theme}'."
80 else
81 eecho "Theme '${theme}' not available on this system. Aborted!"
82 fi
83 }