3builddistro 179 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770
  1. #!/bin/sh
  2. #(c) Copyright Barry Kauler 2009.
  3. #2createpackages has already built the generic packages in packages-$DISTRO_FILE_PREFIX/.
  4. #these packages have generic names as specified in the second field of PKGS_SPECS_TABLE,
  5. #which is a variable in ./DISTRO_PKGS_SPECS. The format of entries in table:
  6. # yes|abiword|abiword,abiword-common|exe,dev,doc,nls
  7. # ...if first field is 'yes' then it will be built into distro.
  8. #100628 my 2.6.34 pet has modules.builtin and modules.order, don't delete.
  9. #100629 if nouveau xorg driver exists, move nv driver to 'drivers-alternate'.
  10. #100801,100806 file inline_get_pet, inline_get_compat have common code.
  11. #100831 hack.
  12. #100903 extract all kernel-specific files to zdrv, to support mix-n-match.
  13. #100911 handle Packages-puppy-lucid-official.
  14. #100911 simple filenames vmlinuz, initrd.gz, puppy.sfs, zdrv.sfs, devx.sfs.
  15. #100912 choose between old and new puppy filenames.
  16. #100916 don't bother record devx sfs name. second help screen at bootup.
  17. #101007 the latest busybox depmod generates relative paths in modules.dep, breaks modprobe in initrd.
  18. #101012 have restored 'depmod-FULL' name to 'depmod'.
  19. #101013 read variable PKG_PREFER_OLDER in file PKGS_MANAGEMENT to choose between 2 pkgs.
  20. #101023 small bugfix. 101024 bugfix. 101025 bugfix.
  21. #101026 display "wary <version>" on boot splash screen.
  22. #101027 Iguleder reported DISTRO_SPECS did not have a carriage-return on last line.
  23. #101028 added ko* as have some named .koHIDE.
  24. #101126 Quirky is now built from wary5 pet packages.
  25. #101217 get latest BaCon in devx.
  26. #101222 some big modems named *HIDE, not *.ko.
  27. #110213 fix if /usr/share/X11/locale/locale.alias missing .utf8 entries.
  28. #110215 extra logic for BaCon compiler in devx.
  29. #110329 move some python files to the 'devx'.
  30. #110412 move all .bac, .pot and .pupdev files to 'devx'.
  31. #110413 variable DISTRO_XORG_AUTO in /etc/DISTRO_SPECS, set in Woof '3builddistro'.
  32. #110417 this will make Thunar use ROX-Filer's icons for files
  33. #110421 vercmp utility.
  34. #110422 DISTRO_VERSION variable now has dotted format. note, also now using full dotted version# in puppy filenames.
  35. #110426 help file on CD for Windows users.
  36. #110429 fix ownership of /root/spot just in case.
  37. #110429 may need a fix, think want glibc scsi headers in usr/include/scsi.
  38. #110512 fix for kernel pet name linux_kernel-2.6.32-40-w5.pet
  39. #110516 attempt fix dependcheck() hanging.
  40. #110517 debian squeeze hack, copy pango-querymodules from devx.
  41. #110517 squeeze debian, boot splash message "squeezed <version>".
  42. #110517 turn on kms for intel,radeon,nouveau if recent versions.
  43. #110518 radical culling of modules, add fbcon.ko.
  44. #110523 override files from rootfs-skeleton/root/Choices/MIME-types, if rox pkg has older files.
  45. #110608 copy Packages-puppy-common-official, not -woof-.
  46. #110612 copy rpm2ppm and mageia2ppm needed by 0setup in built puppy.
  47. #110620 do same as 110523, for mime icons.
  48. #110621 fix for turning on kms.
  49. #110622 hack for mageia 1 (otherwise can't find pango.modules)...
  50. #110622 mageia1 requires pixbuf cache file to be at /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.
  51. #110701 possible lib clash between e2fsprogs and util-linux (i might use old util-linux pet).
  52. #110702 mageia1 python pkg puts /etc/profile.d/30python.csh in devx.
  53. #110712 modinfo won't work if modules.* files missing.
  54. #110712 reduce hid-* drivers moved to initrd, so when usbhid configured builtin, none be moved to initrd.
  55. #110713 support xz compression for squashfs 4.2 and kernel 2.6.39+.
  56. #110721 Drake Puppy: display "drake <version>" on boot splash screen.
  57. #110726 Drake Puppy: config files put in usr/bin/multiarch-i386-linux, move to usr/bin.
  58. #110727 running drake pup 0.3 with k2.6.39-3 new laptop, mysterious loss of dirs/files. try sync.
  59. #110727 no longer using $PKG_PREFER_OLDER to select kernel-version-sensitive pkg alternatives.
  60. #110803 workaround for 'pngoverlay' needs X runnning, also avoid cpu overhead at first startup.
  61. #110806 if yad installed, no zenity, make sure zenity is symlink to yad.
  62. #110816 add Packages-puppy-slacko-official.
  63. #110821 copy support/findpkgs into build.
  64. #110822 removed fossil_fixup_func. improved choice of KMS on/off.
  65. #110822 customizations script provided by 01micko for Slacko.
  66. #110823 move asking for kernel pet from 3builddistro to 1download.
  67. #110823 revert 110821 (also have removed rootfs-skeleton/usr/local/petget/findwoofinstalledpkgs.sh)
  68. #110823 fix creating file woof-installed-packages.
  69. #110824 add common repo default in PPM, set defaults for slacko.
  70. #110826 no longer calling icon_switcher_cli from rc.update, modify 110803.
  71. #110826 get the kernel version out of inside the PET pkg.
  72. #110831 support png background image.
  73. #110901 i have experimented with building a wary "5.2pre" without libxcb.
  74. #110901 temp hack, if only have gtkdialog4 pkg.
  75. #110903 pixbuf loader cache fix.
  76. #110904 revert 110901 libxcb hack.
  77. #110906 fix syntax error.
  78. #110907 rcrsn51: network printing, need pdftops symlink.
  79. #110910 make sure gtkdialog links to latest.
  80. #110911 'drivers-alternate' moved from /usr/lib/xorg/modules/ to /usr/lib/x/.
  81. #110912 modify jwm to use menu icon 'start-button.png' if present.
  82. #110917 support file prefix 'racy'.
  83. #110918 kernel-skeleton now has a pinstall.sh script.
  84. #110918 radeon, default kms off. testers found can't shutdown with it on.
  85. #110923 avoid conflict between busybox applets and full utilities.
  86. #110928 boot splash image for Racy. 111003 racy logo.
  87. #111004 for 110923, need to check in devx also.
  88. #111006 generic logo mechanism for all pups. replaces 091206 100516 111003
  89. #111010 set desktop font.
  90. #111014 support 3.x kernel.
  91. #111026 davids45: /tmp needs 777 permissions. i do have this in rootfs-skeleton, but lost in sandbox3/rootfs-complete
  92. #111027 revert 110907. was symlinking to pdftops from poppler pkg, but must have actual pdftops from cups pkg.
  93. #111114 support older gtk (2.20.1) for pixbuf loaders in new location.
  94. #111121 noryb009: improve arch linux support, patched: 0setup, 1download, 2createpackages, 3builddistro, DISTRO_COMPAT_REPOS-arch, support/arch/runDotInstalls
  95. #111123 support cross-build.
  96. #111127 no need to copy 'printcols', 'vercmp' to target build, now done in 'merge2out' script.
  97. #111203 remove offer to download and compile bacon (no good for cross-builds).
  98. #111204 remove zdump from list.
  99. #120215 language translations for init script.
  100. #120216 set default LANG and KMAP. 120217 recommend UTF-8.
  101. #120217 translate early-boot splash screens... (expect building with langpack)
  102. #120224 move rootfs-complete/usr/share/doc/nls to 'devx'.
  103. #120225 DISTRO_PUPPYDATE -> DISTRO_SPECS. this is read by /usr/share/doc/convert-raw-docs. (note: this script no longer exists)
  104. #120305 copy Packages-puppy-noarch-official to build.
  105. #120312 removed Packages-puppy-common-official from ppm default selection.
  106. #120315 Ubuntu Precise Pangolin has done a big move of files from /lib to /lib/i386-linux-gnu and /usr/lib to /usr/lib/i386-linuxgnu
  107. #120331 bugfix generating README.HTM on cd.
  108. #120401 improve choosing locale.
  109. #120502 more support for arm build.
  110. #120506 support creation of SD-card image (for arm build).
  111. #120506b check that sd card big enough.
  112. #120510 offer to resize 2nd partition of SD card to fill card.
  113. #120521 for SD-image build, copy-only console fonts and keyboard layouts to initrd, copy-only kernel modules to initrd.
  114. #120522 precise puppy, seamonkey was crashing. needed /usr/share/glib-2.0/schemas/apps.gecko-mediaplayer.preferences, also must be compiled.
  115. #120523 precise puppy, may also need to run gio-querymodules. (refer also installpkg.sh, rc.update)
  116. #120526 try radeon kms default on. 120605 turn off again.
  117. #120605 shinobar: generate gtk.immodules. ref: http://murga-linux.com/puppy/viewtopic.php?t=76961&start=195
  118. #120613 kernel image can have different names. rename to vmlinuz, however change back later if build sd card.
  119. #120616 check dri drivers exist before offer kernel modesetting.
  120. #120618 raspi debian squeeze, links as main browser, helpsurfer html viewer, gtkmoz missing. 120620 modify.
  121. #120628 certain utilities are not appropriate when booting on an arm board.
  122. #120703 sd card: allow 2nd partition to be ext2, ext3 or ext4.
  123. #120704 ask if want to load swap partition/file at bootup.
  124. #120704 sd card image, ext2 f.s., offer to bump to ext4 (without journal).
  125. #120705 refine upgrade ext2 to ext4. 120706 disktype misreports ext4 without journal as ext2.
  126. #120707 change relatime to noatime. see also rc.sysinit.
  127. #120708 added BOOT_QUICKSETUP='quickarm'. quickarm is symlink to /usr/sbin/quicksetup. leave out X config frame for arm boards.
  128. #120709 fix for pci.ids and usb.ids in "wrong" place. new BOOT_UDEVDCHILDREN.
  129. #120714 revert 120708. instead, BOOT_BOARD (= raspi, mele, odroidx, etc.) read by quicksetup.
  130. #120720 raspbian wheezy has files in /lib/arm-linux-gnueabihf and /usr/lib/arm-linux-gnueabihf
  131. #120721 support ubuntu and debian arm multiarch.
  132. #120723 BOOT_DISABLEXORGWIZARD variable.
  133. #120724 'alsaconf' does not work on arm boards, BOOT_DISABLEALSACONF variable. refer /usr/sbin/alsawizard.
  134. #120830 my hunspell-en-us pet has pinstall.sh that creates symlinks of en_US.aff and en_US.dic from seamonkey and firefox. however, need to do this thoroughly.
  135. #120831 simplify repo-list radiobuttons for ppm.
  136. #120903 default radeon kms on again.
  137. #120909 multiarch support for /usr/bin. (see also 2createpackages).
  138. #120922 was getting "nv" listing twice (precise puppy) for xorg drivers-alternate.
  139. #120925 ignore debian/ubuntu multiarch circular symlink (these are create by 2createpackages), when creating builtin_files lists.
  140. #121010 fix for 120925.
  141. #121022 fix for python not in devx, in main f.s.
  142. #121028 copy devx-only-installed-packages to build. (refer findwoofinstalledpkgs)
  143. #121102 file DISTRO_SPECS has new variable DISTRO_DB_SUBNAME. ex: for 14.0-based slacko, DISTRO_DB_SUBNAME=slacko14
  144. #121105 fix enabled-repo list for ppm.
  145. #121111 debdb2pupdb, new fast deb to pup db converter, called by 0setup.
  146. #121123 changed default locale from en_US to en_US.UTF-8.
  147. #121123 some chroot operations may leave something inside sandbox3/rootfs-complete/tmp, delete.
  148. #121123 new variable DISTRO_ARCHDIR in /etc/DISTRO_SPECS
  149. #121203 /usr/sbin/welcome1stboot needs this lib: /usr/lib/libgtk-x11-2.0.so (symlink was only in devx).
  150. #121210 fix, ARCHDIR was not getting set.
  151. #121212 puninstall.sh was not getting removed from root of sandbox3/rootfs-complete.
  152. #121227 initrd: if kernel has f.s. drivers as modules (quirky6), added ext2.ko ext3.ko ext4.ko fat.ko msdos.ko vfat.ko ntfs.ko reiserfs.ko udf.ko, and deps: jbd.ko mbcache.ko jbd2.ko
  153. #130111 proper handling of multiarch for mageia (refer 2createpackages).
  154. #130112 multiarch symlinks now optional.
  155. #130114 revert 130112.
  156. #130129 offer to change X dpi from 78 to 96.
  157. #130129 busybox: deb 'bsdmainutils' has broken 'cal' and 'hd' symlinks. 130130 tweak.
  158. #130203 fix /tmp permissions.
  159. #130204 01micko: fix for spaces in names.
  160. #130226 hack for missing /usr/bin/X.
  161. #130306 fix arch linux build. 130307 fix arch post-install script execution.
  162. #130314 want to run arch post-install script from ppm also.
  163. #130316 disable execution of arch install scripts.
  164. #130316 now have rootfs-complete/usr/local/petget/invaliddepslist.
  165. #130320 util-linux libblkid and libuuid have preference over e2fsprogs.
  166. #130321 fix call to slacko customisation script.
  167. #130326 X dpi now 96. 130327 offer choice of next-larger.
  168. #130329 append extra line, needed for Qt4 theme matching. (see also /etc/profile.d/pup_gtk and /root/.config/Trolltech.conf).
  169. #130330 Xorg: move modesetting_drv.so to drivers-alternate directory.
  170. #130330 want 'universe' radiobutton before 'main'.
  171. #130401 01micko: support gtk3 themes (see also 130329).
  172. #130404 01micko: link to actual gtk3 theme.
  173. #130418 support kmod. but, still use old depmod from module-init-tools in initrd (as unable to compile kmod statically).
  174. #130430 coreutils 8.20 cp outputs different error message.
  175. #130430 fix depmod symlink.
  176. #130430 gpu/drm/sis.ko needs video/sis/sisfb.ko, must keep. WARNING: sisfb is blacklisted -- as mucks up my pc that has sis video and only vesa works.
  177. #130510 support multiarch for debian wheezy.
  178. #130512 scsijon: dpi size setting not working.
  179. #130515 ask disable 'pupdesk.flg' mechanism, see also init script in initrd.
  180. #130530 write puppy files to SD image file, not to card.
  181. #130601 new script support/setup-spot, optional run internet apps as user 'spot'.
  182. #130604 tweak 130601.
  183. #130612 support devtmpfs. see also 'init' script in initrd.
  184. #130613 kmod depmod wants modules.builtin, modules.order.
  185. #130618 modify 130612.
  186. #130618 restore the "layer:" lines in /etc/xdg/templates/_root_.jwmrc.
  187. #130710 01micko: DEVTMPFSFLG bug fix.
  188. #130720 add QtWeb option to run as spot. 130721 fixes.
  189. #130723 add opera option to run as spot.
  190. #130725 if alternate-browser, set defaulthtmlviewer to it. 130726 fix.
  191. #130821 add firefox option to run as spot.
  192. #v431 accepts passed params, from woof_gui_tabs:
  193. #$1=$CHOICE_KERNELPKG $2=$CHOICE_SCSI $3=$CHOICE_BIGMODEM $4=$CHK_FB_STATE $5=$CHK_EXOTIC_STATE $6=$CHK_RADICAL_STATE
  194. #100912 add $7=CHK_SIMPLE_FILENAMES
  195. export LANG=C #faster.
  196. #w482 use xorriso if it is installed (see also functions4puppy)...
  197. CDRECORD='cdrecord'
  198. MKISOFS='mkisofs'
  199. if [ "`which xorriso`" != "" ];then
  200. CDRECORD='xorrecord'
  201. MKISOFS='xorrisofs' #growisofs reads this variable.
  202. fi
  203. export CDRECORD MKISOFS
  204. . ./DISTRO_SPECS #this has DISTRO_VERSION.
  205. if [ ! "$DISTRO_DB_SUBNAME" ];then #121102
  206. DISTRO_DB_SUBNAME="$DISTRO_COMPAT_VERSION" #fallback if DISTRO_DB_SUBNAME not defined in file DISTRO_SPECS.
  207. echo '#subname for online PETs dir. Ex: "slacko14", dir "pet_packages-slacko14", db file "Packages-puppy-slacko14-official":
  208. #note: prior to existence of this variable, online subname was set to $DISTRO_COMPAT_VERSION or via some hack code.
  209. ' >> ./DISTRO_SPECS
  210. echo "DISTRO_DB_SUBNAME='${DISTRO_DB_SUBNAME}'" >> ./DISTRO_SPECS
  211. fi
  212. if [ -f ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  213. . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  214. else
  215. . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT} #130306
  216. fi
  217. if [ -f ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then #w478
  218. . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} #has FALLBACKS_COMPAT_VERSIONS
  219. else
  220. . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT} #has FALLBACKS_COMPAT_VERSIONS
  221. fi
  222. . ./PKGS_MANAGEMENT #101013 want variable PKG_PREFER_OLDER.
  223. . ./DISTRO_PET_REPOS #120506 want variable PACKAGELISTS_PET_ORDER
  224. if [ -f WOOFMERGEVARS ];then #111123
  225. . ./WOOFMERGEVARS #has variables WOOF_HOSTARCH, WOOF_TARGETARCH, WOOF_COMPATDISTRO, WOOF_COMPATVERSION
  226. else
  227. echo 'File WOOFMERGEVARS does not exist. This is created by script
  228. merge2out. Your setup is wrong, quiting.'
  229. exit
  230. fi
  231. #100911 simple filenames, want idstring...
  232. #IDDATE="`date +%y%m%d%H%M%S`" #12 bytes, ex: 100911153319
  233. #IDPREFIX="`echo -n "$DISTRO_FILE_PREFIX" | cut -b 1`"
  234. #vDISTRO_VERSION="`echo -n "$DISTRO_VERSION" | cut -b 1-3`" #in case it ever gets bigger than 3 chars.
  235. #IDSTRING="${IDPREFIX}${vDISTRO_VERSION}${IDDATE}"
  236. #110422 increase size of idstring to 32 bytes...
  237. IDDATE="`date +%y%m%d%H%M%S`" #12 bytes, ex: 100911153319
  238. IDPREFIX="`echo -n "$DISTRO_FILE_PREFIX" | cut -b 1`"
  239. IDSTRING="${IDPREFIX}${IDDATE}ZZZZ${DISTRO_VERSION}"
  240. #...ZZZZ reserved space for future use.
  241. LEN1=`echo -n "$IDSTRING" | wc -c`
  242. LEN2=`expr 32 - $LEN1`
  243. EXTX=''
  244. while [ $LEN2 -gt 0 ];do
  245. LEN2=`expr $LEN2 - 1`
  246. EXTX="${EXTX}X"
  247. done
  248. IDSTRING="${IDSTRING}${EXTX}" #32 bytes ex: w110423092024ZZZZ5.1.2XXXXXXXXXX
  249. #the files that have compatible-distro pkg docs (these were downloaded by 0setup)...
  250. PKGLISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | tr '\n' ' ' | sed -e 's% $%%'`" #see file DISTRO_PKGS_SPECS-ubuntu
  251. #...format ex: 'Packages-ubuntu-intrepid-main Packages-ubuntu-intrepid-universe'
  252. WKGDIR="`pwd`"
  253. #120506 params passed from woof_gui_tabs. moved up...
  254. KERNELPKG=""
  255. [ $1 ] && KERNELPKG="$1"
  256. CHOICE_SCSI=""
  257. [ $2 ] && CHOICE_SCSI="$2" #Erase_SCSI, Keep_SCSI, Boot_SCSI
  258. CHOICE_BIGMODEM=""
  259. [ $3 ] && CHOICE_BIGMODEM="$3" #Erase_big_modems Keep_big_modems Zdrv_big_modems
  260. CHK_FB_STATE=""
  261. [ $4 ] && CHK_FB_STATE="$4"
  262. CHK_EXOTIC_STATE=""
  263. [ $5 ] && CHK_EXOTIC_STATE="$5"
  264. CHK_RADICAL_STATE=""
  265. [ $6 ] && CHK_RADICAL_STATE="$6"
  266. #120506
  267. echo
  268. echo "Do you want to create a live-CD .iso file, which is the normal choice for a
  269. PC-compatible target, or is your target an SD-card for an ARM-based board?
  270. In the latter case, you would already have downloaded an SD-card skeleton image
  271. file into folder 'sd-skeleton-images' (done by script '1download') -- if there
  272. is no image file in that folder, you cannot choose the SD-card option.
  273. The latter choice will also require an SD card to write to, and you must have
  274. it available now."
  275. echo "WARNING: for the SD-card option, you must have enough free space in the
  276. current directory ${WKGDIR}/sandbox3
  277. to expand the SD image file, typically 4GB."
  278. echo "Press ENTER only for normal .iso creation, or "
  279. echo -n "any other printable character for SD-card: "
  280. read SDFLAG
  281. #120714 ask what type of arm board...
  282. if [ "$SDFLAG" != "" ];then
  283. echo "...ok, chose sd-card image."
  284. echo
  285. echo "Type number of board that you are building for:
  286. 1 Raspberry Pi
  287. 2 Mele A1000 or A2000 (or other A10 board)
  288. 3 ODROID-X (or other Exynos 4412 board)"
  289. read boardnum
  290. case $boardnum in
  291. 1) BOOT_BOARD='raspi' ;;
  292. 2) BOOT_BOARD='mele' ;;
  293. *) BOOT_BOARD='odroidx' ;;
  294. esac
  295. echo "...you chose $BOOT_BOARD"
  296. fi
  297. if [ "$SDFLAG" != "" ];then
  298. #override module choices, as kernel is built customized to particular hardware...
  299. CHOICE_BIGMODEM="Keep_big_modems"
  300. CHOICE_SCSI="Keep_SCSI"
  301. CHK_FB_STATE="false"
  302. CHK_EXOTIC_STATE="false"
  303. CHK_RADICAL_STATE="false"
  304. CHK_YES_ZDRV="false"
  305. fi
  306. #w003 remove comments from PKGS_SPECS_TABLE
  307. PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep -v '^#'`"
  308. mkdir -p sandbox3
  309. export DISTRO_NAME
  310. export DISTRO_VERSION
  311. if [ "`echo -n "$DISTRO_VERSION" | grep '\.'`" = "" ];then #110422
  312. DIGIT1="`echo "$DISTRO_VERSION" | cut -b 1`"
  313. DIGIT2="`echo "$DISTRO_VERSION" | cut -b 2`"
  314. DIGIT3="`echo "$DISTRO_VERSION" | cut -b 3`"
  315. RIGHTVER="${DIGIT1}.${DIGIT2}.${DIGIT3}"
  316. [ "$DIGIT3" = "0" ] && RIGHTVER="${DIGIT1}.${DIGIT2}"
  317. else
  318. RIGHTVER="$DISTRO_VERSION"
  319. fi
  320. #the kernel is supposed to be a .pet package, already downloaded into packages-pet...
  321. echo
  322. if [ "$KERNELPKG" = "" ];then
  323. #110823
  324. KERNELPKG="$DISTRO_KERNEL_PET"
  325. echo "The kernel pkg that you are using is: $KERNELPKG"
  326. echo "This is specified in variable DISTRO_KERNEL_PET in file DISTRO_SPECS,"
  327. echo "which is set in the first GUI tab of script woof_gui, or in script 1download,"
  328. echo "or you can directly edit DISTRO_SPECS -- but please do so early-on, before"
  329. echo "running script 1download, as Woof needs to know the kernel version to"
  330. echo "properly resolve some dependencies, possible packages that are dependent"
  331. echo "on a certain kernel version."
  332. echo "Note, the linux_kernel PET needs to be in directory packages-pet."
  333. echo -n "Press ENTER to continue: "
  334. read keepgoing
  335. fi
  336. #110826...
  337. #KERNELVER="`echo "$KERNELPKG" | cut -f 2 -d '-'`"
  338. ##um, if it is named 'linux-2.6.29-rc7-*.pet' then get 2 fields...
  339. #[ "`echo -n "$KERNELPKG" | grep '\-rc[0-9]\-'`" != "" ] && KERNELVER="`echo "$KERNELPKG" | cut -f 2,3 -d '-'`"
  340. ##100204 may be like this 2.6.33-rc6-git2...
  341. #[ "`echo -n "$KERNELPKG" | grep '\-git[0-9]\-'`" != "" ] && KERNELVER="`echo "$KERNELPKG" | rev | grep -o '[0-9]tig\-.*' | rev | cut -f 2- -d '-'`"
  342. ##100209 special case...
  343. #[ "`echo -n "$KERNELPKG" | grep '\-vortex86'`" != "" ] && KERNELVER="`echo "$KERNELPKG" | cut -f 2,3 -d '-'`"
  344. ##110512 special case... format linux-2.6.32-40-w5
  345. #dotnum="`echo -n "$KERNELVER" | sed -e 's%[^\.]%%g' | wc -c`"
  346. #if [ "$dotnum" = "2" ];then
  347. # SUB_SUB_KERNELVER=`echo -n "$KERNELPKG" | cut -f 3 -d '-'`
  348. #else
  349. # SUB_SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 4 -d '.'`
  350. #fi
  351. #SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 3 -d '.'`
  352. #110826
  353. KERNELVER="`tar --list -z -f packages-pet/${KERNELPKG} 2>/dev/null | grep -o '/lib/modules/[23]\..*' | head -n 1 | cut -f 4 -d '/'`" #120502 hide error msg.
  354. dotnum="`echo -n "$KERNELVER" | sed -e 's%[^\.]%%g' | wc -c`"
  355. if [ "$dotnum" = "2" ];then
  356. #SUB_SUB_KERNELVER=`echo -n "$KERNELPKG" | cut -f 3 -d '-'`
  357. SUB_SUB_KERNELVER=0 #cos we don't really know what it is.
  358. else
  359. SUB_SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 4 -d '.'`
  360. fi
  361. SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 3 -d '.'`
  362. MAJ_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 1 -d '.'` #111014 2 or 3.
  363. echo
  364. echo "You have chosen $KERNELPKG, which is version $KERNELVER."
  365. #echo -n "Press ENTER to continue: "
  366. #read continue1
  367. #if >= 2.6.29 kernel, use mksquashfs v4.0...
  368. if [ "$MAJ_KERNELVER" = "2" ];then
  369. MKSQUASHFS='mksquashfs3.3'
  370. [ $SUB_KERNELVER -ge 29 ] && MKSQUASHFS='mksquashfs4.0'
  371. [ $SUB_KERNELVER -ge 39 ] && MKSQUASHFS='mksquashfs4.2' #110713
  372. #[ $SUB_KERNELVER -eq 18 ] && MKSQUASHFS='mksquashfs3.1' #w478
  373. #[ $SUB_KERNELVER -eq 18 ] && MKSQUASHFS='mksquashfs3.2' #w478 old 2.6.18.1 kernel
  374. [ $SUB_KERNELVER -eq 18 ] && MKSQUASHFS='mksquashfs3.3' #w479 2.6.18.8 kernel
  375. [ $SUB_KERNELVER -eq 18 ] && [ $SUB_SUB_KERNELVER -eq 1 ] && MKSQUASHFS='mksquashfs3.2' #w479
  376. [ $SUB_KERNELVER -eq 27 ] && [ $SUB_SUB_KERNELVER -gt 46 ] && MKSQUASHFS='mksquashfs4.0' #100607
  377. else #111014
  378. MKSQUASHFS='mksquashfs4.2'
  379. fi
  380. SQUASHFSMAJOR="`echo -n "$MKSQUASHFS" | cut -f 1 -d '.' | rev | cut -c 1`" #3 or 4.
  381. if [ "$MKSQUASHFS" = "mksquashfs4.2" ];then #110713
  382. echo
  383. echo ".sfs files are normally compressed with gzip."
  384. echo "However, this kernel supports xz, which is higher compression."
  385. echo -n "Press ENTER only for gzip, any other char for xz: "
  386. read XZCHOICE
  387. if [ "$XZCHOICE" ];then
  388. echo "...xz chosen"
  389. COMPCHOICE='-comp xz'
  390. else
  391. echo "...gzip chosen"
  392. COMPCHOICE=''
  393. fi
  394. fi
  395. #110823
  396. echo
  397. ./findwoofinstalledpkgs #creates woof-installed-packages, which later gets copied into sandbox3/rootfs-complete/root/.packages/
  398. #121028 ...now also creates devx-only-installed-packages.
  399. #100912 choose simple or traditional filenames...
  400. #traditional names...
  401. PREFIX1CHAR="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1`"
  402. KERNEL3CHARS="`echo -n "$KERNELVER" | tr -d '.' | tr -d '\-' | tr -d '[a-z]' | rev | cut -c 1,2,3 | rev`"
  403. #tradZDRVSFS="z${PREFIX1CHAR}${DISTRO_VERSION}${KERNEL3CHARS}.sfs" #ex: zw071629.sfs
  404. #tradDEVXSFS="${DISTRO_FILE_PREFIX}_devx_${DISTRO_VERSION}.sfs" #ex: wary_devx_071.sfs
  405. ##tradPUPPYSFS="${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.sfs" #ex: wary-071.sfs
  406. ##tradZDRVSFS="zdrv_${DISTRO_VERSION}.sfs"
  407. ##tradDEVXSFS="devx_${DISTRO_VERSION}.sfs"
  408. #tradPUPPYSFS="${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  409. #110422 new traditional names...
  410. tradPUPPYSFS="puppy_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  411. tradZDRVSFS="zdrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  412. tradDEVXSFS="devx_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  413. if [ $7 ];then #passed in from woof_gui
  414. CHK_SIMPLE_FILENAMES="$7"
  415. else
  416. echo
  417. echo "Woof can build to use traditional or simplified filenames."
  418. echo "The simplified filenames do not have any distro or version information in their"
  419. echo "names: vmlinuz, initrd.gz, puppy.sfs, zdrv.sfs"
  420. echo "The traditional names look like this:"
  421. echo "vmlinuz, initrd.gz, ${tradPUPPYSFS}, ${tradZDRVSFS}"
  422. echo "Note that there are many apps that use the traditional names, such as CD"
  423. echo "remaster applications, though the official Woof scripts should be all working"
  424. echo "with both naming schemes. To complicate matters, there is some variation in"
  425. echo "the traditional names with different versions of Puppy, so best to use scripts"
  426. echo "that have been updated to work will the names stored in file DISTRO_SPECS: so"
  427. echo "note that the chosen names are available in a running Puppy in /etc/DISTRO_SPECS"
  428. echo "as these variables: DISTRO_PUPPYSFS, DISTRO_ZDRVSFS"
  429. echo -n "Press ENTER only for simplified names (any char otherwise): "
  430. read read_simple
  431. CHK_SIMPLE_FILENAMES='true' #simple.
  432. [ "$read_simple" ] && CHK_SIMPLE_FILENAMES='false'
  433. fi
  434. if [ "$CHK_SIMPLE_FILENAMES" = "true" ];then
  435. echo '...simple chosen'
  436. PUPPYSFS='puppy.sfs'
  437. ZDRVSFS='zdrv.sfs'
  438. DEVXSFS='devx.sfs'
  439. else
  440. echo '...traditional chosen'
  441. PUPPYSFS="$tradPUPPYSFS"
  442. ZDRVSFS="$tradZDRVSFS"
  443. DEVXSFS="$tradDEVXSFS"
  444. fi
  445. #now build rootfs-complete, the main filesystem...
  446. echo
  447. echo "Now building sandbox3/rootfs-complete, with the complete filesystem..."
  448. echo '#!/bin/sh' > sandbox3/pinstall.sh
  449. rm -rf sandbox3/rootfs-complete
  450. sync
  451. mkdir sandbox3/rootfs-complete
  452. mkdir sandbox3/rootfs-complete/etc
  453. #no, confusing, assign to history...
  454. #echo -n "$DISTRO_VERSION" > sandbox3/rootfs-complete/etc/puppyversion #for backwards compat. old scripts.
  455. cp DISTRO_SPECS sandbox3/rootfs-complete/etc/
  456. #copy the skeleton...
  457. cp -a rootfs-skeleton/* sandbox3/rootfs-complete/
  458. cat sandbox3/rootfs-complete/pinstall.sh >> sandbox3/pinstall.sh
  459. rm -f sandbox3/rootfs-complete/pinstall.sh
  460. rm -f /tmp/3builddistro_removed_alt 2>/dev/null #101013
  461. #120315 Ubuntu Precise Pangolin has done a big move of files from /lib to /lib/i386-linux-gnu and /usr/lib to /usr/lib/i386-linuxgnu
  462. #well, i want to move them back. symlinks will do it (cp below does not destroy them)...
  463. #120316 note, see also 2createpackages.
  464. #if [ ! -e packages-${DISTRO_FILE_PREFIX}/glibc/lib/libc.so.6 ];then
  465. # #ARCHDIR="`find packages-${DISTRO_FILE_PREFIX}/glibc/lib -mindepth 2 -maxdepth 2 -name 'libc.so.6' | head -n 1 | rev | cut -f 2 -d '/' | rev`"
  466. # ARCHDIR=''
  467. # case $WOOF_TARGETARCH in #see file WOOFMERGEVARS
  468. # x86) ARCHDIR='i386-linux-gnu' ;;
  469. # x86_64) ARCHDIR='x86_64-linux-gnu' ;;
  470. # arm) #120720 120721
  471. # case $WOOF_COMPATDISTRO in #see file WOOFMERGEVARS
  472. # raspbian) ARCHDIR='arm-linux-gnueabihf' ;;
  473. # debian)
  474. # case $WOOF_COMPATVERSION in
  475. # squeeze) true ;; #old release
  476. # *) ARCHDIR='arm-linux-gnueabihf' ;;
  477. # esac
  478. # ;;
  479. # ubuntu)
  480. # case $WOOF_COMPATVERSION in
  481. # jaunty|karmic|lucid) true ;; #old releases.
  482. # *) ARCHDIR='arm-linux-gnueabihf' ;;
  483. # esac
  484. # ;;
  485. # esac
  486. # ;;
  487. # esac
  488. # if [ "$ARCHDIR" ];then #ex: i386-linux-gnu
  489. # ln -snf ./ sandbox3/rootfs-complete/lib/${ARCHDIR}
  490. # ln -snf ./ sandbox3/rootfs-complete/usr/lib/${ARCHDIR}
  491. # ln -snf ./ sandbox3/rootfs-complete/usr/bin/${ARCHDIR} #120909
  492. # fi
  493. #fi
  494. #121210 fix, ARCHDIR was not getting set...
  495. ARCHDIR=''
  496. if [ "$WOOF_COMPATDISTRO" = "ubuntu" ];then
  497. case $WOOF_COMPATVERSION in
  498. jaunty|karmic|lucid) #old releases.
  499. true
  500. ;;
  501. *)
  502. case $WOOF_TARGETARCH in
  503. x86) ARCHDIR='i386-linux-gnu' ;;
  504. x86_64) ARCHDIR='x86_64-linux-gnu' ;;
  505. esac
  506. ;;
  507. esac
  508. fi
  509. if [ "$WOOF_COMPATDISTRO" = "debian" ];then #130510
  510. case $WOOF_COMPATVERSION in
  511. squeeze|lenny|etch|sarge|woody) #old releases.
  512. true
  513. ;;
  514. *) #wheezy and later...
  515. case $WOOF_TARGETARCH in
  516. x86) ARCHDIR='i386-linux-gnu' ;;
  517. x86_64) ARCHDIR='x86_64-linux-gnu' ;;
  518. esac
  519. ;;
  520. esac
  521. fi
  522. if [ "$WOOF_COMPATDISTRO" = "mageia" ];then #130111
  523. case $WOOF_TARGETARCH in
  524. x86) ARCHDIR='multiarch-i386-linux' ;;
  525. *) ARCHDIR=''; echo 'dunno'; exit ;;
  526. esac
  527. fi
  528. case $WOOF_TARGETARCH in
  529. arm)
  530. case $WOOF_COMPATDISTRO in #see file WOOFMERGEVARS
  531. raspbian) ARCHDIR='arm-linux-gnueabihf' ;; #different from debian/ubuntu, compiled for armv6 hf.
  532. debian)
  533. case $WOOF_COMPATVERSION in
  534. squeeze) true ;; #old release
  535. *) ARCHDIR='arm-linux-gnueabihf' ;;
  536. esac
  537. ;;
  538. ubuntu)
  539. case $WOOF_COMPATVERSION in
  540. jaunty|karmic|lucid) true ;; #old releases.
  541. *) ARCHDIR='arm-linux-gnueabihf' ;;
  542. esac
  543. ;;
  544. esac
  545. ;;
  546. esac
  547. #130114 revert 130112...
  548. if [ "$ARCHDIR" ];then #ex: i386-linux-gnu
  549. # #130112 multiarch symlinks now optional...
  550. # if [ "$DISTRO_ARCHDIR_SYMLINKS" = "" ];then #this now created in 2createpackages.
  551. # echo
  552. # echo "Woof-built puppies up until Dec 2012 have multiarch dirs as symlinks,
  553. #for example /usr/lib/i386-linux-gnu is a symlink to /usr/lib in Debian/Ubuntu
  554. #based pups. However, in future builds will by default retain the multiarch
  555. #sub-directories."
  556. # echo -n "ENTER only to retain multiarch dirs: "
  557. # read flagmultiarchdirs
  558. # else
  559. # flagmultiarchdirs=""
  560. # [ "$DISTRO_ARCHDIR_SYMLINKS" = "yes" ] && flagmultiarchdirs="yes"
  561. # fi
  562. # if [ "$flagmultiarchdirs" != "" ];then
  563. # echo "...Creating multiarch symlinks"
  564. # ln -snf ./ sandbox3/rootfs-complete/lib/${ARCHDIR}
  565. # ln -snf ./ sandbox3/rootfs-complete/usr/lib/${ARCHDIR}
  566. # ln -snf ./ sandbox3/rootfs-complete/usr/bin/${ARCHDIR} #120909
  567. # xDISTRO_ARCHDIR_SYMLINKS='yes'
  568. # else
  569. # echo
  570. # echo "...Multiarch directories retained"
  571. # mkdir -p sandbox3/rootfs-complete/lib/${ARCHDIR}
  572. # echo "/lib/${ARCHDIR}" >> sandbox3/rootfs-complete/etc/ld.so.conf
  573. # #do we really need to populate LD_LIBRARY_PATH if already in ld.so.conf?
  574. # libPTN="s%^LD_LIBRARY_PATH=\"%LD_LIBRARY_PATH=\"/lib/${ARCHDIR}:%"
  575. # sed -i -e "$libPTN" sandbox3/rootfs-complete/etc/profile
  576. # mkdir -p sandbox3/rootfs-complete/usr/lib/${ARCHDIR}
  577. # echo "/usr/lib/${ARCHDIR}" >> sandbox3/rootfs-complete/etc/ld.so.conf
  578. # libPTN="s%^LD_LIBRARY_PATH=\"%LD_LIBRARY_PATH=\"/usr/lib/${ARCHDIR}:%"
  579. # sed -i -e "$libPTN" sandbox3/rootfs-complete/etc/profile
  580. # mkdir -p sandbox3/rootfs-complete/usr/bin/${ARCHDIR}
  581. # binPTN="s%^PATH=\"%PATH=\"/usr/bin/${ARCHDIR}:%"
  582. # sed -i -e "$binPTN" sandbox3/rootfs-complete/etc/profile
  583. # xDISTRO_ARCHDIR_SYMLINKS='no'
  584. # fi
  585. ln -snf ./ sandbox3/rootfs-complete/lib/${ARCHDIR}
  586. ln -snf ./ sandbox3/rootfs-complete/usr/lib/${ARCHDIR}
  587. ln -snf ./ sandbox3/rootfs-complete/usr/bin/${ARCHDIR} #120909
  588. fi
  589. PKGLIST="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | cut -f 2 -d '|' | tr '\n' ' '`"
  590. for ONEPKG in $PKGLIST
  591. do
  592. if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG} ];then
  593. if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DEV ];then #pkg may go entirely into devx.
  594. if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DOC ];then #pkg may go entirely into docs.
  595. echo "WARNING, PKG DOES NOT EXIST: packages-${DISTRO_FILE_PREFIX}/${ONEPKG}"
  596. continue
  597. fi
  598. fi
  599. fi
  600. #110923 avoid conflict between busybox applets and full utilities...
  601. [ "$ONEPKG" == "busybox" ] && continue #see below.
  602. #cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}/* sandbox3/rootfs-complete/ 2> /dev/null
  603. #w003 problem. pet pkg seamonkey_addon_adblock has files in /usr/lib/seamonkey but in rootfs-complete
  604. #usr/lib/seamonkey is a symlink to seamonkey-1.1.14 and copy fails. this will follow path with a
  605. #symlink (hopefully doesn't break something else)...
  606. #looks okay. the --remove-destination ensures that if target file already exists as a symlink
  607. #it will be deleted first and won't be followed. shit no, it changed /usr/lib/seamonkey into a dir...
  608. #cp -r --preserve=mode,ownership,timestamps,links --dereference --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}/* sandbox3/rootfs-complete/ 2> /dev/null
  609. #/usr/sbin/petget solves this a different way, let's try that...
  610. #130430 new problem with coreutils 8.20... ex building raring pup...
  611. #ex: cp -a --remove-destination packages-raring/synclient/* sandbox3/rootfs-complete/
  612. #coreutils 5.2.1 stderr: cannot overwrite non-directory `sandbox3/rootfs-complete/usr/X11' with directory `packages-raring/synclient/usr/X11'
  613. #coreutils 8.20 (in Raring) stderr: cp: cannot overwrite non-directory ‘sandbox3/rootfs-complete/usr/X11’ with directory ‘packages-raring/synclient/usr/X11’
  614. #...!!!! ok, attempt to fix...
  615. cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}/* sandbox3/rootfs-complete/ 2> /tmp/3builddistro-cp-errlog
  616. sync #110727 running drake pup 0.3 with k2.6.39-3 new laptop, mysterious loss of dirs/files. try sync.
  617. if [ -s /tmp/3builddistro-cp-errlog ];then #130430 next line fixes those quote chars...
  618. cat /tmp/3builddistro-cp-errlog | grep 'cannot overwrite non-directory' | tr '[`‘’]' "'" | cut -f 2 -d "'" |
  619. while read ONEDIRSYMLINK
  620. do
  621. xONEDIRSYMLINK="`echo -n "$ONEDIRSYMLINK" | sed -e 's%sandbox3/rootfs-complete%%'`"
  622. #adding that extra trailing / does the trick...
  623. cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}${xONEDIRSYMLINK}/* sandbox3/rootfs-complete${xONEDIRSYMLINK}/
  624. done
  625. fi
  626. #...now seems ok. note, there are two places in woof v003 where this problem occurs: /usr/lib/seamonkey
  627. # and /usr/share/cups/model.
  628. if [ -f sandbox3/rootfs-complete/pinstall.sh ];then
  629. #note, do not filter #! /bin/sh (with a space)...
  630. grep -E -v '^\#\!\/bin\/sh' sandbox3/rootfs-complete/pinstall.sh >> sandbox3/pinstall.sh
  631. rm -f sandbox3/rootfs-complete/pinstall.sh
  632. fi
  633. #get rid of a .specs file...
  634. rm -f sandbox3/rootfs-complete/*.specs
  635. #window and menu icons can also be in the top-level directory of the package...
  636. mv sandbox3/rootfs-complete/*24.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  637. mv sandbox3/rootfs-complete/*32.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  638. mv sandbox3/rootfs-complete/*32.png sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  639. mv sandbox3/rootfs-complete/*48.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  640. mv sandbox3/rootfs-complete/*48.png sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  641. mv sandbox3/rootfs-complete/*.xpm sandbox3/rootfs-complete/usr/local/lib/X11/mini-icons/ 2>/dev/null
  642. mv sandbox3/rootfs-complete/*.png sandbox3/rootfs-complete/usr/local/lib/X11/mini-icons/ 2>/dev/null
  643. done
  644. #110923 fix busybox applets...
  645. DEVXUTILS=' config ar ar86 as as86 audiofile-config autoconf autoheader autom4te automake autopoint autoreconf autoscan autoupdate bacon bacongui bcc bison c2ph catchsegv cc ccmake chem cmake combinediff config_data corelist cpack cpan cpan2dist cpanp cpanp-run-perl cpp ctest cups-config curl-config cvs cvsbug db_archive db_checkpoint db_deadlock db_dump db_hotbackup db_load db_printlog db_recover db_stat db_upgrade db_verify dehtmldiff diet dnsd dprofpp dvdnav-config dvdread-config editdiff elftrunc enc2xs envsubst eqn eqn2graph espdiff filterdiff find2perl fixcvsdiff flex flipdiff freetype-config gccbug gcov gdb gdbserver gdbtui gdiffmk gencat getconf getent gettext gettext.sh gettextize gfortran git git-cvsserver git-receive-pack git-shell git-upload-archive git-upload-pack gitk glade-3 gmake gnome-menu-spec-test gperf gphoto2-config gphoto2-port-config gprof grap2graph grepdiff grn grodvi groff groffer grog grolbp grolj4 grops grotty h2ph h2xs hpftodit iconv idle ifnames indxbib info infokey install-info instmodsh interdiff intltool-extract intltool-merge intltool-prepare intltool-update intltoolize ld ld86 ldd lddlibc4 lex lib-i386 libart2-config libnetcfg libpng-config libpng12-config libtool libtoolize libusb-config lkbib locale localedef lookbib lsdiff m4 make makeinfo man man1 man2dvi man2html mmroff msgattrib msgcat msgcmp msgcomm msgconv msgen msgexec msgfilter msgfmt msggrep msginit msgmerge msgunfmt msguniq mtrace nasm ndisasm neon-config neqn netpbm-config ngettext nm nm86 nroff objcopy objdump objdump86 onsgmls osgmlnorm ospam ospcat ospent osx patch pcap-config pcprofiledump pcre-config pdfroff pdftexi2dvi perl perlbug perldoc perlivp perlthanks pfbtops pic pic2graph piconv pkg-config pl2pm pod2html pod2latex pod2man pod2text pod2usage podchecker podselect post-grohtml pre-grohtml preconv prove psed pstruct ptar ptardiff pydoc ranlib rcs2log readelf recode-sr-latin recountdiff rediff refer rman roff2dvi roff2html roff2pdf roff2ps roff2text roff2x rpcgen s2p sane-config scrollkeeper-config scrollkeeper-extract scrollkeeper-gen-seriesid scrollkeeper-get-cl scrollkeeper-get-content-list scrollkeeper-get-extended-content-list scrollkeeper-get-index-from-docpath scrollkeeper-get-toc-from-docpath scrollkeeper-get-toc-from-id scrollkeeper-install scrollkeeper-preinstall scrollkeeper-rebuilddb scrollkeeper-uninstall scrollkeeper-update shasum size size86 soelim splain splitdiff sprof strace strace-graph strings strip svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion sysprof sysprof-cli tbl texi2dvi texi2pdf texindex tfmtodit troff tzselect unwrapdiff update-mime-database vsyasm whatis xgettext xml2-config xslt-config xsubpp xtrace yacc yasm ytasm zsoelim iconvconfig makewhatis nscd rpcinfo visudo zic ' #11104 111204 remove zdump.
  646. cp -a -f packages-${DISTRO_FILE_PREFIX}/busybox/bin/busybox ./sandbox3/rootfs-complete/bin/
  647. osPTN="s%packages-${DISTRO_FILE_PREFIX}/busybox%%"
  648. for ONEAPPLET in `find packages-${DISTRO_FILE_PREFIX}/busybox -type l | tr '\n' ' '`
  649. do
  650. ONESPEC="`echo -n "$ONEAPPLET" | sed -e "$osPTN"`"
  651. ONEPATH="`dirname $ONESPEC`"
  652. ONENAME="`basename $ONESPEC`"
  653. FNDFULL="`find ./sandbox3/rootfs-complete/bin ./sandbox3/rootfs-complete/sbin ./sandbox3/rootfs-complete/usr/bin ./sandbox3/rootfs-complete/usr/sbin -name ${ONENAME}`"
  654. #130129 deb 'bsdmainutils' has broken 'cal' and 'hd' symlinks... 130204 01micko: fix for spaces in names...
  655. if [ "$FNDFULL" ];then
  656. if [ -h "$FNDFULL" ];then
  657. FULLPATH="$(dirname "$FNDFULL")"
  658. FULLLINK="$(readlink "$FNDFULL")"
  659. xFULLLINK="${FULLPATH}/${FULLLINK}"
  660. [ "`echo -n "$FULLLINK" | cut -c 1`" = "/" ] && xFULLLINK="sandbox3/rootfs-complete${FULLLINK}"
  661. if [ ! -e "${xFULLLINK}" ];then
  662. rm -f "$FNDFULL" #130130
  663. FNDFULL=""
  664. fi
  665. fi
  666. fi
  667. #111004 need to check in devx also...
  668. if [ ! "$FNDFULL" ];then
  669. if [ "$ONENAME" != "[" ];then
  670. if [ "$ONENAME" != "[[" ];then
  671. oaPTN=" ${ONENAME} "
  672. FNDFULL="`echo -n "$DEVXUTILS" | grep "$oaPTN"`"
  673. fi
  674. fi
  675. fi
  676. if [ "$FNDFULL" ];then
  677. cp -a -f $ONEAPPLET ./sandbox3/rootfs-complete${ONEPATH}/${ONENAME}-BB-NOTUSED
  678. else
  679. cp -a -f $ONEAPPLET ./sandbox3/rootfs-complete${ONEPATH}/
  680. fi
  681. done
  682. [ -f packages-${DISTRO_FILE_PREFIX}/busybox/pinstall.sh ] && cat packages-${DISTRO_FILE_PREFIX}/busybox/pinstall.sh >> sandbox3/pinstall.sh
  683. echo 'echo "END OF pinstall.sh SCRIPT."' >> sandbox3/pinstall.sh
  684. chmod 755 sandbox3/pinstall.sh
  685. #run post-install script...
  686. echo
  687. echo "Executing sandbox3/pinstall.sh post-install script..."
  688. cd $WKGDIR/sandbox3/rootfs-complete
  689. SAVEWKGDIR="$WKGDIR"
  690. $WKGDIR/sandbox3/pinstall.sh
  691. echo "If you did not get 'End of pinstall.sh' message above, then"
  692. echo -n "it aborted before completion. Press ENTER or CTRL-C: "
  693. read isitbad
  694. WKGDIR="$SAVEWKGDIR"
  695. cd $WKGDIR
  696. #100316 script to handle improper shutdown, full hd install...
  697. if [ -f sandbox3/rootfs-complete/sbin/initNEW ];then
  698. rm -f sandbox3/rootfs-complete/sbin/init #a busybox link.
  699. mv -f sandbox3/rootfs-complete/sbin/initNEW sandbox3/rootfs-complete/sbin/init
  700. fi
  701. #now do dependency check...
  702. dependcheck() {
  703. echo -n "" > /tmp/missinglibs.txt
  704. echo -n "" > /tmp/notmissinglibs0.txt
  705. echo -n "" > /tmp/notusedlibs.txt
  706. #FNDFILES="`find $WKGDIR/sandbox3/rootfs-complete -type f | tr "\n" " "`"
  707. #for ONEFILE in $FNDFILES
  708. find $WKGDIR/sandbox3/rootfs-complete -type f | #110516
  709. while read ONEFILE #110516
  710. do
  711. echo -n '.'
  712. ISANEXEC="`file --brief $ONEFILE | grep -E "LSB executable|shared object"`"
  713. if [ ! "$ISANEXEC" = "" ];then
  714. #need to chroot into rootfs-complete...
  715. NUMBYTESALL="`echo -n "$ONEFILE" | wc -c | tr -s " " | cut -f 2 -d " "`"
  716. NUMBYTESHD=`echo -n "$WKGDIR/sandbox3/rootfs-complete" | wc -c | tr -s " " | cut -f 2 -d " "`
  717. NUMBYTESHD="`expr $NUMBYTESHD + 1`"
  718. NEWROOTFILE="`echo -n "$ONEFILE" | cut -b $NUMBYTESHD-$NUMBYTESALL`"
  719. LDDRESULT="`chroot ${WKGDIR}/sandbox3/rootfs-complete ldd ${NEWROOTFILE}`"
  720. MISSINGLIBS="`echo "$LDDRESULT" | grep "not found" | cut -f 2 | cut -f 1 -d " " | tr "\n" " "`"
  721. if [ ! "$MISSINGLIBS" = "" ];then
  722. echo "File $ONEFILE has these missing library files:" >> /tmp/missinglibs.txt
  723. echo " $MISSINGLIBS" >> /tmp/missinglibs.txt
  724. echo "The missing libs are in these packages:" >> /tmp/missinglibs.txt
  725. for ONEMISSING in $MISSINGLIBS
  726. do
  727. find ${WKGDIR}/packages-${DISTRO_FILE_PREFIX} -name $ONEMISSING >> /tmp/missinglibs.txt
  728. done
  729. fi
  730. #find all libs not missing...
  731. NOTMISSING="`file --brief $ONEFILE | grep -v "not found" | grep "shared object"`"
  732. if [ "$NOTMISSING" != "" ];then
  733. basename "$ONEFILE" >> /tmp/notmissinglibs0.txt
  734. fi
  735. fi
  736. done
  737. sync
  738. sort -u /tmp/notmissinglibs0.txt > /tmp/notmissinglibs.txt
  739. #now go thru rootfs-complete and see if any unused libs...
  740. #FNDFILES="`find $WKGDIR/sandbox3/rootfs-complete -type f | tr "\n" " "`"
  741. #for ONEFILE in $FNDFILES
  742. find $WKGDIR/sandbox3/rootfs-complete -type f | #110516
  743. while read ONEFILE #110516
  744. do
  745. ISANLIB="`file --brief $ONEFILE | grep "shared object"`"
  746. if [ ! "$ISANLIB" = "" ];then
  747. FILEBASE='/'"`basename $ONEFILE`"'$'
  748. FNDMATCH="`cat /tmp/notmissinglibs.txt | grep "$FILEBASE"`"
  749. if [ "$FNDMATCH" = "" ];then
  750. echo "File $ONEFILE is in Puppy but is not used." >> /tmp/notusedlibs.txt
  751. fi
  752. fi
  753. done
  754. }
  755. echo
  756. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  757. echo "This script can now optionally do a thorough dependency check. "
  758. echo "Note, this may take a long time."
  759. echo -e "Press \"c\" key then ENTER to do thorough check,"
  760. echo -n "else just press ENTER key to bypass check: "
  761. read mmnn
  762. else
  763. echo "Normally, the script now offers to perform a thorough dependency check."
  764. echo "However, as the host and target architectures are different, this cannot"
  765. echo "be done (host=${WOOF_HOSTARCH}, target=${WOOF_TARGETARCH})."
  766. echo "If you want to do this check, do a build with host and target the same,"
  767. echo "with same package selection."
  768. echo -n "Press ENTER key to continue: "
  769. read mmnn
  770. mmnn=""
  771. fi
  772. echo
  773. if [ "$mmnn" = "c" ];then
  774. echo "Wait awhile..."
  775. dependcheck
  776. if [ -s /tmp/missinglibs.txt ];then #true if file not zero size.
  777. echo
  778. echo "UNFORTUNATELY, these libs are missing:"
  779. cat /tmp/missinglibs.txt
  780. echo
  781. echo -e "Press \"c\" key then ENTER key to exit,"
  782. echo -n "or if you really want to ignore problem, just press ENTER: "
  783. read goto1
  784. fi
  785. [ "$goto1" = "c" ] && exit
  786. if [ -s /tmp/notusedlibs.txt ];then
  787. echo
  788. echo "INTERESTING, the following libs are in Puppy but apparently not used:"
  789. cat /tmp/notusedlibs.txt
  790. echo
  791. echo -e "Press \"c\" key then ENTER key to exit,"
  792. echo -n "or if you really want to ignore problem, just press ENTER: "
  793. read goto1
  794. fi
  795. [ "$goto1" = "c" ] && exit
  796. fi
  797. echo "...done."
  798. #now do the kernel...
  799. echo
  800. echo "Now installing the kernel into build/ and modules into rootfs-complete/..."
  801. rm -f sandbox3/$KERNELPKG
  802. KERNPKGNAMEONLY="`basename $KERNELPKG .pet`"
  803. rm -rf sandbox3/$KERNPKGNAMEONLY
  804. cp packages-pet/${KERNELPKG} sandbox3/
  805. cd sandbox3
  806. pet2tgz $KERNELPKG
  807. tar -zxf $KERNPKGNAMEONLY.tar.gz
  808. cp -a --remove-destination $KERNPKGNAMEONLY/* rootfs-complete/
  809. #100603 i'm now putting common kernel files in here...
  810. cp -a -f ../kernel-skeleton/* rootfs-complete/
  811. #110918 kernel-skeleton now has a pinstall.sh script...
  812. cd rootfs-complete
  813. ./pinstall.sh
  814. sync
  815. rm -f ./pinstall.sh
  816. cd ..
  817. mv -f rootfs-complete/etc/modules/firmware.dep rootfs-complete/etc/modules/firmware.dep.${KERNELVER}
  818. sync
  819. rm -rf build
  820. mkdir build
  821. #120613 kernel image can have different names. rename to vmlinuz, however change back later if build sd card...
  822. REALKERNAME='vmlinuz'
  823. [ -f rootfs-complete/boot/vmlinuz ] && cp rootfs-complete/boot/vmlinuz build/
  824. if [ -f rootfs-complete/boot/uImage ];then #mele a1000
  825. cp rootfs-complete/boot/uImage build/vmlinuz #120506 arm builds, using different name for kernel.
  826. REALKERNAME='uImage'
  827. fi
  828. if [ -f rootfs-complete/boot/kernel.img ];then #raspberry pi
  829. cp rootfs-complete/boot/kernel.img build/vmlinuz
  830. REALKERNAME='kernel.img'
  831. fi
  832. [ -f rootfs-complete/boot/System.map ] && cp rootfs-complete/boot/System.map ./
  833. sync
  834. rm -rf rootfs-complete/boot
  835. echo -n "$IDSTRING" >> build/vmlinuz #100911 16-byte id-string appended. init can determine boot partition.
  836. #110722 need this, to put into woof-installed-packages...
  837. KERNEL_DB_ENTRY="`cat rootfs-complete/pet.specs`"
  838. rm -f rootfs-complete/pet.specs
  839. #arch .INSTALL files
  840. #130316 NOTE: maybe could do this without chroot, as for slackware in 2createpackages (see 2createpackages-hack-install.sh).
  841. # ok, I have looked through all pkgs used in build, most .INSTALL are trivial. these are slight exceptions:
  842. # cmake glibc_dev_DEV libglade2 libwmf man_DEV openldap perl_DEV subversion_DEV
  843. # but, don't really need to execute those either. besides, the code below is only operating upon rootfs-complete, it would be better
  844. # to aufs mount the devx, as is done in sandbox2b in 2createpackages. comment out all of below...
  845. if [ "${DISTRO_BINARY_COMPAT}" = "arch" ]; then
  846. rm -f rootfs-complete/.INSTALL*
  847. # numberOfDotInstall=1
  848. # for FOLDER in `ls -1 ${WKGDIR}/packages-${DISTRO_FILE_PREFIX} | tr '\n' ' '` #130307
  849. # do
  850. # [ ! -f ${WKGDIR}/packages-${DISTRO_FILE_PREFIX}/${FOLDER}/.INSTALL ] && continue
  851. # PKGVER="`grep -e '^pkgver' "${WKGDIR}/packages-${DISTRO_FILE_PREFIX}/${FOLDER}/.PKGINFO" | sed 's/^pkgver\ =\ //' | sed 's/-[^-]//'`"
  852. # cp ${WKGDIR}/packages-${DISTRO_FILE_PREFIX}/${FOLDER}/.INSTALL "rootfs-complete/.INSTALL${numberOfDotInstall}-${PKGVER}"
  853. # let numberOfDotInstall++
  854. # done
  855. # if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #130316
  856. # cp ${WKGDIR}/support/arch/runDotInstalls rootfs-complete/
  857. # chroot "${PWD}/rootfs-complete" "/runDotInstalls" &> /dev/null
  858. # rm -f rootfs-complete/runDotInstalls
  859. # else
  860. # echo "Unfortunately, cannot execute Arch install scripts, as this is a cross-build."
  861. # fi
  862. # rm -f rootfs-complete/.INSTALL*
  863. fi
  864. #130314 want to run arch post-install script from ppm also...
  865. mkdir -p rootfs-complete/usr/local/petget
  866. cp ${WKGDIR}/support/arch/runDotInstalls rootfs-complete/usr/local/petget/ArchRunDotInstalls
  867. chmod 755 rootfs-complete/usr/local/petget/ArchRunDotInstalls
  868. if [ "$CHOICE_SCSI" = "" ];then
  869. #w462 true-scsi drives
  870. echo
  871. echo "Would you like the live-CD to be able to recognise and even boot from"
  872. echo "old true-SCSI hard drives and CD drives?"
  873. echo "Most likely you would just press the ENTER key only to decline, as the"
  874. echo "vast majority of PCs do not have true-SCSI hardware. However, 10-20 years"
  875. echo "ago it was popular in network server computers."
  876. echo "Note, really old pre-PCI computers will not be supported at all."
  877. echo -n "Enter only to decline, any other key for SCSI drivers in live-CD: "
  878. read wantscsi
  879. CHOICE_SCSI="Erase_SCSI"
  880. [ "$wantscsi" != "" ] && CHOICE_SCSI="Boot_SCSI"
  881. fi
  882. #130613 kmod depmod wants these two... they are moved in later, but do it here also...
  883. mkdir -p rootfs-complete/lib/modules/$KERNELVER
  884. [ -f rootfs-complete/etc/modules/modules.builtin ] && cp -a -f rootfs-complete/etc/modules/modules.builtin rootfs-complete/lib/modules/$KERNELVER/
  885. [ -f rootfs-complete/etc/modules/modules.order ] && cp -a -f rootfs-complete/etc/modules/modules.order rootfs-complete/lib/modules/$KERNELVER/
  886. #110712 modinfo won't work if modules.* files missing...
  887. #130418 if kmod, do not use busybox depmod...
  888. USINGKMOD='no'
  889. [ "`grep '^kmod' ../woof-installed-packages`" != "" ] && USINGKMOD='yes'
  890. if [ "$USINGKMOD" = "no" ];then
  891. cp -f ../boot/depmod ./
  892. if [ ! -f rootfs-complete/lib/modules/$KERNELVER/modules.dep ];then
  893. busybox depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  894. fi
  895. else
  896. cp -f ../boot/kmod ./
  897. ln -snf kmod depmod
  898. if [ ! -f rootfs-complete/lib/modules/$KERNELVER/modules.dep ];then
  899. ./depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  900. fi
  901. fi
  902. SCSIFLAG=""
  903. SCSIDRVS="parport.ko"
  904. if [ "$CHOICE_SCSI" = "Boot_SCSI" ];then #note, further down, scsi modules get moved to initrd.
  905. SCSIFLAG="-SCSI" #used in name of .iso file.
  906. #mkdir -p initrd-tree/lib/modules/$KERNELVER/kernel/drivers
  907. #cp -a -f rootfs-complete/lib/modules/$KERNELVER/kernel/drivers/scsi initrd-tree/lib/modules/$KERNELVER/kernel/drivers/
  908. for ONESCSI in `find rootfs-complete/lib/modules/$KERNELVER/kernel/drivers/scsi -type f -name \*.ko`
  909. do
  910. #really only want those with pci interface...
  911. SCSIBASE="`basename $ONESCSI`"
  912. SCSINAMEONLY="`basename $ONESCSI .ko`"
  913. ALIASFND="`modinfo -b rootfs-complete -k ${KERNELVER} ${SCSINAMEONLY} 2>/dev/null | grep '^alias:'`"
  914. if [ "$ALIASFND" ];then
  915. SCSIDRVS="$SCSIDRVS $SCSIBASE"
  916. #add any deps to list...
  917. SCSIDEPS="`modinfo -b rootfs-complete -k ${KERNELVER} ${SCSINAMEONLY} 2>/dev/null | grep '^depends:' | head -n 1 | tr -s ' ' | cut -f 2 -d ' ' | sed -e 's%,%.ko %g' -e 's%$%.ko%'`"
  918. [ "$SCSIDEPS" != ".ko" ] && SCSIDRVS="$SCSIDRVS $SCSIDEPS"
  919. fi
  920. done
  921. fi
  922. ##w479 ask about removing old analog modem modules...
  923. #INTELMODEMMOD="`find rootfs-complete/lib/modules/$KERNELVER/kernel/drivers/char -type f -name Intel*ko*`"
  924. #if [ "$INTELMODEMMOD" != "" ];then
  925. # echo
  926. # echo "Would you like to remove the Intel 536 and 537 analog modem modules?"
  927. # echo "These are an enormous waste of space (1MB and 4MB uncompressed) if you"
  928. # echo "don't have one of those particular old modem dialup cards."
  929. # echo -n "Press ENTER only to delete them: "
  930. # read DELINTEL
  931. # if [ "$DELINTEL" = "" ];then
  932. # for ONEMODEM in $INTELMODEMMOD
  933. # do
  934. # echo "Removing $ONEMODEM"
  935. # rm -f $ONEMODEM
  936. # done
  937. # fi
  938. #fi
  939. if [ "$CHOICE_BIGMODEM" != "Erase_big_modems" ];then #v431
  940. # INTELMODEMMOD="`find rootfs-complete/lib/modules/${KERNELVER} -type f -iname intel5*ko*`"
  941. INTELMODEMMOD="`find rootfs-complete/lib/modules/${KERNELVER} -type f -iname 'intel5*ko' -o -iname 'intel5*HIDE'`" #101222
  942. if [ "$INTELMODEMMOD" != "" ];then
  943. echo
  944. if [ "$CHOICE_BIGMODEM" ];then
  945. echo "You already selected what to do with the \"big modems\", however, this"
  946. echo "question is specifically about the Intel 536 and 537 analog modems, that"
  947. echo "are enormous and you might want to delete them, independently of the"
  948. echo "choice already made for the big modems."
  949. else
  950. echo "The next question will ask what to do with the \"big modems\", however, this"
  951. echo "question is specifically about the Intel 536 and 537 analog modems, that"
  952. echo "are enormous and you might want to delete them, independently of the"
  953. echo "choise that will be made next for the big modems."
  954. fi
  955. echo
  956. echo "Would you like to remove the Intel 536 and 537 analog modem modules?"
  957. echo "These are an enormous waste of space (1MB - 18MB uncompressed) if you"
  958. echo "don't have one of those particular old modem dialup cards."
  959. echo -n "Press ENTER only to delete them: "
  960. read DELINTEL
  961. if [ "$DELINTEL" = "" ];then
  962. for ONEMODEM in $INTELMODEMMOD
  963. do
  964. echo "Removing $ONEMODEM"
  965. rm -f $ONEMODEM
  966. done
  967. fi
  968. fi
  969. fi
  970. #v425 offer to move all the big analog modem modules to zdrv...
  971. rm -rf big-modem-modules 2>/dev/null
  972. rm -rf big-modem-firmware 2>/dev/null
  973. if [ "$CHOICE_BIGMODEM" = "" ];then
  974. echo
  975. echo "Some of the analog (dialup) modem drivers are massive."
  976. echo "If you just press ENTER, the big drivers, for Conexant, Intel and Agere,"
  977. echo "will be deleted, but there will still be support for many software modems"
  978. echo "(Smartlink, Pctel, Lucent) as well as true hardware modems."
  979. echo "Or, type 'z' then enter to move them to a separate zdrv,"
  980. echo "or, any other printable char to keep them in the main live-cd file"
  981. echo "(warning, last option will make main f.s. much bigger)"
  982. echo -n "Press ENTER, 'z' or any other char: "
  983. read DELHSF
  984. CHOICE_BIGMODEM="Keep_big_modems"
  985. [ "$DELHSF" = "" ] && CHOICE_BIGMODEM="Erase_big_modems"
  986. [ "$DELHSF" = "z" ] && CHOICE_BIGMODEM="Zdrv_big_modems"
  987. fi
  988. if [ "$CHOICE_BIGMODEM" = "Erase_big_modems" ];then
  989. echo
  990. echo "ok, deleting big modem modules..."
  991. #101028 added ko* as have some named .koHIDE
  992. for BIGMODS in agr hcf hsf intel5 Intel5 esscom pctel
  993. do
  994. # for ONEBIGMOD in `find rootfs-complete/lib/modules/${KERNELVER}/ -type f -name ${BIGMODS}*.ko*`
  995. for ONEBIGMOD in `find rootfs-complete/lib/modules/${KERNELVER}/ -type f -name ${BIGMODS}*.ko -o -name ${BIGMODS}*HIDE` #101222
  996. do
  997. BIGMODNAME="`basename $ONEBIGMOD`"
  998. echo -n "$BIGMODNAME "
  999. [ -f $ONEBIGMOD ] && rm -f $ONEBIGMOD
  1000. done
  1001. done
  1002. rm -rf rootfs-complete/lib/modules/all-firmware/hsfmodem 2>/dev/null
  1003. rm -f rootfs-complete/lib/modules/all-firmware/hsfmodem.tar.gz 2>/dev/null
  1004. rm -rf rootfs-complete/lib/modules/all-firmware/hcfpcimodem 2>/dev/null
  1005. rm -f rootfs-complete/lib/modules/all-firmware/hcfpcimodem.tar.gz 2>/dev/null
  1006. rm -rf rootfs-complete/lib/modules/all-firmware/intel536ep 2>/dev/null
  1007. rm -f rootfs-complete/lib/modules/all-firmware/intel536ep.tar.gz 2>/dev/null
  1008. rm -rf rootfs-complete/lib/modules/all-firmware/intel537* 2>/dev/null
  1009. rm -f rootfs-complete/lib/modules/all-firmware/intel537*.tar.gz 2>/dev/null
  1010. fi
  1011. MAKEZDRV="" #100903
  1012. if [ "$CHOICE_BIGMODEM" = "Zdrv_big_modems" ];then
  1013. echo "ok, moving big modem modules to separate zdrv sfs file..."
  1014. MAKEZDRV="big-modems" #100903
  1015. mkdir big-modem-modules
  1016. mkdir big-modem-firmware
  1017. #101028 added ko* as have some named .koHIDE
  1018. for BIGMODS in agr hcf hsf intel5 Intel5
  1019. do
  1020. # for ONEBIGMOD in `find rootfs-complete/lib/modules/$KERNELVER/ -type f -name ${BIGMODS}*.ko*`
  1021. for ONEBIGMOD in `find rootfs-complete/lib/modules/$KERNELVER/ -type f -name ${BIGMODS}*.ko -o -name ${BIGMODS}*HIDE` #101222
  1022. do
  1023. BIGMODNAME="`basename $ONEBIGMOD`"
  1024. echo -n "$BIGMODNAME "
  1025. ONEBIGDIR="`dirname $ONEBIGMOD`"
  1026. mkdir -p big-modem-modules/$ONEBIGDIR
  1027. mv $ONEBIGMOD big-modem-modules/$ONEBIGDIR/
  1028. done
  1029. done
  1030. mv -f rootfs-complete/lib/modules/all-firmware/hsfmodem big-modem-firmware/ 2>/dev/null
  1031. mv -f rootfs-complete/lib/modules/all-firmware/hsfmodem.tar.gz big-modem-firmware/ 2>/dev/null
  1032. mv -f rootfs-complete/lib/modules/all-firmware/hcfpcimodem big-modem-firmware/ 2>/dev/null
  1033. mv -f rootfs-complete/lib/modules/all-firmware/hcfpcimodem.tar.gz big-modem-firmware/ 2>/dev/null
  1034. mv -f rootfs-complete/lib/modules/all-firmware/intel536ep big-modem-firmware/ 2>/dev/null
  1035. mv -f rootfs-complete/lib/modules/all-firmware/intel536ep.tar.gz big-modem-firmware/ 2>/dev/null
  1036. mv -f rootfs-complete/lib/modules/all-firmware/intel537* big-modem-firmware/ 2>/dev/null
  1037. mv -f rootfs-complete/lib/modules/all-firmware/intel537*.tar.gz big-modem-firmware/ 2>/dev/null
  1038. fi
  1039. echo
  1040. if [ "$CHK_FB_STATE" = "" ];then
  1041. #w481 remove framebuffer modules...
  1042. echo
  1043. echo "The kernel is configured with the vesafb driver builtin, which is usually enough"
  1044. echo "if it is ever required to boot in framebuffer video mode. The other framebuffer"
  1045. echo "modules take up about 1.4MB uncompressed and are not normally required."
  1046. echo -n "Press ENTER only to delete the other framebuffer modules: "
  1047. read DELFBM
  1048. CHK_FB_STATE="false"
  1049. [ "$DELFBM" = "" ] && CHK_FB_STATE="true"
  1050. fi
  1051. if [ "$CHK_FB_STATE" = "true" ];then
  1052. #130430 gpu/drm/sis.ko needs sisfb.ko, must keep...
  1053. echo
  1054. echo "Deleting framebuffer modules..."
  1055. find rootfs-complete/lib/modules/$KERNELVER/kernel/drivers/video -type f -name '*fb.ko' -o -name '*fb_*.ko' |
  1056. while read ONEMODULE
  1057. do
  1058. ONEBASE="`basename $ONEMODULE`"
  1059. [ "$ONEBASE" = "sisfb.ko" ] && continue #130430
  1060. echo -n "$ONEBASE "
  1061. rm -f $ONEMODULE
  1062. done
  1063. echo
  1064. fi
  1065. if [ "$CHK_EXOTIC_STATE" = "" ];then
  1066. echo
  1067. echo "A bit later in the script you will be asked if you would like to cut the modules"
  1068. echo "right down to a fairly basic selection. However, for now you can choose a minor"
  1069. echo "cutdown of some 'exotic' modules that are unlikely to be needed."
  1070. echo "Press any printable character to keep these, or"
  1071. echo "press ENTER only to remove 'exotic' modules: "
  1072. read keepexotic
  1073. CHK_EXOTIC_STATE="false"
  1074. [ "$keepexotic" = "" ] && CHK_EXOTIC_STATE="true"
  1075. fi
  1076. if [ "$CHK_EXOTIC_STATE" = "true" ];then
  1077. echo
  1078. echo "Deleting exotic modules..."
  1079. #v423 nfs.ko needs sunrpc.ko and lockd.ko... nfsd.ko needs exportfs.ko...
  1080. #v423 someone is working on autofs, so bring that back too...
  1081. #EXOTICFS=' fs/autofs fs/autofs4 fs/befs fs/bfs fs/coda fs/cramfs fs/exportfs fs/freevxfs fs/jffs2 fs/jfs fs/lockd fs/ncpfs fs/romfs fs/sysv '
  1082. #EXOTICNET=' net/appletalk net/ipv6 net/ipx net/llc net/sunrpc net/wanrouter '
  1083. EXOTICFS=' fs/befs fs/bfs fs/coda fs/cramfs fs/freevxfs fs/jffs2 fs/jfs fs/ncpfs fs/romfs fs/sysv '
  1084. EXOTICNET=' net/appletalk net/ipv6 net/ipx net/llc net/wanrouter '
  1085. EXOTICDRIVERS=' drivers/block/paride drivers/block/aoe drivers/mtd drivers/telephony '
  1086. for ONEDIR in $EXOTICFS $EXOTICNET $EXOTICDRIVERS
  1087. do
  1088. if [ -d rootfs-complete/lib/modules/$KERNELVER/kernel/$ONEDIR ];then
  1089. echo -n "$ONEDIR "
  1090. rm -rf rootfs-complete/lib/modules/$KERNELVER/kernel/$ONEDIR
  1091. fi
  1092. done
  1093. sync
  1094. echo
  1095. fi
  1096. #build the initrd-tree...
  1097. echo
  1098. echo "Now building initial ramdisk in initrd-tree/..."
  1099. rm -rf initrd-tree
  1100. cp -a ../boot/initrd-tree0 ./initrd-tree
  1101. cp ../DISTRO_SPECS ./initrd-tree/
  1102. #091222 support laptop internal sd/mmc cards at bootup...
  1103. MEMXTRAMODS='tifm_core.ko tifm_7xx1.ko mmc_core.ko mmc_block.ko tifm_sd.ko led-class.ko sdhci.ko sdhci-pci.ko'
  1104. #v423 2.6.29/30 kernels have extra hid-* modules needed for wireless keyboard to work...
  1105. #HIDXTRAMODS='hid-a4tech.ko hid-apple.ko hid-belkin.ko hid-cherry.ko hid-chicony.ko hid-cypress.ko hid-ezkey.ko hid-gyration.ko hid-logitech.ko hid-microsoft.ko hid-monterey.ko hid-ntrig.ko hid-petalynx.ko hid-pl.ko hid-samsung.ko hid-sony.ko hid-sunplus.ko hid-topseed.ko'
  1106. #110712 reduce list a bit, exclude hid drivers that are not keyboard (note, 2.6.39-3 kernel configured with them builtin)...
  1107. # removed: hid-gyration.ko hid-ntrig.ko hid-petalynx.ko hid-pl.ko hid-sony.ko hid-sunplus.ko hid-topseed.ko
  1108. HIDXTRAMODS='hid-a4tech.ko hid-apple.ko hid-belkin.ko hid-cherry.ko hid-chicony.ko hid-cypress.ko hid-ezkey.ko hid-logitech.ko hid-microsoft.ko hid-monterey.ko hid-samsung.ko'
  1109. #copy some modules to initrd-tree/... w007 added nls_utf8.ko w468 added nls_cp850.ko w476 added nls_iso8859-2.ko, nls_cp850.ko, nls_cp852.ko. 100214 added floppy.ko, psmouse.ko
  1110. #100406 add btrfs.ko and its deps libcrc32c.ko,zlib_deflate.ko
  1111. #121227 if kernel has f.s. drivers as modules (quirky6), added ext2.ko ext3.ko ext4.ko fat.ko msdos.ko vfat.ko ntfs.ko reiserfs.ko udf.ko, and deps: jbd.ko mbcache.ko jbd2.ko
  1112. NEEDEDINITRDMODS=" ${SCSIDRVS} aufs.ko cdrom.ko fuse.ko ide-cd.ko ide-floppy.ko nls_cp437.ko nls_cp850.ko nls_cp852.ko nls_iso8859-1.ko nls_iso8859-2.ko nls_utf8.ko nls_cp850.ko sqlzma.ko squashfs.ko sr_mod.ko unionfs.ko unlzma.ko aes.ko aes_generic.ko blkcipher.ko crypto_blkcipher.ko cbc.ko cryptoloop.ko rsrc_nonstatic.ko yenta_socket.ko ehci-hcd.ko ohci-hcd.ko uhci-hcd.ko usb-storage.ko usbcore.ko usbhid.ko scsi_wait_scan.ko ssb.ko ${HIDXTRAMODS} ${DISTRO_MODULES} ${MEMXTRAMODS} floppy.ko psmouse.ko btrfs.ko libcrc32c.ko zlib_deflate.ko ext2.ko ext3.ko ext4.ko fat.ko msdos.ko vfat.ko ntfs.ko reiserfs.ko udf.ko jbd.ko mbcache.ko jbd2.ko "
  1113. NEEDEDINITRDMODS="`echo -n "$NEEDEDINITRDMODS" | tr -s ' ' | tr ' ' '\n' | sort -u | tr '\n' ' '`"
  1114. for ONENEEDED in $NEEDEDINITRDMODS
  1115. do
  1116. echo -n "$ONENEEDED "
  1117. FNDONE="`find rootfs-complete/lib/modules -type f -name $ONENEEDED | sed -e 's/rootfs\-complete//'`"
  1118. if [ "$FNDONE" != "" ];then
  1119. FNDDIR="`dirname $FNDONE`"
  1120. mkdir -p initrd-tree$FNDDIR
  1121. cp -a rootfs-complete${FNDONE} initrd-tree${FNDONE}
  1122. gzip initrd-tree${FNDONE}
  1123. [ "$SDFLAG" = "" ] && rm -f rootfs-complete${FNDONE} #avoid duplication. 120521 SD-image, do not delete.
  1124. fi
  1125. done
  1126. #091121 want to load keyboard layout in initrd... (note, init script copies them back at bootup)
  1127. #120521 no, do not move, copy only, in situation where building for SD image (that has no initrd)...
  1128. if [ "$SDFLAG" != "" ];then
  1129. #not actually using an initrd, but let's keep the initrd functional...
  1130. cp -a -f rootfs-complete/lib/keymaps initrd-tree/lib/
  1131. cp -a -f rootfs-complete/lib/consolefonts initrd-tree/lib/
  1132. else
  1133. mv -f rootfs-complete/lib/keymaps initrd-tree/lib/
  1134. mv -f rootfs-complete/lib/consolefonts initrd-tree/lib/
  1135. fi
  1136. sync
  1137. if [ "$CHOICE_SCSI" != "Keep_SCSI" ];then #v431
  1138. #get rid of scsi modules except some essentials...
  1139. #note, above option to move some to initrd has left some old pre-PCI modules behind.
  1140. rm -rf /tmp/scsi-keep
  1141. mkdir /tmp/scsi-keep
  1142. for ONEKEEP in imm.ko ppa.ko raid_class.ko sg.ko scsi_wait_scan.ko
  1143. do
  1144. ONEFND="`find rootfs-complete/lib/modules/$KERNELVER/kernel/drivers/scsi -type f -name $ONEKEEP`"
  1145. [ "$ONEFND" ] && cp -a $ONEFND /tmp/scsi-keep/
  1146. done
  1147. rm -rf rootfs-complete/lib/modules/$KERNELVER/kernel/drivers/scsi
  1148. cp -a /tmp/scsi-keep rootfs-complete/lib/modules/$KERNELVER/kernel/drivers/scsi
  1149. fi
  1150. #091225 remove duplicate executables...
  1151. #busybox in initrd is different, cp needed in main f.s. later by 3builddistro...
  1152. #100101 find in initrd does not support '-L' option... bit nervous taking out 'rev'...
  1153. #100128 symlinks get lost, for now leave out e2fsck, resize2fs, fsck, e3...
  1154. #100527 leave out lsmod, modinfo, ntfs-3g as causes symlinks to get deleted...
  1155. #100527 in fact, abandon this whole thing...
  1156. #INITRDEXES="`find initrd-tree/bin -type f | grep -v 'e2fsck' | grep -v 'resize2fs' | grep -v 'fsck' | grep -v 'busybox' | grep -v 'e3' | grep -v 'cp' | grep -v 'find' | grep -v 'rev' | rev | cut -f 1 -d '/' | rev | tr '\n' ' '`"
  1157. #echo -n "" > initrd-tree/bin/TARGETEXES #init script will read this.
  1158. #for ONEINITRDEXE in $INITRDEXES
  1159. #do
  1160. # echo "Remove duplicate of $ONEINITRDEXE in main f.s."
  1161. # ONEEXE="`find rootfs-complete/bin -maxdepth 1 -type f -name $ONEINITRDEXE | cut -f 2,3 -d '/'`"
  1162. # if [ "$ONEEXE" ];then
  1163. # rm -f rootfs-complete/$ONEEXE
  1164. # echo "$ONEEXE" >> initrd-tree/bin/TARGETEXES
  1165. # continue
  1166. # fi
  1167. # ONEEXE="`find rootfs-complete/sbin -maxdepth 1 -type f -name $ONEINITRDEXE | cut -f 2,3 -d '/'`"
  1168. # if [ "$ONEEXE" ];then
  1169. # rm -f rootfs-complete/$ONEEXE
  1170. # echo "$ONEEXE" >> initrd-tree/bin/TARGETEXES
  1171. # continue
  1172. # fi
  1173. # ONEEXE="`find rootfs-complete/usr/bin -maxdepth 1 -type f -name $ONEINITRDEXE | cut -f 2-4 -d '/'`"
  1174. # if [ "$ONEEXE" ];then
  1175. # rm -f rootfs-complete/$ONEEXE
  1176. # echo "$ONEEXE" >> initrd-tree/bin/TARGETEXES
  1177. # continue
  1178. # fi
  1179. # ONEEXE="`find rootfs-complete/usr/sbin -maxdepth 1 -type f -name $ONEINITRDEXE | cut -f 2-4 -d '/'`"
  1180. # if [ "$ONEEXE" ];then
  1181. # rm -f rootfs-complete/$ONEEXE
  1182. # echo "$ONEEXE" >> initrd-tree/bin/TARGETEXES
  1183. # continue
  1184. # fi
  1185. #done
  1186. #w091029 use busybox depmod, creates smaller modules* files...
  1187. if [ "$USINGKMOD" = "no" ];then #130418
  1188. cp -f ../boot/depmod ./
  1189. #101007 the latest busybox depmod generates relative paths in modules.dep (it is a config option)
  1190. # but this breaks the older modprobe in the initrd, so use older depmod...
  1191. ./depmod -b $WKGDIR/sandbox3/initrd-tree -F $WKGDIR/sandbox3/System.map $KERNELVER
  1192. #./depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1193. #busybox depmod -b $WKGDIR/sandbox3/initrd-tree -F $WKGDIR/sandbox3/System.map $KERNELVER
  1194. busybox depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1195. else
  1196. cp -f ../boot/depmod ./depmod.veryold
  1197. cp -f ../boot/kmod ./kmod
  1198. ln -snf kmod depmod
  1199. #130418 we do not use kmod in initrd (as unable to compile statically)...
  1200. #101007 the latest busybox depmod generates relative paths in modules.dep (it is a config option)
  1201. # but this breaks the older modprobe in the initrd, so use older depmod...
  1202. ./depmod.veryold -b $WKGDIR/sandbox3/initrd-tree -F $WKGDIR/sandbox3/System.map $KERNELVER
  1203. ./depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1204. fi
  1205. sync
  1206. #101027 Iguleder reported DISTRO_SPECS did not have a carriage-return on last line...
  1207. xDISTROSPECS="`cat initrd-tree/DISTRO_SPECS`"
  1208. echo "$xDISTROSPECS" > initrd-tree/DISTRO_SPECS
  1209. echo "$xDISTROSPECS" > rootfs-complete/etc/DISTRO_SPECS
  1210. #100911
  1211. NEWVARIABLES="#32-byte alpha-numeric ID-string appended to vmlinuz, ${PUPPYSFS}, ${ZDRVSFS} and devx.sfs:
  1212. DISTRO_IDSTRING='${IDSTRING}'
  1213. #Puppy default filenames...
  1214. #Note, the 'SFS' files below are what the 'init' script in initrd.gz searches for,
  1215. #for the partition, path and actual files loaded, see PUPSFS and ZDRV in /etc/rc.d/PUPSTATE
  1216. DISTRO_PUPPYSFS='${PUPPYSFS}'
  1217. DISTRO_ZDRVSFS='${ZDRVSFS}'"
  1218. #DISTRO_DEVXSFS='${DEVXSFS}'"
  1219. echo "$NEWVARIABLES" >> initrd-tree/DISTRO_SPECS
  1220. echo "$NEWVARIABLES" >> rootfs-complete/etc/DISTRO_SPECS
  1221. sync
  1222. #120225 this is read by /usr/share/doc/convert-raw-docs...
  1223. DISTRO_PUPPYDATE="`date | tr -s " " | cut -f 2,6 -d " "`"
  1224. echo "DISTRO_PUPPYDATE='${DISTRO_PUPPYDATE}'" >> rootfs-complete/etc/DISTRO_SPECS
  1225. echo "DISTRO_PUPPYDATE='${DISTRO_PUPPYDATE}'" >> initrd-tree/DISTRO_SPECS
  1226. #120215 language translations for init script...
  1227. INITRDTRANSFILES="`find ../rootfs-skeleton/usr/share/sss/initrd_strings -mindepth 1 -maxdepth 1 -type f -name 'initrd_strings.*'`"
  1228. if [ "$INITRDTRANSFILES" ];then
  1229. for ATRANS in $INITRDTRANSFILES
  1230. do
  1231. ENDBIT="`echo -n "$ATRANS" | rev | cut -f 1 -d '.' | rev`" #ex: de (from initrd_strings.de)
  1232. mkdir -p initrd-tree/locale/${ENDBIT}
  1233. #only supporting translating the init script for now...
  1234. sPTN="/^\[init\]/,/^$/p" #this is a multi-line block find expression.
  1235. CODEBLOCK="`sed -n "$sPTN" ${ATRANS} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`" #extracts just the relevant block of lines.
  1236. [ ! "$CODEBLOCK" ] && continue #precaution.
  1237. echo "$CODEBLOCK" > initrd-tree/locale/${ENDBIT}/init #translation file, read by /init script in initrd.
  1238. done
  1239. fi
  1240. #120216 set default LANG and KMAP... 120401 improve...
  1241. echo
  1242. echo
  1243. echo "Puppy is built with a default locale LANG=en_US and keyboard layout KMAP=us,
  1244. which may be changed after bootup.
  1245. However, if you are building a language-specific Puppy, you may change the
  1246. defaults now. But, please do make sure that your Puppy has a 'langpack' PET
  1247. for your language installed -- if one does not exist, then you will have to
  1248. create one -- see MoManager in the Utility menu, also read the Menu -> Help
  1249. -> HOWTO Internationalization."
  1250. echo
  1251. echo "These are the available LANG values (in /usr/share/i18n/locales):
  1252. aa_DJ aa_ER aa_ER@saaho aa_ET af_ZA am_ET an_ES ar_AE ar_BH ar_DZ ar_EG ar_IN ar_IQ ar_JO ar_KW ar_LB ar_LY ar_MA ar_OM ar_QA ar_SA ar_SD ar_SY ar_TN ar_YE as_IN ast_ES az_AZ be_BY be_BY@latin ber_DZ ber_MA bg_BG bn_BD bn_IN br_FR br_FR@euro bs_BA byn_ER ca_AD ca_ES ca_ES@euro ca_FR ca_IT crh_UA csb_PL cs_CZ cy_GB da_DK de_AT de_AT@euro de_BE de_BE@euro de_CH de_DE de_DE@euro de_LU de_LU@euro dz_BT el_CY el_GR el_GR@euro en_AU en_BW en_CA en_DK en_GB en_HK en_IE en_IE@euro en_IN en_NG en_NZ en_PH en_SG en_US en_ZA en_ZW es_AR es_BO es_CL es_CO es_CR es_DO es_EC es_ES es_ES@euro es_GT es_HN es_MX es_NI es_PA es_PE es_PR es_PY es_SV es_US es_UY es_VE et_EE eu_ES eu_ES@euro fa_IR fi_FI fi_FI@euro fil_PH fo_FO fr_BE fr_BE@euro fr_CA fr_CH fr_FR fr_FR@euro fr_LU fr_LU@euro fur_IT fy_DE fy_NL ga_IE ga_IE@euro gd_GB gez_ER gez_ER@abegede gez_ET gez_ET@abegede gl_ES gl_ES@euro gu_IN gv_GB ha_NG he_IL hi_IN hr_HR hsb_DE hu_HU hy_AM id_ID ig_NG ik_CA is_IS it_CH it_IT it_IT@euro iu_CA iw_IL ja_JP ka_GE kk_KZ kl_GL km_KH kn_IN ko_KR ks_IN ku_TR kw_GB ky_KG lg_UG li_BE li_NL lo_LA lt_LT lv_LV mai_IN mg_MG mi_NZ mk_MK ml_IN mn_MN mr_IN ms_MY mt_MT nb_NO nds_DE nds_NL ne_NP nl_BE nl_BE@euro nl_NL nl_NL@euro nn_NO nr_ZA nso_ZA oc_FR om_ET om_KE or_IN pa_IN pap_AN pa_PK pl_PL pt_BR pt_PT pt_PT@euro ro_RO ru_RU ru_UA rw_RW sa_IN sc_IT se_NO shs_CA sid_ET si_LK sk_SK sl_SI so_DJ so_ET so_KE so_SO sq_AL sr_ME sr_RS sr_RS@latin ss_ZA st_ZA sv_FI sv_FI@euro sv_SE ta_IN te_IN tg_TJ th_TH ti_ER ti_ET tig_ER tk_TM tl_PH tn_ZA tr_CY tr_TR ts_ZA tt_RU tt_RU@iqtelif ug_CN uk_UA ur_PK uz_UZ uz_UZ@cyrillic ve_ZA vi_VN wa_BE wa_BE@euro wal_ET wo_SN xh_ZA yi_US yo_NG zh_CN zh_HK zh_SG zh_TW zu_ZA"
  1253. echo "ENTER only for default, else type one of the above. Usually, you would want UTF-8 enabled, so append that. ex: de_DE.UTF-8."
  1254. echo "(the default is en_US.UTF-8)"
  1255. echo -n "ENTER only for default, or type it now: "
  1256. read DEFAULTLANG
  1257. if [ "$DEFAULTLANG" ];then
  1258. echo "...ok, set to ${DEFAULTLANG}"
  1259. DEFAULTLANG1="${DEFAULTLANG%_*}"
  1260. if [ "$DEFAULTLANG1" != "en" ];then
  1261. echo -n "$DEFAULTLANG" > initrd-tree/PUPPYLANG
  1262. echo
  1263. echo "These are the available keyboard layout values (in /lib/keymaps):
  1264. azerty be-latin1 br-abnt2 br-abnt br-latin1-abnt2 br-latin1-us by cf croat cz de de-latin1 dk dvorak dvorak-l dvorak-r es et fi fr gr hu101 hu il it jp106 lt mk nl no pl pt-latin1 ro ru se sg sk-qwerty sk-qwertz slovene sv-latin1 uk us wangbe"
  1265. echo "You don't have to choose a default, as Puppy will try and guess at bootup. Whatever, after bootup the user will have the opportunity to change it, in the QuickSetup window."
  1266. echo -n "Enter only for 'us', else type one of the above: "
  1267. read DEFAULTKMAP
  1268. [ "$DEFAULTKMAP" != "" ] && [ "$DEFAULTKMAP" != "us" ] && echo -n "$DEFAULTKMAP" > initrd-tree/PUPPYKEYMAP
  1269. [ "$DEFAULTKMAP" = "" ] && DEFAULTKMAP="us"
  1270. echo "...ok, set to ${DEFAULTKMAP}"
  1271. fi
  1272. else
  1273. DEFAULTLANG="en_US.UTF-8" #121123
  1274. echo "...ok, set to ${DEFAULTLANG}"
  1275. fi
  1276. #i think also, set LANG in /etc/profile...
  1277. sed -i -e "s%^LANG=.*%LANG=${DEFAULTLANG}%" rootfs-complete/etc/profile
  1278. echo
  1279. #130515
  1280. echo
  1281. echo "Puppy by default creates a file 'pupdesk.flg' on a hard-drive partition
  1282. (giving preference to a Linux f.s. if it exists) at first bootup (PUPMODE=5).
  1283. If the graphical desktop is successfully launched, the file is removed, and
  1284. never created again -- that is, it is a once-only ephemeral thing.
  1285. However, if the desktop fails, say hangs, and forced poweroff/reboot is
  1286. required, 'pupdesk.flg' will still exist at second bootup, which will force
  1287. the text-mode Xorg Video Wizard to run.
  1288. If you want to build a pup without this 'pupdesk.flg' mechanism, type any
  1289. character now then press ENTER key. The alternative is that a forced reboot"
  1290. echo 'will require typing in the boot parameter "puppy pfix=nox" at second startup.'
  1291. echo -n "Press ENTER only to enable 'pupdesk.flg' mechanism: "
  1292. read PUPDESKFLG
  1293. if [ "$PUPDESKFLG" = "" ];then
  1294. echo '...enabled'
  1295. else
  1296. #change the message in iso 'help.msg', see further down.
  1297. #modify 'init' script in initrd...
  1298. sed -i -e 's%^PUPDESKFLG=.*%PUPDESKFLG=0%' initrd-tree/init
  1299. fi
  1300. #130618 check udev version... 130710 01micko: fix...
  1301. #130612 if kernel has CONFIG_DEVTMPFS=y (and CONFIG_DEVTMPFS_MOUNT=y) then empty /dev...
  1302. DEVTMPFSFLG=0
  1303. if [ "`grep 'CONFIG_DEVTMPFS.*=y' rootfs-complete/etc/modules/DOTconfig*`" != "" ];then
  1304. UDEV3=`grep -E '^udev[_-][0-9]' ../woof-installed-packages | cut -f 3 -d '|' | cut -c 1-3 | head -n 1`
  1305. [ ! $UDEV3 ] && UDEV3=200 #eudev
  1306. if [ $UDEV3 -ge 176 ];then #175 is last version that creates device nodes.
  1307. #modify 'init' script in initrd...
  1308. sed -i -e 's%^DEVTMPFSFLG=.*%DEVTMPFSFLG=2%' initrd-tree/init
  1309. DEVTMPFSFLG=2 #see further down.
  1310. fi
  1311. fi
  1312. sync
  1313. #build build/initrd.gz...
  1314. cp -f ../boot/makecpioinitrd ./
  1315. cp -f ../boot/cpio ./
  1316. ./makecpioinitrd
  1317. sync
  1318. mv -f initrd.gz build/
  1319. #offer to cutdown the modules, to build a smaller live-cd...
  1320. rm -rf zdrv 2>/dev/null #note, current dir is in sandbox3.
  1321. rm -f ${ZDRVSFS} #100911 zdrv.sfs
  1322. if [ "$CHK_RADICAL_STATE" = "" ];then
  1323. echo
  1324. echo -n "Press ENTER only to cutdown selection of modules, any other char to retain all: "
  1325. read cutthemdown
  1326. CHK_RADICAL_STATE="false"
  1327. [ "$cutthemdown" = "" ] && CHK_RADICAL_STATE="true"
  1328. fi
  1329. if [ "$CHK_RADICAL_STATE" = "true" ];then
  1330. if [ "$USINGKMOD" = "no" ];then #130418
  1331. busybox depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1332. else
  1333. ./depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1334. fi
  1335. cd rootfs-complete/lib/modules/$KERNELVER #makes it easier to handle find results.
  1336. #create a list of essential modules...
  1337. echo "Creating must-have lists..."
  1338. SOUNDMODS="`find ./kernel/sound/ -type f | sed -e 's/^\.\///g'`" #want all the alsa sound mods.
  1339. IPV4MODS="`find ./kernel/net/ipv4 -type f | sed -e 's/^\.\///g'`" #want all the firewall mods.
  1340. NETFILTERMODS="`find ./kernel/net/netfilter -type f | sed -e 's/^\.\///g'`"
  1341. #IEEE80211MODS="`find ./kernel/net/ieee80211 -type f | sed -e 's/^\.\///g'`" #want all the ieee80211 mods.
  1342. IEEE80211MODS="`find ./kernel/net/wireless -type f | sed -e 's/^\.\///g'`" #want all the wireless 80211 mods.
  1343. RFKILLMODS="`find ./kernel/net/rfkill -type f | sed -e 's/^\.\///g'`"
  1344. MAC80211MODS="`find ./kernel/net/mac80211 -type f | sed -e 's/^\.\///g'`"
  1345. WIMAXMODS="`find ./kernel/net/wimax -type f | sed -e 's/^\.\///g'`"
  1346. NETWORKMODS="`find ./kernel/drivers/net -type f | grep -vE '/wan/|/appletalk/' | sed -e 's/^\.\///g'`" #want all the network interface drivers.
  1347. UBUNTUMODS=""
  1348. [ -d ./kernel/ubuntu ] && UBUNTUMODS="`find ./kernel/ubuntu -type f | grep -vE '/compcache/|/gnbd/|/heci/|/lirc/' | sed -e 's/^\.\///g'`"
  1349. MMCMODS="`find ./kernel/drivers/mmc -type f | sed -e 's/^\.\///g'`" #include mmc/sd host drivers.
  1350. MEMSTICKMODS="`find ./kernel/drivers/memstick -type f | sed -e 's/^\.\///g'`"
  1351. MISCMODS="`find ./kernel/drivers/misc -type f | sed -e 's/^\.\///g'`"
  1352. USBMODS="`find ./kernel/drivers/usb -type f | sed -e 's/^\.\///g'`"
  1353. ACPIMODS="`find ./kernel/drivers/acpi -type f | sed -e 's/^\.\///g'`"
  1354. AGPMODS="`find ./kernel/drivers/char/agp -type f | sed -e 's/^\.\///g'`"
  1355. I2CMODS="`find ./kernel/drivers/i2c -type f | sed -e 's/^\.\///g'`"
  1356. PLATFORMMODS="`find ./kernel/drivers/platform -type f | sed -e 's/^\.\///g'`"
  1357. BLUETOOTHMODS="`find ./kernel/drivers/bluetooth -type f | sed -e 's/^\.\///g'`"
  1358. #w475 k2.6.29.3 has these usb webcam drivers...
  1359. GSPCAMODS=""
  1360. [ -d ./kernel/drivers/media/video/gspca ] && GSPCAMODS="`find ./kernel/drivers/media/video/gspca -type f | sed -e 's/^\.\///g'`"
  1361. #k2.6.25.16: kernel/drivers/char/drm, k2.6.27.4: kernel/drivers/gpu/drm...
  1362. DRMMODS="`find ./kernel/drivers -type f | grep '/drm/' | sed -e 's/^\.\///g'`"
  1363. USBMODEMLIST="cdc-acm.ko pl2303.ko nozomi.ko hso.ko option.ko sierra.ko"
  1364. ANALOGMODEMLIST="mwave.ko martian_dev.ko pctel.ko ltserial.ko slamr.ko slusb.ko esscom.ko"
  1365. CPUSCALING2MODS="`find ./kernel/drivers/cpufreq -type f | sed -e 's/^\.\///g'`" #100127
  1366. CPUSCALINGMODS="`find ./kernel/arch/x86/kernel/cpu/cpufreq -type f | sed -e 's/^\.\///g'`" #v431
  1367. CRYPTOMODS="`find ./kernel/crypto -type f | sed -e 's/^\.\///g'`" #100126
  1368. FBCONMODS="`find ./kernel/drivers/video/console -type f | sed -e 's/^\.\///g'`" #110518
  1369. #create a list of extra modules... w476 added nls_cp850.ko nls_cp852.ko...
  1370. EXTRALIST="blkcipher.ko cbc.ko apm.ko cdrom.ko mwave.ko synclink_cs.ko serial_cs.ko lp.ko n_hdlc.ko nvram.ko sonypi.ko generic_serial.ko agpgart.ko ali-agp.ko amd-k7-agp.ko amd64-agp.ko ati-agp.ko intel-agp.ko nvidia-agp.ko sis-agp.ko sworks-agp.ko via-agp.ko blowfish.ko aes.ko arc4.ko crc32c.ko deflate.ko des.ko md5.ko sha1.ko cramfs.ko ext3.ko fat.ko fuse.ko isofs.ko jbd.ko lockd.ko minix.ko msdos.ko nfs.ko nls_cp437.ko nls_cp850.ko nls_cp852.ko nls_iso8859-1.ko nls_iso8859-13.ko nls_iso8859-14.ko nls_iso8859-15.ko nls_iso8859-2.ko nls_iso8859-3.ko nls_iso8859-4.ko nls_iso8859-5.ko nls_iso8859-6.ko nls_iso8859-7.ko nls_iso8859-8.ko nls_iso8859-9.ko nls_utf8.ko ntfs.ko reiserfs.ko smbfs.ko squashfs.ko udf.ko unionfs.ko vfat.ko i2c-core.ko i2c-algo-bit.ko ide-cs.ko ide-tape.ko ide-cd.ko ide-floppy.ko gameport.ko analog.ko pcigame.ko pcspkr.ko psmouse.ko sermouse.ko serport.ko serio.ko evdev.ko joydev.ko input.ko keybdev.ko mousedev.ko crc32.ko crc-ccitt.ko libcrc32c.ko zlib_deflate.ko firmware_class.ko parport_pc.ko parport_serial.ko parport.ko parport_cs.ko i82365.ko pd6729.ko tcic.ko yenta_socket.ko i82092.ko rsrc_nonstatic.ko pcmcia_core.ko ds.ko imm.ko scsi_mod.ko scsi_transport_spi.ko sd_mod.ko sg.ko sr_mod.ko ide-scsi.ko scsi_debug.ko scsi_transport_fc.ko cdc-acm.ko usb-midi.ko usblp.ko audio.ko bluetty.ko usbcore.ko sl811-hcd.ko uhci-hcd.ko ehci-hcd.ko ohci-hcd.ko uhci.ko usb-ohci.ko usb-uhci.ko usbkbd.ko usbhid.ko hid.ko usbmouse.ko usbnet.ko ir-usb.ko usbserial.ko usb-storage.ko scanner.ko printer.ko fan.ko ibm_acpi.ko ac.ko battery.ko processor.ko thermal.ko paride.ko cryptoloop.ko pktcdvd.ko floppy.ko loop.ko 8250_pnp.ko serial_core.ko 8250.ko 8250_pci.ko ndiswrapper.ko ungrab-winmodem.ko cifs.ko ssb.ko pl2303.ko aufs.ko serio_raw.ko ecb.ko output.ko"
  1371. #FBMODS="intelfb.ko rivafb.ko sisfb.ko fbcon-vga-planes.ko fbcon-mfb.ko fbgen.ko mdacon.ko neofb.ko tridentfb.ko vgastate.ko vga16fb.ko "
  1372. EXTRAMODS=""
  1373. for ONEMOD in $EXTRALIST $USBMODEMLIST #$ANALOGMODEMLIST
  1374. do
  1375. ONEFND="`find ./ -type f -name $ONEMOD | sed -e 's/^\.\///g'`"
  1376. if [ "$ONEFND" != "" ];then
  1377. EXTRAMODS="$EXTRAMODS
  1378. $ONEFND"
  1379. fi
  1380. done
  1381. cd ../../../../ #back into sandbox3.
  1382. CHOSENMODS="$SOUNDMODS
  1383. $IPV4MODS
  1384. $NETFILTERMODS
  1385. $IEEE80211MODS
  1386. $RFKILLMODS
  1387. $MAC80211MODS
  1388. $WIMAXMODS
  1389. $NETWORKMODS
  1390. $UBUNTUMODS
  1391. $MMCMODS
  1392. $MEMSTICKMODS
  1393. $MISCMODS
  1394. $USBMODS
  1395. $ACPIMODS
  1396. $AGPMODS
  1397. $I2CMODS
  1398. $PLATFORMMODS
  1399. $GSPCAMODS
  1400. $BLUETOOTHMODS
  1401. $DRMMODS
  1402. $CPUSCALING2MODS
  1403. $CPUSCALINGMODS
  1404. $CRYPTOMODS
  1405. $FBCONMODS
  1406. $EXTRAMODS"
  1407. echo "$CHOSENMODS"| tr -s '\n' > /tmp/chosenmods.txt
  1408. echo "Finding all dependent modules..."
  1409. echo -n "" > /tmp/alldeps.txt
  1410. echo "$CHOSENMODS" |
  1411. while read ONEMOD
  1412. do
  1413. [ "$ONEMOD" = "" ] && continue #precaution
  1414. ONEBASE="`basename $ONEMOD`"
  1415. DPATTERN="/${ONEBASE}:"
  1416. PPATTERN="s/^\/lib\/modules\/${KERNELVER}\///g"
  1417. ONEDEPS="`cat rootfs-complete/lib/modules/$KERNELVER/modules.dep | grep "$DPATTERN" | cut -f 2 -d ':' | tr ' ' '\n' | sed -e "$PPATTERN"`"
  1418. [ "$ONEDEPS" != "" ] && echo "$ONEDEPS" >> /tmp/alldeps.txt
  1419. done
  1420. sync
  1421. sort -u /tmp/alldeps.txt > /tmp/alldepssorted.txt #remove duplicate lines.
  1422. cat /tmp/alldepssorted.txt >> /tmp/chosenmods.txt
  1423. sort -u /tmp/chosenmods.txt > /tmp/allmodssorted.txt
  1424. sync
  1425. #now delete all mods not in the list...
  1426. echo "Moving unwanted modules to a separate sfs file..." #"Deleting unwanted modules..."
  1427. find rootfs-complete/lib/modules/$KERNELVER/ -type f -name '*.ko' -o -name '*.HIDE' |
  1428. while read ONEMODSPEC
  1429. do
  1430. ONEMODNAME="`basename $ONEMODSPEC`"
  1431. mPATTERN='/'"$ONEMODNAME"
  1432. if [ "`grep "$mPATTERN" /tmp/allmodssorted.txt`" = "" ];then
  1433. ONEMODPATH="`dirname $ONEMODSPEC`"
  1434. xONEMODPATH="`echo -n "$ONEMODPATH" | sed -e 's%^rootfs\-complete/%%'`"
  1435. mkdir -p zdrv/${xONEMODPATH}
  1436. cp -a $ONEMODSPEC zdrv/${xONEMODPATH}/
  1437. rm -f $ONEMODSPEC
  1438. #091203 remove firmware tarball...
  1439. ONEMODBASE="`basename $ONEMODSPEC`"
  1440. ombPATTERN='[:,]'"$ONEMODBASE"
  1441. FWFND="`grep "$ombPATTERN" rootfs-complete/etc/modules/firmware.dep.${KERNELVER} | cut -f 1 -d ':'`"
  1442. if [ "$FWFND" ];then
  1443. if [ -f rootfs-complete/lib/modules/all-firmware/${FWFND}.tar.gz ];then
  1444. mkdir -p zdrv/lib/modules/all-firmware
  1445. mv -f rootfs-complete/lib/modules/all-firmware/${FWFND}.tar.gz zdrv/lib/modules/all-firmware/
  1446. fi
  1447. fi
  1448. fi
  1449. done
  1450. #special case:
  1451. mv -f rootfs-complete/lib/modules/all-firmware/intel537ep.tar.gz zdrv/lib/modules/all-firmware/
  1452. cp -a -f --remove-destination rootfs-complete/lib/modules/${KERNELVER}/intelmodem zdrv/lib/modules/${KERNELVER}/
  1453. rm -rf rootfs-complete/lib/modules/${KERNELVER}/intelmodem
  1454. echo "Creating ${ZDRVSFS} 'zdrv' file..." #100911
  1455. sync
  1456. #w091029 use busybox depmod, creates smaller modules* files...
  1457. #./depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1458. if [ "$USINGKMOD" = "no" ];then #130418
  1459. busybox depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1460. else
  1461. ./depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  1462. fi
  1463. sync
  1464. MAKEZDRV="unwanted-modules" #w481 delay. 100903
  1465. else
  1466. #w460 retaining all modules, but offer to move them to a separate zdrv... 100911
  1467. if [ "$CHK_YES_ZDRV" = "" ];then #120506
  1468. echo
  1469. echo "If you wish, you can move the modules to a separate zdrv sfs file."
  1470. echo "Right now they are in rootfs-complete, which will become ${PUPPYSFS},"
  1471. echo "however there are advantages if the modules and firmware are in a separate"
  1472. echo "'zdrv' sfs file -- it will not be copied into RAM at bootup, speeding bootup"
  1473. echo "and using up less RAM, yet not sacrificing any speed."
  1474. echo -n "Press ENTER key only to leave them alone, else any char for a separate zdrv: "
  1475. read wantzdrv
  1476. CHK_YES_ZDRV="false"
  1477. [ "$wantzdrv" != "" ] && CHK_YES_ZDRV="true"
  1478. fi
  1479. if [ "$CHK_YES_ZDRV" = "true" ];then
  1480. echo
  1481. echo "Creating ${ZDRVSFS} 'zdrv' file..." #100911
  1482. mkdir -p zdrv/lib
  1483. mv -f rootfs-complete/lib/modules zdrv/lib/
  1484. sync
  1485. MAKEZDRV="all-modules" #w481 delay. 100903
  1486. else
  1487. echo "...okay, leaving modules inside ${PUPPYSFS}" #100911
  1488. fi
  1489. fi
  1490. ##091125 offer to cutdown fonts...
  1491. #echo
  1492. #echo "Would you like to cutdown the bitmap fonts in usr/share/X11/fonts/misc"
  1493. #echo "to the barest minimum? The bitmap fonts were used in older xlib apps"
  1494. #echo "(not gtk or qt) and some cli (non-X) apps. Okay to answer yes if want"
  1495. #echo "to build a small iso. Saving about 1.5MB uncompressed."
  1496. #echo -n "Hit ENTER only to cutdown 'misc' fonts: "
  1497. #read cutdownmisc
  1498. #if [ "$cutdownmisc" = "" ];then
  1499. # 7x14B-ISO8859-1.pcf
  1500. # 7x14-ISO8859-1.pcf #default for xlib, set in root/.Xresources
  1501. # cursor.pcf
  1502. # 8x16.pcf #used by yaf-splash, ex usr/sbin/pmount
  1503. # 9x15B-ISO8859-1.pcf #used by yaf-splash in usr/sbin/delayedrun, sbin/pup_event_frontend_d
  1504. # symb12.pcf #used by xcalc, see etc/X11/app-defaults/Xcalc
  1505. # helvB12-ISO8859-1.pcf #used by Xclipboard
  1506. # courR12-ISO8859-1.pcf # "
  1507. # helvR24-ISO8859-1.pcf #used by Xlock
  1508. # courB12-ISO8859-1.pcf #'fixed' font that some xlib apps use.
  1509. # helvR12-ISO8859-1.pcf #'variable' font that some xlib apps use.
  1510. #
  1511. #fi
  1512. #100622 slackware 13.1: just in case any got through, remove c-shell scripts...
  1513. rm -f rootfs-complete/etc/profile.d/*.csh* 2>/dev/null
  1514. #sanity check...
  1515. echo
  1516. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1517. chroot rootfs-complete echo 'testing chroot'
  1518. if [ $? -ne 0 ];then
  1519. echo "ERROR: could not 'chroot' into sandbox3/rootfs-complete"
  1520. echo "This means that something is incomplete, perhaps a library"
  1521. echo "needed by bash. Check it out. Have to exit script now."
  1522. exit
  1523. fi
  1524. else
  1525. echo "Normally, the script now does a sanity-test by chrooting into"
  1526. echo "sandbox3/rootfs-complete, however as you are doing a cross-build, this"
  1527. echo "cannot be done."
  1528. fi
  1529. #before building puppy.sfs from rootfs-complete, check for any invalid symlinks
  1530. #and move them to the devx...
  1531. echo
  1532. echo "Finding invalid symlinks..."
  1533. rm -rf devx
  1534. mkdir devx
  1535. #v431 aaargh, latest pburn (3.1.1) has a symlink with spaces in name...
  1536. #for ONESYMLINK in `find rootfs-complete/ -type l`
  1537. find rootfs-complete/ -type l |
  1538. while read ONESYMLINK
  1539. do
  1540. [ "`echo -n "$ONESYMLINK" | grep '/dev/'`" != "" ] && continue
  1541. [ "`echo -n "$ONESYMLINK" | grep '/proc/'`" != "" ] && continue
  1542. xONESYMLINK="`echo -n "$ONESYMLINK" | sed -e 's/^rootfs\-complete//'`"
  1543. #w018 some symlinks become valid after puppy 1st boot...
  1544. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1545. LINKTO="`chroot rootfs-complete readlink "$xONESYMLINK"`"
  1546. [ "`echo -n "$LINKTO" | grep 'lib/X11/pixmaps'`" != "" ] && continue #these images created 1st boot.
  1547. if [ "`chroot rootfs-complete readlink -e "$xONESYMLINK"`" = "" ];then
  1548. UPONE="`dirname "$xONESYMLINK"`"
  1549. mkdir -p devx${UPONE}
  1550. cp -a -f "$ONESYMLINK" devx${UPONE}/
  1551. rm -f "$ONESYMLINK"
  1552. fi
  1553. else
  1554. #do it without chroot...
  1555. LINKTO="`readlink rootfs-complete"${xONESYMLINK}"`" #120502 fix for spaces in path.
  1556. [ -e rootfs-complete${LINKTO} ] && continue #absolute path
  1557. UPONE="`dirname "$xONESYMLINK"`"
  1558. [ -e rootfs-complete${UPONE}/${LINKTO} ] && continue #relative path
  1559. mkdir -p devx${UPONE}
  1560. cp -a -f "$ONESYMLINK" devx${UPONE}/
  1561. rm -f "$ONESYMLINK"
  1562. fi
  1563. done
  1564. #for ONESYMLINK in `find rootfs-complete/ -type l`
  1565. #do
  1566. # [ "`echo -n "$ONESYMLINK" | grep '/dev/'`" != "" ] && continue
  1567. # [ "`echo -n "$ONESYMLINK" | grep '/proc/'`" != "" ] && continue
  1568. # xONESYMLINK="`echo -n "$ONESYMLINK" | sed -e 's/^rootfs\-complete//'`"
  1569. # #w018 some symlinks become valid after puppy 1st boot...
  1570. # LINKTO="`chroot rootfs-complete readlink $xONESYMLINK`"
  1571. # [ "`echo -n "$LINKTO" | grep 'lib/X11/pixmaps'`" != "" ] && continue #these images created 1st boot.
  1572. # if [ "`chroot rootfs-complete readlink -e $xONESYMLINK`" = "" ];then
  1573. # UPONE="`dirname $xONESYMLINK`"
  1574. # mkdir -p devx${UPONE}
  1575. # cp -a -f $ONESYMLINK devx${UPONE}/
  1576. # rm -f $ONESYMLINK
  1577. # fi
  1578. #done
  1579. sync
  1580. #get info about the ubuntu pkgs...
  1581. echo "Updating pkg data in rootfs-complete/root/.packages ..."
  1582. #copy them into the live-cd also...
  1583. #in case of Ppup4, PKGLISTS_COMPAT='Packages-puppy-4xx-official'
  1584. for ONELIST in $PKGLISTS_COMPAT
  1585. do
  1586. cp -f ../$ONELIST ./
  1587. cp -f ../$ONELIST rootfs-complete/root/.packages/
  1588. done
  1589. for ONELIST in $PACKAGELISTS_PET_ORDER #120506
  1590. do
  1591. cp -f ../$ONELIST ./
  1592. cp -f ../$ONELIST rootfs-complete/root/.packages/
  1593. done
  1594. #note, Ppup4, findwoofinstalledpkgs.sh (below) needs above file, then deletes it.
  1595. #also copy the pet package databases...
  1596. cp -f ../Packages-puppy-[0-9]-official rootfs-complete/root/.packages/ 2>/dev/null
  1597. cp -f ../Packages-puppy-common-official rootfs-complete/root/.packages/ 2>/dev/null #110608
  1598. #cp -f ../Packages-puppy-wary5-official rootfs-complete/root/.packages/
  1599. cp -f ../Packages-puppy-noarch-official rootfs-complete/root/.packages/ #120305
  1600. #121102
  1601. if [ -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official ];then #110723 ex: Packages-puppy-drake-official
  1602. cp -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official rootfs-complete/root/.packages/
  1603. cp -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official ./
  1604. #120506...
  1605. ../support/rationalize_categories Packages-puppy-${DISTRO_DB_SUBNAME}-official
  1606. cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-${DISTRO_DB_SUBNAME}-official
  1607. fi
  1608. #101014 rationalise categories... 110726 must *always* copy Packages-puppy-wary5-official (it is going to be the fallback)...
  1609. #if [ "$DISTRO_COMPAT_VERSION" = "wary5" ];then #101025
  1610. if [ -f Packages-puppy-wary5-official ];then
  1611. ../support/rationalize_categories Packages-puppy-wary5-official
  1612. cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-wary5-official
  1613. fi
  1614. #fi
  1615. #if [ "${DISTRO_FILE_PREFIX}" = "drake" ];then #110723
  1616. # ../support/rationalize_categories Packages-puppy-drake-official
  1617. # cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-drake-official
  1618. #fi
  1619. #if [ "${DISTRO_FILE_PREFIX}" = "slacko" ];then #110816
  1620. # ../support/rationalize_categories Packages-puppy-slacko-official
  1621. # cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-slacko-official
  1622. #fi
  1623. #also copy this...
  1624. cp -f ../PKGS_MANAGEMENT rootfs-complete/root/.packages/
  1625. #477 a puppy-puppy build will not have any compat-distro databases...
  1626. petcntlimit=3
  1627. COMPATDISTRO_DB_FILES="`ls -1 rootfs-complete/root/.packages/Packages-[^p]* 2>/dev/null`"
  1628. [ "$COMPATDISTRO_DB_FILES" = "" ] && petcntlimit=5
  1629. #w476 swap to make sure 3 pet repos get chosen...
  1630. enabledrepos=" "
  1631. #100207 now using the quirky pet repo for all puppy builds...
  1632. [ -f ../Packages-puppy-quirky-official ] && cp -f ../Packages-puppy-quirky-official rootfs-complete/root/.packages/
  1633. #100730 DISTRO_COMPAT_VERSION for puppy builds no longer limited to a number 1-5 (ex: wary5)
  1634. fNUM1=`echo -n "$DISTRO_COMPAT_VERSION" | wc -c`
  1635. #100116 quirky, want the quirky db first in list... 101126 no, now building quirky from wary5 pkgs...
  1636. #if [ "`echo "$DISTRO_NAME" | grep -i 'quirky'`" != "" ];then
  1637. # enabledrepos="Packages-puppy-quirky-official Packages-puppy-4-official Packages-puppy-3-official "
  1638. # #cp -f ../Packages-puppy-quirky-official rootfs-complete/root/.packages/
  1639. #else
  1640. repocnt=1
  1641. case $DISTRO_FILE_PREFIX in #110906 fix. $DISTRO_COMPAT_VERSION in #100911
  1642. lucid|lupu|luci) #110906 fix. 120305 120312
  1643. enabledrepos="Packages-puppy-lucid-official Packages-puppy-noarch-official "
  1644. ;;
  1645. wary|racy) #110906 110917 120305 120312 121105
  1646. enabledrepos="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-quirky-official Packages-puppy-noarch-official Packages-puppy-4-official " #110824 added -common-
  1647. ;;
  1648. slacko) #110824 120305 120312 121105
  1649. enabledrepos="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official "
  1650. ;;
  1651. dpup|sqzd) #110824 110906 120305 120312
  1652. enabledrepos="Packages-puppy-dpup-official Packages-puppy-noarch-official "
  1653. ;;
  1654. *)
  1655. #add the puppy repos... (i want 5, 4, 3)...
  1656. for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-puppy* | sort -r`
  1657. do
  1658. [ $repocnt -gt $petcntlimit ] && break #limit of 3 puppy repos.
  1659. BASEREPO="`basename $ONEREPO`"
  1660. [ "$BASEREPO" = "Packages-puppy-wary5-official" ] && continue #100911 handled above.
  1661. [ "$BASEREPO" = "Packages-puppy-lucid-official" ] && continue #100911 handled above.
  1662. [ "$BASEREPO" = "Packages-puppy-slacko-official" ] && continue #110824 handled above.
  1663. #w478 a problem if building an old puppy-puppy, don't want more recent db's... 100730...
  1664. if [ "$DISTRO_BINARY_COMPAT" = "puppy" ];then
  1665. ONEREPNUM=`echo -n "$BASEREPO" | cut -f 3 -d '-'`
  1666. fNUM2=`echo -n "$ONEREPNUM" | wc -c`
  1667. #[ "`echo -n "$ONEREPNUM" | grep '[a-z]'`" != "" ] && continue
  1668. [ $fNUM1 -eq 1 ] && [ $fNUM2 -eq 1 ] && [ $ONEREPNUM -gt $DISTRO_COMPAT_VERSION 2>/dev/null ] && continue
  1669. fi
  1670. # #w019 have decided don't want this showing up in PPM...
  1671. # [ "$BASEREPO" = "Packages-puppy-woof-official" ] && continue
  1672. enabledrepos="${enabledrepos}${BASEREPO} "
  1673. repocnt=`expr $repocnt + 1`
  1674. done
  1675. ;;
  1676. esac
  1677. #add compat-distro repos...
  1678. if [ "$COMPATDISTRO_DB_FILES" != "" ];then
  1679. for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-[^p]*`
  1680. do
  1681. [ $repocnt -gt 5 ] && break #only allow 5 active repos in PPM.
  1682. BASEREPO="`basename $ONEREPO`"
  1683. enabledrepos="${enabledrepos}${BASEREPO} "
  1684. repocnt=`expr $repocnt + 1`
  1685. done
  1686. fi
  1687. #fi
  1688. #120831 above code ok, but really just want these...
  1689. case $DISTRO_BINARY_COMPAT in
  1690. ubuntu)
  1691. xPUPPYREPOS="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official" #Packages-puppy-common-official
  1692. xCOMPATREPOS="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-universe$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
  1693. #130330 would like universe first...
  1694. xCOMPATREPOS1="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-universe$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
  1695. xCOMPATREPOS2="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
  1696. enabledrepos=" ${xCOMPATREPOS1} ${xCOMPATREPOS2} ${xPUPPYREPOS} "
  1697. ;;
  1698. esac
  1699. echo "PKG_REPOS_ENABLED='${enabledrepos}'" >> rootfs-complete/root/.packages/PKGS_MANAGEMENT
  1700. if [ -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then #w478
  1701. cp -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
  1702. else
  1703. cp -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
  1704. fi
  1705. #101013 remove wrong alternate choice (old/new kernel optional pkgs)...
  1706. if [ -f /tmp/3builddistro_removed_alt ];then
  1707. for ONEREMOVE in `cat /tmp/3builddistro_removed_alt | tr '\n' ' '`
  1708. do
  1709. orPATTERN='yes|'"$ONEREMOVE"'|'
  1710. grep -v "$orPATTERN" rootfs-complete/root/.packages/DISTRO_PKGS_SPECS > /tmp/DISTRO_PKGS_SPECS-tempor
  1711. cp -f /tmp/DISTRO_PKGS_SPECS-tempor rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
  1712. done
  1713. fi
  1714. if [ -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  1715. cp -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} rootfs-complete/root/.packages/DISTRO_COMPAT_REPOS
  1716. else #130306
  1717. cp -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT} rootfs-complete/root/.packages/DISTRO_COMPAT_REPOS
  1718. fi
  1719. #this needed to update pkg db's in a running puppy...
  1720. cp -f ../0setup rootfs-complete/usr/local/petget/
  1721. #w015 0setup calls this for faster operation...
  1722. cp -f ../support/find_cat rootfs-complete/usr/local/petget/
  1723. #w091017 0setup also needs these, fast conversion created by Wosh...
  1724. [ -f ../support/ppkg ] && cp -f ../support/ppkg rootfs-complete/usr/local/petget/
  1725. [ -f ../support/ppkg.ctg ] && cp -f ../support/ppkg.ctg rootfs-complete/usr/local/petget/
  1726. #110612 0setup needs these...
  1727. [ -f ../support/rpm2ppm ] && cp -f ../support/rpm2ppm rootfs-complete/usr/local/petget/
  1728. [ -f ../support/mageia2ppm ] && cp -f ../support/mageia2ppm rootfs-complete/usr/local/petget/
  1729. #121111 new fast deb to pup db converter, called by 0setup...
  1730. [ -f ../support/debdb2pupdb ] && cp -f ../support/debdb2pupdb rootfs-complete/usr/local/petget/
  1731. #urls etc on the pet db's...
  1732. cp -f ../DISTRO_PET_REPOS rootfs-complete/root/.packages/
  1733. #w018 homepages of heaps of pkgs (see 0pre script)...
  1734. cp -f ../PKGS_HOMEPAGES rootfs-complete/root/.packages/
  1735. #cp -f ../support/inline_get_pet rootfs-complete/root/.packages/ #100801
  1736. #cp -f ../support/inline_get_compat rootfs-complete/root/.packages/ #100806
  1737. #cp -f ../support/findpkgs rootfs-complete/root/.packages/ #110821 110823 revert.
  1738. #130316 see 0setup and debdb2pupdb...
  1739. case ${DISTRO_BINARY_COMPAT} in
  1740. debian|ubuntu|raspbian)
  1741. if [ ! -f ../invaliddepslist ];then
  1742. echo "WARNING WARNING"
  1743. echo "File 'invaliddepslist' does not exist.
  1744. This is created by script '0setup'. You must go back and rerun all of the
  1745. scripts from 0setup, 1download, 2createpackages.
  1746. Recommend abort this script now (ctrl-c).
  1747. Or, if you press ENTER to continue, an empty 'invaliddepslist' file will
  1748. be created."
  1749. echo -n "Press ENTER to continue: "
  1750. read justgoon
  1751. touch ../invaliddepslist
  1752. fi
  1753. ;;
  1754. esac
  1755. [ -f ../invaliddepslist ] && cp -f ../invaliddepslist rootfs-complete/usr/local/petget/
  1756. #build a db of builtin packages, woof-installed-packages ... 110823 no need to chroot...
  1757. #chroot rootfs-complete /usr/local/petget/findwoofinstalledpkgs.sh
  1758. cp ../woof-installed-packages rootfs-complete/root/.packages/ #110823 already created earlier this script.
  1759. touch ../devx-only-installed-packages #121028
  1760. cp ../devx-only-installed-packages rootfs-complete/root/.packages/ #121028
  1761. #110722 add kernel db line...
  1762. echo "$KERNEL_DB_ENTRY" >> rootfs-complete/root/.packages/woof-installed-packages
  1763. #sort alphabetically...
  1764. sort --key=1 --field-separator="|" rootfs-complete/root/.packages/woof-installed-packages > /tmp/petget_woof-installed-packages
  1765. mv -f /tmp/petget_woof-installed-packages rootfs-complete/root/.packages/woof-installed-packages
  1766. #currently not using these...
  1767. rm -f rootfs-complete/etc/rc.d/rc.sysinit-UNIPUP
  1768. rm -f rootfs-complete/etc/rc.d/rc.shutdown-UNIPUP
  1769. #120628 certain utilities are not appropriate when booting on an arm board...
  1770. if [ "$SDFLAG" != "" ];then
  1771. rm -f rootfs-complete/usr/sbin/grubconfig
  1772. rm -f rootfs-complete/usr/sbin/remasterpup2
  1773. rm -f rootfs-complete/usr/sbin/resizepfile.sh
  1774. rm -f rootfs-complete/usr/sbin/wakepup2
  1775. rm -f rootfs-complete/usr/share/applications/Grub-bootloader-config.desktop
  1776. rm -f rootfs-complete/usr/share/applications/BootFlash-usb-installer.desktop
  1777. rm -f rootfs-complete/usr/share/applications/Puppy-universal-installer.desktop
  1778. rm -f rootfs-complete/usr/share/applications/Remaster-Puppy-live-CD.desktop
  1779. rm -f rootfs-complete/usr/share/applications/Resize-personal-storage-file.desktop
  1780. rm -f rootfs-complete/usr/share/applications/WakePup2.desktop
  1781. fi
  1782. #130326 script to adjust fonts to suit 96 dpi (puppy used to have 78 dpi)...
  1783. rootfs-complete/usr/sbin/hackfontsize
  1784. #130618 restore the "layer:" lines in /etc/xdg/templates/_root_.jwmrc...
  1785. #note, this file is now in Woof, I took it out of the JWM pet.
  1786. JWMFLG=0
  1787. JWM3=`grep -E '^jwm[_-][0-9]' rootfs-complete/root/.packages/woof-installed-packages | cut -f 3 -d '|' | cut -c 1-3 | head -n 1`
  1788. [ ! $JWM3 ] && JWMFLG=1 #assume too old. note, there is a jwm2 pet, which is older version.
  1789. if vercmp $JWM3 ge 2.2; then JWMFLG=2; fi
  1790. if vercmp $JWM3 ge 790; then JWMFLG=2; fi
  1791. case $JWMFLG in
  1792. 2)
  1793. sed -i -e 's%.*LAYER_MINIXCAL.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
  1794. sed -i -e 's%.*LAYER_GTKDIALOGSPLASH.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
  1795. sed -i -e 's%.*LAYER_SPLASHWINDOW.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
  1796. ;;
  1797. esac
  1798. #fix the menus...
  1799. #111123 ***NOTICE*** cross-build, will have to run fixmenus and indexgen.sh at first bootup.
  1800. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1801. echo
  1802. echo "Constructing configuration files for JWM, Fvwm95, IceWM, openbox..."
  1803. chroot rootfs-complete /usr/sbin/fixmenus
  1804. #generate help index...
  1805. chroot rootfs-complete /usr/sbin/indexgen.sh
  1806. #...note, rootfs-skeleton/pinstall.sh pre-processes the help files.
  1807. fi
  1808. #shared library loading...
  1809. echo "/lib" > rootfs-complete/etc/ld.so.conf
  1810. echo "/usr/lib" >> rootfs-complete/etc/ld.so.conf
  1811. [ -d rootfs-complete/usr/local/lib ] && echo "/usr/local/lib" >> rootfs-complete/etc/ld.so.conf
  1812. [ -d rootfs-complete/usr/X11R7/lib ] && echo "/usr/X11R7/lib" >> rootfs-complete/etc/ld.so.conf
  1813. [ -d rootfs-complete/opt/gnome2/lib ] && echo "/opt/gnome2/lib" >> rootfs-complete/etc/ld.so.conf
  1814. [ -d rootfs-complete/opt/qt4/lib ] && echo "/opt/qt4/lib" >> rootfs-complete/etc/ld.so.conf
  1815. [ -d rootfs-complete/opt/mozilla.org/lib ] && echo "/opt/mozilla.org/lib" >> rootfs-complete/etc/ld.so.conf
  1816. [ -d rootfs-complete/opt/samba/lib ] && echo "/opt/samba/lib" >> rootfs-complete/etc/ld.so.conf
  1817. echo "/root/my-applications/lib" >> rootfs-complete/etc/ld.so.conf
  1818. #generate /etc/ld.so.cache shared lib loading cache file... w019 not always there...
  1819. #cp -a ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/sbin/ldconfig rootfs-complete/
  1820. #100527 stupid thing, needs '/' on end of path in case of 'packages-qret' being a symlink...
  1821. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1822. LDCONFIG="`find ../packages-${DISTRO_FILE_PREFIX}/ -type f -name ldconfig | grep '/sbin/' | head -n 1`"
  1823. cp -a $LDCONFIG rootfs-complete/
  1824. chroot rootfs-complete ./ldconfig
  1825. rm -f rootfs-complete/ldconfig
  1826. sync
  1827. else
  1828. #***NOTICE*** have to run ldconfig at first boot.
  1829. LDCONFIG="`find ../packages-${DISTRO_FILE_PREFIX}/ -type f -name ldconfig | grep '/sbin/' | head -n 1`"
  1830. cp -a $LDCONFIG rootfs-complete/sbin/
  1831. fi
  1832. #i don't know what 'lintian' is for...
  1833. rm -rf rootfs-complete/usr/share/lintian 2>/dev/null
  1834. #maybe stray /install dir from slackware pkgs...
  1835. rm -rf rootfs-complete/install 2>/dev/null
  1836. #slackware pkg may create this...
  1837. rm -rf rootfs-complete/etc/cron.daily 2>/dev/null
  1838. #w460 theme selection...
  1839. echo
  1840. echo "Continuing to setup `pwd`/rootfs-complete..."
  1841. echo
  1842. #w478 now have a gui for theme selection...
  1843. eval "`../support/choose_themes`"
  1844. #...returns BACKGROUNDIMAGE, DESKICONS, GTKTHEME, JWMTHEME.
  1845. if [ "$EXIT" = "OK" ];then
  1846. #BACKGROUNDIMAGE="zzzzzzzz"
  1847. #echo "Here are the available background images (ref: usr/share/backgrounds):"
  1848. #ls -1 rootfs-complete/usr/share/backgrounds
  1849. #echo
  1850. #while [ ! -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE ];do
  1851. # echo "Type the full filename of the one you want as default"
  1852. # echo -n "(ENTER only will select the first): "
  1853. # read BACKGROUNDIMAGE
  1854. # [ "$BACKGROUNDIMAGE" = "" ] && BACKGROUNDIMAGE="`ls -1 rootfs-complete/usr/share/backgrounds | head -n 1`"
  1855. #done
  1856. case $BACKGROUNDIMAGE in #110831
  1857. *.png|*.PNG)
  1858. mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.png
  1859. sed -i -e 's%default\.jpg%default.png%' rootfs-complete/root/Choices/ROX-Filer/PuppyPin
  1860. #i don't know what uses this, but change it anyway...
  1861. sed -i -e 's%default\.jpg%default.png%' rootfs-complete/etc/Puppybackgroundpicture
  1862. ;;
  1863. *)
  1864. mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.jpg
  1865. ;;
  1866. esac
  1867. ##w477 choose gtk theme...
  1868. #echo
  1869. #echo "Here are the available GTK themes (ref: usr/share/themes):"
  1870. #ls -1 rootfs-complete/usr/share/themes/*/gtk-2.0 | grep '^rootfs-complete/usr/share/themes' | cut -f 5 -d '/'
  1871. #echo
  1872. #GTKTHEME="zzzzzzzzzz"
  1873. #while [ ! -d "rootfs-complete/usr/share/themes/$GTKTHEME" ];do
  1874. # echo "Type the full filename of the one you want as default"
  1875. # echo -n "(ENTER only will select the first): "
  1876. # read GTKTHEME
  1877. # [ "$GTKTHEME" = "" ] && GTKTHEME="`ls -1 rootfs-complete/usr/share/themes/*/gtk-2.0 | grep '^rootfs-complete/usr/share/themes' | cut -f 5 -d '/' | head -n 1`"
  1878. #done
  1879. #130329 append extra line, needed for Qt4 theme matching. (see also /etc/profile.d/pup_gtk and /root/.config/Trolltech.conf)...
  1880. echo "# -- THEME AUTO-WRITTEN DO NOT EDIT
  1881. include \"/usr/share/themes/${GTKTHEME}/gtk-2.0/gtkrc\"
  1882. include \"/root/.gtkrc.mine\"
  1883. # -- THEME AUTO-WRITTEN DO NOT EDIT
  1884. gtk-theme-name=\"${GTKTHEME}\"" > rootfs-complete/root/.gtkrc-2.0
  1885. #130401 01micko...
  1886. # gtk3 theme support thunor http://murga-linux.com/puppy/viewtopic.php?p=695722#695722
  1887. #[ -d rootfs-complete/root/.config/gtk-3.0 ] || mkdir -p rootfs-complete/root/.config/gtk-3.0
  1888. pathGTK3THEME="`find rootfs-complete/usr/share/themes/${GTKTHEME} -type d -name gtk-3.0`"
  1889. if [ "$pathGTK3THEME" ];then #XDG_CONFIG_HOME=/root/.config
  1890. # [ -f ${pathGTK3THEME}/settings.ini ] && cp -af ${pathGTK3THEME}/settings.ini rootfs-complete/root/.config/gtk-3.0/ || echo -e "[Settings] \ngtk-theme-name = \"${GTKTHEME}\" \ngtk-fallback-icon-theme = \"gnome\"" > rootfs-complete/root/.config/gtk-3.0/settings.ini
  1891. # #[ -f ${pathGTK3THEME}/gtk.css ] && cp -af ${pathGTK3THEME}/gtk.css rootfs-complete$XDG_CONFIG_HOME/gtk-3.0/ ||\# doesn't work
  1892. # echo "" > rootfs-complete/root/.config/gtk-3.0/gtk.css
  1893. #130404 link to actual theme...
  1894. ln -snf "$pathGTK3THEME" rootfs-complete/root/.config/gtk-3.0
  1895. fi
  1896. #echo
  1897. #DESKICONS="zzzzzzzzz"
  1898. #echo "Here are the available desktop icon themes (ref: usr/local/lib/X11/themes):"
  1899. #find rootfs-complete/usr/local/lib/X11/themes -maxdepth 1 -mindepth 1 -type d | rev | cut -f 1 -d '/' | rev
  1900. #while [ ! -d "rootfs-complete/usr/local/lib/X11/themes/$DESKICONS" ];do
  1901. # echo "Type the full filename of the one you want as default"
  1902. # echo -n "(ENTER only will select the first): "
  1903. # read DESKICONS
  1904. # [ "$DESKICONS" = "" ] && DESKICONS="`find rootfs-complete/usr/local/lib/X11/themes -maxdepth 1 -mindepth 1 -type d | rev | cut -f 1 -d '/' | rev | head -n 1`"
  1905. #done
  1906. echo -n "$DESKICONS" > rootfs-complete/etc/desktop_icon_theme
  1907. if [ -d rootfs-complete/root/.jwm/themes ];then
  1908. cp -f rootfs-complete/root/.jwm/themes/${JWMTHEME}-jwmrc rootfs-complete/root/.jwm/jwmrc-theme
  1909. cp -f rootfs-complete/root/.jwm/themes/${JWMTHEME}-colors rootfs-complete/root/.jwm/jwm_colors 2>/dev/null
  1910. fi
  1911. if [ -f rootfs-complete/root/.config/openbox/rc.xml ];then #20100406
  1912. obPATTERN="s%Natura%${OBTHEME}%"
  1913. sed -i -e "$obPATTERN" rootfs-complete/root/.config/openbox/rc.xml
  1914. fi
  1915. sync
  1916. fi #end theme chooser ok.
  1917. #110807 don't ask...
  1918. ##110803 workaround for 'pngoverlay' needs X runnning, also avoid cpu overhead at first startup...
  1919. ##/usr/sbin/icon_switcher_cli is called from /etc/rc.d/rc.update.
  1920. #echo
  1921. #echo "There are currently issues with building the default desktop icons in"
  1922. #echo "usr/local/lib/X11/pixmaps at first bootup of Puppy (PUPMODE=5)."
  1923. #echo "Recommend do it now, which will also save cpu time at first bootup."
  1924. #echo "Press any printable character then ENTER to defer building desktop icons."
  1925. #echo -n "Recommend press ENTER key only: "
  1926. #read DOITNOW
  1927. #if [ "$DOITNOW" = "" ];then
  1928. #110826 no longer calling icon_switcher_cli from rc.update, don't need this...
  1929. # #modify start of rootfs-complete/usr/sbin/icon_switcher_cli...
  1930. # sed -i -e 's%^#DONEINWOOF .*%[ "$PUPMODE" = "5" ] \&\& exit%' rootfs-complete/usr/sbin/icon_switcher_cli
  1931. #have copied code from icon_switcher_cli to here, modified...
  1932. NEWTHEME="$DESKICONS" #see above
  1933. for ONESVG in `find rootfs-complete/usr/local/lib/X11/themes/${NEWTHEME}/ -maxdepth 1 -type f -name \*.svg | tr '\n' ' '`
  1934. do
  1935. ONEBASENAME="`basename $ONESVG .svg`"
  1936. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}48.png
  1937. rsvg-convert -w 48 -h 48 -o rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}48.png $ONESVG
  1938. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}24.png
  1939. #rsvg-convert -w 24 -h 24 -o /tmp/${ONEBASENAME}24.png $ONESVG
  1940. ##if svg has transparency, JWM does not render properly in x16 bit color, screen out...
  1941. #pngtopnm -mix /tmp/${ONEBASENAME}24.png | pnmtopng > /usr/local/lib/X11/pixmaps/${ONEBASENAME}24.png
  1942. rsvg-convert -w 24 -h 24 -o rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}24.png $ONESVG
  1943. done
  1944. for ONEPNG in `find rootfs-complete/usr/local/lib/X11/themes/${NEWTHEME}/ -maxdepth 1 -type f -name \*.png | tr '\n' ' '`
  1945. do
  1946. ONEBASENAME="`basename $ONEPNG .png`"
  1947. cp -f $ONEPNG rootfs-complete/usr/local/lib/X11/pixmaps/
  1948. touch -m rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}.png #v3.98
  1949. xONEBASENAME="`basename $ONEBASENAME 48`"
  1950. if [ "$xONEBASENAME" != "$ONEBASENAME" ];then #scale to 24 pixels...
  1951. pngtopnm -alpha $ONEPNG > /tmp/temp.pbm #separate transparency channel.
  1952. pnmscale -reduce 2 /tmp/temp.pbm > /tmp/temp2.pbm 2> /dev/null
  1953. pngtopnm $ONEPNG | pnmscale -reduce 2 2>/dev/null | pnmtopng -alpha=/tmp/temp2.pbm > rootfs-complete/usr/local/lib/X11/pixmaps/${xONEBASENAME}24.png
  1954. touch -m rootfs-complete/usr/local/lib/X11/pixmaps/${xONEBASENAME}24.png #v3.98
  1955. fi
  1956. done
  1957. if [ "$DISPLAY" ];then #110726 pngoverlay does not work when X not running. --quick fix, perform this operation in woof in 3builddistro.
  1958. #110721 new standardised icons to show when mounted...
  1959. if [ -e rootfs-complete/usr/sbin/pngoverlay -a -e rootfs-complete/usr/local/lib/X11/pixmaps/closebox_outline48.png ];then #overlay app created by vovchik (see source /usr/sbin/pngoverlay.bac)
  1960. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/*_mntd*.png
  1961. #cp -f rootfs-complete/usr/sbin/pngoverlay rootfs-complete/usr/local/lib/X11/pixmaps/ #dumb, but needs to be in same folder.
  1962. #111123 get pngoverlay from host, in case of cross-build...
  1963. cp -f /usr/sbin/pngoverlay rootfs-complete/usr/local/lib/X11/pixmaps/ #dumb, but needs to be in same folder.
  1964. cd rootfs-complete/usr/local/lib/X11/pixmaps
  1965. for ONEDRV in card drive floppy optical usbdrv
  1966. do
  1967. ./pngoverlay ${ONEDRV}48.png closebox_outline48.png ${ONEDRV}_mntd48.png #background foreground output.
  1968. ./pngoverlay ${ONEDRV}48.png locked_outline48.png ${ONEDRV}_mntd_boot48.png
  1969. done
  1970. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/pngoverlay
  1971. cd ../../../../../../
  1972. fi
  1973. fi
  1974. #fi
  1975. #110912 modify jwm to use menu icon 'start-button.png' if present...
  1976. #note, similar code also in /usr/sbin/icon_switcher (desktop icon switcher script).
  1977. if [ -f rootfs-complete/root/.jwmrc-tray ];then
  1978. if [ -f rootfs-complete/usr/local/lib/X11/${NEWTHEME}/start-button.png ];then #default theme has menu icon.
  1979. if [ -f rootfs-complete/usr/local/lib/X11/pixmaps/start-button.png ];then #precaution.
  1980. if [ "`grep 'start-button\.png' rootfs-complete/root/.jwmrc-tray`" = "" ];then
  1981. #the default is to use 'mini-dog.xpm' with text "Menu"...
  1982. echo "rootfs-complete/root/.jwmrc-tray modified to use start-button.png menu icon"
  1983. echo "(which is in rootfs-complete/usr/local/lib/X11/pixmaps/)"
  1984. PTN1='s%label="Menu" icon="mini-dog\.xpm"%icon="start-button.png"%'
  1985. sed -i -e "$PTN1" rootfs-complete/root/.jwmrc-tray
  1986. fi
  1987. fi
  1988. fi
  1989. fi
  1990. #v423 moved down. remove 'default' image from cull list...
  1991. #w482 cutdown the background images, to 8 images, remove largest...
  1992. BIGBACKIMAGES="`ls -S -1 rootfs-complete/usr/share/backgrounds | head -n -8 | grep -v 'default' | tr '\n' ' '`"
  1993. for ONEBIGIMAGE in $BIGBACKIMAGES
  1994. do
  1995. rm -f rootfs-complete/usr/share/backgrounds/$ONEBIGIMAGE
  1996. done
  1997. #v424 rox desktop text is default white with black shadow, not suited all backgrounds...
  1998. echo
  1999. echo "The ROX-Filer desktop text defaults to white with black shadow, but this is"
  2000. echo "not best for some light backgound images. ENTER only to keep, but if you"
  2001. echo -n "want black text press any printable key then ENTER: "
  2002. read wantblacktext
  2003. if [ "$wantblacktext" != "" ];then
  2004. echo "...ok, black text"
  2005. grep -v 'pinboard_fg_colour' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
  2006. grep -v 'pinboard_shadow_labels' /tmp/3builddistro_rox_options > rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2007. grep -v '^</Options>' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
  2008. mv -f /tmp/3builddistro_rox_options rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2009. echo ' <Option name="pinboard_fg_colour">#000000000000</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2010. echo ' <Option name="pinboard_shadow_labels">0</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2011. echo '</Options>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2012. fi
  2013. #111010 set desktop font...
  2014. echo
  2015. echo "Also, ROX-Filer defaults to 'DejaVu Sans 10' font for the desktop. To accept"
  2016. echo "that just press ENTER. If you would prefer bold text 'DejaVu Sans Bold 10',"
  2017. echo "hit 'b' key then ENTER, or type in a full font specification (ex: Mono 12)"
  2018. echo -n ": "
  2019. read wantfont
  2020. if [ "$wantfont" != "" ];then
  2021. grep -v 'label_font' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
  2022. grep -v '^</Options>' /tmp/3builddistro_rox_options > rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2023. if [ "$wantfont" = "b" ];then
  2024. echo '...ok, bold'
  2025. echo ' <Option name="label_font">DejaVu Sans Bold 10</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2026. else
  2027. echo "...ok, $wantfont"
  2028. echo " <Option name=\"label_font\">${wantfont}</Option>" >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2029. fi
  2030. echo '</Options>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  2031. fi
  2032. #w464 maybe get rid of old mksquashfs... v424 fix
  2033. #w091019 running puppy with older glibc, mksquashfs may not work, so must chroot...
  2034. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  2035. if [ -e rootfs-complete/usr/sbin/mksquashfs ];then
  2036. if [ "`chroot rootfs-complete /usr/sbin/mksquashfs -version | grep 'mksquashfs version 4'`" = "" ];then
  2037. mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs3
  2038. else
  2039. [ ! -e rootfs-complete/usr/sbin/mksquashfs4 ] && mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs4
  2040. fi
  2041. if [ "$SQUASHFSMAJOR" = "4" ];then #100607
  2042. [ -e rootfs-complete/usr/sbin/mksquashfs4 ] && ln -s mksquashfs4 rootfs-complete/usr/sbin/mksquashfs
  2043. else
  2044. ln -s mksquashfs3 rootfs-complete/usr/sbin/mksquashfs
  2045. fi
  2046. fi
  2047. #ditto for unsquashfs... v424 fix w091019 chroot fix...
  2048. if [ -e rootfs-complete/usr/sbin/unsquashfs ];then
  2049. if [ "`chroot rootfs-complete /usr/sbin/unsquashfs -version | grep 'unsquashfs version 4'`" = "" ];then
  2050. mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs3
  2051. else
  2052. [ ! -e rootfs-complete/usr/sbin/unsquashfs4 ] && mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs4
  2053. fi
  2054. if [ "$SQUASHFSMAJOR" = "4" ];then #100607
  2055. [ -e rootfs-complete/usr/sbin/unsquashfs4 ] && ln -s unsquashfs4 rootfs-complete/usr/sbin/unsquashfs
  2056. else
  2057. ln -s unsquashfs3 rootfs-complete/usr/sbin/unsquashfs
  2058. fi
  2059. fi
  2060. else
  2061. #cross-build, assume recent kernel and has squashfs v4...
  2062. [ ! -e rootfs-complete/usr/sbin/mksquashfs4 ] && mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs4
  2063. [ -e rootfs-complete/usr/sbin/mksquashfs ] && [ ! -h rootfs-complete/usr/sbin/mksquashfs ] && mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs3 #120502
  2064. [ -e rootfs-complete/usr/sbin/mksquashfs4 ] && ln -s mksquashfs4 rootfs-complete/usr/sbin/mksquashfs
  2065. [ ! -e rootfs-complete/usr/sbin/unsquashfs4 ] && mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs4
  2066. [ -e rootfs-complete/usr/sbin/unsquashfs ] && [ ! -h rootfs-complete/usr/sbin/unsquashfs ] && mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs3 #120502
  2067. [ -e rootfs-complete/usr/sbin/unsquashfs4 ] && ln -s unsquashfs4 rootfs-complete/usr/sbin/unsquashfs
  2068. fi
  2069. #w469 delete /lib/modules/$KERNELVER/modules.* to save space...
  2070. #/etc/rc.d/rc.sysinit has code to run depmod.
  2071. #w481 ask delete modules.*...
  2072. echo
  2073. echo "Would you like to delete all the 'modules.*' files in lib/modules/${KERNELVER}?"
  2074. echo "This means that 'depmod' has to be run at first boot, but that is usually ok."
  2075. echo "These files occupy 600KB - 2MB uncompressed."
  2076. echo -n "Press ENTER only to delete them: "
  2077. read nodelmods
  2078. if [ "$nodelmods" = "" ];then
  2079. echo "...deleting modules.* files."
  2080. [ -d rootfs-complete/lib/modules/$KERNELVER ] && rm -f rootfs-complete/lib/modules/$KERNELVER/modules.* 2>/dev/null
  2081. [ -d zdrv/lib/modules/$KERNELVER ] && rm -f zdrv/lib/modules/$KERNELVER/modules.* 2>/dev/null
  2082. fi
  2083. #100628 my 2.6.34 pet has these...
  2084. mkdir -p rootfs-complete/lib/modules/$KERNELVER #101023 not there if separate zdrv built.
  2085. [ -f rootfs-complete/etc/modules/modules.builtin ] && mv -f rootfs-complete/etc/modules/modules.builtin rootfs-complete/lib/modules/$KERNELVER/
  2086. [ -f rootfs-complete/etc/modules/modules.order ] && mv -f rootfs-complete/etc/modules/modules.order rootfs-complete/lib/modules/$KERNELVER/
  2087. if [ "$MAKEZDRV" != "" ];then #w481 100903
  2088. #v425 big analog modules may have got moved out to the zdrv...
  2089. if [ -d big-modem-modules ];then
  2090. mkdir -p zdrv
  2091. cp -a -f big-modem-modules/rootfs-complete/* zdrv/
  2092. mkdir -p zdrv/lib/modules/all-firmware
  2093. cp -a -f big-modem-firmware/* zdrv/lib/modules/all-firmware/
  2094. sync
  2095. fi
  2096. if [ "$MAKEZDRV" = "all-modules" ];then #100903
  2097. mkdir -p zdrv/lib
  2098. mkdir -p zdrv/etc
  2099. mv -f rootfs-complete/lib/firmware zdrv/lib/
  2100. mv -f rootfs-complete/etc/modules zdrv/etc/
  2101. fi
  2102. echo
  2103. echo "Creating ${ZDRVSFS}..."
  2104. [ -f ${ZDRVSFS} ] && rm -f ${ZDRVSFS} #100911
  2105. ../support/${MKSQUASHFS} zdrv ${ZDRVSFS} ${COMPCHOICE} #100911 110713
  2106. sync
  2107. chmod 644 ${ZDRVSFS} #100903 100911
  2108. fi
  2109. #w470 create a table for dialog/Xdialog: /usr/share/i18n/dialog_table
  2110. #'chooselocale' is called from /etc/rc.d/rc.country at first boot and
  2111. #pre-creating this table speeds things up. 111123
  2112. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  2113. chroot rootfs-complete /usr/sbin/chooselocale composeonly
  2114. fi
  2115. [ -f rootfs-complete/pet.specs ] && rm -f rootfs-complete/pet.specs #w478
  2116. #w478 save some space if medit and gtksourceview both installed...
  2117. if [ -d rootfs-complete/usr/share/gtksourceview-2.0 ];then
  2118. if [ -d rootfs-complete/usr/share/moo/language-specs ];then
  2119. echo
  2120. echo "An optimisation can be done to share some files between medit and"
  2121. echo -n "gtksourceview. Press ENTER only to do this: "
  2122. read optsourceview
  2123. if [ "$optsourceview" = "" ];then
  2124. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/convert.py rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  2125. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language2.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  2126. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  2127. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language.dtd rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  2128. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/styles.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  2129. rm -r -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs
  2130. rm -r -f rootfs-complete/usr/share/gtksourceview-2.0/styles
  2131. ln -s /usr/share/moo/language-specs rootfs-complete/usr/share/gtksourceview-2.0/language-specs
  2132. ln -s /usr/share/moo/language-specs rootfs-complete/usr/share/gtksourceview-2.0/styles
  2133. echo "...usr/share/gtksourceview-2.0 now has links to usr/share/moo."
  2134. fi
  2135. fi
  2136. fi
  2137. #091123 t2 build get rid of some stray stuff...
  2138. [ -d rootfs-complete/usr/share/devhelp ] && rm -rf rootfs-complete/usr/share/devhelp
  2139. [ -d rootfs-complete/usr/share/man ] && rm -rf rootfs-complete/usr/share/man
  2140. [ -d rootfs-complete/usr/share/omf ] && rm -rf rootfs-complete/usr/share/omf
  2141. ##091206 cleanup some icons if quirky build...
  2142. #c1DFP="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1`" #100516
  2143. ##if [ "$DISTRO_FILE_PREFIX" = "quirky" ];then
  2144. #if [ "$c1DFP" = "q" ];then #100516
  2145. # ln -snf quirky-grey48x48.png rootfs-complete/usr/share/doc/puppylogo48.png
  2146. # ln -snf quirky-grey96x96.png rootfs-complete/usr/share/doc/puppylogo96.png
  2147. #else #111003
  2148. # rm -f rootfs-complete/usr/share/doc/quirky-grey48x48.png
  2149. # rm -f rootfs-complete/usr/share/doc/quirky-grey96x96.png
  2150. # case $DISTRO_FILE_PREFIX in
  2151. # racy)
  2152. # ln -snf racy48.png rootfs-complete/usr/share/doc/puppylogo48.png
  2153. # ln -snf racy96.png rootfs-complete/usr/share/doc/puppylogo96.png
  2154. # ;;
  2155. # *)
  2156. # rm -f rootfs-complete/usr/share/doc/racy48.png #111003
  2157. # rm -f rootfs-complete/usr/share/doc/racy96.png #111003
  2158. # ;;
  2159. # esac
  2160. #fi
  2161. #111006 generic logo mechanism for all pups...
  2162. if [ -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}48.png ];then
  2163. mv -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}48.png rootfs-complete/usr/share/doc/${DISTRO_FILE_PREFIX}48.png
  2164. ln -snf ${DISTRO_FILE_PREFIX}48.png rootfs-complete/usr/share/doc/puppylogo48.png
  2165. fi
  2166. if [ -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}96.png ];then
  2167. mv -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}96.png rootfs-complete/usr/share/doc/${DISTRO_FILE_PREFIX}96.png
  2168. ln -snf ${DISTRO_FILE_PREFIX}96.png rootfs-complete/usr/share/doc/puppylogo96.png
  2169. fi
  2170. rm -rf rootfs-complete/usr/share/doc/puplogos
  2171. #100208 hack so net-setup.sh can find ifplugstatus (pup 4.3.2 needs this)...
  2172. if [ ! -e rootfs-complete/sbin/ifplugstatus ];then
  2173. if [ -e rootfs-complete/sbin/ifplugstatus-0.18 ];then
  2174. ln -s ifplugstatus-0.18 rootfs-complete/sbin/ifplugstatus
  2175. else
  2176. if [ -e rootfs-complete/sbin/ifplugstatus-0.28 ];then
  2177. ln -s ifplugstatus-0.28 rootfs-complete/sbin/ifplugstatus
  2178. fi
  2179. fi
  2180. fi
  2181. #100524 fix cups for samba, got this code from /usr/sbin/cups_shell...
  2182. #fixes from rcrsn51 for samba printing...
  2183. [ -f rootfs-complete/etc/cups/snmp.conf ] && [ "`stat --format=%U%G rootfs-complete/etc/cups/snmp.conf | grep 'UNKNOWN'`" != "" ] && chown root:nobody rootfs-complete/etc/cups/snmp.conf
  2184. #100706 no, this goes against all the docs, restore to a symlink...
  2185. #if [ ! -e rootfs-complete/usr/lib/cups/backend/smb ];then
  2186. # [ -f rootfs-complete/opt/samba/bin/smbspool ] && cp -a rootfs-complete/opt/samba/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  2187. # [ -f rootfs-complete/usr/bin/smbspool ] && cp -a rootfs-complete/usr/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  2188. #fi
  2189. if [ ! -e rootfs-complete/usr/lib/cups/backend/smb ];then
  2190. [ -f rootfs-complete/opt/samba/bin/smbspool ] && ln -s /opt/samba/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  2191. [ -f rootfs-complete/usr/bin/smbspool ] && ln -s /usr/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  2192. fi
  2193. [ -f rootfs-complete/etc/opt/samba/smb.conf ] && chmod 755 rootfs-complete/etc/opt/samba/smb.conf #need world-readable.
  2194. [ -f rootfs-complete/etc/samba/smb.conf ] && chmod 755 rootfs-complete/etc/samba/smb.conf #need world-readable.
  2195. #110907 rcrsn51: network printing, need this... 111027 revert, must have actual pdftops from cups pkg...
  2196. #if [ ! -e rootfs-complete/usr/lib/cups/filter/pdftops ];then
  2197. # [ -f rootfs-complete/usr/bin/pdftops ] && ln -s /usr/bin/pdftops rootfs-complete/usr/lib/cups/filter/pdftops
  2198. #fi
  2199. #111026 davids45: /tmp needs 777 permissions. i do have this in rootfs-skeleton, but lost in sandbox3/rootfs-complete
  2200. # (http://murga-linux.com/puppy/viewtopic.php?t=72258&start=90)
  2201. #130203 01micko: make that 1777 ref: http://murga-linux.com/puppy/viewtopic.php?p=677630#677630
  2202. chmod 1777 rootfs-complete/tmp
  2203. chmod 777 rootfs-complete/var
  2204. #110911 fix if any alternate drivers still at old location...
  2205. mkdir -p rootfs-complete/usr/lib/x/drivers-alternate
  2206. if [ -d rootfs-complete/usr/lib/xorg/modules/drivers-alternate ];then
  2207. cp -a -f rootfs-complete/usr/lib/xorg/modules/drivers-alternate/* rootfs-complete/usr/lib/x/drivers-alternate/
  2208. rm -rf rootfs-complete/usr/lib/xorg/modules/drivers-alternate
  2209. fi
  2210. #100319 move more xorg drivers to 'drivers-alternate' so won't be chosen by xorg...
  2211. if [ -d rootfs-complete/usr/lib/xorg/modules/drivers ];then #well, always exists.
  2212. XORGBADDRIVERS=''
  2213. if [ -f rootfs-complete/usr/lib/xorg/modules/drivers/nvidia_drv.so -o -f rootfs-complete/usr/lib/xorg/modules/drivers/nouveau_drv.so ];then #100527 100629
  2214. [ -f rootfs-complete/usr/lib/xorg/modules/drivers/nv_drv.so ] && XORGBADDRIVERS='nv' #120922 note, some builds don't have nv, or it may already be in drivers-alternate dir.
  2215. fi
  2216. [ -f rootfs-complete/usr/lib/xorg/modules/drivers/modesetting_drv.so ] && XORGBADDRIVERS="${XORGBADDRIVERS} modesetting" #130330
  2217. echo
  2218. echo "Certain Xorg drivers have a bad reputation. Here you can choose to move them"
  2219. echo "to /usr/lib/x/drivers-alternate so Xorg will not use them, instead"
  2220. echo "will use the generic 'vesa' driver (or other more appropriate driver)."
  2221. echo "However the Xorg Wizard has a mechanism to move any drivers in "
  2222. echo "'drivers-alternate' back to 'drivers' directory."
  2223. echo "Here is the list of drivers currently in 'drivers-alternate':"
  2224. XORGBADDRIVERS="$XORGBADDRIVERS `ls -1 rootfs-complete/usr/lib/x/drivers-alternate | grep '_drv' | cut -f 1 -d '_' | tr '\n' ' '`"
  2225. echo " $XORGBADDRIVERS"
  2226. echo "Press ENTER only to accept this, or"
  2227. echo "type a space-delimited list of drivers"
  2228. echo -n " that you want to be in 'drivers-alternate': "
  2229. read NEWXORGBADDRVRS
  2230. [ "$NEWXORGBADDRVRS" = "" ] && NEWXORGBADDRVRS="$XORGBADDRIVERS"
  2231. for ONEBADX in $NEWXORGBADDRVRS
  2232. do
  2233. #some builds have i810_drv.so symlink to intel_drv.so...
  2234. if [ -h rootfs-complete/usr/lib/xorg/modules/drivers/${ONEBADX}_drv.so ];then
  2235. continue
  2236. fi
  2237. [ -f rootfs-complete/usr/lib/xorg/modules/drivers/${ONEBADX}_drv.so ] && mv -f rootfs-complete/usr/lib/xorg/modules/drivers/${ONEBADX}_drv.so rootfs-complete/usr/lib/x/drivers-alternate/
  2238. done
  2239. for ONECHK in `ls -1 rootfs-complete/usr/lib/x/drivers-alternate | grep '_drv' | cut -f 1 -d '_' | tr '\n' ' '` #110911
  2240. do
  2241. oPTN=" ${ONECHK} "
  2242. if [ "`echo -n " ${NEWXORGBADDRVRS} " | grep "$oPTN"`" = "" ];then
  2243. if [ ! -d $ONECHK ];then
  2244. mv -f rootfs-complete/usr/lib/x/drivers-alternate/${ONECHK}_drv.so rootfs-complete/usr/lib/xorg/modules/drivers/
  2245. else
  2246. echo "SORRY: cannot move '${ONECHK}_drv.so' from drivers-alternate back to"
  2247. echo "main drivers, it must stay as an alternate driver only."
  2248. fi
  2249. fi
  2250. done
  2251. fi
  2252. #101012 if 'depmod-FULL' exists, rename it to 'depmod'... 101024
  2253. if [ "$USINGKMOD" = "no" ];then #130418
  2254. if [ ! -h rootfs-complete/sbin/depmod-FULL ];then #if hyperlink then assume to depmod.
  2255. if [ -f rootfs-complete/sbin/depmod-FULL ];then
  2256. mv -f rootfs-complete/sbin/depmod rootfs-complete/sbin/depmod-BB-NOTUSED
  2257. mv -f rootfs-complete/sbin/depmod-FULL rootfs-complete/sbin/depmod
  2258. fi
  2259. ln -s depmod rootfs-complete/sbin/depmod-FULL
  2260. fi
  2261. else
  2262. [ -e rootfs-complete/bin/kmod ] && ln -snf ../bin/kmod rootfs-complete/sbin/depmod #130430 path fix.
  2263. fi
  2264. #101015 make sure our modified 'alsaconf' is used (just in case got overwritten)...
  2265. cp -a -f ../rootfs-skeleton/usr/sbin/alsaconf rootfs-complete/usr/sbin/
  2266. #w481 extra stripping...
  2267. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #120502 strip will not work for cross-build.
  2268. echo
  2269. echo "Would you like to strip all binary executables and shared library files?"
  2270. echo "These are usually already stripped, although some packages may have the shared"
  2271. echo "library files stripped with the '--strip-debug' option only, and extra stripping"
  2272. echo "should be okay. It won't do any harm answering yes here."
  2273. if [ "`which strip`" = "" ];then
  2274. echo
  2275. echo "OH, NO GOOD, you don't have the 'strip' executable. The 'devx' sfs has it."
  2276. echo "PLEASE DECLINE THIS OFFER..."
  2277. echo
  2278. fi
  2279. echo -n "ENTER only to strip, any other printable char to decline: "
  2280. read NOSTRIP
  2281. if [ "$NOSTRIP" = "" ];then
  2282. find rootfs-complete/bin rootfs-complete/sbin rootfs-complete/usr/bin rootfs-complete/sbin -type f |
  2283. while read ONEFILE
  2284. do
  2285. ONEBASE="`basename "$ONEFILE"`"
  2286. # if [ "`file "$ONEFILE" | grep 'ELF' | grep 'executable' | grep 'dynamically linked'`" != "" ];then #v424 fix.
  2287. [ "$ONEBASE" = "e3" ] && continue #v431 cannot be stripped.
  2288. [ "$ONEBASE" = "QtWeb" ] && continue #130721 cannot be stripped.
  2289. if [ "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" != "" ];then #v431
  2290. echo -n "$ONEBASE "
  2291. strip --strip-unneeded "$ONEFILE"
  2292. fi
  2293. done
  2294. echo
  2295. find rootfs-complete/usr/lib rootfs-complete/usr/X11R7/lib -type f -name \*.so* |
  2296. while read ONEFILE
  2297. do
  2298. ONEBASE="`basename "$ONEFILE"`"
  2299. #v431 libgdk-x11-2.0.so* compiled in pup4 with '--enable-debug', fixes insert-key mozilla crash.
  2300. # it may be unwise to strip its debug symbols... no, it's ok...
  2301. #[ "`echo "$ONEBASE" | grep 'libgdk'`" != "" ] && continue #v431
  2302. if [ "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" != "" ];then
  2303. echo -n "$ONEBASE "
  2304. strip --strip-unneeded "$ONEFILE"
  2305. fi
  2306. done
  2307. echo
  2308. fi
  2309. fi
  2310. #100527 build a .pet with lists of all builtin files...
  2311. echo
  2312. echo "Now building sandbox3/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.pet,"
  2313. echo "which is a PET package with lists of all packages and files builtin to the SFS..."
  2314. rm -rf 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION} 2>/dev/null
  2315. mkdir 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  2316. mkdir /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  2317. for ONEGENDIR in `find ../packages-${DISTRO_FILE_PREFIX} -maxdepth 1 -type d | tr '\n' ' '`
  2318. do
  2319. ONEGENNAME="`basename $ONEGENDIR`"
  2320. # [ "`echo "$ONEGENNAME" | grep -E '_DEV|_DOC|_NLS|_NULL'`" != "" ] && continue #not really needed.
  2321. ogPATTERN="|${ONEGENNAME}|"
  2322. [ "`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep "$ogPATTERN"`" == "" ] && continue
  2323. echo -n "$ONEGENNAME "
  2324. ogPATTERN="s%^\\.\\./packages-${DISTRO_FILE_PREFIX}/${ONEGENNAME}/%/%"
  2325. find $ONEGENDIR | sed -e "$ogPATTERN" | sort > /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${ONEGENNAME}.files
  2326. sync
  2327. #store the information more efficiently...
  2328. mkdir -p 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files
  2329. PREVPATH=''; PREVPATH0=''
  2330. cat /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${ONEGENNAME}.files |
  2331. while read ONELINE
  2332. do
  2333. [ "`echo "$ONELINE" | cut -c 1`" == "." ] && continue #catch ex: ../packages-qrky/abiword
  2334. if [ -d "rootfs-complete${ONELINE}" ];then
  2335. #120925 ignore debian/ubuntu multiarch circular symlink (these are create by 2createpackages)...
  2336. if [ -h "rootfs-complete${ONELINE}" ];then
  2337. if [ "$(readlink "rootfs-complete${ONELINE}")" = "./" ];then
  2338. PREVPATH0="$(dirname "$ONELINE")" #121010 fix, missing some files.
  2339. [ "$PREVPATH0" != "$PREVPATH" ] && echo "$PREVPATH0" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME} #121010
  2340. continue
  2341. fi
  2342. fi
  2343. PREVPATH="$ONELINE"
  2344. echo "$ONELINE" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME}
  2345. else
  2346. NEWPATH="`dirname "$ONELINE"`"
  2347. [ "$NEWPATH" == "/" ] && continue #ignore top-level files.
  2348. NEWFILE="`basename "$ONELINE"`"
  2349. if [ -e "rootfs-complete${ONELINE}" ];then #sanity check.
  2350. if [ "$PREVPATH" == "$NEWPATH" -o "$PREVPATH0" == "$NEWPATH" ];then #sanity check. 121010
  2351. echo " ${NEWFILE}" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME}
  2352. fi
  2353. fi
  2354. fi
  2355. done
  2356. done
  2357. echo "0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}|0builtin_files_${DISTRO_FILE_PREFIX}|${DISTRO_VERSION}||BuildingBlock|||0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.pet||Lists of files built-in to the SFS file||||
  2358. " > 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/pet.specs
  2359. rm -f 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.pet 2>/dev/null
  2360. dir2tgz 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  2361. tgz2pet 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.tar.gz
  2362. rm -rf /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  2363. echo
  2364. echo "installing pkg lists into rootfs-complete/root/.packages/builtin_files..."
  2365. cp -a -f 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files rootfs-complete/root/.packages/builtin_files
  2366. echo '...done'
  2367. #100613 create font cache for fontconfig (in /var/cache/fontconfig)...
  2368. echo
  2369. echo "Creating Fontconfig cache files..."
  2370. rm -rf rootfs-complete/var/cache/fontconfig
  2371. mkdir -p rootfs-complete/var/cache/fontconfig
  2372. #111123 ***NOTICE*** cross-build, this will have to be executed at first boot...
  2373. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  2374. chroot rootfs-complete /usr/bin/fc-cache -s -v
  2375. fi
  2376. if [ ! -e rootfs-complete/usr/bin/pango-querymodules ];then #110517 debian squeeze hack
  2377. #cp -f devx/usr/bin/pango-querymodules rootfs-complete/usr/bin/
  2378. cp -f ../packages-${DISTRO_FILE_PREFIX}/pango_DEV/usr/bin/pango-querymodules rootfs-complete/usr/bin/
  2379. fi
  2380. #100622 slackware 13.1: this file is zero bytes...
  2381. #111123 ***NOTICE*** cross-build, this will have to be executed at first boot...
  2382. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  2383. PANGOMODULES="`find rootfs-complete/etc/pango -type f -name pango.modules | sed -e 's%rootfs-complete%%'`"
  2384. [ "$PANGOMODULES" = "" ] && PANGOMODULES='/etc/pango/pango.modules'
  2385. if [ ! -s rootfs-complete${PANGOMODULES} ];then
  2386. echo "/usr/bin/pango-querymodules > ${PANGOMODULES}" > rootfs-complete/zz
  2387. chroot rootfs-complete /bin/ash zz
  2388. rm -f rootfs-complete/zz
  2389. fi
  2390. fi
  2391. #110622 hack for mageia 1 (otherwise can't find pango.modules)...
  2392. if [ -d rootfs-complete/etc/pango/i386 ];then
  2393. cp -a -f rootfs-complete/etc/pango/pango.modules rootfs-complete/etc/pango/i386/
  2394. [ -f rootfs-complete/etc/pango/pangox.aliases ] && cp -a -f rootfs-complete/etc/pango/pangox.aliases rootfs-complete/etc/pango/i386/
  2395. fi
  2396. #110622 /etc/rc.d/rc.update executes: gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
  2397. #however, mageia1 requires above file to be at /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
  2398. #create a symlink...
  2399. VERDIR=''
  2400. if [ -d rootfs-complete/usr/lib/gdk-pixbuf-2.0 ];then
  2401. [ ! -f rootfs-complete/etc/gtk-2.0/gdk-pixbuf.loaders ] && touch rootfs-complete/etc/gtk-2.0/gdk-pixbuf.loaders
  2402. PIXBUFLOADERSDIR="`find rootfs-complete/usr/lib/gdk-pixbuf-2.0 -maxdepth 2 -mindepth 2 -type d -name loaders | head -n 1`"
  2403. if [ "$PIXBUFLOADERSDIR" ];then
  2404. PIXBUFCACHEDIR="`dirname $PIXBUFLOADERSDIR`"
  2405. VERDIR="`basename $PIXBUFCACHEDIR`" #2.10.0
  2406. ln -snf ../../../../etc/gtk-2.0/gdk-pixbuf.loaders ${PIXBUFCACHEDIR}/loaders.cache #110903 change -s to -snf
  2407. #there may be some loaders in wrong place...
  2408. [ -d rootfs-complete/usr/lib/gtk-2.0/loaders ] && mv -f rootfs-complete/usr/lib/gtk-2.0/loaders/*.so ${PIXBUFLOADERSDIR}/ 2>/dev/null
  2409. if [ -d rootfs-complete/usr/lib/gtk-2.0/${VERDIR}/loaders ];then
  2410. mv -f rootfs-complete/usr/lib/gtk-2.0/${VERDIR}/loaders/*.so ${PIXBUFLOADERSDIR}/ 2>/dev/null
  2411. rmdir rootfs-complete/usr/lib/gtk-2.0/${VERDIR}/loaders #111114
  2412. ln -s ../../gdk-pixbuf-2.0/${VERDIR}/loaders rootfs-complete/usr/lib/gtk-2.0/${VERDIR}/loaders #111114
  2413. else #111117
  2414. ln -s ../../gdk-pixbuf-2.0/${VERDIR}/loaders rootfs-complete/usr/lib/gtk-2.0/${VERDIR}/loaders
  2415. fi
  2416. fi
  2417. fi
  2418. #120605 shinobar ref: http://murga-linux.com/puppy/viewtopic.php?t=76961&start=195
  2419. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
  2420. chroot rootfs-complete /usr/bin/gtk-query-immodules-2.0 > rootfs-complete/etc/gtk-2.0/gtk.immodules
  2421. else
  2422. touch rootfs-complete/etc/gtk-2.0/gtk.immodules
  2423. fi
  2424. [ "$VERDIR" ] && ln -snf ../../../../etc/gtk-2.0/gtk.immodules rootfs-complete/usr/lib/gtk-2.0/${VERDIR}/gtk.immodules
  2425. #100627 recent versions of xorg server, turn modesetting on... 110822 improve...
  2426. mkdir -p rootfs-complete/etc/modprobe.d
  2427. #110621 need to chroot...
  2428. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  2429. XORGINFO="`chroot rootfs-complete /usr/bin/Xorg -version 2>&1`"
  2430. XORGVER="`echo "$XORGINFO" | grep '^X\.Org' | rev | cut -f 1 -d ' ' | rev`"
  2431. else
  2432. #cross-build, assume recent xorg...
  2433. XORGVER='1.7.7'
  2434. fi
  2435. [ "$XORGVER" = "" ] && XORGVER="`echo "$XORGINFO" | grep '^X Window System Version' | rev | cut -f 1 -d ' ' | rev`" #xorg 7.3
  2436. [ "$XORGVER" = "" ] && XORGVER="1.3.0" #precaution. version used in original Xorg 7.3.
  2437. if vercmp "$XORGVER" gt "1.7.6";then
  2438. #120616 no, don't do this...
  2439. ##120516 check that these drivers exist...
  2440. #EXTRADRVPTH=''
  2441. #[ -d rootfs-complete/usr/X11R7/lib/dri ] && EXTRADRVPTH='rootfs-complete/usr/X11R7/lib/dri'
  2442. #[ -d rootfs-complete/usr/lib/dri ] && EXTRADRVPTH="${EXTRADRVPTH} rootfs-complete/usr/lib/dri"
  2443. #[ ! "$EXTRADRVPTH" ] && EXTRADRVPTH='/usr/lib'
  2444. #DRILIST=''
  2445. #for AXDRI in i915_dri.so radeon_dri.so nouveau_dri.so
  2446. #do
  2447. # if find ${EXTRADRVPTH} -mindepth 1 -maxdepth 1 -name ${AXDRI}; then
  2448. # ADRI="`echo -n "$AXDRI" | cut -f 1 -d '_'`"
  2449. # DRILIST="${DRILIST}${ADRI} "
  2450. # fi
  2451. #done
  2452. #120616 do this...
  2453. DRILIST='i915 radeon nouveau'
  2454. [ "$SDFLAG" ] && DRILIST='' #assume not using kms at all when boot from sd card (arm arch).
  2455. if [ "$DRILIST" != "" ];then
  2456. echo
  2457. echo "Certain Xorg drivers require KMS (Kernel ModeSetting)"
  2458. echo "A value of '1' means on, '0' means off."
  2459. echo "Press ENTER key only to accept the default, any other char to flip:"
  2460. for XDRIVER in $DRILIST #i915 radeon nouveau
  2461. do
  2462. KMSFLG='1'
  2463. #[ "$XDRIVER" = "radeon" ] && [ "$DISTRO_BINARY_COMPAT" = "slackware" ] && KMSFLG='0' #01micko.
  2464. #[ "$XDRIVER" = "radeon" ] && KMSFLG='0' #110918 seems need this off. 120526 try default on. 120605 turn off. 120903 on again.
  2465. echo -n "${XDRIVER} [${KMSFLG}]: "
  2466. read KMSREPLY
  2467. if [ "$KMSREPLY" ];then #110906 fix syntax error.
  2468. #not the default...
  2469. case $KMSFLG in
  2470. 0) echo "options ${XDRIVER} modeset=1" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf ;;
  2471. 1) echo "options ${XDRIVER} modeset=0" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf ;;
  2472. esac
  2473. else
  2474. echo "options ${XDRIVER} modeset=${KMSFLG}" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf
  2475. fi
  2476. done
  2477. fi
  2478. fi
  2479. #110213 fix if .utf8 entries missing...
  2480. if [ "`grep 'nb_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  2481. echo 'nb_NO.utf8: nb_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  2482. fi
  2483. if [ "`grep 'nn_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  2484. echo 'nn_NO.utf8: nn_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  2485. fi
  2486. if [ "`grep 'ru_UA\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  2487. echo 'ru_UA.utf8: ru_UA.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  2488. fi
  2489. if [ "`grep 'ru_RU\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  2490. echo 'ru_RU.utf8: ru_RU.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  2491. fi
  2492. #110329 some python files, move to 'devx'...
  2493. #121022 but only if python is supposed to be in devx...
  2494. if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" != "" ];then
  2495. PYTHONDIR=''
  2496. [ -d rootfs-complete/usr/lib/python2.5 ] && PYTHONDIR='python2.5'
  2497. [ -d rootfs-complete/usr/lib/python2.6 ] && PYTHONDIR='python2.6'
  2498. [ -d rootfs-complete/usr/lib/python2.7 ] && PYTHONDIR='python2.7'
  2499. if [ "$PYTHONDIR" ];then
  2500. mkdir -p devx/usr/lib/${PYTHONDIR}
  2501. cp -a -f --remove-destination rootfs-complete/usr/lib/${PYTHONDIR}/* devx/usr/lib/${PYTHONDIR}/
  2502. rm -rf rootfs-complete/usr/lib/${PYTHONDIR}
  2503. fi
  2504. fi
  2505. #110412 move all .bac, .pot and .pupdev files to 'devx'...
  2506. find rootfs-complete/usr -type f -name '*.pot' -o -name '*.pupdev' -o -name '*.bac' |
  2507. while read ONEPD
  2508. do
  2509. DESTDIR="`dirname "$ONEPD" | sed -e 's%rootfs\-complete%%'`"
  2510. mkdir -p "devx${DESTDIR}"
  2511. mv -f "$ONEPD" "devx${DESTDIR}/"
  2512. done
  2513. #120224 move rootfs-complete/usr/share/doc/nls to 'devx'...
  2514. mkdir -p devx/usr/share/doc/nls
  2515. cp -a -f rootfs-complete/usr/share/doc/nls/* devx/usr/share/doc/nls/
  2516. rm -r -f rootfs-complete/usr/share/doc/nls
  2517. #110417 this may be helpful for more apps than Thunar...
  2518. #this will make Thunar use ROX-Filer's icons for files...
  2519. if [ -d rootfs-complete/usr/local/apps/ROX-Filer/ROX/MIME ];then
  2520. if [ ! -e rootfs-complete/usr/share/icons/hicolor/48x48/mimetypes ];then
  2521. ln -s ../../../../local/apps/ROX-Filer/ROX/MIME rootfs-complete/usr/share/icons/hicolor/48x48/mimetypes
  2522. fi
  2523. fi
  2524. #110421 get version compare utility...
  2525. cp -f ../boot/initrd-tree0/bin/vercmp rootfs-complete/bin/
  2526. #110429 fix just in case...
  2527. busybox chown -h -R spot:spot rootfs-complete/root/spot
  2528. #110429 this is difficult. may need a fix, think want glibc scsi headers in usr/include/scsi...
  2529. mkdir -p devx/usr/include
  2530. if [ -d ../packages-${DISTRO_FILE_PREFIX}/linux_headers_DEV/usr/include/scsi ];then
  2531. cp -a ../packages-${DISTRO_FILE_PREFIX}/linux_headers_DEV/usr/include/scsi devx/usr/include/scsi-KERNEL
  2532. fi
  2533. if [ -d ../packages-${DISTRO_FILE_PREFIX}/linux-header_DEV/usr/include/scsi ];then
  2534. cp -a ../packages-${DISTRO_FILE_PREFIX}/linux-header_DEV/usr/include/scsi devx/usr/include/scsi-KERNEL
  2535. fi
  2536. if [ -d ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/usr/include/scsi ];then
  2537. cp -a ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/usr/include/scsi devx/usr/include/scsi-GLIBC
  2538. fi
  2539. #also see further down, when building devx.
  2540. ##110517 kms may need to be turned on... ALREADY DONE, SEE 110621 ABOVE
  2541. #XINTELMINOR=`grep '^xserver-xorg-video-intel' rootfs-complete/root/.packages/woof-installed-packages | cut -f 3 -d '|' | cut -f 2 -d '.'` #110517 ex: xserver-xorg-video-intel_2.13.0-6_i386.deb extract 13.
  2542. #[ ! $XINTELMINOR ] && XINTELMINOR=`grep '^xf86-video-intel' rootfs-complete/root/.packages/woof-installed-packages | cut -f 3 -d '|' | cut -f 2 -d '.'`
  2543. #[ ! $XINTELMINOR ] && XINTELMINOR=0
  2544. #if [ $XINTELMINOR -gt 9 ];then
  2545. # echo 'options i915 modeset=1' > rootfs-complete/etc/modprobe.d/i915.conf
  2546. # [ "`grep '^xserver-xorg-video-nouveau' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options nouveau modeset=1' > rootfs-complete/etc/modprobe.d/nvidia.conf
  2547. # [ "`grep '^xf86-video-nouveau' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options nouveau modeset=1' > rootfs-complete/etc/modprobe.d/nvidia.conf
  2548. # [ "`grep '^xserver-xorg-video-radeon' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options radeon modeset=1' > rootfs-complete/etc/modprobe.d/radeon.conf
  2549. # [ "`grep '^xf86-video-radeon' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options radeon modeset=1' > rootfs-complete/etc/modprobe.d/radeon.conf
  2550. #fi
  2551. #110523 override files from rootfs-skeleton/root/Choices/MIME-types, if rox pkg has older files...
  2552. cp -a -f ../rootfs-skeleton/root/Choices/MIME-types/* rootfs-complete/root/Choices/MIME-types/
  2553. #110620 do same for mime icons...
  2554. cp -a -f --remove-destination ../rootfs-skeleton/usr/local/apps/ROX-Filer/ROX/MIME/* rootfs-complete/usr/local/apps/ROX-Filer/ROX/MIME/
  2555. #130320 these days, i think give util-linux the preference. note, should really fix in e2fsprogs template.
  2556. ##110701 possible lib clash between e2fsprogs and util-linux (i might use old util-linux pet). hack...
  2557. #if [ -e ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs/lib/libblkid.so.1 ];then
  2558. # if [ -e ../packages-${DISTRO_FILE_PREFIX}/util-linux/lib/libblkid.so.1 ];then
  2559. # #give e2fsprogs libs preference...
  2560. # cp -a -f --remove-destination ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs/lib/libblkid.so* rootfs-complete/lib/
  2561. # cp -a -f --remove-destination ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs/lib/libuuid.so* rootfs-complete/lib/
  2562. # rm -f ../packages-${DISTRO_FILE_PREFIX}/util-linux_DEV/lib/lib*
  2563. # fi
  2564. #fi
  2565. #130320 i don't think any of this is required, as util-linux is later in the pkg-list so will override anyway.
  2566. # so, comment this out also!...
  2567. #if [ -e ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs/lib/libblkid.so.1 ];then
  2568. # if [ -e ../packages-${DISTRO_FILE_PREFIX}/util-linux/lib/libblkid.so.1 ];then
  2569. # #give util-linux libs preference...
  2570. # cp -a -f --remove-destination ../packages-${DISTRO_FILE_PREFIX}/util-linux/lib/libblkid.so* rootfs-complete/lib/
  2571. # cp -a -f --remove-destination ../packages-${DISTRO_FILE_PREFIX}/util-linux/lib/libuuid.so* rootfs-complete/lib/
  2572. # cp -a -f --remove-destination ../packages-${DISTRO_FILE_PREFIX}/util-linux/usr/lib/libblkid.so* rootfs-complete/lib/ 2>/dev/null
  2573. # cp -a -f --remove-destination ../packages-${DISTRO_FILE_PREFIX}/util-linux/usr/lib/libuuid.so* rootfs-complete/lib/ 2>/dev/null
  2574. # #so that the 'devx' will build ok...
  2575. # rm -f ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs_DEV/lib/libblkid.so* 2>/dev/null
  2576. # rm -f ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs_DEV/lib/libuuid.so* 2>/dev/null
  2577. # rm -f ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs_DEV/usr/lib/libblkid.so* 2>/dev/null
  2578. # rm -f ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs_DEV/usr/lib/libuuid.so* 2>/dev/null
  2579. # rm -f ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs_DEV/usr/lib/pkgconfig/blkid.pc
  2580. # rm -f ../packages-${DISTRO_FILE_PREFIX}/e2fsprogs_DEV/usr/lib/pkgconfig/uuid.pc
  2581. # fi
  2582. #fi
  2583. #130111 fixed in 2createpackages...
  2584. ##110726 mageia does something weird, puts all these in wrong place (see also devx further down)...
  2585. #if [ -d rootfs-complete/usr/bin/multiarch-i386-linux ];then
  2586. # cp -a -f --remove-destination rootfs-complete/usr/bin/multiarch-i386-linux/* devx/usr/bin/
  2587. # rm -rf rootfs-complete/usr/bin/multiarch-i386-linux
  2588. #fi
  2589. #110806 if yad installed, no zenity, make sure zenity is symlink to yad...
  2590. YAD="`find ./rootfs-complete/bin ./rootfs-complete/sbin ./rootfs-complete/usr/bin ./rootfs-complete/usr/sbin ./rootfs-complete/usr/local/bin -type f -name yad`"
  2591. if [ "$YAD" ];then
  2592. ZENITY="`find ./rootfs-complete/bin ./rootfs-complete/sbin ./rootfs-complete/usr/bin ./rootfs-complete/usr/sbin ./rootfs-complete/usr/local/bin -name zenity`"
  2593. if [ ! "$ZENITY" ];then
  2594. YADDIR="`dirname $YAD`"
  2595. ln -s yad ${YADDIR}/zenity
  2596. fi
  2597. fi
  2598. #110904 no, now done in pet pkg 'zz_wary52_fixup'...
  2599. ##110901 i have experimented with building a wary "5.2pre" without libxcb.
  2600. ##however, many existing apps want it, even though don't use it.
  2601. ##this is a trick that satisfies them...
  2602. #if [ "`grep '^libxcb' rootfs-complete/root/.packages/woof-installed-packages`" = "" ];then
  2603. # if [ -e rootfs-complete/usr/X11R7/lib/libX11.so.6 ];then
  2604. # ln -s libX11.so.6 rootfs-complete/usr/X11R7/lib/libxcb-xlib.so.0
  2605. # ln -s libX11.so.6 rootfs-complete/usr/X11R7/lib/libxcb.so.1
  2606. # fi
  2607. #fi
  2608. #110901 temp hack, if only have gtkdialog4 pkg...
  2609. if [ ! -e rootfs-complete/usr/sbin/gtkdialog3 ];then
  2610. if [ ! -e rootfs-complete/usr/bin/gtkdialog3 ];then
  2611. [ -e rootfs-complete/usr/sbin/gtkdialog4 ] && ln -s gtkdialog4 rootfs-complete/usr/sbin/gtkdialog3
  2612. [ -e rootfs-complete/usr/bin/gtkdialog4 ] && ln -s gtkdialog4 rootfs-complete/usr/bin/gtkdialog3
  2613. fi
  2614. fi
  2615. #110910 make sure gtkdialog links to latest...
  2616. if [ ! -e rootfs-complete/usr/sbin/gtkdialog ];then
  2617. [ -e rootfs-complete/usr/sbin/gtkdialog3 ] && ln -s gtkdialog3 rootfs-complete/usr/sbin/gtkdialog
  2618. [ -e rootfs-complete/usr/sbin/gtkdialog4 ] && ln -snf gtkdialog4 rootfs-complete/usr/sbin/gtkdialog
  2619. fi
  2620. #110822 some customisations provided by 01micko for Slacko...
  2621. #if [ "$DISTRO_BINARY_COMPAT" = "slackware" ];then
  2622. if [ "$DISTRO_FILE_PREFIX" = "slacko" ];then #130321
  2623. if [ -f ../support/slacko/woof_base_hack ];then
  2624. echo "Running Slacko customization script ../support/slacko/woof_base_hack..."
  2625. ../support/slacko/woof_base_hack
  2626. fi
  2627. fi
  2628. #111123 put this into target, want to know if cross-build at 1st boot (see rc.update)...
  2629. [ -f ../WOOFMERGEVARS ] && cp -f ../WOOFMERGEVARS rootfs-complete/etc/rc.d/
  2630. #120522 precise puppy, seamonkey was crashing. needed /usr/share/glib-2.0/schemas/apps.gecko-mediaplayer.preferences,
  2631. # but also needs this compile operation...
  2632. # ***NOTICE*** cross-build, this will have to be executed at first boot...
  2633. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
  2634. if [ -d rootfs-complete/usr/share/glib-2.0/schemas ];then
  2635. [ -e rootfs-complete/usr/bin/glib-compile-schemas ] && chroot rootfs-complete /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
  2636. fi
  2637. #120523 seems need this too...
  2638. if [ -d rootfs-complete/usr/lib/gio/modules ];then
  2639. [ -e rootfs-complete/usr/bin/gio-querymodules ] && chroot rootfs-complete /usr/bin/gio-querymodules /usr/lib/gio/modules
  2640. fi
  2641. fi
  2642. #120618 raspi debian squeeze, links as main browser, helpsurfer html viewer, gtkmoz missing...
  2643. #120620 problem, helpsurfer cannot display /usr/share/doc/index.html, so do not point gtkmoz at basichtmlviewer...
  2644. if [ ! -e rootfs-complete/usr/local/bin/gtkmoz ];then
  2645. ln -s defaultbrowser rootfs-complete/usr/local/bin/gtkmoz
  2646. fi
  2647. #120704 some constraints in a small system...
  2648. if [ "$SDFLAG" != "" ];then
  2649. #ask if want to load swap partition/file...
  2650. echo
  2651. echo "Puppy will normally load a swap partition or swap file if it/they exist,
  2652. however you can choose to ignore them and not load them at bootup."
  2653. echo -n "Press ENTER key to load swap at bootup, any key otherwise: "
  2654. read wantswap
  2655. if [ "$wantswap" != "" ];then
  2656. echo "BOOT_DISABLESWAP='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #read by /etc/rc.d/rc.sysinit
  2657. echo "...BOOT_DISABLESWAP='yes' in /etc/rc.d/BOOTCONSTRAINED, read by rc.sysinit."
  2658. fi
  2659. #this also reduces writes to flash card... um, relatime seems to be the default anyway... 120707 change to noatime...
  2660. echo "BOOT_ATIME='noatime'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #rc.sysinit will remount / with 'relatime' (constrains updating access time). 120707 change to noatime.
  2661. #this file in rootfs-skeleton, overwrite...
  2662. echo 'none /proc proc defaults,noatime 0 0
  2663. none /sys sysfs defaults,noatime 0 0
  2664. none /dev/pts devpts gid=2,mode=620,noatime 0 0
  2665. shmfs /dev/shm tmpfs defaults,noatime 0 0' > rootfs-complete/etc/fstab
  2666. echo "BOOT_DIRTYWRITE='1500'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #defer writing to disk. refer: http://www.lesswatts.org/tips/disks.php
  2667. echo "BOOT_SCHEDULER='deadline'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #my kernel defaults to 'cfq', change to 'deadline'. refer: http://tombuntu.com/index.php/2008/09/04/four-tweaks-for-using-linux-with-solid-state-drives/
  2668. #echo "BOOT_QUICKSETUP='quickarm'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120708 leaves out X config frame. 120714 removed.
  2669. echo "BOOT_UDEVDCHILDREN='1'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120709 is this a good idea? append --children-max=1 to udevd in rc.sysinit.
  2670. echo "BOOT_BOARD='${BOOT_BOARD}'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120714 read by quicksetup.
  2671. echo "BOOT_DISABLEXORGWIZARD='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120723 read in xwin, also xorgwizard. also see below.
  2672. echo "BOOT_DISABLEALSACONF='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120724 'alsaconf' does not work on arm boards.
  2673. fi
  2674. #120723 code moved down, add BOOT_DISABLEXORGWIZARD test...
  2675. #110413 variable DISTRO_XORG_AUTO in /etc/DISTRO_SPECS, see also /usr/bin/xwin
  2676. autoflag='no'
  2677. if [ "$BOOT_DISABLEXORGWIZARD" != "yes" ];then
  2678. if [ "$DISTRO_XORG_AUTO" ];then
  2679. autoflag="$DISTRO_XORG_AUTO"
  2680. else
  2681. if vercmp "$XORGVER" ge "1.7.0";then #110621
  2682. echo
  2683. echo "Do you want Xorg to start automatically at first boot (or at 'pfix=ram'"
  2684. echo "kernel boot param) or run Xorg Wizard? The latter has been the case for"
  2685. echo "earlier puppies. Automatic startup of X usually works, though in some"
  2686. echo "cases may choose the wrong monitor resolution or driver -- which can be"
  2687. echo "fixed by running Xorg Wizard afterward."
  2688. echo -n "Press ENTER only for automatic Xorg: "
  2689. read xorgauto
  2690. [ "$xorgauto" = "" ] && autoflag='yes'
  2691. fi
  2692. fi
  2693. fi
  2694. if [ "`grep '^DISTRO_XORG_AUTO' rootfs-complete/etc/DISTRO_SPECS`" = "" ];then #110621
  2695. echo "DISTRO_XORG_AUTO='${autoflag}'" >> rootfs-complete/etc/DISTRO_SPECS
  2696. else
  2697. REGEXauto="s%^DISTRO_XORG_AUTO.*%DISTRO_XORG_AUTO='${autoflag}'%"
  2698. sed -i -e "$REGEXauto" rootfs-complete/etc/DISTRO_SPECS
  2699. fi
  2700. #121123 want this info in ppm...
  2701. echo '#multiarch distros, such as Ubuntu, will have this. ex: /usr/lib/i386-linux-gnu, so DISTRO_ARCHDIR=i386-linux-gnu' >> rootfs-complete/etc/DISTRO_SPECS
  2702. echo "DISTRO_ARCHDIR='${ARCHDIR}'" >> rootfs-complete/etc/DISTRO_SPECS
  2703. echo "DISTRO_ARCHDIR='${ARCHDIR}'" >> initrd-tree/DISTRO_SPECS
  2704. #130114 revert...
  2705. ##130112 just in case 2createpackages did not set this variable...
  2706. #[ "$DISTRO_ARCHDIR_SYMLINKS" = "" ] && echo "DISTRO_ARCHDIR_SYMLINKS='${xDISTRO_ARCHDIR_SYMLINKS}'" >> rootfs-complete/etc/DISTRO_SPECS
  2707. #[ "$DISTRO_ARCHDIR_SYMLINKS" = "" ] && echo "DISTRO_ARCHDIR_SYMLINKS='${xDISTRO_ARCHDIR_SYMLINKS}'" >> initrd-tree/DISTRO_SPECS
  2708. #120709 debian squeeze has /usr/share/misc/pci.ids, usb.ids, which confuses some apps, create symlinks...
  2709. if [ ! -e rootfs-complete/usr/share/pci.ids ];then
  2710. if [ -e rootfs-complete/usr/share/misc/pci.ids ];then
  2711. ln -s misc/pci.ids rootfs-complete/usr/share/pci.ids
  2712. fi
  2713. fi
  2714. if [ ! -e rootfs-complete/usr/share/usb.ids ];then
  2715. if [ -e rootfs-complete/usr/share/misc/usb.ids ];then
  2716. ln -s misc/usb.ids rootfs-complete/usr/share/usb.ids
  2717. fi
  2718. fi
  2719. #120830 my hunspell-en-us pet has pinstall.sh that creates symlinks of en_US.aff and en_US.dic
  2720. #from seamonkey and firefox. however, need to do this thoroughly...
  2721. #note: see also woof rootfs-skeleton/usr/share/doc/langpack-template (used by momanager).
  2722. if [ -d rootfs-complete/usr/share/hunspell ];then
  2723. for ONEHUN in `find rootfs-complete/usr/share/hunspell -mindepth 1 -maxdepth 1 -type f -name '*.dic' -o -name '*.aff' | tr '\n' ' '`
  2724. do
  2725. HUNBASE="`basename $ONEHUN`"
  2726. DICTDIRS="`find rootfs-complete/usr/lib -mindepth 2 -maxdepth 2 -type d -name dictionaries | tr '\n' ' '`"
  2727. for ONEDICTDIR in $DICTDIRS
  2728. do
  2729. [ ! -e ${ONEDICTDIR}/${HUNBASE} ] && ln -s ../../../share/hunspell/${HUNBASE} ${ONEDICTDIR}/${HUNBASE}
  2730. done
  2731. done
  2732. fi
  2733. #121022 may need this (see below similar code if python in devx)...
  2734. if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" = "" ];then
  2735. [ -e rootfs-complete/usr/bin/python2.5 ] && ln -s python2.5 rootfs-complete/usr/bin/python 2>/dev/null
  2736. [ -e rootfs-complete/usr/bin/python2.6 ] && ln -s python2.6 rootfs-complete/usr/bin/python 2>/dev/null
  2737. [ -e rootfs-complete/usr/bin/python2.7 ] && ln -s python2.7 rootfs-complete/usr/bin/python 2>/dev/null
  2738. fi
  2739. #121203 bacon hug gui apps need some .so libs, for example libgtk-x11-2.0.so,
  2740. #(refer /usr/sbin/welcome1stboot.bac), however these are only in the devx.
  2741. #so need to create them...
  2742. #note, i think this problem only in wary/racy, as gtk template creates these symlinks.
  2743. if [ ! -e rootfs-complete/usr/lib/libgtk-x11-2.0.so ];then
  2744. FNDGTKLIB="$(find rootfs-complete/usr/lib/ -mindepth 1 -maxdepth 1 -name 'libgtk-x11-2.0.so.[0-9]' | head -n 1 | rev | cut -f 1 -d '/' | rev)"
  2745. [ "$FNDGTKLIB" ] && ln -s $FNDGTKLIB rootfs-complete/usr/lib/libgtk-x11-2.0.so #2> /dev/null
  2746. fi
  2747. #i'll do the same for libgdk-x11-2.0.so ...
  2748. if [ ! -e rootfs-complete/usr/lib/libgdk-x11-2.0.so ];then
  2749. FNDGDKLIB="$(find rootfs-complete/usr/lib/ -mindepth 1 -maxdepth 1 -name 'libgdk-x11-2.0.so.[0-9]' | head -n 1 | rev | cut -f 1 -d '/' | rev)"
  2750. [ "$FNDGTKLIB" ] && ln -s $FNDGTKLIB rootfs-complete/usr/lib/libgdk-x11-2.0.so #2> /dev/null
  2751. fi
  2752. #121212 puinstall.sh was not getting removed...
  2753. [ -f rootfs-complete/puninstall.sh ] && rm -f rootfs-complete/puninstall.sh
  2754. #130326 now permanently 96... 130327 reintroduce a choice...
  2755. ##130129 /root/.Xresources has dpi set to 78 in all prior pups. In future, might prefer 96...
  2756. DPILINE="$(grep '^Xft\.dpi:' rootfs-complete/root/.Xresources)"
  2757. DPIVALUE=$(echo -n "$DPILINE" | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' ')
  2758. #if [ $DPIVALUE -lt 96 ];then
  2759. echo
  2760. echo "rootfs-complete/root/.Xresources has this line:"
  2761. echo "$DPILINE"
  2762. echo "which sets the displayed size of fonts on the screen (but not bitmap fonts)."
  2763. # echo "All puppies up until January 2013 have the value of '78', however, in future,
  2764. #especially with smaller high-resolution screens, a higher value (hence bigger
  2765. #font) would be better. We plan to standardise on the value of '96' for bigger
  2766. #font display. Just press ENTER only if you want to keep '${DPIVALUE}', or any printable
  2767. #character then ENTER for '96'.
  2768. #Choose '96' if you would like your pup to display with bigger fonts, even for
  2769. #large screens, or you are targeting running on a high-res small screen."
  2770. # echo -n "Press ENTER key for '${DPIVALUE}' dpi: "
  2771. # read dpisizeflag
  2772. # if [ "$dpisizeflag" ];then
  2773. # sed -i -e 's%^Xft\.dpi:.*%Xft.dpi: 96%' rootfs-complete/root/.Xresources
  2774. # fi
  2775. #fi
  2776. DPINEXT1=`expr $DPIVALUE + 6`
  2777. DPINEXT2=`expr $DPINEXT1 + 6`
  2778. echo "To accept this size, just press ENTER key."
  2779. echo "However, if you would like fonts to display bigger on the screen, type in
  2780. a value now. The value should be in steps of 6, for example ${DPINEXT1} or ${DPINEXT2}.
  2781. The default size is ${DPIVALUE}, you might try the next-up, ${DPINEXT1}."
  2782. echo -n "Press ENTER key for '${DPIVALUE}' dpi, or type a value: "
  2783. read dpisizeflag
  2784. if [ "$dpisizeflag" ];then #130512 scsijon: fix size...
  2785. fsPTN='s%^Xft\.dpi:.*%Xft.dpi: '"${dpisizeflag}%"
  2786. sed -i -e "$fsPTN" rootfs-complete/root/.Xresources
  2787. echo "...ok, now ${dpisizeflag}"
  2788. fi
  2789. #130226 wary: /usr/bin/X was missing...
  2790. if [ ! -e rootfs-complete/usr/bin/X ];then
  2791. if [ -e rootfs-complete/usr/bin/Xorg -o -h rootfs-complete/usr/bin/Xorg ];then
  2792. ln -s Xorg rootfs-complete/usr/bin/X
  2793. fi
  2794. fi
  2795. #130601 optional, run internet apps as user 'spot'...
  2796. echo
  2797. echo "Puppy is normally run as the 'administrator' (root) user, though there is
  2798. also 'fido' which is not currently very mature.
  2799. The structure of Puppy is such that we consider root to be safe (with a full
  2800. disclaimer of any responsibility if anything does go wrong), but there is a
  2801. compromise, to run as root but to run Internet apps as user 'spot'."
  2802. if [ -e rootfs-complete/usr/lib/seamonkey ];then
  2803. echo
  2804. echo "Type any character then ENTER if you want SeaMonkey to run as spot,
  2805. or just ENTER not to. Note, in a running 'Puppy Menu->System->Login & Security
  2806. Manager' can be used to enable or disable running as spot."
  2807. echo
  2808. echo -n "ENTER only to not run SeaMonkey as spot: "
  2809. read SPOTAPPS
  2810. if [ "$SPOTAPPS" ];then
  2811. ../support/setup-spot 'seamonkey=true' #130604
  2812. echo '...ok, SeaMonkey will run as spot.'
  2813. else
  2814. echo 'seamonkey=false' > rootfs-complete/root/.spot-status #130604 so that an unticked checkbox will display in loginmanager.
  2815. echo '...ok, SeaMonkey will not run as spot.'
  2816. fi
  2817. fi
  2818. #130720 add QtWeb... 130723 add opera... 130821 add firefox...
  2819. for AINTERNETAPP in QtWeb opera firefox
  2820. do
  2821. [ ! -e rootfs-complete/usr/bin/${AINTERNETAPP} ] && continue
  2822. echo
  2823. echo "Type any character then ENTER if you want ${AINTERNETAPP} to run as spot,
  2824. or just ENTER not to. Note, in a running Puppy 'Menu->System->Login & Security
  2825. Manager' can be used to enable or disable running as spot."
  2826. echo
  2827. echo -n "ENTER only to not run ${AINTERNETAPP} as spot: "
  2828. read SPOTAPPS
  2829. if [ "$SPOTAPPS" ];then
  2830. ../support/setup-spot "${AINTERNETAPP}=true"
  2831. echo "...ok, ${AINTERNETAPP} will run as spot."
  2832. else
  2833. echo "${AINTERNETAPP}=false" >> rootfs-complete/root/.spot-status #so that an unticked checkbox will display in loginmanager.
  2834. echo "...ok, ${AINTERNETAPP} will not run as spot."
  2835. fi
  2836. done
  2837. #setup-spot is also called by the Login & Security Manager in running Puppy...
  2838. cp -f ../support/setup-spot rootfs-complete/usr/sbin/
  2839. #130618 code above sets DEVTMPFSFLG...
  2840. #130612 if kernel has CONFIG_DEVTMPFS=y (and CONFIG_DEVTMPFS_MOUNT=y) then empty /dev...
  2841. if [ $DEVTMPFSFLG -ne 0 ];then
  2842. rm -rf rootfs-complete/dev/* #see also 'init' script in initrd.
  2843. sed -i -e 's%^DEVTMPFSFLG=.*%DEVTMPFSFLG=2%' rootfs-complete/etc/rc.d/rc.sysinit
  2844. fi
  2845. #130725 want Menu -> Help to use secondary browser... 130726 fix...
  2846. #code to detect dual browsers, taken out of /usr/sbin/delayedrun...
  2847. ALTBROWSER=''
  2848. #the pinstall.sh script in qtweb and opera pets create separate desktop icon if there is another major browser...
  2849. [ "`grep 'QtWeb' rootfs-complete/root/Choices/ROX-Filer/PuppyPin`" != "" ] && ALTBROWSER='QtWeb'
  2850. [ "`grep 'opera' rootfs-complete/root/Choices/ROX-Filer/PuppyPin`" != "" ] && ALTBROWSER='opera'
  2851. if [ "$ALTBROWSER" != "" ];then
  2852. MAINBROWSER="`grep '^exec' rootfs-complete/usr/local/bin/defaultbrowser | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' '`"
  2853. if [ "$MAINBROWSER" != "$ALTBROWSER" ];then
  2854. echo '#!/bin/sh' > rootfs-complete/usr/local/bin/defaulthtmlviewer
  2855. echo "exec ${ALTBROWSER} \"\$@\"" >> rootfs-complete/usr/local/bin/defaulthtmlviewer
  2856. chmod 755 rootfs-complete/usr/local/bin/defaulthtmlviewer
  2857. fi
  2858. fi
  2859. rm -rf rootfs-complete/tmp/* #121123 some above chroot operations may have left something behind in here.
  2860. ###########
  2861. #build the rootfs-complete sfs...
  2862. echo
  2863. echo "Now building the main f.s., ${PUPPYSFS}..."
  2864. sync
  2865. rm -f build/${PUPPYSFS} 2>/dev/null
  2866. ../support/${MKSQUASHFS} rootfs-complete build/${PUPPYSFS} ${COMPCHOICE} #100911 110713
  2867. sync
  2868. echo -n "$IDSTRING" >> build/${PUPPYSFS} #100911 16-byte id-string appended to file.
  2869. sync
  2870. ###########
  2871. #if separate 'zdrv' exists, copy that into live-cd also...
  2872. if [ -f ${ZDRVSFS} ];then #100911
  2873. echo -n "$IDSTRING" >> ${ZDRVSFS} #100911 16-byte id-string appended to file.
  2874. echo
  2875. echo "Press ENTER only to copy ${ZDRVSFS} into build/,"
  2876. echo -n "so that it becomes part of the live-CD. Any other char to leave it out: "
  2877. read insertzdrv
  2878. if [ "$insertzdrv" = "" ];then
  2879. echo "Copying ${ZDRVSFS} into build/" #100911
  2880. cp -a ${ZDRVSFS} build/ #100911
  2881. fi
  2882. sync
  2883. fi
  2884. ##create isolinux.cfg...
  2885. #echo "Creating build/isolinux.cfg..."
  2886. #echo "default puppy
  2887. #display boot.msg
  2888. #prompt 1
  2889. #label puppy
  2890. #kernel vmlinuz
  2891. #append initrd=initrd.gz pmedia=cd
  2892. #timeout 50" > build/isolinux.cfg
  2893. #build live-cd .iso file...
  2894. echo "Now building ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso"
  2895. rm -f ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso 2>/dev/null
  2896. if [ -f rootfs-complete/usr/lib/syslinux/isolinux.bin ];then
  2897. cp -a rootfs-complete/usr/lib/syslinux/isolinux.bin build/
  2898. else
  2899. cp -a ../boot/isolinux.bin build/
  2900. fi
  2901. case $DISTRO_FILE_PREFIX in #091203
  2902. wary) #101026
  2903. BOOTLOGO="puppy"
  2904. BOOTLABEL="puppy"
  2905. #REMOVELINE1='pfix=copy' #100916
  2906. REMOVELINE1=''
  2907. VERPREFIX="wary "
  2908. [ "`echo "$DISTRO_NAME" | grep "Racy"`" != "" ] && VERPREFIX="racy " #110917
  2909. ;;
  2910. racy) #110917
  2911. BOOTLOGO="racy-splash" #110928
  2912. BOOTLABEL="puppy"
  2913. REMOVELINE1=''
  2914. VERPREFIX="racy "
  2915. ;;
  2916. sqzd) #110517 squeeze debian
  2917. BOOTLOGO="puppy"
  2918. BOOTLABEL="puppy"
  2919. REMOVELINE1=''
  2920. VERPREFIX="squeezed "
  2921. ;;
  2922. drake|drak) #110721
  2923. BOOTLOGO="puppy"
  2924. BOOTLABEL="puppy"
  2925. REMOVELINE1=''
  2926. VERPREFIX="drake "
  2927. ;;
  2928. q*) #quirky, qurky, qrky
  2929. BOOTLOGO="quirky"
  2930. BOOTLABEL="puppy" #"quirky"
  2931. #REMOVELINE1='pfix=copy'
  2932. VERPREFIX="puppy " #100319
  2933. [ "$DISTRO_FILE_PREFIX" = "qret" ] && VERPREFIX="retro " #100514 quirky-retro.
  2934. ;;
  2935. *)
  2936. BOOTLOGO="puppy"
  2937. BOOTLABEL="puppy"
  2938. #REMOVELINE1='pfix=copy' #100916
  2939. VERPREFIX=""
  2940. ;;
  2941. esac
  2942. #111006 generic mechanism, boot logo for any pup...
  2943. [ -f ../boot/boot-dialog/${DISTRO_FILE_PREFIX}-splash.gif ] && BOOTLOGO="${DISTRO_FILE_PREFIX}-splash"
  2944. blPATTERN="s%BOOTLABEL%${BOOTLABEL}%"
  2945. namePATTERN="s/DISTRO_NAME/${DISTRO_NAME}/"
  2946. verPATTERN="s/DISTRO_VERSION/${DISTRO_VERSION}/"
  2947. prefixPATTERN="s/DISTRO_FILE_PREFIX/${DISTRO_FILE_PREFIX}/"
  2948. sed -e "$namePATTERN" -e "$verPATTERN" -e "$prefixPATTERN" -e "$blPATTERN" ../boot/boot-dialog/help.msg > build/help.msg
  2949. if [ "$REMOVELINE1" != "" ];then
  2950. grep -v "$REMOVELINE1" build/help.msg > /tmp/3builddistro-help.msg
  2951. mv -f /tmp/3builddistro-help.msg build/help.msg
  2952. fi
  2953. #100916 second help screen...
  2954. sed -e "$namePATTERN" -e "$verPATTERN" -e "$prefixPATTERN" -e "$blPATTERN" ../boot/boot-dialog/help2.msg > build/help2.msg
  2955. if [ "$REMOVELINE1" != "" ];then
  2956. grep -v "$REMOVELINE1" build/help2.msg > /tmp/3builddistro-help2.msg
  2957. mv -f /tmp/3builddistro-help2.msg build/help2.msg
  2958. fi
  2959. #130515 asked above whether to disable 'pupdesk.flg' mechanism...
  2960. if [ "$PUPDESKFLG" != "" ];then
  2961. sed -i -e 's%next bootup will force run of Video Wizard: choose alternate driver/settings%next startup type boot param "puppy pfix=nox" to enable run of Video Wizard%' build/help.msg
  2962. fi
  2963. cp -f ../boot/boot-dialog/boot.msg build/boot.msg
  2964. cat ../boot/boot-dialog/isolinux.cfg | sed -e "$blPATTERN" > build/isolinux.cfg
  2965. export RGBDEF=/usr/share/X11/rgb.txt
  2966. ../boot/boot-dialog/textongif.sh ../boot/boot-dialog/${BOOTLOGO}.gif "${VERPREFIX}${RIGHTVER}" > logo.gif
  2967. ../boot/boot-dialog/gif2lss logo.gif > build/logo.16
  2968. #120217 translate early-boot splash screens... (expect building with langpack)
  2969. if [ "$DEFAULTLANG" != "en_US" ];then
  2970. DEFAULTLANG1="${DEFAULTLANG%_*}" #ex: de
  2971. DEFAULTLANG12="${DEFAULTLANG%.*}" #ex: de_DE
  2972. SPLASHFILE=""
  2973. [ -f ../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG12} ] && SPLASHFILE="../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG12}"
  2974. [ ! "$SPLASHFILE" ] && [ -f ../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG1} ] && SPLASHFILE="../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG1}"
  2975. if [ "$SPLASHFILE" ];then
  2976. #translate boot.msg...
  2977. sPTN="/^\[boot.msg\]/,/^$/p" #this is a multi-line block find expression.
  2978. CODEBLOCK="`sed -n "$sPTN" ${SPLASHFILE} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`" #extracts just the relevant block of lines.
  2979. if [ "$CODEBLOCK" ];then
  2980. echo "$CODEBLOCK" > /tmp/3builddistro-boot-splash-translation
  2981. sed -i -f /tmp/3builddistro-boot-splash-translation build/boot.msg
  2982. fi
  2983. #translate help.msg...
  2984. sPTN="/^\[help.msg\]/,/^$/p" #this is a multi-line block find expression.
  2985. CODEBLOCK="`sed -n "$sPTN" ${SPLASHFILE} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`" #extracts just the relevant block of lines.
  2986. if [ "$CODEBLOCK" ];then
  2987. echo "$CODEBLOCK" > /tmp/3builddistro-boot-splash-translation
  2988. sed -i -f /tmp/3builddistro-boot-splash-translation build/help.msg
  2989. fi
  2990. fi
  2991. fi
  2992. #110426 help file for Windows users
  2993. CUT2INSERT="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1,2`"
  2994. CUT3INSERT="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1,2,3`"
  2995. cut2PATTERN="s%CUT2INSERT%${CUT2INSERT}%"
  2996. cut3PATTERN="s%CUT3INSERT%${CUT3INSERT}%"
  2997. sed -e "$verPATTERN" -e "$prefixPATTERN" -e "$cut2PATTERN" -e "$cut3PATTERN" ../boot/README.HTM > build/README.HTM
  2998. sync
  2999. if [ "$SDFLAG" = "" ];then #120506
  3000. $MKISOFS -D -R -o ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ./build/
  3001. sync
  3002. md5sum ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso > ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso.md5.txt
  3003. echo
  3004. echo "Would you like to burn it to a CD? "
  3005. echo -n "ENTER only for yes, or any printable char then ENTER not to: "
  3006. read writeitnow
  3007. if [ "$writeitnow" = "" ];then
  3008. CDR=""
  3009. [ -f /etc/cdburnerdevice ] && CDR="/dev/`cat /etc/cdburnerdevice`"
  3010. [ "$CDR" = "" ] && CDR='/dev/sr0'
  3011. CDDESCR="`probedisk2 | grep '|optical|' | grep "$CDR" | cut -f 3 -d '|'`"
  3012. echo -n 'Type "y" for multisession, else just ENTER: '
  3013. read BURNMULTI
  3014. if [ "$BURNMULTI" = "y" ];then
  3015. BURNMULTI="-multi -tao -pad"
  3016. else
  3017. BURNMULTI="-dao"
  3018. fi
  3019. echo "Please insert blank CD into $CDR
  3020. (which is described as: ${CDDESCR})
  3021. -- also be sure that it is unmounted."
  3022. echo -n "Then hit ENTER key: "
  3023. read yayburn
  3024. # $CDRECORD $BURNMULTI -data -eject -v speed=4 padsize=300k dev=ATAPI:$CDR ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso
  3025. $CDRECORD $BURNMULTI -data -eject -v speed=4 padsize=300k dev=$CDR ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso
  3026. sync
  3027. eject $CDR
  3028. echo "...done"
  3029. fi
  3030. else #120506 sd image
  3031. echo
  3032. echo "Please choose the SD-card skeleton image file, to suit target board."
  3033. CNT=1
  3034. echo -n "" > /tmp/3builddistro-probeimage
  3035. ls -1 ../sd-skeleton-images | grep 'xz$' | grep "$BOOT_BOARD" | #120714 BOOT_BOARD is raspi, mele, or odroidx.
  3036. while read ONEIMAGE
  3037. do
  3038. echo "${CNT} ${ONEIMAGE}" >> /tmp/3builddistro-probeimage
  3039. CNT=`expr $CNT + 1`
  3040. done
  3041. while [ 1 ];do
  3042. echo
  3043. echo "Type number which is your choice of SD image:"
  3044. cat /tmp/3builddistro-probeimage
  3045. read sdnumber
  3046. SDIMAGE="`cat /tmp/3builddistro-probeimage | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' '`"
  3047. echo -n "You chose '${SDIMAGE}' Press ENTER if correct: "
  3048. read sdcorrect
  3049. [ "$sdcorrect" = "" ] && break
  3050. done
  3051. echo
  3052. echo "Please insert the SD card. Make sure that it is the same size or bigger than
  3053. indicated on the filename of the skeleton image file that you chose."
  3054. echo -n "Press ENTER after it is inserted: "
  3055. read waitinsert
  3056. sleep 2
  3057. while [ 1 ];do
  3058. CNT=1
  3059. echo -n "" > /tmp/3builddistro-probedisk
  3060. probedisk |
  3061. while read ONEPROBE
  3062. do
  3063. echo "${CNT} ${ONEPROBE}" >> /tmp/3builddistro-probedisk
  3064. CNT=`expr $CNT + 1`
  3065. done
  3066. echo
  3067. echo "Type number which is your SD card:"
  3068. cat /tmp/3builddistro-probedisk
  3069. read sdnumber
  3070. SDDEVICE="`cat /tmp/3builddistro-probedisk | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '|'`"
  3071. echo -n "You chose ${SDDEVICE} Press ENTER if correct: "
  3072. read sdcorrect
  3073. [ "$sdcorrect" = "" ] && break
  3074. done
  3075. echo
  3076. echo "Sanity check: ../sd-skeleton-images/${SDIMAGE}
  3077. is to be written to ${SDDEVICE}."
  3078. echo -n "Press ENTER to continue: "
  3079. read yepgo
  3080. echo
  3081. #need to know uncompressed size of image...
  3082. echo "Uncompressing image, please wait..."
  3083. cp -f ../sd-skeleton-images/${SDIMAGE} ./${SDIMAGE}
  3084. sync
  3085. SDBASE="`basename $SDIMAGE .xz`"
  3086. [ -f ./${SDBASE} ] && rm -f ./${SDBASE}
  3087. unxz ${SDIMAGE}
  3088. if [ $? -ne 0 ];then
  3089. [ -f ./$SDIMAGE ] && rm -f ./$SDIMAGE
  3090. [ -f ./$SDBASE ] && rm -f ./$SDBASE
  3091. echo "Uncompress fail. Aborting."
  3092. exit 1
  3093. fi
  3094. sync
  3095. IMGBYTES=`stat --format=%s $SDBASE`
  3096. SDCARDINFO="`disktype ${SDDEVICE}`"
  3097. #120506b check that sd card big enough...
  3098. SDCARDBYTES=`echo "$SDCARDINFO" | grep '^Block device' | cut -f 2 -d '(' | cut -f 1 -d ' '` #ex: 4023386112
  3099. if [ $IMGBYTES -gt $SDCARDBYTES ];then
  3100. echo
  3101. echo "Sorry, the image file is ${IMGBYTES}bytes, however the
  3102. SD card is only ${SDCARDBYTES}bytes. Cannot continue."
  3103. exit 1
  3104. fi
  3105. #120703 allow 2nd partition to be ext2, ext3 or ext4...
  3106. SDIMGINFO="`disktype ${SDBASE}`"
  3107. SDFS2="`echo "$SDIMGINFO" | grep -o 'Ext[0-9] file system' | cut -f 1 -d ' ' | tr '[A-Z]' '[a-z]'`"
  3108. case $SDFS2 in
  3109. ext2|ext3|ext4) SDFS2="ext4" ;; #120706 hack for now. disktype misreports ext4 without journal as ext2.
  3110. *)
  3111. echo -n "wrong f.s. ${SDFS2} in ${SDBASE}, aborting. Press ENTER: "
  3112. read exitme
  3113. exit
  3114. ;;
  3115. esac
  3116. #130530 better to write everything to the image file first, then write to sd afterward...
  3117. #need to know the offsets of the filesystems...
  3118. P1BYTES=`echo "$SDIMGINFO" | grep '^Partition 1:' | cut -f 2 -d '(' | cut -f 1 -d ' '`
  3119. P1SECTORS=`echo "$SDIMGINFO" | grep '^Partition 1:' | cut -f 2 -d '(' | cut -f 3 -d ' '`
  3120. P1STARTSECTORS=`echo "$SDIMGINFO" | grep '^Partition 1:' | rev | cut -f 1 -d ' ' | rev | cut -f 1 -d ')'`
  3121. BYTESPERSECTOR=`expr $P1BYTES \/ $P1SECTORS` #normally 512.
  3122. P1STARTBYTES=`expr $P1STARTSECTORS \* $BYTESPERSECTOR`
  3123. P2BYTES=`echo "$SDIMGINFO" | grep '^Partition 2:' | cut -f 2 -d '(' | cut -f 1 -d ' '`
  3124. P2SECTORS=`echo "$SDIMGINFO" | grep '^Partition 2:' | cut -f 2 -d '(' | cut -f 3 -d ' '`
  3125. P2STARTSECTORS=`echo "$SDIMGINFO" | grep '^Partition 2:' | rev | cut -f 1 -d ' ' | rev | cut -f 1 -d ')'`
  3126. P2STARTBYTES=`expr $P1STARTSECTORS \* $BYTESPERSECTOR`
  3127. echo
  3128. echo "Copying Linux kernel to SD image file..."
  3129. mkdir -p /mnt/sdimagep1
  3130. mkdir -p /mnt/sdimagep2
  3131. busybox mount -t vfat -o loop,offset=${P1STARTBYTES} ${SDBASE} /mnt/sdimagep1
  3132. if [ $? -ne 0 ];then
  3133. echo "Sorry, mounting vfat partition 1 (at offset ${P1STARTBYTES}) of ${SDBASE} failed. Aborting script."
  3134. exit 1
  3135. fi
  3136. #120613 restore correct kernel image name...
  3137. case $REALKERNAME in
  3138. uImage) cp -f build/vmlinuz /mnt/sdimagep1/uImage ;;
  3139. kernel.img) cp -f build/vmlinuz /mnt/sdimagep1/kernel.img ;;
  3140. *) cp -f build/vmlinuz /mnt/sdimagep1/ ;;
  3141. esac
  3142. echo -n "$REALKERNAME" > /mnt/sdimagep1/REALKERNAME #just in case need to know, in a running puppy.
  3143. sync
  3144. busybox umount /mnt/sdimagep1 2>/dev/null
  3145. echo "...done"
  3146. echo
  3147. echo "Copying Puppy filesystem to SD image file, please wait..."
  3148. busybox mount -t ${SDFS2} -o loop,offset=${P2STARTBYTES} ${SDBASE} /mnt/sdimagep2
  3149. if [ $? -ne 0 ];then
  3150. echo "Sorry, mounting ${SDFS2} partition 2 (at offset ${P2STARTBYTES}) of ${SDBASE} failed. Aborting script."
  3151. exit 1
  3152. fi
  3153. cp -a rootfs-complete/* /mnt/sdimagep2/
  3154. sync
  3155. #120704 add to /etc/fstab...
  3156. echo "/dev/${SDDEVICE}2 / ${SDFS2} defaults,noatime 0 1" >> /mnt/sdimagep2/etc/fstab #120707 change relatime to noatime.
  3157. sync
  3158. echo "...done"
  3159. busybox umount /mnt/sdimagep2 2>/dev/null
  3160. echo
  3161. echo "Writing image file ${SDBASE} to SD card ${SDDEVICE}..."
  3162. dd if=${SDBASE} of=${SDDEVICE} bs=4M #120704 added bs=4M
  3163. if [ $? -ne 0 ];then
  3164. echo "Sorry, operation failure. Aborting script."
  3165. exit 1
  3166. fi
  3167. sync
  3168. echo
  3169. echo "Please type the name that you want to give the SD image file, or press ENTER"
  3170. SDBASEBASE="`basename $SDBASE .img | sed -e 's%-201[0-9]*%-%' -e 's%-skeleton%-%' | cut -f 1,2,3 -d '-'`"
  3171. PUPIMG="${SDBASEBASE}-${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.img"
  3172. echo -n "only for the default [${PUPIMG}]: "
  3173. read PUPIMG1
  3174. [ "$PUPIMG1" != "" ] && PUPIMG="$PUPIMG1"
  3175. echo "...chosen $PUPIMG"
  3176. echo
  3177. IMGK=`expr $IMGBYTES \/ 1024`
  3178. echo "The image file is ${IMGK}KB, so needs to be compressed for distribution."
  3179. echo "Compressing, please wait..."
  3180. [ -f ./${PUPIMG}.xz ] && rm -f ./${PUPIMG}.xz
  3181. xz --stdout ${SDBASE} > ${PUPIMG}.xz
  3182. sync
  3183. rm -f ./${SDBASE}
  3184. echo "...${PUPIMG}.xz created."
  3185. #130530 this is old code...
  3186. # echo "Writing skeleton image to ${SDDEVICE}, please wait very patiently..."
  3187. # dd if=${SDBASE} of=${SDDEVICE} bs=4M #120704 added bs=4M
  3188. # if [ $? -ne 0 ];then
  3189. # echo "Sorry, operation failure. Aborting script."
  3190. # exit 1
  3191. # fi
  3192. # sync
  3193. # rm -f $SDBASE
  3194. #
  3195. # FIXEXTPTN=''
  3196. # if [ "$SDFS2" = "ext2" ];then #120704 120706 see hack above, bypass.
  3197. # echo
  3198. # echo "The 2nd partition is 'ext2', but you may bump it to 'ext4' if you wish."
  3199. # echo -n "ENTER only to keep ext2, any char for ext4: "
  3200. # read bumpit
  3201. # if [ "$bumpit" != "" ];then
  3202. # echo
  3203. # echo "Creating ext4 f.s. on partition ${SDDEVICE}2, without a journal..."
  3204. # #mke2fs -t ext4 -O ^has_journal -L puppy -m 0 -b 4096 ${SDDEVICE}2
  3205. # ##120705 add '-E stride=2,stripe-width=1024' refer: http://blogofterje.wordpress.com/2012/01/14/optimizing-fs-on-sd-card/
  3206. # #mke2fs -t ext4 -O ^has_journal -L puppy -m 0 -b 4096 -E stride=2,stripe-width=1024 ${SDDEVICE}2
  3207. # #120706 mavrothal reports may not suit many cards, so revert...
  3208. # mke2fs -t ext4 -O ^has_journal -L puppy -m 0 -b 4096 ${SDDEVICE}2
  3209. # sync
  3210. # FIXEXTPTN='s%ext2%ext4%' #see below.
  3211. # SDFS2='ext4'
  3212. # echo "...done"
  3213. # fi
  3214. # fi
  3215. #
  3216. # mkdir -p /mnt/sdimagep1
  3217. # mkdir -p /mnt/sdimagep2
  3218. # dd if=${SDDEVICE}1 of=/dev/null bs=1024 count=1 #trying to fix weird bug.
  3219. # dd if=${SDDEVICE}2 of=/dev/null bs=1024 count=1 #trying to fix weird bug.
  3220. # while [ "a" = "a" ];do
  3221. # mount -t vfat ${SDDEVICE}1 /mnt/sdimagep1
  3222. # MNTSTAT1=$?
  3223. # mount -t ${SDFS2} ${SDDEVICE}2 /mnt/sdimagep2
  3224. # MNTSTAT2=$?
  3225. # if [ $MNTSTAT1 -ne 0 -o $MNTSTAT2 -ne 0 ];then
  3226. # echo
  3227. # echo "Something is wrong. There should be two partitions on the SD card,"
  3228. # echo "vfat and ${SDFS2}. There was an error mounting them. Aborting script."
  3229. # echo "Attempted operations:"
  3230. # echo "mount -t vfat ${SDDEVICE}1 /mnt/sdimagep1 STATUS: ${MNTSTAT1}"
  3231. # echo "mount -t ${SDFS2} ${SDDEVICE}2 /mnt/sdimagep2 STATUS: ${MNTSTAT2}"
  3232. # umount /mnt/sdimagep1 2>/dev/null
  3233. # umount /mnt/sdimagep2 2>/dev/null
  3234. # echo "You might try replugging the card."
  3235. # echo -n "ENTER to quit, any other key to retry: "
  3236. # read weirdbug
  3237. # [ "$weirdbug" != "" ] && continue
  3238. # exit 1
  3239. # fi
  3240. # break
  3241. # done
  3242. # [ "$FIXEXTPTN" ] && [ -f /mnt/sdimagep1/cmdline.txt ] && sed -i -e "${FIXEXTPTN}" /mnt/sdimagep1/cmdline.txt #120704
  3243. # echo
  3244. # echo "Copying Linux kernel to SD card..."
  3245. # #120613 restore correct kernel image name...
  3246. # case $REALKERNAME in
  3247. # uImage) cp -f build/vmlinuz /mnt/sdimagep1/uImage ;;
  3248. # kernel.img) cp -f build/vmlinuz /mnt/sdimagep1/kernel.img ;;
  3249. # *) cp -f build/vmlinuz /mnt/sdimagep1/ ;;
  3250. # esac
  3251. # echo -n "$REALKERNAME" > /mnt/sdimagep1/REALKERNAME #just in case need to know, in a running puppy.
  3252. # sync
  3253. # echo "...done"
  3254. # echo "Copying Puppy filesystem to SD card, please wait..."
  3255. # cp -a rootfs-complete/* /mnt/sdimagep2/
  3256. # sync
  3257. # #120704 add to /etc/fstab...
  3258. # echo "/dev/${SDDEVICE}2 / ${SDFS2} defaults,noatime 0 1" >> /mnt/sdimagep2/etc/fstab #120707 change relatime to noatime.
  3259. # sync
  3260. # echo "...done"
  3261. # umount /mnt/sdimagep1 2>/dev/null
  3262. # umount /mnt/sdimagep2 2>/dev/null
  3263. #
  3264. # echo
  3265. # echo "Please type the name that you want to give the SD image file, or press ENTER"
  3266. # SDBASEBASE="`basename $SDBASE .img | sed -e 's%-201[0-9]*%-%' -e 's%-skeleton%-%' | cut -f 1,2,3 -d '-'`"
  3267. # PUPIMG="${SDBASEBASE}-${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.img"
  3268. # echo -n "only for the default [${PUPIMG}]: "
  3269. # read PUPIMG1
  3270. # [ "$PUPIMG1" != "" ] && PUPIMG="$PUPIMG1"
  3271. # echo "...chosen $PUPIMG"
  3272. # echo
  3273. # echo "Now creating an image file of the SD card, please wait patiently..."
  3274. # IMGK=`expr $IMGBYTES \/ 1024` #assume size divisible by 1024!!!!***WARNING***
  3275. # dd if=$SDDEVICE of=$PUPIMG bs=1024 count=$IMGK
  3276. # sync
  3277. # echo "...done. The image file is named '${PUPIMG}'"
  3278. # echo
  3279. # echo "However, it is ${IMGK}KB, so needs to be compressed for distribution."
  3280. # echo "Compressing, please wait..."
  3281. # rm -f ${PUPIMG}.xz
  3282. # xz $PUPIMG
  3283. # sync
  3284. #update desktop drive icons. note, this is also done in /usr/sbin/bootflash, puppyinstaller, gparted_shell...
  3285. #/tmp/pup_event_frontend_block_request is used in /sbin/pup_event_frontend_d to refresh drv...
  3286. THEDRIVE="`echo -n "$SDDEVICE" | cut -f 3 -d '/'`"
  3287. echo "$THEDRIVE" > /tmp/pup_event_frontend_block_request
  3288. COMPRIMGBYTES=`stat --format=%s ${PUPIMG}.xz`
  3289. echo
  3290. echo "The image is now ${PUPIMG}.xz and is ${COMPRIMGBYTES}bytes."
  3291. COMPRIMGK=`expr $COMPRIMGBYTES \/ 1024`
  3292. echo "(${COMPRIMGK}KB)"
  3293. echo "Image file may be distributed to others!"
  3294. echo
  3295. #120510...
  3296. echo "If the SD card currently plugged in is bigger than the image, for example
  3297. you have a 4GB card and used a 1GB image, optionally now you may increase the
  3298. ${SDFS2} partition to fill the remaining space -- this is for your own use."
  3299. echo -n "ENTER only to decline: "
  3300. read makebig
  3301. if [ "$makebig" != "" ];then
  3302. if [ "`which gparted`" = "" ];then
  3303. echo "ERROR, gparted not installed!!!"
  3304. else
  3305. gparted $SDDEVICE
  3306. sync
  3307. echo
  3308. echo "Checking the ${SDFS2} filesystem..."
  3309. fsck.${SDFS2} -p ${SDDEVICE}2
  3310. sync
  3311. echo "$THEDRIVE" > /tmp/pup_event_frontend_block_request
  3312. fi
  3313. fi
  3314. fi
  3315. cd $WKGDIR
  3316. #now do the devx...
  3317. echo
  3318. echo -n "Hit ENTER to build the 'devx' SFS file, any other key to exit: "
  3319. read dodevx
  3320. [ "$dodevx" != "" ] && exit
  3321. echo
  3322. echo "Building ${DEVXSFS}..."
  3323. #rm -rf sandbox3/devx
  3324. #mkdir sandbox3/devx
  3325. echo " building sandbox3/devx ..."
  3326. rm -f /tmp/3builddistro_removed_alt_dev #101013
  3327. ALLGENNAMESD="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | cut -f 2 -d '|' | sed -e 's%$%_DEV%'`"
  3328. rm -f sandbox3/${DEVXSFS} 2>/dev/null #100911
  3329. for ONEDEV in `ls -1 packages-${DISTRO_FILE_PREFIX} | grep '_DEV$' | tr '\n' ' '`
  3330. do
  3331. #110727 no longer using this...
  3332. ##101013 preferred pkg for an older kernel (see PKGS_MANAGEMENT file)...
  3333. ONEPKG="`echo -n "$ONEDEV" | sed -e 's%_DEV%%'`"
  3334. #for ONE_PPO in $PKG_PREFER_OLDER
  3335. #do
  3336. # one_KERNEL=`echo -n "$ONE_PPO" | cut -f 1 -d '|' | cut -f 1 -d '-' | cut -f 1 -d '_' | cut -f 3 -d '.'` #ex 34 (from 2.6.34)
  3337. # two_PKG="`echo -n "$ONE_PPO" | cut -f 2 -d '|'`"
  3338. # three_PKG="`echo -n "$ONE_PPO" | cut -f 3 -d '|'`"
  3339. # if [ $SUB_KERNELVER -le $one_KERNEL ];then
  3340. # if [ "$two_PKG" = "$ONEPKG" ];then
  3341. # #if PKGS_SPECS_TABLE has 'yes' for older pkg, bypass this one...
  3342. # if [ "`echo "$PKGLIST" | tr ' ' '\n' | grep "^${three_PKG}$"`" != "" ];then
  3343. # echo "$ONEDEV" >> /tmp/3builddistro_removed_alt_dev
  3344. # continue 2
  3345. # fi
  3346. # fi
  3347. # else
  3348. # if [ "$three_PKG" = "$ONEPKG" ];then
  3349. # #if PKGS_SPECS_TABLE has 'yes' for newer pkg, bypass this one...
  3350. # if [ "`echo "$PKGLIST" | tr ' ' '\n' | grep "^${two_PKG}$"`" != "" ];then
  3351. # echo "$ONEDEV" >> /tmp/3builddistro_removed_alt_dev
  3352. # continue 2
  3353. # fi
  3354. # fi
  3355. # fi
  3356. #done
  3357. devPATTERN='^'"$ONEDEV"
  3358. if [ "`echo "$ALLGENNAMESD" | grep "$devPATTERN"`" != "" ];then
  3359. cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEDEV}/* sandbox3/devx/
  3360. sync #110727 running drake pup 0.3 with k2.6.39-3 new laptop, mysterious loss of dirs/files. try sync.
  3361. fi
  3362. done
  3363. sync
  3364. #earlier above i moved all invalid symlinks into the devx module, yeah but i
  3365. #think should delete them if they really point nowhere...
  3366. echo " Deleting really invalid symlinks in devx..."
  3367. mkdir layer_top
  3368. LAYERFS="aufs"
  3369. [ "`lsmod | grep '^unionfs'`" != "" ] && LAYERFS="unionfs"
  3370. if [ "$LAYERFS" = "aufs" ];then
  3371. mount -t aufs -o udba=reval,diropq=w,dirs=sandbox3/devx=rw:sandbox3/rootfs-complete=ro layerfs layer_top
  3372. else
  3373. mount -t unionfs -o dirs=sandbox3/devx=rw:sandbox3/rootfs-complete=ro layerfs layer_top
  3374. fi
  3375. for ONESYMLINK in `find layer_top/ -type l`
  3376. do
  3377. [ "`echo -n "$ONESYMLINK" | grep '/dev/'`" != "" ] && continue
  3378. [ "`echo -n "$ONESYMLINK" | grep '/proc/'`" != "" ] && continue
  3379. xONESYMLINK="`echo -n "$ONESYMLINK" | sed -e 's/^layer_top//'`"
  3380. #111123 cross-build, cannot do chroot...
  3381. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  3382. if [ "`chroot layer_top readlink -e $xONESYMLINK`" = "" ];then
  3383. echo " $ONESYMLINK"
  3384. rm -f $ONESYMLINK
  3385. fi
  3386. else
  3387. #do it without chroot...
  3388. LINKTO="`readlink layer_top${xONESYMLINK}`"
  3389. [ -e layer_top${LINKTO} ] && continue #absolute path
  3390. UPONE="`dirname "$xONESYMLINK"`"
  3391. [ -e layer_top${UPONE}/${LINKTO} ] && continue #relative path
  3392. echo " $ONESYMLINK"
  3393. rm -f $ONESYMLINK
  3394. fi
  3395. done
  3396. sync
  3397. umount layer_top
  3398. rmdir layer_top
  3399. ###HACK###
  3400. if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" != "" ];then #121022
  3401. [ -e sandbox3/devx/usr/bin/python2.5 ] && ln -s python2.5 sandbox3/devx/usr/bin/python 2>/dev/null
  3402. [ -e sandbox3/devx/usr/bin/python2.6 ] && ln -s python2.6 sandbox3/devx/usr/bin/python 2>/dev/null
  3403. [ -e sandbox3/devx/usr/bin/python2.7 ] && ln -s python2.7 sandbox3/devx/usr/bin/python 2>/dev/null
  3404. fi
  3405. rm -f sandbox3/devx/usr/lib/mozilla/plugins/* #100407 maybe .a, .la files in here.
  3406. ###END HACK###
  3407. #v424 no, i have needed docs in usr/share/doc...
  3408. #w003 there's docs here, move them out...
  3409. rm -rf packages-${DISTRO_FILE_PREFIX}/devx_DOC 2>/dev/null
  3410. mkdir -p packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share
  3411. #mv sandbox3/devx/usr/share/doc packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
  3412. mv sandbox3/devx/usr/share/doc-base packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
  3413. mv sandbox3/devx/usr/share/man packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
  3414. #100831 hack, this symlink needed...
  3415. if [ -d sandbox3/devx/usr/X11R7/include/xorg ];then
  3416. [ ! -e sandbox3/devx/usr/include/xorg ] && ln -s ../X11/include/xorg sandbox3/devx/usr/include/xorg
  3417. fi
  3418. #100622 remove overhead of this script running every bootup...
  3419. mkdir -p sandbox3/devx/etc/profile.d
  3420. rm -f sandbox3/devx/etc/profile.d/pkgconfig* 2>/dev/null
  3421. PKG_CONFIG_PATH="`find sandbox3/devx/usr/lib sandbox3/devx/usr/X11R7/lib sandbox3/devx/opt sandbox3/devx/usr/local/lib -type d -name pkgconfig | sed -e 's%sandbox3/devx%%' | tr '\n' ':'`"
  3422. echo "export PKG_CONFIG_PATH='${PKG_CONFIG_PATH}'" > sandbox3/devx/etc/profile.d/pkgconfig
  3423. #maybe stray /install dir from slackware pkgs...
  3424. rm -rf sandbox3/devx/install 2>/dev/null
  3425. [ -f sandbox3/devx/pet.specs ] && rm -f sandbox3/devx/pet.specs #w478
  3426. sync
  3427. #110215 BaCon...
  3428. #111203 remove offer to download and compile bacon (no good for cross-builds)...
  3429. if [ ! -f sandbox3/devx/usr/bin/bacon ];then
  3430. #if [ -f sandbox3/devx/usr/bin/bacon ];then
  3431. # BACONPKG="`grep '|bacon|' sandbox3/rootfs-complete/root/.packages/woof-installed-packages | cut -f 1 -d '|'`"
  3432. # echo
  3433. # echo "The devx has BaCon compiler package: ${BACONPKG}"
  3434. # echo "Great, but if you have an Internet connection, you may update it, however this"
  3435. # echo "does not always work as a very recent /usr/bin/bacon must be installed..."
  3436. #else
  3437. echo
  3438. echo "Oh, you do not have the BaCon compiler in devx."
  3439. echo "It is recommended that variable PKGS_SPECS_TABLE in file DISTRO_PKGS_SPECS-* have this entry:"
  3440. echo "yes|bacon||exe>dev,dev,doc>dev,nls"
  3441. echo "It is recommended that all Puppy distros standardise on having BaCon available."
  3442. # echo "Anyway, if you have an Internet connection, BaCon can be downloaded now, however"
  3443. # echo "this does not always work as you need a very recent /usr/bin/bacon already installed..."
  3444. fi
  3445. echo -n "Press ENTER to continue: "
  3446. read keepgoing
  3447. ##101217 get latest BaCon...
  3448. #if [ -f support/fetch ];then #see http://www.basic-converter.org/fetch.bac
  3449. # if [ "`which bacon`" != "" ];then
  3450. # echo
  3451. # echo "Press any printable key (then ENTER) to download latest BaCon BASIC compiler"
  3452. # echo "and support files. You will need Internet access to do this."
  3453. # echo -n "ENTER key only to decline, any other printable char to download: "
  3454. # read dobacon
  3455. # if [ "$dobacon" != "" ];then
  3456. # mkdir -p sandbox3/devx/usr/share/BaCon
  3457. # rm -f sandbox3/devx/usr/share/BaCon/* 2>/dev/null
  3458. # cp support/fetch sandbox3/devx/usr/share/BaCon/
  3459. # cd sandbox3/devx/usr/share/BaCon
  3460. # ./fetch
  3461. # sync
  3462. # [ ! -f documentation.pdf ] && wget http://www.basic-converter.org/documentation.pdf
  3463. # [ ! -f documentation.html ] && wget http://www.basic-converter.org/documentation.html
  3464. # [ ! -f hug.txt ] && wget http://www.basic-converter.org/hug.txt
  3465. # [ ! -f sqlite3.txt ] && wget http://www.basic-converter.org/sqlite3.txt
  3466. # [ ! -f gmp.txt ] && wget http://www.basic-converter.org/gmp.txt
  3467. # [ ! -f curses.txt ] && wget http://www.basic-converter.org/curses.txt
  3468. # [ ! -f pthreads.txt ] && wget http://www.basic-converter.org/pthreads.txt
  3469. # [ ! -f gd.txt ] && wget http://www.basic-converter.org/gd.txt
  3470. # [ ! -f gtk.txt ] && wget http://www.basic-converter.org/gtk.txt
  3471. # [ ! -f gl.txt ] && wget http://www.basic-converter.org/gl.txt
  3472. # ##fetch has already downloaded bacon.bac, but want beta version...
  3473. # #mv -f bacon.bac bacon-released.bac
  3474. # #wget http://www.basic-converter.org/beta/bacon.bac
  3475. # #[ $? -ne 0 ] && mv -f bacon-released.bac bacon.bac
  3476. # #mv -f documentation.html documentation-released.html
  3477. # #wget http://www.basic-converter.org/beta/documentation.html
  3478. # #[ $? -ne 0 ] && mv -f documentation-released.html documentation.html
  3479. # sync
  3480. # if [ -f bacon.bac ];then
  3481. # bacon bacon.bac
  3482. # sync
  3483. # if [ -f bacon ];then
  3484. # cp -f -a bacon ../../bin/
  3485. # echo "...done"
  3486. # else
  3487. # echo "ERROR: bacon did not compile!"
  3488. # fi
  3489. # fi
  3490. # cd ../../../../../ #back to woof-tree project dir.
  3491. # fi
  3492. # else
  3493. # echo
  3494. # echo "WARNING: 'devx' SFS not loaded, cannot install latest BaCon BASIC compiler."
  3495. # echo " (or current loaded devx SFS does not have BaCon compiler in it)"
  3496. # fi
  3497. #fi
  3498. #110429 see above, think want glibc scsi headers in usr/include/scsi...
  3499. if [ -d sandbox3/devx/usr/include/scsi-GLIBC ];then
  3500. #probably have kernel scsi headers in usr/include/scsi, fix...
  3501. cp -a -f sandbox3/devx/usr/include/scsi-GLIBC/* sandbox3/devx/usr/include/scsi/
  3502. fi
  3503. #110702 mageia1 python puts 30python.csh here...
  3504. rm -f sandbox3/devx/etc/profile.d/*.csh
  3505. #130111 fixed in 2createpackages...
  3506. ##110726 mageia does something weird, puts all these in wrong place...
  3507. #if [ -d sandbox3/devx/usr/bin/multiarch-i386-linux ];then
  3508. # cp -a -f --remove-destination sandbox3/devx/usr/bin/multiarch-i386-linux/* sandbox3/devx/usr/bin/
  3509. # rm -rf sandbox3/devx/usr/bin/multiarch-i386-linux
  3510. #fi
  3511. echo "Now creating sandbox3/${DEVXSFS} ..."
  3512. ./support/${MKSQUASHFS} sandbox3/devx sandbox3/${DEVXSFS} ${COMPCHOICE} #100911 110713
  3513. sync
  3514. chmod 644 sandbox3/${DEVXSFS}
  3515. cd sandbox3
  3516. echo -n "$IDSTRING" >> ${DEVXSFS} #100911 16-byte id-string appended to file.
  3517. md5sum ${DEVXSFS} > ${DEVXSFS}.md5.txt #100911
  3518. cd ..
  3519. sync
  3520. echo "...done"
  3521. echo
  3522. echo "Script finished."
  3523. echo -n "Press ENTER key to exit: "
  3524. read yeahgetout
  3525. ###END###