Check-in [9f7c222f6e]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:9f7c222f6eef1700ecb02fc94ad1903a15c04663
Date: 2012-05-06 10:11:04
User: BarryK
Comment:Slight mods to 3builddistro, arm build

Tags And Properties
Changes

Changes to woof-code/3builddistro

@@ -133,10 +133,11 @@
 else
 . ./DISTRO_PKGS_SPECS-${DISTRO_BINARY_COMPAT} #has FALLBACKS_COMPAT_VERSIONS
 fi
 
 . ./PKGS_MANAGEMENT #101013 want variable PKG_PREFER_OLDER.
+. ./DISTRO_PET_REPOS #120506 want variable PACKAGELISTS_PET_ORDER
 
 if [ -f WOOFMERGEVARS ];then #111123
 . ./WOOFMERGEVARS #has variables WOOF_HOSTARCH, WOOF_TARGETARCH, WOOF_COMPATDISTRO, WOOF_COMPATVERSION
 else
  echo 'File WOOFMERGEVARS does not exist. This is created by script
@@ -167,10 +168,50 @@
 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'
 
 WKGDIR="`pwd`"
 
+#120506 params passed from woof_gui_tabs. moved up...
+KERNELPKG=""
+[ $1 ] && KERNELPKG="$1"
+CHOICE_SCSI=""
+[ $2 ] && CHOICE_SCSI="$2" #Erase_SCSI, Keep_SCSI, Boot_SCSI
+CHOICE_BIGMODEM=""
+[ $3 ] && CHOICE_BIGMODEM="$3" #Erase_big_modems Keep_big_modems Zdrv_big_modems
+CHK_FB_STATE=""
+[ $4 ] && CHK_FB_STATE="$4"
+CHK_EXOTIC_STATE=""
+[ $5 ] && CHK_EXOTIC_STATE="$5"
+CHK_RADICAL_STATE=""
+[ $6 ] && CHK_RADICAL_STATE="$6"
+
+#120506
+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.
+The latter choice will also require an SD card to write to, and you must have
+it available now."
+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
+ #override module choices, as kernel is built customized to particular hardware...
+ echo "...ok, chose sd-card image."
+ 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
+
 #w003 remove comments from PKGS_SPECS_TABLE
 PKGS_SPECS_TABLE="`echo "$PKGS_SPECS_TABLE" | grep -v '^#'`"
 
 mkdir -p sandbox3
 
@@ -186,14 +227,11 @@
  RIGHTVER="$DISTRO_VERSION"
 fi
 
 #the kernel is supposed to be a .pet package, already downloaded into packages-pet...
 echo
-if [ $1 ];then
- KERNELPKG="$1" #passed from woof_gui_tabs.
-else
-
+if [ "$KERNELPKG" = "" ];then
  #110823
  KERNELPKG="$DISTRO_KERNEL_PET"
  echo "The kernel pkg that you are using is: $KERNELPKG"
  echo "This is specified in variable DISTRO_KERNEL_PET in file DISTRO_SPECS,"
  echo "which is set in the first GUI tab of script woof_gui, or in script 1download,"
@@ -202,11 +240,10 @@
  echo "properly resolve some dependencies, possible packages that are dependent"
  echo "on a certain kernel version."
  echo "Note, the linux_kernel PET needs to be in directory packages-pet."
  echo -n "Press ENTER to continue: "
  read keepgoing
-
 fi
 
 #110826...
 #KERNELVER="`echo "$KERNELPKG" | cut -f 2 -d '-'`"
 ##um, if it is named 'linux-2.6.29-rc7-*.pet' then get 2 fields...
@@ -271,10 +308,11 @@
   COMPCHOICE=''
  fi
 fi
 
 #110823
+echo
 ./findwoofinstalledpkgs #creates woof-installed-packages, which later gets copied into sandbox3/rootfs-complete/root/.packages/
 
 #100912 choose simple or traditional filenames...
 #traditional names...
 PREFIX1CHAR="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1`"
@@ -585,12 +623,13 @@
 
 mv -f rootfs-complete/etc/modules/firmware.dep rootfs-complete/etc/modules/firmware.dep.${KERNELVER}
 sync
 rm -rf build
 mkdir build
-cp rootfs-complete/boot/vmlinuz build/
-cp rootfs-complete/boot/System.map ./
+[ -f rootfs-complete/boot/vmlinuz ] && cp rootfs-complete/boot/vmlinuz build/
+[ -f rootfs-complete/boot/uImage ] && cp rootfs-complete/boot/uImage build/vmlinuz #120506 arm builds, using different name for kernel.
+[ -f rootfs-complete/boot/System.map ] && cp rootfs-complete/boot/System.map ./
 sync
 rm -rf rootfs-complete/boot
 echo -n "$IDSTRING" >> build/vmlinuz #100911 16-byte id-string appended. init can determine boot partition.
 
 #110722 need this, to put into woof-installed-packages...
@@ -613,14 +652,10 @@
 
  chroot "${PWD}/rootfs-complete" "/runDotInstalls" &> /dev/null
  rm -f rootfs-complete/runDotInstalls
  rm -f rootfs-complete/.INSTALL*
 fi
-
-#v431 param passed from woof_gui_tabs...
-CHOICE_SCSI=""
-[ $2 ] && CHOICE_SCSI="$2" #Erase_SCSI, Keep_SCSI, Boot_SCSI
 
 if [ "$CHOICE_SCSI" = "" ];then
  #w462 true-scsi drives
  echo
  echo "Would you like the live-CD to be able to recognise and even boot from"
@@ -678,30 +713,26 @@
 #   rm -f $ONEMODEM
 #  done
 # fi
 #fi
 
-#v431 woof_gui_tabs passes parameter...
-CHOICE_BIGMODEM=""
-[ $3 ] && CHOICE_BIGMODEM="$3" #Erase_big_modems Keep_big_modems Zdrv_big_modems
-
-if [ "$CHOICE_BIGMODEM" != "Erase_big_modems" ];then #v431
- echo
- if [ "$CHOICE_BIGMODEM" ];then
-  echo "You already selected what to do with the \"big modems\", however, this"
-  echo "question is specifically about the Intel 536 and 537 analog modems, that"
-  echo "are enormous and you might want to delete them, independently of the"
-  echo "choice already made for the big modems."
- else
-  echo "The next question will ask what to do with the \"big modems\", however, this"
-  echo "question is specifically about the Intel 536 and 537 analog modems, that"
-  echo "are enormous and you might want to delete them, independently of the"
-  echo "choise that will be made next for the big modems."
- fi
+if [ "$CHOICE_BIGMODEM" != "Erase_big_modems" ];then #v431
 # INTELMODEMMOD="`find rootfs-complete/lib/modules/${KERNELVER} -type f -iname intel5*ko*`"
  INTELMODEMMOD="`find rootfs-complete/lib/modules/${KERNELVER} -type f -iname 'intel5*ko' -o -iname 'intel5*HIDE'`" #101222
  if [ "$INTELMODEMMOD" != "" ];then
+  echo
+  if [ "$CHOICE_BIGMODEM" ];then
+   echo "You already selected what to do with the \"big modems\", however, this"
+   echo "question is specifically about the Intel 536 and 537 analog modems, that"
+   echo "are enormous and you might want to delete them, independently of the"
+   echo "choice already made for the big modems."
+  else
+   echo "The next question will ask what to do with the \"big modems\", however, this"
+   echo "question is specifically about the Intel 536 and 537 analog modems, that"
+   echo "are enormous and you might want to delete them, independently of the"
+   echo "choise that will be made next for the big modems."
+  fi
   echo
   echo "Would you like to remove the Intel 536 and 537 analog modem modules?"
   echo "These are an enormous waste of space (1MB - 18MB uncompressed) if you"
   echo "don't have one of those particular old modem dialup cards."
   echo -n "Press ENTER only to delete them: "
@@ -787,14 +818,10 @@
  mv -f rootfs-complete/lib/modules/all-firmware/intel537* big-modem-firmware/ 2>/dev/null
  mv -f rootfs-complete/lib/modules/all-firmware/intel537*.tar.gz big-modem-firmware/ 2>/dev/null
 fi
 echo
 
-#v431 param passed from woof_gui_tabs...
-CHK_FB_STATE=""
-[ $4 ] && CHK_FB_STATE="$4"
-
 if [ "$CHK_FB_STATE" = "" ];then
  #w481 remove framebuffer modules...
  echo
  echo "The kernel is configured with the vesafb driver builtin, which is usually enough"
  echo "if it is ever required to boot in framebuffer video mode. The other framebuffer"
@@ -815,13 +842,10 @@
   echo -n "$ONEBASE "
   rm -f $ONEMODULE
  done
  echo
 fi
-
-CHK_EXOTIC_STATE=""
-[ $5 ] && CHK_EXOTIC_STATE="$5"
 
 if [ "$CHK_EXOTIC_STATE" = "" ];then
  echo
  echo "A bit later in the script you will be asked if you would like to cut the modules"
  echo "right down to a fairly basic selection. However, for now you can choose a minor"
@@ -1036,14 +1060,10 @@
 
 #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
 
-#v431 passed from woof_gui_tabs...
-CHK_RADICAL_STATE=""
-[ $6 ] && CHK_RADICAL_STATE="$6"
-
 if [ "$CHK_RADICAL_STATE" = "" ];then
  echo
  echo -n "Press ENTER only to cutdown selection of modules, any other char to retain all: "
  read cutthemdown
  CHK_RADICAL_STATE="false"
@@ -1180,19 +1200,23 @@
  busybox depmod -b $WKGDIR/sandbox3/rootfs-complete -F $WKGDIR/sandbox3/System.map $KERNELVER
  sync
  MAKEZDRV="unwanted-modules" #w481 delay. 100903
 else
  #w460 retaining all modules, but offer to move them to a separate zdrv... 100911
- echo
- echo "If you wish, you can move the modules to a separate zdrv sfs file."
- echo "Right now they are in rootfs-complete, which will become ${PUPPYSFS},"
- echo "however there are advantages if the modules and firmware are in a separate"
- echo "'zdrv' sfs file -- it will not be copied into RAM at bootup, speeding bootup"
- echo "and using up less RAM, yet not sacrificing any speed."
- echo -n "Press ENTER key only to leave them alone, else any char for a separate zdrv: "
- read wantzdrv
- if [ "$wantzdrv" != "" ];then
+ if [ "$CHK_YES_ZDRV" = "" ];then #120506
+  echo
+  echo "If you wish, you can move the modules to a separate zdrv sfs file."
+  echo "Right now they are in rootfs-complete, which will become ${PUPPYSFS},"
+  echo "however there are advantages if the modules and firmware are in a separate"
+  echo "'zdrv' sfs file -- it will not be copied into RAM at bootup, speeding bootup"
+  echo "and using up less RAM, yet not sacrificing any speed."
+  echo -n "Press ENTER key only to leave them alone, else any char for a separate zdrv: "
+  read wantzdrv
+  CHK_YES_ZDRV="false"
+  [ "$wantzdrv" != "" ] && CHK_YES_ZDRV="true"
+ fi
+ if [ "$CHK_YES_ZDRV" = "true" ];then
   echo
   echo "Creating ${ZDRVSFS} 'zdrv' file..." #100911
   mkdir -p zdrv/lib
   mv -f rootfs-complete/lib/modules zdrv/lib/
   sync
@@ -1306,36 +1330,49 @@
 for ONELIST in $PKGLISTS_COMPAT
 do
  cp -f ../$ONELIST ./
  cp -f ../$ONELIST rootfs-complete/root/.packages/
 done
+
+for ONELIST in $PACKAGELISTS_PET_ORDER #120506
+do
+ cp -f ../$ONELIST ./
+ cp -f ../$ONELIST rootfs-complete/root/.packages/
+done
+
 #note, Ppup4, findwoofinstalledpkgs.sh (below) needs above file, then deletes it.
 #also copy the pet package databases...
-cp -f ../Packages-puppy-[0-9]-official rootfs-complete/root/.packages/
-cp -f ../Packages-puppy-common-official rootfs-complete/root/.packages/ #110608
+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 #110608
 #cp -f ../Packages-puppy-wary5-official rootfs-complete/root/.packages/
 
 cp -f ../Packages-puppy-noarch-official rootfs-complete/root/.packages/ #120305
 
 if [ -f ../Packages-puppy-${DISTRO_FILE_PREFIX}-official ];then #110723 ex: Packages-puppy-drake-official
  cp -f ../Packages-puppy-${DISTRO_FILE_PREFIX}-official rootfs-complete/root/.packages/
  cp -f ../Packages-puppy-${DISTRO_FILE_PREFIX}-official ./
+ #120506...
+ ../support/rationalize_categories Packages-puppy-${DISTRO_FILE_PREFIX}-official
+ cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-${DISTRO_FILE_PREFIX}-official
 fi
 
 #101014 rationalise categories... 110726 must *always* copy Packages-puppy-wary5-official (it is going to be the fallback)...
 #if [ "$DISTRO_COMPAT_VERSION" = "wary5" ];then #101025
+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
+#fi
+
+#if [ "${DISTRO_FILE_PREFIX}" = "drake" ];then #110723
+# ../support/rationalize_categories Packages-puppy-drake-official
+# cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-drake-official
 #fi
-if [ "${DISTRO_FILE_PREFIX}" = "drake" ];then #110723
- ../support/rationalize_categories Packages-puppy-drake-official
- cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-drake-official
-fi
-if [ "${DISTRO_FILE_PREFIX}" = "slacko" ];then #110816
- ../support/rationalize_categories Packages-puppy-slacko-official
- cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-slacko-official
-fi
+#if [ "${DISTRO_FILE_PREFIX}" = "slacko" ];then #110816
+# ../support/rationalize_categories Packages-puppy-slacko-official
+# cp -f /tmp/rationalized_categories rootfs-complete/root/.packages/Packages-puppy-slacko-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...
@@ -1345,11 +1382,11 @@
 
 #w476 swap to make sure 3 pet repos get chosen...
 enabledrepos=" "
 
 #100207 now using the quirky pet repo for all puppy builds...
-cp -f ../Packages-puppy-quirky-official rootfs-complete/root/.packages/
+[ -f ../Packages-puppy-quirky-official ] && cp -f ../Packages-puppy-quirky-official rootfs-complete/root/.packages/
 
 #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`
 
 #100116 quirky, want the quirky db first in list... 101126 no, now building quirky from wary5 pkgs...
@@ -2443,26 +2480,10 @@
 cut3PATTERN="s%CUT3INSERT%${CUT3INSERT}%"
 sed -e "$verPATTERN" -e "$prefixPATTERN" -e "$cut2PATTERN" -e "$cut3PATTERN" ../boot/README.HTM > build/README.HTM
 
 sync
 
-#120506
-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.
-The latter choice will also require an SD card to write to, and you must have
-it available now."
-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 #120506
  $MKISOFS -D -R -o ${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
  md5sum ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso > ${DISTRO_FILE_PREFIX}-${DISTRO_VERSION}${SCSIFLAG}.iso.md5.txt
  echo
@@ -2504,11 +2525,11 @@
   echo "${CNT} ${ONEIMAGE}" >> /tmp/3builddistro-probeimage
   CNT=`expr $CNT + 1`
  done
  while [ 1 ];do
   echo
-  echo -n "Type number which is your choice of SD image:"
+  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
@@ -2518,11 +2539,10 @@
  echo "Please insert the SD card. Make sure that it is the correct size as
 indicated on the filename of the skeleton image file that you chose."
  echo -n "Press ENTER after it is inserted: "
  read waitinsert
  sleep 2
- echo
  while [ 1 ];do
   CNT=1
   echo -n "" > /tmp/3builddistro-probedisk
   probedisk |
   while read ONEPROBE
@@ -2529,11 +2549,11 @@
   do
    echo "${CNT} ${ONEPROBE}" >> /tmp/3builddistro-probedisk
    CNT=`expr $CNT + 1`
   done
   echo
-  echo -n "Type number which is your SD card:"
+  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
@@ -2550,17 +2570,20 @@
  echo "Uncompressing image, please wait..."
  cp -f ../sd-skeleton-images/${SDIMAGE} ./${SDIMAGE}
  sync
  unxz ${SDIMAGE}
  if [ $? -ne 0 ];then
+  [ -f ./$SDIMAGE ] && rm -f ./$SDIMAGE
+  SDBASE="`basename $SDIMAGE .xz`"
+  [ -f ./$SDBASE ] && rm -f ./$SDBASE
   echo "Uncompress fail. Aborting."
   exit 1
  fi
  sync
  SDBASE="`basename $SDIMAGE .xz`"
  IMGBYTES=`stat --format=%s $SDBASE`
- echo "Writing skeleton image to ${SDDEVICE}, please wait patiently..."
+ echo "Writing skeleton image to ${SDDEVICE}, please wait very patiently..."
  dd if=${SDBASE} of=${SDDEVICE}
  if [ $? -ne 0 ];then
   echo "Sorry, operation failure. Aborting script."
   exit 1
  fi
@@ -2583,20 +2606,24 @@
  echo
  echo "Copying Linux kernel to SD card..."
  cp -f build/vmlinuz /mnt/sdimagep1/uImage
  sync
  echo "...done"
- echo "Copying Puppy filesystem to SD card (this will take awhile)..."
+ echo "Copying Puppy filesystem to SD card, please wait..."
  cp -a rootfs-complete/* /mnt/sdimagep2/
  sync
  echo "...done"
  umount /mnt/sdimagep1 2>/dev/null
  umount /mnt/sdimagep2 2>/dev/null
  echo
- echo "Please type the name that you want to give the SD image file,"
- echo -n "for example 'mele-sd-4gb-puppy-5.3.img': "
- read PUPIMG
+ 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="$PUPIMG1"
+ echo "...chosen $PUPIMG"
  echo
  echo "Now creating an image file of the SD card, please wait patiently..."
  IMGK=`expr $IMGBYTES \/ 1024` #assume size divisible by 1024!!!!***WARNING***
  dd if=$SDDEVICE of=$PUPIMG bs=1024 count=$IMGK
  sync
@@ -2604,10 +2631,14 @@
  echo
  echo "However, it is ${IMGK}KB, so needs to be compressed for distribution."
  echo "Compressing, please wait..."
  xz $PUPIMG
  sync
+ #update desktop drive icons. note, this is also done in /usr/sbin/bootflash, puppyinstaller, gparted_shell...
+ #/tmp/pup_event_frontend_block_request is used in /sbin/pup_event_frontend_d to refresh drv...
+ THEDRIVE="`echo -n "$SDDEVICE" | cut -f 3 -d '/'`"
+ echo "$THEDRIVE" > /tmp/pup_event_frontend_block_request
  COMPRIMGBYTES=`stat --format=%s ${PUPIMG}.xz`
  echo
  echo "The image is now ${PUPIMG}.xz and is ${COMPRIMGBYTES}bytes."
  COMPRIMGK=`expr $COMPRIMGBYTES \/ 1024`
  echo "(${COMPRIMGK}KB)"