Skip to content

Commit

Permalink
20120521 release:
Browse files Browse the repository at this point in the history
Update to latest elfrdsetroot (from OpenBSD 5.1) which allows for cfgflashrd of i386 images on amd64 workstation (and vice versa).
Always use in-kernel disk geometry for real disks in growimg, otherwise the kernel will complain if growimg supplies a geometry different than detected.
  • Loading branch information
yellowman committed Jun 2, 2012
1 parent cf3e1b0 commit d8defd0
Show file tree
Hide file tree
Showing 10 changed files with 470 additions and 141 deletions.
20 changes: 7 additions & 13 deletions cfgflashrd
Expand Up @@ -118,7 +118,7 @@ if [ -z "$dest" -a -z "$novnd" ]; then
or, use -image to configure a disk image
use -rdroot flag if you have an rdrootfs image and want to change disk parameters on it
use -com0 flag if you want to direct console from vga to com0 at "speed" speed
use -mp to set bsd.mp as primary kernel, if exists (shifting bsd to bsd.sp)
use -mp to set bsd.mp as primary kernel, if exists
use -tz to copy /usr/share/zoneinfo/"tzfile" to destination image /etc/localtime
EOF
exit 1
Expand Down Expand Up @@ -153,20 +153,20 @@ if [ ! -z "$rdfs" ]; then
#
# if user wants to modify kernel ramdisk, ready elfrdsetroot, mount vnd, change stand/rc, elfrdsetroot actual kernels

if [ -z "$elfrdsetroot" ]; then
elfrdsetroot=./elfrdsetroot.c
if [ -z "$elfrdsetrootdir" ]; then
elfrdsetrootdir=./elfrdsetroot/
fi

if [ ! -f $elfrdsetroot ]; then
echo % $elfrdsetroot not found
if [ ! -d $elfrdsetrootdir ]; then
echo % $elfrdsetrootdir not found
2; 1; 0;
fi

###
#
# compile ELFRDSETROOT

c 2 cc -o ./elfrdsetroot $elfrdsetroot
c 2 cc -o $elfrdsetrootdir/elfrdsetroot $elfrdsetrootdir/elfrdsetroot.c $elfrdsetrootdir/elf32.c $elfrdsetrootdir/elf64.c

c 2 vnconfig $device $rdfs

Expand Down Expand Up @@ -203,16 +203,10 @@ if [ ! -z "$rdfs" ]; then
c 2 vnconfig -u $device

echo Setting ramdisk root image
elfrdarch=`file ./elfrdsetroot | awk -F, ' { print $2 } '`

for i in bsd bsd.mp bsd.sp; do
if [ -f $tmpmnt/$i ]; then
bsdarch=`file $tmpmnt/$i | awk -F, ' { print $2 } '`
if [ "$bsdarch" != "$elfrdarch" ]; then
echo "% elfrdsetroot architecture mismatch (kernel $bsdarch, but elfrdsetroot is $elfrdarch)"
2; 1; 0;
fi
c 2 ./elfrdsetroot $tmpmnt/$i $rdfs
c 2 $elfrdsetrootdir/elfrdsetroot $tmpmnt/$i $rdfs
cfgbsd=1
fi
done
Expand Down
2 changes: 2 additions & 0 deletions elfrdsetroot/elf32.c
@@ -0,0 +1,2 @@
#define ELFSIZE 32
#include "elfrd_size.c"
2 changes: 2 additions & 0 deletions elfrdsetroot/elf64.c
@@ -0,0 +1,2 @@
#define ELFSIZE 64
#include "elfrd_size.c"

0 comments on commit d8defd0

Please sign in to comment.