Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/src/modules/plymouth/plymouth.client.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2552 - (show annotations) (download)
Wed Sep 16 13:41:42 2015 UTC (8 years, 7 months ago) by niro
File size: 1859 byte(s)
-do not rebuild grub config on live-media or netboot systems
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}@@CONFDDIR@@/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="${CLASS_ARGV[0]}"
21 [[ -z ${action} ]] && help_boot_splash && return 1
22
23 # do not allow this on livecd or netboot systems
24 if [ -e /dev/mapper/live-rw ]
25 then
26 eecho "This function is not allowed on live-media or netboot systems."
27 return 1
28 fi
29
30 case "${action}" in
31 enable)
32 sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash\":" ${MROOT}@@CONFDDIR@@/grub
33 helper_boot_rebuild_bootconfig
34 mecho "bootsplash enabled"
35 ;;
36 disable)
37 sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"rd.plymouth=0\":" ${MROOT}@@CONFDDIR@@/grub
38 helper_boot_rebuild_bootconfig
39 mecho "bootsplash disabled"
40 ;;
41 *) help_system_autologon && return 1 ;;
42 esac
43 }
44
45 get_boot_theme()
46 {
47 local action="${CLASS_ARGV[0]}"
48 local i
49
50 local chrooted
51 if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]
52 then
53 chrooted="system_chroot"
54 fi
55
56 case "${action}" in
57 current) rvecho "$(${chrooted} plymouth-set-default-theme)" ;;
58 system)
59 for i in $(${chrooted} plymouth-set-default-theme --list)
60 do
61 rvecho "${i}"
62 done
63 ;;
64 *)
65 help_boot_theme
66 return 1
67 ;;
68 esac
69 }
70
71 set_boot_theme()
72 {
73 local theme="${CLASS_ARGV[0]}"
74 local themedir="${MROOT}@@DATADIR@@/plymouth/themes"
75 [[ -z ${theme} ]] && help_boot_theme && return 1
76
77 local chrooted
78 if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]
79 then
80 chrooted="system_chroot"
81 fi
82
83 if [[ -d ${themedir}/${theme} ]]
84 then
85 ${chrooted} plymouth-set-default-theme ${theme}
86 mecho "Selected theme '${theme}'."
87 else
88 eecho "Theme '${theme}' not available on this system. Aborted!"
89 fi
90 }