3builddistro 192 KB

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