
usage: rdbedit [-F] [-i] [-s blkno] [-e] [-t] device
 -F use file
 -i start with empty RDB
 -s use this start block for RDB instead of 0.
 -e enter edit mode
 -t print disktab entry
[ -d increase debug level

The program is menu driven and waits for lines with
commands to be entered. You can also pipe commands
to stdin. When you change the data, you will get
asked if you want to write back the changes and
you have to enter Y.

A command may require additional arguments that immediately
follow the command letter. Multiple arguments are space
separated, strings are read to the end of the line.

E.g. on the main menu:

c0 4000

creates a partition with size 4000 cyclinders. The first parameter
denotes the partition block to configure, a 0 means: chose the
next available RDB block. The partition start value is automatically
chosen.

The RDB information is special. You start with a RDB block with
global parameters which is searched at the beginning of the disk.
It is followed by different kind of blocks, mostly partition
blocks, each describing a single partition. There mayb be other
blocks to list bad blocks or to store fileystem code that is
loaded before AmigaOS can mount the partition.


The main menu lets you enter the rdb and the part menus
and adds two simple commands to add and remove partitions.

main menu:
r - edit rigid disk block
p - edit partition PARTBLK
c - create partition PARTBLK NUMCYLS
d - delete partition PARTBLK
. - print
a - abort
q - quit

The rdb menu lets you edit parameters in the RDB. The
'X' command computes redundant values and validates
geometry parameters.

rdb menu:
i - hostid ID
b - nbytes NUM
C - ncylinders NUM
S - nsectors NUM
H - nheads NUM
f - flags [last,lastlun,lastunit,noreselect,diskid,ctrlid,sync]
l - lowcyl NUM
h - highcyl NUM
v - disk vendor STRING
p - disk product STRING
r - disk revision STRING
V - controller vendor STRING
P - controller product STRING
R - controller revision STRING
x - check
X - set geometry and check
. - print
a - abort
q - quit

The part menu lets you edit parameters of a partition.
The fsize/frag/cpg parameters are NetBSD parameters.
The dostype parameter understands \NNN as a byte in decimal.

part menu:
f - flags [bootable,nomount]
n - partname STRING
r - resvblocks NUM
v - interleave NUM
l - lowcyl NUM
h - highcyl NUM
b - numbufs NUM
B - membuftype [chip,fast,local,24bitdam]
M - maxtrans NUM
m - mask NUM
p - bootpri NUM
t - dostype STRING
o - bootblocks NUM
S - fsize NUM
F - frag NUM
C - cpg NUM
x - check
. - print
a - abort
q - quit



Example:

We start the RDB at block 2 so that block 1 could be used for
a hybrid disk with a disklabel, block 0 is unused. The default
would write the RDB block to block 0.

rdbedit -F -i -e -s 2 imagefile <<EOF
r                       Edit rdb block
vNetBSD                 Set vendor string to NetBSD
pHardfile               Set product string to Hardfile
q                       Exit rdb menu
c0 4000                 Create next partition with 4000 cylinders
p3                      Edit partition in block 3 (Block 2 is the RDB block)
fbootable               Tag it as bootable
nroot                   Name it as "root"
tNBR\007                Set the Dostype so that NetBSD choses it as 'a'
o16                     Reserve 16 blocks for the bootblock
p10                     Set boot priority 10
x                       Fill in other values
q                       Exit part menu
c0 4000                 Create next partition with 4000 cylinders
p4                      Edit partition in block 4
nswap                   Name it 'swap'
tNBS\001                Set dostype to make it 'b'
o16                     Reserve bloot block (for miniroot installation)
p0                      Set boot priority 0
x                       Fill in other values
q                       Exit part menu
c0 0                    Create next partition with remaining cylinders
p5                      Edit partition block 5
nother                  Name it 'other'
x                       Fill in other values
q                       Exit part menu
.                       Print resulting table
q                       Exit
Y                       Confirm write-back
EOF

