Adopt to current and other changes:

use dedicated kernel files with some local settings
	use mkimg for ISO building
	put images into separate directory and rename them for better consistency
This commit is contained in:
Michael Reifenberger 2014-07-04 09:29:43 +00:00
parent b5bb953863
commit 7aca2eedc8
7 changed files with 77 additions and 14 deletions

View File

@ -0,0 +1,14 @@
#
# R32 -- Generic kernel configuration file with modifications for rescue.
#
# $FreeBSD$
include GENERIC
ident R32
nooptions INVARIANTS
nooptions INVARIANT_SUPPORT
nooptions WITNESS
nooptions WITNESS_SKIPSPIN
nooptions MALLOC_DEBUG_MAXZONES

View File

@ -0,0 +1,14 @@
#
# R64 -- Generic kernel configuration file with modifications for rescue.
#
# $FreeBSD$
include GENERIC
ident R64
nooptions INVARIANTS
nooptions INVARIANT_SUPPORT
nooptions WITNESS
nooptions WITNESS_SKIPSPIN
nooptions MALLOC_DEBUG_MAXZONES

View File

@ -3,6 +3,8 @@
# $FreeBSD$
#
today=`date '+%Y%m%d'`
if [ -z "${1}" -o \! -f "${1}" ]; then
echo "Usage: $0 cfg_file [-bhiknw]"
echo "-i : skip image build"
@ -15,4 +17,26 @@ fi
CFG="${1}"
shift;
if [ \! -d /usr/obj/Rescue ]; then
mkdir -p /usr/obj/Rescue
fi
sh ../nanobsd.sh $* -c ${CFG}
F32="/usr/obj/Rescue/rescue_${today}_x32"
D32="/usr/obj/nanobsd.rescue_i386"
if [ -f "${D32}/_.disk.full" ]; then
mv "${D32}/_.disk.full" "${F32}.img"
fi
if [ -f "${D32}/_.disk.iso" ]; then
mv "${D32}/_.disk.iso" "${F32}.iso"
fi
F64="/usr/obj/Rescue/rescue_${today}_x64"
D64="/usr/obj/nanobsd.rescue_amd64"
if [ -f "${D64}/_.disk.full" ]; then
mv "${D64}/_.disk.full" "${F64}.img"
fi
if [ -f "${D64}/_.disk.iso" ]; then
mv "${D64}/_.disk.iso" "${F64}.iso"
fi

View File

@ -3,7 +3,7 @@
#
NANO_TOOLS=`pwd`
NANO_PACKAGE_DIR=`pwd`/Pkg
NANO_RAM_TMPVARSIZE=20480
NANO_RAM_TMPVARSIZE=40960
NANO_PMAKE="make -j 8"
NANO_LABEL="rescue"
NANO_RAM_TMPVARSIZE=40960
@ -68,6 +68,7 @@ cust_etc_cfg () (
echo "#ifconfig_fxp0=\"AUTO\"" >> etc/rc.conf
echo "#sshd_enable=\"YES\"" >> etc/rc.conf
echo "/dev/ufs/${NANO_LABEL}s1a / ufs ro,noatime 0 0" > etc/fstab
echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab
echo "tmpfs /boot/zfs tmpfs rw,size=1048576,mode=777 0 0" >> etc/fstab
echo "ports:/usr/ports /usr/ports nfs rw,noauto,noatime,bg,soft,intr,nfsv3 0 0" >> etc/fstab
# echo "/dev/ad1s1a /scratch ufs rw,noauto,noatime 0 0" >> etc/fstab
@ -100,9 +101,9 @@ last_orders () (
touch conf/default/etc/.keepme
touch conf/default/var/.keepme
cd ..
mkisofs -quiet -r -J -no-emul-boot \
-V ${NANO_LABEL} \
-b boot/cdboot -o _.disk.iso _.w/
makefs -t cd9660 -o rockridge \
-o label="${NANO_LABEL}" -o publisher="RMX" \
-o bootimage="i386;_.w/boot/cdboot" -o no-emul-boot _.disk.iso _.w/
)
)

View File

@ -1,18 +1,28 @@
#!/bin/sh
# $FreeBSD$
D1="/usr/obj/nanobsd.rescue_i386"
D2="/usr/obj/nanobsd.rescue_amd64"
today=`date '+%Y%m%d'`
MD=`mdconfig -a -t vnode -f ${D1}/_.disk.full`
I32="/usr/obj/Rescue/rescue_${today}_x32.img"
I64="/usr/obj/Rescue/rescue_${today}_x64.img"
IAL="/usr/obj/Rescue/rescue_${today}_xal.img"
D64="/usr/obj/nanobsd.rescue_amd64"
MNT="/usr/obj/Rescue/_mnt"
dd if=${D2}/_.disk.image of=/dev/${MD}s2 bs=128k
if [ \! -d "$MNT" ]; then
mkdir "$MNT"
fi
dd if=${I32} of=${IAL} bs=128k
MD=`mdconfig -a -t vnode -f ${IAL}`
dd if=${D64}/_.disk.image of=/dev/${MD}s2 bs=128k
tunefs -L rescues2a /dev/${MD}s2a
mount /dev/${MD}s2a ${D1}/_.mnt
mount /dev/${MD}s2a ${MNT}
sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/conf/base/etc/fstab
sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/etc/fstab
sed -i "" -e 's/rescues1/rescues2/' ${MNT}/conf/base/etc/fstab
sed -i "" -e 's/rescues1/rescues2/' ${MNT}/etc/fstab
umount ${D1}/_.mnt
umount ${MNT}
mdconfig -d -u ${MD}

View File

@ -1,7 +1,7 @@
#
# $FreeBSD$
#
NANO_KERNEL=GENERIC
NANO_KERNEL=R64
NANO_ARCH=amd64
TARGET_ARCH=amd64; export TARGET_ARCH
#TARGET_CPUTYPE=amd64; export TARGET_CPUTYPE

View File

@ -1,7 +1,7 @@
#
# $FreeBSD$
#
NANO_KERNEL=GENERIC
NANO_KERNEL=R32
NANO_ARCH=i386
TARGET_ARCH=i386; export TARGET_ARCH
#TARGET_CPUTYPE=i386; export TARGET_CPUTYPE