-
Notifications
You must be signed in to change notification settings - Fork 272
/
3builddistro-Z
executable file
·2306 lines (2093 loc) · 90.9 KB
/
3builddistro-Z
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
# new for fatdog style kernel
export LANG=C #faster.
export BUILDSYS=yes
export MWD=$(pwd)
CDRECORD='cdrecord'
MKISOFS='mkisofs'
if [ "`which xorriso`" != "" ];then # use xorriso if it is installed
CDRECORD='xorrecord'
MKISOFS='xorrisofs'
fi
export CDRECORD MKISOFS
UEFI_ISO=${UFEI_ISO} #UFEI is a typo
. ./_00func
. ./_00build.conf
if [ "$UFEI_ISO" != "yes" -a "$G4DOS_ISO" != "yes" ] ; then
if ! which giftopnm &>/dev/null ; then
# boot/boot-dialog/textongif.sh requires:
# ppmquant, ppmlabel, giftopnm, ppmtogif from netpbm
echo "Warning: ppmtogif is missing ... building a grub4dos iso "
G4DOS_ISO=yes
fi
sleep 1
fi
export PTHEME #build.conf - woof-code/rootfs-packages/ptheme
export XTRA_FLG # build.conf - extra naming for iso
KERNEL_REPO_URL=${KERNEL_REPO_URL:-http://distro.ibiblio.org/puppylinux/huge_kernels} #can change var
. ./DISTRO_SPECS #this has DISTRO_VERSION.
source_compat_repos # ./DISTRO_COMPAT_REPOS-
source_pkgs_specs # ./DISTRO_PKGS_SPECS-
. ./PKGS_MANAGEMENT #101013 want variable PKG_PREFER_OLDER.
. ./DISTRO_PET_REPOS #120506 want variable PACKAGELISTS_PET_ORDER
source_woofmergevars # ./WOOFMERGEVARS
create_local_repos_dirs
set_layer_type # aufs or overlay
set_archdir_var # ex: ARCHDIR=x86_64-linux-gnu
#64 bit
[ "${DISTRO_BINARY_COMPAT}" = 'slackware64' ] && lsuffix=64 || lsuffix= #140121 for 64bit ${lsuffix} #170519 slacko specific
#the files that have compatible-distro pkg docs (these were downloaded by 0setup)...
PKGLISTS_COMPAT="`echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | cut -f 3 -d '|' | tr '\n' ' ' | sed -e 's% $%%'`" #see file DISTRO_PKGS_SPECS-ubuntu
#...format ex: 'Packages-ubuntu-intrepid-main Packages-ubuntu-intrepid-universe'
export WKGDIR="`pwd`"
if [ "$BUILD_ZIP" = "yes" ]; then
SDFLAG="zip"
elif [ "$DISTRO_TARGETARCH" = "arm" ]; then
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
#120714 ask what type of arm board...
if [ "$SDFLAG" != "" ];then
export SDFLAG
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
#override module choices, as kernel is built customized to particular hardware...
echo -n #-------
fi
fi
#w003 remove comments from PKGS_SPECS_TABLE
PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep -v '^#'`"
mkdir -p sandbox3
export DISTRO_NAME
export DISTRO_VERSION
export DISTRO_COMPAT_VERSION
echo
#-- always assume mksquashfs4+ --
export MKSQUASHFS=mksquashfs #use running system's 140619
# new traditional names...
export PUPPYSFS="puppy_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
export ZDRVSFS="zdrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
export FDRVSFS="fdrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
export ADRVSFS="adrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
export YDRVSFS="ydrv_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
export DEVXSFS="devx_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
#now build rootfs-complete, the main filesystem...
echo
echo "Now building sandbox3/rootfs-complete, with the complete filesystem..."
echo '#!/bin/sh' > sandbox3/pinstall.sh
rm -rf sandbox3/rootfs-complete
rm -rf sandbox3/devx
sync
mkdir sandbox3/rootfs-complete
mkdir sandbox3/rootfs-complete/etc
mkdir sandbox3/devx
cp DISTRO_SPECS sandbox3/rootfs-complete/etc/
#copy the skeleton...
cp -a rootfs-skeleton/* sandbox3/rootfs-complete/
cat sandbox3/rootfs-complete/pinstall.sh >> sandbox3/pinstall.sh
# extra packages
CHOICE=/tmp/rootfs_choice$$
if [ ! -f support/rootfs-packages.conf ];then
echo
echo "If you know what packages you want included from rootfs-packages
you can bypass the checkbox GUI by renaming
'support/rootfs-packages.conf-backup'
to
'support/rootfs-packages.conf'
and edit it to include your customised package list.
You can CTRL-C out of this script and try it right now if you wish
or hit Enter/Return to continue."
read carry_on
for d in $(ls rootfs-packages)
do
state=true
def=false
case "$d" in
jwm_config|ptheme|pt_buntoo|pt_faux_xfwm)
if grep 'yes|jwmconfig' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ;then
state=false #cant choose them if jwmconfig is in specs.
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
fi # depends ffmpeg
;;
cups_backend) # contains the backends smbw and pdf-writer
if grep -q 'yes|cups|' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
if [ "${DISTRO_BINARY_COMPAT}" = 'slackware64' ];then
state=false
else
def=true
fi
else
state=false
fi # depends cups and anything BUT slackware64 binary compat
;;
cups_backend64) # contains the backends smbw and pdf-writer
if grep -q 'yes|cups|' DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION};then
if [ "${DISTRO_BINARY_COMPAT}" = 'slackware64' ];then
def=true
else
state=false
fi
else
state=false
fi # depends cups AND slackware64 binary compat
;;
grub2_efi64)
[ "$UFEI_ISO" = "yes" ] && def=true
;;
*)
if grep "yes|${d}" DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} ;then
state=false # don't overwrite user chosen specs
else
def=true
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
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
else
cp -a support/rootfs-packages.conf $CHOICE
EXIT=OK
fi
. $CHOICE
[ -f /tmp/rootfs-packages.specs ] && rm /tmp/rootfs-packages.specs # in case we baled out on last build
[ -f /tmp/rootfs_pkgs_pinstall.sh ] && rm /tmp/rootfs_pkgs_pinstall.sh # this needs doing anyway
if [ "$EXIT" = "OK" ];then
while read line
do
if echo $line|grep -q "true" ;then
if echo "${line%%=*}" | grep -v 'grub' | grep -q '64$' ;then # failsafe for debian based 64 versions and auto config generated from merge2out
if [ "${DISTRO_BINARY_COMPAT}" != 'slackware64' ];then
echo "NOT copying ${line%%=*} - incompatible"
continue
fi
fi
echo "copying ${line%%=*}"
cp -a rootfs-packages/${line%%=*}/* sandbox3/rootfs-complete/
if [ -f rootfs-packages/${line%%=*}/pinstall.sh ];then
if grep -qw 'exit' rootfs-packages/${line%%=*}/pinstall.sh;then continue
else
if grep -q 'poor man' rootfs-packages/${line%%=*}/pinstall.sh;then # ptheme must go last
cat rootfs-packages/${line%%=*}/pinstall.sh > /tmp/rootfs_pkgs_pinstall_ptheme.sh
else
cat rootfs-packages/${line%%=*}/pinstall.sh >> /tmp/rootfs_pkgs_pinstall.sh
fi
fi
fi
cat sandbox3/rootfs-complete/pet.specs >> /tmp/rootfs-packages.specs
else
continue
fi
done < $CHOICE
cat /tmp/rootfs_pkgs_pinstall_ptheme.sh >> /tmp/rootfs_pkgs_pinstall.sh
fi
rm $CHOICE
#creates devx-only-installed-packages.
./support/findwoofinstalledpkgs # moved to here so we can add /tmp/rootfs-packages.specs
### new {a,f,y}drv stuff - this creates a full 'woof-installed-packages' in {a,y}drv and subtracts the
# {a,y}drv installed packages from the the full 'woof-installed-packages' that goes to the main sfs.
if [ "$(echo $ADRV_INC)" != "" -o "$(echo $FDRV_INC)" != "" -o "$(echo $YDRV_INC)" != "" ];then
sync
fields="${ADRV_INC}:${FDRV_INC}:${YDRV_INC}:)"
IFS=':' read -a field <<< $fields
fcnt=0
for dtype in a f y; do
[ -d sandbox3/${dtype}drv ] && rm -rf sandbox3/${dtype}drv
[ "$dtype" = 'a' -a -z "$ADRV_INC" ] && continue
[ "$dtype" = 'f' ] && continue #don't bother with fdrv
[ "$dtype" = 'y' -a -z "$YDRV_INC" ] && break
mkdir -p sandbox3/${dtype}drv/root/.packages/
[ -f /tmp/${dtype}-woof-packages ] && rm /tmp/${dtype}-woof-packages
while read -r line
do
IFS='|' read -r a b c <<<$line
if echo "${fields[${fcnt}]}" | grep -q "$b" ;then
continue
else
echo "$line" >> /tmp/${dtype}-woof-packages
fi
done < woof-installed-packages
cat woof-installed-packages > sandbox3/${dtype}drv/root/.packages/woof-installed-packages
cat /tmp/${dtype}-woof-packages > woof-installed-packages
fcnt=$(($fcnt + 1))
done
fi
###
rm -f sandbox3/rootfs-complete/pinstall.sh
if [ "$ARCHDIR" ];then #ex: i386-linux-gnu
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} #120909
fi
ZHACKSDIR=z_${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION}_${DISTRO_TARGETARCH}
if [ -d packages-templates/${ZHACKSDIR} ] ; then
cp -a --remove-destination packages-templates/${ZHACKSDIR} packages-${DISTRO_FILE_PREFIX}/
ZHACKS=${ZHACKSDIR}
fi
#=====================================================================
function files2delete() {
[ -d "$1" ] || return
(
cd "$1"
echo
echo "Parsing support/files2delete"
while read i ; do
for file in $(echo ./$i) #might cointain wildcards
do
[ -f ${file} ] && rm -fv ${file}
done
done < ${MWD}/support/files2delete
#--
if [ "${DISTRO_BINARY_COMPAT}" = 'slackware64' ] ; then
sed 's%/lib/%/lib64/%' ${MWD}/support/files2delete > ${MWD}/support/files2delete64
while read i ; do
for file in $(echo ./$i) #might cointain wildcards
do
[ -f ${file} ] && rm -fv ${file}
done
done < ${MWD}/support/files2delete64
fi
# -- after the symlink is deleted...
#if [ "$ARCHDIR" ] ; then
# sed "s%/lib/%/lib/${ARCHDIR}/%" ${MWD}/support/files2delete > ${MWD}/support/files2delete${ARCHDIR}
# while read i ; do
# for file in $(echo ./$i) #might cointain wildcards
# do
# [ -f ${file} ] && rm -fv ${file}
# done
# done < ${MWD}/support/files2delete${ARCHDIR}
#fi
echo
)
}
function copy_pkgs_to_build() {
. ./DISTRO_SPECS
SFS_DIR=$2
case $SFS_DIR in
*drv)xPRE=${SFS_DIR:0:1};; #extract first char: a, y, z, f ...
*)xPRE='';;
esac
while read ONEPKG
do
case $SFS_DIR in
adrv|ydrv)
if ls rootfs-packages | grep -q "${ONEPKG}" ;then
case "${ONEPKG}" in
jwm*|ptheme|pfilesearch|pfind|wallpaper)
echo "$ADRV_INC YDRV_INC FDRV_INC" | grep -q "${ONEPKG}" && continue;; #don't copy these in {a,y,f}drv
esac
echo -n " ${ONEPKG}"
cp -a --remove-destination rootfs-packages/${ONEPKG}/* sandbox3/${SFS_DIR}/ 2> /tmp/3builddistro-cp-errlog
continue
fi
;;
esac
if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG} ];then
if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DEV ];then #pkg may go entirely into devx.
if [ ! -d packages-${DISTRO_FILE_PREFIX}/${ONEPKG}_DOC ];then #pkg may go entirely into docs.
echo "WARNING, PKG DOES NOT EXIST: packages-${DISTRO_FILE_PREFIX}/${ONEPKG}"
continue
fi
fi
fi
case "$ONEPKG" in
busybox|busybox_static|busybox-static) continue ;; #busy box may conflict with core apps
sfs_load|xkbconfigmanager) continue;; #force woofce apps
esac
echo -n " ${ONEPKG}"
cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}/* sandbox3/${SFS_DIR}/ 2> /tmp/3builddistro-cp-errlog
sync
if [ -s /tmp/3builddistro-cp-errlog ];then #130430 next line fixes those quote chars...
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/${SFS_DIR}%%"`"
cp -a --remove-destination packages-${DISTRO_FILE_PREFIX}/${ONEPKG}${xONEDIRSYMLINK}/* sandbox3/${SFS_DIR}${xONEDIRSYMLINK}/
done
fi
if [ -f sandbox3/${SFS_DIR}/pinstall.sh ];then
#note, do not filter #! /bin/sh (with a space)...
grep -E -v '^\#\!\/bin\/sh' sandbox3/${SFS_DIR}/pinstall.sh >> sandbox3/${xPRE}pinstall.sh
rm -f sandbox3/${SFS_DIR}/pinstall.sh
fi
#get rid of .specs file...
rm -f sandbox3/${SFS_DIR}/*.specs
done <<< "$(echo "$1" | tr ' ' '\n')"
}
#=====================================================================
echo "Copying to sandbox3/rootfs-complete..."
EXTRAS_LIST="${ADRV_INC// /|} ${YDRV_INC// /|} ${AFDRV_INC// /|}"
if echo "$EXTRAS_LIST" | grep -qvE "[a-z]";then
DUMMY=""
else
DUMMY=XXXX #unless they make a Qld beer proggy 'XXXX' will never match; besides need a trailing field
EXTRAS_LIST="${EXTRAS_LIST// /|}${DUMMY}"
EXTRAS_LIST="${EXTRAS_LIST//^|}" #strip leading "|"
EXTRAS_LIST="${EXTRAS_LIST//||/|}" #replace double "||" with "|"
fi
if [ -n "${DUMMY}" ];then
PKGLIST="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | grep -vE "${EXTRAS_LIST}" | cut -f 2 -d '|' | tr '\n' ' '`"
else
PKGLIST="`echo "$PKGS_SPECS_TABLE" | grep '^yes' | cut -f 2 -d '|' | tr '\n' ' '`"
fi
PKGLIST="${PKGLIST}${ZHACKS}"
copy_pkgs_to_build "${PKGLIST}" rootfs-complete
echo
### new {a,f,y}drv build - this sorts the packages and builds the {a,f,y}drv filesystem
ADRV_INCLUDE='';FDRV_INCLUDE_='';YDRV_INCLUDE=''
[ "$(echo $ADRV_INC)" != "" ] && ADRV_INCLUDE=adrv
[ "$(echo $FDRV_INC)" != "" ] && FDRV_INCLUDE=fdrv
[ "$(echo $YDRV_INC)" != "" ] && YDRV_INCLUDE=ydrv
if [ -n "$ADRV_INCLUDE" -o -n "$FDRV_INCLUDE" -o -n "$YDRV_INCLUDE" ];then
rm -f sandbox3/?pinstall.sh
for _DRV in $ADRV_INCLUDE $FDRV_INCLUDE $YDRV_INCLUDE;do
echo
echo "Now building sandbox3/${_DRV} with apps redirected to ${_DRV}_${DISTRO_FILE_PREFIX}_${DISTRO_VERSION}.sfs"
case ${_DRV} in
adrv)echo '#!/bin/sh' > sandbox3/apinstall.sh
mkdir -p sandbox3/adrv/usr/local/bin
copy_pkgs_to_build "${ADRV_INC}" adrv
chmod 755 sandbox3/apinstall.sh
echo;;
fdrv)echo '#!/bin/sh' > sandbox3/fpinstall.sh
mkdir -p sandbox3/fdrv/
copy_pkgs_to_build "${FDRV_INC}" fdrv
chmod 755 sandbox3/fpinstall.sh
echo
CONF_DIR=no;;
ydrv)echo '#!/bin/sh' > sandbox3/ypinstall.sh
mkdir -p sandbox3/ydrv/usr/local/bin
copy_pkgs_to_build "${YDRV_INC}" ydrv
chmod 755 sandbox3/ypinstall.sh
echo;;
esac
# if exists in {a,y}drv a .desktop file we symlink it to root/.config/rox.sourceforge.net/OpenWith/
if [ ! "$CONF_DIR" = 'no' ];then
mkdir -p sandbox3/${_DRV}/root/.config/rox.sourceforge.net/OpenWith/
(
cd sandbox3/${_DRV}/root/.config/rox.sourceforge.net/OpenWith/
for d in ../../../../usr/share/applications/*.desktop;do
app=${d##*/}
lo=$app # weird bug with libreoffice*.desktop 'permission denied'
app=${app%\.*}
if echo $app | grep -q 'libreoffice';then
echo $app | grep -qE "qstart|startcenter|xsltfilter" && continue
ln -sf $d $lo # maintains '.desktop' extension
else
ln -sf $d $app
fi
done
)
fi
done
else
rm -rf sandbox3/?drv #precaution
fi
### end {a,f,y}drv
#some old packages have xpm and png images in /
mv -f sandbox3/rootfs-complete/{*.xpm,*.png} sandbox3/rootfs-complete/usr/share/pixmaps 2>/dev/null
for i in busybox busybox_static busybox-static
do
[ -f packages-${DISTRO_FILE_PREFIX}/${i}/bin/busybox ] && busybox=$i && break
done
if [ ! -f packages-${DISTRO_FILE_PREFIX}/${busybox}/bin/busybox ] ; then
echo "packages-${DISTRO_FILE_PREFIX}/${busybox}/bin/busybox is missing"
echo "fatal error.."
fi
#110923 fix busybox applets...
DEVXUTILS=' config ar ar86 as as86 audiofile-config autoconf autoheader autom4te automake autopoint autoreconf autoscan autoupdate bacon bacongui bcc bison c2ph catchsegv cc ccmake chem cmake combinediff config_data corelist cpack cpan cpan2dist cpanp cpanp-run-perl cpp ctest cups-config curl-config cvs cvsbug db_archive db_checkpoint db_deadlock db_dump db_hotbackup db_load db_printlog db_recover db_stat db_upgrade db_verify dehtmldiff diet dnsd dprofpp dvdnav-config dvdread-config editdiff elftrunc enc2xs envsubst eqn eqn2graph espdiff filterdiff find2perl fixcvsdiff flex flipdiff freetype-config gccbug gcov gdb gdbserver gdbtui gdiffmk gencat getconf getent gettext gettext.sh gettextize gfortran git git-cvsserver git-receive-pack git-shell git-upload-archive git-upload-pack gitk glade-3 gmake gnome-menu-spec-test gperf gphoto2-config gphoto2-port-config gprof grap2graph grepdiff grn grodvi groff groffer grog grolbp grolj4 grops grotty h2ph h2xs hpftodit iconv idle ifnames indxbib info infokey install-info instmodsh interdiff intltool-extract intltool-merge intltool-prepare intltool-update intltoolize ld ld86 ldd lddlibc4 lex lib-i386 libart2-config libnetcfg libpng-config libpng12-config libtool libtoolize libusb-config lkbib locale localedef lookbib lsdiff m4 make makeinfo man man1 man2dvi man2html mmroff msgattrib msgcat msgcmp msgcomm msgconv msgen msgexec msgfilter msgfmt msggrep msginit msgmerge msgunfmt msguniq mtrace nasm ndisasm neon-config neqn netpbm-config ngettext nm nm86 nroff objcopy objdump objdump86 onsgmls osgmlnorm ospam ospcat ospent osx patch pcap-config pcprofiledump pcre-config pdfroff pdftexi2dvi perl perlbug perldoc perlivp perlthanks pfbtops pic pic2graph piconv pkg-config pl2pm pod2html pod2latex pod2man pod2text pod2usage podchecker podselect post-grohtml pre-grohtml preconv prove psed pstruct ptar ptardiff pydoc ranlib rcs2log readelf recode-sr-latin recountdiff rediff refer rman roff2dvi roff2html roff2pdf roff2ps roff2text roff2x rpcgen s2p sane-config scrollkeeper-config scrollkeeper-extract scrollkeeper-gen-seriesid scrollkeeper-get-cl scrollkeeper-get-content-list scrollkeeper-get-extended-content-list scrollkeeper-get-index-from-docpath scrollkeeper-get-toc-from-docpath scrollkeeper-get-toc-from-id scrollkeeper-install scrollkeeper-preinstall scrollkeeper-rebuilddb scrollkeeper-uninstall scrollkeeper-update shasum size size86 soelim splain splitdiff sprof strace strace-graph strings strip svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion sysprof sysprof-cli tbl texi2dvi texi2pdf texindex tfmtodit troff tzselect unwrapdiff update-mime-database vsyasm whatis xgettext xml2-config xslt-config xsubpp xtrace yacc yasm ytasm zsoelim iconvconfig makewhatis nscd rpcinfo visudo zic ' #11104 111204 remove zdump.
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="${ONESPEC##*/}" #basename $ONESPEC
FNDFULL="`find ./sandbox3/rootfs-complete/bin ./sandbox3/rootfs-complete/sbin ./sandbox3/rootfs-complete/usr/bin ./sandbox3/rootfs-complete/usr/sbin -name ${ONENAME}`"
#130129 deb 'bsdmainutils' has broken 'cal' and 'hd' symlinks... 130204 01micko: fix for spaces in names...
if [ "$FNDFULL" ];then
if [ -h "$FNDFULL" ];then
FULLPATH="$(dirname "$FNDFULL")"
FULLLINK="$(readlink "$FNDFULL")"
xFULLLINK="${FULLPATH}/${FULLLINK}"
if [ "`echo -n "$FULLLINK" | cut -c 1`" = "/" ] ; then
xFULLLINK="sandbox3/rootfs-complete${FULLLINK}"
fi
if [ ! -e "${xFULLLINK}" ];then
rm -f "$FNDFULL" #130130
FNDFULL=""
fi
fi
fi
#111004 need to check in devx also...
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
rm -f /tmp/3builddistro_end_of_pinstall
echo 'touch /tmp/3builddistro_end_of_pinstall' >> sandbox3/pinstall.sh
chmod 755 sandbox3/pinstall.sh
#pemasu start 131207
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 xarchive; do #140128 added back legal, 01micko
case `basename $i` in $j) keep=1 ; break 1 ;; esac
done
[ $keep -eq 0 ] && rm -rf $i
fi
done
for i in share/doc share/info share/man usr/share/info usr/share/man \
usr/share/gtk-doc usr/share/gnome/help usr/info usr/man usr/share/cups/doc-root/help
do
if [ -d sandbox3/rootfs-complete/${i} ] ; then
rm -rf sandbox3/rootfs-complete/${i}
mkdir -p sandbox3/rootfs-complete/${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; do
case `basename $i` in $j) keep=1 ; break 1 ;; esac
done
[ $keep -eq 0 ] && rm -rf $i
fi
done
#pemasu end
# new wallpaper maker - test if exec exists
if which mkwallpaper &>/dev/null ; then # must be on the system
support/mk_walls.sh
fi
echo
#run post-install script...
echo
echo "Executing sandbox3/pinstall.sh post-install script..."
cd $WKGDIR/sandbox3/rootfs-complete
SAVEWKGDIR="$WKGDIR"
$WKGDIR/sandbox3/pinstall.sh
### new {a,f,y}drv stuff - execute the '{a,f,y}pinstall.sh'
(
cd $WKGDIR/sandbox3/
for post_inst in adrv fdrv ydrv;do
prefix=${post_inst:0:1}
[ -f ${prefix}pinstall.sh ] && {(cd ${post_inst};$WKGDIR/sandbox3/${prefix}pinstall.sh)}
done
)
###
echo "Now setting /etc/os-release file"
mk_os_release() {
dir=/etc
[ "$1" ] && dir=etc
. $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
if [ -f /tmp/3builddistro_end_of_pinstall ] ; then
echo "pinstall.sh finished OK"
sleep 2
else
echo -n "pinstall.sh aborted before completion. Press ENTER or CTRL-C: "
read isitbad
fi
WKGDIR="$SAVEWKGDIR"
cd $WKGDIR
#100316 script to handle improper shutdown, full hd install...
if [ -f sandbox3/rootfs-complete/sbin/initNEW ];then
rm -f sandbox3/rootfs-complete/sbin/init #a busybox link.
mv -f sandbox3/rootfs-complete/sbin/initNEW sandbox3/rootfs-complete/sbin/init
fi
#now do dependency check...
dependcheck() {
echo -n "" > /tmp/missinglibs.txt
echo -n "" > /tmp/notmissinglibs0.txt
echo -n "" > /tmp/notusedlibs.txt
find $WKGDIR/sandbox3/rootfs-complete -type f | #110516
while read ONEFILE #110516
do
echo -n '.'
ISANEXEC="`file --brief $ONEFILE | grep -E "LSB executable|shared object"`"
if [ ! "$ISANEXEC" = "" ];then
#need to chroot into rootfs-complete...
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
#find all libs not missing...
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
#now go thru rootfs-complete and see if any unused libs...
find $WKGDIR/sandbox3/rootfs-complete -type f | #110516
while read ONEFILE #110516
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
#build.conf
if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" -a "$CHECK_BINARY_DEPS" = "yes" ];then
echo "Wait awhile..."
dependcheck
if [ -s /tmp/missinglibs.txt ];then #true if file not zero size.
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."
# new profile script fixup
support/mk_profile
cd sandbox3
#150624 put this back
#100603 i'm now putting common kernel files in here...
cp -a -f ../kernel-skeleton/* rootfs-complete/
#110918 kernel-skeleton now has a pinstall.sh script... 131207 revert ..131212 revert, revert!
cd rootfs-complete
./pinstall.sh
sync
rm -f ./pinstall.sh
cd ..
sync
#now do the kernel...
echo
rm -rf build 2>/dev/null
mkdir build
case "$KERNEL_TARBALL_URL" in *.pet|*.deb|*.tgz|*.txz) KPKG=yes ;; esac
if [ "$KPKG" = "yes" ] ; then
# kernel pet/deb/txz/tgz
. ../support/kernel_pkg.sh
elif [ "$DISTRO_KERNEL_PET" = 'Raspbian_Kernel' ];then
# do nothing.
echo -n #-------
elif [ "$DISTRO_KERNEL_PET" = 'Kit_Kernel' ];then
../support/kit_kernel.sh || exit 1
else
# Huge_Kernel
../support/huge_kernel.sh || exit 1
fi
#========================
if [ "$KPKG" = "yes" ] ; then
rootfs=zdrv #produced by support/kernel_pet.sh
else
rootfs=rootfs-complete
fi
REALKERNAME='vmlinuz'
[ -f ${rootfs}/boot/vmlinuz* ] && mv ${rootfs}/boot/vmlinuz* build/vmlinuz
if [ -f ${rootfs}/boot/uImage ];then #mele a1000
cp ${rootfs}/boot/uImage build/vmlinuz #120506 arm builds, using different name for kernel.
REALKERNAME='uImage'
fi
if [ -f ${rootfs}/boot/kernel.img ];then #raspberry pi
cp ${rootfs}/boot/kernel.img build/vmlinuz
REALKERNAME='kernel.img'
fi
if [ -f ${rootfs}/boot/kernel7.img ];then #raspberry pi2
cp ${rootfs}/boot/kernel7.img build/vmlinuz7
REALKERNAME='kernel.img'
fi
if [ -f ${rootfs}/boot/vmlinuz-*-rpi ];then #raspberry pi, Raspbian kernel
mv ${rootfs}/boot/vmlinuz-*-rpi build/vmlinuz
REALKERNAME='kernel.img'
fi
if [ -f ${rootfs}/boot/vmlinuz-*-rpi2 ];then #raspberry pi2, Raspbian kernel
mv ${rootfs}/boot/vmlinuz-*-rpi2 build/vmlinuz7
REALKERNAME='kernel.img'
fi
[ -f ${rootfs}/boot/System.map ] && cp ${rootfs}/boot/System.map ./
sync
#download/verify static initrd-progs
(
cd ../initrd-progs
./build.sh -prebuilt -download -arch ${WOOF_TARGETARCH} 1>/dev/null
)
#build the initrd-tree...
echo
echo "Now building initial ramdisk in initrd-tree/..."
rm -rf initrd-progs initrd-tree
cp -a ../initrd-progs ./initrd-progs
ln -s ./initrd-progs/0initrd initrd-tree
ln -sf ../../initrd-progs/0sources ./initrd-progs/0sources
cp ../DISTRO_SPECS ./initrd-tree/
#101027 Iguleder reported DISTRO_SPECS did not have a carriage-return on last line...
xDISTROSPECS="`cat initrd-tree/DISTRO_SPECS`"
echo "$xDISTROSPECS" > initrd-tree/DISTRO_SPECS
echo "$xDISTROSPECS" > rootfs-complete/etc/DISTRO_SPECS
if [ "$DISTRO_KERNEL_PET" = 'Kit_Kernel' ];then
NEWVARIABLES="DISTRO_ZDRVSFS=\"kernel-modules-\$(uname -r)-${DISTRO_FILE_PREFIX}.sfs\""
else
#100911
NEWVARIABLES="#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_FDRVSFS='${FDRVSFS}'
DISTRO_ADRVSFS='${ADRVSFS}'
DISTRO_YDRVSFS='${YDRVSFS}'"
#DISTRO_DEVXSFS='${DEVXSFS}'"
fi
echo "$NEWVARIABLES" >> initrd-tree/DISTRO_SPECS
echo "$NEWVARIABLES" >> rootfs-complete/etc/DISTRO_SPECS
sync
#120225 this is read by /usr/share/doc/convert-raw-docs...
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
# /lib/keymaps and /lib/consolefonts are in bothr rootfs and initd
if [ "$DEFAULTLANG" ] ; then #build.conf
echo "...ok, set to ${DEFAULTLANG}"
INITRD_LANG="-lang ${DEFAULTLANG}"
else
DEFAULTLANG="en_US.UTF-8" #121123
fi
echo "LANG: ${DEFAULTLANG}"
[ "$KEYMAP" ] && INITRD_KM="-keymap $KEYMAP" #initrd-progs
#i think also, set LANG in /etc/profile...
sed -i -e "s%^LANG=.*%LANG=${DEFAULTLANG}%" rootfs-complete/etc/profile
echo
if [ "$KPKG" = "yes" ] ; then
../support/kernel_pkg_zdrv2initrd.sh
fi
#### initrd-progs #### build/initrd.gz...
rm -f build/initrd.[gx]z
(
cd initrd-progs
rm -f initrd.[gx]z
./build.sh -prebuilt -auto -arch ${WOOF_TARGETARCH:-default} ${INITRD_LANG} ${INITRD_KM}
mv -f initrd.[gx]z ../build/
)
if [ ! -f build/initrd.gz -a ! -f build/initrd.xz ] ; then
echo "No initrd... exiting"
exit 1
fi
if [ "$SDFLAG" ] ; then
cp -fv initrd-progs/ZZ_initrd-expanded/bin/busybox rootfs-complete/bin/busybox_static
cp -fv initrd-progs/ZZ_initrd-expanded/bin/e2fsck rootfs-complete/sbin/e2fsck_static
fi
# Include LICK installer
if [ "$LICK_IN_ISO" = "yes" ]; then
../support/lick_in_iso.sh
fi
#offer to cutdown the modules, to build a smaller live-cd...
rm -rf zdrv 2>/dev/null #note, current dir is in sandbox3.
rm -f ${ZDRVSFS} #100911 zdrv.sfs
#100622 slackware 13.1: just in case any got through, remove c-shell scripts...
rm -f rootfs-complete/etc/profile.d/*.csh* 2>/dev/null
#sanity check...
echo
if [ "$WOOF_HOSTARCH" = "$WOOF_TARGETARCH" ];then #111123
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 "*** Doing a cross-build. Not chrooting to do a sanity-test ***"
fi
#get info about the ubuntu pkgs...
echo "Updating pkg data in rootfs-complete/root/.packages ..."
#copy them into the live-cd also...
for ONELIST in $PKGLISTS_COMPAT $PACKAGELISTS_PET_ORDER
do
cp -f ../$ONELIST ./
cp -fv ../$ONELIST rootfs-complete/root/.packages/
done
#also copy the pet package databases...
cp -f ../Packages-puppy-noarch-official rootfs-complete/root/.packages/ #120305
if [ -f ../Packages-puppy-${DISTRO_DB_SUBNAME}-official ];then #110723 ex: Packages-puppy-drake-official
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
#also copy this...
cp -f ../PKGS_MANAGEMENT rootfs-complete/root/.packages/
#477 a puppy-puppy build will not have any compat-distro databases...
petcntlimit=3
COMPATDISTRO_DB_FILES="`ls -1 rootfs-complete/root/.packages/Packages-[^p]* 2>/dev/null`"
[ "$COMPATDISTRO_DB_FILES" = "" ] && petcntlimit=5
#w476 swap to make sure 3 pet repos get chosen...
enabledrepos=" "
#100730 DISTRO_COMPAT_VERSION for puppy builds no longer limited to a number 1-5 (ex: wary5)
fNUM1=`echo -n "$DISTRO_COMPAT_VERSION" | wc -c`
repocnt=1
case $DISTRO_FILE_PREFIX in #110906 fix. $DISTRO_COMPAT_VERSION in #100911
slacko*) enabledrepos="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official " ;;
*)
#add the puppy repos... (i want 5, 4, 3)...
for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-puppy* | sort -r`
do
[ $repocnt -gt $petcntlimit ] && break #limit of 3 puppy repos.
BASEREPO=${ONEREPO##*/} #basename $ONEREPO
case $BASEREPO in Packages-puppy-common*) continue ;; esac
enabledrepos="${enabledrepos}${BASEREPO} "
repocnt=`expr $repocnt + 1`
done
;;
esac
#add compat-distro repos...
if [ "$COMPATDISTRO_DB_FILES" != "" ];then
for ONEREPO in `ls -1 rootfs-complete/root/.packages/Packages-[^p]*`
do
[ $repocnt -gt 5 ] && break #only allow 5 active repos in PPM.
BASEREPO="`basename $ONEREPO`"
enabledrepos="${enabledrepos}${BASEREPO} "
repocnt=`expr $repocnt + 1`
done
fi
#120831 above code ok, but really just want these...
case $DISTRO_BINARY_COMPAT in
ubuntu|trisquel)
xPUPPYREPOS="Packages-puppy-${DISTRO_DB_SUBNAME}-official Packages-puppy-noarch-official" #Packages-puppy-common-official
xCOMPATREPOS="$(ls -1 rootfs-complete/root/.packages/Packages-[^p]* | grep -E '\-main$|\-universe$|\-multiverse$' | rev | cut -f 1 -d '/' | rev | tr '\n' ' ')"
#130330 would like universe first...
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
cp -f ../${DPSFILE} rootfs-complete/root/.packages/DISTRO_PKGS_SPECS # _00func
cp -f ../${DCRFILE} rootfs-complete/root/.packages/DISTRO_COMPAT_REPOS # _00func
#=
cp -f ../DISTRO_PET_REPOS rootfs-complete/root/.packages/DISTRO_PET_REPOS-orig
# make common* pet repos insivible to the PPM..
sed '/Packages-puppy-common/d' rootfs-complete/root/.packages/DISTRO_PET_REPOS-orig \
> rootfs-complete/root/.packages/DISTRO_PET_REPOS
#=
cp -f ../PKGS_HOMEPAGES rootfs-complete/root/.packages/
cat <<EOF>/tmp/conf_spacer
# >>>> rootfs-packages.conf >>>>
EOF
cat ../_00build.conf /tmp/conf_spacer ../rootfs-packages.conf > rootfs-complete/root/.packages/woof-build.conf
rm -f /tmp/conf_spacer
#this needed to update pkg db's in a running puppy...
cp -f ../0setup rootfs-complete/usr/local/petget/
#130316 see 0setup and debdb2pupdb...
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/
#findwoofinstalledpkgs creates 'woof-installed-packages'
cp ../woof-installed-packages rootfs-complete/root/.packages/ #already created earlier
touch ../devx-only-installed-packages #121028
cp ../devx-only-installed-packages rootfs-complete/root/.packages/ #121028