Skip to content

Commit

Permalink
20100402 release:
Browse files Browse the repository at this point in the history
Fix usage with no tardirs and/or mfsdirs defined.
Add /sbin/reboot to ramdisk rdroot (to reboot cleanly if the system fails to load).
Add most networking firmware to ramdisk rdroot (so USB NICs, USB RS232 work without unplug/replug).
Add make clean to kernel compilation (only runs if config utility says that kernel options have changed).
Add detail to kernel compilation phase for less patient people (make depend, make clean, make).
  • Loading branch information
yellowman committed Jun 2, 2012
1 parent 5111d98 commit 5674382
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 19 deletions.
34 changes: 34 additions & 0 deletions firmware.list
@@ -0,0 +1,34 @@
# Firmware that will get copied from /etc/firmware to ramdisk
# This gives the kernel access to firmware before the real /etc filesystem is mounted
atu-at76c503-i3863-ext
atu-at76c503-i3863-int
atu-at76c503-rfmd-acc-ext
atu-at76c503-rfmd-acc-int
atu-at76c505-rfmd-ext
atu-at76c505-rfmd-int
atu-intersil-ext
atu-intersil-int
atu-rfmd-ext
atu-rfmd-int
atu-rfmd2958-ext
atu-rfmd2958-int
atu-rfmd2958smc-ext
atu-rfmd2958smc-int
fxp-d101a
fxp-d101b0
fxp-d101ma
fxp-d101s
fxp-d102
fxp-d102c
fxp-d102e
kue
ral-rt2561
ral-rt2561s
ral-rt2661
ral-rt2860
rum-rt2573
run-rt2870
run-rt3071
tusb3410
zd1211
zd1211b
10 changes: 5 additions & 5 deletions flashrd
Expand Up @@ -6,12 +6,12 @@

date=`date +%Y%m%d`
arch=`uname -m`
vers=20090904
vers=20100402

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

export vnddirs="root bin etc sbin usr" # must match vnddirs= in stand/rc and fstab
Expand Down Expand Up @@ -179,8 +179,8 @@ for i in $vnddirs; do
let x=x+1
done

x=0
if [ ! -z "$tardirs" ]; then
x=0
for i in $tardirs; do
echo "swap /$i mfs rw,nodev,nosuid,-s${tarsize[$x]} 0 0" >> $tmpfstab
let x=x+1
Expand All @@ -192,8 +192,8 @@ if [ $x -ne ${#tarsize[*]} ]; then
2; 1; 0;
fi

x=0
if [ ! -z "$mfsdirs" ]; then
x=0
for i in $mfsdirs; do
echo
echo "swap /$i mfs rw,nodev,nosuid,-s${mfssize[$x]} 0 0" >> $tmpfstab
Expand Down
11 changes: 4 additions & 7 deletions growimg
Expand Up @@ -162,8 +162,7 @@ NewDir=`mktemp -d newdir.XXXXX`
if ! mount -o rdonly /dev/"$device2"a $OldDir; then
echo mount old image failed
vnconfig -u $device2
rm -f $NewImg $NewLabel
rmdir $OldDir $NewDir
rm -f $NewImg $NewLabel $OldDir $NewDir
exit 1
fi

Expand Down Expand Up @@ -193,8 +192,7 @@ if [ -z "$alt" ]; then
if ! vnconfig $device $NewImg; then
echo % vnconfig failure
vnconfig -u $device2
rm $NewImg $NewLabel
rmdir $OldDir $NewDir
rm $NewImg $NewLabel $OldDir $NewDir
exit 1
fi
fi
Expand Down Expand Up @@ -222,8 +220,7 @@ if ! mount -o async /dev/"$device"a $NewDir; then
vnconfig -u $device
fi
vnconfig -u $device2
rmdir $OldDir $NewDir
rm -f $NewImg
rm -f $NewImg $NewLabel $OldDir $NewDir
exit 1
fi

Expand Down Expand Up @@ -280,7 +277,7 @@ else
fi
echo

rmdir $NewDir $OldDir
rm -r $NewDir $OldDir
rm $NewLabel

exit 0
25 changes: 21 additions & 4 deletions mkkern
Expand Up @@ -13,7 +13,7 @@
#
# blocks

[ -z "$blocks" ] && blocks=6080
[ -z "$blocks" ] && blocks=7480

###
#
Expand Down Expand Up @@ -102,27 +102,44 @@ c 0 cc -o ./elfrdsetroot $elfrdsetroot
#
# compile our version of GENERIC

echo -n Configuring FLASHRD kernel
T=`mktemp /tmp/mkkern.XXXXXXX`
TMP=`mktemp /tmp/mkkern.XXXXXXX`

echo -n Configuring FLASHRD, FLASHRD.MP kernels
wd=`pwd`
cd $kernsrc/conf
c 0 "config FLASHRD >/dev/null 2>&1"
c 0 "config FLASHRD.MP >/dev/null 2>&1"
c 0 "config FLASHRD >$T 2>&1"
c 0 "config FLASHRD.MP >$TMP 2>&1"
echo

echo -n Compiling FLASHRD kernel
cd $kernsrc/compile/FLASHRD
echo -n " (make depend)"
c 0 "make depend >/dev/null 2>&1"
if grep "make clean" $T >/dev/null; then
echo -n " (make clean)"
c 0 "make clean >/dev/null 2>&1"
fi
echo -n " (make)"
c 0 "make >/dev/null 2>&1"
c 0 cp bsd $tmpmnt/bsd
echo

echo -n Compiling FLASHRD.MP kernel
cd $kernsrc/compile/FLASHRD.MP
echo -n " (make depend)"
c 0 "make depend >/dev/null 2>&1"
if grep "make clean" $TMP >/dev/null; then
echo -n " (make clean)"
c 0 "make clean >/dev/null 2>&1"
fi
echo -n " (make)"
c 0 "make >/dev/null 2>&1"
c 0 cp bsd $tmpmnt/bsd.mp
echo

rm $T

###
#
# run elfrdsetroot
Expand Down
21 changes: 18 additions & 3 deletions mkrdroot
Expand Up @@ -20,15 +20,15 @@

[ -z "$bincopy" ] && bincopy="bin/sh"

[ -z "$sbincopy" ] && sbincopy="sbin/init sbin/mount sbin/mount_ffs sbin/fsck sbin/fsck_ffs"
[ -z "$sbincopy" ] && sbincopy="sbin/init sbin/mount sbin/mount_ffs sbin/fsck sbin/fsck_ffs sbin/reboot"

[ -z "$etccopy" ] && etccopy="etc/login.conf etc/pwd.db"

###
#
# blocks

[ -z "$blocks" ] && blocks=6080
[ -z "$blocks" ] && blocks=7480

###
#
Expand Down Expand Up @@ -96,7 +96,7 @@ c 1 mount /dev/${device}a $tmpmntdir
#
# Our ramdisk base

c 2 mkdir $tmpmntdir/bin $tmpmntdir/dev $tmpmntdir/etc $tmpmntdir/home $tmpmntdir/mnt $tmpmntdir/root $tmpmntdir/sbin $tmpmntdir/stand $tmpmntdir/sys $tmpmntdir/tmp $tmpmntdir/usr $tmpmntdir/var $tmpmntdir/flash
c 2 mkdir $tmpmntdir/bin $tmpmntdir/dev $tmpmntdir/etc $tmpmntdir/etc/firmware $tmpmntdir/home $tmpmntdir/mnt $tmpmntdir/root $tmpmntdir/sbin $tmpmntdir/stand $tmpmntdir/sys $tmpmntdir/tmp $tmpmntdir/usr $tmpmntdir/var $tmpmntdir/flash

c 2 cp $distloc/.cshrc $distloc/.profile $tmpmntdir

Expand Down Expand Up @@ -139,6 +139,21 @@ for i in $etccopy; do
echo -n " $i"
c 2 cp $distloc/$i $tmpmntdir/etc
done
echo

echo -n Copying pre-mount firmware to ramdisk rootfs
if [ -f firmware.list ]; then
while read line; do

line=${line%%#*} # strip comments
test -z "$line" && continue

echo -n " $line"
c 2 cp $distloc/etc/firmware/$line $tmpmntdir/etc/firmware
done < firmware.list
else
echo -n " (no firmware.list found for ramdisk firmware copy)"
fi

echo

Expand Down

0 comments on commit 5674382

Please sign in to comment.