Skip to content

Commit

Permalink
Default ramdisk now 8000 blocks, double the size of /var MFS, double …
Browse files Browse the repository at this point in the history
…the size of /tmp MFS, other minor cleanup
  • Loading branch information
yellowman committed Aug 26, 2012
1 parent eb39310 commit 0fecd68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
10 changes: 5 additions & 5 deletions flashrd
Expand Up @@ -6,22 +6,22 @@

date=`date +%Y%m%d`
arch=`uname -m`
vers=20120523
vers=20120826

export device=vnd3 # least likely to conflict ?
export rootdevice=vnd2 # used to mount flash vnd for writing of stuff inside
export blocks=7480 # blocks to reserve for kernel ramdisk
export szezroot=szez.$arch-$date # 7480 flash root
export blocks=8000 # blocks to reserve for kernel ramdisk
export szezroot=szez.$arch-$date # 8000 flash root
export dest=flashimg.$arch-$date # final product

export vnddirs="root bin etc sbin usr" # must match vnddirs= in stand/rc and fstab
export vndsize="102400 auto 102400 auto auto" # min partition sizes (or auto) (in 512 byte sectors)

export tardirs="var" # must match tardirs= in stand/rc and rc.conf.local
set -A tarsize 65536 # mfs sizes for tar dirs (in 512 byte sectors)
set -A tarsize 131072 # mfs sizes for tar dirs (in 512 byte sectors)

export mfsdirs="tmp" # mfs-only dirs
set -A mfssize 16384 # mfs sizes (in 512 byte sectors)
set -A mfssize 32768 # mfs sizes (in 512 byte sectors)

set -A part a d e f g h i j k l m n o p

Expand Down
12 changes: 4 additions & 8 deletions mkboot
Expand Up @@ -52,18 +52,17 @@ vnuncfgroot() {
tmplabel=`mktemp /tmp/mkbootlabel.XXXXXXXX`

if [ -z "$novnd" ]; then

# Create vnd image, must zero out the first few sectors or else disklabel freaks out...
c 0 "dd if=/dev/zero bs=$bytessec count=$bytessec of=$dest > /dev/null 2>&1"
vncfgroot $dest
c 1 "fdisk -c $cylinders -h $trackscylinder -s $sectorstrack -f $distloc/usr/mdec/mbr -yi $rootdevice >/dev/null 2>&1"
c 1 disklabel $rootdevice > $tmplabel
totalsize=$((cylinders * trackscylinder * sectorstrack))
sectorscylinder=$((totalsize / cylinders))

else
# This probably isn't important as of OpenBSD 4.8 because disklabel
# now ignores geometry specified by -R command. Flag for removal
# after further analysis. XXX
#

# Disk specified, use default kernel geometry
c 0 "fdisk -f $distloc/usr/mdec/mbr -yi $rootdevice >/dev/null 2>&1"
c 0 disklabel $rootdevice > $tmplabel
Expand All @@ -73,6 +72,7 @@ else
sectorscylinder=`awk -F: ' /^sectors\/cylinder:/ {print $2} ' $tmplabel`
trackscylinder=`awk -F: ' /^tracks\/cylinder:/ {print $2} ' $tmplabel`
cylinders=`awk -F: ' /^cylinders:/ {print $2} ' $tmplabel`

fi

totalmbytes=$((((totalsize / 1024) * bytessec) / 1024))
Expand All @@ -81,10 +81,6 @@ echo "Using disk geometry $cylinders/$trackscylinder/$sectorstrack ($totalmbytes
# Main partition comprises the total disk, minus first sector
asize=$((totalsize - sectorstrack))

# This probably isn't important as of OpenBSD 4.8 because disklabel
# now ignores geometry specified by -R command. Flag for removal
# after further analysis. XXX
#
# Remove most disklabel info, write disk geometry, partitions
egrep -v "^type:|^boundstart:|^boundend:|^total sectors:|^bytes/sector:|^sectors/track:|^sectors/cylinder:|^tracks/cylinder:|^cylinders:|^ .:|^#|^. partitions:|^.. partitions:|^$" < $tmplabel > ${tmplabel}.new
cat >> ${tmplabel}.new <<-EOF
Expand Down

0 comments on commit 0fecd68

Please sign in to comment.