3builddistro-Z 144 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288
  1. #!/bin/sh
  2. # new for fatdog style kernel
  3. #v431 accepts passed params, from woof_gui_tabs:
  4. #$1=$CHOICE_KERNELPKG $2=$CHOICE_SCSI $3=$CHOICE_BIGMODEM $4=$CHK_FB_STATE $5=$CHK_EXOTIC_STATE $6=$CHK_RADICAL_STATE
  5. #100912 add $7=CHK_SIMPLE_FILENAMES
  6. export LANG=C #faster.
  7. # for downlaoding kernel
  8. REPO_URL=${REPO_URL:-http://librepup.info/huge_kernels/} #can change var
  9. #w482 use xorriso if it is installed (see also functions4puppy)...
  10. CDRECORD='cdrecord'
  11. MKISOFS='mkisofs'
  12. if [ "`which xorriso`" != "" ];then
  13. CDRECORD='xorrecord'
  14. MKISOFS='xorrisofs' #growisofs reads this variable.
  15. fi
  16. export CDRECORD MKISOFS
  17. RARCH=`uname -m` #running arch
  18. . ./DISTRO_SPECS #this has DISTRO_VERSION.
  19. #140619
  20. if [ "$DISTRO_KERNEL_PET" != "Huge_Kernel" ];then
  21. echo "You can not use this script. Use 3builddistro instead or click the button"
  22. echo "named 'BUILD DISTRO (normal build)' in the Woof GUI"
  23. echo "Press enter to exit."
  24. read normal_build
  25. exit 0
  26. fi
  27. if [ ! "$DISTRO_DB_SUBNAME" ];then #121102
  28. DISTRO_DB_SUBNAME="$DISTRO_COMPAT_VERSION" #fallback if DISTRO_DB_SUBNAME not defined in file DISTRO_SPECS.
  29. echo '#subname for online PETs dir. Ex: "slacko14", dir "pet_packages-slacko14", db file "Packages-puppy-slacko14-official":
  30. #note: prior to existence of this variable, online subname was set to $DISTRO_COMPAT_VERSION or via some hack code.
  31. ' >> ./DISTRO_SPECS
  32. echo "DISTRO_DB_SUBNAME='${DISTRO_DB_SUBNAME}'" >> ./DISTRO_SPECS
  33. fi
  34. if [ -f ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  35. . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
  36. else
  37. . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT} #130306
  38. fi
  39. if [ -f ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then #w478
  40. . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} #has FALLBACKS_COMPAT_VERSIONS
  41. else
  42. . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT} #has FALLBACKS_COMPAT_VERSIONS
  43. fi
  44. . ./PKGS_MANAGEMENT #101013 want variable PKG_PREFER_OLDER.
  45. . ./DISTRO_PET_REPOS #120506 want variable PACKAGELISTS_PET_ORDER
  46. if [ -f WOOFMERGEVARS ];then #111123
  47. . ./WOOFMERGEVARS #has variables WOOF_HOSTARCH, WOOF_TARGETARCH, WOOF_COMPATDISTRO, WOOF_COMPATVERSION
  48. else
  49. echo 'File WOOFMERGEVARS does not exist. This is created by script
  50. merge2out. Your setup is wrong, quiting.'
  51. exit
  52. fi
  53. #64 bit
  54. [ "$WOOF_TARGETARCH" = "x86_64" ] && lsuffix=64 || lsuffix= #140121 for 64bit ${lsuffix}
  55. #100911 simple filenames, want idstring...
  56. #IDDATE="`date +%y%m%d%H%M%S`" #12 bytes, ex: 100911153319
  57. #IDPREFIX="`echo -n "$DISTRO_FILE_PREFIX" | cut -b 1`"
  58. #vDISTRO_VERSION="`echo -n "$DISTRO_VERSION" | cut -b 1-3`" #in case it ever gets bigger than 3 chars.
  59. #IDSTRING="${IDPREFIX}${vDISTRO_VERSION}${IDDATE}"
  60. #110422 increase size of idstring to 32 bytes...
  61. IDDATE="`date +%y%m%d%H%M%S`" #12 bytes, ex: 100911153319
  62. IDPREFIX="`echo -n "$DISTRO_FILE_PREFIX" | cut -b 1`"
  63. IDSTRING="${IDPREFIX}${IDDATE}ZZZZ${DISTRO_VERSION}"
  64. #...ZZZZ reserved space for future use.
  65. LEN1=`echo -n "$IDSTRING" | wc -c`
  66. LEN2=`expr 32 - $LEN1`
  67. EXTX=''
  68. while [ $LEN2 -gt 0 ];do
  69. LEN2=`expr $LEN2 - 1`
  70. EXTX="${EXTX}X"
  71. done
  72. IDSTRING="${IDSTRING}${EXTX}" #32 bytes ex: w110423092024ZZZZ5.1.2XXXXXXXXXX
  73. #the files that have compatible-distro pkg docs (these were downloaded by 0setup)...
  74. PKGLISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | tr '\n' ' ' | sed -e 's% $%%'`" #see file DISTRO_PKGS_SPECS-ubuntu
  75. #...format ex: 'Packages-ubuntu-intrepid-main Packages-ubuntu-intrepid-universe'
  76. WKGDIR="`pwd`"
  77. #120506 params passed from woof_gui_tabs. moved up...
  78. KERNELPKG=""
  79. [ $1 ] && KERNELPKG="$1"
  80. CHOICE_SCSI=""
  81. [ $2 ] && CHOICE_SCSI="$2" #Erase_SCSI, Keep_SCSI, Boot_SCSI
  82. CHOICE_BIGMODEM=""
  83. [ $3 ] && CHOICE_BIGMODEM="$3" #Erase_big_modems Keep_big_modems Zdrv_big_modems
  84. CHK_FB_STATE=""
  85. [ $4 ] && CHK_FB_STATE="$4"
  86. CHK_EXOTIC_STATE=""
  87. [ $5 ] && CHK_EXOTIC_STATE="$5"
  88. CHK_RADICAL_STATE=""
  89. [ $6 ] && CHK_RADICAL_STATE="$6"
  90. #120506
  91. echo
  92. echo "Do you want to create a live-CD .iso file, which is the normal choice for a
  93. PC-compatible target, or is your target an SD-card for an ARM-based board?
  94. In the latter case, you would already have downloaded an SD-card skeleton image
  95. file into folder 'sd-skeleton-images' (done by script '1download') -- if there
  96. is no image file in that folder, you cannot choose the SD-card option."
  97. echo "WARNING: for the SD-card option, you must have enough free space in the
  98. current directory ${WKGDIR}/sandbox3
  99. to expand the SD image file, typically 4GB."
  100. echo "Press ENTER only for normal .iso creation, or "
  101. echo -n "any other printable character for SD-card: "
  102. read SDFLAG
  103. #120714 ask what type of arm board...
  104. if [ "$SDFLAG" != "" ];then
  105. echo "...ok, chose sd-card image."
  106. echo
  107. echo "Type number of board that you are building for:
  108. 1 Raspberry Pi
  109. 2 Mele A1000 or A2000 (or other A10 board)
  110. 3 ODROID-X (or other Exynos 4412 board)"
  111. read boardnum
  112. case $boardnum in
  113. 1) BOOT_BOARD='raspi' ;;
  114. 2) BOOT_BOARD='mele' ;;
  115. *) BOOT_BOARD='odroidx' ;;
  116. esac
  117. echo "...you chose $BOOT_BOARD"
  118. fi
  119. if [ "$SDFLAG" != "" ];then
  120. #override module choices, as kernel is built customized to particular hardware...
  121. CHOICE_BIGMODEM="Keep_big_modems"
  122. CHOICE_SCSI="Keep_SCSI"
  123. CHK_FB_STATE="false"
  124. CHK_EXOTIC_STATE="false"
  125. CHK_RADICAL_STATE="false"
  126. CHK_YES_ZDRV="false"
  127. fi
  128. #w003 remove comments from PKGS_SPECS_TABLE
  129. PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep -v '^#'`"
  130. mkdir -p sandbox3
  131. export DISTRO_NAME
  132. export DISTRO_VERSION
  133. if [ "`echo -n "$DISTRO_VERSION" | grep '\.'`" = "" ];then #110422
  134. DIGIT1="`echo "$DISTRO_VERSION" | cut -b 1`"
  135. DIGIT2="`echo "$DISTRO_VERSION" | cut -b 2`"
  136. DIGIT3="`echo "$DISTRO_VERSION" | cut -b 3`"
  137. RIGHTVER="${DIGIT1}.${DIGIT2}.${DIGIT3}"
  138. [ "$DIGIT3" = "0" ] && RIGHTVER="${DIGIT1}.${DIGIT2}"
  139. else
  140. RIGHTVER="$DISTRO_VERSION"
  141. fi
  142. #the kernel is supposed to be a .pet package, already downloaded into packages-pet... not now
  143. #echo
  144. #if [ "$KERNELPKG" = "" ];then
  145. ##110823
  146. #KERNELPKG="$DISTRO_KERNEL_PET"
  147. #echo "The kernel pkg that you are using is: $KERNELPKG"
  148. #echo "This is specified in variable DISTRO_KERNEL_PET in file DISTRO_SPECS,"
  149. #echo "which is set in the first GUI tab of script woof_gui, or in script 1download,"
  150. #echo "or you can directly edit DISTRO_SPECS -- but please do so early-on, before"
  151. #echo "running script 1download, as Woof needs to know the kernel version to"
  152. #echo "properly resolve some dependencies, possible packages that are dependent"
  153. #echo "on a certain kernel version."
  154. #echo "Note, the linux_kernel PET needs to be in directory packages-pet."
  155. #echo -n "Press ENTER to continue: "
  156. #read keepgoing
  157. #fi
  158. #110826 #131124 xz
  159. 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.
  160. dotnum="`echo -n "$KERNELVER" | sed -e 's%[^\.]%%g' | wc -c`"
  161. if [ "$dotnum" = "2" ];then
  162. #SUB_SUB_KERNELVER=`echo -n "$KERNELPKG" | cut -f 3 -d '-'`
  163. SUB_SUB_KERNELVER=0 #cos we don't really know what it is.
  164. else
  165. SUB_SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 4 -d '.'`
  166. fi
  167. SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 3 -d '.'`
  168. MAJ_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 1 -d '.'` #111014 2 or 3.
  169. echo
  170. #if >= 2.6.29 kernel, use mksquashfs v4.0...
  171. #if [ "$MAJ_KERNELVER" = "2" ];then
  172. #MKSQUASHFS='mksquashfs3.3'
  173. #[ $SUB_KERNELVER -ge 29 ] && MKSQUASHFS='mksquashfs4.0'
  174. #[ $SUB_KERNELVER -ge 39 ] && MKSQUASHFS='mksquashfs4.2' #110713
  175. ##[ $SUB_KERNELVER -eq 18 ] && MKSQUASHFS='mksquashfs3.1' #w478
  176. ##[ $SUB_KERNELVER -eq 18 ] && MKSQUASHFS='mksquashfs3.2' #w478 old 2.6.18.1 kernel
  177. #[ $SUB_KERNELVER -eq 18 ] && MKSQUASHFS='mksquashfs3.3' #w479 2.6.18.8 kernel
  178. #[ $SUB_KERNELVER -eq 18 ] && [ $SUB_SUB_KERNELVER -eq 1 ] && MKSQUASHFS='mksquashfs3.2' #w479
  179. #[ $SUB_KERNELVER -eq 27 ] && [ $SUB_SUB_KERNELVER -gt 46 ] && MKSQUASHFS='mksquashfs4.0' #100607
  180. #else #111014
  181. #MKSQUASHFS='mksquashfs4.2'
  182. #fi
  183. #SQUASHFSMAJOR="`echo -n "$MKSQUASHFS" | cut -f 1 -d '.' | rev | cut -c 1`" #3 or 4.
  184. #if [ "$MKSQUASHFS" = "mksquashfs4.2" ];then #110713
  185. #echo
  186. #echo ".sfs files are normally compressed with gzip."
  187. #echo "However, this kernel supports xz, which is higher compression."
  188. #echo -n "Press ENTER only for gzip, any other char for xz: "
  189. #read XZCHOICE
  190. #if [ "$XZCHOICE" ];then
  191. #echo "...xz chosen"
  192. #else
  193. #echo "...gzip chosen"
  194. #COMPCHOICE=''
  195. #fi
  196. #fi
  197. #140615
  198. MKSQUASHFS=mksquashfs #use running system's 140619
  199. COMPCHOICE='-comp xz -Xbcj x86 -b 512K'
  200. #110823
  201. echo
  202. #./findwoofinstalledpkgs #creates woof-installed-packages, which later gets copied into sandbox3/rootfs-complete/root/.packages/
  203. #121028 ...now also creates devx-only-installed-packages.
  204. #100912 choose simple or traditional filenames...
  205. #traditional names...
  206. PREFIX1CHAR="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1`"
  207. KERNEL3CHARS="`echo -n "$KERNELVER" | tr -d '.' | tr -d '\-' | tr -d '[a-z]' | rev | cut -c 1,2,3 | rev`"
  208. #tradZDRVSFS="z${PREFIX1CHAR}${DISTRO_VERSION}${KERNEL3CHARS}.sfs" #ex: zw071629.sfs
  209. #tradDEVXSFS="${DISTRO_FILE_PREFIX}_devx_${DISTRO_VERSION}.sfs" #ex: wary_devx_071.sfs
  210. ##tradPUPPYSFS="${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.sfs" #ex: wary-071.sfs
  211. ##tradZDRVSFS="zdrv_${DISTRO_VERSION}.sfs"
  212. ##tradDEVXSFS="devx_${DISTRO_VERSION}.sfs"
  213. #tradPUPPYSFS="${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  214. #110422 new traditional names...
  215. tradPUPPYSFS="puppy_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  216. tradZDRVSFS="zdrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  217. tradADRVSFS="adrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  218. tradYDRVSFS="ydrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  219. tradDEVXSFS="devx_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
  220. #if [ $7 ];then #passed in from woof_gui
  221. #CHK_SIMPLE_FILENAMES="$7"
  222. #else
  223. #echo
  224. #echo "Woof can build to use traditional or simplified filenames."
  225. #echo "The simplified filenames do not have any distro or version information in their"
  226. #echo "names: vmlinuz, initrd.gz, puppy.sfs, zdrv.sfs"
  227. #echo "The traditional names look like this:"
  228. #echo "vmlinuz, initrd.gz, ${tradPUPPYSFS}, ${tradZDRVSFS}"
  229. #echo "Note that there are many apps that use the traditional names, such as CD"
  230. #echo "remaster applications, though the official Woof scripts should be all working"
  231. #echo "with both naming schemes. To complicate matters, there is some variation in"
  232. #echo "the traditional names with different versions of Puppy, so best to use scripts"
  233. #echo "that have been updated to work will the names stored in file DISTRO_SPECS: so"
  234. #echo "note that the chosen names are available in a running Puppy in /etc/DISTRO_SPECS"
  235. #echo "as these variables: DISTRO_PUPPYSFS, DISTRO_ZDRVSFS"
  236. #echo -n "Press ENTER only for simplified names (any char otherwise): "
  237. #read read_simple
  238. #CHK_SIMPLE_FILENAMES='true' #simple.
  239. #[ "$read_simple" ] && CHK_SIMPLE_FILENAMES='false'
  240. #fi
  241. if [ "$CHK_SIMPLE_FILENAMES" = "true" ];then
  242. echo '...simple chosen'
  243. PUPPYSFS='puppy.sfs'
  244. ZDRVSFS='zdrv.sfs'
  245. ADRVSFS='adrv.sfs'
  246. YDRVSFS='ydrv.sfs'
  247. DEVXSFS='devx.sfs'
  248. else
  249. echo '...traditional chosen'
  250. PUPPYSFS="$tradPUPPYSFS"
  251. ZDRVSFS="$tradZDRVSFS"
  252. ADRVSFS="$tradADRVSFS"
  253. YDRVSFS="$tradYDRVSFS"
  254. DEVXSFS="$tradDEVXSFS"
  255. fi
  256. #now build rootfs-complete, the main filesystem...
  257. echo
  258. echo "Now building sandbox3/rootfs-complete, with the complete filesystem..."
  259. echo '#!/bin/sh' > sandbox3/pinstall.sh
  260. rm -rf sandbox3/rootfs-complete
  261. sync
  262. mkdir sandbox3/rootfs-complete
  263. mkdir sandbox3/rootfs-complete/etc
  264. #no, confusing, assign to history...
  265. #echo -n "$DISTRO_VERSION" > sandbox3/rootfs-complete/etc/puppyversion #for backwards compat. old scripts.
  266. cp DISTRO_SPECS sandbox3/rootfs-complete/etc/
  267. #copy the skeleton...
  268. cp -a rootfs-skeleton/* sandbox3/rootfs-complete/
  269. cat sandbox3/rootfs-complete/pinstall.sh >> sandbox3/pinstall.sh
  270. # extra packages
  271. for d in $(ls rootfs-packages)
  272. do
  273. state=true
  274. LIST="sfs_load|pfilesearch|pfind|firewall_ng"
  275. echo "$d" | egrep -q "$LIST" && def=true || def=false
  276. case "$d" in
  277. change_kernels)
  278. def=true
  279. ;;
  280. jwm_config|ptheme|ptheme_buntoo)
  281. if grep 'jwmconfig' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} |\
  282. grep -q '^yes' ;then
  283. state=false #cant choose them if jwmconfig is in specs.
  284. else
  285. def=true
  286. fi
  287. ;;
  288. wallpaper)
  289. if grep -q 'yes|wallpaper' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
  290. state=false # don't overwrite user chosen specs
  291. def=false
  292. else
  293. def=true
  294. fi
  295. ;;
  296. pmusic)
  297. if grep -q 'yes|ffmpeg' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
  298. def=true
  299. else
  300. state=false
  301. def=false
  302. fi # depends ffmpeg
  303. ;;
  304. pmirror)
  305. if grep -q 'yes|mirdir' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
  306. def=true
  307. else
  308. state=false
  309. def=false
  310. fi #depends mirdir
  311. ;;
  312. *)
  313. if grep "$d" DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} |\
  314. grep -q '^yes' ;then
  315. state=false # don't overwrite user chosen specs
  316. def=false
  317. fi
  318. ;;
  319. #### TO DO, pburn. Different distros have different generic names.
  320. esac
  321. CBOXES="$CBOXES""<hbox space-expand=\"true\" space-fill=\"true\">
  322. <checkbox>
  323. <label>$d</label>
  324. <default>$def</default>
  325. <variable>$d</variable>
  326. <sensitive>$state</sensitive>
  327. </checkbox>
  328. </hbox>"
  329. done
  330. CHOICE=/tmp/rootfs_choice$$
  331. export GUIC="<window title=\"Choose extra packages\">
  332. <vbox>
  333. <hbox>
  334. <text>
  335. <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>
  336. </text>
  337. </hbox>
  338. <hbox space-expand=\"true\" space-fill=\"true\">
  339. <text use-markup=\"true\">
  340. <label>\"<b>These are maintained as part of woof.</b>\"</label>
  341. </text>
  342. </hbox>
  343. <vbox scrollable=\"true\" height=\"160\" width=\"380\">
  344. $CBOXES
  345. </vbox>
  346. <hbox><button ok></button></hbox>
  347. </vbox>
  348. </window>"
  349. gtkdialog -p GUIC -c > $CHOICE
  350. . $CHOICE
  351. [ -f /tmp/rootfs-packages.specs ] && rm /tmp/rootfs-packages.specs # in case we baled out on last build
  352. [ -f /tmp/rootfs_pkgs_pinstall.sh ] && rm /tmp/rootfs_pkgs_pinstall.sh # this needs doing anyway
  353. if [ "$EXIT" = "OK" ];then
  354. while read line
  355. do
  356. if echo $line|grep -q "true" ;then
  357. echo "copying ${line%%=*}"
  358. cp -a rootfs-packages/${line%%=*}/* sandbox3/rootfs-complete/
  359. [ -f rootfs-packages/${line%%=*}/pinstall.sh ] &&\
  360. cat rootfs-packages/${line%%=*}/pinstall.sh >> /tmp/rootfs_pkgs_pinstall.sh
  361. cat sandbox3/rootfs-complete/pet.specs >> /tmp/rootfs-packages.specs
  362. else
  363. continue
  364. fi
  365. done < $CHOICE
  366. fi
  367. rm $CHOICE
  368. ./findwoofinstalledpkgs # moved to here so we can add /tmp/rootfs-packages.specs
  369. echo "Continuing... please wait"
  370. rm -f sandbox3/rootfs-complete/pinstall.sh
  371. rm -f /tmp/3builddistro_removed_alt 2>/dev/null #101013
  372. #121210 fix, ARCHDIR was not getting set...
  373. ARCHDIR=''
  374. if [ "$WOOF_COMPATDISTRO" = "ubuntu" ] || [ "$WOOF_COMPATDISTRO" = "trisquel" ];then
  375. case $WOOF_COMPATVERSION in
  376. jaunty|karmic|lucid|dwyn|awen|taranis) #old releases.
  377. true
  378. ;;
  379. *)
  380. case $WOOF_TARGETARCH in
  381. x86) ARCHDIR='i386-linux-gnu' ;;
  382. x86_64) ARCHDIR='x86_64-linux-gnu' ;;
  383. esac
  384. ;;
  385. esac
  386. fi
  387. if [ "$WOOF_COMPATDISTRO" = "debian" ];then #130510
  388. case $WOOF_COMPATVERSION in
  389. squeeze|lenny|etch|sarge|woody) #old releases.
  390. true
  391. ;;
  392. *) #wheezy and later...
  393. case $WOOF_TARGETARCH in
  394. x86) ARCHDIR='i386-linux-gnu' ;;
  395. x86_64) ARCHDIR='x86_64-linux-gnu' ;;
  396. esac
  397. ;;
  398. esac
  399. fi
  400. if [ "$WOOF_COMPATDISTRO" = "devuan" ];then
  401. case $WOOF_TARGETARCH in
  402. x86) ARCHDIR='i386-linux-gnu' ;;
  403. x86_64) ARCHDIR='x86_64-linux-gnu' ;;
  404. esac
  405. fi
  406. if [ "$WOOF_COMPATDISTRO" = "mageia" ];then #130111
  407. case $WOOF_TARGETARCH in
  408. x86) ARCHDIR='multiarch-i386-linux' ;;
  409. *) ARCHDIR=''; echo 'dunno'; exit ;;
  410. esac
  411. fi
  412. case $WOOF_TARGETARCH in
  413. arm)
  414. case $WOOF_COMPATDISTRO in #see file WOOFMERGEVARS
  415. raspbian) ARCHDIR='arm-linux-gnueabihf' ;; #different from debian/ubuntu, compiled for armv6 hf.
  416. debian)
  417. case $WOOF_COMPATVERSION in
  418. squeeze) true ;; #old release
  419. *) ARCHDIR='arm-linux-gnueabihf' ;;
  420. esac
  421. ;;
  422. devuan)
  423. ARCHDIR='arm-linux-gnueabihf'
  424. ;;
  425. ubuntu|trisquel)
  426. case $WOOF_COMPATVERSION in
  427. jaunty|karmic|lucid|dwyn|awen|taranis) true ;; #old releases.
  428. *) ARCHDIR='arm-linux-gnueabihf' ;;
  429. esac
  430. ;;
  431. esac
  432. ;;
  433. esac
  434. if [ "$ARCHDIR" ];then #ex: i386-linux-gnu
  435. ln -snf ./ sandbox3/rootfs-complete/lib${lsuffix}/${ARCHDIR}
  436. ln -snf ./ sandbox3/rootfs-complete/usr/lib${lsuffix}/${ARCHDIR}
  437. ln -snf ./ sandbox3/rootfs-complete/usr/bin/${ARCHDIR} #120909
  438. fi
  439. PKGLIST="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | cut -f 2 -d '|' | tr '\n' ' '`"
  440. for ONEPKG in $PKGLIST
  441. do
  442. if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG} ];then
  443. if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DEV ];then #pkg may go entirely into devx.
  444. if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DOC ];then #pkg may go entirely into docs.
  445. echo "WARNING, PKG DOES NOT EXIST: packages-${DISTRO_FILE_PREFIX}/${ONEPKG}"
  446. continue
  447. fi
  448. fi
  449. fi
  450. #110923 avoid conflict between busybox applets and full utilities...
  451. [ "$ONEPKG" == "busybox" ] && continue #see below.
  452. cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}/* sandbox3/rootfs-complete/ 2> /tmp/3builddistro-cp-errlog
  453. sync #110727 running drake pup 0.3 with k2.6.39-3 new laptop, mysterious loss of dirs/files. try sync.
  454. if [ -s /tmp/3builddistro-cp-errlog ];then #130430 next line fixes those quote chars...
  455. cat /tmp/3builddistro-cp-errlog | grep 'cannot overwrite non-directory' | tr '[`‘’]' "'" | cut -f 2 -d "'" |
  456. while read ONEDIRSYMLINK
  457. do
  458. xONEDIRSYMLINK="`echo -n "$ONEDIRSYMLINK" | sed -e 's%sandbox3/rootfs-complete%%'`"
  459. #adding that extra trailing / does the trick...
  460. cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}${xONEDIRSYMLINK}/* sandbox3/rootfs-complete${xONEDIRSYMLINK}/
  461. done
  462. fi
  463. #...now seems ok. note, there are two places in woof v003 where this problem occurs: /usr/lib/seamonkey
  464. # and /usr/share/cups/model.
  465. if [ -f sandbox3/rootfs-complete/pinstall.sh ];then
  466. #note, do not filter #! /bin/sh (with a space)...
  467. grep -E -v '^\#\!\/bin\/sh' sandbox3/rootfs-complete/pinstall.sh >> sandbox3/pinstall.sh
  468. rm -f sandbox3/rootfs-complete/pinstall.sh
  469. fi
  470. #get rid of a .specs file...
  471. rm -f sandbox3/rootfs-complete/*.specs
  472. #window and menu icons can also be in the top-level directory of the package...
  473. mv sandbox3/rootfs-complete/*24.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  474. mv sandbox3/rootfs-complete/*32.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  475. mv sandbox3/rootfs-complete/*32.png sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  476. mv sandbox3/rootfs-complete/*48.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  477. mv sandbox3/rootfs-complete/*48.png sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
  478. mv sandbox3/rootfs-complete/*.xpm sandbox3/rootfs-complete/usr/local/lib/X11/mini-icons/ 2>/dev/null
  479. mv sandbox3/rootfs-complete/*.png sandbox3/rootfs-complete/usr/local/lib/X11/mini-icons/ 2>/dev/null
  480. done
  481. #110923 fix busybox applets...
  482. 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.
  483. cp -a -f packages-${DISTRO_FILE_PREFIX}/busybox/bin/busybox ./sandbox3/rootfs-complete/bin/
  484. osPTN="s%packages-${DISTRO_FILE_PREFIX}/busybox%%"
  485. for ONEAPPLET in `find packages-${DISTRO_FILE_PREFIX}/busybox -type l | tr '\n' ' '`
  486. do
  487. ONESPEC="`echo -n "$ONEAPPLET" | sed -e "$osPTN"`"
  488. ONEPATH="`dirname $ONESPEC`"
  489. ONENAME="`basename $ONESPEC`"
  490. FNDFULL="`find ./sandbox3/rootfs-complete/bin ./sandbox3/rootfs-complete/sbin ./sandbox3/rootfs-complete/usr/bin ./sandbox3/rootfs-complete/usr/sbin -name ${ONENAME}`"
  491. #130129 deb 'bsdmainutils' has broken 'cal' and 'hd' symlinks... 130204 01micko: fix for spaces in names...
  492. if [ "$FNDFULL" ];then
  493. if [ -h "$FNDFULL" ];then
  494. FULLPATH="$(dirname "$FNDFULL")"
  495. FULLLINK="$(readlink "$FNDFULL")"
  496. xFULLLINK="${FULLPATH}/${FULLLINK}"
  497. [ "`echo -n "$FULLLINK" | cut -c 1`" = "/" ] && xFULLLINK="sandbox3/rootfs-complete${FULLLINK}"
  498. if [ ! -e "${xFULLLINK}" ];then
  499. rm -f "$FNDFULL" #130130
  500. FNDFULL=""
  501. fi
  502. fi
  503. fi
  504. #111004 need to check in devx also...
  505. if [ ! "$FNDFULL" ];then
  506. if [ "$ONENAME" != "[" ];then
  507. if [ "$ONENAME" != "[[" ];then
  508. oaPTN=" ${ONENAME} "
  509. FNDFULL="`echo -n "$DEVXUTILS" | grep "$oaPTN"`"
  510. fi
  511. fi
  512. fi
  513. if [ "$FNDFULL" ];then
  514. cp -a -f $ONEAPPLET ./sandbox3/rootfs-complete${ONEPATH}/${ONENAME}-BB-NOTUSED
  515. else
  516. cp -a -f $ONEAPPLET ./sandbox3/rootfs-complete${ONEPATH}/
  517. fi
  518. done
  519. [ -f packages-${DISTRO_FILE_PREFIX}/busybox/pinstall.sh ] && cat packages-${DISTRO_FILE_PREFIX}/busybox/pinstall.sh >> sandbox3/pinstall.sh
  520. [ -f /tmp/rootfs_pkgs_pinstall.sh ] && cat /tmp/rootfs_pkgs_pinstall.sh >> sandbox3/pinstall.sh
  521. echo 'echo "END OF pinstall.sh SCRIPT."' >> sandbox3/pinstall.sh
  522. chmod 755 sandbox3/pinstall.sh
  523. #pemasu start 131207
  524. echo "Removing extra documentation"
  525. for i in sandbox3/rootfs-complete/usr/share/doc/*; do
  526. if [ -d $i ]; then
  527. keep=0
  528. for j in legal pmusic pburn pbackup mtpaint help wvdial ffconvert cups nls puplogos notecase didiwiki; do #140128 added back legal, 01micko
  529. case `basename $i` in
  530. $j)
  531. keep=1
  532. break 1
  533. ;;
  534. esac
  535. done
  536. [ $keep -eq 0 ] && rm -rf $i
  537. fi
  538. done
  539. echo "Removing extra locales"
  540. for i in sandbox3/rootfs-complete/usr/share/locale/*; do
  541. if [ -d $i ]; then
  542. keep=0
  543. for j in en en_US locale.alias fi; do
  544. case `basename $i` in
  545. $j)
  546. keep=1
  547. break 1
  548. ;;
  549. esac
  550. done
  551. [ $keep -eq 0 ] && rm -rf $i
  552. fi
  553. done
  554. rm -rf sandbox3/rootfs-complete/usr/share/man/* 2>/dev/null
  555. rm -rf sandbox3/rootfs-complete/usr/share/info/* 2>/dev/null
  556. rm -rf sandbox3/rootfs-complete/usr/share/cups/doc-root/help/* 2>/dev/null
  557. #pemasu end
  558. #140617 copy new init
  559. echo "Replacing /etc/rc.d/rc.sysinit"
  560. [ -d ./huge_extras ] && cp -af ./huge_extras/rc.sysinit sandbox3/rootfs-complete/etc/rc.d/ || exit 1
  561. # new wallpaper maker
  562. # test if exec exists
  563. which mkwallpaper 2>&1 > /dev/null # must be on the system
  564. retwall=$?
  565. if [ $retwall -eq 0 ];then
  566. echo "Do you want to build some custom wallpapers?"
  567. echo "Press 'w' to accept or ENTER to keep going without custom wallpapers."
  568. read customwalls
  569. if [ "$customwalls" = "w" ];then
  570. mkwallpaper | grep -wq '\-k' && opt='-kyes' || opt=''
  571. cd sandbox3/rootfs-complete
  572. . etc/DISTRO_SPECS
  573. for e in 1 2 3 4 5 6 7 8; do
  574. case $e in
  575. 1)color='0.2 0.2 0.2' ;; #dark grey
  576. 2)color='0.70 0.30 0.40' ;; #raspberry
  577. 3)color='0.00 0.75 0.75' ;; #teale
  578. 4)color='0.2 0.7 0.1' ;; #green
  579. 5)color='0.55 0.25 0.60' ;; #purply violet
  580. 6)color='0.1 0.1 0.8' ;; #darkish blue
  581. 7)color='0.73 0.55 0.52' ;; #salmon
  582. 8)color='0.6 0.7 0.8' ;; #light blue
  583. esac
  584. mkwallpaper -n ${DISTRO_FILE_PREFIX}-wall${e} -l "$DISTRO_FILE_PREFIX" -x1024 -y768 -z "$color" ${opt} -w woof
  585. done
  586. cd -
  587. fi
  588. fi
  589. echo
  590. #run post-install script...
  591. echo
  592. echo "Executing sandbox3/pinstall.sh post-install script..."
  593. cd $WKGDIR/sandbox3/rootfs-complete
  594. SAVEWKGDIR="$WKGDIR"
  595. $WKGDIR/sandbox3/pinstall.sh
  596. echo "Now setting /etc/os-release file"
  597. mk_os_release() {
  598. if [ "$1" ];then
  599. dir=etc
  600. else
  601. dir=/etc
  602. fi
  603. . $dir/DISTRO_SPECS
  604. cat > ${dir}/os-release << _EOF
  605. NAME=Puppy
  606. VERSION="$DISTRO_VERSION"
  607. ID=puppy_$DISTRO_FILE_PREFIX
  608. VERSION_ID=$DISTRO_VERSION
  609. PRETTY_NAME="$DISTRO_NAME $DISTRO_VERSION"
  610. ANSI_COLOR="0;34"
  611. CPE_NAME="cpe:/o:puppy:puppy_linux:$DISTRO_VERSION"
  612. HOME_URL="http://puppylinux.com/"
  613. SUPPORT_URL="http://www.murga-linux.com/puppy/index.php"
  614. BUG_REPORT_URL="https://github.com/puppylinux-woof-CE/woof-CE"
  615. _EOF
  616. }
  617. mk_os_release ok
  618. echo "If you did not get 'End of pinstall.sh' message above, then"
  619. echo -n "it aborted before completion. Press ENTER or CTRL-C: "
  620. read isitbad
  621. WKGDIR="$SAVEWKGDIR"
  622. cd $WKGDIR
  623. #100316 script to handle improper shutdown, full hd install...
  624. if [ -f sandbox3/rootfs-complete/sbin/initNEW ];then
  625. rm -f sandbox3/rootfs-complete/sbin/init #a busybox link.
  626. mv -f sandbox3/rootfs-complete/sbin/initNEW sandbox3/rootfs-complete/sbin/init
  627. fi
  628. #now do dependency check...
  629. dependcheck() {
  630. echo -n "" > /tmp/missinglibs.txt
  631. echo -n "" > /tmp/notmissinglibs0.txt
  632. echo -n "" > /tmp/notusedlibs.txt
  633. #FNDFILES="`find $WKGDIR/sandbox3/rootfs-complete -type f | tr "\n" " "`"
  634. #for ONEFILE in $FNDFILES
  635. find $WKGDIR/sandbox3/rootfs-complete -type f | #110516
  636. while read ONEFILE #110516
  637. do
  638. echo -n '.'
  639. ISANEXEC="`file --brief $ONEFILE | grep -E "LSB executable|shared object"`"
  640. if [ ! "$ISANEXEC" = "" ];then
  641. #need to chroot into rootfs-complete...
  642. NUMBYTESALL="`echo -n "$ONEFILE" | wc -c | tr -s " " | cut -f 2 -d " "`"
  643. NUMBYTESHD=`echo -n "$WKGDIR/sandbox3/rootfs-complete" | wc -c | tr -s " " | cut -f 2 -d " "`
  644. NUMBYTESHD="`expr $NUMBYTESHD + 1`"
  645. NEWROOTFILE="`echo -n "$ONEFILE" | cut -b $NUMBYTESHD-$NUMBYTESALL`"
  646. LDDRESULT="`chroot ${WKGDIR}/sandbox3/rootfs-complete ldd ${NEWROOTFILE}`"
  647. MISSINGLIBS="`echo "$LDDRESULT" | grep "not found" | cut -f 2 | cut -f 1 -d " " | tr "\n" " "`"
  648. if [ ! "$MISSINGLIBS" = "" ];then
  649. echo "File $ONEFILE has these missing library files:" >> /tmp/missinglibs.txt
  650. echo " $MISSINGLIBS" >> /tmp/missinglibs.txt
  651. echo "The missing libs are in these packages:" >> /tmp/missinglibs.txt
  652. for ONEMISSING in $MISSINGLIBS
  653. do
  654. find ${WKGDIR}/packages-${DISTRO_FILE_PREFIX} -name $ONEMISSING >> /tmp/missinglibs.txt
  655. done
  656. fi
  657. #find all libs not missing...
  658. NOTMISSING="`file --brief $ONEFILE | grep -v "not found" | grep "shared object"`"
  659. if [ "$NOTMISSING" != "" ];then
  660. basename "$ONEFILE" >> /tmp/notmissinglibs0.txt
  661. fi
  662. fi
  663. done
  664. sync
  665. sort -u /tmp/notmissinglibs0.txt > /tmp/notmissinglibs.txt
  666. #now go thru rootfs-complete and see if any unused libs...
  667. #FNDFILES="`find $WKGDIR/sandbox3/rootfs-complete -type f | tr "\n" " "`"
  668. #for ONEFILE in $FNDFILES
  669. find $WKGDIR/sandbox3/rootfs-complete -type f | #110516
  670. while read ONEFILE #110516
  671. do
  672. ISANLIB="`file --brief $ONEFILE | grep "shared object"`"
  673. if [ ! "$ISANLIB" = "" ];then
  674. FILEBASE='/'"`basename $ONEFILE`"'$'
  675. FNDMATCH="`cat /tmp/notmissinglibs.txt | grep "$FILEBASE"`"
  676. if [ "$FNDMATCH" = "" ];then
  677. echo "File $ONEFILE is in Puppy but is not used." >> /tmp/notusedlibs.txt
  678. fi
  679. fi
  680. done
  681. }
  682. echo
  683. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  684. echo "This script can now optionally do a thorough dependency check. "
  685. echo "Note, this may take a long time."
  686. echo -e "Press \"c\" key then ENTER to do thorough check,"
  687. echo -n "else just press ENTER key to bypass check: "
  688. read mmnn
  689. else
  690. echo "Normally, the script now offers to perform a thorough dependency check."
  691. echo "However, as the host and target architectures are different, this cannot"
  692. echo "be done (host=${WOOF_HOSTARCH}, target=${WOOF_TARGETARCH})."
  693. echo "If you want to do this check, do a build with host and target the same,"
  694. echo "with same package selection."
  695. echo -n "Press ENTER key to continue: "
  696. read mmnn
  697. mmnn=""
  698. fi
  699. echo
  700. if [ "$mmnn" = "c" ];then
  701. echo "Wait awhile..."
  702. dependcheck
  703. if [ -s /tmp/missinglibs.txt ];then #true if file not zero size.
  704. echo
  705. echo "UNFORTUNATELY, these libs are missing:"
  706. cat /tmp/missinglibs.txt
  707. echo
  708. echo -e "Press \"c\" key then ENTER key to exit,"
  709. echo -n "or if you really want to ignore problem, just press ENTER: "
  710. read goto1
  711. fi
  712. [ "$goto1" = "c" ] && exit
  713. if [ -s /tmp/notusedlibs.txt ];then
  714. echo
  715. echo "INTERESTING, the following libs are in Puppy but apparently not used:"
  716. cat /tmp/notusedlibs.txt
  717. echo
  718. echo -e "Press \"c\" key then ENTER key to exit,"
  719. echo -n "or if you really want to ignore problem, just press ENTER: "
  720. read goto1
  721. fi
  722. [ "$goto1" = "c" ] && exit
  723. fi
  724. echo "...done."
  725. # new profile script fixup
  726. support/mk_profile
  727. cd sandbox3
  728. #150624 put this back
  729. #100603 i'm now putting common kernel files in here...
  730. cp -a -f ../kernel-skeleton/* rootfs-complete/
  731. #110918 kernel-skeleton now has a pinstall.sh script... 131207 revert ..131212 revert, revert!
  732. cd rootfs-complete
  733. ./pinstall.sh
  734. sync
  735. rm -f ./pinstall.sh
  736. cd ..
  737. mv -f rootfs-complete/etc/modules/firmware.dep rootfs-complete/etc/modules/firmware.dep.${KERNELVER}
  738. sync
  739. #now do the kernel...
  740. #140615
  741. echo
  742. rm -rf build 2>/dev/null
  743. mkdir build
  744. echo "Installing HUGE kernel"
  745. sleep 1
  746. # see if there is one in kernel-kit
  747. if [ -d '../kernel-kit/dist' ];then
  748. KIT_KERNEL=`find ../kernel-kit/dist/packages -type f -name 'huge*.tar.bz2' -maxdepth 1|head -n1`
  749. [ -z "$KIT_KERNEL" ] || cp $KIT_KERNEL ../huge_kernel/
  750. fi
  751. # install huge kernel to build 140617
  752. IS_KERNEL=`ls ../huge_kernel|wc -l`
  753. download_kernel() {
  754. TMP=/tmp/kernels$$
  755. TMP2=/tmp/kernels2$$
  756. wget ${REPO_URL} -O $TMP
  757. # grok out what kernels are available
  758. c=1
  759. cat $TMP|tr '>' ' '|tr '<' ' '|tr ' ' '\n'|grep -v 'md5'|grep -v 'kernels'|grep 'huge'|grep -v 'href'|\
  760. while read q;do
  761. echo "$c $q" >> $TMP2
  762. c=$(($c + 1))
  763. done
  764. while [ 1 ];do
  765. echo "Please choose the number of the kernel you wish to download"
  766. cat $TMP2
  767. read choice_k
  768. choice=`grep ^$choice_k $TMP2`
  769. [ ! "$choice" ] && echo "invalid choice" && continue
  770. echo "You chose ${choice##* }. Hit ENTER to continue"
  771. read
  772. break
  773. done
  774. wget -t0 -c $REPO_URL/${choice##* } -P ../huge_kernel
  775. wget $REPO_URL/${choice##* }.md5.txt -P ../huge_kernel
  776. CHK=`md5sum ../huge_kernel/${choice##* }|cut -d ' ' -f1`
  777. MD5=`cat ../huge_kernel/${choice##* }.md5.txt|cut -d ' ' -f1`
  778. [ "$CHK" != "$MD5" ] && "checksum failed" && exit 1
  779. echo "Checksum passed"
  780. rm ../huge_kernel/${choice##* }.md5.txt
  781. rm $TMP
  782. rm $TMP2
  783. }
  784. [ "$IS_KERNEL" = 0 ] && download_kernel #no kernel, get 1
  785. choose_kernel() {
  786. TMP=/tmp/kernels3$$
  787. x=1
  788. for j in `ls -1 ../huge_kernel|grep -v 'md5'`;do
  789. echo "$x $j" >> $TMP
  790. x=$(($x + 1))
  791. done
  792. while [ 1 ];do
  793. echo "Please choose the number of the kernel you wish to use"
  794. cat $TMP
  795. read choice_k3
  796. choice3=`grep ^$choice_k3 $TMP`
  797. [ ! "$choice3" ] && echo "invalid choice3" && continue
  798. echo "You chose ${choice3##* }. Hit ENTER to continue"
  799. read
  800. break
  801. done
  802. KERNEL_VERSION=`echo ${choice3##* } |cut -d '-' -f2-|rev|cut -d '.' -f3-|rev`
  803. rm $TMP
  804. }
  805. unset IS_KERNEL
  806. IS_KERNEL=`ls ../huge_kernel|wc -l`
  807. [ "$IS_KERNEL" -gt 1 ] && choose_kernel #too many, choose 1
  808. [ "$IS_KERNEL" == 1 ] && KERNEL_VERSION=`ls ../huge_kernel|grep -v 'md5'|cut -d '-' -f2-|rev|cut -d '.' -f3-|rev`
  809. echo "Kernel is $KERNEL_VERSION version"
  810. cp -a ../huge_kernel/huge-${KERNEL_VERSION}.tar.* build/
  811. cd build
  812. tar -xvf huge-${KERNEL_VERSION}.tar.*
  813. [ "$?" = 0 ] || exit 1
  814. rm -f huge-${KERNEL_VERSION}.tar.* #remove pkg
  815. mv -f kernel-modules.sfs-$KERNEL_VERSION $ZDRVSFS
  816. mv -f vmlinuz-$KERNEL_VERSION vmlinuz
  817. cd ..
  818. #end 140617
  819. #120613 kernel image can have different names. rename to vmlinuz, however change back later if build sd card...
  820. REALKERNAME='vmlinuz'
  821. [ -f rootfs-complete/boot/vmlinuz ] && cp rootfs-complete/boot/vmlinuz build/
  822. if [ -f rootfs-complete/boot/uImage ];then #mele a1000
  823. cp rootfs-complete/boot/uImage build/vmlinuz #120506 arm builds, using different name for kernel.
  824. REALKERNAME='uImage'
  825. fi
  826. if [ -f rootfs-complete/boot/kernel.img ];then #raspberry pi
  827. cp rootfs-complete/boot/kernel.img build/vmlinuz
  828. REALKERNAME='kernel.img'
  829. fi
  830. [ -f rootfs-complete/boot/System.map ] && cp rootfs-complete/boot/System.map ./
  831. sync
  832. rm -rf rootfs-complete/boot 2 > /dev/null
  833. #100911 16-byte id-string appended. init can determine boot partition.
  834. cd build
  835. for pfile in vmlinuz *.sfs ; do
  836. echo -n "$IDSTRING" >> $pfile
  837. echo "Appending IDSTRING : $IDSTRING to $pfile"
  838. done
  839. echo
  840. cd -
  841. #110722 need this, to put into woof-installed-packages...
  842. #KERNEL_DB_ENTRY="`cat rootfs-complete/pet.specs`"
  843. #rm -f rootfs-complete/pet.specs
  844. #arch .INSTALL files
  845. #130316 NOTE: maybe could do this without chroot, as for slackware in 2createpackages (see 2createpackages-hack-install.sh).
  846. # ok, I have looked through all pkgs used in build, most .INSTALL are trivial. these are slight exceptions:
  847. # cmake glibc_dev_DEV libglade2 libwmf man_DEV openldap perl_DEV subversion_DEV
  848. # but, don't really need to execute those either. besides, the code below is only operating upon rootfs-complete, it would be better
  849. # to aufs mount the devx, as is done in sandbox2b in 2createpackages. comment out all of below...
  850. if [ "${DISTRO_BINARY_COMPAT}" = "arch" ]; then
  851. rm -f rootfs-complete/.INSTALL*
  852. # numberOfDotInstall=1
  853. # for FOLDER in `ls -1 ${WKGDIR}/packages-${DISTRO_FILE_PREFIX} | tr '\n' ' '` #130307
  854. # do
  855. # [ ! -f ${WKGDIR}/packages-${DISTRO_FILE_PREFIX}/${FOLDER}/.INSTALL ] && continue
  856. # PKGVER="`grep -e '^pkgver' "${WKGDIR}/packages-${DISTRO_FILE_PREFIX}/${FOLDER}/.PKGINFO" | sed 's/^pkgver\ =\ //' | sed 's/-[^-]//'`"
  857. # cp ${WKGDIR}/packages-${DISTRO_FILE_PREFIX}/${FOLDER}/.INSTALL "rootfs-complete/.INSTALL${numberOfDotInstall}-${PKGVER}"
  858. # let numberOfDotInstall++
  859. # done
  860. # if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #130316
  861. # cp ${WKGDIR}/support/arch/runDotInstalls rootfs-complete/
  862. # chroot "${PWD}/rootfs-complete" "/runDotInstalls" &> /dev/null
  863. # rm -f rootfs-complete/runDotInstalls
  864. # else
  865. # echo "Unfortunately, cannot execute Arch install scripts, as this is a cross-build."
  866. # fi
  867. # rm -f rootfs-complete/.INSTALL*
  868. fi
  869. #130314 want to run arch post-install script from ppm also...
  870. mkdir -p rootfs-complete/usr/local/petget
  871. cp ${WKGDIR}/support/arch/runDotInstalls rootfs-complete/usr/local/petget/ArchRunDotInstalls
  872. chmod 755 rootfs-complete/usr/local/petget/ArchRunDotInstalls
  873. #build the initrd-tree...
  874. echo
  875. echo "Now building initial ramdisk in initrd-tree/..."
  876. rm -rf initrd-tree
  877. cp -a ../boot/initrd-tree0 ./initrd-tree
  878. cp ../DISTRO_SPECS ./initrd-tree/
  879. #091121 want to load keyboard layout in initrd... (note, init script copies them back at bootup)
  880. #120521 no, do not move, copy only, in situation where building for SD image (that has no initrd)...
  881. if [ "$SDFLAG" != "" ];then
  882. #not actually using an initrd, but let's keep the initrd functional...
  883. cp -a -f rootfs-complete/lib/keymaps initrd-tree/lib/
  884. cp -a -f rootfs-complete/lib/consolefonts initrd-tree/lib/
  885. else
  886. mv -f rootfs-complete/lib/keymaps initrd-tree/lib/
  887. mv -f rootfs-complete/lib/consolefonts initrd-tree/lib/
  888. fi
  889. sync
  890. #101027 Iguleder reported DISTRO_SPECS did not have a carriage-return on last line...
  891. xDISTROSPECS="`cat initrd-tree/DISTRO_SPECS`"
  892. echo "$xDISTROSPECS" > initrd-tree/DISTRO_SPECS
  893. echo "$xDISTROSPECS" > rootfs-complete/etc/DISTRO_SPECS
  894. #100911
  895. NEWVARIABLES="#32-byte alpha-numeric ID-string appended to vmlinuz, ${PUPPYSFS}, ${ZDRVSFS} and devx.sfs:
  896. DISTRO_IDSTRING='${IDSTRING}'
  897. #Puppy default filenames...
  898. #Note, the 'SFS' files below are what the 'init' script in initrd.gz searches for,
  899. #for the partition, path and actual files loaded, see PUPSFS and ZDRV in /etc/rc.d/PUPSTATE
  900. DISTRO_PUPPYSFS='${PUPPYSFS}'
  901. DISTRO_ZDRVSFS='${ZDRVSFS}'
  902. DISTRO_ADRVSFS='${ADRVSFS}'
  903. DISTRO_YDRVSFS='${YDRVSFS}'"
  904. #DISTRO_DEVXSFS='${DEVXSFS}'"
  905. echo "$NEWVARIABLES" >> initrd-tree/DISTRO_SPECS
  906. echo "$NEWVARIABLES" >> rootfs-complete/etc/DISTRO_SPECS
  907. sync
  908. #120225 this is read by /usr/share/doc/convert-raw-docs...
  909. DISTRO_PUPPYDATE="`date | tr -s " " | cut -f 2,6 -d " "`"
  910. echo "DISTRO_PUPPYDATE='${DISTRO_PUPPYDATE}'" >> rootfs-complete/etc/DISTRO_SPECS
  911. echo "DISTRO_PUPPYDATE='${DISTRO_PUPPYDATE}'" >> initrd-tree/DISTRO_SPECS
  912. #120215 language translations for init script...
  913. INITRDTRANSFILES="`find ../rootfs-skeleton/usr/share/sss/initrd_strings -mindepth 1 -maxdepth 1 -type f -name 'initrd_strings.*'`"
  914. if [ "$INITRDTRANSFILES" ];then
  915. for ATRANS in $INITRDTRANSFILES
  916. do
  917. ENDBIT="`echo -n "$ATRANS" | rev | cut -f 1 -d '.' | rev`" #ex: de (from initrd_strings.de)
  918. mkdir -p initrd-tree/locale/${ENDBIT}
  919. #only supporting translating the init script for now...
  920. sPTN="/^\[init\]/,/^$/p" #this is a multi-line block find expression.
  921. CODEBLOCK="`sed -n "$sPTN" ${ATRANS} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`" #extracts just the relevant block of lines.
  922. [ ! "$CODEBLOCK" ] && continue #precaution.
  923. echo "$CODEBLOCK" > initrd-tree/locale/${ENDBIT}/init #translation file, read by /init script in initrd.
  924. done
  925. fi
  926. #120216 set default LANG and KMAP... 120401 improve...
  927. echo
  928. echo
  929. echo "Puppy is built with a default locale LANG=en_US and keyboard layout KMAP=us,
  930. which may be changed after bootup.
  931. However, if you are building a language-specific Puppy, you may change the
  932. defaults now. But, please do make sure that your Puppy has a 'langpack' PET
  933. for your language installed -- if one does not exist, then you will have to
  934. create one -- see MoManager in the Utility menu, also read the Menu -> Help
  935. -> HOWTO Internationalization."
  936. echo
  937. echo "These are the available LANG values (in /usr/share/i18n/locales):
  938. 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"
  939. 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."
  940. echo "(the default is en_US.UTF-8)"
  941. echo -n "ENTER only for default, or type it now: "
  942. read DEFAULTLANG
  943. if [ "$DEFAULTLANG" ];then
  944. echo "...ok, set to ${DEFAULTLANG}"
  945. DEFAULTLANG1="${DEFAULTLANG%_*}"
  946. if [ "$DEFAULTLANG1" != "en" ];then
  947. echo -n "$DEFAULTLANG" > initrd-tree/PUPPYLANG
  948. echo
  949. echo "These are the available keyboard layout values (in /lib/keymaps):
  950. 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"
  951. 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."
  952. echo -n "Enter only for 'us', else type one of the above: "
  953. read DEFAULTKMAP
  954. [ "$DEFAULTKMAP" != "" ] && [ "$DEFAULTKMAP" != "us" ] && echo -n "$DEFAULTKMAP" > initrd-tree/PUPPYKEYMAP
  955. [ "$DEFAULTKMAP" = "" ] && DEFAULTKMAP="us"
  956. echo "...ok, set to ${DEFAULTKMAP}"
  957. fi
  958. else
  959. DEFAULTLANG="en_US.UTF-8" #121123
  960. echo "...ok, set to ${DEFAULTLANG}"
  961. fi
  962. #i think also, set LANG in /etc/profile...
  963. sed -i -e "s%^LANG=.*%LANG=${DEFAULTLANG}%" rootfs-complete/etc/profile
  964. echo
  965. #130515
  966. echo
  967. #140617 copy new init
  968. echo "Replacing init"
  969. [ -d ../huge_extras ] && cp -af ../huge_extras/init initrd-tree/
  970. # will remove this soon
  971. sed -i -e 's%^PUPDESKFLG=.*%PUPDESKFLG=0%' initrd-tree/init
  972. # james has default as devtmpfs so we need udev >= 176
  973. #130618 check udev version... 130710 01micko: fix...
  974. #130612 if kernel has CONFIG_DEVTMPFS=y (and CONFIG_DEVTMPFS_MOUNT=y) then empty /dev...
  975. #DEVTMPFSFLG=0
  976. #if [ "`grep 'CONFIG_DEVTMPFS.*=y' rootfs-complete/etc/modules/DOTconfig*`" != "" ];then
  977. #UDEV3=`grep -E '^udev[_-][0-9]' ../woof-installed-packages | cut -f 3 -d '|' | cut -c 1-3 | head -n 1`
  978. #[ ! $UDEV3 ] && UDEV3=200 #eudev
  979. #if [ $UDEV3 -ge 176 ];then #175 is last version that creates device nodes.
  980. ##modify 'init' script in initrd...
  981. #sed -i -e 's%^DEVTMPFSFLG=.*%DEVTMPFSFLG=2%' initrd-tree/init
  982. #DEVTMPFSFLG=2 #see further down.
  983. #fi
  984. #fi
  985. #sync
  986. #build build/initrd.gz...
  987. cp -f ../boot/makecpioinitrd ./
  988. cp -f ../boot/cpio ./
  989. ./makecpioinitrd
  990. sync
  991. mv -f initrd.gz build/
  992. #offer to cutdown the modules, to build a smaller live-cd...
  993. rm -rf zdrv 2>/dev/null #note, current dir is in sandbox3.
  994. rm -f ${ZDRVSFS} #100911 zdrv.sfs
  995. ##091125 offer to cutdown fonts...
  996. #echo
  997. #echo "Would you like to cutdown the bitmap fonts in usr/share/X11/fonts/misc"
  998. #echo "to the barest minimum? The bitmap fonts were used in older xlib apps"
  999. #echo "(not gtk or qt) and some cli (non-X) apps. Okay to answer yes if want"
  1000. #echo "to build a small iso. Saving about 1.5MB uncompressed."
  1001. #echo -n "Hit ENTER only to cutdown 'misc' fonts: "
  1002. #read cutdownmisc
  1003. #if [ "$cutdownmisc" = "" ];then
  1004. # 7x14B-ISO8859-1.pcf
  1005. # 7x14-ISO8859-1.pcf #default for xlib, set in root/.Xresources
  1006. # cursor.pcf
  1007. # 8x16.pcf #used by yaf-splash, ex usr/sbin/pmount
  1008. # 9x15B-ISO8859-1.pcf #used by yaf-splash in usr/sbin/delayedrun, sbin/pup_event_frontend_d
  1009. # symb12.pcf #used by xcalc, see etc/X11/app-defaults/Xcalc
  1010. # helvB12-ISO8859-1.pcf #used by Xclipboard
  1011. # courR12-ISO8859-1.pcf # "
  1012. # helvR24-ISO8859-1.pcf #used by Xlock
  1013. # courB12-ISO8859-1.pcf #'fixed' font that some xlib apps use.
  1014. # helvR12-ISO8859-1.pcf #'variable' font that some xlib apps use.
  1015. #
  1016. #fi
  1017. #100622 slackware 13.1: just in case any got through, remove c-shell scripts...
  1018. rm -f rootfs-complete/etc/profile.d/*.csh* 2>/dev/null
  1019. #sanity check...
  1020. echo
  1021. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1022. chroot rootfs-complete echo 'testing chroot'
  1023. if [ $? -ne 0 ];then
  1024. echo "ERROR: could not 'chroot' into sandbox3/rootfs-complete"
  1025. echo "This means that something is incomplete, perhaps a library"
  1026. echo "needed by bash. Check it out. Have to exit script now."
  1027. exit
  1028. fi
  1029. else
  1030. echo "Normally, the script now does a sanity-test by chrooting into"
  1031. echo "sandbox3/rootfs-complete, however as you are doing a cross-build, this"
  1032. echo "cannot be done."
  1033. fi
  1034. #before building puppy.sfs from rootfs-complete, check for any invalid symlinks
  1035. #and move them to the devx...
  1036. echo
  1037. echo "Finding invalid symlinks..."
  1038. rm -rf devx
  1039. mkdir devx
  1040. #v431 aaargh, latest pburn (3.1.1) has a symlink with spaces in name...
  1041. #for ONESYMLINK in `find rootfs-complete/ -type l`
  1042. find rootfs-complete/ -type l |
  1043. while read ONESYMLINK
  1044. do
  1045. [ "`echo -n "$ONESYMLINK" | grep '/dev/'`" != "" ] && continue
  1046. [ "`echo -n "$ONESYMLINK" | grep '/proc/'`" != "" ] && continue
  1047. xONESYMLINK="`echo -n "$ONESYMLINK" | sed -e 's/^rootfs\-complete//'`"
  1048. #w018 some symlinks become valid after puppy 1st boot...
  1049. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1050. LINKTO="`chroot rootfs-complete readlink "$xONESYMLINK"`"
  1051. [ "`echo -n "$LINKTO" | grep 'lib/X11/pixmaps'`" != "" ] && continue #these images created 1st boot.
  1052. if [ "`chroot rootfs-complete readlink -e "$xONESYMLINK"`" = "" ];then
  1053. UPONE="`dirname "$xONESYMLINK"`"
  1054. mkdir -p devx${UPONE}
  1055. cp -a -f "$ONESYMLINK" devx${UPONE}/
  1056. rm -f "$ONESYMLINK"
  1057. fi
  1058. else
  1059. #do it without chroot...
  1060. LINKTO="`readlink rootfs-complete"${xONESYMLINK}"`" #120502 fix for spaces in path.
  1061. [ -e rootfs-complete${LINKTO} ] && continue #absolute path
  1062. UPONE="`dirname "$xONESYMLINK"`"
  1063. [ -e rootfs-complete${UPONE}/${LINKTO} ] && continue #relative path
  1064. mkdir -p devx${UPONE}
  1065. cp -a -f "$ONESYMLINK" devx${UPONE}/
  1066. rm -f "$ONESYMLINK"
  1067. fi
  1068. done
  1069. sync
  1070. #get info about the ubuntu pkgs...
  1071. echo "Updating pkg data in rootfs-complete/root/.packages ..."
  1072. #copy them into the live-cd also...
  1073. #in case of Ppup4, PKGLISTS_COMPAT='Packages-puppy-4xx-official'
  1074. for ONELIST in $PKGLISTS_COMPAT
  1075. do
  1076. cp -f ../$ONELIST ./
  1077. cp -f ../$ONELIST rootfs-complete/root/.packages/
  1078. done
  1079. for ONELIST in $PACKAGELISTS_PET_ORDER #120506
  1080. do
  1081. cp -f ../$ONELIST ./
  1082. cp -f ../$ONELIST rootfs-complete/root/.packages/
  1083. done
  1084. #note, Ppup4, findwoofinstalledpkgs.sh (below) needs above file, then deletes it.
  1085. #also copy the pet package databases...
  1086. cp -f ../Packages-puppy-[0-9]-official rootfs-complete/root/.packages/ 2>/dev/null
  1087. cp -f ../Packages-puppy-common-official rootfs-complete/root/.packages/ 2>/dev/null #110608
  1088. #cp -f ../Packages-puppy-wary5-official rootfs-complete/root/.packages/
  1089. cp -f ../Packages-puppy-noarch-official rootfs-complete/root/.packages/ #120305
  1090. #121102
  1091. if [ -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official ];then #110723 ex: Packages-puppy-drake-official
  1092. cp -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official rootfs-complete/root/.packages/
  1093. cp -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official ./
  1094. #120506...
  1095. ../support/rationalize_categories Packages-puppy-${DISTRO_DB_SUBNAME}-official
  1096. cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-${DISTRO_DB_SUBNAME}-official
  1097. fi
  1098. #101014 rationalise categories... 110726 must *always* copy Packages-puppy-wary5-official (it is going to be the fallback)...
  1099. #if [ "$DISTRO_COMPAT_VERSION" = "wary5" ];then #101025
  1100. if [ -f Packages-puppy-wary5-official ];then
  1101. ../support/rationalize_categories Packages-puppy-wary5-official
  1102. cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-wary5-official
  1103. fi
  1104. #fi
  1105. #also copy this...
  1106. cp -f ../PKGS_MANAGEMENT rootfs-complete/root/.packages/
  1107. #477 a puppy-puppy build will not have any compat-distro databases...
  1108. petcntlimit=3
  1109. COMPATDISTRO_DB_FILES="`ls -1 rootfs-complete/root/.packages/Packages-[^p]* 2>/dev/null`"
  1110. [ "$COMPATDISTRO_DB_FILES" = "" ] && petcntlimit=5
  1111. #w476 swap to make sure 3 pet repos get chosen...
  1112. enabledrepos=" "
  1113. #100207 now using the quirky pet repo for all puppy builds...
  1114. [ -f ../Packages-puppy-quirky-official ] && cp -f ../Packages-puppy-quirky-official rootfs-complete/root/.packages/
  1115. #100730 DISTRO_COMPAT_VERSION for puppy builds no longer limited to a number 1-5 (ex: wary5)
  1116. fNUM1=`echo -n "$DISTRO_COMPAT_VERSION" | wc -c`
  1117. #100116 quirky, want the quirky db first in list... 101126 no, now building quirky from wary5 pkgs...
  1118. #if [ "`echo "$DISTRO_NAME" | grep -i 'quirky'`" != "" ];then
  1119. # enabledrepos="Packages-puppy-quirky-official Packages-puppy-4-official Packages-puppy-3-official "
  1120. # #cp -f ../Packages-puppy-quirky-official rootfs-complete/root/.packages/
  1121. #else
  1122. repocnt=1
  1123. case $DISTRO_FILE_PREFIX in #110906 fix. $DISTRO_COMPAT_VERSION in #100911
  1124. lucid|lupu|luci) #110906 fix. 120305 120312
  1125. enabledrepos="Packages-puppy-lucid-official Packages-puppy-noarch-official "
  1126. ;;
  1127. wary|racy) #110906 110917 120305 120312 121105
  1128. enabledrepos="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-quirky-official Packages-puppy-noarch-official Packages-puppy-4-official " #110824 added -common-
  1129. ;;
  1130. slacko) #110824 120305 120312 121105
  1131. enabledrepos="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official "
  1132. ;;
  1133. dpup|sqzd) #110824 110906 120305 120312
  1134. enabledrepos="Packages-puppy-dpup-official Packages-puppy-noarch-official "
  1135. ;;
  1136. *)
  1137. #add the puppy repos... (i want 5, 4, 3)...
  1138. for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-puppy* | sort -r`
  1139. do
  1140. [ $repocnt -gt $petcntlimit ] && break #limit of 3 puppy repos.
  1141. BASEREPO="`basename $ONEREPO`"
  1142. [ "$BASEREPO" = "Packages-puppy-wary5-official" ] && continue #100911 handled above.
  1143. [ "$BASEREPO" = "Packages-puppy-lucid-official" ] && continue #100911 handled above.
  1144. [ "$BASEREPO" = "Packages-puppy-slacko-official" ] && continue #110824 handled above.
  1145. #w478 a problem if building an old puppy-puppy, don't want more recent db's... 100730...
  1146. if [ "$DISTRO_BINARY_COMPAT" = "puppy" ];then
  1147. ONEREPNUM=`echo -n "$BASEREPO" | cut -f 3 -d '-'`
  1148. fNUM2=`echo -n "$ONEREPNUM" | wc -c`
  1149. #[ "`echo -n "$ONEREPNUM" | grep '[a-z]'`" != "" ] && continue
  1150. [ $fNUM1 -eq 1 ] && [ $fNUM2 -eq 1 ] && [ $ONEREPNUM -gt $DISTRO_COMPAT_VERSION 2>/dev/null ] && continue
  1151. fi
  1152. # #w019 have decided don't want this showing up in PPM...
  1153. # [ "$BASEREPO" = "Packages-puppy-woof-official" ] && continue
  1154. enabledrepos="${enabledrepos}${BASEREPO} "
  1155. repocnt=`expr $repocnt + 1`
  1156. done
  1157. ;;
  1158. esac
  1159. #add compat-distro repos...
  1160. if [ "$COMPATDISTRO_DB_FILES" != "" ];then
  1161. for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-[^p]*`
  1162. do
  1163. [ $repocnt -gt 5 ] && break #only allow 5 active repos in PPM.
  1164. BASEREPO="`basename $ONEREPO`"
  1165. enabledrepos="${enabledrepos}${BASEREPO} "
  1166. repocnt=`expr $repocnt + 1`
  1167. done
  1168. fi
  1169. #fi
  1170. #120831 above code ok, but really just want these...
  1171. case $DISTRO_BINARY_COMPAT in
  1172. ubuntu|trisquel)
  1173. xPUPPYREPOS="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official" #Packages-puppy-common-official
  1174. xCOMPATREPOS="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-universe$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
  1175. #130330 would like universe first...
  1176. xCOMPATREPOS1="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-universe$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
  1177. xCOMPATREPOS2="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
  1178. enabledrepos=" ${xCOMPATREPOS1} ${xCOMPATREPOS2} ${xPUPPYREPOS} "
  1179. ;;
  1180. esac
  1181. echo "PKG_REPOS_ENABLED='${enabledrepos}'" >> rootfs-complete/root/.packages/PKGS_MANAGEMENT
  1182. if [ -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then #w478
  1183. cp -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
  1184. else
  1185. cp -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
  1186. fi
  1187. #101013 remove wrong alternate choice (old/new kernel optional pkgs)...
  1188. if [ -f /tmp/3builddistro_removed_alt ];then
  1189. for ONEREMOVE in `cat /tmp/3builddistro_removed_alt | tr '\n' ' '`
  1190. do
  1191. orPATTERN='yes|'"$ONEREMOVE"'|'
  1192. grep -v "$orPATTERN" rootfs-complete/root/.packages/DISTRO_PKGS_SPECS > /tmp/DISTRO_PKGS_SPECS-tempor
  1193. cp -f /tmp/DISTRO_PKGS_SPECS-tempor rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
  1194. done
  1195. fi
  1196. if [ -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
  1197. cp -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} rootfs-complete/root/.packages/DISTRO_COMPAT_REPOS
  1198. else #130306
  1199. cp -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT} rootfs-complete/root/.packages/DISTRO_COMPAT_REPOS
  1200. fi
  1201. #this needed to update pkg db's in a running puppy...
  1202. cp -f ../0setup rootfs-complete/usr/local/petget/
  1203. #w015 0setup calls this for faster operation...
  1204. cp -f ../support/find_cat rootfs-complete/usr/local/petget/
  1205. #w091017 0setup also needs these, fast conversion created by Wosh...
  1206. [ -f ../support/ppkg ] && cp -f ../support/ppkg rootfs-complete/usr/local/petget/
  1207. [ -f ../support/ppkg.ctg ] && cp -f ../support/ppkg.ctg rootfs-complete/usr/local/petget/
  1208. #110612 0setup needs these...
  1209. [ -f ../support/rpm2ppm ] && cp -f ../support/rpm2ppm rootfs-complete/usr/local/petget/
  1210. [ -f ../support/mageia2ppm ] && cp -f ../support/mageia2ppm rootfs-complete/usr/local/petget/
  1211. #121111 new fast deb to pup db converter, called by 0setup...
  1212. [ -f ../support/debdb2pupdb ] && cp -f ../support/debdb2pupdb rootfs-complete/usr/local/petget/
  1213. #urls etc on the pet db's...
  1214. cp -f ../DISTRO_PET_REPOS rootfs-complete/root/.packages/
  1215. #w018 homepages of heaps of pkgs (see 0pre script)...
  1216. cp -f ../PKGS_HOMEPAGES rootfs-complete/root/.packages/
  1217. #cp -f ../support/inline_get_pet rootfs-complete/root/.packages/ #100801
  1218. #cp -f ../support/inline_get_compat rootfs-complete/root/.packages/ #100806
  1219. #cp -f ../support/findpkgs rootfs-complete/root/.packages/ #110821 110823 revert.
  1220. #130316 see 0setup and debdb2pupdb...
  1221. case ${DISTRO_BINARY_COMPAT} in
  1222. debian|devuan|ubuntu|trisquel|raspbian)
  1223. if [ ! -f ../invaliddepslist ];then
  1224. echo "WARNING WARNING"
  1225. echo "File 'invaliddepslist' does not exist.
  1226. This is created by script '0setup'. You must go back and rerun all of the
  1227. scripts from 0setup, 1download, 2createpackages.
  1228. Recommend abort this script now (ctrl-c).
  1229. Or, if you press ENTER to continue, an empty 'invaliddepslist' file will
  1230. be created."
  1231. echo -n "Press ENTER to continue: "
  1232. read justgoon
  1233. touch ../invaliddepslist
  1234. fi
  1235. ;;
  1236. esac
  1237. [ -f ../invaliddepslist ] && cp -f ../invaliddepslist rootfs-complete/usr/local/petget/
  1238. #build a db of builtin packages, woof-installed-packages ... 110823 no need to chroot...
  1239. #chroot rootfs-complete /usr/local/petget/findwoofinstalledpkgs.sh
  1240. cp ../woof-installed-packages rootfs-complete/root/.packages/ #110823 already created earlier this script.
  1241. touch ../devx-only-installed-packages #121028
  1242. cp ../devx-only-installed-packages rootfs-complete/root/.packages/ #121028
  1243. #110722 add kernel db line...
  1244. echo "$KERNEL_DB_ENTRY" >> rootfs-complete/root/.packages/woof-installed-packages
  1245. #sort alphabetically...
  1246. sort --key=1 --field-separator="|" rootfs-complete/root/.packages/woof-installed-packages > /tmp/petget_woof-installed-packages
  1247. mv -f /tmp/petget_woof-installed-packages rootfs-complete/root/.packages/woof-installed-packages
  1248. #currently not using these...
  1249. rm -f rootfs-complete/etc/rc.d/rc.sysinit-UNIPUP
  1250. rm -f rootfs-complete/etc/rc.d/rc.shutdown-UNIPUP
  1251. #120628 certain utilities are not appropriate when booting on an arm board...
  1252. if [ "$SDFLAG" != "" ];then
  1253. rm -f rootfs-complete/usr/sbin/grubconfig
  1254. rm -f rootfs-complete/usr/sbin/remasterpup2
  1255. rm -f rootfs-complete/usr/sbin/resizepfile.sh
  1256. rm -f rootfs-complete/usr/sbin/wakepup2
  1257. rm -f rootfs-complete/usr/share/applications/Grub-bootloader-config.desktop
  1258. rm -f rootfs-complete/usr/share/applications/BootFlash-usb-installer.desktop
  1259. rm -f rootfs-complete/usr/share/applications/Puppy-universal-installer.desktop
  1260. rm -f rootfs-complete/usr/share/applications/Remaster-Puppy-live-CD.desktop
  1261. rm -f rootfs-complete/usr/share/applications/Resize-personal-storage-file.desktop
  1262. rm -f rootfs-complete/usr/share/applications/WakePup2.desktop
  1263. fi
  1264. #130326 script to adjust fonts to suit 96 dpi (puppy used to have 78 dpi)...
  1265. rootfs-complete/usr/sbin/hackfontsize
  1266. #130618 restore the "layer:" lines in /etc/xdg/templates/_root_.jwmrc...
  1267. #note, this file is now in Woof, I took it out of the JWM pet.
  1268. JWMFLG=0
  1269. JWM3=`grep -E '^jwm[_-][0-9]' rootfs-complete/root/.packages/woof-installed-packages | cut -f 3 -d '|' | cut -c 1-3 | head -n 1`
  1270. [ ! $JWM3 ] && JWMFLG=1 #assume too old. note, there is a jwm2 pet, which is older version.
  1271. if vercmp $JWM3 ge 2.2; then JWMFLG=2; fi
  1272. if vercmp $JWM3 ge 790; then JWMFLG=2; fi
  1273. case $JWMFLG in
  1274. 2)
  1275. sed -i -e 's%.*LAYER_MINIXCAL.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
  1276. sed -i -e 's%.*LAYER_GTKDIALOGSPLASH.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
  1277. sed -i -e 's%.*LAYER_SPLASHWINDOW.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
  1278. ;;
  1279. esac
  1280. #fix the menus...
  1281. #111123 ***NOTICE*** cross-build, will have to run fixmenus and indexgen.sh at first bootup.
  1282. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1283. echo
  1284. echo "Constructing configuration files for JWM, Fvwm95, IceWM, openbox..."
  1285. chroot rootfs-complete /usr/sbin/fixmenus
  1286. #generate help index...
  1287. chroot rootfs-complete /usr/sbin/indexgen.sh
  1288. #...note, rootfs-skeleton/pinstall.sh pre-processes the help files.
  1289. fi
  1290. #shared library loading...
  1291. echo "/lib${lsuffix}" > rootfs-complete/etc/ld.so.conf
  1292. echo "/usr/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
  1293. [ -d rootfs-complete/usr/local/lib${lsuffix} ] && echo "/usr/local/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
  1294. [ -d rootfs-complete/usr/X11R7/lib${lsuffix} ] && echo "/usr/X11R7/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
  1295. [ -d rootfs-complete/opt/gnome2/lib${lsuffix} ] && echo "/opt/gnome2/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
  1296. [ -d rootfs-complete/opt/qt4/lib${lsuffix} ] && echo "/opt/qt4/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
  1297. [ -d rootfs-complete/opt/mozilla.org/lib${lsuffix} ] && echo "/opt/mozilla.org/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
  1298. [ -d rootfs-complete/opt/samba/lib${lsuffix} ] && echo "/opt/samba/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
  1299. echo "/root/my-applications/lib" >> rootfs-complete/etc/ld.so.conf
  1300. #generate /etc/ld.so.cache shared lib loading cache file... w019 not always there...
  1301. #cp -a ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/sbin/ldconfig rootfs-complete/
  1302. #100527 stupid thing, needs '/' on end of path in case of 'packages-qret' being a symlink...
  1303. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1304. LDCONFIG="`find ../packages-${DISTRO_FILE_PREFIX}/ -type f -name ldconfig | grep '/sbin/' | head -n 1`"
  1305. cp -a $LDCONFIG rootfs-complete/
  1306. chroot rootfs-complete ./ldconfig
  1307. rm -f rootfs-complete/ldconfig
  1308. sync
  1309. else
  1310. #***NOTICE*** have to run ldconfig at first boot.
  1311. LDCONFIG="`find ../packages-${DISTRO_FILE_PREFIX}/ -type f -name ldconfig | grep '/sbin/' | head -n 1`"
  1312. cp -a $LDCONFIG rootfs-complete/sbin/
  1313. fi
  1314. #i don't know what 'lintian' is for...
  1315. rm -rf rootfs-complete/usr/share/lintian 2>/dev/null
  1316. #maybe stray /install dir from slackware pkgs...
  1317. rm -rf rootfs-complete/install 2>/dev/null
  1318. #slackware pkg may create this...
  1319. rm -rf rootfs-complete/etc/cron.daily 2>/dev/null
  1320. #w460 theme selection...
  1321. # if "default.ext" exists in wallpapers then we set it up in poor man's ptheme...
  1322. wdefault=`find rootfs-complete/usr/share/backgrounds -name 'default.*'`
  1323. # double check for ptheme
  1324. wptheme=`find rootfs-complete/usr/share/ -type d -name 'ptheme'`
  1325. if [ -z "$wdefault" -a -z "$wptheme" ];then #it don't exists so we proceed with this method
  1326. echo
  1327. echo "Continuing to setup `pwd`/rootfs-complete..."
  1328. echo
  1329. #141204 optional file...
  1330. DEFAULT_THEME_GTK2=''
  1331. DEFAULT_THEME_JWM=''
  1332. DEFAULT_THEME_OPENBOX=''
  1333. DEFAULT_THEME_WALLPAPER=''
  1334. DEFAULT_THEME_DESK_ICONS=''
  1335. DEFAULT_THEME_ROX_TEXT_FOREGROUND='black'
  1336. DEFAULT_THEME_ROX_TEXT_SHADOW='thin' #none, thin, or thick
  1337. DEFAULT_THEME_ROX_TEXT_FONT='DejaVu Sans 10'
  1338. DEFAULT_THEME_XORG_TEXT_DPI= #141206
  1339. if [ -f default-theme ];then
  1340. . ../default-theme
  1341. fi
  1342. #w478 now have a gui for theme selection...
  1343. eval "`../support/choose_themes`"
  1344. #...returns BACKGROUNDIMAGE, DESKICONS, GTKTHEME, JWMTHEME.
  1345. if [ "$EXIT" = "OK" ];then
  1346. #BACKGROUNDIMAGE="zzzzzzzz"
  1347. #echo "Here are the available background images (ref: usr/share/backgrounds):"
  1348. #ls -1 rootfs-complete/usr/share/backgrounds
  1349. #echo
  1350. #while [ ! -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE ];do
  1351. # echo "Type the full filename of the one you want as default"
  1352. # echo -n "(ENTER only will select the first): "
  1353. # read BACKGROUNDIMAGE
  1354. # [ "$BACKGROUNDIMAGE" = "" ] && BACKGROUNDIMAGE="`ls -1 rootfs-complete/usr/share/backgrounds | head -n 1`"
  1355. #done
  1356. case $BACKGROUNDIMAGE in #110831
  1357. *.png|*.PNG)
  1358. mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.png
  1359. sed -i -e 's%default\.jpg%default.png%' rootfs-complete/root/Choices/ROX-Filer/PuppyPin
  1360. #i don't know what uses this, but change it anyway...
  1361. sed -i -e 's%default\.jpg%default.png%' rootfs-complete/etc/Puppybackgroundpicture
  1362. ;;
  1363. *.svg)
  1364. mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.svg
  1365. sed -i -e 's%default\.jpg%default.svg%' rootfs-complete/root/Choices/ROX-Filer/PuppyPin
  1366. sed -i -e 's%default\.jpg%default.svg%' rootfs-complete/etc/Puppybackgroundpicture
  1367. ;;
  1368. *)
  1369. mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.jpg
  1370. ;;
  1371. esac
  1372. ##w477 choose gtk theme...
  1373. #echo
  1374. #echo "Here are the available GTK themes (ref: usr/share/themes):"
  1375. #ls -1 rootfs-complete/usr/share/themes/*/gtk-2.0 | grep '^rootfs-complete/usr/share/themes' | cut -f 5 -d '/'
  1376. #echo
  1377. #GTKTHEME="zzzzzzzzzz"
  1378. #while [ ! -d "rootfs-complete/usr/share/themes/$GTKTHEME" ];do
  1379. # echo "Type the full filename of the one you want as default"
  1380. # echo -n "(ENTER only will select the first): "
  1381. # read GTKTHEME
  1382. # [ "$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`"
  1383. #done
  1384. #130329 append extra line, needed for Qt4 theme matching. (see also /etc/profile.d/pup_gtk and /root/.config/Trolltech.conf)...
  1385. echo "# -- THEME AUTO-WRITTEN DO NOT EDIT
  1386. include \"/usr/share/themes/${GTKTHEME}/gtk-2.0/gtkrc\"
  1387. include \"/root/.gtkrc.mine\"
  1388. # -- THEME AUTO-WRITTEN DO NOT EDIT
  1389. gtk-theme-name=\"${GTKTHEME}\"" > rootfs-complete/root/.gtkrc-2.0
  1390. #130401 01micko...
  1391. # gtk3 theme support thunor http://murga-linux.com/puppy/viewtopic.php?p=695722#695722
  1392. #[ -d rootfs-complete/root/.config/gtk-3.0 ] || mkdir -p rootfs-complete/root/.config/gtk-3.0
  1393. pathGTK3THEME="`find rootfs-complete/usr/share/themes/${GTKTHEME} -type d -name gtk-3.0`"
  1394. if [ "$pathGTK3THEME" ];then #XDG_CONFIG_HOME=/root/.config
  1395. # [ -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
  1396. # #[ -f ${pathGTK3THEME}/gtk.css ] && cp -af ${pathGTK3THEME}/gtk.css rootfs-complete$XDG_CONFIG_HOME/gtk-3.0/ ||\# doesn't work
  1397. # echo "" > rootfs-complete/root/.config/gtk-3.0/gtk.css
  1398. #130404 link to actual theme...
  1399. ln -snf "$pathGTK3THEME" rootfs-complete/root/.config/gtk-3.0
  1400. fi
  1401. #echo
  1402. #DESKICONS="zzzzzzzzz"
  1403. #echo "Here are the available desktop icon themes (ref: usr/local/lib/X11/themes):"
  1404. #find rootfs-complete/usr/local/lib/X11/themes -maxdepth 1 -mindepth 1 -type d | rev | cut -f 1 -d '/' | rev
  1405. #while [ ! -d "rootfs-complete/usr/local/lib/X11/themes/$DESKICONS" ];do
  1406. # echo "Type the full filename of the one you want as default"
  1407. # echo -n "(ENTER only will select the first): "
  1408. # read DESKICONS
  1409. # [ "$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`"
  1410. #done
  1411. echo -n "$DESKICONS" > rootfs-complete/etc/desktop_icon_theme
  1412. if [ -d rootfs-complete/root/.jwm/themes ];then
  1413. cp -f rootfs-complete/root/.jwm/themes/${JWMTHEME}-jwmrc rootfs-complete/root/.jwm/jwmrc-theme
  1414. cp -f rootfs-complete/root/.jwm/themes/${JWMTHEME}-colors rootfs-complete/root/.jwm/jwm_colors 2>/dev/null
  1415. fi
  1416. if [ -f rootfs-complete/root/.config/openbox/rc.xml ];then #20100406
  1417. obPATTERN="s%Natura%${OBTHEME}%"
  1418. sed -i -e "$obPATTERN" rootfs-complete/root/.config/openbox/rc.xml
  1419. fi
  1420. sync
  1421. fi #end theme chooser ok.
  1422. else
  1423. DESKICONS=`cat rootfs-complete/etc/desktop_icon_theme` # set up by poor man's ptheme
  1424. echo $DESKICONS
  1425. pathGTK3THEME="`find rootfs-complete/usr/share/themes/${GTKTHEME} -type d -name gtk-3.0`"
  1426. if [ "$pathGTK3THEME" ];then
  1427. ln -snf "$pathGTK3THEME" rootfs-complete/root/.config/gtk-3.0
  1428. fi
  1429. sync
  1430. fi
  1431. #have copied code from icon_switcher_cli to here, modified...
  1432. NEWTHEME="$DESKICONS" #see above
  1433. for ONESVG in `find rootfs-complete/usr/local/lib/X11/themes/${NEWTHEME}/ -maxdepth 1 -name \*.svg | tr '\n' ' '` #140103 removed '-type f'
  1434. do
  1435. ONEBASENAME="`basename $ONESVG .svg`"
  1436. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}48.png
  1437. rsvg-convert -w 48 -h 48 -o rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}48.png $ONESVG
  1438. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}24.png 2>/dev/null #140102 sent to null, shouldn't exist here
  1439. #rsvg-convert -w 24 -h 24 -o /tmp/${ONEBASENAME}24.png $ONESVG
  1440. ##if svg has transparency, JWM does not render properly in x16 bit color, screen out...
  1441. #pngtopnm -mix /tmp/${ONEBASENAME}24.png | pnmtopng > /usr/local/lib/X11/pixmaps/${ONEBASENAME}24.png
  1442. #rsvg-convert -w 24 -h 24 -o rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}24.png $ONESVG #140102 removed
  1443. done
  1444. for ONEPNG in `find rootfs-complete/usr/local/lib/X11/themes/${NEWTHEME}/ -maxdepth 1 -type f -name \*.png | tr '\n' ' '`
  1445. do
  1446. ONEBASENAME="`basename $ONEPNG .png`"
  1447. cp -f $ONEPNG rootfs-complete/usr/local/lib/X11/pixmaps/
  1448. touch -m rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}.png #v3.98
  1449. xONEBASENAME="`basename $ONEBASENAME 48`"
  1450. #if [ "$xONEBASENAME" != "$ONEBASENAME" ];then #scale to 24 pixels... #140102 removed
  1451. #pngtopnm -alpha $ONEPNG > /tmp/temp.pbm #separate transparency channel.
  1452. #pnmscale -reduce 2 /tmp/temp.pbm > /tmp/temp2.pbm 2> /dev/null
  1453. #pngtopnm $ONEPNG | pnmscale -reduce 2 2>/dev/null | pnmtopng -alpha=/tmp/temp2.pbm > rootfs-complete/usr/local/lib/X11/pixmaps/${xONEBASENAME}24.png
  1454. #touch -m rootfs-complete/usr/local/lib/X11/pixmaps/${xONEBASENAME}24.png #v3.98
  1455. #fi
  1456. done
  1457. if [ "$DISPLAY" ];then #110726 pngoverlay does not work when X not running. --quick fix, perform this operation in woof in 3builddistro.
  1458. #110721 new standardised icons to show when mounted...
  1459. 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)
  1460. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/*_mntd*.png
  1461. #cp -f rootfs-complete/usr/sbin/pngoverlay rootfs-complete/usr/local/lib/X11/pixmaps/ #dumb, but needs to be in same folder.
  1462. #111123 get pngoverlay from host, in case of cross-build...
  1463. cp -f /usr/sbin/pngoverlay rootfs-complete/usr/local/lib/X11/pixmaps/ #dumb, but needs to be in same folder.
  1464. cd rootfs-complete/usr/local/lib/X11/pixmaps
  1465. for ONEDRV in card drive floppy optical usbdrv
  1466. do
  1467. ./pngoverlay ${ONEDRV}48.png closebox_outline48.png ${ONEDRV}_mntd48.png #background foreground output.
  1468. ./pngoverlay ${ONEDRV}48.png locked_outline48.png ${ONEDRV}_mntd_boot48.png
  1469. done
  1470. rm -f rootfs-complete/usr/local/lib/X11/pixmaps/pngoverlay
  1471. cd ../../../../../../
  1472. fi
  1473. fi
  1474. #fi
  1475. #110912 modify jwm to use menu icon 'start-button.png' if present...
  1476. #note, similar code also in /usr/sbin/icon_switcher (desktop icon switcher script).
  1477. if [ -f rootfs-complete/root/.jwmrc-tray ];then
  1478. if [ -f rootfs-complete/usr/local/lib/X11/${NEWTHEME}/start-button.png ];then #default theme has menu icon.
  1479. if [ -f rootfs-complete/usr/local/lib/X11/pixmaps/start-button.png ];then #precaution.
  1480. if [ "`grep 'start-button\.png' rootfs-complete/root/.jwmrc-tray`" = "" ];then
  1481. #the default is to use 'mini-dog.xpm' with text "Menu"...
  1482. echo "rootfs-complete/root/.jwmrc-tray modified to use start-button.png menu icon"
  1483. echo "(which is in rootfs-complete/usr/local/lib/X11/pixmaps/)"
  1484. PTN1='s%label="Menu" icon="mini-dog\.xpm"%icon="start-button.png"%'
  1485. sed -i -e "$PTN1" rootfs-complete/root/.jwmrc-tray
  1486. fi
  1487. fi
  1488. fi
  1489. fi
  1490. #v423 moved down. remove 'default' image from cull list...
  1491. # remove BG image cull
  1492. #v424 rox desktop text is default white with black shadow, not suited all backgrounds...
  1493. echo
  1494. echo "The ROX-Filer desktop text defaults to white with black shadow, but this is"
  1495. echo "not best for some light backgound images. ENTER only to keep, but if you"
  1496. echo -n "want black text press any printable key then ENTER: "
  1497. read wantblacktext
  1498. if [ "$wantblacktext" != "" ];then
  1499. echo "...ok, black text"
  1500. grep -v 'pinboard_fg_colour' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
  1501. grep -v 'pinboard_shadow_labels' /tmp/3builddistro_rox_options > rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1502. grep -v '^</Options>' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
  1503. mv -f /tmp/3builddistro_rox_options rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1504. echo ' <Option name="pinboard_fg_colour">#000000000000</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1505. echo ' <Option name="pinboard_shadow_labels">0</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1506. echo '</Options>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1507. fi
  1508. #111010 set desktop font...
  1509. echo
  1510. echo "Also, ROX-Filer defaults to 'DejaVu Sans 10' font for the desktop. To accept"
  1511. echo "that just press ENTER. If you would prefer bold text 'DejaVu Sans Bold 10',"
  1512. echo "hit 'b' key then ENTER, or type in a full font specification (ex: Mono 12)"
  1513. echo -n ": "
  1514. read wantfont
  1515. if [ "$wantfont" != "" ];then
  1516. grep -v 'label_font' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
  1517. grep -v '^</Options>' /tmp/3builddistro_rox_options > rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1518. if [ "$wantfont" = "b" ];then
  1519. echo '...ok, bold'
  1520. echo ' <Option name="label_font">DejaVu Sans Bold 10</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1521. else
  1522. echo "...ok, $wantfont"
  1523. echo " <Option name=\"label_font\">${wantfont}</Option>" >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1524. fi
  1525. echo '</Options>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
  1526. fi
  1527. RK=`uname -r`
  1528. [ ${RK%%.*} -lt 3 ] && echo "Running kernel too old, exiting" && exit 1
  1529. #w464 maybe get rid of old mksquashfs... v424 fix #140619 assume 3 kernel
  1530. [ ! -e rootfs-complete/usr/sbin/mksquashfs4 ] && mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs4 2>/dev/null
  1531. [ -e rootfs-complete/usr/sbin/mksquashfs ] && [ ! -h rootfs-complete/usr/sbin/mksquashfs ] && mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs3 2>/dev/null #120502
  1532. [ -e rootfs-complete/usr/sbin/mksquashfs4 ] && ln -s mksquashfs4 rootfs-complete/usr/sbin/mksquashfs 2>/dev/null
  1533. [ ! -e rootfs-complete/usr/sbin/unsquashfs4 ] && mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs4 2>/dev/null
  1534. [ -e rootfs-complete/usr/sbin/unsquashfs ] && [ ! -h rootfs-complete/usr/sbin/unsquashfs ] && mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs3 2>/dev/null #120502
  1535. [ -e rootfs-complete/usr/sbin/unsquashfs4 ] && ln -s unsquashfs4 rootfs-complete/usr/sbin/unsquashfs 2>/dev/null
  1536. #w470 create a table for dialog/Xdialog: /usr/share/i18n/dialog_table
  1537. #'chooselocale' is called from /etc/rc.d/rc.country at first boot and
  1538. #pre-creating this table speeds things up. 111123
  1539. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1540. chroot rootfs-complete /usr/sbin/chooselocale composeonly
  1541. fi
  1542. [ -f rootfs-complete/pet.specs ] && rm -f rootfs-complete/pet.specs #w478
  1543. #w478 save some space if medit and gtksourceview both installed...
  1544. if [ -d rootfs-complete/usr/share/gtksourceview-2.0 ];then
  1545. if [ -d rootfs-complete/usr/share/moo/language-specs ];then
  1546. echo
  1547. echo "An optimisation can be done to share some files between medit and"
  1548. echo -n "gtksourceview. Press ENTER only to do this: "
  1549. read optsourceview
  1550. if [ "$optsourceview" = "" ];then
  1551. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/convert.py rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  1552. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language2.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  1553. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  1554. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language.dtd rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  1555. cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/styles.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
  1556. rm -r -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs
  1557. rm -r -f rootfs-complete/usr/share/gtksourceview-2.0/styles
  1558. ln -s /usr/share/moo/language-specs rootfs-complete/usr/share/gtksourceview-2.0/language-specs
  1559. ln -s /usr/share/moo/language-specs rootfs-complete/usr/share/gtksourceview-2.0/styles
  1560. echo "...usr/share/gtksourceview-2.0 now has links to usr/share/moo."
  1561. fi
  1562. fi
  1563. fi
  1564. #091123 t2 build get rid of some stray stuff...
  1565. [ -d rootfs-complete/usr/share/devhelp ] && rm -rf rootfs-complete/usr/share/devhelp
  1566. [ -d rootfs-complete/usr/share/man ] && rm -rf rootfs-complete/usr/share/man
  1567. [ -d rootfs-complete/usr/share/omf ] && rm -rf rootfs-complete/usr/share/omf
  1568. #111006 generic logo mechanism for all pups...
  1569. if [ -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}48.png ];then
  1570. mv -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}48.png rootfs-complete/usr/share/doc/${DISTRO_FILE_PREFIX}48.png
  1571. ln -snf ${DISTRO_FILE_PREFIX}48.png rootfs-complete/usr/share/doc/puppylogo48.png
  1572. fi
  1573. if [ -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}96.png ];then
  1574. mv -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}96.png rootfs-complete/usr/share/doc/${DISTRO_FILE_PREFIX}96.png
  1575. ln -snf ${DISTRO_FILE_PREFIX}96.png rootfs-complete/usr/share/doc/puppylogo96.png
  1576. fi
  1577. rm -rf rootfs-complete/usr/share/doc/puplogos
  1578. #100208 hack so net-setup.sh can find ifplugstatus (pup 4.3.2 needs this)...
  1579. if [ ! -e rootfs-complete/sbin/ifplugstatus ];then
  1580. if [ -e rootfs-complete/sbin/ifplugstatus-0.18 ];then
  1581. ln -s ifplugstatus-0.18 rootfs-complete/sbin/ifplugstatus
  1582. else
  1583. if [ -e rootfs-complete/sbin/ifplugstatus-0.28 ];then
  1584. ln -s ifplugstatus-0.28 rootfs-complete/sbin/ifplugstatus
  1585. fi
  1586. fi
  1587. fi
  1588. #100524 fix cups for samba, got this code from /usr/sbin/cups_shell...
  1589. #fixes from rcrsn51 for samba printing...
  1590. [ -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
  1591. #100706 no, this goes against all the docs, restore to a symlink...
  1592. #if [ ! -e rootfs-complete/usr/lib/cups/backend/smb ];then
  1593. # [ -f rootfs-complete/opt/samba/bin/smbspool ] && cp -a rootfs-complete/opt/samba/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  1594. # [ -f rootfs-complete/usr/bin/smbspool ] && cp -a rootfs-complete/usr/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  1595. #fi
  1596. if [ ! -e rootfs-complete/usr/lib/cups/backend/smb ];then
  1597. [ -f rootfs-complete/opt/samba/bin/smbspool ] && ln -s /opt/samba/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  1598. [ -f rootfs-complete/usr/bin/smbspool ] && ln -s /usr/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
  1599. fi
  1600. [ -f rootfs-complete/etc/opt/samba/smb.conf ] && chmod 755 rootfs-complete/etc/opt/samba/smb.conf #need world-readable.
  1601. [ -f rootfs-complete/etc/samba/smb.conf ] && chmod 755 rootfs-complete/etc/samba/smb.conf #need world-readable.
  1602. #110907 rcrsn51: network printing, need this... 111027 revert, must have actual pdftops from cups pkg...
  1603. #if [ ! -e rootfs-complete/usr/lib/cups/filter/pdftops ];then
  1604. # [ -f rootfs-complete/usr/bin/pdftops ] && ln -s /usr/bin/pdftops rootfs-complete/usr/lib/cups/filter/pdftops
  1605. #fi
  1606. #111026 davids45: /tmp needs 777 permissions. i do have this in rootfs-skeleton, but lost in sandbox3/rootfs-complete
  1607. # (http://murga-linux.com/puppy/viewtopic.php?t=72258&start=90)
  1608. #130203 01micko: make that 1777 ref: http://murga-linux.com/puppy/viewtopic.php?p=677630#677630
  1609. chmod 1777 rootfs-complete/tmp
  1610. chmod 777 rootfs-complete/var
  1611. #110911 fix if any alternate drivers still at old location...
  1612. mkdir -p rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate
  1613. if [ -d rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers-alternate ];then
  1614. cp -a -f rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers-alternate/* rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate/
  1615. rm -rf rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers-alternate
  1616. fi
  1617. #100319 move more xorg drivers to 'drivers-alternate' so won't be chosen by xorg...
  1618. if [ -d rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers ];then #well, always exists.
  1619. XORGBADDRIVERS=''
  1620. 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
  1621. [ -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.
  1622. fi
  1623. [ -f rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers/modesetting_drv.so ] && XORGBADDRIVERS="${XORGBADDRIVERS} modesetting" #130330
  1624. echo
  1625. echo "Certain Xorg drivers have a bad reputation. Here you can choose to move them"
  1626. echo "to /usr/lib${lsuffix}/x/drivers-alternate so Xorg will not use them, instead"
  1627. echo "will use the generic 'vesa' driver (or other more appropriate driver)."
  1628. echo "However the Xorg Wizard has a mechanism to move any drivers in "
  1629. echo "'drivers-alternate' back to 'drivers' directory."
  1630. echo "Here is the list of drivers currently in 'drivers-alternate':"
  1631. XORGBADDRIVERS="$XORGBADDRIVERS `ls -1 rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate | grep '_drv' | cut -f 1 -d '_' | tr '\n' ' '`"
  1632. echo " $XORGBADDRIVERS"
  1633. echo "Press ENTER only to accept this, or"
  1634. echo "type a space-delimited list of drivers"
  1635. echo -n " that you want to be in 'drivers-alternate': "
  1636. read NEWXORGBADDRVRS
  1637. [ "$NEWXORGBADDRVRS" = "" ] && NEWXORGBADDRVRS="$XORGBADDRIVERS"
  1638. for ONEBADX in $NEWXORGBADDRVRS
  1639. do
  1640. #some builds have i810_drv.so symlink to intel_drv.so...
  1641. if [ -h rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers/${ONEBADX}_drv.so ];then
  1642. continue
  1643. fi
  1644. [ -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/
  1645. done
  1646. for ONECHK in `ls -1 rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate | grep '_drv' | cut -f 1 -d '_' | tr '\n' ' '` #110911
  1647. do
  1648. oPTN=" ${ONECHK} "
  1649. if [ "`echo -n " ${NEWXORGBADDRVRS} " | grep "$oPTN"`" = "" ];then
  1650. if [ ! -d $ONECHK ];then
  1651. mv -f rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate/${ONECHK}_drv.so rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers/
  1652. else
  1653. echo "SORRY: cannot move '${ONECHK}_drv.so' from drivers-alternate back to"
  1654. echo "main drivers, it must stay as an alternate driver only."
  1655. fi
  1656. fi
  1657. done
  1658. fi
  1659. #101012 if 'depmod-FULL' exists, rename it to 'depmod'... 101024
  1660. if [ "$USINGKMOD" = "no" ];then #130418
  1661. if [ ! -h rootfs-complete/sbin/depmod-FULL ];then #if hyperlink then assume to depmod.
  1662. if [ -f rootfs-complete/sbin/depmod-FULL ];then
  1663. mv -f rootfs-complete/sbin/depmod rootfs-complete/sbin/depmod-BB-NOTUSED
  1664. mv -f rootfs-complete/sbin/depmod-FULL rootfs-complete/sbin/depmod
  1665. fi
  1666. ln -s depmod rootfs-complete/sbin/depmod-FULL
  1667. fi
  1668. else
  1669. [ -e rootfs-complete/bin/kmod ] && ln -snf ../bin/kmod rootfs-complete/sbin/depmod #130430 path fix.
  1670. fi
  1671. #101015 make sure our modified 'alsaconf' is used (just in case got overwritten)...
  1672. cp -a -f ../rootfs-skeleton/usr/sbin/alsaconf rootfs-complete/usr/sbin/
  1673. #w481 extra stripping...
  1674. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #120502 strip will not work for cross-build.
  1675. echo
  1676. echo "Would you like to strip all binary executables and shared library files?"
  1677. echo "These are usually already stripped, although some packages may have the shared"
  1678. echo "library files stripped with the '--strip-debug' option only, and extra stripping"
  1679. echo "should be okay. It won't do any harm answering yes here."
  1680. if [ "`which strip`" = "" ];then
  1681. echo
  1682. echo "OH, NO GOOD, you don't have the 'strip' executable. The 'devx' sfs has it."
  1683. echo "PLEASE DECLINE THIS OFFER..."
  1684. echo
  1685. fi
  1686. echo -n "ENTER only to strip, any other printable char to decline: "
  1687. read NOSTRIP
  1688. if [ "$NOSTRIP" = "" ];then
  1689. find rootfs-complete/bin rootfs-complete/sbin rootfs-complete/usr/bin rootfs-complete/sbin -type f |
  1690. while read ONEFILE
  1691. do
  1692. ONEBASE="`basename "$ONEFILE"`"
  1693. # if [ "`file "$ONEFILE" | grep 'ELF' | grep 'executable' | grep 'dynamically linked'`" != "" ];then #v424 fix.
  1694. [ "$ONEBASE" = "e3" ] && continue #v431 cannot be stripped.
  1695. [ "$ONEBASE" = "QtWeb" ] && continue #130721 cannot be stripped.
  1696. if [ "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" != "" ];then #v431
  1697. echo -n "$ONEBASE "
  1698. strip --strip-unneeded "$ONEFILE"
  1699. fi
  1700. done
  1701. echo
  1702. find rootfs-complete/usr/lib rootfs-complete/usr/X11R7/lib -type f -name \*.so* |
  1703. while read ONEFILE
  1704. do
  1705. ONEBASE="`basename "$ONEFILE"`"
  1706. #v431 libgdk-x11-2.0.so* compiled in pup4 with '--enable-debug', fixes insert-key mozilla crash.
  1707. # it may be unwise to strip its debug symbols... no, it's ok...
  1708. #[ "`echo "$ONEBASE" | grep 'libgdk'`" != "" ] && continue #v431
  1709. if [ "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" != "" ];then
  1710. echo -n "$ONEBASE "
  1711. strip --strip-unneeded "$ONEFILE"
  1712. fi
  1713. done
  1714. echo
  1715. fi
  1716. fi
  1717. #100527 build a .pet with lists of all builtin files...
  1718. echo
  1719. echo "Now building sandbox3/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.pet,"
  1720. echo "which is a PET package with lists of all packages and files builtin to the SFS..."
  1721. rm -rf 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION} 2>/dev/null
  1722. mkdir 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  1723. mkdir /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  1724. for ONEGENDIR in `find ../packages-${DISTRO_FILE_PREFIX} -maxdepth 1 -type d | tr '\n' ' '`
  1725. do
  1726. ONEGENNAME="`basename $ONEGENDIR`"
  1727. # [ "`echo "$ONEGENNAME" | grep -E '_DEV|_DOC|_NLS|_NULL'`" != "" ] && continue #not really needed.
  1728. ogPATTERN="|${ONEGENNAME}|"
  1729. [ "`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep "$ogPATTERN"`" == "" ] && continue
  1730. echo -n "$ONEGENNAME "
  1731. ogPATTERN="s%^\\.\\./packages-${DISTRO_FILE_PREFIX}/${ONEGENNAME}/%/%"
  1732. find $ONEGENDIR | sed -e "$ogPATTERN" | sort > /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${ONEGENNAME}.files
  1733. sync
  1734. #store the information more efficiently...
  1735. mkdir -p 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files
  1736. PREVPATH=''; PREVPATH0=''
  1737. cat /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${ONEGENNAME}.files |
  1738. while read ONELINE
  1739. do
  1740. [ "`echo "$ONELINE" | cut -c 1`" == "." ] && continue #catch ex: ../packages-qrky/abiword
  1741. if [ -d "rootfs-complete${ONELINE}" ];then
  1742. #120925 ignore debian/ubuntu multiarch circular symlink (these are create by 2createpackages)...
  1743. if [ -h "rootfs-complete${ONELINE}" ];then
  1744. if [ "$(readlink "rootfs-complete${ONELINE}")" = "./" ];then
  1745. PREVPATH0="$(dirname "$ONELINE")" #121010 fix, missing some files.
  1746. [ "$PREVPATH0" != "$PREVPATH" ] && echo "$PREVPATH0" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME} #121010
  1747. continue
  1748. fi
  1749. fi
  1750. PREVPATH="$ONELINE"
  1751. echo "$ONELINE" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME}
  1752. else
  1753. NEWPATH="`dirname "$ONELINE"`"
  1754. [ "$NEWPATH" == "/" ] && continue #ignore top-level files.
  1755. NEWFILE="`basename "$ONELINE"`"
  1756. if [ -e "rootfs-complete${ONELINE}" ];then #sanity check.
  1757. if [ "$PREVPATH" == "$NEWPATH" -o "$PREVPATH0" == "$NEWPATH" ];then #sanity check. 121010
  1758. echo " ${NEWFILE}" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME}
  1759. fi
  1760. fi
  1761. fi
  1762. done
  1763. done
  1764. # do the same for rootfs-packages
  1765. if [ -f /tmp/rootfs-packages.specs ];then
  1766. while read line ; do
  1767. PKGL=`echo $line | cut -d '|' -f 2`
  1768. echo -n "${PKGL} "
  1769. ogPATTERN="s%^\\.\\./rootfs-packages/${PKGL}/%/%"
  1770. find ../rootfs-packages/$PKGL | sed -e "$ogPATTERN" | sort > /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${PKGL}.files
  1771. sync
  1772. mkdir -p 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files
  1773. PREVPATH=''; PREVPATH0=''
  1774. cat /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${PKGL}.files |
  1775. while read ONELINE
  1776. do
  1777. [ "`echo "$ONELINE" | cut -c 1`" == "." ] && continue #catch ex: ../packages-qrky/abiword
  1778. if [ -d "rootfs-complete${ONELINE}" ];then
  1779. PREVPATH="$ONELINE"
  1780. echo "$ONELINE" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${PKGL}
  1781. else
  1782. NEWPATH="`dirname "$ONELINE"`"
  1783. [ "$NEWPATH" == "/" ] && continue #ignore top-level files.
  1784. NEWFILE="`basename "$ONELINE"`"
  1785. if [ -e "rootfs-complete${ONELINE}" ];then #sanity check.
  1786. if [ "$PREVPATH" == "$NEWPATH" -o "$PREVPATH0" == "$NEWPATH" ];then #sanity check. 121010
  1787. echo " ${NEWFILE}" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${PKGL}
  1788. fi
  1789. fi
  1790. fi
  1791. done
  1792. done < /tmp/rootfs-packages.specs
  1793. rm -f /tmp/rootfs-packages.specs
  1794. fi
  1795. echo
  1796. 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||||
  1797. " > 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/pet.specs
  1798. rm -f 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.pet 2>/dev/null
  1799. dir2tgz 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  1800. tgz2pet 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.tar.gz
  1801. rm -rf /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
  1802. echo
  1803. echo "installing pkg lists into rootfs-complete/root/.packages/builtin_files..."
  1804. cp -a -f 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files rootfs-complete/root/.packages/builtin_files
  1805. echo '...done'
  1806. #140615
  1807. echo "Removing redundant aufs-utils..."
  1808. for r in auibusy auplink mount.aufs umount.aufs aufs libau.so* aufs aufs.5 aubrsync aubusy auchk
  1809. do find rootfs-complete/ -type f -name $r -delete
  1810. echo "deleting $r"
  1811. done
  1812. #140616 remove firmware - in kernel-modules.sfs = $ZDRVSFS
  1813. echo "Removing redundant firmware as it is in the z drive"
  1814. rm -rf rootfs-complete/lib/firmware 2>/dev/null
  1815. #150624 remove redundant stuff from 'all-firmware'
  1816. for fw in agrsm hso iwlwifi libertas* madwifi* mwl8k mwave* nozomi RTL8192E rt2x00 rtl_nic rtlwifi brcm;do
  1817. echo "removing $fw"
  1818. rm -rf rootfs-complete/lib/modules/all-firmware/${fw} 2>/dev/null
  1819. done
  1820. sleep 1
  1821. #100613 create font cache for fontconfig (in /var/cache/fontconfig)...
  1822. echo
  1823. echo "Creating Fontconfig cache files..."
  1824. rm -rf rootfs-complete/var/cache/fontconfig
  1825. mkdir -p rootfs-complete/var/cache/fontconfig
  1826. #111123 ***NOTICE*** cross-build, this will have to be executed at first boot...
  1827. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1828. chroot rootfs-complete /usr/bin/fc-cache -s -v
  1829. fi
  1830. if [ ! -e rootfs-complete/usr/bin/pango-querymodules ];then #110517 debian squeeze hack
  1831. #cp -f devx/usr/bin/pango-querymodules rootfs-complete/usr/bin/
  1832. cp -f ../packages-${DISTRO_FILE_PREFIX}/pango_DEV/usr/bin/pango-querymodules rootfs-complete/usr/bin/
  1833. fi
  1834. #100622 slackware 13.1: this file is zero bytes...
  1835. #111123 ***NOTICE*** cross-build, this will have to be executed at first boot...
  1836. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1837. PANGOMODULES="`find rootfs-complete/etc/pango -type f -name pango.modules | sed -e 's%rootfs-complete%%'`"
  1838. [ "$PANGOMODULES" = "" ] && PANGOMODULES='/etc/pango/pango.modules'
  1839. if [ ! -s rootfs-complete${PANGOMODULES} ];then
  1840. echo "/usr/bin/pango-querymodules > ${PANGOMODULES}" > rootfs-complete/zz
  1841. chroot rootfs-complete /bin/ash zz
  1842. rm -f rootfs-complete/zz
  1843. fi
  1844. fi
  1845. #110622 hack for mageia 1 (otherwise can't find pango.modules)...
  1846. if [ -d rootfs-complete/etc/pango/i386 ];then
  1847. cp -a -f rootfs-complete/etc/pango/pango.modules rootfs-complete/etc/pango/i386/
  1848. [ -f rootfs-complete/etc/pango/pangox.aliases ] && cp -a -f rootfs-complete/etc/pango/pangox.aliases rootfs-complete/etc/pango/i386/
  1849. fi
  1850. #110622 /etc/rc.d/rc.update executes: gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
  1851. #however, mageia1 requires above file to be at /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
  1852. #create a symlink...
  1853. VERDIR=''
  1854. if [ -d rootfs-complete/usr/lib${lsuffix}/gdk-pixbuf-2.0 ];then
  1855. [ ! -f rootfs-complete/etc/gtk-2.0/gdk-pixbuf.loaders ] && touch rootfs-complete/etc/gtk-2.0/gdk-pixbuf.loaders
  1856. PIXBUFLOADERSDIR="`find rootfs-complete/usr/lib${lsuffix}/gdk-pixbuf-2.0 -maxdepth 2 -mindepth 2 -type d -name loaders | head -n 1`"
  1857. if [ "$PIXBUFLOADERSDIR" ];then
  1858. PIXBUFCACHEDIR="`dirname $PIXBUFLOADERSDIR`"
  1859. VERDIR="`basename $PIXBUFCACHEDIR`" #2.10.0
  1860. ln -snf ../../../../etc/gtk-2.0/gdk-pixbuf.loaders ${PIXBUFCACHEDIR}/loaders.cache #110903 change -s to -snf
  1861. #there may be some loaders in wrong place...
  1862. [ -d rootfs-complete/usr/lib${lsuffix}/gtk-2.0/loaders ] && mv -f rootfs-complete/usr/lib${lsuffix}/gtk-2.0/loaders/*.so ${PIXBUFLOADERSDIR}/ 2>/dev/null
  1863. if [ -d rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders ];then
  1864. mv -f rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders/*.so ${PIXBUFLOADERSDIR}/ 2>/dev/null
  1865. rmdir rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders #111114
  1866. ln -s ../../gdk-pixbuf-2.0/${VERDIR}/loaders rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders #111114
  1867. else #111117
  1868. ln -s ../../gdk-pixbuf-2.0/${VERDIR}/loaders rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders
  1869. fi
  1870. fi
  1871. fi
  1872. #120605 shinobar ref: http://murga-linux.com/puppy/viewtopic.php?t=76961&start=195
  1873. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
  1874. chroot rootfs-complete /usr/bin/gtk-query-immodules-2.0 > rootfs-complete/etc/gtk-2.0/gtk.immodules
  1875. else
  1876. touch rootfs-complete/etc/gtk-2.0/gtk.immodules
  1877. fi
  1878. [ "$VERDIR" ] && ln -snf ../../../../etc/gtk-2.0/gtk.immodules rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/gtk.immodules
  1879. #100627 recent versions of xorg server, turn modesetting on... 110822 improve...
  1880. mkdir -p rootfs-complete/etc/modprobe.d
  1881. #110621 need to chroot...
  1882. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  1883. XORGINFO="`chroot rootfs-complete /usr/bin/Xorg -version 2>&1`"
  1884. XORGVER="`echo "$XORGINFO" | grep '^X\.Org' | rev | cut -f 1 -d ' ' | rev`"
  1885. else
  1886. #cross-build, assume recent xorg...
  1887. XORGVER='1.7.7'
  1888. fi
  1889. [ "$XORGVER" = "" ] && XORGVER="`echo "$XORGINFO" | grep '^X Window System Version' | rev | cut -f 1 -d ' ' | rev`" #xorg 7.3
  1890. [ "$XORGVER" = "" ] && XORGVER="1.3.0" #precaution. version used in original Xorg 7.3.
  1891. if vercmp "$XORGVER" gt "1.7.6";then
  1892. #120616 no, don't do this...
  1893. ##120516 check that these drivers exist...
  1894. #EXTRADRVPTH=''
  1895. #[ -d rootfs-complete/usr/X11R7/lib/dri ] && EXTRADRVPTH='rootfs-complete/usr/X11R7/lib/dri'
  1896. #[ -d rootfs-complete/usr/lib/dri ] && EXTRADRVPTH="${EXTRADRVPTH} rootfs-complete/usr/lib/dri"
  1897. #[ ! "$EXTRADRVPTH" ] && EXTRADRVPTH='/usr/lib'
  1898. #DRILIST=''
  1899. #for AXDRI in i915_dri.so radeon_dri.so nouveau_dri.so
  1900. #do
  1901. # if find ${EXTRADRVPTH} -mindepth 1 -maxdepth 1 -name ${AXDRI}; then
  1902. # ADRI="`echo -n "$AXDRI" | cut -f 1 -d '_'`"
  1903. # DRILIST="${DRILIST}${ADRI} "
  1904. # fi
  1905. #done
  1906. #120616 do this...
  1907. DRILIST='i915 radeon nouveau'
  1908. [ "$SDFLAG" ] && DRILIST='' #assume not using kms at all when boot from sd card (arm arch).
  1909. if [ "$DRILIST" != "" ];then
  1910. echo
  1911. echo "Certain Xorg drivers require KMS (Kernel ModeSetting)"
  1912. echo "A value of '1' means on, '0' means off."
  1913. echo "Press ENTER key only to accept the default, any other char to flip:"
  1914. for XDRIVER in $DRILIST #i915 radeon nouveau
  1915. do
  1916. KMSFLG='1'
  1917. #[ "$XDRIVER" = "radeon" ] && [ "$DISTRO_BINARY_COMPAT" = "slackware" ] && KMSFLG='0' #01micko.
  1918. #[ "$XDRIVER" = "radeon" ] && KMSFLG='0' #110918 seems need this off. 120526 try default on. 120605 turn off. 120903 on again.
  1919. echo -n "${XDRIVER} [${KMSFLG}]: "
  1920. read KMSREPLY
  1921. if [ "$KMSREPLY" ];then #110906 fix syntax error.
  1922. #not the default...
  1923. case $KMSFLG in
  1924. 0) echo "options ${XDRIVER} modeset=1" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf ;;
  1925. 1) echo "options ${XDRIVER} modeset=0" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf ;;
  1926. esac
  1927. else
  1928. echo "options ${XDRIVER} modeset=${KMSFLG}" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf
  1929. fi
  1930. done
  1931. fi
  1932. fi
  1933. #140619 ui_ziggy choice
  1934. echo
  1935. echo "Do you want the PPM2 or the Classic gui for PPM?"
  1936. echo "hit \"c\" [enter] for Classic, Enter only for PPM2."
  1937. read UICHOICE
  1938. if [ "$UICHOICE" = "c" ];then
  1939. mkdir -p rootfs-complete/var/local/petget
  1940. echo "Classic" > rootfs-complete/var/local/petget/ui_choice
  1941. else
  1942. echo "Leaving PPM2 gui"
  1943. fi
  1944. echo
  1945. # fix CUPS thanks to jamesbond, shinobar
  1946. # re http://www.murga-linux.com/puppy/viewtopic.php?p=784181#784181
  1947. echo "Fixing permissions on CUPS libraries.."
  1948. chmod 0755 rootfs-complete/usr/lib${lsuffix}/cups/backend
  1949. chmod 0755 rootfs-complete/usr/lib${lsuffix}/cups/filter
  1950. chmod 500 rootfs-complete/usr/lib${lsuffix}/cups/backend/*
  1951. echo
  1952. #110213 fix if .utf8 entries missing...
  1953. if [ "`grep 'nb_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  1954. echo 'nb_NO.utf8: nb_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  1955. fi
  1956. if [ "`grep 'nn_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  1957. echo 'nn_NO.utf8: nn_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  1958. fi
  1959. if [ "`grep 'ru_UA\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  1960. echo 'ru_UA.utf8: ru_UA.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  1961. fi
  1962. if [ "`grep 'ru_RU\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
  1963. echo 'ru_RU.utf8: ru_RU.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
  1964. fi
  1965. #110329 some python files, move to 'devx'...
  1966. #121022 but only if python is supposed to be in devx...
  1967. if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" != "" ];then
  1968. PYTHONDIR=''
  1969. [ -d rootfs-complete/usr/lib${lsuffix}/python2.5 ] && PYTHONDIR='python2.5'
  1970. [ -d rootfs-complete/usr/lib${lsuffix}/python2.6 ] && PYTHONDIR='python2.6'
  1971. [ -d rootfs-complete/usr/lib${lsuffix}/python2.7 ] && PYTHONDIR='python2.7'
  1972. if [ "$PYTHONDIR" ];then
  1973. mkdir -p devx/usr/lib${lsuffix}/${PYTHONDIR}
  1974. cp -a -f --remove-destination rootfs-complete/usr/lib${lsuffix}/${PYTHONDIR}/* devx/usr/lib${lsuffix}/${PYTHONDIR}/
  1975. rm -rf rootfs-complete/usr/lib${lsuffix}/${PYTHONDIR}
  1976. fi
  1977. fi
  1978. #110412 move all .bac, .pot and .pupdev files to 'devx'...
  1979. find rootfs-complete/usr -type f -name '*.pot' -o -name '*.pupdev' -o -name '*.bac' |
  1980. while read ONEPD
  1981. do
  1982. DESTDIR="`dirname "$ONEPD" | sed -e 's%rootfs\-complete%%'`"
  1983. mkdir -p "devx${DESTDIR}"
  1984. mv -f "$ONEPD" "devx${DESTDIR}/"
  1985. done
  1986. #120224 move rootfs-complete/usr/share/doc/nls to 'devx'...
  1987. mkdir -p devx/usr/share/doc/nls
  1988. cp -a -f rootfs-complete/usr/share/doc/nls/* devx/usr/share/doc/nls/
  1989. rm -r -f rootfs-complete/usr/share/doc/nls
  1990. #110417 this may be helpful for more apps than Thunar...
  1991. #this will make Thunar use ROX-Filer's icons for files...
  1992. if [ -d rootfs-complete/usr/local/apps/ROX-Filer/ROX/MIME ];then
  1993. if [ ! -e rootfs-complete/usr/share/icons/hicolor/48x48/mimetypes ];then
  1994. ln -s ../../../../local/apps/ROX-Filer/ROX/MIME rootfs-complete/usr/share/icons/hicolor/48x48/mimetypes
  1995. fi
  1996. fi
  1997. #110421 get version compare utility...
  1998. cp -f ../boot/initrd-tree0/bin/vercmp rootfs-complete/bin/
  1999. #110429 fix just in case...
  2000. busybox chown -h -R spot:spot rootfs-complete/root/spot
  2001. #110429 this is difficult. may need a fix, think want glibc scsi headers in usr/include/scsi...
  2002. mkdir -p devx/usr/include
  2003. if [ -d ../packages-${DISTRO_FILE_PREFIX}/linux_headers_DEV/usr/include/scsi ];then
  2004. cp -a ../packages-${DISTRO_FILE_PREFIX}/linux_headers_DEV/usr/include/scsi devx/usr/include/scsi-KERNEL
  2005. fi
  2006. if [ -d ../packages-${DISTRO_FILE_PREFIX}/linux-header_DEV/usr/include/scsi ];then
  2007. cp -a ../packages-${DISTRO_FILE_PREFIX}/linux-header_DEV/usr/include/scsi devx/usr/include/scsi-KERNEL
  2008. fi
  2009. if [ -d ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/usr/include/scsi ];then
  2010. cp -a ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/usr/include/scsi devx/usr/include/scsi-GLIBC
  2011. fi
  2012. #also see further down, when building devx.
  2013. ##110517 kms may need to be turned on... ALREADY DONE, SEE 110621 ABOVE
  2014. #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.
  2015. #[ ! $XINTELMINOR ] && XINTELMINOR=`grep '^xf86-video-intel' rootfs-complete/root/.packages/woof-installed-packages | cut -f 3 -d '|' | cut -f 2 -d '.'`
  2016. #[ ! $XINTELMINOR ] && XINTELMINOR=0
  2017. #if [ $XINTELMINOR -gt 9 ];then
  2018. # echo 'options i915 modeset=1' > rootfs-complete/etc/modprobe.d/i915.conf
  2019. # [ "`grep '^xserver-xorg-video-nouveau' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options nouveau modeset=1' > rootfs-complete/etc/modprobe.d/nvidia.conf
  2020. # [ "`grep '^xf86-video-nouveau' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options nouveau modeset=1' > rootfs-complete/etc/modprobe.d/nvidia.conf
  2021. # [ "`grep '^xserver-xorg-video-radeon' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options radeon modeset=1' > rootfs-complete/etc/modprobe.d/radeon.conf
  2022. # [ "`grep '^xf86-video-radeon' rootfs-complete/root/.packages/woof-installed-packages`" != "" ] && echo 'options radeon modeset=1' > rootfs-complete/etc/modprobe.d/radeon.conf
  2023. #fi
  2024. #110523 override files from rootfs-skeleton/root/Choices/MIME-types, if rox pkg has older files...
  2025. cp -a -f ../rootfs-skeleton/root/Choices/MIME-types/* rootfs-complete/root/Choices/MIME-types/
  2026. #110620 do same for mime icons...
  2027. cp -a -f --remove-destination ../rootfs-skeleton/usr/local/apps/ROX-Filer/ROX/MIME/* rootfs-complete/usr/local/apps/ROX-Filer/ROX/MIME/
  2028. #110806 if yad installed, no zenity, make sure zenity is symlink to yad...
  2029. 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`"
  2030. if [ "$YAD" ];then
  2031. ZENITY="`find ./rootfs-complete/bin ./rootfs-complete/sbin ./rootfs-complete/usr/bin ./rootfs-complete/usr/sbin ./rootfs-complete/usr/local/bin -name zenity`"
  2032. if [ ! "$ZENITY" ];then
  2033. YADDIR="`dirname $YAD`"
  2034. ln -s yad ${YADDIR}/zenity
  2035. fi
  2036. fi
  2037. #110901 temp hack, if only have gtkdialog4 pkg...
  2038. if [ ! -e rootfs-complete/usr/sbin/gtkdialog3 ];then
  2039. if [ ! -e rootfs-complete/usr/bin/gtkdialog3 ];then
  2040. [ -e rootfs-complete/usr/sbin/gtkdialog4 ] && ln -s gtkdialog4 rootfs-complete/usr/sbin/gtkdialog3
  2041. [ -e rootfs-complete/usr/bin/gtkdialog4 ] && ln -s gtkdialog4 rootfs-complete/usr/bin/gtkdialog3
  2042. fi
  2043. fi
  2044. #110910 make sure gtkdialog links to latest...
  2045. if [ ! -e rootfs-complete/usr/sbin/gtkdialog ];then
  2046. [ -e rootfs-complete/usr/sbin/gtkdialog3 ] && ln -s gtkdialog3 rootfs-complete/usr/sbin/gtkdialog
  2047. [ -e rootfs-complete/usr/sbin/gtkdialog4 ] && ln -snf gtkdialog4 rootfs-complete/usr/sbin/gtkdialog
  2048. fi
  2049. #110822 some customisations provided by 01micko for Slacko...
  2050. #if [ "$DISTRO_BINARY_COMPAT" = "slackware" ];then
  2051. if [ "$DISTRO_FILE_PREFIX" = "slacko" ];then #130321
  2052. if [ -f ../support/slacko/woof_base_hack ];then
  2053. echo "Running Slacko customization script ../support/slacko/woof_base_hack..."
  2054. ../support/slacko/woof_base_hack
  2055. fi
  2056. fi
  2057. #111123 put this into target, want to know if cross-build at 1st boot (see rc.update)...
  2058. [ -f ../WOOFMERGEVARS ] && cp -f ../WOOFMERGEVARS rootfs-complete/etc/rc.d/
  2059. #120522 precise puppy, seamonkey was crashing. needed /usr/share/glib-2.0/schemas/apps.gecko-mediaplayer.preferences,
  2060. # but also needs this compile operation...
  2061. # ***NOTICE*** cross-build, this will have to be executed at first boot...
  2062. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
  2063. if [ -d rootfs-complete/usr/share/glib-2.0/schemas ];then
  2064. [ -e rootfs-complete/usr/bin/glib-compile-schemas ] && chroot rootfs-complete /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
  2065. fi
  2066. #120523 seems need this too...
  2067. if [ -d rootfs-complete/usr/lib${lsuffix}/gio/modules ];then
  2068. [ -e rootfs-complete/usr/bin/gio-querymodules ] && chroot rootfs-complete /usr/bin/gio-querymodules /usr/lib${lsuffix}/gio/modules
  2069. fi
  2070. fi
  2071. #120618 raspi debian squeeze, links as main browser, helpsurfer html viewer, gtkmoz missing...
  2072. #120620 problem, helpsurfer cannot display /usr/share/doc/index.html, so do not point gtkmoz at basichtmlviewer...
  2073. if [ ! -e rootfs-complete/usr/local/bin/gtkmoz ];then
  2074. ln -s defaultbrowser rootfs-complete/usr/local/bin/gtkmoz
  2075. fi
  2076. #120704 some constraints in a small system...
  2077. if [ "$SDFLAG" != "" ];then
  2078. #ask if want to load swap partition/file...
  2079. echo
  2080. echo "Puppy will normally load a swap partition or swap file if it/they exist,
  2081. however you can choose to ignore them and not load them at bootup."
  2082. echo -n "Press ENTER key to load swap at bootup, any key otherwise: "
  2083. read wantswap
  2084. if [ "$wantswap" != "" ];then
  2085. echo "BOOT_DISABLESWAP='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #read by /etc/rc.d/rc.sysinit
  2086. echo "...BOOT_DISABLESWAP='yes' in /etc/rc.d/BOOTCONSTRAINED, read by rc.sysinit."
  2087. fi
  2088. #this also reduces writes to flash card... um, relatime seems to be the default anyway... 120707 change to noatime...
  2089. echo "BOOT_ATIME='noatime'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #rc.sysinit will remount / with 'relatime' (constrains updating access time). 120707 change to noatime.
  2090. #this file in rootfs-skeleton, overwrite...
  2091. echo 'none /proc proc defaults,noatime 0 0
  2092. none /sys sysfs defaults,noatime 0 0
  2093. none /dev/pts devpts gid=2,mode=620,noatime 0 0
  2094. shmfs /dev/shm tmpfs defaults,noatime 0 0' > rootfs-complete/etc/fstab
  2095. echo "BOOT_DIRTYWRITE='1500'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #defer writing to disk. refer: http://www.lesswatts.org/tips/disks.php
  2096. 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/
  2097. #echo "BOOT_QUICKSETUP='quickarm'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120708 leaves out X config frame. 120714 removed.
  2098. 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.
  2099. echo "BOOT_BOARD='${BOOT_BOARD}'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120714 read by quicksetup.
  2100. echo "BOOT_DISABLEXORGWIZARD='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120723 read in xwin, also xorgwizard. also see below.
  2101. echo "BOOT_DISABLEALSACONF='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED #120724 'alsaconf' does not work on arm boards.
  2102. fi
  2103. #120723 code moved down, add BOOT_DISABLEXORGWIZARD test...
  2104. #110413 variable DISTRO_XORG_AUTO in /etc/DISTRO_SPECS, see also /usr/bin/xwin
  2105. autoflag='no'
  2106. if [ "$BOOT_DISABLEXORGWIZARD" != "yes" ];then
  2107. if [ "$DISTRO_XORG_AUTO" ];then
  2108. autoflag="$DISTRO_XORG_AUTO"
  2109. else
  2110. if vercmp "$XORGVER" ge "1.7.0";then #110621
  2111. echo
  2112. echo "Do you want Xorg to start automatically at first boot (or at 'pfix=ram'"
  2113. echo "kernel boot param) or run Xorg Wizard? The latter has been the case for"
  2114. echo "earlier puppies. Automatic startup of X usually works, though in some"
  2115. echo "cases may choose the wrong monitor resolution or driver -- which can be"
  2116. echo "fixed by running Xorg Wizard afterward."
  2117. echo -n "Press ENTER only for automatic Xorg: "
  2118. read xorgauto
  2119. [ "$xorgauto" = "" ] && autoflag='yes'
  2120. fi
  2121. fi
  2122. fi
  2123. if [ "`grep '^DISTRO_XORG_AUTO' rootfs-complete/etc/DISTRO_SPECS`" = "" ];then #110621
  2124. echo "DISTRO_XORG_AUTO='${autoflag}'" >> rootfs-complete/etc/DISTRO_SPECS
  2125. else
  2126. REGEXauto="s%^DISTRO_XORG_AUTO.*%DISTRO_XORG_AUTO='${autoflag}'%"
  2127. sed -i -e "$REGEXauto" rootfs-complete/etc/DISTRO_SPECS
  2128. fi
  2129. #121123 want this info in ppm...
  2130. 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
  2131. echo "DISTRO_ARCHDIR='${ARCHDIR}'" >> rootfs-complete/etc/DISTRO_SPECS
  2132. echo "DISTRO_ARCHDIR='${ARCHDIR}'" >> initrd-tree/DISTRO_SPECS
  2133. #130114 revert...
  2134. ##130112 just in case 2createpackages did not set this variable...
  2135. #[ "$DISTRO_ARCHDIR_SYMLINKS" = "" ] && echo "DISTRO_ARCHDIR_SYMLINKS='${xDISTRO_ARCHDIR_SYMLINKS}'" >> rootfs-complete/etc/DISTRO_SPECS
  2136. #[ "$DISTRO_ARCHDIR_SYMLINKS" = "" ] && echo "DISTRO_ARCHDIR_SYMLINKS='${xDISTRO_ARCHDIR_SYMLINKS}'" >> initrd-tree/DISTRO_SPECS
  2137. #120709 debian squeeze has /usr/share/misc/pci.ids, usb.ids, which confuses some apps, create symlinks...
  2138. if [ ! -e rootfs-complete/usr/share/pci.ids ];then
  2139. if [ -e rootfs-complete/usr/share/misc/pci.ids ];then
  2140. ln -s misc/pci.ids rootfs-complete/usr/share/pci.ids
  2141. fi
  2142. fi
  2143. if [ ! -e rootfs-complete/usr/share/usb.ids ];then
  2144. if [ -e rootfs-complete/usr/share/misc/usb.ids ];then
  2145. ln -s misc/usb.ids rootfs-complete/usr/share/usb.ids
  2146. fi
  2147. fi
  2148. #120830 my hunspell-en-us pet has pinstall.sh that creates symlinks of en_US.aff and en_US.dic
  2149. #from seamonkey and firefox. however, need to do this thoroughly...
  2150. #note: see also woof rootfs-skeleton/usr/share/doc/langpack-template (used by momanager).
  2151. if [ -d rootfs-complete/usr/share/hunspell ];then
  2152. for ONEHUN in `find rootfs-complete/usr/share/hunspell -mindepth 1 -maxdepth 1 -type f -name '*.dic' -o -name '*.aff' | tr '\n' ' '`
  2153. do
  2154. HUNBASE="`basename $ONEHUN`"
  2155. DICTDIRS="`find rootfs-complete/usr/lib -mindepth 2 -maxdepth 2 -type d -name dictionaries | tr '\n' ' '`"
  2156. for ONEDICTDIR in $DICTDIRS
  2157. do
  2158. [ ! -e ${ONEDICTDIR}/${HUNBASE} ] && ln -s ../../../share/hunspell/${HUNBASE} ${ONEDICTDIR}/${HUNBASE}
  2159. done
  2160. done
  2161. fi
  2162. #121022 may need this (see below similar code if python in devx)...
  2163. if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" = "" ];then
  2164. [ -e rootfs-complete/usr/bin/python2.5 ] && ln -s python2.5 rootfs-complete/usr/bin/python 2>/dev/null
  2165. [ -e rootfs-complete/usr/bin/python2.6 ] && ln -s python2.6 rootfs-complete/usr/bin/python 2>/dev/null
  2166. [ -e rootfs-complete/usr/bin/python2.7 ] && ln -s python2.7 rootfs-complete/usr/bin/python 2>/dev/null
  2167. fi
  2168. #121203 bacon hug gui apps need some .so libs, for example libgtk-x11-2.0.so,
  2169. #(refer /usr/sbin/welcome1stboot.bac), however these are only in the devx.
  2170. #so need to create them...
  2171. #note, i think this problem only in wary/racy, as gtk template creates these symlinks.
  2172. if [ ! -e rootfs-complete/usr/lib${lsuffix}/libgtk-x11-2.0.so ];then
  2173. 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)"
  2174. [ "$FNDGTKLIB" ] && ln -s $FNDGTKLIB rootfs-complete/usr/lib${lsuffix}/libgtk-x11-2.0.so #2> /dev/null
  2175. fi
  2176. #i'll do the same for libgdk-x11-2.0.so ...
  2177. if [ ! -e rootfs-complete/usr/lib${lsuffix}/libgdk-x11-2.0.so ];then
  2178. 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)"
  2179. [ "$FNDGTKLIB" ] && ln -s $FNDGTKLIB rootfs-complete/usr/lib${lsuffix}/libgdk-x11-2.0.so #2> /dev/null
  2180. fi
  2181. #121212 puinstall.sh was not getting removed...
  2182. [ -f rootfs-complete/puninstall.sh ] && rm -f rootfs-complete/puninstall.sh
  2183. #130326 now permanently 96... 130327 reintroduce a choice...
  2184. ##130129 /root/.Xresources has dpi set to 78 in all prior pups. In future, might prefer 96...
  2185. #141206 now have DEFAULT_THEME_XORG_TEXT_DPI (usually =96).
  2186. if [ "$DEFAULT_THEME_XORG_TEXT_DPI" != "" ];then #141206
  2187. dpisizeflag="$DEFAULT_THEME_XORG_TEXT_DPI"
  2188. else
  2189. DPILINE="$(grep '^Xft\.dpi:' rootfs-complete/root/.Xresources)"
  2190. DPIVALUE=$(echo -n "$DPILINE" | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' ')
  2191. echo
  2192. echo "rootfs-complete/root/.Xresources has this line:"
  2193. echo "$DPILINE"
  2194. echo "which sets the displayed size of fonts on the screen (but not bitmap fonts)."
  2195. DPINEXT1=`expr $DPIVALUE + 6`
  2196. DPINEXT2=`expr $DPINEXT1 + 6`
  2197. echo "To accept this size, just press ENTER key."
  2198. echo "However, if you would like fonts to display bigger on the screen, type in
  2199. a value now. The value should be in steps of 6, for example ${DPINEXT1} or ${DPINEXT2}.
  2200. The default size is ${DPIVALUE}, you might try the next-up, ${DPINEXT1}."
  2201. echo -n "Press ENTER key for '${DPIVALUE}' dpi, or type a value: "
  2202. read dpisizeflag
  2203. fi
  2204. if [ "$dpisizeflag" ];then #130512 scsijon: fix size...
  2205. fsPTN='s%^Xft\.dpi:.*%Xft.dpi: '"${dpisizeflag}%"
  2206. sed -i -e "$fsPTN" rootfs-complete/root/.Xresources
  2207. echo "...ok, dpi now ${dpisizeflag}"
  2208. fi
  2209. #130226 wary: /usr/bin/X was missing...
  2210. if [ ! -e rootfs-complete/usr/bin/X ];then
  2211. if [ -e rootfs-complete/usr/bin/Xorg -o -h rootfs-complete/usr/bin/Xorg ];then
  2212. ln -s Xorg rootfs-complete/usr/bin/X
  2213. fi
  2214. fi
  2215. #130601 optional, run internet apps as user 'spot'...
  2216. echo
  2217. echo "Puppy is normally run as the 'administrator' (root) user, though there is
  2218. also 'fido' which is not currently very mature.
  2219. The structure of Puppy is such that we consider root to be safe (with a full
  2220. disclaimer of any responsibility if anything does go wrong), but there is a
  2221. compromise, to run as root but to run Internet apps as user 'spot'."
  2222. if [ -e rootfs-complete/usr/lib${lsuffix}/seamonkey ];then
  2223. echo
  2224. echo "Type any character then ENTER if you want SeaMonkey to run as spot,
  2225. or just ENTER not to. Note, in a running 'Puppy Menu->System->Login & Security
  2226. Manager' can be used to enable or disable running as spot."
  2227. echo
  2228. echo -n "ENTER only to not run SeaMonkey as spot: "
  2229. read SPOTAPPS
  2230. if [ "$SPOTAPPS" ];then
  2231. ../support/setup-spot 'seamonkey=true' #130604
  2232. echo '...ok, SeaMonkey will run as spot.'
  2233. else
  2234. echo 'seamonkey=false' > rootfs-complete/root/.spot-status #130604 so that an unticked checkbox will display in loginmanager.
  2235. echo '...ok, SeaMonkey will not run as spot.'
  2236. fi
  2237. fi
  2238. if [ -e rootfs-complete/usr/lib${lsuffix}/firefox* ];then
  2239. echo
  2240. echo "Type any character then ENTER if you want firefox to run as spot,
  2241. or just ENTER not to. Note, in a running Puppy 'Menu->System->Login & Security
  2242. Manager' can be used to enable or disable running as spot."
  2243. echo
  2244. echo -n "ENTER only to not run firefox as spot: "
  2245. read SPOTAPPS
  2246. if [ "$SPOTAPPS" ];then
  2247. ../support/setup-spot "firefox=true"
  2248. echo "...ok, firefox will run as spot."
  2249. else
  2250. echo "firefox=false" >> rootfs-complete/root/.spot-status #so that an unticked checkbox will display in loginmanager.
  2251. echo "...ok, firefox will not run as spot."
  2252. fi
  2253. fi
  2254. #130720 add QtWeb... 130723 add opera... 130821 add firefox... 132211 firefox didn't work, separate, see above
  2255. for AINTERNETAPP in QtWeb opera
  2256. do
  2257. [ -e rootfs-complete/usr/bin/${AINTERNETAPP} ] || continue
  2258. echo
  2259. echo "Type any character then ENTER if you want ${AINTERNETAPP} to run as spot,
  2260. or just ENTER not to. Note, in a running Puppy 'Menu->System->Login & Security
  2261. Manager' can be used to enable or disable running as spot."
  2262. echo
  2263. echo -n "ENTER only to not run ${AINTERNETAPP} as spot: "
  2264. read SPOTAPPS
  2265. if [ "$SPOTAPPS" ];then
  2266. ../support/setup-spot "${AINTERNETAPP}=true"
  2267. echo "...ok, ${AINTERNETAPP} will run as spot."
  2268. else
  2269. echo "${AINTERNETAPP}=false" >> rootfs-complete/root/.spot-status #so that an unticked checkbox will display in loginmanager.
  2270. echo "...ok, ${AINTERNETAPP} will not run as spot."
  2271. fi
  2272. done
  2273. #setup-spot is also called by the Login & Security Manager in running Puppy...
  2274. cp -f ../support/setup-spot rootfs-complete/usr/sbin/
  2275. #130618 code above sets DEVTMPFSFLG...
  2276. #130612 if kernel has CONFIG_DEVTMPFS=y (and CONFIG_DEVTMPFS_MOUNT=y) then empty /dev...
  2277. #if [ $DEVTMPFSFLG -ne 0 ];then
  2278. #rm -rf rootfs-complete/dev/* #see also 'init' script in initrd.
  2279. #sed -i -e 's%^DEVTMPFSFLG=.*%DEVTMPFSFLG=2%' rootfs-complete/etc/rc.d/rc.sysinit
  2280. #fi
  2281. #130725 want Menu -> Help to use secondary browser... 130726 fix...
  2282. #code to detect dual browsers, taken out of /usr/sbin/delayedrun...
  2283. ALTBROWSER=''
  2284. #the pinstall.sh script in qtweb and opera pets create separate desktop icon if there is another major browser...
  2285. [ "`grep 'QtWeb' rootfs-complete/root/Choices/ROX-Filer/PuppyPin`" != "" ] && ALTBROWSER='QtWeb'
  2286. [ "`grep 'opera' rootfs-complete/root/Choices/ROX-Filer/PuppyPin`" != "" ] && ALTBROWSER='opera'
  2287. if [ "$ALTBROWSER" != "" ];then
  2288. MAINBROWSER="`grep '^exec' rootfs-complete/usr/local/bin/defaultbrowser | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' '`"
  2289. if [ "$MAINBROWSER" != "$ALTBROWSER" ];then
  2290. echo '#!/bin/sh' > rootfs-complete/usr/local/bin/defaulthtmlviewer
  2291. echo "exec ${ALTBROWSER} \"\$@\"" >> rootfs-complete/usr/local/bin/defaulthtmlviewer
  2292. chmod 755 rootfs-complete/usr/local/bin/defaulthtmlviewer
  2293. fi
  2294. fi
  2295. rm -rf rootfs-complete/tmp/* #121123 some above chroot operations may have left something behind in here.
  2296. BUILD_SFS='yes'
  2297. if [ "$SDFLAG" != "" ]; then
  2298. echo
  2299. echo "Since you are building a SD card image, it is not necessary"
  2300. echo "to build the main sfs file. Press ENTER only to skip,"
  2301. echo "any other character then ENTER to build it anyway."
  2302. read buildanyway
  2303. if [ "$buildanyway" = '' ]; then
  2304. BUILD_SFS='no'
  2305. fi
  2306. fi
  2307. if [ "$BUILD_SFS" = 'yes' ]; then
  2308. ###########
  2309. #build the rootfs-complete sfs...
  2310. echo
  2311. echo "Now building the main f.s., ${PUPPYSFS}..."
  2312. sync
  2313. rm -f build/${PUPPYSFS} 2>/dev/null
  2314. ${MKSQUASHFS} rootfs-complete build/${PUPPYSFS} ${COMPCHOICE} #100911 110713
  2315. sync
  2316. echo -n "$IDSTRING" >> build/${PUPPYSFS} #100911 16-byte id-string appended to file.
  2317. sync
  2318. ###########
  2319. fi # if BUILD_SFS
  2320. #if separate 'zdrv' exists, copy that into live-cd also...
  2321. # delete this as we need zdrv and it's there already
  2322. ##create isolinux.cfg...
  2323. #echo "Creating build/isolinux.cfg..."
  2324. #echo "default puppy
  2325. #display boot.msg
  2326. #prompt 1
  2327. #label puppy
  2328. #kernel vmlinuz
  2329. #append initrd=initrd.gz pmedia=cd
  2330. #timeout 50" > build/isolinux.cfg
  2331. WOOF_OUTPUT="woof-output-${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}" #woodenshoe-wi idea. #140619
  2332. [ -d ../$WOOF_OUTPUT ] || mkdir -p ../$WOOF_OUTPUT
  2333. #build live-cd .iso file...
  2334. echo "Now building ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso"
  2335. rm -f ../${WOOF_OUTPUT}/${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso 2>/dev/null
  2336. if [ -f rootfs-complete/usr/lib${lsuffix}/syslinux/isolinux.bin ];then
  2337. cp -a rootfs-complete/usr/lib${lsuffix}/syslinux/isolinux.bin build/
  2338. else
  2339. cp -a ../boot/isolinux.bin build/
  2340. fi
  2341. case $DISTRO_FILE_PREFIX in #091203
  2342. wary) #101026
  2343. BOOTLOGO="puppy"
  2344. BOOTLABEL="puppy"
  2345. #REMOVELINE1='pfix=copy' #100916
  2346. REMOVELINE1=''
  2347. VERPREFIX="wary "
  2348. [ "`echo "$DISTRO_NAME" | grep "Racy"`" != "" ] && VERPREFIX="racy " #110917
  2349. ;;
  2350. racy) #110917
  2351. BOOTLOGO="racy-splash" #110928
  2352. BOOTLABEL="puppy"
  2353. REMOVELINE1=''
  2354. VERPREFIX="racy "
  2355. ;;
  2356. sqzd) #110517 squeeze debian
  2357. BOOTLOGO="puppy"
  2358. BOOTLABEL="puppy"
  2359. REMOVELINE1=''
  2360. VERPREFIX="squeezed "
  2361. ;;
  2362. drake|drak) #110721
  2363. BOOTLOGO="puppy"
  2364. BOOTLABEL="puppy"
  2365. REMOVELINE1=''
  2366. VERPREFIX="drake "
  2367. ;;
  2368. q*) #quirky, qurky, qrky
  2369. BOOTLOGO="quirky"
  2370. BOOTLABEL="puppy" #"quirky"
  2371. #REMOVELINE1='pfix=copy'
  2372. VERPREFIX="puppy " #100319
  2373. [ "$DISTRO_FILE_PREFIX" = "qret" ] && VERPREFIX="retro " #100514 quirky-retro.
  2374. ;;
  2375. *)
  2376. BOOTLOGO="puppy"
  2377. BOOTLABEL="puppy"
  2378. #REMOVELINE1='pfix=copy' #100916
  2379. VERPREFIX=""
  2380. ;;
  2381. esac
  2382. #111006 generic mechanism, boot logo for any pup...
  2383. [ -f ../boot/boot-dialog/${DISTRO_FILE_PREFIX}-splash.gif ] && BOOTLOGO="${DISTRO_FILE_PREFIX}-splash"
  2384. blPATTERN="s%BOOTLABEL%${BOOTLABEL}%"
  2385. namePATTERN="s/DISTRO_NAME/${DISTRO_NAME}/"
  2386. verPATTERN="s/DISTRO_VERSION/${DISTRO_VERSION}/"
  2387. prefixPATTERN="s/DISTRO_FILE_PREFIX/${DISTRO_FILE_PREFIX}/"
  2388. sed -e "$namePATTERN" -e "$verPATTERN" -e "$prefixPATTERN" -e "$blPATTERN" ../boot/boot-dialog/help.msg > build/help.msg
  2389. if [ "$REMOVELINE1" != "" ];then
  2390. grep -v "$REMOVELINE1" build/help.msg > /tmp/3builddistro-help.msg
  2391. mv -f /tmp/3builddistro-help.msg build/help.msg
  2392. fi
  2393. #100916 second help screen...
  2394. sed -e "$namePATTERN" -e "$verPATTERN" -e "$prefixPATTERN" -e "$blPATTERN" ../boot/boot-dialog/help2.msg > build/help2.msg
  2395. if [ "$REMOVELINE1" != "" ];then
  2396. grep -v "$REMOVELINE1" build/help2.msg > /tmp/3builddistro-help2.msg
  2397. mv -f /tmp/3builddistro-help2.msg build/help2.msg
  2398. fi
  2399. #130515 asked above whether to disable 'pupdesk.flg' mechanism...
  2400. if [ "$PUPDESKFLG" != "" ];then
  2401. 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
  2402. fi
  2403. cp -f ../boot/boot-dialog/boot.msg build/boot.msg
  2404. cat ../boot/boot-dialog/isolinux.cfg | sed -e "$blPATTERN" > build/isolinux.cfg
  2405. export RGBDEF=/usr/share/X11/rgb.txt
  2406. ../boot/boot-dialog/textongif.sh ../boot/boot-dialog/${BOOTLOGO}.gif "${VERPREFIX}${RIGHTVER}" > logo.gif
  2407. ../boot/boot-dialog/gif2lss logo.gif > build/logo.16
  2408. #120217 translate early-boot splash screens... (expect building with langpack)
  2409. if [ "$DEFAULTLANG" != "en_US" ];then
  2410. DEFAULTLANG1="${DEFAULTLANG%_*}" #ex: de
  2411. DEFAULTLANG12="${DEFAULTLANG%.*}" #ex: de_DE
  2412. SPLASHFILE=""
  2413. [ -f ../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG12} ] && SPLASHFILE="../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG12}"
  2414. [ ! "$SPLASHFILE" ] && [ -f ../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG1} ] && SPLASHFILE="../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG1}"
  2415. if [ "$SPLASHFILE" ];then
  2416. #translate boot.msg...
  2417. sPTN="/^\[boot.msg\]/,/^$/p" #this is a multi-line block find expression.
  2418. CODEBLOCK="`sed -n "$sPTN" ${SPLASHFILE} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`" #extracts just the relevant block of lines.
  2419. if [ "$CODEBLOCK" ];then
  2420. echo "$CODEBLOCK" > /tmp/3builddistro-boot-splash-translation
  2421. sed -i -f /tmp/3builddistro-boot-splash-translation build/boot.msg
  2422. fi
  2423. #translate help.msg...
  2424. sPTN="/^\[help.msg\]/,/^$/p" #this is a multi-line block find expression.
  2425. CODEBLOCK="`sed -n "$sPTN" ${SPLASHFILE} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`" #extracts just the relevant block of lines.
  2426. if [ "$CODEBLOCK" ];then
  2427. echo "$CODEBLOCK" > /tmp/3builddistro-boot-splash-translation
  2428. sed -i -f /tmp/3builddistro-boot-splash-translation build/help.msg
  2429. fi
  2430. fi
  2431. fi
  2432. #110426 help file for Windows users
  2433. CUT2INSERT="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1,2`"
  2434. CUT3INSERT="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1,2,3`"
  2435. cut2PATTERN="s%CUT2INSERT%${CUT2INSERT}%"
  2436. cut3PATTERN="s%CUT3INSERT%${CUT3INSERT}%"
  2437. sed -e "$verPATTERN" -e "$prefixPATTERN" -e "$cut2PATTERN" -e "$cut3PATTERN" ../boot/README.HTM > build/README.HTM
  2438. sync
  2439. if [ "$SDFLAG" = "" ];then #120506
  2440. $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/
  2441. sync
  2442. # 131227 iguleder: made the generated ISO image hybrid, so it can be written to flash drives using dd
  2443. isohybrid="$(which isohybrid)"
  2444. [ -n "$isohybrid" ] && $isohybrid ../${WOOF_OUTPUT}/${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso
  2445. CUR_DIR="$PWD"
  2446. cd ../${WOOF_OUTPUT}
  2447. md5sum ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso > ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso.md5.txt
  2448. cd "$CUR_DIR"
  2449. echo
  2450. echo "Would you like to burn it to a CD? "
  2451. echo -n "ENTER only for yes, or any printable char then ENTER not to: "
  2452. read writeitnow
  2453. if [ "$writeitnow" = "" ];then
  2454. CDR=""
  2455. [ -f /etc/cdburnerdevice ] && CDR="/dev/`cat /etc/cdburnerdevice`"
  2456. [ "$CDR" = "" ] && CDR='/dev/sr0'
  2457. CDDESCR="`probedisk2 | grep '|optical|' | grep "$CDR" | cut -f 3 -d '|'`"
  2458. echo -n 'Type "y" for multisession, else just ENTER: '
  2459. read BURNMULTI
  2460. if [ "$BURNMULTI" = "y" ];then
  2461. BURNMULTI="-multi -tao -pad"
  2462. else
  2463. BURNMULTI="-dao"
  2464. fi
  2465. echo "Please insert blank CD into $CDR
  2466. (which is described as: ${CDDESCR})
  2467. -- also be sure that it is unmounted."
  2468. echo -n "Then hit ENTER key: "
  2469. read yayburn
  2470. # $CDRECORD $BURNMULTI -data -eject -v speed=4 padsize=300k dev=ATAPI:$CDR ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso
  2471. $CDRECORD $BURNMULTI -data -eject -v speed=4 padsize=300k dev=$CDR ../${WOOF_OUTPUT}/${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso
  2472. sync
  2473. eject $CDR
  2474. echo "...done"
  2475. fi
  2476. else #120506 sd image
  2477. echo
  2478. echo "Please choose the SD-card skeleton image file, to suit target board."
  2479. CNT=1
  2480. echo -n "" > /tmp/3builddistro-probeimage
  2481. ls -1 ../sd-skeleton-images | grep 'xz$' | grep "$BOOT_BOARD" | #120714 BOOT_BOARD is raspi, mele, or odroidx.
  2482. while read ONEIMAGE
  2483. do
  2484. echo "${CNT} ${ONEIMAGE}" >> /tmp/3builddistro-probeimage
  2485. CNT=`expr $CNT + 1`
  2486. done
  2487. while [ 1 ];do
  2488. echo
  2489. echo "Type number which is your choice of SD image:"
  2490. cat /tmp/3builddistro-probeimage
  2491. read sdnumber
  2492. SDIMAGE="`cat /tmp/3builddistro-probeimage | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' '`"
  2493. echo -n "You chose '${SDIMAGE}' Press ENTER if correct: "
  2494. read sdcorrect
  2495. [ "$sdcorrect" = "" ] && break
  2496. done
  2497. echo
  2498. echo "Please insert the SD card. Make sure that it is the same size or bigger than
  2499. indicated on the filename of the skeleton image file that you chose."
  2500. echo -n "Press ENTER after it is inserted: "
  2501. read waitinsert
  2502. sleep 2
  2503. while [ 1 ];do
  2504. CNT=1
  2505. echo -n "" > /tmp/3builddistro-probedisk
  2506. probedisk |
  2507. while read ONEPROBE
  2508. do
  2509. echo "${CNT} ${ONEPROBE}" >> /tmp/3builddistro-probedisk
  2510. CNT=`expr $CNT + 1`
  2511. done
  2512. echo
  2513. echo "Type number which is your SD card:"
  2514. cat /tmp/3builddistro-probedisk
  2515. read sdnumber
  2516. SDDEVICE="`cat /tmp/3builddistro-probedisk | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '|'`"
  2517. echo -n "You chose ${SDDEVICE} Press ENTER if correct: "
  2518. read sdcorrect
  2519. [ "$sdcorrect" = "" ] && break
  2520. done
  2521. SDBASE="`basename ../sd-skeleton-images/${SDIMAGE} .xz`"
  2522. echo
  2523. echo "Please type the name that you want to give the SD image file, or press ENTER"
  2524. SDBASEBASE="`basename $SDBASE .img | sed -e 's%-201[0-9]*%-%' -e 's%-skeleton%-%' | cut -f 1,2,3 -d '-'`"
  2525. PUPIMG="${SDBASEBASE}-${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.img"
  2526. echo -n "only for the default [${PUPIMG}]: "
  2527. read PUPIMG1
  2528. [ "$PUPIMG1" != "" ] && PUPIMG="`basename $PUPIMG1 .img`.img"
  2529. echo "...chosen $PUPIMG"
  2530. echo
  2531. #need to know uncompressed size of image...
  2532. echo "Uncompressing image, please wait..."
  2533. [ -f ../${WOOF_OUTPUT}/${PUPIMG} ] && rm -f ../${WOOF_OUTPUT}/${PUPIMG}
  2534. unxz --stdout ../sd-skeleton-images/${SDIMAGE} > ../${WOOF_OUTPUT}/${PUPIMG}
  2535. if [ $? -ne 0 ];then
  2536. [ -f ../${WOOF_OUTPUT}/${PUPIMG} ] && rm -f ../${WOOF_OUTPUT}/${PUPIMG}
  2537. echo "Uncompress fail. Aborting."
  2538. exit 1
  2539. fi
  2540. sync
  2541. #120703 allow 2nd partition to be ext2, ext3 or ext4...
  2542. SDIMGINFO="`disktype ../${WOOF_OUTPUT}/${PUPIMG}`"
  2543. SDFS2="`echo "$SDIMGINFO" | grep -o 'Ext[0-9] file system' | cut -f 1 -d ' ' | tr '[A-Z]' '[a-z]'`"
  2544. case $SDFS2 in
  2545. ext2|ext3|ext4) SDFS2="ext4" ;; #120706 hack for now. disktype misreports ext4 without journal as ext2.
  2546. *)
  2547. echo -n "wrong f.s. ${SDFS2} in ${SDIMAGE}, aborting. Press ENTER: "
  2548. read exitme
  2549. exit
  2550. ;;
  2551. esac
  2552. #130530 better to write everything to the image file first, then write to sd afterward...
  2553. #need to know the offsets of the filesystems...
  2554. P1BYTES=`echo "$SDIMGINFO" | grep '^Partition 1:' | cut -f 2 -d '(' | cut -f 1 -d ' '`
  2555. P1SECTORS=`echo "$SDIMGINFO" | grep '^Partition 1:' | cut -f 2 -d '(' | cut -f 3 -d ' '`
  2556. P1STARTSECTORS=`echo "$SDIMGINFO" | grep '^Partition 1:' | rev | cut -f 1 -d ' ' | rev | cut -f 1 -d ')'`
  2557. BYTESPERSECTOR=`expr $P1BYTES \/ $P1SECTORS` #normally 512.
  2558. P1STARTBYTES=`expr $P1STARTSECTORS \* $BYTESPERSECTOR`
  2559. P2BYTES=`echo "$SDIMGINFO" | grep '^Partition 2:' | cut -f 2 -d '(' | cut -f 1 -d ' '`
  2560. P2SECTORS=`echo "$SDIMGINFO" | grep '^Partition 2:' | cut -f 2 -d '(' | cut -f 3 -d ' '`
  2561. P2STARTSECTORS=`echo "$SDIMGINFO" | grep '^Partition 2:' | rev | cut -f 1 -d ' ' | rev | cut -f 1 -d ')'`
  2562. P2STARTBYTES=`expr $P2STARTSECTORS \* $BYTESPERSECTOR`
  2563. echo
  2564. echo "Copying Linux kernel to SD image file..."
  2565. mkdir -p /mnt/sdimagep1
  2566. mkdir -p /mnt/sdimagep2
  2567. mount-FULL -t vfat -o loop,offset=${P1STARTBYTES} ../${WOOF_OUTPUT}/${PUPIMG} /mnt/sdimagep1
  2568. if [ $? -ne 0 ];then
  2569. echo "Sorry, mounting vfat partition 1 (at offset ${P1STARTBYTES}) of ${PUPIMG} failed. Aborting script."
  2570. exit 1
  2571. fi
  2572. #120613 restore correct kernel image name...
  2573. case $REALKERNAME in
  2574. uImage) cp -f build/vmlinuz /mnt/sdimagep1/uImage ;;
  2575. kernel.img) cp -f build/vmlinuz /mnt/sdimagep1/kernel.img ;;
  2576. *) cp -f build/vmlinuz /mnt/sdimagep1/ ;;
  2577. esac
  2578. echo -n "$REALKERNAME" > /mnt/sdimagep1/REALKERNAME #just in case need to know, in a running puppy.
  2579. sync
  2580. busybox umount /mnt/sdimagep1 2>/dev/null
  2581. echo "...done"
  2582. echo
  2583. echo "Copying Puppy filesystem to SD image file, please wait..."
  2584. mount-FULL -t ${SDFS2} -o loop,offset=${P2STARTBYTES} ../${WOOF_OUTPUT}/${PUPIMG} /mnt/sdimagep2
  2585. if [ $? -ne 0 ];then
  2586. echo "Sorry, mounting ${SDFS2} partition 2 (at offset ${P2STARTBYTES}) of ${PUPIMG} failed. Aborting script."
  2587. exit 1
  2588. fi
  2589. cp -a rootfs-complete/* /mnt/sdimagep2/
  2590. sync
  2591. #120704 add to /etc/fstab...
  2592. # echo "/dev/${SDDEVICE}2 / ${SDFS2} defaults,noatime 0 1" >> /mnt/sdimagep2/etc/fstab #120707 change relatime to noatime.
  2593. #not sure if the root partition is referred to as /dev/root or /dev/mmcblk0p2 on the raspi
  2594. echo "/dev/mmcblk0p2 / ${SDFS2} defaults,noatime 0 1" >> /mnt/sdimagep2/etc/fstab
  2595. sync
  2596. echo "...done"
  2597. busybox umount /mnt/sdimagep2 2>/dev/null
  2598. IMGBYTES=`stat --format=%s ../${WOOF_OUTPUT}/$PUPIMG`
  2599. echo
  2600. IMGK=`expr $IMGBYTES \/ 1024`
  2601. echo "The image file is ${IMGK}KB, so needs to be compressed for distribution."
  2602. echo "If you only want to write to SD card choose 'none' which is the fastest."
  2603. echo "You can also compress the image file yourself later."
  2604. echo "Choose compression type:
  2605. 1 xz (smallest, slowest)
  2606. 2 gz (larger, faster)
  2607. 3 none (huge, instant)"
  2608. read compresstype
  2609. case $compresstype in
  2610. 1) COMPRESS='xz' ;;
  2611. 2) COMPRESS='gz' ;;
  2612. *) COMPRESS='none' ;;
  2613. esac
  2614. echo "...you chose $COMPRESS"
  2615. if [ "$COMPRESS" != 'none' ]; then
  2616. echo "Compressing, please wait..."
  2617. [ -f ../${WOOF_OUTPUT}/${PUPIMG}.${COMPRESS} ] && rm -f ../${WOOF_OUTPUT}/${PUPIMG}.${COMPRESS}
  2618. if [ "$COMPRESS" = 'xz' ]; then
  2619. xz --stdout ../${WOOF_OUTPUT}/${PUPIMG} > ../${WOOF_OUTPUT}/${PUPIMG}.xz
  2620. elif [ "$COMPRESS" = 'gz' ]; then
  2621. gzip --stdout ../${WOOF_OUTPUT}/${PUPIMG} > ../${WOOF_OUTPUT}/${PUPIMG}.gz
  2622. fi
  2623. sync
  2624. echo "...${PUPIMG}.${COMPRESS} created."
  2625. COMPRIMGBYTES=`stat --format=%s ../${WOOF_OUTPUT}/${PUPIMG}.${COMPRESS}`
  2626. echo
  2627. echo "The image is now ${PUPIMG}.${COMPRESS} and is ${COMPRIMGBYTES}bytes."
  2628. COMPRIMGK=`expr $COMPRIMGBYTES \/ 1024`
  2629. echo "(${COMPRIMGK}KB)"
  2630. echo "Image file may be distributed to others!"
  2631. echo
  2632. fi # if COMPRESS
  2633. echo
  2634. echo "Would you like to write it to a SD card? ENTER only for no,"
  2635. echo -n "or any printable char then ENTER to write image to SD card: "
  2636. read writeSD
  2637. if [ "$writeSD" = "" ];then
  2638. WRITE_SD="no"
  2639. else
  2640. WRITE_SD="yes"
  2641. fi
  2642. if [ "$WRITE_SD" = "yes" ];then
  2643. echo
  2644. echo "Please insert the SD card. Make sure that it is the same size or bigger than
  2645. indicated on the filename of the skeleton image file that you chose."
  2646. echo -n "Press ENTER after it is inserted: "
  2647. read waitinsert
  2648. sleep 2
  2649. while [ 1 ];do
  2650. CNT=1
  2651. echo -n "" > /tmp/3builddistro-probedisk
  2652. probedisk |
  2653. while read ONEPROBE
  2654. do
  2655. echo "${CNT} ${ONEPROBE}" >> /tmp/3builddistro-probedisk
  2656. CNT=`expr $CNT + 1`
  2657. done
  2658. echo
  2659. echo "Type number which is your SD card:"
  2660. cat /tmp/3builddistro-probedisk
  2661. read sdnumber
  2662. SDDEVICE="`cat /tmp/3builddistro-probedisk | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '|'`"
  2663. echo -n "You chose ${SDDEVICE} Press ENTER if correct: "
  2664. read sdcorrect
  2665. [ "$sdcorrect" = "" ] && break
  2666. done
  2667. echo
  2668. echo "Sanity check: ${PUPIMG}
  2669. is to be written to ${SDDEVICE}."
  2670. echo -n "Press ENTER to continue: "
  2671. read yepgo
  2672. SDCARDINFO="`disktype ${SDDEVICE}`"
  2673. #120506b check that sd card big enough...
  2674. SDCARDBYTES=`echo "$SDCARDINFO" | grep '^Block device' | cut -f 2 -d '(' | cut -f 1 -d ' '` #ex: 4023386112
  2675. if [ $IMGBYTES -gt $SDCARDBYTES ];then
  2676. echo
  2677. echo "Sorry, the image file is ${IMGBYTES}bytes, however the
  2678. SD card is only ${SDCARDBYTES}bytes. Cannot continue."
  2679. exit 1
  2680. fi
  2681. echo
  2682. echo "Writing image file ${PUPIMG} to SD card ${SDDEVICE}..."
  2683. dd if=../${WOOF_OUTPUT}/${PUPIMG} of=${SDDEVICE} bs=4M #120704 added bs=4M
  2684. if [ $? -ne 0 ];then
  2685. echo "Sorry, operation failure. Aborting script."
  2686. exit 1
  2687. fi
  2688. sync
  2689. fi # if WRITE_SD
  2690. if [ "$COMPRESS" != 'none' ]; then
  2691. rm -f ../${WOOF_OUTPUT}/${PUPIMG}
  2692. fi
  2693. #130530 this is old code...
  2694. # echo "Writing skeleton image to ${SDDEVICE}, please wait very patiently..."
  2695. # dd if=${SDBASE} of=${SDDEVICE} bs=4M #120704 added bs=4M
  2696. # if [ $? -ne 0 ];then
  2697. # echo "Sorry, operation failure. Aborting script."
  2698. # exit 1
  2699. # fi
  2700. # sync
  2701. # rm -f $SDBASE
  2702. #
  2703. # FIXEXTPTN=''
  2704. # if [ "$SDFS2" = "ext2" ];then #120704 120706 see hack above, bypass.
  2705. # echo
  2706. # echo "The 2nd partition is 'ext2', but you may bump it to 'ext4' if you wish."
  2707. # echo -n "ENTER only to keep ext2, any char for ext4: "
  2708. # read bumpit
  2709. # if [ "$bumpit" != "" ];then
  2710. # echo
  2711. # echo "Creating ext4 f.s. on partition ${SDDEVICE}2, without a journal..."
  2712. # #mke2fs -t ext4 -O ^has_journal -L puppy -m 0 -b 4096 ${SDDEVICE}2
  2713. # ##120705 add '-E stride=2,stripe-width=1024' refer: http://blogofterje.wordpress.com/2012/01/14/optimizing-fs-on-sd-card/
  2714. # #mke2fs -t ext4 -O ^has_journal -L puppy -m 0 -b 4096 -E stride=2,stripe-width=1024 ${SDDEVICE}2
  2715. # #120706 mavrothal reports may not suit many cards, so revert...
  2716. # mke2fs -t ext4 -O ^has_journal -L puppy -m 0 -b 4096 ${SDDEVICE}2
  2717. # sync
  2718. # FIXEXTPTN='s%ext2%ext4%' #see below.
  2719. # SDFS2='ext4'
  2720. # echo "...done"
  2721. # fi
  2722. # fi
  2723. #
  2724. # mkdir -p /mnt/sdimagep1
  2725. # mkdir -p /mnt/sdimagep2
  2726. # dd if=${SDDEVICE}1 of=/dev/null bs=1024 count=1 #trying to fix weird bug.
  2727. # dd if=${SDDEVICE}2 of=/dev/null bs=1024 count=1 #trying to fix weird bug.
  2728. # while [ "a" = "a" ];do
  2729. # mount -t vfat ${SDDEVICE}1 /mnt/sdimagep1
  2730. # MNTSTAT1=$?
  2731. # mount -t ${SDFS2} ${SDDEVICE}2 /mnt/sdimagep2
  2732. # MNTSTAT2=$?
  2733. # if [ $MNTSTAT1 -ne 0 -o $MNTSTAT2 -ne 0 ];then
  2734. # echo
  2735. # echo "Something is wrong. There should be two partitions on the SD card,"
  2736. # echo "vfat and ${SDFS2}. There was an error mounting them. Aborting script."
  2737. # echo "Attempted operations:"
  2738. # echo "mount -t vfat ${SDDEVICE}1 /mnt/sdimagep1 STATUS: ${MNTSTAT1}"
  2739. # echo "mount -t ${SDFS2} ${SDDEVICE}2 /mnt/sdimagep2 STATUS: ${MNTSTAT2}"
  2740. # umount /mnt/sdimagep1 2>/dev/null
  2741. # umount /mnt/sdimagep2 2>/dev/null
  2742. # echo "You might try replugging the card."
  2743. # echo -n "ENTER to quit, any other key to retry: "
  2744. # read weirdbug
  2745. # [ "$weirdbug" != "" ] && continue
  2746. # exit 1
  2747. # fi
  2748. # break
  2749. # done
  2750. # [ "$FIXEXTPTN" ] && [ -f /mnt/sdimagep1/cmdline.txt ] && sed -i -e "${FIXEXTPTN}" /mnt/sdimagep1/cmdline.txt #120704
  2751. # echo
  2752. # echo "Copying Linux kernel to SD card..."
  2753. # #120613 restore correct kernel image name...
  2754. # case $REALKERNAME in
  2755. # uImage) cp -f build/vmlinuz /mnt/sdimagep1/uImage ;;
  2756. # kernel.img) cp -f build/vmlinuz /mnt/sdimagep1/kernel.img ;;
  2757. # *) cp -f build/vmlinuz /mnt/sdimagep1/ ;;
  2758. # esac
  2759. # echo -n "$REALKERNAME" > /mnt/sdimagep1/REALKERNAME #just in case need to know, in a running puppy.
  2760. # sync
  2761. # echo "...done"
  2762. # echo "Copying Puppy filesystem to SD card, please wait..."
  2763. # cp -a rootfs-complete/* /mnt/sdimagep2/
  2764. # sync
  2765. # #120704 add to /etc/fstab...
  2766. # echo "/dev/${SDDEVICE}2 / ${SDFS2} defaults,noatime 0 1" >> /mnt/sdimagep2/etc/fstab #120707 change relatime to noatime.
  2767. # sync
  2768. # echo "...done"
  2769. # umount /mnt/sdimagep1 2>/dev/null
  2770. # umount /mnt/sdimagep2 2>/dev/null
  2771. #
  2772. # echo
  2773. # echo "Please type the name that you want to give the SD image file, or press ENTER"
  2774. # SDBASEBASE="`basename $SDBASE .img | sed -e 's%-201[0-9]*%-%' -e 's%-skeleton%-%' | cut -f 1,2,3 -d '-'`"
  2775. # PUPIMG="${SDBASEBASE}-${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.img"
  2776. # echo -n "only for the default [${PUPIMG}]: "
  2777. # read PUPIMG1
  2778. # [ "$PUPIMG1" != "" ] && PUPIMG="$PUPIMG1"
  2779. # echo "...chosen $PUPIMG"
  2780. # echo
  2781. # echo "Now creating an image file of the SD card, please wait patiently..."
  2782. # IMGK=`expr $IMGBYTES \/ 1024` #assume size divisible by 1024!!!!***WARNING***
  2783. # dd if=$SDDEVICE of=$PUPIMG bs=1024 count=$IMGK
  2784. # sync
  2785. # echo "...done. The image file is named '${PUPIMG}'"
  2786. # echo
  2787. # echo "However, it is ${IMGK}KB, so needs to be compressed for distribution."
  2788. # echo "Compressing, please wait..."
  2789. # rm -f ${PUPIMG}.xz
  2790. # xz $PUPIMG
  2791. # sync
  2792. if [ "$WRITE_SD" = "yes" ];then
  2793. #update desktop drive icons. note, this is also done in /usr/sbin/bootflash, puppyinstaller, gparted_shell...
  2794. #/tmp/pup_event_frontend_block_request is used in /sbin/pup_event_frontend_d to refresh drv...
  2795. THEDRIVE="`echo -n "$SDDEVICE" | cut -f 3 -d '/'`"
  2796. echo "$THEDRIVE" > /tmp/pup_event_frontend_block_request
  2797. #120510...
  2798. echo "If the SD card currently plugged in is bigger than the image, for example
  2799. you have a 4GB card and used a 1GB image, optionally now you may increase the
  2800. ${SDFS2} partition to fill the remaining space -- this is for your own use."
  2801. echo -n "ENTER only to decline: "
  2802. read makebig
  2803. if [ "$makebig" != "" ];then
  2804. if [ "`which gparted`" = "" ];then
  2805. echo "ERROR, gparted not installed!!!"
  2806. else
  2807. gparted $SDDEVICE
  2808. sync
  2809. echo
  2810. echo "Checking the ${SDFS2} filesystem..."
  2811. fsck.${SDFS2} -p ${SDDEVICE}2
  2812. sync
  2813. echo "$THEDRIVE" > /tmp/pup_event_frontend_block_request
  2814. fi
  2815. fi
  2816. fi # if WRITE_SD
  2817. fi
  2818. cd $WKGDIR
  2819. #now do the devx...
  2820. echo
  2821. echo -n "Hit ENTER to build the 'devx' SFS file, any other key to exit: "
  2822. read dodevx
  2823. [ "$dodevx" != "" ] && exit
  2824. echo
  2825. echo "Building ${DEVXSFS}..."
  2826. #rm -rf sandbox3/devx
  2827. #mkdir sandbox3/devx
  2828. echo " building sandbox3/devx ..."
  2829. rm -f /tmp/3builddistro_removed_alt_dev #101013
  2830. ALLGENNAMESD="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | cut -f 2 -d '|' | sed -e 's%$%_DEV%'`"
  2831. rm -f ./${WOOF_OUTPUT}/${DEVXSFS} 2>/dev/null #100911
  2832. for ONEDEV in `ls -1 packages-${DISTRO_FILE_PREFIX} | grep '_DEV$' | tr '\n' ' '`
  2833. do
  2834. #110727 no longer using this...
  2835. ##101013 preferred pkg for an older kernel (see PKGS_MANAGEMENT file)...
  2836. ONEPKG="`echo -n "$ONEDEV" | sed -e 's%_DEV%%'`"
  2837. #for ONE_PPO in $PKG_PREFER_OLDER
  2838. #do
  2839. # 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)
  2840. # two_PKG="`echo -n "$ONE_PPO" | cut -f 2 -d '|'`"
  2841. # three_PKG="`echo -n "$ONE_PPO" | cut -f 3 -d '|'`"
  2842. # if [ $SUB_KERNELVER -le $one_KERNEL ];then
  2843. # if [ "$two_PKG" = "$ONEPKG" ];then
  2844. # #if PKGS_SPECS_TABLE has 'yes' for older pkg, bypass this one...
  2845. # if [ "`echo "$PKGLIST" | tr ' ' '\n' | grep "^${three_PKG}$"`" != "" ];then
  2846. # echo "$ONEDEV" >> /tmp/3builddistro_removed_alt_dev
  2847. # continue 2
  2848. # fi
  2849. # fi
  2850. # else
  2851. # if [ "$three_PKG" = "$ONEPKG" ];then
  2852. # #if PKGS_SPECS_TABLE has 'yes' for newer pkg, bypass this one...
  2853. # if [ "`echo "$PKGLIST" | tr ' ' '\n' | grep "^${two_PKG}$"`" != "" ];then
  2854. # echo "$ONEDEV" >> /tmp/3builddistro_removed_alt_dev
  2855. # continue 2
  2856. # fi
  2857. # fi
  2858. # fi
  2859. #done
  2860. devPATTERN='^'"$ONEDEV"
  2861. if [ "`echo "$ALLGENNAMESD" | grep "$devPATTERN"`" != "" ];then
  2862. cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEDEV}/* sandbox3/devx/
  2863. sync #110727 running drake pup 0.3 with k2.6.39-3 new laptop, mysterious loss of dirs/files. try sync.
  2864. fi
  2865. done
  2866. sync
  2867. #earlier above i moved all invalid symlinks into the devx module, yeah but i
  2868. #think should delete them if they really point nowhere...
  2869. echo " Deleting really invalid symlinks in devx..."
  2870. mkdir layer_top
  2871. mount -t aufs -o udba=reval,diropq=w,dirs=sandbox3/devx=rw:sandbox3/rootfs-complete=ro layerfs layer_top
  2872. for ONESYMLINK in `find layer_top/ -type l`
  2873. do
  2874. [ "`echo -n "$ONESYMLINK" | grep '/dev/'`" != "" ] && continue
  2875. [ "`echo -n "$ONESYMLINK" | grep '/proc/'`" != "" ] && continue
  2876. xONESYMLINK="`echo -n "$ONESYMLINK" | sed -e 's/^layer_top//'`"
  2877. #111123 cross-build, cannot do chroot...
  2878. if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
  2879. if [ "`chroot layer_top readlink -e $xONESYMLINK`" = "" ];then
  2880. echo " $ONESYMLINK"
  2881. rm -f $ONESYMLINK
  2882. fi
  2883. else
  2884. #do it without chroot...
  2885. LINKTO="`readlink layer_top${xONESYMLINK}`"
  2886. [ -e layer_top${LINKTO} ] && continue #absolute path
  2887. UPONE="`dirname "$xONESYMLINK"`"
  2888. [ -e layer_top${UPONE}/${LINKTO} ] && continue #relative path
  2889. echo " $ONESYMLINK"
  2890. rm -f $ONESYMLINK
  2891. fi
  2892. done
  2893. sync
  2894. umount layer_top
  2895. rmdir layer_top
  2896. ###HACK###
  2897. if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" != "" ];then #121022
  2898. [ -e sandbox3/devx/usr/bin/python2.5 ] && ln -s python2.5 sandbox3/devx/usr/bin/python 2>/dev/null
  2899. [ -e sandbox3/devx/usr/bin/python2.6 ] && ln -s python2.6 sandbox3/devx/usr/bin/python 2>/dev/null
  2900. [ -e sandbox3/devx/usr/bin/python2.7 ] && ln -s python2.7 sandbox3/devx/usr/bin/python 2>/dev/null
  2901. fi
  2902. rm -f sandbox3/devx/usr/lib${lsuffix}/mozilla/plugins/* #100407 maybe .a, .la files in here.
  2903. ###END HACK###
  2904. #v424 no, i have needed docs in usr/share/doc...
  2905. #w003 there's docs here, move them out...
  2906. rm -rf packages-${DISTRO_FILE_PREFIX}/devx_DOC 2>/dev/null
  2907. mkdir -p packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share
  2908. #mv sandbox3/devx/usr/share/doc packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
  2909. mv sandbox3/devx/usr/share/doc-base packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
  2910. mv sandbox3/devx/usr/share/man packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
  2911. #100831 hack, this symlink needed...
  2912. if [ -d sandbox3/devx/usr/X11R7/include/xorg ];then
  2913. [ ! -e sandbox3/devx/usr/include/xorg ] && ln -s ../X11/include/xorg sandbox3/devx/usr/include/xorg
  2914. fi
  2915. #100622 remove overhead of this script running every bootup...
  2916. mkdir -p sandbox3/devx/etc/profile.d
  2917. rm -f sandbox3/devx/etc/profile.d/pkgconfig* 2>/dev/null
  2918. PKG_CONFIG_PATH="`find sandbox3/devx/usr/lib sandbox3/devx/usr/X11R7/lib sandbox3/devx/opt sandbox3/devx/usr/local/lib -type d -name pkgconfig | sed -e 's%sandbox3/devx%%' | tr '\n' ':'`"
  2919. echo "export PKG_CONFIG_PATH='${PKG_CONFIG_PATH}'" > sandbox3/devx/etc/profile.d/pkgconfig
  2920. #maybe stray /install dir from slackware pkgs...
  2921. rm -rf sandbox3/devx/install 2>/dev/null
  2922. [ -f sandbox3/devx/pet.specs ] && rm -f sandbox3/devx/pet.specs #w478
  2923. #another slackware hack 131124
  2924. [ -x sandbox3/devx/usr/bin/strings-GNU ] && mv sandbox3/devx/usr/bin/strings-GNU sandbox3/devx/usr/bin/strings
  2925. sync
  2926. #110215 BaCon...
  2927. #111203 remove offer to download and compile bacon (no good for cross-builds)...
  2928. #if [ ! -f sandbox3/devx/usr/bin/bacon ];then
  2929. #if [ -f sandbox3/devx/usr/bin/bacon ];then
  2930. # BACONPKG="`grep '|bacon|' sandbox3/rootfs-complete/root/.packages/woof-installed-packages | cut -f 1 -d '|'`"
  2931. # echo
  2932. # echo "The devx has BaCon compiler package: ${BACONPKG}"
  2933. # echo "Great, but if you have an Internet connection, you may update it, however this"
  2934. # echo "does not always work as a very recent /usr/bin/bacon must be installed..."
  2935. #else
  2936. #echo
  2937. #echo "Oh, you do not have the BaCon compiler in devx."
  2938. #echo "It is recommended that variable PKGS_SPECS_TABLE in file DISTRO_PKGS_SPECS-* have this entry:"
  2939. #echo "yes|bacon||exe>dev,dev,doc>dev,nls"
  2940. #echo "It is recommended that all Puppy distros standardise on having BaCon available."
  2941. ## echo "Anyway, if you have an Internet connection, BaCon can be downloaded now, however"
  2942. ## echo "this does not always work as you need a very recent /usr/bin/bacon already installed..."
  2943. #fi
  2944. #echo -n "Press ENTER to continue: "
  2945. #read keepgoing
  2946. ##101217 get latest BaCon...
  2947. #if [ -f support/fetch ];then #see http://www.basic-converter.org/fetch.bac
  2948. # if [ "`which bacon`" != "" ];then
  2949. # echo
  2950. # echo "Press any printable key (then ENTER) to download latest BaCon BASIC compiler"
  2951. # echo "and support files. You will need Internet access to do this."
  2952. # echo -n "ENTER key only to decline, any other printable char to download: "
  2953. # read dobacon
  2954. # if [ "$dobacon" != "" ];then
  2955. # mkdir -p sandbox3/devx/usr/share/BaCon
  2956. # rm -f sandbox3/devx/usr/share/BaCon/* 2>/dev/null
  2957. # cp support/fetch sandbox3/devx/usr/share/BaCon/
  2958. # cd sandbox3/devx/usr/share/BaCon
  2959. # ./fetch
  2960. # sync
  2961. # [ ! -f documentation.pdf ] && wget http://www.basic-converter.org/documentation.pdf
  2962. # [ ! -f documentation.html ] && wget http://www.basic-converter.org/documentation.html
  2963. # [ ! -f hug.txt ] && wget http://www.basic-converter.org/hug.txt
  2964. # [ ! -f sqlite3.txt ] && wget http://www.basic-converter.org/sqlite3.txt
  2965. # [ ! -f gmp.txt ] && wget http://www.basic-converter.org/gmp.txt
  2966. # [ ! -f curses.txt ] && wget http://www.basic-converter.org/curses.txt
  2967. # [ ! -f pthreads.txt ] && wget http://www.basic-converter.org/pthreads.txt
  2968. # [ ! -f gd.txt ] && wget http://www.basic-converter.org/gd.txt
  2969. # [ ! -f gtk.txt ] && wget http://www.basic-converter.org/gtk.txt
  2970. # [ ! -f gl.txt ] && wget http://www.basic-converter.org/gl.txt
  2971. # ##fetch has already downloaded bacon.bac, but want beta version...
  2972. # #mv -f bacon.bac bacon-released.bac
  2973. # #wget http://www.basic-converter.org/beta/bacon.bac
  2974. # #[ $? -ne 0 ] && mv -f bacon-released.bac bacon.bac
  2975. # #mv -f documentation.html documentation-released.html
  2976. # #wget http://www.basic-converter.org/beta/documentation.html
  2977. # #[ $? -ne 0 ] && mv -f documentation-released.html documentation.html
  2978. # sync
  2979. # if [ -f bacon.bac ];then
  2980. # bacon bacon.bac
  2981. # sync
  2982. # if [ -f bacon ];then
  2983. # cp -f -a bacon ../../bin/
  2984. # echo "...done"
  2985. # else
  2986. # echo "ERROR: bacon did not compile!"
  2987. # fi
  2988. # fi
  2989. # cd ../../../../../ #back to woof-tree project dir.
  2990. # fi
  2991. # else
  2992. # echo
  2993. # echo "WARNING: 'devx' SFS not loaded, cannot install latest BaCon BASIC compiler."
  2994. # echo " (or current loaded devx SFS does not have BaCon compiler in it)"
  2995. # fi
  2996. #fi
  2997. #110429 see above, think want glibc scsi headers in usr/include/scsi...
  2998. if [ -d sandbox3/devx/usr/include/scsi-GLIBC ];then
  2999. #probably have kernel scsi headers in usr/include/scsi, fix...
  3000. cp -a -f sandbox3/devx/usr/include/scsi-GLIBC/* sandbox3/devx/usr/include/scsi/
  3001. fi
  3002. #110702 mageia1 python puts 30python.csh here...
  3003. rm -f sandbox3/devx/etc/profile.d/*.csh
  3004. #130111 fixed in 2createpackages...
  3005. ##110726 mageia does something weird, puts all these in wrong place...
  3006. #if [ -d sandbox3/devx/usr/bin/multiarch-i386-linux ];then
  3007. # cp -a -f --remove-destination sandbox3/devx/usr/bin/multiarch-i386-linux/* sandbox3/devx/usr/bin/
  3008. # rm -rf sandbox3/devx/usr/bin/multiarch-i386-linux
  3009. #fi
  3010. # 151019 - delete duplicate symlinks
  3011. echo "deleting duplicate symlinks"
  3012. find sandbox3/devx -type l |
  3013. while read ONESYMLINK
  3014. do
  3015. # if the symlink exists in sandbox3/rootfs-complete we delete it
  3016. ESYMLINK=$(echo "$ONESYMLINK" | sed 's%devx%rootfs-complete%')
  3017. [ -h "$ESYMLINK" ] && echo -n "deleted $ONESYMLINK " && rm -f "$ONESYMLINK"
  3018. done
  3019. sync
  3020. # 151019 - delete whiteouts
  3021. echo "cleaning out whiteouts"
  3022. find sandbox3/devx -name '.wh*' -delete
  3023. echo "Now creating ${DEVXSFS} ..."
  3024. ${MKSQUASHFS} sandbox3/devx ./${WOOF_OUTPUT}/${DEVXSFS} ${COMPCHOICE} #100911 110713
  3025. sync
  3026. chmod 644 ./${WOOF_OUTPUT}/${DEVXSFS}
  3027. CUR_DIR="$PWD"
  3028. cd ./${WOOF_OUTPUT}
  3029. echo -n "$IDSTRING" >> ${DEVXSFS} #100911 16-byte id-string appended to file.
  3030. md5sum ${DEVXSFS} > ${DEVXSFS}.md5.txt #100911
  3031. cd "$CUR_DIR"
  3032. sync
  3033. echo "...done"
  3034. echo
  3035. echo "Script finished."
  3036. echo -n "Press ENTER key to exit: "
  3037. read yeahgetout
  3038. ###END###