22# run this script from the `Marble` project directory:
33# $ bash scripts/manufacturing.sh
44#
5- # Versions tested on Debian Bullseye 2023 -03-20:
6- # KiCad 6.0.6 (wish for more varied experience)
5+ # Versions tested on Debian Bullseye 2024 -03-20:
6+ # KiCad 6.0.11 (wish for more varied experience)
77# KiBoM 1.8.0 (tested with commit ac29a12)
88# kiauto 2.2.1 (tested natively, docker and chroot)
99#
1313# (or let pip3 find xvfbwrapper and psutil)
1414# pip3 install kiauto==2.2.1
1515#
16- # No need to open the GUI! Everything can be done using this script
16+ # No need to open the GUI! Everything can be done using this script,
1717# including generation of the BOM .xml and IPC-D-356 Netlist files.
1818#
1919# Make sure
@@ -26,7 +26,7 @@ export LC_COLLATE=C
2626umask 0022
2727A=Marble
2828
29- # Make sure we're running under bash so brace expansion and which works
29+ # Make sure we're running under bash, so brace expansion and which works
3030if ! test " $( echo A{B,C}) " = " AB AC" ; then
3131 echo " Error, not running under bash"
3232 exit 1
@@ -39,7 +39,7 @@ if ! python3 -m KiBOM_CLI --version; then
3939 exit 1
4040fi
4141
42- # check for kiauto (see installation instructions above)
42+ # Check for kiauto (see installation instructions above)
4343if ! which eeschema_do pcbnew_do; then
4444 echo " kiauto commands eeschema_do pcbnew_do not in \$ PATH"
4545 exit 1
5858zipfile=marble-${spec} -fab.zip
5959echo " Final .zip file will be named $zipfile "
6060
61- # remove any stray stale files
61+ # Remove any stray stale files
6262rm -f marble* .dat ./* .pdf ./* .erc ./* .drc ./* .xml
6363
6464echo " Generating PDF schematics"
65- # Export schematics to PDF, saves it as Marble.pdf
65+ # Export schematics to PDF, saving it as Marble.pdf
6666eeschema_do export -a $A .kicad_sch .
6767
6868# Run ERC, saves a report Marble.erc
7676fi
7777echo " See $A .erc and $( wc -l $A .erc.log) "
7878
79- # Run DRC, saves a report Marble.drc
79+ # Run DRC, which saves a report file called Marble.drc
8080echo " Running DRC (layout)"
8181# -s or not?
8282if pcbnew_do run_drc -f drc_exclusion $A .kicad_pcb --ignore_unconnected -o $A .drc . 2> $A .drc.log; then
@@ -138,7 +138,7 @@ python3 scripts/find_tp.py ${A}.kicad_pcb > testpoint_map.gbr
138138
139139# Assemble files into fab directory
140140# Includes stripping out date and revision info from KiCad exports,
141- # so we have a chance of making reproducible output
141+ # so we have a good chance of making reproducible output.
142142rm -rf fab
143143mkdir fab
144144cd PCB_layers
@@ -173,7 +173,7 @@ cp marble-stack.txt fab/marble-stack.txt
173173cp scripts/testpoint_map.gvp fab/testpoint_map.gvp
174174mv testpoint_map.gbr fab/testpoint_map.gbr
175175
176- # Fancy file integrity feature, presumably nobody besides Larry will care
176+ # Fancy file integrity feature. Presumably nobody besides Larry will ever care.
177177(cd fab && sha256sum -- * > marble-sha256.txt)
178178(cat ../docs/README_fab.txt; cd fab; sha256sum marble-sha256.txt) > fab/README_fab.txt
179179
@@ -183,9 +183,10 @@ if test -n "$SOURCE_DATE_EPOCH"; then
183183 echo " Forcing timestamp $SOURCE_DATE_EPOCH "
184184 touch --date=" @$SOURCE_DATE_EPOCH " fab/*
185185 TZ=UTC zip -X --latest-time " $zipfile " fab/*
186- # Note the -X flag; to be pedantic about timestamps,
187- # that means you should unpack with TZ=UTC unzip "$zipfile". See
186+ # Note the -X flag, that keeps potentially bogus atime info out of the zipfile. See
188187 # https://lists.reproducible-builds.org/pipermail/rb-general/2023-April/002927.html
188+ # The TZ setup means that for full pedantic accuracy, you should unpack with
189+ # TZ=UTC unzip "$zipfile".
189190else
190191 zip " $zipfile " fab/*
191192fi
@@ -196,4 +197,5 @@ if [ "$1" != "debug" ]; then # clean-up step, can skip when debugging
196197fi
197198# marble-${spec}-fab.zip is the only generated file that should remain
198199ls -l " $zipfile "
200+ sha256sum " $zipfile "
199201echo DONE
0 commit comments