pinstall.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/sh
  2. #post-install script.
  3. #Puppy Linux
  4. #assume current directory is rootfs-complete, which has the final filesystem.
  5. #this script is similar to the post-install scripts of the window managers.
  6. #Keywords are located in the Help page and the lines uncommented.
  7. #DISTRO_VERSION, DISTRO_NAME are global variables visible here.
  8. #110422 DISTRO_VERSION variable now has dotted format. note, also now using full dotted version# in puppy filenames.
  9. #120225 create symlink release-notes.htm to actual release-notes file. NO.
  10. #120225 backup doc files, refer /usr/sbin/indexgen.sh.
  11. #120818 now have /etc/xdg in Woof, taken out of xdg_puppy PET, relocated pinstall.sh to here.
  12. WKGDIR="`pwd`"
  13. echo "Configuring Puppy skeleton..."
  14. #cleanup...
  15. rm -f /tmp/fbvideomode.txt
  16. echo "Configuring Puppy Help page..."
  17. #refer /usr/sbin/indexgen.sh...
  18. cp -f usr/share/doc/index.html.top usr/share/doc/index.html.top-raw #120225
  19. cp -f usr/share/doc/index.html.bottom usr/share/doc/index.html.bottom-raw #120225
  20. cp -f usr/share/doc/home.htm usr/share/doc/home-raw.htm #120225
  21. cutDISTRONAME="`echo -n "$DISTRO_NAME" | cut -f 1 -d ' '`"
  22. cPATTERN="s/cutDISTRONAME/${cutDISTRONAME}/g"
  23. RIGHTVER="$DISTRO_VERSION"
  24. PUPPYDATE="`date | tr -s " " | cut -f 2,6 -d " "`"
  25. dPATTERN="s/PUPPYDATE/${PUPPYDATE}/g"
  26. echo "Writing version number and distro name and date to Help page..."
  27. PATTERN1="s/RIGHTVER/${RIGHTVER}/g"
  28. PATTERN2="s/DISTRO_VERSION/${DISTRO_VERSION}/g"
  29. nPATTERN="s/DISTRO_NAME/${DISTRO_NAME}/g"
  30. sed -i -e "$PATTERN1" -e "$PATTERN2" -e "$nPATTERN" -e "$dPATTERN" -e "$cPATTERN" usr/share/doc/index.html.top
  31. sed -i -e "$PATTERN1" -e "$PATTERN2" -e "$nPATTERN" -e "$dPATTERN" usr/share/doc/index.html.bottom
  32. #...note, /usr/sbin/indexgen.sh puts these together as index.html (via rc.update and 3builddistro).
  33. echo "Writing distro name to jumping-off page..."
  34. sed -i -e "$nPATTERN" usr/share/doc/home.htm
  35. echo "Creating base release notes..."
  36. if [ ! -e usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm ];then
  37. mv -f usr/share/doc/release-skeleton.htm usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm
  38. sed -i -e "$PATTERN1" -e "$PATTERN2" -e "$nPATTERN" -e "$dPATTERN" usr/share/doc/release-${cutDISTRONAME}-${DISTRO_VERSION}.htm
  39. #else
  40. # rm -f usr/share/doc/release-skeleton.htm
  41. fi
  42. if [ ! -e usr/share/doc/release-${cutDISTRONAME}-${RIGHTVER}.htm ];then
  43. ln -s release-${cutDISTRONAME}-${DISTRO_VERSION}.htm usr/share/doc/release-${cutDISTRONAME}-${RIGHTVER}.htm
  44. fi
  45. #ln -snf release-${cutDISTRONAME}-${DISTRO_VERSION}.htm usr/share/doc/release-notes.htm #120225
  46. #echo "The default kernel for Puppy is vmlinuz."
  47. echo -n "vmlinuz" > /tmp/vmlinuzforpup.txt
  48. #note, createpuppy will read this.
  49. #120818 now have /etc/xdg in Woof, taken out of xdg_puppy PET, relocated pinstall.sh to here...
  50. #this code is to fix the icewm menu...
  51. if [ "`find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name evilwm`" = "" ];then
  52. grep -v ' evilwm$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu
  53. mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/
  54. fi
  55. if [ "`find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name fluxbox`" = "" ];then
  56. grep -v ' fluxbox$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu
  57. mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/
  58. fi
  59. if [ "`find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name fvwm95`" = "" ];then
  60. grep -v ' fvwm95$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu
  61. mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/
  62. fi
  63. if [ "`find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name jwm`" = "" ];then
  64. grep -v ' jwm$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu
  65. mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/
  66. fi
  67. if [ "`find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name pwm`" = "" ];then
  68. grep -v ' pwm$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu
  69. mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/
  70. fi
  71. if [ "`find ./usr/local/bin ./usr/bin ./usr/sbin ./usr/X11R7/bin -maxdepth 1 -type f -name xfce4-session`" = "" ];then
  72. grep -v ' xfce4-session$' ./etc/xdg/templates/_root_.icewm_menu > /tmp/_root_.icewm_menu
  73. mv -f /tmp/_root_.icewm_menu ./etc/xdg/templates/
  74. fi
  75. #end#