Date: Mon, 28 Jun 1999 18:52:16 +0200 From: Michael Bretterklieber <mbretter@sbox.tu-graz.ac.at> To: freebsd-small@freebsd.org Cc: abial@webgiro.com Subject: Changes to scripts for building DiskOnChip 2000 4MB images Message-ID: <99062819152800.14539@babsi.tu-graz.ac.at>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi,
I made a few changes to some scripts from PicoBSD.
It is now possible to build disk-images for M-Systems DiskOnChip2k (4MB) Flash-Disks.
The changes in the "build"-script let you define the disktype (floppy or
DOC2k) and the disksize (1.44 or 4 MB) and its now possible to define
default-values for Type and MFS size.
If anybody tries to build an image for the DOC2k then you
have to exchange the entries from "fd0a" to "fla0c" in these two files:
mfs.rc.en
update.en
It also lets you copy your own files into the mfs-tree during
the population of the filesystem. Add a script called "mfs.custom" into
your "custom"-dir, where have to put lines like these:
...
cp /sbin/dhclient-script /mnt/stand/
chmod a+x /mnt/stand/dhclient-script
touch /mnt/var/log/messages
touch /mnt/var/log/ppp.log
touch /mnt/var/log/wtmp
touch /mnt/var/log/ipfw
These two files are now expected to be in the "custom"-dir
loader.rc
kernel.conf
Finaly the entries for /etc/disktab:
doc2k4|DiskOnChip 2000 4MB Chip:\
:dt=ESDI:ty=winchester:se#512:nt#8:ns#1:nc#986:\
:pa#7888:oa#0:ba#0:fa#0:ta=4.2BSD:\
:pc#7888:oc#0:bc#0:fc#0:
Bye,
--
\|/
@ @
+---------------------------oOO-(_)-OOo---------------------------+
Michael Bretterklieber
Office: Michael.Bretterklieber@gamed.com
Privat: mbretter@sbox.tu-graz.ac.at
URL: http://www.sbox.tu-graz.ac.at/home/m/mbretter/
+-----------------------------------------------------------------+
[-- Attachment #2 --]
--- build Mon Jun 28 18:40:03 1999
+++ build.orig Mon Jun 28 18:14:02 1999
@@ -11,16 +11,10 @@
# Default MFS sizes for different types of the floppy. Again, most people
# shouldn't change them unless they know what they are doing.
-DEF_TYPE=custom
DIAL_DFLT_SIZE=1600
ROUTER_DFLT_SIZE=820
NET_DFLT_SIZE=1700
ISP_DFLT_SIZE=1700
-CUS_DFLT_SIZE=8192
-#DEF_DISK_TYPE=floppy
-#DEF_DISK_SIZE=1440
-DEF_DISK_TYPE=DOC2k
-DEF_DISK_SIZE=3944
# DEVFS is currently broken. Always set this.
#
@@ -91,7 +85,7 @@
# Build the kernel, if necessary
build_kernel
-export SIZE LANGUAGE TYPE SRC NO_DEVFS INIT DISK_TYPE DISK_SIZE
+export SIZE LANGUAGE TYPE SRC NO_DEVFS INIT
for i in stage1 populate stage2 stage3
do
@@ -204,7 +198,7 @@
SIZE=$ISP_DFLT_SIZE
elif [ "X${TYPE}" = "Xcustom" ]
then
- SIZE=$CUS_DFLT_SIZE
+ SIZE=$DIAL_DFLT_SIZE
else
echo "Unknown type of setup: \"${TYPE}\". Aborting..."
exit 10
@@ -290,44 +284,6 @@
set_dflt_size
}
-set_disk_type() {
- clear
- echo " Disk Type setup"
- echo " Two Disktypes are available:"
- echo " a: Floppy"
- echo " b: DiskOnChip 2000"
- read -p "Enter the Type of disk:" DISK_TYPE
- if [ "${DISK_TYPE}" = "a" ]
- then
- DISK_TYPE=floppy
- elif [ "${DISK_TYPE}" = "b" ]
- then
- DISK_TYPE=DOC2k
- else
- echo " unknown disktype"
- exit 10
- fi
-}
-
-set_disk_size() {
- clear
- echo " Disk Size setup"
- echo " Two Disksizes are available:"
- echo " a: Floppy 1.44 MB"
- echo " b: DiskOnChip 2000 4MB"
- read -p "Enter the disksze:" DISK_SIZE
- if [ "${DISK_SIZE}" = "a" ]
- then
- DISK_SIZE=1440
- elif [ "${DISK_SIZE}" = "b" ]
- then
- DISK_SIZE=3944
- else
- echo " unknown disksize"
- exit 10
- fi
-}
-
put_title() {
clear
echo " Building the PicoBSD v. 0.4 floppy"
@@ -357,7 +313,7 @@
set_dflt_size
echo "---------------------------------------------">>build.status
echo "Building TYPE=${z}, LANGUAGE=${y}, SIZE=${SIZE}" >>build.status
- export TYPE SIZE LANGUAGE SRC NO_DEVFS INIT DISK_TYPE DISK_SIZE
+ export TYPE SIZE LANGUAGE SRC NO_DEVFS INIT
main
if [ "X$?" != "X0" ]
then
@@ -375,10 +331,8 @@
# Set build parameters interactively
-TYPE=${DEF_TYPE}
+TYPE=dial
LANGUAGE=en
-DISK_TYPE=${DEF_DISK_TYPE}
-DISK_SIZE=${DEF_DISK_SIZE}
set_dflt_size
while [ "X${ans}" != "Xn" ]
do
@@ -393,13 +347,11 @@
echo " a. (using stock init as init(8))"
fi
echo ""
- echo " 2. MFS size: ${SIZE} KB"
+ echo " 2. MFS size: ${SIZE} kB"
echo " 3. Language: ${LANGUAGE}"
- echo " 4. Disk Type: ${DISK_TYPE}"
- echo " 5. Disk Size: ${DISK_SIZE} KB"
echo ""
echo "Which parameter would you like to change?"
- read -p "(1, a, 2, 3, 4, 5; n -no change, build it ; q -quit): " ans
+ read -p "(1, a, 2, 3; n -no change, build it ; q -quit): " ans
case ${ans} in
1) set_type
clear
@@ -413,12 +365,6 @@
3) set_lang
clear
;;
- 4) set_disk_type
- clear
- ;;
- 5) set_disk_size
- clear
- ;;
q) echo ""
echo "Hey! Don't give up so quickly. Quitting for now..."
echo ""
@@ -432,7 +378,7 @@
esac
done
# Export the parameters
-export LANGUAGE SIZE TYPE SRC NO_DEVFS INIT DISK_TYPE DISK_SIZE
+export LANGUAGE SIZE TYPE SRC NO_DEVFS INIT
# Call the build procedure
main
# Install if it's ok.
[-- Attachment #3 --]
--- populate Fri Jun 25 19:17:49 1999
+++ populate.orig Mon Jun 28 18:51:03 1999
@@ -53,10 +53,6 @@
cp help.a /mnt/help.a)
fi
-if [ -f ../mfs.custom ]; then
- . ../mfs.custom
-fi
-
echo "-> Making and installing crunch1..."
cd ../crunch1
make "SRC=${SRC}" && make install 2>&1 >/dev/null
[-- Attachment #4 --]
--- stage3 Mon Jun 28 18:45:05 1999
+++ stage3.orig Sun Jun 27 19:10:03 1999
@@ -17,8 +17,7 @@
umount /mnt 2> /dev/null || true
vnconfig -u /dev/rvn0 2> /dev/null || true
-#dd of=picobsd.bin if=/dev/zero count=1440 bs=1k 2> /dev/null
-dd of=picobsd.bin if=/dev/zero count=${DISK_SIZE} bs=1k 2> /dev/null
+dd of=picobsd.bin if=/dev/zero count=1440 bs=1k 2> /dev/null
awk 'BEGIN {printf "%c%c", 85, 170}' | \
dd of=picobsd.bin obs=1 seek=510 conv=notrunc 2> /dev/null
@@ -34,31 +33,15 @@
dd if=/boot/boot1 of=picobsd.bin conv=notrunc 2> /dev/null
-if [ "${DISK_TYPE}" = "DOC2k" ]
+disklabel -Brw -b /boot/boot1 -s /boot/boot2 /dev/rvn0 fd1440 2>&1 >/dev/null
+if [ "X$?" != "X0" ]
then
- echo "labeling for DiskOnChip ..."
- disklabel -Brw -b /boot/boot1 -s /boot/boot2 /dev/rvn0 doc2k4 2>&1 >/dev/null
- if [ "X$?" != "X0" ]
- then
echo "-> ERROR while labeling picobsd.bin on /dev/rvn0..."
echo "-> Aborting $0"
exit 10
- fi
- newfs -T doc2k4 -m 0 -o space /dev/rvn0c 2>&1 >/dev/null
fi
-if [ "${DISK_TYPE}" = "floppy" ]
-then
- echo "labeling for Floppy ..."
- disklabel -Brw -b /boot/boot1 -s /boot/boot2 /dev/rvn0 fd1440 2>&1 >/dev/null
- if [ "X$?" != "X0" ]
- then
- echo "-> ERROR while labeling picobsd.bin on /dev/rvn0..."
- echo "-> Aborting $0"
- exit 10
- fi
- newfs -i 32768 -m 0 -p 0 -o space /dev/rvn0c 2>&1 >/dev/null
-fi
+newfs -i 32768 -m 0 -p 0 -o space /dev/rvn0c 2>&1 >/dev/null
mount /dev/vn0c /mnt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99062819152800.14539>
