Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/daemon/client/include/boot.client.class

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2073 by niro, Mon Aug 13 11:15:18 2012 UTC revision 2074 by niro, Fri May 10 10:44:38 2013 UTC
# Line 23  help_boot_splash() Line 23  help_boot_splash()
23   mecho "      disable - disables bootsplash"   mecho "      disable - disables bootsplash"
24  }  }
25    
26  get_boot_splash()  helper_get_boot_splash_plymouth()
27    {
28     if grep "^export GRUB_CMDLINE_BOOTSPLASH=.*splash" /etc/conf.d/grub
29     then
30     mecho "bootsplash currently enabled"
31     rvecho "1"
32     else
33     mecho "bootsplash currently disabled"
34     rvecho "0"
35     fi
36    }
37    
38    helper_get_boot_splash_fbsplash()
39  {  {
40   local var   local var
41   var=$(grep "^export GRUB_CMDLINE_BOOTSPLASH=" /etc/conf.d/grub | sed "s:.*splash=\(.*\),.*:\1:")   var=$(grep "^export GRUB_CMDLINE_BOOTSPLASH=" /etc/conf.d/grub | sed "s:.*splash=\(.*\),.*:\1:")
# Line 35  get_boot_splash() Line 47  get_boot_splash()
47   esac   esac
48  }  }
49    
50  set_boot_splash()  get_boot_splash()
51    {
52     if [ -x $(type -P plymouth-set-default-theme) ]
53     then
54     helper_get_boot_splash_plymouth $*
55     else
56     helper_get_boot_splash_fbsplash $*
57     fi
58    }
59    
60    helper_set_boot_splash_plymouth()
61    {
62     local action="$1"
63     [[ -z ${action} ]] && help_boot_splash && return 1
64    
65     case "${action}" in
66     enable)
67     sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash\":" /etc/conf.d/grub
68     helper_boot_rebuild_bootconfig
69     mecho "bootsplash enabled"
70     ;;
71     disable)
72     sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"rd.plymouth=0\":" /etc/conf.d/grub
73     helper_boot_rebuild_bootconfig
74     mecho "bootsplash disabled"
75     ;;
76     *) help_system_autologon && return 1 ;;
77     esac
78    }
79    
80    helper_set_boot_splash_fbsplash()
81  {  {
82   local action="$1"   local action="$1"
83   [[ -z ${action} ]] && help_boot_splash && return 1   [[ -z ${action} ]] && help_boot_splash && return 1
# Line 55  set_boot_splash() Line 97  set_boot_splash()
97   esac   esac
98  }  }
99    
100    set_boot_splash()
101    {
102     if [ -x $(type -P plymouthd) ]
103     then
104     helper_set_boot_splash_plymouth $*
105     else
106     helper_set_boot_splash_fbsplash $*
107     fi
108    }
109    
110  help_boot_theme()  help_boot_theme()
111  {  {
112   mecho "get boot.theme [action]"   mecho "get boot.theme [action]"
# Line 67  help_boot_theme() Line 119  help_boot_theme()
119   mecho " Selects the theme which will be used on system startup by bootsplash."   mecho " Selects the theme which will be used on system startup by bootsplash."
120  }  }
121    
122  get_boot_theme()  helper_get_boot_theme_plymouth()
123    {
124     local action="$1"
125     local i
126    
127     case "${action}" in
128     current) rvecho "$(plymouth-set-default-theme)" ;;
129     system)
130     for i in $(plymouth-set-default-theme --list)
131     do
132     rvecho "${i}"
133     done
134     ;;
135     *)
136     help_boot_theme
137     return 1
138     ;;
139     esac
140    }
141    
142    helper_get_boot_theme_fbsplash()
143  {  {
144   local action="$1"   local action="$1"
145   local themedir="/etc/splash/themes"   local themedir="/etc/splash/themes"
# Line 94  get_boot_theme() Line 166  get_boot_theme()
166   esac   esac
167  }  }
168    
169  set_boot_theme()  get_boot_theme()
170    {
171     if [ -x $(type -P plymouth-set-default-theme) ]
172     then
173     helper_get_boot_theme_plymouth $*
174     else
175     helper_get_boot_theme_fbsplash $*
176     fi
177    }
178    
179    helper_set_boot_theme_plymouth()
180    {
181     local theme="$1"
182     local themedir="/usr/share/plymouth/themes"
183     [[ -z ${theme} ]] && help_boot_theme && return 1
184    
185     if [[ -d ${themedir}/${theme} ]]
186     then
187     plymouth-set-default-theme ${theme}
188     mecho "Selected theme '${theme}'."
189     else
190     eecho "Theme '${theme}' not available on this system. Aborted!"
191     fi
192    }
193    
194    helper_set_boot_theme_fbsplash()
195  {  {
196   local theme="$1"   local theme="$1"
197   local themedir="/etc/splash/themes"   local themedir="/etc/splash/themes"
# Line 108  set_boot_theme() Line 205  set_boot_theme()
205   eecho "Theme '${theme}' not available on this system. Aborted!"   eecho "Theme '${theme}' not available on this system. Aborted!"
206   fi   fi
207  }  }
208    
209    set_boot_theme()
210    {
211     if [ -x $(plymouth-set-default-theme) ]
212     then
213     helper_set_boot_theme_plymouth $*
214     else
215     helper_set_boot_theme_fbsplash $*
216     fi
217    }

Legend:
Removed from v.2073  
changed lines
  Added in v.2074