rc.update 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. #!/bin/sh
  2. #LGPL Barry Kauler 2006,2007 www.puppylinux.com
  3. #v555 pup files renamed to woofr555.sfs, woofsave.2fs.
  4. #w001 /etc/networkmodules generated (previously done in createpuppy, Unleashed).
  5. #w002 run gtk-update-icon-cache on hicolor icons.
  6. #w002 run icon_switcher_cli for default desktop icon set JQ8flat.
  7. #w007 if sfs layer with extra modules added or removed, need to run depmod.
  8. #w012 updated for new standardised pkg database format.
  9. #w020 april2009: fix for add/remove zdrv (modules) sfs.
  10. #w464 tidyup, make sure /etc/puppyversion is history.
  11. #w474 updatenetmoduleslist.sh called when zdrv loaded or unloaded.
  12. #w477 /etc/desktop_icon_theme has default desktop icon set.
  13. #v423 fix for PUPMODE=2, full hd installation.
  14. #100425 generate woof-tree-official.png from svg.
  15. #100913 new puppy filenames.
  16. #101020 no longer using modprobe.conf.
  17. #101228 01micko: bug fix.
  18. #110119 giving this script an overhaul.
  19. #110122 make sure all woof scripts are updated.
  20. #110204 LANG in /etc/profile got overwritten.
  21. #110422 DISTRO_VERSION variable now has dotted format. note, also now using full dotted version# in puppy filenames.
  22. #110622 mageia1 note, pixbuf cache.
  23. #110722 updated lists of woof scripts that must be updated.
  24. #110722 get rid of stray modules.* files, may occur when mix usage of the two depmods.
  25. #110826 do not call icon_switcher_cli at all.
  26. #111009 try fix upgrading old wary save-file.
  27. #111027 maybe need to fix permissions on /tmp and /var.
  28. #111123 first-boot fix if did cross-build in Woof.
  29. #120209 append LANG when call fixmenus. also run fixdesk, fixscripts
  30. #120225 fix non-english PuppyPin when layers change.
  31. #120323 shinobar: need some more operations when aufs layers change.
  32. #120505 PUPMODE==2, need to consider situation of a full-hd install that is not pre-setup.
  33. #120522 ubuntu precise puppy must have the schemas compiled (otherwise seamonkey crashed) (normally done in 3builddistro).
  34. #120523 precise puppy, may also need to run gio-querymodules. (refer also installpkg.sh, 3builddistro)
  35. #120605 shinobar: need to run gtk-query-immodules-2.0 at first start.
  36. #130203 change probedisk2 to probedisk.
  37. #130217 depmod_func() created, to ensure deletion of modules.* files.
  38. #130418 support kmod (see also rc.sysinit, 3builddistro).
  39. #This script is called by /etc/rc.d/rc.sysinit. the purpose is to perform
  40. #any required updates to files when a new version of Puppy is booted.
  41. #this script can also be called by /usr/sbin/puppyinstaller, when doing a full install
  42. #(option2) to hard drive. in that case, chroot to hd partition, and the ${DISTRO_PUPPYSFS}
  43. #source files are mounted on /srcmntpt in the hd partition.
  44. #puppyinstaller will call here with PUPMODE="option2hdinstall"
  45. PUPMODE="$1"
  46. KERNVER="`uname -r`"
  47. [ -z $DISPLAY ] || XSTATUS="yes" #v3.99
  48. [ "$PUPMODE" = "" ] && exit
  49. depmod_func() { #130217 extracted as a function.
  50. #then run depmod to overwrite any depmod files on OLD layer...
  51. echo "Executing depmod, to update module files..."
  52. if which kmod;then #130418
  53. depmod #this is a symlink to kmod.
  54. else
  55. #110722 get rid of stray modules.* files, may occur when mix usage of the two depmods...
  56. mkdir -p /tmp/rc_update_dump
  57. mv -f /lib/modules/${KERNVER}/modules.* /tmp/rc_update_dump
  58. [ -f /tmp/rc_update_dump/modules.builtin ] && mv -f /tmp/rc_update_dump/modules.builtin /lib/modules/${KERNVER}/
  59. [ -f /tmp/rc_update_dump/modules.order ] && mv -f /tmp/rc_update_dump/modules.order /lib/modules/${KERNVER}/
  60. rm -f /tmp/rc_update_dump/modules.*
  61. if [ "`busybox | grep 'depmod'`" != "" ];then
  62. busybox depmod #use busybox depmod if available.
  63. else
  64. depmod
  65. fi
  66. fi
  67. }
  68. case $PUPMODE in
  69. "7") #tmpfs (pup_rw), hd for persistent storage (pup_ro1), ${DISTRO_PUPPYSFS} (pup_ro2).
  70. NEWFILESMNTPT="/initrd/pup_ro2"
  71. OLDFILESMNTPT="/initrd/pup_ro1"
  72. ;;
  73. "6") #no tmpfs, PDEV1 (pup_rw), ${DISTRO_PUPPYSFS} (pup_ro2)
  74. #have booted from PDEV1 partition, which has initrd.gz & ${DISTRO_PUPPYSFS} files on it, and
  75. #session has been saved direct to the partition. (very similar to mode 12)
  76. NEWFILESMNTPT="/initrd/pup_ro2"
  77. OLDFILESMNTPT="/initrd/pup_rw"
  78. ;;
  79. "12") #no tmpfs, ${DISTRO_FILE_PREFIX}save.3fs (pup_rw), nothing (pup_ro1), ${DISTRO_PUPPYSFS} (pup_ro2)
  80. #example: boot from live-cd, ${DISTRO_FILE_PREFIX}save.3fs on a fast h.d. partition.
  81. NEWFILESMNTPT="/initrd/pup_ro2"
  82. OLDFILESMNTPT="/initrd/pup_rw"
  83. ;;
  84. "13") #tmpfs (pup_rw), ${DISTRO_FILE_PREFIX}save.3fs (pup_ro1), ${DISTRO_PUPPYSFS} (pup_ro2).
  85. #example: boot from usb flash, ${DISTRO_FILE_PREFIX}save.3fs on flash media (needs restrained writes).
  86. NEWFILESMNTPT="/initrd/pup_ro2"
  87. OLDFILESMNTPT="/initrd/pup_ro1"
  88. ;;
  89. "77") #tmpfs (pup_rw), folders (pup_ro1), ${DISTRO_PUPPYSFS} (pup_ro2).
  90. #example: boot from multisession live-cd/dvd, pup_ro1 is a tmpfs folders copied from cd.
  91. NEWFILESMNTPT="/initrd/pup_ro2"
  92. OLDFILESMNTPT="/initrd/pup_ro1"
  93. ;;
  94. "option2hdinstall")
  95. NEWFILESMNTPT="/srcmntpt"
  96. OLDFILESMNTPT=""
  97. ;;
  98. 5) #v423
  99. #PUPMODE=5 is first boot, ignore.
  100. if [ -f /etc/rc.d/WOOFMERGEVARS ];then #111123 inserted by 3builddistro.
  101. . /etc/rc.d/WOOFMERGEVARS
  102. if [ "$WOOF_HOSTARCH" != "$WOOF_TARGETARCH" ];then #woof did a cross-build
  103. echo -n " cross-build-fix" >/dev/console
  104. #these are normally done in 3builddistro.
  105. ldconfig #ldconfig put in by 3builddistro. rebuild /etc/ld.so.cache
  106. /usr/sbin/indexgen.sh #create master help index.
  107. /usr/sbin/fixmenus #Reconstruct configuration files for JWM, Fvwm95, IceWM. 120323 note: fixmenus corrects $LANG.
  108. /usr/bin/fc-cache -s -v #fontconfig cache
  109. ARCH=`uname -m`
  110. case $ARCH in
  111. i?86)[ -f /usr/lib/gconv/gconv-modules.cache ] || /usr/sbin/iconvconfig
  112. #120523 this too...
  113. [ -d /usr/lib/gio/modules ] && [ -e /usr/bin/gio-querymodules ] && /usr/bin/gio-querymodules /usr/lib/gio/modules;;
  114. x86_64)[ -f /usr/lib64/gconv/gconv-modules.cache ] || /usr/sbin/iconvconfig
  115. [ -d /usr/lib64/gio/modules ] && [ -e /usr/bin/gio-querymodules ] && /usr/bin/gio-querymodules /usr/lib64/gio/modules;;
  116. esac
  117. PANGOMODULES="`find /etc/pango -type f -name pango.modules`"
  118. [ "$PANGOMODULES" = "" ] && PANGOMODULES='/etc/pango/pango.modules'
  119. [ ! -s ${PANGOMODULES} ] && pango-querymodules > ${PANGOMODULES}
  120. #120522 ubuntu precise puppy must have the schemas compiled (otherwise seamonkey crashed)...
  121. [ -d /usr/share/glib-2.0/schemas ] && [ -e /usr/bin/glib-compile-schemas ] && /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
  122. #120605 note, /usr/lib/gtk-2.0/2.10.0/gtk.immodules is a symlink to this...
  123. gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules #120605 shinobar.
  124. fi
  125. fi
  126. NEWPVERSION="`grep '^DISTRO_VERSION' /etc/DISTRO_SPECS | cut -f 2 -d '=' | cut -f 2 -d '"' | cut -f 2 -d "'" | cut -f 1 -d ' '`" #110422
  127. #w001 generate /etc/networkmodules...
  128. echo -n " network-drivers-list" >/dev/console
  129. /usr/sbin/updatenetmoduleslist.sh
  130. #110119 just in case something missing (like svg loader)...
  131. echo -n " pixbuf-loaders" >/dev/console
  132. gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
  133. #110622 note, mageia1 requires above file to be at /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache -- symlink created by 3builddistro.
  134. #w002 update icon cache (supposed to speed things up)...
  135. echo -n " gtk-icon-cache" >/dev/console
  136. #note, can use --ignore-theme-index if want to...
  137. /usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor/
  138. #w002 generate desktop icons (previously done in unleashed)...
  139. echo -n " desk-icons" >/dev/console
  140. if [ -f /etc/desktop_icon_theme ];then #110119
  141. DEFAULT_DESK_ICONS="`cat /etc/desktop_icon_theme`" #Woof creates this.
  142. else #precaution
  143. DEFAULT_DESK_ICONS="`ls -1 /usr/local/lib/X11/themes | tail -n 1`"
  144. fi
  145. #110826 not needed, now done in 3builddistro...
  146. #/usr/sbin/icon_switcher_cli $DEFAULT_DESK_ICONS
  147. #[ -f /usr/share/doc/woof-tree-official.svg ] && [ ! -f /usr/share/doc/woof-tree-official.png ] && rsvg-convert -w 648 -a -o /usr/share/doc/woof-tree-official.png /usr/share/doc/woof-tree-official.svg #100425
  148. exit ###EXIT###
  149. ;;
  150. *) #v423 PUPMODE=2 (full hd install) then just exit.
  151. #exit
  152. #120505 need to consider situation of a full-hd install that is not pre-setup, as would normally be done by 3builddistro in Woof and the Universal Installer.
  153. #one exception is a cross-build in Woof. in such a situation /etc/networkmodules would not exist...
  154. [ -f /etc/networkmodules ] && exit ###EXIT###
  155. #code as per PUPMODE==5 above...
  156. if [ -f /etc/rc.d/WOOFMERGEVARS ];then #111123 inserted by 3builddistro.
  157. . /etc/rc.d/WOOFMERGEVARS
  158. if [ "$WOOF_HOSTARCH" != "$WOOF_TARGETARCH" ];then #woof did a cross-build
  159. echo -n " cross-build-fix" >/dev/console
  160. #these are normally done in 3builddistro.
  161. ldconfig #ldconfig put in by 3builddistro. rebuild /etc/ld.so.cache
  162. /usr/sbin/indexgen.sh #create master help index.
  163. /usr/sbin/fixmenus #Reconstruct configuration files for JWM, Fvwm95, IceWM. 120323 note: fixmenus corrects $LANG.
  164. /usr/bin/fc-cache -s -v #fontconfig cache
  165. PANGOMODULES="`find /etc/pango -type f -name pango.modules`"
  166. [ "$PANGOMODULES" = "" ] && PANGOMODULES='/etc/pango/pango.modules'
  167. [ ! -s ${PANGOMODULES} ] && pango-querymodules > ${PANGOMODULES}
  168. #120522 ubuntu precise puppy must have the schemas compiled (otherwise seamonkey crashed)...
  169. [ -d /usr/share/glib-2.0/schemas ] && [ -e /usr/bin/glib-compile-schemas ] && /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
  170. #120523 this too...
  171. [ -d /usr/lib/gio/modules ] && [ -e /usr/bin/gio-querymodules ] && /usr/bin/gio-querymodules /usr/lib/gio/modules
  172. [ -d /usr/lib64/gio/modules ] && [ -e /usr/bin/gio-querymodules ] && /usr/bin/gio-querymodules /usr/lib64/gio/modules
  173. #120605 note, /usr/lib/gtk-2.0/2.10.0/gtk.immodules is a symlink to this...
  174. gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules #120605 shinobar.
  175. fi
  176. fi
  177. NEWPVERSION="`grep '^DISTRO_VERSION' /etc/DISTRO_SPECS | cut -f 2 -d '=' | cut -f 2 -d '"' | cut -f 2 -d "'" | cut -f 1 -d ' '`" #110422
  178. #w001 generate /etc/networkmodules...
  179. echo -n " network-drivers-list" >/dev/console
  180. /usr/sbin/updatenetmoduleslist.sh #creates /etc/networkmodules
  181. #110119 just in case something missing (like svg loader)...
  182. echo -n " pixbuf-loaders" >/dev/console
  183. gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
  184. #110622 note, mageia1 requires above file to be at /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache -- symlink created by 3builddistro.
  185. #w002 update icon cache (supposed to speed things up)...
  186. echo -n " gtk-icon-cache" >/dev/console
  187. #note, can use --ignore-theme-index if want to...
  188. /usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor/
  189. #w002 generate desktop icons (previously done in unleashed)...
  190. echo -n " desk-icons" >/dev/console
  191. if [ -f /etc/desktop_icon_theme ];then #110119
  192. DEFAULT_DESK_ICONS="`cat /etc/desktop_icon_theme`" #Woof creates this.
  193. else #precaution
  194. DEFAULT_DESK_ICONS="`ls -1 /usr/local/lib/X11/themes | tail -n 1`"
  195. fi
  196. #110826 not needed, now done in 3builddistro...
  197. #/usr/sbin/icon_switcher_cli $DEFAULT_DESK_ICONS
  198. exit ###EXIT###
  199. ;;
  200. esac
  201. . $NEWFILESMNTPT/etc/DISTRO_SPECS #w020 has DISTRO_VERSION, DISTRO_BINARY_COMPAT, DISTRO_FILE_PREFIX
  202. NEWPVERSION="`grep '^DISTRO_VERSION' $NEWFILESMNTPT/etc/DISTRO_SPECS | cut -f 2 -d '=' | cut -f 2 -d '"' | cut -f 2 -d "'" | cut -f 1 -d ' '`" #110422
  203. #note, reboot after creating save file, this might not be there...
  204. # (but does get created, see bottom of this script)
  205. if [ -f $OLDFILESMNTPT/etc/puppyversion ];then
  206. OLDPVERSION="`cat $OLDFILESMNTPT/etc/puppyversion`" #110422
  207. rm -f $OLDFILESMNTPT/etc/puppyversion #init does this, but not in case of full hd install.
  208. fi
  209. [ -f $OLDFILESMNTPT/etc/DISTRO_SPECS ] && OLDPVERSION="`grep '^DISTRO_VERSION' $OLDFILESMNTPT/etc/DISTRO_SPECS | cut -f 2 -d '=' | cut -f 2 -d '"' | cut -f 2 -d "'" | cut -f 1 -d ' '`" #110422
  210. [ "$OLDPVERSION" = "" ] && OLDPVERSION="$NEWPVERSION" #110422
  211. if [ "$OLDPVERSION" = "0" ];then #101228 01micko: workaround for weird bug, full hd install.
  212. #OLDPVERSION=`expr $NEWPVERSION - 1`
  213. OLDPVERSION='0.0' #110422
  214. fi
  215. #if [ $NEWPVERSION -gt $OLDPVERSION ];then
  216. FLAGnew='false' #110422
  217. #if vercmp $NEWPVERSION gt $OLDPVERSION ; then #
  218. if [ -f /initrd/tmp/version_update_flag ]; then
  219. rm -f /initrd/tmp/version_update_flag 2>/dev/null
  220. FLAGnew='true' #110422
  221. VERstr='to version'
  222. [ "$OLDPVERSION" != "0.0" ] && VERstr="from version $OLDPVERSION to" #110422
  223. echo "Upgrading ${DISTRO_NAME} ${VERstr} ${NEWPVERSION}..." #110422
  224. echo -n " to $NEWPVERSION" >/dev/console
  225. #need to identify files that absolutely must always be updated, when
  226. #there is a new version, and forcefully copy them...
  227. echo "Updating w.m. menus..."
  228. cp -af $NEWFILESMNTPT/root/.packages/Packages-* /root/.packages/ #w012
  229. cp -af $NEWFILESMNTPT/root/.packages/DISTRO_PKGS_SPECS /root/.packages/ #w012
  230. #110119...
  231. rm -rf /root/.packages/builtin_files
  232. cp -af $NEWFILESMNTPT/root/.packages/builtin_files /root/.packages/
  233. cp -af $NEWFILESMNTPT/root/.packages/woof-installed-packages /root/.packages/
  234. PKG_REPOS_ENABLED="`grep '^PKG_REPOS_ENABLED' /root/.packages/PKGS_MANAGEMENT | cut -f 2 -d "'"`" #geany'
  235. grep -v '^PKG_REPOS_ENABLED' $NEWFILESMNTPT/root/.packages/PKGS_MANAGEMENT > /tmp/PKGS_MANAGEMENT-tmp
  236. mv -f /tmp/PKGS_MANAGEMENT-tmp /root/.packages/PKGS_MANAGEMENT
  237. echo "PKG_REPOS_ENABLED='${PKG_REPOS_ENABLED}'" >> /root/.packages/PKGS_MANAGEMENT
  238. [ -f /etc/puppyversion ] && rm -f /etc/puppyversion #about time got rid of this.
  239. cp -af $NEWFILESMNTPT/etc/DISTRO_SPECS /etc/ #w012
  240. cp -af /root/.fvwm95rc /root/DOTfvwm95rc.bak 2>/dev/null
  241. cp -af /root/.jwmrc /root/DOTjwmrc.bak 2>/dev/null
  242. # Update if needed
  243. if [ -f $OLDFILESMNTPT/etc/xdg/templates/_root_.jwmrc -a \
  244. "`grep JWMRC_VERSION_002 $OLDFILESMNTPT/etc/xdg/templates/_root_.jwmrc`" = "" ]; then
  245. cp -af $NEWFILESMNTPT/etc/xdg/templates/_root_.jwmrc /etc/xdg/templates/
  246. [ -f /usr/sbin/upgrade_ptheme_fix ] && upgrade_ptheme_fix
  247. fi
  248. cp -af /root/.icewm/menu /root/DOTicewmmenu.bak 2>/dev/null #v1.0.5
  249. cp -af $NEWFILESMNTPT/root/.fvwm95rc /root/ 2>/dev/null
  250. cp -af $NEWFILESMNTPT/root/.jwmrc /root/ 2>/dev/null
  251. cp -af $NEWFILESMNTPT/root/.icewm/menu /root/.icewm/ 2>/dev/null #v1.0.5
  252. #also update every boot and shutdown script...
  253. echo "Updating boot and shutdown system scripts..."
  254. cp -af $NEWFILESMNTPT/etc/rc.d/rc.country /etc/rc.d/
  255. cp -af $NEWFILESMNTPT/etc/rc.d/rc.network /etc/rc.d/
  256. cp -af $NEWFILESMNTPT/etc/rc.d/rc.shutdown /etc/rc.d/
  257. cp -af $NEWFILESMNTPT/etc/rc.d/rc.sysinit /etc/rc.d/
  258. cp -af $NEWFILESMNTPT/etc/rc.d/rc.update /etc/rc.d/
  259. #110119...
  260. cp -af $NEWFILESMNTPT/etc/rc.d/rc.services /etc/rc.d/
  261. cp -af $NEWFILESMNTPT/etc/rc.d/functions4puppy /etc/rc.d/
  262. cp -af $NEWFILESMNTPT/etc/rc.d/functions4puppy4 /etc/rc.d/
  263. SKIPLIST="`grep '^SKIPLIST' /etc/rc.d/MODULESCONFIG | cut -f 2 -d '"'`" #geany'
  264. ADDLIST="`grep '^ADDLIST' /etc/rc.d/MODULESCONFIG | cut -f 2 -d "'"`" #geany'
  265. REGEX1="s%^SKIPLIST.*%SKIPLIST=\"${SKIPLIST}\"%"
  266. REGEX2="s%^ADDLIST.*%ADDLIST='${ADDLIST}'%"
  267. cp -af $NEWFILESMNTPT/etc/rc.d/MODULESCONFIG /etc/rc.d/
  268. sed -i -e "${REGEX1}" -e "${REGEX2}" /etc/rc.d/MODULESCONFIG
  269. #110204 problem, as overwrites LANG setting...
  270. #cp -af $NEWFILESMNTPT/etc/profile /etc/
  271. xLANG="`grep '^LANG=' /etc/profile | cut -f 2 -d '=' | cut -f 1 -d ' '`"
  272. #110216 still not working. so, do this bad hack (see rc.shutdown)...
  273. [ -f /var/local/etc_profile_at_shutdown ] && xLANG="`grep '^LANG=' /var/local/etc_profile_at_shutdown | cut -f 2 -d '=' | cut -f 1 -d ' '`" #110216
  274. REGEX3="s%^LANG=.*%LANG=${xLANG}%"
  275. sed -e "$REGEX3" $NEWFILESMNTPT/etc/profile > /etc/profile
  276. #cp -af $NEWFILESMNTPT/usr/X11R7/bin/xwin /usr/X11R7/bin/
  277. cp -af $NEWFILESMNTPT/root/.xinitrc /root/
  278. #110122 make sure all woof scripts are updated... 110722 updated lists... 111009 update...
  279. for ONESCRIPT in df initrd_layer_test mount ps pupkill umount
  280. do
  281. cp -a -f --remove-destination $NEWFILESMNTPT/bin/$ONESCRIPT /bin/
  282. done
  283. for ONESCRIPT in clean_desk_icons dir2sfs dir2tgz initNEW poweroff probedisk probepart pup_event_backend_firmware pup_event_backend_modprobe pup_event_backend_modprobe_protect pup_event_frontend_d reboot runlevel test-eide test-scsi
  284. do
  285. cp -a -f --remove-destination $NEWFILESMNTPT/sbin/$ONESCRIPT /sbin/ 2>/dev/null
  286. done
  287. for ONESCRIPT in dir2pet dirs2pets evince gtkdialog-splash lprshell man new2dir pet2tgz petspec pman pupdialog restartwm startx tgz2pet wmexit wmpoweroff wmreboot wvdialshell xterm xwin yaf-splash
  288. do
  289. cp -a -f --remove-destination $NEWFILESMNTPT/usr/bin/$ONESCRIPT /usr/bin/ 2>/dev/null
  290. done
  291. for ONESCRIPT in alsaconf alsawizard askpass background_reshape bcrypt_gui bootflash bootmanager burniso2cd calcfreespace.sh cdburner-wizard chooselocale connectwizard connectwizard_2nd countrywizard cups_shell dotpup delayedrun deskshortcut.sh download_file eventmanager exploderpm filemnt fitimage2root fixdesk fixmenus fixPuppyPin floppy-format.sh framebufferwizard freememappletshell gen_modem_init_string get_bluetooth_connection get_modem_alternate_device grubconfig grubconfigREADME.txt icon_switcher icon_switcher_cli indexgen.sh input-wizard ipinfo loginmanager modemdisconnect modemprobe modemprobe_erase modemprobe_help modemtest networkdisconnect partview pcur pdict Pdisk petget pgprs-shell pmodemdiag pmonitork.sh pmonitorx.sh pmount pmovie pngoverlay pngoverlay.bac pngoverlay.sh pppconnect pppdisconnect pppsetup Pudd pup-advert-blocker pupautodetect pupcamera pupdial pupdial_init_hotpluggable pupdial_wizard_helper puppyhelp puppyinstaller puppypdf pupscan remasterpup2 remove_builtin report-video resizepfile.sh root2user save2flash save2image savesession-dvd scannerwizard.sh securetelnetshell set_bg set_hwclock_type set-time-for-puppy set-xftdpi sfsget shutdownconfig snapmergepuppy sns spacereplace systemvalues timezone-set updatenetmoduleslist.sh usb_modem_special_status usb_modeswitch_status video_upgrade_wizard video-wizard wakepup2 welcome1stboot welcome1stboot.bac wirelesswizard wizardwizard xdelta_gui xf86svga336wizard xgamma-gui xinitrc_test xorgwizard xorgwizard-automatic xrandrshell xserverwizard
  292. do
  293. cp -a -f --remove-destination $NEWFILESMNTPT/usr/sbin/$ONESCRIPT /usr/sbin/ 2>/dev/null
  294. done
  295. cp -a -f --remove-destination $NEWFILESMNTPT/usr/local/petget /usr/local/
  296. cp -a -f --remove-destination $NEWFILESMNTPT/usr/local/simple_network_setup /usr/local/
  297. cp -a -f --remove-destination $NEWFILESMNTPT/usr/local/video_upgrade /usr/local/
  298. #Remove old kernels if present
  299. for i in $(ls -d /lib/modules/[0-9]*)
  300. do
  301. OLDKERN=$(echo $i | cut -f 4 -d '/')
  302. if [ "$KERNVER" != "$OLDKERN" ]; then
  303. rm -rf $i
  304. fi
  305. done
  306. depmod_func #run depmod. 130217 extracted as a function.
  307. #alsaconf generates alsaconf.cards, maybe have to get rid of old one?... 110119
  308. [ -f /var/tmp/alsaconf.cards ] && rm -f /var/tmp/alsaconf.cards
  309. if [ -f /etc/modprobe.conf ];then #110119 deprecated.
  310. SNDCARD0="`grep '^alias snd\-card\-0' /etc/modprobe.conf`"
  311. SNDSLOT0="`grep '^alias sound\-slot\-0' /etc/modprobe.conf`"
  312. rm -f /etc/modprobe.conf
  313. [ "$SNDCARD0" ] && echo "$SNDCARD0" >> /etc/modprobe.d/alsa.conf
  314. [ "$SNDSLOT0" ] && echo "$SNDSLOT0" >> /etc/modprobe.d/alsa.conf
  315. fi
  316. #v2.14 Jesse suggested this. remove any broken shared library symlinks...
  317. find / -mount -noleaf -path '*/lib/*' -type l -name *.so -o -noleaf -path '*/lib/*' -type l -name *.so.* |
  318. while read ONESYMLINK
  319. do
  320. ONESYMDEST="`readlink $ONESYMLINK`"
  321. ONESYMDIR="`dirname $ONESYMLINK`"
  322. FIRSTCHAR="`echo -n "$ONESYMDEST" | cut -b 1`"
  323. if [ "$FIRSTCHAR" = "/" ];then
  324. [ ! -e "$ONESYMDEST" ] && rm -f $ONESYMLINK
  325. else
  326. [ ! -e $ONESYMDIR/$ONESYMDEST ] && rm -f $ONESYMLINK
  327. fi
  328. done
  329. #111009 try fix upgrading old wary save-file...
  330. if [ "$PUPMODE" != "option2hdinstall" ];then
  331. case $DISTRO_FILE_PREFIX in
  332. wary)
  333. if vercmp $OLDPVERSION lt 5.1.5;then #before i recompiled everything in t2.
  334. #x might not work, wipe all stuff in save-file...
  335. rm -rf $OLDFILESMNTPT/usr/X11R7/* #hmmm, will this show on top?
  336. rm -f /etc/X11/xorg.conf
  337. #111026 upnorth posted this.. (http://murga-linux.com/puppy/viewtopic.php?t=72258&start=90)
  338. rm /etc/gtk-2.0/gdk-pixbuf.loaders
  339. gdk-pixbuf-query-loaders >/etc/gtk-2.0/gdk-pixbuf.loaders
  340. fi
  341. ;;
  342. esac
  343. fi
  344. #w001 generate /etc/networkmodules...
  345. echo -n " network-drivers-list" >/dev/console
  346. /usr/sbin/updatenetmoduleslist.sh
  347. #w002 update icon cache (supposed to speed things up)...
  348. echo -n " gtk-icon-cache" >/dev/console
  349. /usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor/
  350. #110119 just in case something missing (like svg loader)...
  351. echo -n " pixbuf-loaders" >/dev/console
  352. gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
  353. #110622 note, mageia1 requires above file to be at /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache -- symlink created by 3builddistro.
  354. #111027 sometimes these go back to 755... 01micko reports this problem with full install
  355. chmod 777 /tmp
  356. chmod 777 /var
  357. #moved this stuff down from line 166. fixmenus must run after desktop icons setup...
  358. #master help index has to be updated...
  359. /usr/sbin/indexgen.sh
  360. #120209 i think these also need to run, in case a target file has changed and needs to be re-translated...
  361. #but, i think the english target files will have to be copied to top first...
  362. SSSDESK="`grep '^\[' $NEWFILESMNTPT/usr/share/sss/desk_strings/desk_strings | tr -d '[' | tr -d ']' | tr '\n' ' '`"
  363. SSSSCRIPTS="`grep '^\[' $NEWFILESMNTPT/usr/share/sss/script_strings/script_strings | tr -d '[' | tr -d ']' | tr '\n' ' '`"
  364. for ASECTIONID in ${SSSDESK} ${SSSSCRIPTS} #ex: general _woof_.jwmrc
  365. do
  366. #allow any character to be the 'marker' for / in the section-id...
  367. MARKERCHAR="`echo -n "$ASECTIONID" | cut -c 1`"
  368. TARGETFILE="`echo -n "$ASECTIONID" | tr "${MARKERCHAR}" '/'`" #ex: /root/Choices/ROX-Filer/PuppyPin
  369. if [ -f ${NEWFILESMNTPT}${TARGETFILE} ];then #precaution.
  370. TARGETPATH="`dirname $TARGETFILE`"
  371. cp -a -f ${NEWFILESMNTPT}${TARGETFILE} ${TARGETPATH}/
  372. fi
  373. [ -f /var/local/sss${TARGETFILE} ] && rm -f /var/local/sss${TARGETFILE} #remove previous en backup (see fixdesk)
  374. done
  375. LANG=$xLANG /usr/sbin/fixscripts
  376. LANG=$xLANG /usr/sbin/fixdesk
  377. #Reconstruct configuration files for JWM, Fvwm95, IceWM... 120209 append LANG...
  378. LANG=$xLANG /usr/sbin/fixmenus
  379. fi
  380. xLANG="`grep '^LANG=' /etc/profile | cut -f 2 -d '=' | cut -f 1 -d ' '`"
  381. #stuff to update on every boot...
  382. #think have to do this everytime...
  383. cp -af $NEWFILESMNTPT/etc/DISTRO_SPECS /etc/
  384. touch /etc/DISTRO_SPECS #important, as snapmergepuppy uses '-u' cp option. ...huh, why?
  385. #v2.16 if aufs layers have changed, may need to fix menu (etc)...
  386. #note, BootManager may be popped-up, see /usr/sbin/delayedrun.
  387. if [ -d /initrd ];then #test it isn't full hd installation.
  388. . /etc/rc.d/BOOTCONFIG
  389. #v2.16.1 bug with multisession-cd, different folder at each startup, so screen out...
  390. xLASTUNIONRECORD="`echo -n "$LASTUNIONRECORD" | sed -e 's/^20[0-9][0-9][-0123456789]* //'`"
  391. xPREVUNIONRECORD="`echo -n "$PREVUNIONRECORD" | sed -e 's/^20[0-9][0-9][-0123456789]* //'`"
  392. if [ "$xLASTUNIONRECORD" != "$xPREVUNIONRECORD" ];then
  393. echo -en " layered-filesystem \\033[1;35mnext boot will be faster!\\033[0;39m" > /dev/console
  394. echo "Aufs layers have changed since previous boot, fixing menu..."
  395. #master help index has to be updated...
  396. /usr/sbin/indexgen.sh
  397. #Reconstruct configuration files for JWM, Fvwm95, IceWM...
  398. LANG=$xLANG /usr/sbin/fixmenus
  399. fc-cache -f #120323 shinobar: some sfs files may have fonts
  400. which gtk-query-immodules-2.0 &>/dev/null && gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules #120323 shinobar: refresh gtk.immodules
  401. depmod_func #120323 shinobar: and some sfs may have kernel modules. 130217 depmod extracted as a function.
  402. #w007 has a 'zdrv' layer been added or removed?...
  403. EXMOD_CNT=0
  404. zzPATTERN='zdrv' #120323 have settled on this in all zdrv sfs filenames.
  405. EXMOD_SFS1="`echo "$xLASTUNIONRECORD" | tr ' ' '\n' | grep "$zzPATTERN"`"
  406. EXMOD_SFS2="`echo "$xPREVUNIONRECORD" | tr ' ' '\n' | grep "$zzPATTERN"`"
  407. [ "$EXMOD_SFS1" != "" ] && EXMOD_CNT=1
  408. [ "$EXMOD_SFS2" != "" ] && EXMOD_CNT=`expr $EXMOD_CNT + 1`
  409. if [ $EXMOD_CNT -eq 2 ];then
  410. [ "$EXMOD_SFS1" != "$EXMOD_SFS2" ] && EXMOD_CNT=1 #may have changed to a different zdrv sfs.
  411. fi
  412. if [ $EXMOD_CNT -eq 1 ];then
  413. #depmod #120323 removed, already done above.
  414. /usr/sbin/updatenetmoduleslist.sh
  415. fi
  416. fi
  417. ##fix the desktop...
  418. ##note, init does 'touch' on PuppyPin and globicons to prevent overwrite at version upgrade. #140620 start
  419. ##if [ $NEWPVERSION -gt $OLDPVERSION -o "$xLASTUNIONRECORD" != "$xPREVUNIONRECORD" ];then
  420. #if [ "$FLAGnew" = "true" -o "$xLASTUNIONRECORD" != "$xPREVUNIONRECORD" ];then #110422
  421. ##need some way to retain user-modifications, especially additions to desktop...
  422. ##one way is to just merge everything and then delete invalid entries...
  423. ##DennisF reported backdrop image reverted to default.jpg, so screen out default here...
  424. #grep -v '<backdrop' $NEWFILESMNTPT/root/Choices/ROX-Filer/PuppyPin >> /root/Choices/ROX-Filer/PuppyPin
  425. #cat $NEWFILESMNTPT/root/Choices/ROX-Filer/globicons >> /root/Choices/ROX-Filer/globicons
  426. ##an inconstency, user-mod to desktop, PuppyPin gets changed in
  427. ##/root/Choices/ROX-Filer/, but globicons gets copied and updated in
  428. ##/root/.config/rox.sourceforge.net/ROX-Filer/...
  429. #if [ -f /root/.config/rox.sourceforge.net/ROX-Filer/globicons ];then
  430. #cat /root/.config/rox.sourceforge.net/ROX-Filer/globicons >> /root/Choices/ROX-Filer/globicons
  431. #rm -f /root/.config/rox.sourceforge.net/ROX-Filer/globicons
  432. #fi
  433. #for LAYERNUM in 3 4 5 6 7 8 9 #v431 added 6 7 8 9
  434. #do
  435. #[ -f /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/PuppyPin ] && cat /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/PuppyPin >> /root/Choices/ROX-Filer/PuppyPin
  436. #[ -f /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/globicons ] && cat /initrd/pup_ro$LAYERNUM/root/Choices/ROX-Filer/globicons >> /root/Choices/ROX-Filer/globicons
  437. #done
  438. #echo '<?xml version="1.0"?>' > /tmp/PuppyPinTmp
  439. #echo '<pinboard>' >> /tmp/PuppyPinTmp
  440. #grep -v -E 'pinboard>|<\?xml' /root/Choices/ROX-Filer/PuppyPin | sort -u >> /tmp/PuppyPinTmp
  441. #echo '</pinboard>' >> /tmp/PuppyPinTmp
  442. ##120225 non-english locale may have translations for PuppyPin. translate en text now, and
  443. ##duplicates will get removed further down...
  444. #if [ -f /usr/share/sss/desk_strings/desk_strings.${xLANG%_*} ];then #ex: script_strings.de
  445. #sPTN="/^\[_root_Choices_ROX-Filer_PuppyPin\]/,/^$/p" #this is a multi-line block find expression.
  446. #CODEBLOCK="`sed -n "$sPTN" /usr/share/sss/desk_strings/desk_strings.${xLANG%_*} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`" #extracts just the relevant block of lines.
  447. #if [ "$CODEBLOCK" ];then
  448. #echo "$CODEBLOCK" > /tmp/rc-update-puppypin-codeblock
  449. #sed -i -f /tmp/rc-update-puppypin-codeblock /tmp/PuppyPinTmp
  450. #fi
  451. #fi
  452. ##sort -u only gets rid of completely duplicate lines. delete duplicate execs...
  453. ##also delete line if exec is invalid. also avoid overlapping icons...
  454. #EXECSLOG="";XYLOG=""
  455. #echo -n "" > /root/Choices/ROX-Filer/PuppyPin
  456. #cat /tmp/PuppyPinTmp |
  457. #while read ONELINE
  458. #do
  459. #if [ "`echo -n "$ONELINE" | grep -v '<icon '`" != "" ];then
  460. #echo "$ONELINE" >> /root/Choices/ROX-Filer/PuppyPin
  461. #continue
  462. #fi
  463. #ONEEXEC="`echo -n "$ONELINE" | cut -f 2 -d '>' | cut -f 1 -d '<'`"
  464. #ONEX=`echo -n "$ONELINE" | cut -f 1 -d '>' | cut -f 2 -d '"'` #'geany
  465. #ONEY=`echo -n "$ONELINE" | cut -f 1 -d '>' | cut -f 4 -d '"'` #'geany
  466. #ONEXY0="${ONEX}_${ONEY}"
  467. #ONEXY="${ONEX}_${ONEY}"
  468. #while [ "`echo -n "$XYLOG" | grep "$ONEXY"`" != "" ];do
  469. #ONEX=`expr $ONEX + 32` #64
  470. #ONEY=`expr $ONEY + 48` #96
  471. #ONEXY="${ONEX}_${ONEY}"
  472. #done
  473. #if [ "`echo "$EXECSLOG" | grep "$ONEEXEC"`" = "" ];then
  474. #if [ -e $ONEEXEC ];then #could be a file, symlink or directory(rox-dir).
  475. #XYLOG="$XYLOG $ONEXY"
  476. #if [ "$ONEXY" = "$ONEXY0" ];then
  477. #echo "$ONELINE" >> /root/Choices/ROX-Filer/PuppyPin
  478. #else
  479. ##icon has to be moved...
  480. #XPATTERN="s/x=\"[0-9]*\"/x=\"${ONEX}\"/g"
  481. #YPATTERN="s/y=\"[0-9]*\"/y=\"${ONEY}\"/g"
  482. #echo "$ONELINE" | sed -e "$XPATTERN" | sed -e "$YPATTERN" >> /root/Choices/ROX-Filer/PuppyPin
  483. #fi
  484. #fi
  485. #fi
  486. #EXECSLOG="$EXECSLOG $ONEEXEC"
  487. #done
  488. ##now do globicons file...
  489. #echo '<?xml version="1.0"?>' > /tmp/globiconsTmp
  490. #echo '<special-files>' >> /tmp/globiconsTmp
  491. #grep -v -E 'special\-files>|<\?xml' /root/Choices/ROX-Filer/globicons >> /tmp/globiconsTmp
  492. #echo '</special-files>' >> /tmp/globiconsTmp
  493. ##get rid of duplicate entries...
  494. #RULESLOG="";FLAGIGNORE="";ONERULE=""
  495. #echo -n "" > /root/Choices/ROX-Filer/globicons
  496. ##v431 add tests that executables and icons exist...
  497. ##v431 make sure tags start new lines...
  498. #cat /tmp/globiconsTmp | tr -d '\n' | sed -e 's%$%\n%' -e 's%<icon>%\n<icon>%g' -e 's%<rule%\n<rule%g' -e 's%</rule>%\n</rule>%g' -e 's%</special%\n</special%g' -e 's%<special%\n<special%g' |
  499. #while read ONELINE
  500. #do
  501. #if [ "`echo -n "$ONELINE" | grep 'rule match'`" != "" ];then
  502. #ONERULE="`echo -n "$ONELINE" | cut -f 2 -d '"'`" #'geany
  503. #read ONEICON
  504. #read ENDRULE
  505. #[ "`echo -n "$RULESLOG" | grep "$ONERULE"`" != "" ] && continue #avoid duplicates.
  506. #[ ! -e "$ONERULE" ] && continue #test executable exists.
  507. #REALICON="`echo -n "$ONEICON" | cut -f 2 -d '>' | cut -f 1 -d '<'`"
  508. #[ ! -e "$REALICON" ] && continue #test icon exists.
  509. #RULESLOG="$RULESLOG $ONERULE"
  510. #echo "$ONELINE
  511. #$ONEICON
  512. #$ENDRULE" >> /root/Choices/ROX-Filer/globicons
  513. #else
  514. #echo "$ONELINE" >> /root/Choices/ROX-Filer/globicons
  515. #fi
  516. #done
  517. #fi #140620 end
  518. fi
  519. ###END###