[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cdbr/cdboot not reading boot.conf
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: cdbr/cdboot not reading boot.conf
- From: Matt Van Mater <matt_(_dot_)_vanmater_(_at_)_gmail_(_dot_)_com>
- Date: Fri, 22 Apr 2005 12:05:32 -0400
- Reply-to: Matt Van Mater <matt_(_dot_)_vanmater_(_at_)_gmail_(_dot_)_com>
I'm playing around with making a iso of a bootable cd that should
automatically load a custom kernel, but cannot get the cdboot to read
the /etc/boot.conf file off of the cd. I'm not sure what I'm doing
wrong here, all the files seem to be in the proper places. The script
below creates an ISO, that when burned to a cd boots fine using
cdbr/cdboot and I can manually load my custom kernel just fine from
the boot> prompt.
The important part of the script is at the very end where I create the
cd layout and then the ISO. Most of it is really simple and obvious
so I think it should speak for itself. I have been testing it from an
unmodified 3.6-release box. (For the curious out there YAIFO is a
remotely accessable version of bsd.rd, check the misc and tech
archives). I know I can cheat and just rename yaifo.rd to bsd.rd and
be done with it, but I'd like to know what I'm doing wrong that makes
the boot.conf get ignored. I threw an echo line at the top of
boot.conf to see if it's even being read, and it doesn't seem to be
the case.
#!/bin/sh
#Based on the work found here: http://www.openbsd.de/~wbx/
echo Getting the yaifo code
ftp -a http://www.openbsd.de/~wbx/yaifo-0.1.tgz
echo Uncompressing it
tar zxf yaifo-0.1.tgz
cd yaifo
echo Now we have to manually edit the config to make it point at the
right DNS, gateway, etc
echo Enter DNS
read DNS_
echo Enter IP address
read IP_
echo Enter netmask
read NETMASK_
echo Enter gateway
read GATEWAY_
echo Enter a short name for this configuration with no spaces in it
read CFG_NAME
echo Do you want to fetch the src files? y or n
read GET_SRC
#values currently in config file, need to replace them below
#DHCP=on
#DNS=192.168.2.1
#IP=
#NETMASK=255.255.255.255
#GATEWAY=10.255.255.1
sed s/DHCP=on/DHCP=off/g config > config.1
sed s/DNS=192.168.2.1/DNS=$DNS_/g config.1 > config.2
sed s/IP=/IP=$IP_/g config.2 > config.3
sed s/NETMASK=255.255.255.255/NETMASK=$NETMASK_/g config.3 > config.4
sed s/GATEWAY=10.255.255.1/GATEWAY=$GATEWAY_/g config.4 > config.5
mv config.5 config
rm config.*
echo Generating SSH key.
echo Just press enter 3 times '(store key in default location, and
give blank password)'
ssh-keygen -t rsa
cp ~/.ssh/id_rsa.pub authorized_keys
if [ $GET_SRC == "y" ]
then
export HERE=`pwd`
cd /usr/src
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/src.tar.gz
clear
echo Decompressing src
tar zxf src.tar.gz && rm src.tar.gz
ftp -a ftp://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/sys.tar.gz
clear
echo Decompressing sys
tar zxf sys.tar.gz && rm sys.tar.gz
cd $HERE
fi
make clean
make obj
make
clear
echo Making ISO
mkdir -p cd-dir/`uname -r`/`arch -s`
mkdir -p cd-dir/etc
echo "echo Welcome to the YAIFO remote installation CD" > cd-dir/etc/boot.conf
echo "set image /`uname -r`/`arch -s`/yaifo.rd" >> cd-dir/etc/boot.conf
cp yaifo.rd cd-dir/`uname -r`/`arch -s`/
cp /usr/mdec/cdb* cd-dir/`uname -r`/`arch -s`
mkhybrid -J -V $CFG_NAME -b `uname -r`/`arch -s`/cdbr -c `uname
-r`/`arch -s`/boot.catalog -o $CFG_NAME-yaifo.iso cd-dir/
Matt
Visit your host, monkey.org