home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / initramfs-tools / hooks / plymouth < prev    next >
Encoding:
Text File  |  2012-07-27  |  2.7 KB  |  118 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. PREREQ=""
  6.  
  7. prereqs()
  8. {
  9.     echo "${PREREQ}"
  10. }
  11.  
  12. case "${1}" in
  13.     prereqs)
  14.         prereqs
  15.         exit 0
  16.         ;;
  17. esac
  18.  
  19. . /usr/share/initramfs-tools/hook-functions
  20.  
  21. THEME="$(/usr/sbin/plymouth-set-default-theme || true)"
  22. THEMES="/usr/share/plymouth/themes"
  23.  
  24. if [ -n "${THEME}" ]
  25. then
  26.     THEME="${THEMES}/${THEME}/${THEME}.plymouth"
  27. else
  28.     exit 0
  29. fi
  30.  
  31. PLUGIN_PATH="$(plymouth --get-splash-plugin-path)"
  32.  
  33. case "$(basename ${THEME} .plymouth)" in
  34.     text)
  35.         PLUGINS="details.so text.so"
  36.         ;;
  37.  
  38.     *)
  39.         PLUGINS="details.so text.so label.so"
  40.         ;;
  41. esac
  42.  
  43. MODULE="${PLUGIN_PATH}/$(sed -n 's/^ModuleName=\(.*\)/\1/p' ${THEME}).so"
  44.  
  45. # copy plugin and images for current theme
  46. copy_exec "${MODULE}"
  47. mkdir -p "${DESTDIR}/${THEMES}"
  48. IMAGES="$(sed -n 's/^ImageDir=\(.*\)/\1/p' ${THEME})"
  49. # No images in text mode:
  50. if [ -n "${IMAGES}" ]
  51. then
  52.     cp -r "${IMAGES}" "${DESTDIR}/${THEMES}"
  53. fi
  54.  
  55. # copy binaries and base plugins
  56. copy_exec /bin/plymouth
  57. copy_exec /sbin/plymouthd
  58.  
  59. for PLUGIN in ${PLUGINS}
  60. do
  61.     copy_exec ${PLUGIN_PATH}/${PLUGIN}
  62. done
  63.  
  64. # copy base themes and logo
  65. cp -a "${THEMES}/details" "${DESTDIR}/${THEMES}"
  66. cp -a "${THEMES}/text" "${DESTDIR}/${THEMES}"
  67. cp /etc/debian_version "${DESTDIR}/etc"
  68.  
  69. case "$(basename ${THEME} .plymouth)" in
  70.     text)
  71.  
  72.         ;;
  73.  
  74.     *)
  75.         cp /usr/share/plymouth/debian-logo.png "${DESTDIR}/usr/share/plymouth"
  76.  
  77.         # copy files for font rendering
  78.         mkdir -p "${DESTDIR}/usr/share/fonts/truetype/ttf-dejavu"
  79.         mkdir -p "${DESTDIR}/etc/fonts/conf.d"
  80.         mkdir -p "${DESTDIR}/var/cache/fontconfig"
  81.         cp -a /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf "${DESTDIR}/usr/share/fonts/truetype/ttf-dejavu"
  82.         cp -a /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf  "${DESTDIR}/usr/share/fonts/truetype/ttf-dejavu"
  83.         cp -a /etc/fonts/fonts.conf "${DESTDIR}/etc/fonts"
  84.         cp -rL /etc/fonts/conf.d/60-latin.conf "${DESTDIR}/etc/fonts/conf.d"
  85.         if [ -e /usr/lib/pango/1.6.0/module-files.d/libpango1.0-0.modules ]
  86.         then
  87.             # pre-multiarch fallback
  88.             PANGO_DIR=/usr/lib/pango/1.6.0
  89.         else
  90.             PANGO_DIR=/usr/lib//pango/1.6.0
  91.         fi
  92.         mkdir -p "${DESTDIR}${PANGO_DIR}/module-files.d"
  93.         mkdir -p "${DESTDIR}${PANGO_DIR}/modules"
  94.         cp ${PANGO_DIR}/module-files.d/libpango1.0-0.modules ${DESTDIR}${PANGO_DIR}/module-files.d/
  95.         copy_exec ${PANGO_DIR}/modules/pango-basic-fc.so
  96.  
  97.         # copy renderers
  98.         copy_exec /usr/lib/plymouth/renderers/frame-buffer.so
  99.         copy_exec /usr/lib/plymouth/renderers/drm.so
  100.  
  101.         # add drm/fb modules
  102.         manual_add_modules intel-agp
  103.         manual_add_modules ati-agp
  104.         manual_add_modules i915
  105.         manual_add_modules radeon
  106.         ;;
  107. esac
  108.  
  109. # copy config files
  110. mkdir -p "${DESTDIR}/etc/plymouth"
  111.  
  112. if [ -r /etc/plymouth/plymouthd.conf ]
  113. then
  114.     cp -a /etc/plymouth/plymouthd.conf "${DESTDIR}/etc/plymouth/"
  115. fi
  116.  
  117. cp -a /usr/share/plymouth/plymouthd.defaults "${DESTDIR}/usr/share/plymouth/"
  118.