Menu

[r10367]: / branches / feedback / patches / freebsd-nanobsd-2.patch  Maximize  Restore  History

Download this file

57 lines (56 with data), 1.6 kB

 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
--- tools/tools/nanobsd/FlashDevice.sub- 2009-08-03 02:13:06.000000000 -0600
+++ tools/tools/nanobsd/FlashDevice.sub 2009-08-03 02:13:06.000000000 -0600
@@ -203,10 +203,52 @@
;;
esac
;;
+ # Generic flash media. It assumes that we're booting using packet
+ # mode so the HEADS and SECTS don't matter. The truncation of the
+ # size to a slightly lower number is intentional to be conservative
+ # (eg, 1 sector smaller than N GB is always smaller than any flash
+ # claiming to be N GB, but wastes a little space sometimes when 1GB
+ # really means 1GiB). This is intended to be used when producing
+ # generic images for anybody to boot. Media sizes are specified 'Xg'
+ # for X GB (10^9 bytes) flash or Xm for X MB (10^6 bytes) flash.
+ # Power of 2 variants can be specified with gi or mi for GiB and MiB
+ # sizeed flash and don't try to be conservative (use with caution).
+ generic)
+ case $a2 in
+ *.*) # Catch unsupported 1.5g case, since expr can't
+ # cope with floats.
+ echo "Unsupported generic size $a2"
+ exit 2
+ ;;
+ *m)
+ NANO_HEADS=16
+ NANO_SECTS=63
+ NANO_MEDIASIZE=`expr -e ${a2%m} \* 1000000 / 512`
+ ;;
+ *g)
+ NANO_HEADS=16
+ NANO_SECTS=63
+ NANO_MEDIASIZE=`expr -e ${a2%g} \* 1000000000 / 512`
+ ;;
+ *mi)
+ NANO_HEADS=16
+ NANO_SECTS=63
+ NANO_MEDIASIZE=`expr -e ${a2%mi} \* 1024 \* 1024 / 512`
+ ;;
+ *gi)
+ NANO_HEADS=16
+ NANO_SECTS=63
+ NANO_MEDIASIZE=`expr -e ${a2%gi} \* 1024 \* 1024 \* 1024 / 512`
+ ;;
+ *)
+ echo "Unsupported generic size $a2"
+ exit 2
+ ;;
+ esac
+ ;;
*)
echo "Unknown Flash manufacturer"
exit 2
;;
esac
}
-
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.