3builddistro 182 KB

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