3builddistro 192 KB

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