diff --git a/tools/tools/nanobsd/rescue/R32 b/tools/tools/nanobsd/rescue/R32 new file mode 100644 index 000000000000..3c15ebee49e7 --- /dev/null +++ b/tools/tools/nanobsd/rescue/R32 @@ -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 diff --git a/tools/tools/nanobsd/rescue/R64 b/tools/tools/nanobsd/rescue/R64 new file mode 100644 index 000000000000..17900e2de081 --- /dev/null +++ b/tools/tools/nanobsd/rescue/R64 @@ -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 diff --git a/tools/tools/nanobsd/rescue/build.sh b/tools/tools/nanobsd/rescue/build.sh index 525b7ba38398..4c109ff96cbb 100755 --- a/tools/tools/nanobsd/rescue/build.sh +++ b/tools/tools/nanobsd/rescue/build.sh @@ -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 diff --git a/tools/tools/nanobsd/rescue/common b/tools/tools/nanobsd/rescue/common index d78a1caf560f..c43244079edb 100644 --- a/tools/tools/nanobsd/rescue/common +++ b/tools/tools/nanobsd/rescue/common @@ -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/ ) ) diff --git a/tools/tools/nanobsd/rescue/merge.sh b/tools/tools/nanobsd/rescue/merge.sh index 6761c94de4b7..afb66371fe3c 100755 --- a/tools/tools/nanobsd/rescue/merge.sh +++ b/tools/tools/nanobsd/rescue/merge.sh @@ -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} diff --git a/tools/tools/nanobsd/rescue/rescue_amd64.conf b/tools/tools/nanobsd/rescue/rescue_amd64.conf index 8a183ee1d9f9..a82325fd52c0 100644 --- a/tools/tools/nanobsd/rescue/rescue_amd64.conf +++ b/tools/tools/nanobsd/rescue/rescue_amd64.conf @@ -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 diff --git a/tools/tools/nanobsd/rescue/rescue_i386.conf b/tools/tools/nanobsd/rescue/rescue_i386.conf index 5e9145335494..97b51d49e21d 100644 --- a/tools/tools/nanobsd/rescue/rescue_i386.conf +++ b/tools/tools/nanobsd/rescue/rescue_i386.conf @@ -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