mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.5 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/avm/bootsplash/stone_mod_bootsplash.sh
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. #
  23. # [MAIN] 80 bootsplash BOOTSPLASH theme activation
  24. SPLASH="/sbin/splash"
  25. INITRD="/boot/initrd.img"
  26. select_theme(){
  27. cmd="gui_menu 'select_theme' 'Select one of the following theme'"
  28. cmd="$cmd $( find /etc/bootsplash/themes/*/config -type d | \
  29. sed -re 's,^.*/themes/(.*)/config.*$,"\1" "BOOTSPLASH_THEME=\1",' | \
  30. sort | tr '\n' ' ')"
  31. eval "$cmd"
  32. write_bsconfig
  33. }
  34. select_cfgfile(){
  35. cmd="gui_menu 'select_cfgfile'"
  36. cmd="$cmd 'Select one of the config file for the $BOOTSPLASH_THEME theme'"
  37. cmd="$cmd $( find /etc/bootsplash/themes/$BOOTSPLASH_THEME/config -type f| \
  38. sed -re 's,^.*config/(.*),"\1" "BOOTSPLASH_CFGFILE=\"\1\"",' | sort | tr '\n' ' ')"
  39. eval "$cmd"
  40. write_bsconfig
  41. }
  42. write_bsconfig(){
  43. cat << EOC > /etc/bootsplash/config
  44. BOOTSPLASH_THEME="$BOOTSPLASH_THEME"
  45. BOOTSPLASH_CFGFILE="$BOOTSPLASH_CFGFILE"
  46. EOC
  47. }
  48. main() {
  49. while
  50. BOOTSPLASH_THEME="Linux"
  51. BOOTSPLASH_CFGFILE="bootsplash-1024x768.cfg"
  52. if [ -f /etc/bootsplash/config ]; then
  53. . /etc/bootsplash/config
  54. fi
  55. gui_menu bootsplash 'Bootsplash Setup' \
  56. "Bootsplash Theme ......... $BOOTSPLASH_THEME" 'select_theme' \
  57. "Bootsplash Config File ... $BOOTSPLASH_CFGFILE" 'select_cfgfile' \
  58. "" "" \
  59. 'Append Bootsplash Image to initrd' \
  60. 'gui_cmd "Appending Bootsplash Image 1024x68 to initrd" \
  61. "$SPLASH -s -f /etc/bootsplash/themes/$BOOTSPLASH_THEME/config/$BOOTSPLASH_CFGFILE >> $INITRD"'
  62. do : ; done
  63. }