Updated flash library
	ramdisk sizes and last orders.
This commit is contained in:
phk 2006-01-31 15:56:33 +00:00
parent fbdc4a3cd4
commit 164ce7afe5
2 changed files with 73 additions and 13 deletions

View File

@ -37,8 +37,25 @@
#
sub_FlashDevice () {
case $1 in
[Ss][Aa][Nn][Dd][Ii][Ss][Kk])
a1=`echo $1 | tr '[A-Z]' '[a-z]'`
a2=`echo $2 | tr '[A-Z]' '[a-z]'`
case $a1 in
integral)
# Source: mich@FreeBSD.org
case $a2 in
256|256mb)
NANO_MEDIASIZE=`expr 259596288 / 512`
NANO_HEADS=16
NANO_SECTS=63
;;
*)
echo "Unknown Integral i-Pro Flash capacity"
exit 2
;;
esac
;;
sandisk)
# Source:
# SanDisk CompactFlash Memory Card
# Product Manual
@ -48,43 +65,43 @@ sub_FlashDevice () {
# Table 2-7
# NB: notice math error in SDCFJ-4096-388 line.
#
case $2 in
32|32MB)
case $a2 in
32|32mb)
NANO_MEDIASIZE=`expr 32112640 / 512`
NANO_HEADS=4
NANO_SECTS=32
;;
64|64MB)
64|64mb)
NANO_MEDIASIZE=`expr 64225280 / 512`
NANO_HEADS=8
NANO_SECTS=32
;;
128|128MB)
128|128mb)
NANO_MEDIASIZE=`expr 128450560 / 512`
NANO_HEADS=8
NANO_SECTS=32
;;
256|256MB)
256|256mb)
NANO_MEDIASIZE=`expr 256901120 / 512`
NANO_HEADS=16
NANO_SECTS=32
;;
512|512MB)
512|512mb)
NANO_MEDIASIZE=`expr 512483328 / 512`
NANO_HEADS=16
NANO_SECTS=63
;;
1024|1024MB|1G)
1024|1024mb|1g)
NANO_MEDIASIZE=`expr 1024966656 / 512`
NANO_HEADS=16
NANO_SECTS=63
;;
2048|2048MB|2G)
2048|2048mb|2g)
NANO_MEDIASIZE=`expr 2048901120 / 512`
NANO_HEADS=16
NANO_SECTS=63
;;
4096|4096MB|4G)
4096|4096mb|4g)
NANO_MEDIASIZE=`expr 4097802240 / 512`
NANO_HEADS=16
NANO_SECTS=63
@ -95,9 +112,22 @@ sub_FlashDevice () {
;;
esac
;;
[Ss][Oo][Ee][Kk][Rr][Ii][Ss])
siliconsystems)
case $2 in
[Nn][Ee][Tt]4526 | 4526 | [Nn][Ee][Tt]4826 | 4826 | 64 | 64MB)
4096|4g)
NANO_MEDIASIZE=`expr 4224761856 / 512`
NANO_HEADS=16
NANO_SECTS=63
;;
*)
echo "Unknown SiliconSystems Flash capacity"
exit 2
;;
esac
;;
soekris)
case $2 in
net4526 | 4526 | net4826 | 4826 | 64 | 64mb)
NANO_MEDIASIZE=125056
NANO_HEADS=4
NANO_SECTS=32
@ -108,6 +138,19 @@ sub_FlashDevice () {
;;
esac
;;
transcend)
case 2 in
dom064m)
NANO_MEDIASIZE=125184
NANO_HEADS=4
NANO_SECTS=32
;;
*)
echo "Unknown Transcend Flash capacity"
exit 2
;;
esac
;;
*)
echo "Unknown Flash manufacturer"
exit 2

View File

@ -93,6 +93,12 @@ NANO_CONFSIZE=2048
# If negative: max size possible
NANO_DATASIZE=0
# Size of the /etc ramdisk in 512 bytes sectors
NANO_RAM_ETCSIZE=10240
# Size of the /tmp+/var ramdisk in 512 bytes sectors
NANO_RAM_TMPVARSIZE=10240
# Media geometry, only relevant if bios doesn't understand LBA.
NANO_SECTS=32
NANO_HEADS=16
@ -242,6 +248,9 @@ setup_nanobsd ( ) (
find $d -print | cpio -dumpl conf/base/
done
echo "$NANO_RAM_ETCSIZE" > conf/base/etc/md_size
echo "$NANO_RAM_TMPVARSIZE" > conf/base/var/md_size
# pick up config files from the special partition
echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount
@ -381,6 +390,13 @@ create_i386_diskimage ( ) (
) > ${MAKEOBJDIRPREFIX}/_.di 2>&1
)
last_orders () (
# Redefine this function with any last orders you may have
# after the build completed, for instance to copy the finished
# image to a more convenient place:
# cp ${MAKEOBJDIRPREFIX}/_.disk.image /home/ftp/pub/nanobsd.disk
)
#######################################################################
#
# Optional convenience functions.
@ -550,5 +566,6 @@ run_customize
setup_nanobsd
prune_usr
create_${NANO_ARCH}_diskimage
last_orders
echo "# NanoBSD image completed"