• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revision9e166de2aebdecc84b8bbf1754c61e278508dc46 (tree)
Time2023-01-12 20:19:47
Authorphabrics <phabrics@phab...>
Commiterphabrics

Log Message

More consistent, fine-grained control over downloading of individual files rather than entire directory trees.

Change Summary

Incremental Difference

--- a/machine/sun/tme-make-machs
+++ b/machine/sun/tme-make-machs
@@ -30,40 +30,55 @@
3030 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3131 # POSSIBILITY OF SUCH DAMAGE.
3232
33+# Default values of various locations to download from/to.
34+
3335 # Firmware downloads for various machines
36+firmware_root=./sun-fw
3437 firmware_site=https://people.csail.mit.edu/~fredette/tme
3538 firmwares="sun2-multi-rev-R sun3-carrera-rev-3.0 sun4-75-rev-2.9 SUNW,501-1415 SUNW,501-1561 SUNW,501-2325 SUNW,501-3082-update7"
3639
3740 # NetBSD location/release to download
38-netbsd_site=https://cdn.netbsd.org
41+netbsd_root=./NetBSD
42+netbsd_site=https://cdn.netbsd.org/pub/NetBSD
3943 netbsd_rel=9.3
4044
45+# NetBSD binary sets to install via tape
46+# Remember, skip "etc" for an upgrade.
47+netbsd_sets="etc base comp games man misc rescue text kern-GENERIC"
48+
49+# The command to use for downloading files
50+download_cmd() {
51+ [ -f $2 ] || wget -np -r -nH --cut-dirs=2 $1/$2
52+}
53+
4154 # Download the firmware for each machine type, if needed
42-if [ ! -d "sun-fw" ]; then
43- mkdir sun-fw
44- cd sun-fw
45- for fw in $firmwares; do
46- wget $firmware_site/$fw.bin
47- done
48- cd ..
49-fi
55+mkdir -p $firmware_root
56+cd $firmware_root
57+for fw in $firmwares; do
58+ download_cmd $firmware_site $fw.bin
59+done
60+cd -
5061
51-# Mirror arch-specific NetBSD install files
62+mkdir -p $netbsd_root
63+cd $netbsd_root
64+# Download arch-specific NetBSD install files
5265 for arch in {sun2,sun3}; do
53- netbsd_path=NetBSD/NetBSD-$netbsd_rel/$arch
66+ netbsd_path=NetBSD-$netbsd_rel/$arch
5467 # Only download if necessary
55- if [ ! -d "$netbsd_path" ]; then
56- wget -R "*.html" -np -r -nH --cut-dirs=1 $netbsd_site/pub/$netbsd_path
57- fi
68+ download_cmd $netbsd_site $netbsd_path/installation/tapeimage/tapeboot
69+ download_cmd $netbsd_site $netbsd_path/installation/miniroot/miniroot.fs.gz
70+ download_cmd $netbsd_site $netbsd_path/binary/kernel/netbsd-RAMDISK.gz
71+ for f in $netbsd_sets; do
72+ download_cmd $netbsd_site $netbsd_path/binary/sets/${f}.tgz
73+ done
74+ [ $arch = "sun2" ] && download_cmd $netbsd_site $netbsd_path/binary/sets/kern-FOURMEG.tgz
5875 done
5976
6077 for arch in {sparc,sparc64}; do
61- netbsd_path=NetBSD/images/$netbsd_rel/NetBSD-$netbsd_rel-$arch.iso
6278 # Only download if necessary
63- if [ ! -f "$netbsd_path" ]; then
64- wget -np -r -nH --cut-dirs=1 $netbsd_site/pub/$netbsd_path
65- fi
79+ download_cmd $netbsd_site images/$netbsd_rel/NetBSD-$netbsd_rel-$arch.iso
6680 done
81+cd -
6782
6883 # First, try to find installed location of tme
6984 if [ -z ${MINGW_PREFIX+set} ]; then
@@ -89,59 +104,61 @@ for mach in `ls $loc/SUN*`; do
89104 fi
90105 done
91106
92-# Remember, skip "etc" for an upgrade.
93-sets="etc base comp games man misc rescue text"
107+# Replace with absolute pathnames to avoid symlink issues
108+firmware_root=$(realpath $firmware_root)
109+netbsd_root=$(realpath $netbsd_root)
94110
95111 # Finally, set up the links to the NetBSD installation files and device configuration
96112 for arch in {sun2,sun3,sun4,sun-ultra}; do
97- netbsd_path=NetBSD/NetBSD-$netbsd_rel/$arch
98- netbsd_iso=NetBSD/images/$netbsd_rel/NetBSD-$netbsd_rel-sparc
113+ netbsd_path=$netbsd_root/NetBSD-$netbsd_rel/$arch
114+ netbsd_iso=$netbsd_root/images/$netbsd_rel/NetBSD-$netbsd_rel-sparc
99115 netbsd=netbsd-$arch
100116 prom=my-$arch-eeprom.bin
101117 for machd in `ls -d $arch-*/`; do
102118 cd $machd
103119 echo "Making $machd"
104120 if [ $arch = "sun4" ]; then
105- [ -d ../sun-fw ] && ln -sf ../sun-fw/$arch* .
106- [ -d ../sun-fw ] && ln -sf ../sun-fw/SUNW,501-1* .
107- [ -f "../${netbsd_iso}.iso" ] && ln -sf "../${netbsd_iso}.iso" $netbsd.iso
121+ [ -d $firmware_root ] && ln -sf $firmware_root/$arch* .
122+ [ -d $firmware_root ] && ln -sf $firmware_root/SUNW,501-1* .
123+ [ -f "${netbsd_iso}.iso" ] && ln -sf "${netbsd_iso}.iso" $netbsd.iso
108124 macht="SS2"
109125 cnt=2008
110126 arch+=c
111127 prom=my-$arch-nvram.bin
112128 sz=10G
113129 elif [ $arch = "sun-ultra" ]; then
114- [ -d ../sun-fw ] && ln -sf ../sun-fw/SUNW* .
115- [ -f "../${netbsd_iso}64.iso" ] && ln -sf "../${netbsd_iso}64.iso" $netbsd.iso
130+ [ -d $firmware_root ] && ln -sf $firmware_root/SUNW* .
131+ [ -f "${netbsd_iso}64.iso" ] && ln -sf "${netbsd_iso}64.iso" $netbsd.iso
116132 cnt=8176
117133 arch=sun4u
118134 prom=my-$arch-nvram.bin
119135 sz=10G
120136 else
121- if [ -d "../$netbsd_path" ] && [ ! -d "$netbsd.tape" ]; then
122- [ -d ../sun-fw ] && ln -sf ../sun-fw/$arch* .
137+ if [ -d "$netbsd_path" ] && [ ! -d "$netbsd.tape" ]; then
138+ [ -d $firmware_root ] && ln -sf $firmware_root/$arch* .
123139 mkdir $netbsd.tape
124140 cd $netbsd.tape
125- ln -s ../../$netbsd_path/installation/tapeimage/tapeboot 01
141+ ln -s $netbsd_path/installation/tapeimage/tapeboot 01
126142 touch 02 03
127- gzip -c -d ../../$netbsd_path/installation/miniroot/miniroot.fs.gz > 04
128- gzip -c -d ../../$netbsd_path/binary/kernel/netbsd-RAMDISK.gz > 05
143+ gzip -c -d $netbsd_path/installation/miniroot/miniroot.fs.gz > 04
144+ gzip -c -d $netbsd_path/binary/kernel/netbsd-RAMDISK.gz > 05
129145 if [ $arch = "sun3" ]; then
130146 mv 05 02
131147 i=5
132148 else
133149 i=6
134150 fi
135- for f in $sets; do
151+ for f in $netbsd_sets; do
136152 j=`printf %02d $i`
137- gzip -c -d ../../$netbsd_path/binary/sets/${f}.tgz > $j
153+ gzip -c -d $netbsd_path/binary/sets/${f}.tgz > $j
138154 ((i+=1))
139155 done
156+ [ $arch = "sun2" ] && gzip -c -d $netbsd_path/binary/sets/kern-FOURMEG.tgz > $j
140157 cd ..
141158 fi
142159 if [ $arch = "sun3" ]; then
143160 macht="3/150"
144- [ -f $prom ] || tme-sun-eeprom < $(basename $machd)-eeprom.txt > $prom
161+ [ -f $prom ] || ${MINGW_CHOST}${MINGW_CHOST+-}tme-sun-eeprom < $(basename $machd)-eeprom.txt > $prom
145162 else
146163 macht="2/120"
147164 fi
@@ -154,7 +171,7 @@ for arch in {sun2,sun3,sun4,sun-ultra}; do
154171 if [ $arch != "sun4u" ]; then
155172 macaddr=`printf 8:0:20:%02X:%02X:%02X $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]`
156173 echo "$macht $macaddr"
157- tme-sun-idprom $macht $macaddr >> $prom
174+ ${MINGW_CHOST}${MINGW_CHOST+-}tme-sun-idprom $macht $macaddr >> $prom
158175 fi
159176 fi
160177 [ -f my-$arch-disk.img ] || dd if=/dev/zero of=my-$arch-disk.img bs=1 count=1 seek=$sz