PostInstall 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # This file is part of the 'dragora-installer'.
  2. #
  3. # Purpose: Steps after installing Dragora.
  4. echo ""
  5. echo "-> Running post-install instructions from the installer ..."
  6. # Copy local config files to the system partition
  7. # Cover keyboard map if it has been changed, previously
  8. if test -e /etc/rc.conf
  9. then
  10. # Assume the local config (from the livecd) has been changed
  11. if ! grep -F -m 1 -q 'RC_KEYMAP=qwerty/us' /etc/rc.conf
  12. then
  13. # Make backup of existent rc.conf at /media/dragora-root/etc
  14. if test -e /media/dragora-root/etc/rc.conf
  15. then
  16. cp -p /media/dragora-root/etc/rc.conf \
  17. /media/dragora-root/etc/rc.conf.bak || true
  18. fi
  19. cp -f /etc/rc.conf /media/dragora-root/etc/ || true
  20. fi
  21. fi
  22. # Copy GPM run control file
  23. if test -e /etc/rc.d/rc.gpm && test ! -e /media/dragora-root/etc/rc.d/rc.gpm
  24. then
  25. cp -f /etc/rc.d/rc.gpm /media/dragora-root/etc/rc.d/rc.gpm && \
  26. chmod 755 /media/dragora-root/etc/rc.d/rc.gpm || true
  27. fi
  28. # Create index of scalable font files for X
  29. echo ""
  30. echo "* Creating index of scalable font files for X, if possible ..."
  31. if test -d /media/dragora-root/usr/share/fonts
  32. then
  33. for directory in /media/dragora-root/usr/share/fonts/X11/*
  34. do
  35. test -d "$directory" || continue
  36. directory="$(echo "$directory" | sed -e 's|^/media/dragora-root||')"
  37. chroot /media/dragora-root /usr/bin/mkfontscale -b -s -l "$directory" || true
  38. chroot /media/dragora-root /usr/bin/mkfontscale "$directory" || true
  39. done
  40. unset -v directory
  41. # Build font information cache files
  42. echo ""
  43. echo "* Building font information cache files ..."
  44. chroot /media/dragora-root /usr/bin/fc-cache -f --system-only || true
  45. else
  46. echo " /usr/share/fonts does not exist at /media/dragora-root/" 1>&2
  47. fi
  48. echo ""
  49. echo "* Updating index for the GNU Info document system, if possible ..."
  50. chroot /media/dragora-root \
  51. /usr/bin/find -L /usr/share/info -maxdepth 1 ! -name dir \
  52. -exec /usr/bin/install-info '{}' /usr/share/info/dir \; || true
  53. echo ""
  54. echo "* Updating database of manual pages, if possible ..."
  55. mkdir -p /media/dragora-root/var/cache/man && \
  56. chroot /media/dragora-root /usr/bin/mandb --quiet 2> /dev/null || true
  57. # Delete "lost+found" directory on recent file system creation
  58. rmdir /media/dragora-root/lost+found 2> /dev/null || true