123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288 |
- #!/bin/sh
- export LANG=C
- REPO_URL=${REPO_URL:-http://distro.ibiblio.org/puppylinux/huge_kernels/}
- CDRECORD='cdrecord'
- MKISOFS='mkisofs'
- if [ "`which xorriso`" != "" ];then
- CDRECORD='xorrecord'
- MKISOFS='xorrisofs'
- fi
- export CDRECORD MKISOFS
- RARCH=`uname -m`
- . ./DISTRO_SPECS
- if [ "$DISTRO_KERNEL_PET" != "Huge_Kernel" ];then
- echo "You can not use this script. Use 3builddistro instead or click the button"
- echo "named 'BUILD DISTRO (normal build)' in the Woof GUI"
- echo "Press enter to exit."
- read normal_build
- exit 0
- fi
- if [ ! "$DISTRO_DB_SUBNAME" ];then
- DISTRO_DB_SUBNAME="$DISTRO_COMPAT_VERSION"
- echo '#subname for online PETs dir. Ex: "slacko14", dir "pet_packages-slacko14", db file "Packages-puppy-slacko14-official":
- #note: prior to existence of this variable, online subname was set to $DISTRO_COMPAT_VERSION or via some hack code.
- ' >> ./DISTRO_SPECS
- echo "DISTRO_DB_SUBNAME='${DISTRO_DB_SUBNAME}'" >> ./DISTRO_SPECS
- fi
- if [ -f ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
- . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
- else
- . ./DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}
- fi
- if [ -f ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
- . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}
- else
- . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}
- fi
- . ./PKGS_MANAGEMENT
- . ./DISTRO_PET_REPOS
- if [ -f WOOFMERGEVARS ];then
- . ./WOOFMERGEVARS
- else
- echo 'File WOOFMERGEVARS does not exist. This is created by script
- merge2out. Your setup is wrong, quiting.'
- exit
- fi
- [ "$WOOF_TARGETARCH" = "x86_64" ] && lsuffix=64 || lsuffix=
- IDDATE="`date +%y%m%d%H%M%S`"
- IDPREFIX="`echo -n "$DISTRO_FILE_PREFIX" | cut -b 1`"
- IDSTRING="${IDPREFIX}${IDDATE}ZZZZ${DISTRO_VERSION}"
- LEN1=`echo -n "$IDSTRING" | wc -c`
- LEN2=`expr 32 - $LEN1`
- EXTX=''
- while [ $LEN2 -gt 0 ];do
- LEN2=`expr $LEN2 - 1`
- EXTX="${EXTX}X"
- done
- IDSTRING="${IDSTRING}${EXTX}"
- PKGLISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | tr '\n' ' ' | sed -e 's% $%%'`"
- WKGDIR="`pwd`"
- KERNELPKG=""
- [ $1 ] && KERNELPKG="$1"
- CHOICE_SCSI=""
- [ $2 ] && CHOICE_SCSI="$2"
- CHOICE_BIGMODEM=""
- [ $3 ] && CHOICE_BIGMODEM="$3"
- CHK_FB_STATE=""
- [ $4 ] && CHK_FB_STATE="$4"
- CHK_EXOTIC_STATE=""
- [ $5 ] && CHK_EXOTIC_STATE="$5"
- CHK_RADICAL_STATE=""
- [ $6 ] && CHK_RADICAL_STATE="$6"
- echo
- echo "Do you want to create a live-CD .iso file, which is the normal choice for a
- PC-compatible target, or is your target an SD-card for an ARM-based board?
- In the latter case, you would already have downloaded an SD-card skeleton image
- file into folder 'sd-skeleton-images' (done by script '1download') -- if there
- is no image file in that folder, you cannot choose the SD-card option."
- echo "WARNING: for the SD-card option, you must have enough free space in the
- current directory ${WKGDIR}/sandbox3
- to expand the SD image file, typically 4GB."
- echo "Press ENTER only for normal .iso creation, or "
- echo -n "any other printable character for SD-card: "
- read SDFLAG
- if [ "$SDFLAG" != "" ];then
- echo "...ok, chose sd-card image."
- echo
- echo "Type number of board that you are building for:
- 1 Raspberry Pi
- 2 Mele A1000 or A2000 (or other A10 board)
- 3 ODROID-X (or other Exynos 4412 board)"
- read boardnum
- case $boardnum in
- 1) BOOT_BOARD='raspi' ;;
- 2) BOOT_BOARD='mele' ;;
- *) BOOT_BOARD='odroidx' ;;
- esac
- echo "...you chose $BOOT_BOARD"
- fi
- if [ "$SDFLAG" != "" ];then
-
- CHOICE_BIGMODEM="Keep_big_modems"
- CHOICE_SCSI="Keep_SCSI"
- CHK_FB_STATE="false"
- CHK_EXOTIC_STATE="false"
- CHK_RADICAL_STATE="false"
- CHK_YES_ZDRV="false"
- fi
- PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep -v '^#'`"
- mkdir -p sandbox3
- export DISTRO_NAME
- export DISTRO_VERSION
- if [ "`echo -n "$DISTRO_VERSION" | grep '\.'`" = "" ];then
- DIGIT1="`echo "$DISTRO_VERSION" | cut -b 1`"
- DIGIT2="`echo "$DISTRO_VERSION" | cut -b 2`"
- DIGIT3="`echo "$DISTRO_VERSION" | cut -b 3`"
- RIGHTVER="${DIGIT1}.${DIGIT2}.${DIGIT3}"
- [ "$DIGIT3" = "0" ] && RIGHTVER="${DIGIT1}.${DIGIT2}"
- else
- RIGHTVER="$DISTRO_VERSION"
- fi
-
-
-
-
-
-
-
-
-
-
-
-
- KERNELVER="`tar --list -f packages-pet/${KERNELPKG} 2>/dev/null | grep -o '/lib/modules/[23]\..*' | head -n 1 | cut -f 4 -d '/'`"
- dotnum="`echo -n "$KERNELVER" | sed -e 's%[^\.]%%g' | wc -c`"
- if [ "$dotnum" = "2" ];then
-
- SUB_SUB_KERNELVER=0
- else
- SUB_SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 4 -d '.'`
- fi
- SUB_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 3 -d '.'`
- MAJ_KERNELVER=`echo -n "$KERNELVER" | cut -f 1 -d '-' | cut -f 1 -d '.'`
- echo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MKSQUASHFS=mksquashfs
- COMPCHOICE='-comp xz -Xbcj x86 -b 512K'
- echo
- PREFIX1CHAR="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1`"
- KERNEL3CHARS="`echo -n "$KERNELVER" | tr -d '.' | tr -d '\-' | tr -d '[a-z]' | rev | cut -c 1,2,3 | rev`"
- tradPUPPYSFS="puppy_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
- tradZDRVSFS="zdrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
- tradADRVSFS="adrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
- tradYDRVSFS="ydrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
- tradDEVXSFS="devx_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if [ "$CHK_SIMPLE_FILENAMES" = "true" ];then
- echo '...simple chosen'
- PUPPYSFS='puppy.sfs'
- ZDRVSFS='zdrv.sfs'
- ADRVSFS='adrv.sfs'
- YDRVSFS='ydrv.sfs'
- DEVXSFS='devx.sfs'
- else
- echo '...traditional chosen'
- PUPPYSFS="$tradPUPPYSFS"
- ZDRVSFS="$tradZDRVSFS"
- ADRVSFS="$tradADRVSFS"
- YDRVSFS="$tradYDRVSFS"
- DEVXSFS="$tradDEVXSFS"
- fi
- echo
- echo "Now building sandbox3/rootfs-complete, with the complete filesystem..."
- echo '#!/bin/sh' > sandbox3/pinstall.sh
- rm -rf sandbox3/rootfs-complete
- sync
- mkdir sandbox3/rootfs-complete
- mkdir sandbox3/rootfs-complete/etc
- cp DISTRO_SPECS sandbox3/rootfs-complete/etc/
- cp -a rootfs-skeleton/* sandbox3/rootfs-complete/
- cat sandbox3/rootfs-complete/pinstall.sh >> sandbox3/pinstall.sh
- for d in $(ls rootfs-packages)
- do
- state=true
- LIST="sfs_load|pfilesearch|pfind|firewall_ng"
- echo "$d" | egrep -q "$LIST" && def=true || def=false
- case "$d" in
- change_kernels)
- def=true
- ;;
- jwm_config|ptheme|ptheme_buntoo)
- if grep 'jwmconfig' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} |\
- grep -q '^yes' ;then
- state=false
- else
- def=true
- fi
- ;;
- wallpaper)
- if grep -q 'yes|wallpaper' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
- state=false
- def=false
- else
- def=true
- fi
- ;;
- pmusic)
- if grep -q 'yes|ffmpeg' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
- def=true
- else
- state=false
- def=false
- fi
- ;;
- pmirror)
- if grep -q 'yes|mirdir' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
- def=true
- else
- state=false
- def=false
- fi
- ;;
- *)
- if grep "$d" DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} |\
- grep -q '^yes' ;then
- state=false
- def=false
- fi
- ;;
-
- esac
- CBOXES="$CBOXES""<hbox space-expand=\"true\" space-fill=\"true\">
- <checkbox>
- <label>$d</label>
- <default>$def</default>
- <variable>$d</variable>
- <sensitive>$state</sensitive>
- </checkbox>
- </hbox>"
- done
- CHOICE=/tmp/rootfs_choice$$
- export GUIC="<window title=\"Choose extra packages\">
- <vbox>
- <hbox>
- <text>
- <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>
- </text>
- </hbox>
- <hbox space-expand=\"true\" space-fill=\"true\">
- <text use-markup=\"true\">
- <label>\"<b>These are maintained as part of woof.</b>\"</label>
- </text>
- </hbox>
- <vbox scrollable=\"true\" height=\"160\" width=\"380\">
- $CBOXES
- </vbox>
- <hbox><button ok></button></hbox>
- </vbox>
- </window>"
- gtkdialog -p GUIC -c > $CHOICE
- . $CHOICE
- [ -f /tmp/rootfs-packages.specs ] && rm /tmp/rootfs-packages.specs
- [ -f /tmp/rootfs_pkgs_pinstall.sh ] && rm /tmp/rootfs_pkgs_pinstall.sh
- if [ "$EXIT" = "OK" ];then
- while read line
- do
- if echo $line|grep -q "true" ;then
- echo "copying ${line%%=*}"
- cp -a rootfs-packages/${line%%=*}/* sandbox3/rootfs-complete/
- [ -f rootfs-packages/${line%%=*}/pinstall.sh ] &&\
- cat rootfs-packages/${line%%=*}/pinstall.sh >> /tmp/rootfs_pkgs_pinstall.sh
- cat sandbox3/rootfs-complete/pet.specs >> /tmp/rootfs-packages.specs
- else
- continue
- fi
- done < $CHOICE
- fi
- rm $CHOICE
- ./findwoofinstalledpkgs
- echo "Continuing... please wait"
- rm -f sandbox3/rootfs-complete/pinstall.sh
- rm -f /tmp/3builddistro_removed_alt 2>/dev/null
- ARCHDIR=''
- if [ "$WOOF_COMPATDISTRO" = "ubuntu" ] || [ "$WOOF_COMPATDISTRO" = "trisquel" ];then
- case $WOOF_COMPATVERSION in
- jaunty|karmic|lucid|dwyn|awen|taranis)
- true
- ;;
- *)
- case $WOOF_TARGETARCH in
- x86) ARCHDIR='i386-linux-gnu' ;;
- x86_64) ARCHDIR='x86_64-linux-gnu' ;;
- esac
- ;;
- esac
- fi
- if [ "$WOOF_COMPATDISTRO" = "debian" ];then
- case $WOOF_COMPATVERSION in
- squeeze|lenny|etch|sarge|woody)
- true
- ;;
- *)
- case $WOOF_TARGETARCH in
- x86) ARCHDIR='i386-linux-gnu' ;;
- x86_64) ARCHDIR='x86_64-linux-gnu' ;;
- esac
- ;;
- esac
- fi
- if [ "$WOOF_COMPATDISTRO" = "devuan" ];then
- case $WOOF_TARGETARCH in
- x86) ARCHDIR='i386-linux-gnu' ;;
- x86_64) ARCHDIR='x86_64-linux-gnu' ;;
- esac
- fi
- if [ "$WOOF_COMPATDISTRO" = "mageia" ];then
- case $WOOF_TARGETARCH in
- x86) ARCHDIR='multiarch-i386-linux' ;;
- *) ARCHDIR=''; echo 'dunno'; exit ;;
- esac
- fi
- case $WOOF_TARGETARCH in
- arm)
- case $WOOF_COMPATDISTRO in
- raspbian) ARCHDIR='arm-linux-gnueabihf' ;;
- debian)
- case $WOOF_COMPATVERSION in
- squeeze) true ;;
- *) ARCHDIR='arm-linux-gnueabihf' ;;
- esac
- ;;
- devuan)
- ARCHDIR='arm-linux-gnueabihf'
- ;;
- ubuntu|trisquel)
- case $WOOF_COMPATVERSION in
- jaunty|karmic|lucid|dwyn|awen|taranis) true ;;
- *) ARCHDIR='arm-linux-gnueabihf' ;;
- esac
- ;;
- esac
- ;;
- esac
- if [ "$ARCHDIR" ];then
- ln -snf ./ sandbox3/rootfs-complete/lib${lsuffix}/${ARCHDIR}
- ln -snf ./ sandbox3/rootfs-complete/usr/lib${lsuffix}/${ARCHDIR}
- ln -snf ./ sandbox3/rootfs-complete/usr/bin/${ARCHDIR}
- fi
- PKGLIST="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | cut -f 2 -d '|' | tr '\n' ' '`"
- for ONEPKG in $PKGLIST
- do
- if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG} ];then
- if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DEV ];then
- if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DOC ];then
- echo "WARNING, PKG DOES NOT EXIST: packages-${DISTRO_FILE_PREFIX}/${ONEPKG}"
- continue
- fi
- fi
- fi
-
- [ "$ONEPKG" == "busybox" ] && continue
-
- cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}/* sandbox3/rootfs-complete/ 2> /tmp/3builddistro-cp-errlog
- sync
- if [ -s /tmp/3builddistro-cp-errlog ];then
- cat /tmp/3builddistro-cp-errlog | grep 'cannot overwrite non-directory' | tr '[`‘’]' "'" | cut -f 2 -d "'" |
- while read ONEDIRSYMLINK
- do
- xONEDIRSYMLINK="`echo -n "$ONEDIRSYMLINK" | sed -e 's%sandbox3/rootfs-complete%%'`"
-
- cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}${xONEDIRSYMLINK}/* sandbox3/rootfs-complete${xONEDIRSYMLINK}/
- done
- fi
-
-
-
- if [ -f sandbox3/rootfs-complete/pinstall.sh ];then
-
- grep -E -v '^\#\!\/bin\/sh' sandbox3/rootfs-complete/pinstall.sh >> sandbox3/pinstall.sh
- rm -f sandbox3/rootfs-complete/pinstall.sh
- fi
-
- rm -f sandbox3/rootfs-complete/*.specs
-
- mv sandbox3/rootfs-complete/*24.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
- mv sandbox3/rootfs-complete/*32.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
- mv sandbox3/rootfs-complete/*32.png sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
- mv sandbox3/rootfs-complete/*48.xpm sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
- mv sandbox3/rootfs-complete/*48.png sandbox3/rootfs-complete/usr/local/lib/X11/pixmaps/ 2>/dev/null
- mv sandbox3/rootfs-complete/*.xpm sandbox3/rootfs-complete/usr/local/lib/X11/mini-icons/ 2>/dev/null
- mv sandbox3/rootfs-complete/*.png sandbox3/rootfs-complete/usr/local/lib/X11/mini-icons/ 2>/dev/null
- done
- 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 '
- cp -a -f packages-${DISTRO_FILE_PREFIX}/busybox/bin/busybox ./sandbox3/rootfs-complete/bin/
- osPTN="s%packages-${DISTRO_FILE_PREFIX}/busybox%%"
- for ONEAPPLET in `find packages-${DISTRO_FILE_PREFIX}/busybox -type l | tr '\n' ' '`
- do
- ONESPEC="`echo -n "$ONEAPPLET" | sed -e "$osPTN"`"
- ONEPATH="`dirname $ONESPEC`"
- ONENAME="`basename $ONESPEC`"
- FNDFULL="`find ./sandbox3/rootfs-complete/bin ./sandbox3/rootfs-complete/sbin ./sandbox3/rootfs-complete/usr/bin ./sandbox3/rootfs-complete/usr/sbin -name ${ONENAME}`"
-
- if [ "$FNDFULL" ];then
- if [ -h "$FNDFULL" ];then
- FULLPATH="$(dirname "$FNDFULL")"
- FULLLINK="$(readlink "$FNDFULL")"
- xFULLLINK="${FULLPATH}/${FULLLINK}"
- [ "`echo -n "$FULLLINK" | cut -c 1`" = "/" ] && xFULLLINK="sandbox3/rootfs-complete${FULLLINK}"
- if [ ! -e "${xFULLLINK}" ];then
- rm -f "$FNDFULL"
- FNDFULL=""
- fi
- fi
- fi
-
- if [ ! "$FNDFULL" ];then
- if [ "$ONENAME" != "[" ];then
- if [ "$ONENAME" != "[[" ];then
- oaPTN=" ${ONENAME} "
- FNDFULL="`echo -n "$DEVXUTILS" | grep "$oaPTN"`"
- fi
- fi
- fi
- if [ "$FNDFULL" ];then
- cp -a -f $ONEAPPLET ./sandbox3/rootfs-complete${ONEPATH}/${ONENAME}-BB-NOTUSED
- else
- cp -a -f $ONEAPPLET ./sandbox3/rootfs-complete${ONEPATH}/
- fi
- done
- [ -f packages-${DISTRO_FILE_PREFIX}/busybox/pinstall.sh ] && cat packages-${DISTRO_FILE_PREFIX}/busybox/pinstall.sh >> sandbox3/pinstall.sh
- [ -f /tmp/rootfs_pkgs_pinstall.sh ] && cat /tmp/rootfs_pkgs_pinstall.sh >> sandbox3/pinstall.sh
- echo 'echo "END OF pinstall.sh SCRIPT."' >> sandbox3/pinstall.sh
- chmod 755 sandbox3/pinstall.sh
- echo "Removing extra documentation"
- for i in sandbox3/rootfs-complete/usr/share/doc/*; do
- if [ -d $i ]; then
- keep=0
- for j in legal pmusic pburn pbackup mtpaint help wvdial ffconvert cups nls puplogos notecase didiwiki; do
- case `basename $i` in
- $j)
- keep=1
- break 1
- ;;
- esac
- done
- [ $keep -eq 0 ] && rm -rf $i
- fi
- done
- echo "Removing extra locales"
- for i in sandbox3/rootfs-complete/usr/share/locale/*; do
- if [ -d $i ]; then
- keep=0
- for j in en en_US locale.alias fi; do
- case `basename $i` in
- $j)
- keep=1
- break 1
- ;;
- esac
- done
- [ $keep -eq 0 ] && rm -rf $i
- fi
- done
- rm -rf sandbox3/rootfs-complete/usr/share/man/* 2>/dev/null
- rm -rf sandbox3/rootfs-complete/usr/share/info/* 2>/dev/null
- rm -rf sandbox3/rootfs-complete/usr/share/cups/doc-root/help/* 2>/dev/null
- echo "Replacing /etc/rc.d/rc.sysinit"
- [ -d ./huge_extras ] && cp -af ./huge_extras/rc.sysinit sandbox3/rootfs-complete/etc/rc.d/ || exit 1
- which mkwallpaper 2>&1 > /dev/null
- retwall=$?
- if [ $retwall -eq 0 ];then
- echo "Do you want to build some custom wallpapers?"
- echo "Press 'w' to accept or ENTER to keep going without custom wallpapers."
- read customwalls
- if [ "$customwalls" = "w" ];then
- mkwallpaper | grep -wq '\-k' && opt='-kyes' || opt=''
- cd sandbox3/rootfs-complete
- . etc/DISTRO_SPECS
- for e in 1 2 3 4 5 6 7 8; do
- case $e in
- 1)color='0.2 0.2 0.2' ;;
- 2)color='0.70 0.30 0.40' ;;
- 3)color='0.00 0.75 0.75' ;;
- 4)color='0.2 0.7 0.1' ;;
- 5)color='0.55 0.25 0.60' ;;
- 6)color='0.1 0.1 0.8' ;;
- 7)color='0.73 0.55 0.52' ;;
- 8)color='0.6 0.7 0.8' ;;
- esac
- mkwallpaper -n ${DISTRO_FILE_PREFIX}-wall${e} -l "$DISTRO_FILE_PREFIX" -x1024 -y768 -z "$color" ${opt} -w woof
- done
- cd -
- fi
- fi
- echo
- echo
- echo "Executing sandbox3/pinstall.sh post-install script..."
- cd $WKGDIR/sandbox3/rootfs-complete
- SAVEWKGDIR="$WKGDIR"
- $WKGDIR/sandbox3/pinstall.sh
- echo "Now setting /etc/os-release file"
- mk_os_release() {
- if [ "$1" ];then
- dir=etc
- else
- dir=/etc
- fi
- . $dir/DISTRO_SPECS
-
- cat > ${dir}/os-release << _EOF
- NAME=Puppy
- VERSION="$DISTRO_VERSION"
- ID=puppy_$DISTRO_FILE_PREFIX
- VERSION_ID=$DISTRO_VERSION
- PRETTY_NAME="$DISTRO_NAME $DISTRO_VERSION"
- ANSI_COLOR="0;34"
- CPE_NAME="cpe:/o:puppy:puppy_linux:$DISTRO_VERSION"
- HOME_URL="http://puppylinux.com/"
- SUPPORT_URL="http://www.murga-linux.com/puppy/index.php"
- BUG_REPORT_URL="https://github.com/puppylinux-woof-CE/woof-CE"
- _EOF
- }
- mk_os_release ok
- echo "If you did not get 'End of pinstall.sh' message above, then"
- echo -n "it aborted before completion. Press ENTER or CTRL-C: "
- read isitbad
- WKGDIR="$SAVEWKGDIR"
- cd $WKGDIR
- if [ -f sandbox3/rootfs-complete/sbin/initNEW ];then
- rm -f sandbox3/rootfs-complete/sbin/init
- mv -f sandbox3/rootfs-complete/sbin/initNEW sandbox3/rootfs-complete/sbin/init
- fi
- dependcheck() {
- echo -n "" > /tmp/missinglibs.txt
- echo -n "" > /tmp/notmissinglibs0.txt
- echo -n "" > /tmp/notusedlibs.txt
-
-
- find $WKGDIR/sandbox3/rootfs-complete -type f |
- while read ONEFILE
- do
- echo -n '.'
- ISANEXEC="`file --brief $ONEFILE | grep -E "LSB executable|shared object"`"
- if [ ! "$ISANEXEC" = "" ];then
-
- NUMBYTESALL="`echo -n "$ONEFILE" | wc -c | tr -s " " | cut -f 2 -d " "`"
- NUMBYTESHD=`echo -n "$WKGDIR/sandbox3/rootfs-complete" | wc -c | tr -s " " | cut -f 2 -d " "`
- NUMBYTESHD="`expr $NUMBYTESHD + 1`"
- NEWROOTFILE="`echo -n "$ONEFILE" | cut -b $NUMBYTESHD-$NUMBYTESALL`"
- LDDRESULT="`chroot ${WKGDIR}/sandbox3/rootfs-complete ldd ${NEWROOTFILE}`"
- MISSINGLIBS="`echo "$LDDRESULT" | grep "not found" | cut -f 2 | cut -f 1 -d " " | tr "\n" " "`"
- if [ ! "$MISSINGLIBS" = "" ];then
- echo "File $ONEFILE has these missing library files:" >> /tmp/missinglibs.txt
- echo " $MISSINGLIBS" >> /tmp/missinglibs.txt
- echo "The missing libs are in these packages:" >> /tmp/missinglibs.txt
- for ONEMISSING in $MISSINGLIBS
- do
- find ${WKGDIR}/packages-${DISTRO_FILE_PREFIX} -name $ONEMISSING >> /tmp/missinglibs.txt
- done
- fi
-
- NOTMISSING="`file --brief $ONEFILE | grep -v "not found" | grep "shared object"`"
- if [ "$NOTMISSING" != "" ];then
- basename "$ONEFILE" >> /tmp/notmissinglibs0.txt
- fi
- fi
- done
- sync
- sort -u /tmp/notmissinglibs0.txt > /tmp/notmissinglibs.txt
-
-
-
- find $WKGDIR/sandbox3/rootfs-complete -type f |
- while read ONEFILE
- do
- ISANLIB="`file --brief $ONEFILE | grep "shared object"`"
- if [ ! "$ISANLIB" = "" ];then
- FILEBASE='/'"`basename $ONEFILE`"'$'
- FNDMATCH="`cat /tmp/notmissinglibs.txt | grep "$FILEBASE"`"
- if [ "$FNDMATCH" = "" ];then
- echo "File $ONEFILE is in Puppy but is not used." >> /tmp/notusedlibs.txt
- fi
- fi
- done
- }
- echo
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- echo "This script can now optionally do a thorough dependency check. "
- echo "Note, this may take a long time."
- echo -e "Press \"c\" key then ENTER to do thorough check,"
- echo -n "else just press ENTER key to bypass check: "
- read mmnn
- else
- echo "Normally, the script now offers to perform a thorough dependency check."
- echo "However, as the host and target architectures are different, this cannot"
- echo "be done (host=${WOOF_HOSTARCH}, target=${WOOF_TARGETARCH})."
- echo "If you want to do this check, do a build with host and target the same,"
- echo "with same package selection."
- echo -n "Press ENTER key to continue: "
- read mmnn
- mmnn=""
- fi
- echo
- if [ "$mmnn" = "c" ];then
- echo "Wait awhile..."
- dependcheck
- if [ -s /tmp/missinglibs.txt ];then
- echo
- echo "UNFORTUNATELY, these libs are missing:"
- cat /tmp/missinglibs.txt
- echo
- echo -e "Press \"c\" key then ENTER key to exit,"
- echo -n "or if you really want to ignore problem, just press ENTER: "
- read goto1
- fi
- [ "$goto1" = "c" ] && exit
- if [ -s /tmp/notusedlibs.txt ];then
- echo
- echo "INTERESTING, the following libs are in Puppy but apparently not used:"
- cat /tmp/notusedlibs.txt
- echo
- echo -e "Press \"c\" key then ENTER key to exit,"
- echo -n "or if you really want to ignore problem, just press ENTER: "
- read goto1
- fi
- [ "$goto1" = "c" ] && exit
- fi
- echo "...done."
- support/mk_profile
- cd sandbox3
- cp -a -f ../kernel-skeleton/* rootfs-complete/
- cd rootfs-complete
- ./pinstall.sh
- sync
- rm -f ./pinstall.sh
- cd ..
- mv -f rootfs-complete/etc/modules/firmware.dep rootfs-complete/etc/modules/firmware.dep.${KERNELVER}
- sync
- echo
- rm -rf build 2>/dev/null
- mkdir build
- echo "Installing HUGE kernel"
- sleep 1
- if [ -d '../kernel-kit/dist' ];then
- KIT_KERNEL=`find ../kernel-kit/dist/packages -type f -name 'huge*.tar.bz2' -maxdepth 1|head -n1`
- [ -z "$KIT_KERNEL" ] || cp $KIT_KERNEL ../huge_kernel/
- fi
-
- IS_KERNEL=`ls ../huge_kernel|wc -l`
- download_kernel() {
- TMP=/tmp/kernels$$
- TMP2=/tmp/kernels2$$
- wget ${REPO_URL} -O $TMP
-
- c=1
- cat $TMP|tr '>' ' '|tr '<' ' '|tr ' ' '\n'|grep -v 'md5'|grep -v 'kernels'|grep 'huge'|grep -v 'href'|\
- while read q;do
- echo "$c $q" >> $TMP2
- c=$(($c + 1))
- done
- while [ 1 ];do
- echo "Please choose the number of the kernel you wish to download"
- cat $TMP2
- read choice_k
- choice=`grep ^$choice_k $TMP2`
- [ ! "$choice" ] && echo "invalid choice" && continue
- echo "You chose ${choice##* }. Hit ENTER to continue"
- read
- break
- done
- wget -t0 -c $REPO_URL/${choice##* } -P ../huge_kernel
- wget $REPO_URL/${choice##* }.md5.txt -P ../huge_kernel
- CHK=`md5sum ../huge_kernel/${choice##* }|cut -d ' ' -f1`
- MD5=`cat ../huge_kernel/${choice##* }.md5.txt|cut -d ' ' -f1`
- [ "$CHK" != "$MD5" ] && "checksum failed" && exit 1
- echo "Checksum passed"
- rm ../huge_kernel/${choice##* }.md5.txt
- rm $TMP
- rm $TMP2
- }
- [ "$IS_KERNEL" = 0 ] && download_kernel
- choose_kernel() {
- TMP=/tmp/kernels3$$
- x=1
- for j in `ls -1 ../huge_kernel|grep -v 'md5'`;do
- echo "$x $j" >> $TMP
- x=$(($x + 1))
- done
- while [ 1 ];do
- echo "Please choose the number of the kernel you wish to use"
- cat $TMP
- read choice_k3
- choice3=`grep ^$choice_k3 $TMP`
- [ ! "$choice3" ] && echo "invalid choice3" && continue
- echo "You chose ${choice3##* }. Hit ENTER to continue"
- read
- break
- done
- KERNEL_VERSION=`echo ${choice3##* } |cut -d '-' -f2-|rev|cut -d '.' -f3-|rev`
- rm $TMP
- }
- unset IS_KERNEL
- IS_KERNEL=`ls ../huge_kernel|wc -l`
- [ "$IS_KERNEL" -gt 1 ] && choose_kernel
- [ "$IS_KERNEL" == 1 ] && KERNEL_VERSION=`ls ../huge_kernel|grep -v 'md5'|cut -d '-' -f2-|rev|cut -d '.' -f3-|rev`
- echo "Kernel is $KERNEL_VERSION version"
- cp -a ../huge_kernel/huge-${KERNEL_VERSION}.tar.* build/
- cd build
- tar -xvf huge-${KERNEL_VERSION}.tar.*
- [ "$?" = 0 ] || exit 1
- rm -f huge-${KERNEL_VERSION}.tar.*
- mv -f kernel-modules.sfs-$KERNEL_VERSION $ZDRVSFS
- mv -f vmlinuz-$KERNEL_VERSION vmlinuz
- cd ..
- REALKERNAME='vmlinuz'
- [ -f rootfs-complete/boot/vmlinuz ] && cp rootfs-complete/boot/vmlinuz build/
- if [ -f rootfs-complete/boot/uImage ];then
- cp rootfs-complete/boot/uImage build/vmlinuz
- REALKERNAME='uImage'
- fi
- if [ -f rootfs-complete/boot/kernel.img ];then
- cp rootfs-complete/boot/kernel.img build/vmlinuz
- REALKERNAME='kernel.img'
- fi
- [ -f rootfs-complete/boot/System.map ] && cp rootfs-complete/boot/System.map ./
- sync
- rm -rf rootfs-complete/boot 2 > /dev/null
- cd build
- for pfile in vmlinuz *.sfs ; do
- echo -n "$IDSTRING" >> $pfile
- echo "Appending IDSTRING : $IDSTRING to $pfile"
- done
- echo
- cd -
- if [ "${DISTRO_BINARY_COMPAT}" = "arch" ]; then
- rm -f rootfs-complete/.INSTALL*
- fi
- mkdir -p rootfs-complete/usr/local/petget
- cp ${WKGDIR}/support/arch/runDotInstalls rootfs-complete/usr/local/petget/ArchRunDotInstalls
- chmod 755 rootfs-complete/usr/local/petget/ArchRunDotInstalls
- echo
- echo "Now building initial ramdisk in initrd-tree/..."
- rm -rf initrd-tree
- cp -a ../boot/initrd-tree0 ./initrd-tree
- cp ../DISTRO_SPECS ./initrd-tree/
- if [ "$SDFLAG" != "" ];then
-
- cp -a -f rootfs-complete/lib/keymaps initrd-tree/lib/
- cp -a -f rootfs-complete/lib/consolefonts initrd-tree/lib/
- else
- mv -f rootfs-complete/lib/keymaps initrd-tree/lib/
- mv -f rootfs-complete/lib/consolefonts initrd-tree/lib/
- fi
- sync
- xDISTROSPECS="`cat initrd-tree/DISTRO_SPECS`"
- echo "$xDISTROSPECS" > initrd-tree/DISTRO_SPECS
- echo "$xDISTROSPECS" > rootfs-complete/etc/DISTRO_SPECS
- NEWVARIABLES="#32-byte alpha-numeric ID-string appended to vmlinuz, ${PUPPYSFS}, ${ZDRVSFS} and devx.sfs:
- DISTRO_IDSTRING='${IDSTRING}'
- #Puppy default filenames...
- #Note, the 'SFS' files below are what the 'init' script in initrd.gz searches for,
- #for the partition, path and actual files loaded, see PUPSFS and ZDRV in /etc/rc.d/PUPSTATE
- DISTRO_PUPPYSFS='${PUPPYSFS}'
- DISTRO_ZDRVSFS='${ZDRVSFS}'
- DISTRO_ADRVSFS='${ADRVSFS}'
- DISTRO_YDRVSFS='${YDRVSFS}'"
- echo "$NEWVARIABLES" >> initrd-tree/DISTRO_SPECS
- echo "$NEWVARIABLES" >> rootfs-complete/etc/DISTRO_SPECS
- sync
- DISTRO_PUPPYDATE="`date | tr -s " " | cut -f 2,6 -d " "`"
- echo "DISTRO_PUPPYDATE='${DISTRO_PUPPYDATE}'" >> rootfs-complete/etc/DISTRO_SPECS
- echo "DISTRO_PUPPYDATE='${DISTRO_PUPPYDATE}'" >> initrd-tree/DISTRO_SPECS
- INITRDTRANSFILES="`find ../rootfs-skeleton/usr/share/sss/initrd_strings -mindepth 1 -maxdepth 1 -type f -name 'initrd_strings.*'`"
- if [ "$INITRDTRANSFILES" ];then
- for ATRANS in $INITRDTRANSFILES
- do
- ENDBIT="`echo -n "$ATRANS" | rev | cut -f 1 -d '.' | rev`"
- mkdir -p initrd-tree/locale/${ENDBIT}
-
- sPTN="/^\[init\]/,/^$/p"
- CODEBLOCK="`sed -n "$sPTN" ${ATRANS} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`"
- [ ! "$CODEBLOCK" ] && continue
- echo "$CODEBLOCK" > initrd-tree/locale/${ENDBIT}/init
- done
- fi
- echo
- echo
- echo "Puppy is built with a default locale LANG=en_US and keyboard layout KMAP=us,
- which may be changed after bootup.
- However, if you are building a language-specific Puppy, you may change the
- defaults now. But, please do make sure that your Puppy has a 'langpack' PET
- for your language installed -- if one does not exist, then you will have to
- create one -- see MoManager in the Utility menu, also read the Menu -> Help
- -> HOWTO Internationalization."
- echo
- echo "These are the available LANG values (in /usr/share/i18n/locales):
- 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"
- 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."
- echo "(the default is en_US.UTF-8)"
- echo -n "ENTER only for default, or type it now: "
- read DEFAULTLANG
- if [ "$DEFAULTLANG" ];then
- echo "...ok, set to ${DEFAULTLANG}"
- DEFAULTLANG1="${DEFAULTLANG%_*}"
- if [ "$DEFAULTLANG1" != "en" ];then
- echo -n "$DEFAULTLANG" > initrd-tree/PUPPYLANG
- echo
- echo "These are the available keyboard layout values (in /lib/keymaps):
- 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"
- 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."
- echo -n "Enter only for 'us', else type one of the above: "
- read DEFAULTKMAP
- [ "$DEFAULTKMAP" != "" ] && [ "$DEFAULTKMAP" != "us" ] && echo -n "$DEFAULTKMAP" > initrd-tree/PUPPYKEYMAP
- [ "$DEFAULTKMAP" = "" ] && DEFAULTKMAP="us"
- echo "...ok, set to ${DEFAULTKMAP}"
- fi
- else
- DEFAULTLANG="en_US.UTF-8"
- echo "...ok, set to ${DEFAULTLANG}"
- fi
- sed -i -e "s%^LANG=.*%LANG=${DEFAULTLANG}%" rootfs-complete/etc/profile
- echo
- echo
- echo "Replacing init"
- [ -d ../huge_extras ] && cp -af ../huge_extras/init initrd-tree/
- sed -i -e 's%^PUPDESKFLG=.*%PUPDESKFLG=0%' initrd-tree/init
-
-
-
-
-
-
-
- cp -f ../boot/makecpioinitrd ./
- cp -f ../boot/cpio ./
- ./makecpioinitrd
- sync
- mv -f initrd.gz build/
- rm -rf zdrv 2>/dev/null
- rm -f ${ZDRVSFS}
- rm -f rootfs-complete/etc/profile.d/*.csh* 2>/dev/null
- echo
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- chroot rootfs-complete echo 'testing chroot'
- if [ $? -ne 0 ];then
- echo "ERROR: could not 'chroot' into sandbox3/rootfs-complete"
- echo "This means that something is incomplete, perhaps a library"
- echo "needed by bash. Check it out. Have to exit script now."
- exit
- fi
- else
- echo "Normally, the script now does a sanity-test by chrooting into"
- echo "sandbox3/rootfs-complete, however as you are doing a cross-build, this"
- echo "cannot be done."
- fi
- echo
- echo "Finding invalid symlinks..."
- rm -rf devx
- mkdir devx
- find rootfs-complete/ -type l |
- while read ONESYMLINK
- do
- [ "`echo -n "$ONESYMLINK" | grep '/dev/'`" != "" ] && continue
- [ "`echo -n "$ONESYMLINK" | grep '/proc/'`" != "" ] && continue
- xONESYMLINK="`echo -n "$ONESYMLINK" | sed -e 's/^rootfs\-complete//'`"
-
-
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- LINKTO="`chroot rootfs-complete readlink "$xONESYMLINK"`"
- [ "`echo -n "$LINKTO" | grep 'lib/X11/pixmaps'`" != "" ] && continue
- if [ "`chroot rootfs-complete readlink -e "$xONESYMLINK"`" = "" ];then
- UPONE="`dirname "$xONESYMLINK"`"
- mkdir -p devx${UPONE}
- cp -a -f "$ONESYMLINK" devx${UPONE}/
- rm -f "$ONESYMLINK"
- fi
- else
-
- LINKTO="`readlink rootfs-complete"${xONESYMLINK}"`"
- [ -e rootfs-complete${LINKTO} ] && continue
- UPONE="`dirname "$xONESYMLINK"`"
- [ -e rootfs-complete${UPONE}/${LINKTO} ] && continue
- mkdir -p devx${UPONE}
- cp -a -f "$ONESYMLINK" devx${UPONE}/
- rm -f "$ONESYMLINK"
- fi
-
- done
- sync
- echo "Updating pkg data in rootfs-complete/root/.packages ..."
- for ONELIST in $PKGLISTS_COMPAT
- do
- cp -f ../$ONELIST ./
- cp -f ../$ONELIST rootfs-complete/root/.packages/
- done
- for ONELIST in $PACKAGELISTS_PET_ORDER
- do
- cp -f ../$ONELIST ./
- cp -f ../$ONELIST rootfs-complete/root/.packages/
- done
- cp -f ../Packages-puppy-[0-9]-official rootfs-complete/root/.packages/ 2>/dev/null
- cp -f ../Packages-puppy-common-official rootfs-complete/root/.packages/ 2>/dev/null
- cp -f ../Packages-puppy-noarch-official rootfs-complete/root/.packages/
- if [ -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official ];then
- cp -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official rootfs-complete/root/.packages/
- cp -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official ./
-
- ../support/rationalize_categories Packages-puppy-${DISTRO_DB_SUBNAME}-official
- cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-${DISTRO_DB_SUBNAME}-official
- fi
- if [ -f Packages-puppy-wary5-official ];then
- ../support/rationalize_categories Packages-puppy-wary5-official
- cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-wary5-official
- fi
- cp -f ../PKGS_MANAGEMENT rootfs-complete/root/.packages/
- petcntlimit=3
- COMPATDISTRO_DB_FILES="`ls -1 rootfs-complete/root/.packages/Packages-[^p]* 2>/dev/null`"
- [ "$COMPATDISTRO_DB_FILES" = "" ] && petcntlimit=5
- enabledrepos=" "
- [ -f ../Packages-puppy-quirky-official ] && cp -f ../Packages-puppy-quirky-official rootfs-complete/root/.packages/
- fNUM1=`echo -n "$DISTRO_COMPAT_VERSION" | wc -c`
- repocnt=1
- case $DISTRO_FILE_PREFIX in
- lucid|lupu|luci)
- enabledrepos="Packages-puppy-lucid-official Packages-puppy-noarch-official "
- ;;
- wary|racy)
- enabledrepos="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-quirky-official Packages-puppy-noarch-official Packages-puppy-4-official "
- ;;
- slacko)
- enabledrepos="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official "
- ;;
- dpup|sqzd)
- enabledrepos="Packages-puppy-dpup-official Packages-puppy-noarch-official "
- ;;
- *)
-
- for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-puppy* | sort -r`
- do
- [ $repocnt -gt $petcntlimit ] && break
- BASEREPO="`basename $ONEREPO`"
- [ "$BASEREPO" = "Packages-puppy-wary5-official" ] && continue
- [ "$BASEREPO" = "Packages-puppy-lucid-official" ] && continue
- [ "$BASEREPO" = "Packages-puppy-slacko-official" ] && continue
-
- if [ "$DISTRO_BINARY_COMPAT" = "puppy" ];then
- ONEREPNUM=`echo -n "$BASEREPO" | cut -f 3 -d '-'`
- fNUM2=`echo -n "$ONEREPNUM" | wc -c`
-
- [ $fNUM1 -eq 1 ] && [ $fNUM2 -eq 1 ] && [ $ONEREPNUM -gt $DISTRO_COMPAT_VERSION 2>/dev/null ] && continue
- fi
-
-
- enabledrepos="${enabledrepos}${BASEREPO} "
- repocnt=`expr $repocnt + 1`
- done
- ;;
- esac
-
- if [ "$COMPATDISTRO_DB_FILES" != "" ];then
- for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-[^p]*`
- do
- [ $repocnt -gt 5 ] && break
- BASEREPO="`basename $ONEREPO`"
- enabledrepos="${enabledrepos}${BASEREPO} "
- repocnt=`expr $repocnt + 1`
- done
- fi
- case $DISTRO_BINARY_COMPAT in
- ubuntu|trisquel)
- xPUPPYREPOS="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official"
- xCOMPATREPOS="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-universe$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
-
- xCOMPATREPOS1="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-universe$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
- xCOMPATREPOS2="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
- enabledrepos=" ${xCOMPATREPOS1} ${xCOMPATREPOS2} ${xPUPPYREPOS} "
- ;;
- esac
- echo "PKG_REPOS_ENABLED='${enabledrepos}'" >> rootfs-complete/root/.packages/PKGS_MANAGEMENT
- if [ -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
- cp -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
- else
- cp -f ../DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
- fi
- if [ -f /tmp/3builddistro_removed_alt ];then
- for ONEREMOVE in `cat /tmp/3builddistro_removed_alt | tr '\n' ' '`
- do
- orPATTERN='yes|'"$ONEREMOVE"'|'
- grep -v "$orPATTERN" rootfs-complete/root/.packages/DISTRO_PKGS_SPECS > /tmp/DISTRO_PKGS_SPECS-tempor
- cp -f /tmp/DISTRO_PKGS_SPECS-tempor rootfs-complete/root/.packages/DISTRO_PKGS_SPECS
- done
- fi
- if [ -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ];then
- cp -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} rootfs-complete/root/.packages/DISTRO_COMPAT_REPOS
- else
- cp -f ../DISTRO_COMPAT_REPOS-${DISTRO_BINARY_COMPAT} rootfs-complete/root/.packages/DISTRO_COMPAT_REPOS
- fi
- cp -f ../0setup rootfs-complete/usr/local/petget/
- cp -f ../support/find_cat rootfs-complete/usr/local/petget/
- [ -f ../support/ppkg ] && cp -f ../support/ppkg rootfs-complete/usr/local/petget/
- [ -f ../support/ppkg.ctg ] && cp -f ../support/ppkg.ctg rootfs-complete/usr/local/petget/
- [ -f ../support/rpm2ppm ] && cp -f ../support/rpm2ppm rootfs-complete/usr/local/petget/
- [ -f ../support/mageia2ppm ] && cp -f ../support/mageia2ppm rootfs-complete/usr/local/petget/
- [ -f ../support/debdb2pupdb ] && cp -f ../support/debdb2pupdb rootfs-complete/usr/local/petget/
- cp -f ../DISTRO_PET_REPOS rootfs-complete/root/.packages/
- cp -f ../PKGS_HOMEPAGES rootfs-complete/root/.packages/
- case ${DISTRO_BINARY_COMPAT} in
- debian|devuan|ubuntu|trisquel|raspbian)
- if [ ! -f ../invaliddepslist ];then
- echo "WARNING WARNING"
- echo "File 'invaliddepslist' does not exist.
- This is created by script '0setup'. You must go back and rerun all of the
- scripts from 0setup, 1download, 2createpackages.
- Recommend abort this script now (ctrl-c).
- Or, if you press ENTER to continue, an empty 'invaliddepslist' file will
- be created."
- echo -n "Press ENTER to continue: "
- read justgoon
- touch ../invaliddepslist
- fi
- ;;
- esac
- [ -f ../invaliddepslist ] && cp -f ../invaliddepslist rootfs-complete/usr/local/petget/
- cp ../woof-installed-packages rootfs-complete/root/.packages/
- touch ../devx-only-installed-packages
- cp ../devx-only-installed-packages rootfs-complete/root/.packages/
- echo "$KERNEL_DB_ENTRY" >> rootfs-complete/root/.packages/woof-installed-packages
- sort --key=1 --field-separator="|" rootfs-complete/root/.packages/woof-installed-packages > /tmp/petget_woof-installed-packages
- mv -f /tmp/petget_woof-installed-packages rootfs-complete/root/.packages/woof-installed-packages
- rm -f rootfs-complete/etc/rc.d/rc.sysinit-UNIPUP
- rm -f rootfs-complete/etc/rc.d/rc.shutdown-UNIPUP
- if [ "$SDFLAG" != "" ];then
- rm -f rootfs-complete/usr/sbin/grubconfig
- rm -f rootfs-complete/usr/sbin/remasterpup2
- rm -f rootfs-complete/usr/sbin/resizepfile.sh
- rm -f rootfs-complete/usr/sbin/wakepup2
- rm -f rootfs-complete/usr/share/applications/Grub-bootloader-config.desktop
- rm -f rootfs-complete/usr/share/applications/BootFlash-usb-installer.desktop
- rm -f rootfs-complete/usr/share/applications/Puppy-universal-installer.desktop
- rm -f rootfs-complete/usr/share/applications/Remaster-Puppy-live-CD.desktop
- rm -f rootfs-complete/usr/share/applications/Resize-personal-storage-file.desktop
- rm -f rootfs-complete/usr/share/applications/WakePup2.desktop
- fi
- rootfs-complete/usr/sbin/hackfontsize
- JWMFLG=0
- JWM3=`grep -E '^jwm[_-][0-9]' rootfs-complete/root/.packages/woof-installed-packages | cut -f 3 -d '|' | cut -c 1-3 | head -n 1`
- [ ! $JWM3 ] && JWMFLG=1
- if vercmp $JWM3 ge 2.2; then JWMFLG=2; fi
- if vercmp $JWM3 ge 790; then JWMFLG=2; fi
- case $JWMFLG in
- 2)
- sed -i -e 's%.*LAYER_MINIXCAL.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
- sed -i -e 's%.*LAYER_GTKDIALOGSPLASH.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
- sed -i -e 's%.*LAYER_SPLASHWINDOW.*%\t\t<Option>layer:above</Option>%' rootfs-complete/etc/xdg/templates/_root_.jwmrc
- ;;
- esac
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- echo
- echo "Constructing configuration files for JWM, Fvwm95, IceWM, openbox..."
- chroot rootfs-complete /usr/sbin/fixmenus
-
- chroot rootfs-complete /usr/sbin/indexgen.sh
-
- fi
- echo "/lib${lsuffix}" > rootfs-complete/etc/ld.so.conf
- echo "/usr/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
- [ -d rootfs-complete/usr/local/lib${lsuffix} ] && echo "/usr/local/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
- [ -d rootfs-complete/usr/X11R7/lib${lsuffix} ] && echo "/usr/X11R7/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
- [ -d rootfs-complete/opt/gnome2/lib${lsuffix} ] && echo "/opt/gnome2/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
- [ -d rootfs-complete/opt/qt4/lib${lsuffix} ] && echo "/opt/qt4/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
- [ -d rootfs-complete/opt/mozilla.org/lib${lsuffix} ] && echo "/opt/mozilla.org/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
- [ -d rootfs-complete/opt/samba/lib${lsuffix} ] && echo "/opt/samba/lib${lsuffix}" >> rootfs-complete/etc/ld.so.conf
- echo "/root/my-applications/lib" >> rootfs-complete/etc/ld.so.conf
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- LDCONFIG="`find ../packages-${DISTRO_FILE_PREFIX}/ -type f -name ldconfig | grep '/sbin/' | head -n 1`"
- cp -a $LDCONFIG rootfs-complete/
- chroot rootfs-complete ./ldconfig
- rm -f rootfs-complete/ldconfig
- sync
- else
-
- LDCONFIG="`find ../packages-${DISTRO_FILE_PREFIX}/ -type f -name ldconfig | grep '/sbin/' | head -n 1`"
- cp -a $LDCONFIG rootfs-complete/sbin/
- fi
- rm -rf rootfs-complete/usr/share/lintian 2>/dev/null
- rm -rf rootfs-complete/install 2>/dev/null
- rm -rf rootfs-complete/etc/cron.daily 2>/dev/null
- wdefault=`find rootfs-complete/usr/share/backgrounds -name 'default.*'`
- wptheme=`find rootfs-complete/usr/share/ -type d -name 'ptheme'`
- if [ -z "$wdefault" -a -z "$wptheme" ];then
- echo
- echo "Continuing to setup `pwd`/rootfs-complete..."
- echo
-
- DEFAULT_THEME_GTK2=''
- DEFAULT_THEME_JWM=''
- DEFAULT_THEME_OPENBOX=''
- DEFAULT_THEME_WALLPAPER=''
- DEFAULT_THEME_DESK_ICONS=''
- DEFAULT_THEME_ROX_TEXT_FOREGROUND='black'
- DEFAULT_THEME_ROX_TEXT_SHADOW='thin'
- DEFAULT_THEME_ROX_TEXT_FONT='DejaVu Sans 10'
- DEFAULT_THEME_XORG_TEXT_DPI=
- if [ -f default-theme ];then
- . ../default-theme
- fi
-
- eval "`../support/choose_themes`"
-
-
- if [ "$EXIT" = "OK" ];then
-
-
-
-
-
-
-
-
-
-
- case $BACKGROUNDIMAGE in
- *.png|*.PNG)
- mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.png
- sed -i -e 's%default\.jpg%default.png%' rootfs-complete/root/Choices/ROX-Filer/PuppyPin
-
- sed -i -e 's%default\.jpg%default.png%' rootfs-complete/etc/Puppybackgroundpicture
- ;;
- *.svg)
- mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.svg
- sed -i -e 's%default\.jpg%default.svg%' rootfs-complete/root/Choices/ROX-Filer/PuppyPin
- sed -i -e 's%default\.jpg%default.svg%' rootfs-complete/etc/Puppybackgroundpicture
- ;;
- *)
- mv -f rootfs-complete/usr/share/backgrounds/$BACKGROUNDIMAGE rootfs-complete/usr/share/backgrounds/default.jpg
- ;;
- esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- echo "# -- THEME AUTO-WRITTEN DO NOT EDIT
- include \"/usr/share/themes/${GTKTHEME}/gtk-2.0/gtkrc\"
-
- include \"/root/.gtkrc.mine\"
-
- # -- THEME AUTO-WRITTEN DO NOT EDIT
- gtk-theme-name=\"${GTKTHEME}\"" > rootfs-complete/root/.gtkrc-2.0
-
-
-
-
- pathGTK3THEME="`find rootfs-complete/usr/share/themes/${GTKTHEME} -type d -name gtk-3.0`"
- if [ "$pathGTK3THEME" ];then
-
-
-
-
- ln -snf "$pathGTK3THEME" rootfs-complete/root/.config/gtk-3.0
- fi
-
-
-
-
-
-
-
-
-
-
-
- echo -n "$DESKICONS" > rootfs-complete/etc/desktop_icon_theme
-
- if [ -d rootfs-complete/root/.jwm/themes ];then
- cp -f rootfs-complete/root/.jwm/themes/${JWMTHEME}-jwmrc rootfs-complete/root/.jwm/jwmrc-theme
- cp -f rootfs-complete/root/.jwm/themes/${JWMTHEME}-colors rootfs-complete/root/.jwm/jwm_colors 2>/dev/null
- fi
-
- if [ -f rootfs-complete/root/.config/openbox/rc.xml ];then
- obPATTERN="s%Natura%${OBTHEME}%"
- sed -i -e "$obPATTERN" rootfs-complete/root/.config/openbox/rc.xml
- fi
- sync
- fi
- else
- DESKICONS=`cat rootfs-complete/etc/desktop_icon_theme`
- echo $DESKICONS
- pathGTK3THEME="`find rootfs-complete/usr/share/themes/${GTKTHEME} -type d -name gtk-3.0`"
- if [ "$pathGTK3THEME" ];then
- ln -snf "$pathGTK3THEME" rootfs-complete/root/.config/gtk-3.0
- fi
- sync
- fi
-
- NEWTHEME="$DESKICONS"
- for ONESVG in `find rootfs-complete/usr/local/lib/X11/themes/${NEWTHEME}/ -maxdepth 1 -name \*.svg | tr '\n' ' '`
- do
- ONEBASENAME="`basename $ONESVG .svg`"
- rm -f rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}48.png
- rsvg-convert -w 48 -h 48 -o rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}48.png $ONESVG
- rm -f rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}24.png 2>/dev/null
-
-
-
-
- done
- for ONEPNG in `find rootfs-complete/usr/local/lib/X11/themes/${NEWTHEME}/ -maxdepth 1 -type f -name \*.png | tr '\n' ' '`
- do
- ONEBASENAME="`basename $ONEPNG .png`"
- cp -f $ONEPNG rootfs-complete/usr/local/lib/X11/pixmaps/
- touch -m rootfs-complete/usr/local/lib/X11/pixmaps/${ONEBASENAME}.png
- xONEBASENAME="`basename $ONEBASENAME 48`"
-
-
-
-
-
-
- done
- if [ "$DISPLAY" ];then
-
- if [ -e rootfs-complete/usr/sbin/pngoverlay -a -e rootfs-complete/usr/local/lib/X11/pixmaps/closebox_outline48.png ];then
- rm -f rootfs-complete/usr/local/lib/X11/pixmaps/*_mntd*.png
-
-
- cp -f /usr/sbin/pngoverlay rootfs-complete/usr/local/lib/X11/pixmaps/
- cd rootfs-complete/usr/local/lib/X11/pixmaps
- for ONEDRV in card drive floppy optical usbdrv
- do
- ./pngoverlay ${ONEDRV}48.png closebox_outline48.png ${ONEDRV}_mntd48.png
- ./pngoverlay ${ONEDRV}48.png locked_outline48.png ${ONEDRV}_mntd_boot48.png
- done
- rm -f rootfs-complete/usr/local/lib/X11/pixmaps/pngoverlay
- cd ../../../../../../
- fi
- fi
- if [ -f rootfs-complete/root/.jwmrc-tray ];then
- if [ -f rootfs-complete/usr/local/lib/X11/${NEWTHEME}/start-button.png ];then
- if [ -f rootfs-complete/usr/local/lib/X11/pixmaps/start-button.png ];then
- if [ "`grep 'start-button\.png' rootfs-complete/root/.jwmrc-tray`" = "" ];then
-
- echo "rootfs-complete/root/.jwmrc-tray modified to use start-button.png menu icon"
- echo "(which is in rootfs-complete/usr/local/lib/X11/pixmaps/)"
- PTN1='s%label="Menu" icon="mini-dog\.xpm"%icon="start-button.png"%'
- sed -i -e "$PTN1" rootfs-complete/root/.jwmrc-tray
- fi
- fi
- fi
- fi
- echo
- echo "The ROX-Filer desktop text defaults to white with black shadow, but this is"
- echo "not best for some light backgound images. ENTER only to keep, but if you"
- echo -n "want black text press any printable key then ENTER: "
- read wantblacktext
- if [ "$wantblacktext" != "" ];then
- echo "...ok, black text"
- grep -v 'pinboard_fg_colour' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
- grep -v 'pinboard_shadow_labels' /tmp/3builddistro_rox_options > rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- grep -v '^</Options>' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
- mv -f /tmp/3builddistro_rox_options rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- echo ' <Option name="pinboard_fg_colour">#000000000000</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- echo ' <Option name="pinboard_shadow_labels">0</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- echo '</Options>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- fi
- echo
- echo "Also, ROX-Filer defaults to 'DejaVu Sans 10' font for the desktop. To accept"
- echo "that just press ENTER. If you would prefer bold text 'DejaVu Sans Bold 10',"
- echo "hit 'b' key then ENTER, or type in a full font specification (ex: Mono 12)"
- echo -n ": "
- read wantfont
- if [ "$wantfont" != "" ];then
- grep -v 'label_font' rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options > /tmp/3builddistro_rox_options
- grep -v '^</Options>' /tmp/3builddistro_rox_options > rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- if [ "$wantfont" = "b" ];then
- echo '...ok, bold'
- echo ' <Option name="label_font">DejaVu Sans Bold 10</Option>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- else
- echo "...ok, $wantfont"
- echo " <Option name=\"label_font\">${wantfont}</Option>" >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- fi
- echo '</Options>' >> rootfs-complete/root/.config/rox.sourceforge.net/ROX-Filer/Options
- fi
- RK=`uname -r`
- [ ${RK%%.*} -lt 3 ] && echo "Running kernel too old, exiting" && exit 1
- [ ! -e rootfs-complete/usr/sbin/mksquashfs4 ] && mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs4 2>/dev/null
- [ -e rootfs-complete/usr/sbin/mksquashfs ] && [ ! -h rootfs-complete/usr/sbin/mksquashfs ] && mv -f rootfs-complete/usr/sbin/mksquashfs rootfs-complete/usr/sbin/mksquashfs3 2>/dev/null
- [ -e rootfs-complete/usr/sbin/mksquashfs4 ] && ln -s mksquashfs4 rootfs-complete/usr/sbin/mksquashfs 2>/dev/null
- [ ! -e rootfs-complete/usr/sbin/unsquashfs4 ] && mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs4 2>/dev/null
- [ -e rootfs-complete/usr/sbin/unsquashfs ] && [ ! -h rootfs-complete/usr/sbin/unsquashfs ] && mv -f rootfs-complete/usr/sbin/unsquashfs rootfs-complete/usr/sbin/unsquashfs3 2>/dev/null
- [ -e rootfs-complete/usr/sbin/unsquashfs4 ] && ln -s unsquashfs4 rootfs-complete/usr/sbin/unsquashfs 2>/dev/null
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- chroot rootfs-complete /usr/sbin/chooselocale composeonly
- fi
- [ -f rootfs-complete/pet.specs ] && rm -f rootfs-complete/pet.specs
- if [ -d rootfs-complete/usr/share/gtksourceview-2.0 ];then
- if [ -d rootfs-complete/usr/share/moo/language-specs ];then
- echo
- echo "An optimisation can be done to share some files between medit and"
- echo -n "gtksourceview. Press ENTER only to do this: "
- read optsourceview
- if [ "$optsourceview" = "" ];then
- cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/convert.py rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
- cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language2.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
- cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
- cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/language.dtd rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
- cp -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs/styles.rng rootfs-complete/usr/share/moo/language-specs/ 2>/dev/null
- rm -r -f rootfs-complete/usr/share/gtksourceview-2.0/language-specs
- rm -r -f rootfs-complete/usr/share/gtksourceview-2.0/styles
- ln -s /usr/share/moo/language-specs rootfs-complete/usr/share/gtksourceview-2.0/language-specs
- ln -s /usr/share/moo/language-specs rootfs-complete/usr/share/gtksourceview-2.0/styles
- echo "...usr/share/gtksourceview-2.0 now has links to usr/share/moo."
- fi
- fi
- fi
- [ -d rootfs-complete/usr/share/devhelp ] && rm -rf rootfs-complete/usr/share/devhelp
- [ -d rootfs-complete/usr/share/man ] && rm -rf rootfs-complete/usr/share/man
- [ -d rootfs-complete/usr/share/omf ] && rm -rf rootfs-complete/usr/share/omf
- if [ -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}48.png ];then
- mv -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}48.png rootfs-complete/usr/share/doc/${DISTRO_FILE_PREFIX}48.png
- ln -snf ${DISTRO_FILE_PREFIX}48.png rootfs-complete/usr/share/doc/puppylogo48.png
- fi
- if [ -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}96.png ];then
- mv -f rootfs-complete/usr/share/doc/puplogos/${DISTRO_FILE_PREFIX}96.png rootfs-complete/usr/share/doc/${DISTRO_FILE_PREFIX}96.png
- ln -snf ${DISTRO_FILE_PREFIX}96.png rootfs-complete/usr/share/doc/puppylogo96.png
- fi
- rm -rf rootfs-complete/usr/share/doc/puplogos
- if [ ! -e rootfs-complete/sbin/ifplugstatus ];then
- if [ -e rootfs-complete/sbin/ifplugstatus-0.18 ];then
- ln -s ifplugstatus-0.18 rootfs-complete/sbin/ifplugstatus
- else
- if [ -e rootfs-complete/sbin/ifplugstatus-0.28 ];then
- ln -s ifplugstatus-0.28 rootfs-complete/sbin/ifplugstatus
- fi
- fi
- fi
- [ -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
- if [ ! -e rootfs-complete/usr/lib/cups/backend/smb ];then
- [ -f rootfs-complete/opt/samba/bin/smbspool ] && ln -s /opt/samba/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
- [ -f rootfs-complete/usr/bin/smbspool ] && ln -s /usr/bin/smbspool rootfs-complete/usr/lib/cups/backend/smb
- fi
- [ -f rootfs-complete/etc/opt/samba/smb.conf ] && chmod 755 rootfs-complete/etc/opt/samba/smb.conf
- [ -f rootfs-complete/etc/samba/smb.conf ] && chmod 755 rootfs-complete/etc/samba/smb.conf
- chmod 1777 rootfs-complete/tmp
- chmod 777 rootfs-complete/var
- mkdir -p rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate
- if [ -d rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers-alternate ];then
- cp -a -f rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers-alternate/* rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate/
- rm -rf rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers-alternate
- fi
- if [ -d rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers ];then
- XORGBADDRIVERS=''
- 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
- [ -f rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers/nv_drv.so ] && XORGBADDRIVERS='nv'
- fi
- [ -f rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers/modesetting_drv.so ] && XORGBADDRIVERS="${XORGBADDRIVERS} modesetting"
- echo
- echo "Certain Xorg drivers have a bad reputation. Here you can choose to move them"
- echo "to /usr/lib${lsuffix}/x/drivers-alternate so Xorg will not use them, instead"
- echo "will use the generic 'vesa' driver (or other more appropriate driver)."
- echo "However the Xorg Wizard has a mechanism to move any drivers in "
- echo "'drivers-alternate' back to 'drivers' directory."
- echo "Here is the list of drivers currently in 'drivers-alternate':"
- XORGBADDRIVERS="$XORGBADDRIVERS `ls -1 rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate | grep '_drv' | cut -f 1 -d '_' | tr '\n' ' '`"
- echo " $XORGBADDRIVERS"
- echo "Press ENTER only to accept this, or"
- echo "type a space-delimited list of drivers"
- echo -n " that you want to be in 'drivers-alternate': "
- read NEWXORGBADDRVRS
- [ "$NEWXORGBADDRVRS" = "" ] && NEWXORGBADDRVRS="$XORGBADDRIVERS"
- for ONEBADX in $NEWXORGBADDRVRS
- do
-
- if [ -h rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers/${ONEBADX}_drv.so ];then
- continue
- fi
- [ -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/
- done
- for ONECHK in `ls -1 rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate | grep '_drv' | cut -f 1 -d '_' | tr '\n' ' '`
- do
- oPTN=" ${ONECHK} "
- if [ "`echo -n " ${NEWXORGBADDRVRS} " | grep "$oPTN"`" = "" ];then
- if [ ! -d $ONECHK ];then
- mv -f rootfs-complete/usr/lib${lsuffix}/x/drivers-alternate/${ONECHK}_drv.so rootfs-complete/usr/lib${lsuffix}/xorg/modules/drivers/
- else
- echo "SORRY: cannot move '${ONECHK}_drv.so' from drivers-alternate back to"
- echo "main drivers, it must stay as an alternate driver only."
- fi
- fi
- done
- fi
- if [ "$USINGKMOD" = "no" ];then
- if [ ! -h rootfs-complete/sbin/depmod-FULL ];then
- if [ -f rootfs-complete/sbin/depmod-FULL ];then
- mv -f rootfs-complete/sbin/depmod rootfs-complete/sbin/depmod-BB-NOTUSED
- mv -f rootfs-complete/sbin/depmod-FULL rootfs-complete/sbin/depmod
- fi
- ln -s depmod rootfs-complete/sbin/depmod-FULL
- fi
- else
- [ -e rootfs-complete/bin/kmod ] && ln -snf ../bin/kmod rootfs-complete/sbin/depmod
- fi
- cp -a -f ../rootfs-skeleton/usr/sbin/alsaconf rootfs-complete/usr/sbin/
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- echo
- echo "Would you like to strip all binary executables and shared library files?"
- echo "These are usually already stripped, although some packages may have the shared"
- echo "library files stripped with the '--strip-debug' option only, and extra stripping"
- echo "should be okay. It won't do any harm answering yes here."
- if [ "`which strip`" = "" ];then
- echo
- echo "OH, NO GOOD, you don't have the 'strip' executable. The 'devx' sfs has it."
- echo "PLEASE DECLINE THIS OFFER..."
- echo
- fi
- echo -n "ENTER only to strip, any other printable char to decline: "
- read NOSTRIP
- if [ "$NOSTRIP" = "" ];then
- find rootfs-complete/bin rootfs-complete/sbin rootfs-complete/usr/bin rootfs-complete/sbin -type f |
- while read ONEFILE
- do
- ONEBASE="`basename "$ONEFILE"`"
-
- [ "$ONEBASE" = "e3" ] && continue
- [ "$ONEBASE" = "QtWeb" ] && continue
- if [ "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" != "" ];then
- echo -n "$ONEBASE "
- strip --strip-unneeded "$ONEFILE"
- fi
- done
- echo
- find rootfs-complete/usr/lib rootfs-complete/usr/X11R7/lib -type f -name \*.so* |
- while read ONEFILE
- do
- ONEBASE="`basename "$ONEFILE"`"
-
-
-
- if [ "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" != "" ];then
- echo -n "$ONEBASE "
- strip --strip-unneeded "$ONEFILE"
- fi
- done
- echo
- fi
- fi
- echo
- echo "Now building sandbox3/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.pet,"
- echo "which is a PET package with lists of all packages and files builtin to the SFS..."
- rm -rf 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION} 2>/dev/null
- mkdir 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
- mkdir /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
- for ONEGENDIR in `find ../packages-${DISTRO_FILE_PREFIX} -maxdepth 1 -type d | tr '\n' ' '`
- do
- ONEGENNAME="`basename $ONEGENDIR`"
- ogPATTERN="|${ONEGENNAME}|"
- [ "`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep "$ogPATTERN"`" == "" ] && continue
- echo -n "$ONEGENNAME "
- ogPATTERN="s%^\\.\\./packages-${DISTRO_FILE_PREFIX}/${ONEGENNAME}/%/%"
- find $ONEGENDIR | sed -e "$ogPATTERN" | sort > /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${ONEGENNAME}.files
- sync
-
- mkdir -p 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files
- PREVPATH=''; PREVPATH0=''
- cat /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${ONEGENNAME}.files |
- while read ONELINE
- do
- [ "`echo "$ONELINE" | cut -c 1`" == "." ] && continue
- if [ -d "rootfs-complete${ONELINE}" ];then
-
- if [ -h "rootfs-complete${ONELINE}" ];then
- if [ "$(readlink "rootfs-complete${ONELINE}")" = "./" ];then
- PREVPATH0="$(dirname "$ONELINE")"
- [ "$PREVPATH0" != "$PREVPATH" ] && echo "$PREVPATH0" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME}
- continue
- fi
- fi
- PREVPATH="$ONELINE"
- echo "$ONELINE" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME}
- else
- NEWPATH="`dirname "$ONELINE"`"
- [ "$NEWPATH" == "/" ] && continue
- NEWFILE="`basename "$ONELINE"`"
- if [ -e "rootfs-complete${ONELINE}" ];then
- if [ "$PREVPATH" == "$NEWPATH" -o "$PREVPATH0" == "$NEWPATH" ];then
- echo " ${NEWFILE}" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${ONEGENNAME}
- fi
- fi
- fi
- done
- done
- if [ -f /tmp/rootfs-packages.specs ];then
- while read line ; do
- PKGL=`echo $line | cut -d '|' -f 2`
- echo -n "${PKGL} "
- ogPATTERN="s%^\\.\\./rootfs-packages/${PKGL}/%/%"
- find ../rootfs-packages/$PKGL | sed -e "$ogPATTERN" | sort > /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${PKGL}.files
- sync
- mkdir -p 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files
- PREVPATH=''; PREVPATH0=''
- cat /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/${PKGL}.files |
- while read ONELINE
- do
- [ "`echo "$ONELINE" | cut -c 1`" == "." ] && continue
- if [ -d "rootfs-complete${ONELINE}" ];then
- PREVPATH="$ONELINE"
- echo "$ONELINE" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${PKGL}
- else
- NEWPATH="`dirname "$ONELINE"`"
- [ "$NEWPATH" == "/" ] && continue
- NEWFILE="`basename "$ONELINE"`"
- if [ -e "rootfs-complete${ONELINE}" ];then
- if [ "$PREVPATH" == "$NEWPATH" -o "$PREVPATH0" == "$NEWPATH" ];then
- echo " ${NEWFILE}" >> 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files/${PKGL}
- fi
- fi
- fi
- done
- done < /tmp/rootfs-packages.specs
- rm -f /tmp/rootfs-packages.specs
- fi
- echo
- 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||||
- " > 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/pet.specs
- rm -f 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.pet 2>/dev/null
- dir2tgz 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
- tgz2pet 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.tar.gz
- rm -rf /tmp/0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}
- echo
- echo "installing pkg lists into rootfs-complete/root/.packages/builtin_files..."
- cp -a -f 0builtin_files_${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}/root/.packages/builtin_files rootfs-complete/root/.packages/builtin_files
- echo '...done'
- echo "Removing redundant aufs-utils..."
- for r in auibusy auplink mount.aufs umount.aufs aufs libau.so* aufs aufs.5 aubrsync aubusy auchk
- do find rootfs-complete/ -type f -name $r -delete
- echo "deleting $r"
- done
- echo "Removing redundant firmware as it is in the z drive"
- rm -rf rootfs-complete/lib/firmware 2>/dev/null
- for fw in agrsm hso iwlwifi libertas* madwifi* mwl8k mwave* nozomi RTL8192E rt2x00 rtl_nic rtlwifi brcm;do
- echo "removing $fw"
- rm -rf rootfs-complete/lib/modules/all-firmware/${fw} 2>/dev/null
- done
- sleep 1
- echo
- echo "Creating Fontconfig cache files..."
- rm -rf rootfs-complete/var/cache/fontconfig
- mkdir -p rootfs-complete/var/cache/fontconfig
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- chroot rootfs-complete /usr/bin/fc-cache -s -v
- fi
- if [ ! -e rootfs-complete/usr/bin/pango-querymodules ];then
-
- cp -f ../packages-${DISTRO_FILE_PREFIX}/pango_DEV/usr/bin/pango-querymodules rootfs-complete/usr/bin/
- fi
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- PANGOMODULES="`find rootfs-complete/etc/pango -type f -name pango.modules | sed -e 's%rootfs-complete%%'`"
- [ "$PANGOMODULES" = "" ] && PANGOMODULES='/etc/pango/pango.modules'
- if [ ! -s rootfs-complete${PANGOMODULES} ];then
- echo "/usr/bin/pango-querymodules > ${PANGOMODULES}" > rootfs-complete/zz
- chroot rootfs-complete /bin/ash zz
- rm -f rootfs-complete/zz
- fi
- fi
- if [ -d rootfs-complete/etc/pango/i386 ];then
- cp -a -f rootfs-complete/etc/pango/pango.modules rootfs-complete/etc/pango/i386/
- [ -f rootfs-complete/etc/pango/pangox.aliases ] && cp -a -f rootfs-complete/etc/pango/pangox.aliases rootfs-complete/etc/pango/i386/
- fi
- VERDIR=''
- if [ -d rootfs-complete/usr/lib${lsuffix}/gdk-pixbuf-2.0 ];then
- [ ! -f rootfs-complete/etc/gtk-2.0/gdk-pixbuf.loaders ] && touch rootfs-complete/etc/gtk-2.0/gdk-pixbuf.loaders
- PIXBUFLOADERSDIR="`find rootfs-complete/usr/lib${lsuffix}/gdk-pixbuf-2.0 -maxdepth 2 -mindepth 2 -type d -name loaders | head -n 1`"
- if [ "$PIXBUFLOADERSDIR" ];then
- PIXBUFCACHEDIR="`dirname $PIXBUFLOADERSDIR`"
- VERDIR="`basename $PIXBUFCACHEDIR`"
- ln -snf ../../../../etc/gtk-2.0/gdk-pixbuf.loaders ${PIXBUFCACHEDIR}/loaders.cache
-
- [ -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
- if [ -d rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders ];then
- mv -f rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders/*.so ${PIXBUFLOADERSDIR}/ 2>/dev/null
- rmdir rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders
- ln -s ../../gdk-pixbuf-2.0/${VERDIR}/loaders rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders
- else
- ln -s ../../gdk-pixbuf-2.0/${VERDIR}/loaders rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/loaders
- fi
- fi
- fi
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- chroot rootfs-complete /usr/bin/gtk-query-immodules-2.0 > rootfs-complete/etc/gtk-2.0/gtk.immodules
- else
- touch rootfs-complete/etc/gtk-2.0/gtk.immodules
- fi
- [ "$VERDIR" ] && ln -snf ../../../../etc/gtk-2.0/gtk.immodules rootfs-complete/usr/lib${lsuffix}/gtk-2.0/${VERDIR}/gtk.immodules
- mkdir -p rootfs-complete/etc/modprobe.d
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- XORGINFO="`chroot rootfs-complete /usr/bin/Xorg -version 2>&1`"
- XORGVER="`echo "$XORGINFO" | grep '^X\.Org' | rev | cut -f 1 -d ' ' | rev`"
- else
-
- XORGVER='1.7.7'
- fi
- [ "$XORGVER" = "" ] && XORGVER="`echo "$XORGINFO" | grep '^X Window System Version' | rev | cut -f 1 -d ' ' | rev`"
- [ "$XORGVER" = "" ] && XORGVER="1.3.0"
- if vercmp "$XORGVER" gt "1.7.6";then
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DRILIST='i915 radeon nouveau'
- [ "$SDFLAG" ] && DRILIST=''
- if [ "$DRILIST" != "" ];then
- echo
- echo "Certain Xorg drivers require KMS (Kernel ModeSetting)"
- echo "A value of '1' means on, '0' means off."
- echo "Press ENTER key only to accept the default, any other char to flip:"
- for XDRIVER in $DRILIST
- do
- KMSFLG='1'
-
-
- echo -n "${XDRIVER} [${KMSFLG}]: "
- read KMSREPLY
- if [ "$KMSREPLY" ];then
-
- case $KMSFLG in
- 0) echo "options ${XDRIVER} modeset=1" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf ;;
- 1) echo "options ${XDRIVER} modeset=0" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf ;;
- esac
- else
- echo "options ${XDRIVER} modeset=${KMSFLG}" > rootfs-complete/etc/modprobe.d/${XDRIVER}.conf
- fi
- done
- fi
- fi
- echo
- echo "Do you want the PPM2 or the Classic gui for PPM?"
- echo "hit \"c\" [enter] for Classic, Enter only for PPM2."
- read UICHOICE
- if [ "$UICHOICE" = "c" ];then
- mkdir -p rootfs-complete/var/local/petget
- echo "Classic" > rootfs-complete/var/local/petget/ui_choice
- else
- echo "Leaving PPM2 gui"
- fi
- echo
- echo "Fixing permissions on CUPS libraries.."
- chmod 0755 rootfs-complete/usr/lib${lsuffix}/cups/backend
- chmod 0755 rootfs-complete/usr/lib${lsuffix}/cups/filter
- chmod 500 rootfs-complete/usr/lib${lsuffix}/cups/backend/*
- echo
- if [ "`grep 'nb_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
- echo 'nb_NO.utf8: nb_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
- fi
- if [ "`grep 'nn_NO\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
- echo 'nn_NO.utf8: nn_NO.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
- fi
- if [ "`grep 'ru_UA\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
- echo 'ru_UA.utf8: ru_UA.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
- fi
- if [ "`grep 'ru_RU\.utf8' rootfs-complete/usr/share/X11/locale/locale.alias`" = "" ];then
- echo 'ru_RU.utf8: ru_RU.UTF-8' >> rootfs-complete/usr/share/X11/locale/locale.alias
- fi
- if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" != "" ];then
- PYTHONDIR=''
- [ -d rootfs-complete/usr/lib${lsuffix}/python2.5 ] && PYTHONDIR='python2.5'
- [ -d rootfs-complete/usr/lib${lsuffix}/python2.6 ] && PYTHONDIR='python2.6'
- [ -d rootfs-complete/usr/lib${lsuffix}/python2.7 ] && PYTHONDIR='python2.7'
- if [ "$PYTHONDIR" ];then
- mkdir -p devx/usr/lib${lsuffix}/${PYTHONDIR}
- cp -a -f --remove-destination rootfs-complete/usr/lib${lsuffix}/${PYTHONDIR}/* devx/usr/lib${lsuffix}/${PYTHONDIR}/
- rm -rf rootfs-complete/usr/lib${lsuffix}/${PYTHONDIR}
- fi
- fi
- find rootfs-complete/usr -type f -name '*.pot' -o -name '*.pupdev' -o -name '*.bac' |
- while read ONEPD
- do
- DESTDIR="`dirname "$ONEPD" | sed -e 's%rootfs\-complete%%'`"
- mkdir -p "devx${DESTDIR}"
- mv -f "$ONEPD" "devx${DESTDIR}/"
- done
- mkdir -p devx/usr/share/doc/nls
- cp -a -f rootfs-complete/usr/share/doc/nls/* devx/usr/share/doc/nls/
- rm -r -f rootfs-complete/usr/share/doc/nls
- if [ -d rootfs-complete/usr/local/apps/ROX-Filer/ROX/MIME ];then
- if [ ! -e rootfs-complete/usr/share/icons/hicolor/48x48/mimetypes ];then
- ln -s ../../../../local/apps/ROX-Filer/ROX/MIME rootfs-complete/usr/share/icons/hicolor/48x48/mimetypes
- fi
- fi
- cp -f ../boot/initrd-tree0/bin/vercmp rootfs-complete/bin/
- busybox chown -h -R spot:spot rootfs-complete/root/spot
- mkdir -p devx/usr/include
- if [ -d ../packages-${DISTRO_FILE_PREFIX}/linux_headers_DEV/usr/include/scsi ];then
- cp -a ../packages-${DISTRO_FILE_PREFIX}/linux_headers_DEV/usr/include/scsi devx/usr/include/scsi-KERNEL
- fi
- if [ -d ../packages-${DISTRO_FILE_PREFIX}/linux-header_DEV/usr/include/scsi ];then
- cp -a ../packages-${DISTRO_FILE_PREFIX}/linux-header_DEV/usr/include/scsi devx/usr/include/scsi-KERNEL
- fi
- if [ -d ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/usr/include/scsi ];then
- cp -a ../packages-${DISTRO_FILE_PREFIX}/glibc_DEV/usr/include/scsi devx/usr/include/scsi-GLIBC
- fi
- cp -a -f ../rootfs-skeleton/root/Choices/MIME-types/* rootfs-complete/root/Choices/MIME-types/
- cp -a -f --remove-destination ../rootfs-skeleton/usr/local/apps/ROX-Filer/ROX/MIME/* rootfs-complete/usr/local/apps/ROX-Filer/ROX/MIME/
- 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`"
- if [ "$YAD" ];then
- ZENITY="`find ./rootfs-complete/bin ./rootfs-complete/sbin ./rootfs-complete/usr/bin ./rootfs-complete/usr/sbin ./rootfs-complete/usr/local/bin -name zenity`"
- if [ ! "$ZENITY" ];then
- YADDIR="`dirname $YAD`"
- ln -s yad ${YADDIR}/zenity
- fi
- fi
- if [ ! -e rootfs-complete/usr/sbin/gtkdialog3 ];then
- if [ ! -e rootfs-complete/usr/bin/gtkdialog3 ];then
- [ -e rootfs-complete/usr/sbin/gtkdialog4 ] && ln -s gtkdialog4 rootfs-complete/usr/sbin/gtkdialog3
- [ -e rootfs-complete/usr/bin/gtkdialog4 ] && ln -s gtkdialog4 rootfs-complete/usr/bin/gtkdialog3
- fi
- fi
- if [ ! -e rootfs-complete/usr/sbin/gtkdialog ];then
- [ -e rootfs-complete/usr/sbin/gtkdialog3 ] && ln -s gtkdialog3 rootfs-complete/usr/sbin/gtkdialog
- [ -e rootfs-complete/usr/sbin/gtkdialog4 ] && ln -snf gtkdialog4 rootfs-complete/usr/sbin/gtkdialog
- fi
- if [ "$DISTRO_FILE_PREFIX" = "slacko" ];then
- if [ -f ../support/slacko/woof_base_hack ];then
- echo "Running Slacko customization script ../support/slacko/woof_base_hack..."
- ../support/slacko/woof_base_hack
- fi
- fi
- [ -f ../WOOFMERGEVARS ] && cp -f ../WOOFMERGEVARS rootfs-complete/etc/rc.d/
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- if [ -d rootfs-complete/usr/share/glib-2.0/schemas ];then
- [ -e rootfs-complete/usr/bin/glib-compile-schemas ] && chroot rootfs-complete /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
- fi
-
- if [ -d rootfs-complete/usr/lib${lsuffix}/gio/modules ];then
- [ -e rootfs-complete/usr/bin/gio-querymodules ] && chroot rootfs-complete /usr/bin/gio-querymodules /usr/lib${lsuffix}/gio/modules
- fi
- fi
- if [ ! -e rootfs-complete/usr/local/bin/gtkmoz ];then
- ln -s defaultbrowser rootfs-complete/usr/local/bin/gtkmoz
- fi
- if [ "$SDFLAG" != "" ];then
-
- echo
- echo "Puppy will normally load a swap partition or swap file if it/they exist,
- however you can choose to ignore them and not load them at bootup."
- echo -n "Press ENTER key to load swap at bootup, any key otherwise: "
- read wantswap
- if [ "$wantswap" != "" ];then
- echo "BOOT_DISABLESWAP='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
- echo "...BOOT_DISABLESWAP='yes' in /etc/rc.d/BOOTCONSTRAINED, read by rc.sysinit."
- fi
-
- echo "BOOT_ATIME='noatime'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
-
- echo 'none /proc proc defaults,noatime 0 0
- none /sys sysfs defaults,noatime 0 0
- none /dev/pts devpts gid=2,mode=620,noatime 0 0
- shmfs /dev/shm tmpfs defaults,noatime 0 0' > rootfs-complete/etc/fstab
- echo "BOOT_DIRTYWRITE='1500'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
- echo "BOOT_SCHEDULER='deadline'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
-
- echo "BOOT_UDEVDCHILDREN='1'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
- echo "BOOT_BOARD='${BOOT_BOARD}'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
- echo "BOOT_DISABLEXORGWIZARD='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
- echo "BOOT_DISABLEALSACONF='yes'" >> rootfs-complete/etc/rc.d/BOOTCONSTRAINED
- fi
- autoflag='no'
- if [ "$BOOT_DISABLEXORGWIZARD" != "yes" ];then
- if [ "$DISTRO_XORG_AUTO" ];then
- autoflag="$DISTRO_XORG_AUTO"
- else
- if vercmp "$XORGVER" ge "1.7.0";then
- echo
- echo "Do you want Xorg to start automatically at first boot (or at 'pfix=ram'"
- echo "kernel boot param) or run Xorg Wizard? The latter has been the case for"
- echo "earlier puppies. Automatic startup of X usually works, though in some"
- echo "cases may choose the wrong monitor resolution or driver -- which can be"
- echo "fixed by running Xorg Wizard afterward."
- echo -n "Press ENTER only for automatic Xorg: "
- read xorgauto
- [ "$xorgauto" = "" ] && autoflag='yes'
- fi
- fi
- fi
- if [ "`grep '^DISTRO_XORG_AUTO' rootfs-complete/etc/DISTRO_SPECS`" = "" ];then
- echo "DISTRO_XORG_AUTO='${autoflag}'" >> rootfs-complete/etc/DISTRO_SPECS
- else
- REGEXauto="s%^DISTRO_XORG_AUTO.*%DISTRO_XORG_AUTO='${autoflag}'%"
- sed -i -e "$REGEXauto" rootfs-complete/etc/DISTRO_SPECS
- fi
- 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
- echo "DISTRO_ARCHDIR='${ARCHDIR}'" >> rootfs-complete/etc/DISTRO_SPECS
- echo "DISTRO_ARCHDIR='${ARCHDIR}'" >> initrd-tree/DISTRO_SPECS
- if [ ! -e rootfs-complete/usr/share/pci.ids ];then
- if [ -e rootfs-complete/usr/share/misc/pci.ids ];then
- ln -s misc/pci.ids rootfs-complete/usr/share/pci.ids
- fi
- fi
- if [ ! -e rootfs-complete/usr/share/usb.ids ];then
- if [ -e rootfs-complete/usr/share/misc/usb.ids ];then
- ln -s misc/usb.ids rootfs-complete/usr/share/usb.ids
- fi
- fi
- if [ -d rootfs-complete/usr/share/hunspell ];then
- for ONEHUN in `find rootfs-complete/usr/share/hunspell -mindepth 1 -maxdepth 1 -type f -name '*.dic' -o -name '*.aff' | tr '\n' ' '`
- do
- HUNBASE="`basename $ONEHUN`"
- DICTDIRS="`find rootfs-complete/usr/lib -mindepth 2 -maxdepth 2 -type d -name dictionaries | tr '\n' ' '`"
- for ONEDICTDIR in $DICTDIRS
- do
- [ ! -e ${ONEDICTDIR}/${HUNBASE} ] && ln -s ../../../share/hunspell/${HUNBASE} ${ONEDICTDIR}/${HUNBASE}
- done
- done
- fi
- if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" = "" ];then
- [ -e rootfs-complete/usr/bin/python2.5 ] && ln -s python2.5 rootfs-complete/usr/bin/python 2>/dev/null
- [ -e rootfs-complete/usr/bin/python2.6 ] && ln -s python2.6 rootfs-complete/usr/bin/python 2>/dev/null
- [ -e rootfs-complete/usr/bin/python2.7 ] && ln -s python2.7 rootfs-complete/usr/bin/python 2>/dev/null
- fi
- if [ ! -e rootfs-complete/usr/lib${lsuffix}/libgtk-x11-2.0.so ];then
- 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)"
- [ "$FNDGTKLIB" ] && ln -s $FNDGTKLIB rootfs-complete/usr/lib${lsuffix}/libgtk-x11-2.0.so
- fi
- if [ ! -e rootfs-complete/usr/lib${lsuffix}/libgdk-x11-2.0.so ];then
- 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)"
- [ "$FNDGTKLIB" ] && ln -s $FNDGTKLIB rootfs-complete/usr/lib${lsuffix}/libgdk-x11-2.0.so
- fi
- [ -f rootfs-complete/puninstall.sh ] && rm -f rootfs-complete/puninstall.sh
- if [ "$DEFAULT_THEME_XORG_TEXT_DPI" != "" ];then
- dpisizeflag="$DEFAULT_THEME_XORG_TEXT_DPI"
- else
- DPILINE="$(grep '^Xft\.dpi:' rootfs-complete/root/.Xresources)"
- DPIVALUE=$(echo -n "$DPILINE" | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' ')
- echo
- echo "rootfs-complete/root/.Xresources has this line:"
- echo "$DPILINE"
- echo "which sets the displayed size of fonts on the screen (but not bitmap fonts)."
- DPINEXT1=`expr $DPIVALUE + 6`
- DPINEXT2=`expr $DPINEXT1 + 6`
- echo "To accept this size, just press ENTER key."
- echo "However, if you would like fonts to display bigger on the screen, type in
- a value now. The value should be in steps of 6, for example ${DPINEXT1} or ${DPINEXT2}.
- The default size is ${DPIVALUE}, you might try the next-up, ${DPINEXT1}."
- echo -n "Press ENTER key for '${DPIVALUE}' dpi, or type a value: "
- read dpisizeflag
- fi
- if [ "$dpisizeflag" ];then
- fsPTN='s%^Xft\.dpi:.*%Xft.dpi: '"${dpisizeflag}%"
- sed -i -e "$fsPTN" rootfs-complete/root/.Xresources
- echo "...ok, dpi now ${dpisizeflag}"
- fi
- if [ ! -e rootfs-complete/usr/bin/X ];then
- if [ -e rootfs-complete/usr/bin/Xorg -o -h rootfs-complete/usr/bin/Xorg ];then
- ln -s Xorg rootfs-complete/usr/bin/X
- fi
- fi
- echo
- echo "Puppy is normally run as the 'administrator' (root) user, though there is
- also 'fido' which is not currently very mature.
- The structure of Puppy is such that we consider root to be safe (with a full
- disclaimer of any responsibility if anything does go wrong), but there is a
- compromise, to run as root but to run Internet apps as user 'spot'."
- if [ -e rootfs-complete/usr/lib${lsuffix}/seamonkey ];then
- echo
- echo "Type any character then ENTER if you want SeaMonkey to run as spot,
- or just ENTER not to. Note, in a running 'Puppy Menu->System->Login & Security
- Manager' can be used to enable or disable running as spot."
- echo
- echo -n "ENTER only to not run SeaMonkey as spot: "
- read SPOTAPPS
- if [ "$SPOTAPPS" ];then
- ../support/setup-spot 'seamonkey=true'
- echo '...ok, SeaMonkey will run as spot.'
- else
- echo 'seamonkey=false' > rootfs-complete/root/.spot-status
- echo '...ok, SeaMonkey will not run as spot.'
- fi
- fi
- if [ -e rootfs-complete/usr/lib${lsuffix}/firefox* ];then
- echo
- echo "Type any character then ENTER if you want firefox to run as spot,
- or just ENTER not to. Note, in a running Puppy 'Menu->System->Login & Security
- Manager' can be used to enable or disable running as spot."
- echo
- echo -n "ENTER only to not run firefox as spot: "
- read SPOTAPPS
- if [ "$SPOTAPPS" ];then
- ../support/setup-spot "firefox=true"
- echo "...ok, firefox will run as spot."
- else
- echo "firefox=false" >> rootfs-complete/root/.spot-status
- echo "...ok, firefox will not run as spot."
- fi
- fi
- for AINTERNETAPP in QtWeb opera
- do
- [ -e rootfs-complete/usr/bin/${AINTERNETAPP} ] || continue
- echo
- echo "Type any character then ENTER if you want ${AINTERNETAPP} to run as spot,
- or just ENTER not to. Note, in a running Puppy 'Menu->System->Login & Security
- Manager' can be used to enable or disable running as spot."
- echo
- echo -n "ENTER only to not run ${AINTERNETAPP} as spot: "
- read SPOTAPPS
- if [ "$SPOTAPPS" ];then
- ../support/setup-spot "${AINTERNETAPP}=true"
- echo "...ok, ${AINTERNETAPP} will run as spot."
- else
- echo "${AINTERNETAPP}=false" >> rootfs-complete/root/.spot-status
- echo "...ok, ${AINTERNETAPP} will not run as spot."
- fi
- done
- cp -f ../support/setup-spot rootfs-complete/usr/sbin/
-
-
- ALTBROWSER=''
- [ "`grep 'QtWeb' rootfs-complete/root/Choices/ROX-Filer/PuppyPin`" != "" ] && ALTBROWSER='QtWeb'
- [ "`grep 'opera' rootfs-complete/root/Choices/ROX-Filer/PuppyPin`" != "" ] && ALTBROWSER='opera'
- if [ "$ALTBROWSER" != "" ];then
- MAINBROWSER="`grep '^exec' rootfs-complete/usr/local/bin/defaultbrowser | tr '\t' ' ' | tr -s ' ' | cut -f 2 -d ' '`"
- if [ "$MAINBROWSER" != "$ALTBROWSER" ];then
- echo '#!/bin/sh' > rootfs-complete/usr/local/bin/defaulthtmlviewer
- echo "exec ${ALTBROWSER} \"\$@\"" >> rootfs-complete/usr/local/bin/defaulthtmlviewer
- chmod 755 rootfs-complete/usr/local/bin/defaulthtmlviewer
- fi
- fi
- rm -rf rootfs-complete/tmp/*
- BUILD_SFS='yes'
- if [ "$SDFLAG" != "" ]; then
- echo
- echo "Since you are building a SD card image, it is not necessary"
- echo "to build the main sfs file. Press ENTER only to skip,"
- echo "any other character then ENTER to build it anyway."
- read buildanyway
- if [ "$buildanyway" = '' ]; then
- BUILD_SFS='no'
- fi
- fi
- if [ "$BUILD_SFS" = 'yes' ]; then
- echo
- echo "Now building the main f.s., ${PUPPYSFS}..."
- sync
- rm -f build/${PUPPYSFS} 2>/dev/null
- ${MKSQUASHFS} rootfs-complete build/${PUPPYSFS} ${COMPCHOICE}
- sync
- echo -n "$IDSTRING" >> build/${PUPPYSFS}
- sync
- fi
- WOOF_OUTPUT="woof-output-${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}"
- [ -d ../$WOOF_OUTPUT ] || mkdir -p ../$WOOF_OUTPUT
- echo "Now building ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso"
- rm -f ../${WOOF_OUTPUT}/${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso 2>/dev/null
- if [ -f rootfs-complete/usr/lib${lsuffix}/syslinux/isolinux.bin ];then
- cp -a rootfs-complete/usr/lib${lsuffix}/syslinux/isolinux.bin build/
- else
- cp -a ../boot/isolinux.bin build/
- fi
- case $DISTRO_FILE_PREFIX in
- wary)
- BOOTLOGO="puppy"
- BOOTLABEL="puppy"
-
- REMOVELINE1=''
- VERPREFIX="wary "
- [ "`echo "$DISTRO_NAME" | grep "Racy"`" != "" ] && VERPREFIX="racy "
- ;;
- racy)
- BOOTLOGO="racy-splash"
- BOOTLABEL="puppy"
- REMOVELINE1=''
- VERPREFIX="racy "
- ;;
- sqzd)
- BOOTLOGO="puppy"
- BOOTLABEL="puppy"
- REMOVELINE1=''
- VERPREFIX="squeezed "
- ;;
- drake|drak)
- BOOTLOGO="puppy"
- BOOTLABEL="puppy"
- REMOVELINE1=''
- VERPREFIX="drake "
- ;;
- q*)
- BOOTLOGO="quirky"
- BOOTLABEL="puppy"
-
- VERPREFIX="puppy "
- [ "$DISTRO_FILE_PREFIX" = "qret" ] && VERPREFIX="retro "
- ;;
- *)
- BOOTLOGO="puppy"
- BOOTLABEL="puppy"
-
- VERPREFIX=""
- ;;
- esac
- [ -f ../boot/boot-dialog/${DISTRO_FILE_PREFIX}-splash.gif ] && BOOTLOGO="${DISTRO_FILE_PREFIX}-splash"
- blPATTERN="s%BOOTLABEL%${BOOTLABEL}%"
- namePATTERN="s/DISTRO_NAME/${DISTRO_NAME}/"
- verPATTERN="s/DISTRO_VERSION/${DISTRO_VERSION}/"
- prefixPATTERN="s/DISTRO_FILE_PREFIX/${DISTRO_FILE_PREFIX}/"
- sed -e "$namePATTERN" -e "$verPATTERN" -e "$prefixPATTERN" -e "$blPATTERN" ../boot/boot-dialog/help.msg > build/help.msg
- if [ "$REMOVELINE1" != "" ];then
- grep -v "$REMOVELINE1" build/help.msg > /tmp/3builddistro-help.msg
- mv -f /tmp/3builddistro-help.msg build/help.msg
- fi
- sed -e "$namePATTERN" -e "$verPATTERN" -e "$prefixPATTERN" -e "$blPATTERN" ../boot/boot-dialog/help2.msg > build/help2.msg
- if [ "$REMOVELINE1" != "" ];then
- grep -v "$REMOVELINE1" build/help2.msg > /tmp/3builddistro-help2.msg
- mv -f /tmp/3builddistro-help2.msg build/help2.msg
- fi
- if [ "$PUPDESKFLG" != "" ];then
- 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
- fi
- cp -f ../boot/boot-dialog/boot.msg build/boot.msg
- cat ../boot/boot-dialog/isolinux.cfg | sed -e "$blPATTERN" > build/isolinux.cfg
- export RGBDEF=/usr/share/X11/rgb.txt
- ../boot/boot-dialog/textongif.sh ../boot/boot-dialog/${BOOTLOGO}.gif "${VERPREFIX}${RIGHTVER}" > logo.gif
- ../boot/boot-dialog/gif2lss logo.gif > build/logo.16
- if [ "$DEFAULTLANG" != "en_US" ];then
- DEFAULTLANG1="${DEFAULTLANG%_*}"
- DEFAULTLANG12="${DEFAULTLANG%.*}"
- SPLASHFILE=""
- [ -f ../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG12} ] && SPLASHFILE="../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG12}"
- [ ! "$SPLASHFILE" ] && [ -f ../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG1} ] && SPLASHFILE="../rootfs-skeleton/usr/share/sss/initrd_strings.${DEFAULTLANG1}"
- if [ "$SPLASHFILE" ];then
-
- sPTN="/^\[boot.msg\]/,/^$/p"
- CODEBLOCK="`sed -n "$sPTN" ${SPLASHFILE} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`"
- if [ "$CODEBLOCK" ];then
- echo "$CODEBLOCK" > /tmp/3builddistro-boot-splash-translation
- sed -i -f /tmp/3builddistro-boot-splash-translation build/boot.msg
- fi
-
- sPTN="/^\[help.msg\]/,/^$/p"
- CODEBLOCK="`sed -n "$sPTN" ${SPLASHFILE} | sed -e '/^#/d' -e '/%%/d' -e '/^$/d' -e '/^\[/d'`"
- if [ "$CODEBLOCK" ];then
- echo "$CODEBLOCK" > /tmp/3builddistro-boot-splash-translation
- sed -i -f /tmp/3builddistro-boot-splash-translation build/help.msg
- fi
- fi
- fi
- CUT2INSERT="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1,2`"
- CUT3INSERT="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1,2,3`"
- cut2PATTERN="s%CUT2INSERT%${CUT2INSERT}%"
- cut3PATTERN="s%CUT3INSERT%${CUT3INSERT}%"
- sed -e "$verPATTERN" -e "$prefixPATTERN" -e "$cut2PATTERN" -e "$cut3PATTERN" ../boot/README.HTM > build/README.HTM
- sync
- if [ "$SDFLAG" = "" ];then
- $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/
- sync
-
- isohybrid="$(which isohybrid)"
- [ -n "$isohybrid" ] && $isohybrid ../${WOOF_OUTPUT}/${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso
- CUR_DIR="$PWD"
- cd ../${WOOF_OUTPUT}
- md5sum ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso > ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso.md5.txt
- cd "$CUR_DIR"
- echo
- echo "Would you like to burn it to a CD? "
- echo -n "ENTER only for yes, or any printable char then ENTER not to: "
- read writeitnow
- if [ "$writeitnow" = "" ];then
- CDR=""
- [ -f /etc/cdburnerdevice ] && CDR="/dev/`cat /etc/cdburnerdevice`"
- [ "$CDR" = "" ] && CDR='/dev/sr0'
- CDDESCR="`probedisk2 | grep '|optical|' | grep "$CDR" | cut -f 3 -d '|'`"
- echo -n 'Type "y" for multisession, else just ENTER: '
- read BURNMULTI
- if [ "$BURNMULTI" = "y" ];then
- BURNMULTI="-multi -tao -pad"
- else
- BURNMULTI="-dao"
- fi
- echo "Please insert blank CD into $CDR
- (which is described as: ${CDDESCR})
- -- also be sure that it is unmounted."
- echo -n "Then hit ENTER key: "
- read yayburn
- $CDRECORD $BURNMULTI -data -eject -v speed=4 padsize=300k dev=$CDR ../${WOOF_OUTPUT}/${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso
- sync
- eject $CDR
- echo "...done"
- fi
- else
-
- echo
- echo "Please choose the SD-card skeleton image file, to suit target board."
- CNT=1
- echo -n "" > /tmp/3builddistro-probeimage
- ls -1 ../sd-skeleton-images | grep 'xz$' | grep "$BOOT_BOARD" |
- while read ONEIMAGE
- do
- echo "${CNT} ${ONEIMAGE}" >> /tmp/3builddistro-probeimage
- CNT=`expr $CNT + 1`
- done
- while [ 1 ];do
- echo
- echo "Type number which is your choice of SD image:"
- cat /tmp/3builddistro-probeimage
- read sdnumber
- SDIMAGE="`cat /tmp/3builddistro-probeimage | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' '`"
- echo -n "You chose '${SDIMAGE}' Press ENTER if correct: "
- read sdcorrect
- [ "$sdcorrect" = "" ] && break
- done
- echo
- echo "Please insert the SD card. Make sure that it is the same size or bigger than
- indicated on the filename of the skeleton image file that you chose."
- echo -n "Press ENTER after it is inserted: "
- read waitinsert
- sleep 2
- while [ 1 ];do
- CNT=1
- echo -n "" > /tmp/3builddistro-probedisk
- probedisk |
- while read ONEPROBE
- do
- echo "${CNT} ${ONEPROBE}" >> /tmp/3builddistro-probedisk
- CNT=`expr $CNT + 1`
- done
- echo
- echo "Type number which is your SD card:"
- cat /tmp/3builddistro-probedisk
- read sdnumber
- SDDEVICE="`cat /tmp/3builddistro-probedisk | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '|'`"
- echo -n "You chose ${SDDEVICE} Press ENTER if correct: "
- read sdcorrect
- [ "$sdcorrect" = "" ] && break
- done
- SDBASE="`basename ../sd-skeleton-images/${SDIMAGE} .xz`"
- echo
- echo "Please type the name that you want to give the SD image file, or press ENTER"
- SDBASEBASE="`basename $SDBASE .img | sed -e 's%-201[0-9]*%-%' -e 's%-skeleton%-%' | cut -f 1,2,3 -d '-'`"
- PUPIMG="${SDBASEBASE}-${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}.img"
- echo -n "only for the default [${PUPIMG}]: "
- read PUPIMG1
- [ "$PUPIMG1" != "" ] && PUPIMG="`basename $PUPIMG1 .img`.img"
- echo "...chosen $PUPIMG"
- echo
-
-
- echo "Uncompressing image, please wait..."
- [ -f ../${WOOF_OUTPUT}/${PUPIMG} ] && rm -f ../${WOOF_OUTPUT}/${PUPIMG}
- unxz --stdout ../sd-skeleton-images/${SDIMAGE} > ../${WOOF_OUTPUT}/${PUPIMG}
- if [ $? -ne 0 ];then
- [ -f ../${WOOF_OUTPUT}/${PUPIMG} ] && rm -f ../${WOOF_OUTPUT}/${PUPIMG}
- echo "Uncompress fail. Aborting."
- exit 1
- fi
- sync
-
- SDIMGINFO="`disktype ../${WOOF_OUTPUT}/${PUPIMG}`"
- SDFS2="`echo "$SDIMGINFO" | grep -o 'Ext[0-9] file system' | cut -f 1 -d ' ' | tr '[A-Z]' '[a-z]'`"
- case $SDFS2 in
- ext2|ext3|ext4) SDFS2="ext4" ;;
- *)
- echo -n "wrong f.s. ${SDFS2} in ${SDIMAGE}, aborting. Press ENTER: "
- read exitme
- exit
- ;;
- esac
-
-
-
- P1BYTES=`echo "$SDIMGINFO" | grep '^Partition 1:' | cut -f 2 -d '(' | cut -f 1 -d ' '`
- P1SECTORS=`echo "$SDIMGINFO" | grep '^Partition 1:' | cut -f 2 -d '(' | cut -f 3 -d ' '`
- P1STARTSECTORS=`echo "$SDIMGINFO" | grep '^Partition 1:' | rev | cut -f 1 -d ' ' | rev | cut -f 1 -d ')'`
- BYTESPERSECTOR=`expr $P1BYTES \/ $P1SECTORS`
- P1STARTBYTES=`expr $P1STARTSECTORS \* $BYTESPERSECTOR`
-
- P2BYTES=`echo "$SDIMGINFO" | grep '^Partition 2:' | cut -f 2 -d '(' | cut -f 1 -d ' '`
- P2SECTORS=`echo "$SDIMGINFO" | grep '^Partition 2:' | cut -f 2 -d '(' | cut -f 3 -d ' '`
- P2STARTSECTORS=`echo "$SDIMGINFO" | grep '^Partition 2:' | rev | cut -f 1 -d ' ' | rev | cut -f 1 -d ')'`
- P2STARTBYTES=`expr $P2STARTSECTORS \* $BYTESPERSECTOR`
-
- echo
- echo "Copying Linux kernel to SD image file..."
- mkdir -p /mnt/sdimagep1
- mkdir -p /mnt/sdimagep2
- mount-FULL -t vfat -o loop,offset=${P1STARTBYTES} ../${WOOF_OUTPUT}/${PUPIMG} /mnt/sdimagep1
- if [ $? -ne 0 ];then
- echo "Sorry, mounting vfat partition 1 (at offset ${P1STARTBYTES}) of ${PUPIMG} failed. Aborting script."
- exit 1
- fi
-
- case $REALKERNAME in
- uImage) cp -f build/vmlinuz /mnt/sdimagep1/uImage ;;
- kernel.img) cp -f build/vmlinuz /mnt/sdimagep1/kernel.img ;;
- *) cp -f build/vmlinuz /mnt/sdimagep1/ ;;
- esac
- echo -n "$REALKERNAME" > /mnt/sdimagep1/REALKERNAME
- sync
- busybox umount /mnt/sdimagep1 2>/dev/null
- echo "...done"
-
- echo
- echo "Copying Puppy filesystem to SD image file, please wait..."
- mount-FULL -t ${SDFS2} -o loop,offset=${P2STARTBYTES} ../${WOOF_OUTPUT}/${PUPIMG} /mnt/sdimagep2
- if [ $? -ne 0 ];then
- echo "Sorry, mounting ${SDFS2} partition 2 (at offset ${P2STARTBYTES}) of ${PUPIMG} failed. Aborting script."
- exit 1
- fi
- cp -a rootfs-complete/* /mnt/sdimagep2/
- sync
-
-
- echo "/dev/mmcblk0p2 / ${SDFS2} defaults,noatime 0 1" >> /mnt/sdimagep2/etc/fstab
- sync
- echo "...done"
- busybox umount /mnt/sdimagep2 2>/dev/null
-
- IMGBYTES=`stat --format=%s ../${WOOF_OUTPUT}/$PUPIMG`
-
- echo
- IMGK=`expr $IMGBYTES \/ 1024`
- echo "The image file is ${IMGK}KB, so needs to be compressed for distribution."
- echo "If you only want to write to SD card choose 'none' which is the fastest."
- echo "You can also compress the image file yourself later."
- echo "Choose compression type:
- 1 xz (smallest, slowest)
- 2 gz (larger, faster)
- 3 none (huge, instant)"
- read compresstype
- case $compresstype in
- 1) COMPRESS='xz' ;;
- 2) COMPRESS='gz' ;;
- *) COMPRESS='none' ;;
- esac
- echo "...you chose $COMPRESS"
- if [ "$COMPRESS" != 'none' ]; then
- echo "Compressing, please wait..."
- [ -f ../${WOOF_OUTPUT}/${PUPIMG}.${COMPRESS} ] && rm -f ../${WOOF_OUTPUT}/${PUPIMG}.${COMPRESS}
- if [ "$COMPRESS" = 'xz' ]; then
- xz --stdout ../${WOOF_OUTPUT}/${PUPIMG} > ../${WOOF_OUTPUT}/${PUPIMG}.xz
- elif [ "$COMPRESS" = 'gz' ]; then
- gzip --stdout ../${WOOF_OUTPUT}/${PUPIMG} > ../${WOOF_OUTPUT}/${PUPIMG}.gz
- fi
- sync
- echo "...${PUPIMG}.${COMPRESS} created."
- COMPRIMGBYTES=`stat --format=%s ../${WOOF_OUTPUT}/${PUPIMG}.${COMPRESS}`
- echo
- echo "The image is now ${PUPIMG}.${COMPRESS} and is ${COMPRIMGBYTES}bytes."
- COMPRIMGK=`expr $COMPRIMGBYTES \/ 1024`
- echo "(${COMPRIMGK}KB)"
- echo "Image file may be distributed to others!"
- echo
- fi
- echo
- echo "Would you like to write it to a SD card? ENTER only for no,"
- echo -n "or any printable char then ENTER to write image to SD card: "
- read writeSD
- if [ "$writeSD" = "" ];then
- WRITE_SD="no"
- else
- WRITE_SD="yes"
- fi
- if [ "$WRITE_SD" = "yes" ];then
- echo
- echo "Please insert the SD card. Make sure that it is the same size or bigger than
- indicated on the filename of the skeleton image file that you chose."
- echo -n "Press ENTER after it is inserted: "
- read waitinsert
- sleep 2
- while [ 1 ];do
- CNT=1
- echo -n "" > /tmp/3builddistro-probedisk
- probedisk |
- while read ONEPROBE
- do
- echo "${CNT} ${ONEPROBE}" >> /tmp/3builddistro-probedisk
- CNT=`expr $CNT + 1`
- done
- echo
- echo "Type number which is your SD card:"
- cat /tmp/3builddistro-probedisk
- read sdnumber
- SDDEVICE="`cat /tmp/3builddistro-probedisk | head -n $sdnumber | tail -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '|'`"
- echo -n "You chose ${SDDEVICE} Press ENTER if correct: "
- read sdcorrect
- [ "$sdcorrect" = "" ] && break
- done
- echo
- echo "Sanity check: ${PUPIMG}
- is to be written to ${SDDEVICE}."
- echo -n "Press ENTER to continue: "
- read yepgo
- SDCARDINFO="`disktype ${SDDEVICE}`"
-
- SDCARDBYTES=`echo "$SDCARDINFO" | grep '^Block device' | cut -f 2 -d '(' | cut -f 1 -d ' '`
- if [ $IMGBYTES -gt $SDCARDBYTES ];then
- echo
- echo "Sorry, the image file is ${IMGBYTES}bytes, however the
- SD card is only ${SDCARDBYTES}bytes. Cannot continue."
- exit 1
- fi
- echo
- echo "Writing image file ${PUPIMG} to SD card ${SDDEVICE}..."
- dd if=../${WOOF_OUTPUT}/${PUPIMG} of=${SDDEVICE} bs=4M
- if [ $? -ne 0 ];then
- echo "Sorry, operation failure. Aborting script."
- exit 1
- fi
- sync
- fi
- if [ "$COMPRESS" != 'none' ]; then
- rm -f ../${WOOF_OUTPUT}/${PUPIMG}
- fi
- if [ "$WRITE_SD" = "yes" ];then
-
-
- THEDRIVE="`echo -n "$SDDEVICE" | cut -f 3 -d '/'`"
- echo "$THEDRIVE" > /tmp/pup_event_frontend_block_request
-
- echo "If the SD card currently plugged in is bigger than the image, for example
- you have a 4GB card and used a 1GB image, optionally now you may increase the
- ${SDFS2} partition to fill the remaining space -- this is for your own use."
- echo -n "ENTER only to decline: "
- read makebig
- if [ "$makebig" != "" ];then
- if [ "`which gparted`" = "" ];then
- echo "ERROR, gparted not installed!!!"
- else
- gparted $SDDEVICE
- sync
- echo
- echo "Checking the ${SDFS2} filesystem..."
- fsck.${SDFS2} -p ${SDDEVICE}2
- sync
- echo "$THEDRIVE" > /tmp/pup_event_frontend_block_request
- fi
- fi
- fi
- fi
- cd $WKGDIR
- echo
- echo -n "Hit ENTER to build the 'devx' SFS file, any other key to exit: "
- read dodevx
- [ "$dodevx" != "" ] && exit
- echo
- echo "Building ${DEVXSFS}..."
- echo " building sandbox3/devx ..."
- rm -f /tmp/3builddistro_removed_alt_dev
- ALLGENNAMESD="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | cut -f 2 -d '|' | sed -e 's%$%_DEV%'`"
- rm -f ./${WOOF_OUTPUT}/${DEVXSFS} 2>/dev/null
- for ONEDEV in `ls -1 packages-${DISTRO_FILE_PREFIX} | grep '_DEV$' | tr '\n' ' '`
- do
-
-
- ONEPKG="`echo -n "$ONEDEV" | sed -e 's%_DEV%%'`"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- devPATTERN='^'"$ONEDEV"
- if [ "`echo "$ALLGENNAMESD" | grep "$devPATTERN"`" != "" ];then
- cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEDEV}/* sandbox3/devx/
- sync
- fi
- done
- sync
- echo " Deleting really invalid symlinks in devx..."
- mkdir layer_top
- mount -t aufs -o udba=reval,diropq=w,dirs=sandbox3/devx=rw:sandbox3/rootfs-complete=ro layerfs layer_top
- for ONESYMLINK in `find layer_top/ -type l`
- do
- [ "`echo -n "$ONESYMLINK" | grep '/dev/'`" != "" ] && continue
- [ "`echo -n "$ONESYMLINK" | grep '/proc/'`" != "" ] && continue
- xONESYMLINK="`echo -n "$ONESYMLINK" | sed -e 's/^layer_top//'`"
-
- if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then
- if [ "`chroot layer_top readlink -e $xONESYMLINK`" = "" ];then
- echo " $ONESYMLINK"
- rm -f $ONESYMLINK
- fi
- else
-
- LINKTO="`readlink layer_top${xONESYMLINK}`"
- [ -e layer_top${LINKTO} ] && continue
- UPONE="`dirname "$xONESYMLINK"`"
- [ -e layer_top${UPONE}/${LINKTO} ] && continue
- echo " $ONESYMLINK"
- rm -f $ONESYMLINK
- fi
- done
- sync
- umount layer_top
- rmdir layer_top
- if [ "$(echo "$PKGS_SPECS_TABLE" | grep '^yes|python|' | grep 'exe>dev')" != "" ];then
- [ -e sandbox3/devx/usr/bin/python2.5 ] && ln -s python2.5 sandbox3/devx/usr/bin/python 2>/dev/null
- [ -e sandbox3/devx/usr/bin/python2.6 ] && ln -s python2.6 sandbox3/devx/usr/bin/python 2>/dev/null
- [ -e sandbox3/devx/usr/bin/python2.7 ] && ln -s python2.7 sandbox3/devx/usr/bin/python 2>/dev/null
- fi
- rm -f sandbox3/devx/usr/lib${lsuffix}/mozilla/plugins/*
- rm -rf packages-${DISTRO_FILE_PREFIX}/devx_DOC 2>/dev/null
- mkdir -p packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share
- mv sandbox3/devx/usr/share/doc-base packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
- mv sandbox3/devx/usr/share/man packages-${DISTRO_FILE_PREFIX}/devx_DOC/usr/share/ 2>/dev/null
- if [ -d sandbox3/devx/usr/X11R7/include/xorg ];then
- [ ! -e sandbox3/devx/usr/include/xorg ] && ln -s ../X11/include/xorg sandbox3/devx/usr/include/xorg
- fi
- mkdir -p sandbox3/devx/etc/profile.d
- rm -f sandbox3/devx/etc/profile.d/pkgconfig* 2>/dev/null
- 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' ':'`"
- echo "export PKG_CONFIG_PATH='${PKG_CONFIG_PATH}'" > sandbox3/devx/etc/profile.d/pkgconfig
- rm -rf sandbox3/devx/install 2>/dev/null
- [ -f sandbox3/devx/pet.specs ] && rm -f sandbox3/devx/pet.specs
- [ -x sandbox3/devx/usr/bin/strings-GNU ] && mv sandbox3/devx/usr/bin/strings-GNU sandbox3/devx/usr/bin/strings
- sync
-
-
-
-
-
- if [ -d sandbox3/devx/usr/include/scsi-GLIBC ];then
-
- cp -a -f sandbox3/devx/usr/include/scsi-GLIBC/* sandbox3/devx/usr/include/scsi/
- fi
- rm -f sandbox3/devx/etc/profile.d/*.csh
- echo "deleting duplicate symlinks"
- find sandbox3/devx -type l |
- while read ONESYMLINK
- do
-
- ESYMLINK=$(echo "$ONESYMLINK" | sed 's%devx%rootfs-complete%')
- [ -h "$ESYMLINK" ] && echo -n "deleted $ONESYMLINK " && rm -f "$ONESYMLINK"
-
- done
- sync
- echo "cleaning out whiteouts"
- find sandbox3/devx -name '.wh*' -delete
- echo "Now creating ${DEVXSFS} ..."
- ${MKSQUASHFS} sandbox3/devx ./${WOOF_OUTPUT}/${DEVXSFS} ${COMPCHOICE}
- sync
- chmod 644 ./${WOOF_OUTPUT}/${DEVXSFS}
- CUR_DIR="$PWD"
- cd ./${WOOF_OUTPUT}
- echo -n "$IDSTRING" >> ${DEVXSFS}
- md5sum ${DEVXSFS} > ${DEVXSFS}.md5.txt
- cd "$CUR_DIR"
- sync
- echo "...done"
- echo
- echo "Script finished."
- echo -n "Press ENTER key to exit: "
- read yeahgetout
|