Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2552 - (hide annotations) (download)
Wed Sep 16 13:41:42 2015 UTC (8 years, 8 months ago) by niro
File size: 1859 byte(s)
-do not rebuild grub config on live-media or netboot systems
1 niro 2079 # $Id$
2    
3     provide basic-splash plymouthd
4     require basic-boot
5    
6     get_boot_splash()
7     {
8 niro 2158 if grep "^export GRUB_CMDLINE_BOOTSPLASH=.*splash" ${MROOT}@@CONFDDIR@@/grub
9 niro 2079 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 niro 2269 local action="${CLASS_ARGV[0]}"
21 niro 2079 [[ -z ${action} ]] && help_boot_splash && return 1
22    
23 niro 2552 # 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 niro 2079 case "${action}" in
31     enable)
32 niro 2158 sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash\":" ${MROOT}@@CONFDDIR@@/grub
33 niro 2079 helper_boot_rebuild_bootconfig
34     mecho "bootsplash enabled"
35     ;;
36     disable)
37 niro 2158 sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"rd.plymouth=0\":" ${MROOT}@@CONFDDIR@@/grub
38 niro 2079 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 niro 2269 local action="${CLASS_ARGV[0]}"
48 niro 2079 local i
49    
50 niro 2086 local chrooted
51     if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]
52     then
53     chrooted="system_chroot"
54     fi
55    
56 niro 2079 case "${action}" in
57 niro 2086 current) rvecho "$(${chrooted} plymouth-set-default-theme)" ;;
58 niro 2159 system)
59 niro 2086 for i in $(${chrooted} plymouth-set-default-theme --list)
60 niro 2079 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 niro 2269 local theme="${CLASS_ARGV[0]}"
74 niro 2158 local themedir="${MROOT}@@DATADIR@@/plymouth/themes"
75 niro 2079 [[ -z ${theme} ]] && help_boot_theme && return 1
76    
77 niro 2086 local chrooted
78     if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]
79     then
80     chrooted="system_chroot"
81     fi
82    
83 niro 2079 if [[ -d ${themedir}/${theme} ]]
84     then
85 niro 2086 ${chrooted} plymouth-set-default-theme ${theme}
86 niro 2079 mecho "Selected theme '${theme}'."
87     else
88     eecho "Theme '${theme}' not available on this system. Aborted!"
89     fi
90     }