3builddistro-Z 142 KB

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