#!/bin/sh -x
# original image
cat <<\! >/dev/null
controller	wdc0	at isa? port "IO_WD1" bio irq 9
disk		wd0	at wdc0 drive 0
#disk		wd1	at wdc0 drive 1
#disk		wd2	at wdc0 drive 2
#disk		wd3	at wdc0 drive 3
# ATAPI IDE CD-ROM machine
#disk		wd0	at wdc0 drive 0
#disk		wd1	at wdc0 drive 2
#disk		wd2	at wdc0 drive 3
#
# UIDE-98 provides support for IO-DATA UIDE-98
#
#options	"UIDE98"
#controller	wdc0	at isa? port "0" bio irq ? flags 0xa0ffa0ff
#disk		wd0	at wdc0 drive 0
#disk		wd1	at wdc0 drive 1
#controller	wdc1	at isa? port "0" bio irq ? flags 0xa0ffa0ff
#disk		wd2	at wdc1 drive 0
#disk		wd3	at wdc1 drive 1
#
# If you are using a internal IDE contoller too, then use config lines.
#
#controller	wdc2	at isa? port "IO_WD1" bio irq 9
#disk		wd4	at wdc2 drive 0
#disk		wd5	at wdc2 drive 1
#disk		wd6	at wdc2 drive 2
#disk		wd7	at wdc2 drive 3
!
sed '/^disk		wd0/,/^$/c\
#disk		wd0	at wdc0 drive 0\
#disk		wd1	at wdc0 drive 1\
#disk		wd2	at wdc0 drive 2\
#disk		wd3	at wdc0 drive 3\
# ATAPI IDE CD-ROM machine\
disk		wd0	at wdc0 drive 0\
disk		wd1	at wdc0 drive 2\
disk		wd2	at wdc0 drive 3\
#\
# UIDE-98 provides support for IO-DATA UIDE-98\
#\
#options	"UIDE98"\
#controller	wdc0	at isa? port "0" bio irq ? flags 0xa0ffa0ff\
#disk		wd0	at wdc0 drive 0\
#disk		wd1	at wdc0 drive 1\
#controller	wdc1	at isa? port "0" bio irq ? flags 0xa0ffa0ff\
#disk		wd2	at wdc1 drive 0\
#disk		wd3	at wdc1 drive 1\
#\
# If you are using a internal IDE contoller too, then use config lines.\
#\
#controller	wdc2	at isa? port "IO_WD1" bio irq 9\
#disk		wd4	at wdc2 drive 0\
#disk		wd5	at wdc2 drive 1\
#disk		wd6	at wdc2 drive 2\
#disk		wd7	at wdc2 drive 3\
\
' GENERIC98 >GENERIC98.ide2

sed '/^disk		wd0/,/^$/c\
disk		wd0	at wdc0 drive 0\
disk		wd1	at wdc0 drive 1\
disk		wd2	at wdc0 drive 2\
disk		wd3	at wdc0 drive 3\
# ATAPI IDE CD-ROM machine\
#disk		wd0	at wdc0 drive 0\
#disk		wd1	at wdc0 drive 2\
#disk		wd2	at wdc0 drive 3\
#\
# UIDE-98 provides support for IO-DATA UIDE-98\
#\
#options	"UIDE98"\
#controller	wdc0	at isa? port "0" bio irq ? flags 0xa0ffa0ff\
#disk		wd0	at wdc0 drive 0\
#disk		wd1	at wdc0 drive 1\
#controller	wdc1	at isa? port "0" bio irq ? flags 0xa0ffa0ff\
#disk		wd2	at wdc1 drive 0\
#disk		wd3	at wdc1 drive 1\
#\
# If you are using a internal IDE contoller too, then use config lines.\
#\
#controller	wdc2	at isa? port "IO_WD1" bio irq 9\
#disk		wd4	at wdc2 drive 0\
#disk		wd5	at wdc2 drive 1\
#disk		wd6	at wdc2 drive 2\
#disk		wd7	at wdc2 drive 3\
\
' GENERIC98 >GENERIC98.ide4

sed '/^controller	wdc0/,/^$/c\
#controller	wdc0	at isa? port "IO_WD1" bio irq 9\
#disk		wd0	at wdc0 drive 0\
#disk		wd1	at wdc0 drive 1\
#disk		wd2	at wdc0 drive 2\
#disk		wd3	at wdc0 drive 3\
# ATAPI IDE CD-ROM machine\
#disk		wd0	at wdc0 drive 0\
#disk		wd1	at wdc0 drive 2\
#disk		wd2	at wdc0 drive 3\
#\
# UIDE-98 provides support for IO-DATA UIDE-98\
#\
options	"UIDE98"\
controller	wdc0	at isa? port "0" bio irq ? flags 0xa0ffa0ff\
disk		wd0	at wdc0 drive 0\
disk		wd1	at wdc0 drive 1\
controller	wdc1	at isa? port "0" bio irq ? flags 0xa0ffa0ff\
disk		wd2	at wdc1 drive 0\
disk		wd3	at wdc1 drive 1\
#\
# If you are using a internal IDE contoller too, then use config lines.\
#\
controller	wdc2	at isa? port "IO_WD1" bio irq 9\
disk		wd4	at wdc2 drive 0\
disk		wd5	at wdc2 drive 1\
disk		wd6	at wdc2 drive 2\
disk		wd7	at wdc2 drive 3\
\
' GENERIC98 >GENERIC98.uide
