svn commit: r268246 - head/tools/tools/nanobsd/rescue

Michael Reifenberger mr at FreeBSD.org
Fri Jul 4 09:29:45 UTC 2014


Author: mr
Date: Fri Jul  4 09:29:43 2014
New Revision: 268246
URL: http://svnweb.freebsd.org/changeset/base/268246

Log:
  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

Added:
  head/tools/tools/nanobsd/rescue/R32   (contents, props changed)
  head/tools/tools/nanobsd/rescue/R64   (contents, props changed)
Modified:
  head/tools/tools/nanobsd/rescue/build.sh
  head/tools/tools/nanobsd/rescue/common
  head/tools/tools/nanobsd/rescue/merge.sh
  head/tools/tools/nanobsd/rescue/rescue_amd64.conf
  head/tools/tools/nanobsd/rescue/rescue_i386.conf

Added: head/tools/tools/nanobsd/rescue/R32
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/tools/nanobsd/rescue/R32	Fri Jul  4 09:29:43 2014	(r268246)
@@ -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

Added: head/tools/tools/nanobsd/rescue/R64
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/tools/nanobsd/rescue/R64	Fri Jul  4 09:29:43 2014	(r268246)
@@ -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

Modified: head/tools/tools/nanobsd/rescue/build.sh
==============================================================================
--- head/tools/tools/nanobsd/rescue/build.sh	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/build.sh	Fri Jul  4 09:29:43 2014	(r268246)
@@ -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

Modified: head/tools/tools/nanobsd/rescue/common
==============================================================================
--- head/tools/tools/nanobsd/rescue/common	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/common	Fri Jul  4 09:29:43 2014	(r268246)
@@ -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/
 	)
 )
 

Modified: head/tools/tools/nanobsd/rescue/merge.sh
==============================================================================
--- head/tools/tools/nanobsd/rescue/merge.sh	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/merge.sh	Fri Jul  4 09:29:43 2014	(r268246)
@@ -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"
+
+if [ \! -d "$MNT" ]; then
+  mkdir "$MNT"
+fi
 
-dd if=${D2}/_.disk.image of=/dev/${MD}s2 bs=128k
+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}

Modified: head/tools/tools/nanobsd/rescue/rescue_amd64.conf
==============================================================================
--- head/tools/tools/nanobsd/rescue/rescue_amd64.conf	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/rescue_amd64.conf	Fri Jul  4 09:29:43 2014	(r268246)
@@ -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

Modified: head/tools/tools/nanobsd/rescue/rescue_i386.conf
==============================================================================
--- head/tools/tools/nanobsd/rescue/rescue_i386.conf	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/rescue_i386.conf	Fri Jul  4 09:29:43 2014	(r268246)
@@ -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


More information about the svn-src-head mailing list