Re: Own Install CD with custom kernel

2007-10-05 Thread Matthias Fechner
Hello Ulrich,

* Ulrich Spoerlein [EMAIL PROTECTED] [25-09-07 18:27]:
 [...]
 install.cfg, take a look at
 /usr/src/usr.sbin/sysinstall/install.cfg

thx a lot for your emails I was now able to generate the CD so it does
exactly what i want.

Best regards,
Matthias

-- 

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning. --
Rich Cook
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Own Install CD with custom kernel

2007-09-25 Thread Ulrich Spoerlein
On 9/25/07, Matthias Fechner [EMAIL PROTECTED] wrote:
 thx a lot for your really great answer, but I have some more short
 questions. :)
 Do you copy the release target to the Makefile in
 /usr/src/release/Makefile or do you execute from another place?

Since we need to be able to reproduce our releases, we use the chroot
facility and build those releases in their very own directory. That
way we can also easily use a custom make.conf, especially for the
package building (which are built in that same chroot).

So, with the variables as defined below, I first run the 'init'
target, which sets up the chroot environment

init:
mkdir -p ${TLR}/usr ${TLR}/etc ${TLR}/usr/ports/local
mkdir -p ${TFR}/packages ${TFR}/distfiles
${TLR}/usr/ports/packages ${TLR}/usr/ports/distfiles
cd ${TLR}/usr  ${CVS} co -r ${SRCBRANCH} ${SRCDATE} src
cd ${TLR}/usr/src  make -j4 buildworld DESTDIR=${TLR}
cd ${TLR}/usr/src  make installworld DESTDIR=${TLR}
cd ${TLR}/usr/src  make distribution DESTDIR=${TLR}
cd ${TLR}/usr  ${CVS} co ${PORTSDATE} ports
cp -pr ports/* ${TLR}/usr/ports/local

then 'release' is run as given in my previous mail. After that, the
'packages' target does a lot of voodoo and then loops over a make
variable which contains all the packages we are interested in and
builds them. It is kind of messy, though as we have local patches
which are to be applied to the cvs checkout. Makeing this step
idempotent is ... interesting.

  rm -f ${TLR}/usr/src/release/.install.cfg
  [...]
  cd ${TRR}/R/ftp  find -d . | cpio --quiet -dumpl ${TFR}

 hm, cannot found the variables TLR and TRR anywhere defined. Can you
 please give me some more information how your buildprocess looks?

These are just arbitrary places where the stuff is located, they are defined as

# Build tree, needs LOTS of space ...
T=  /build
# Shortcuts
TLR=$T/live/${RELEASE}
TRR=$T/release/${RELEASE}
TFR=$T/ftproot/pub/FreeBSD/${RELEASE}


  And files/install.cfg contains the following

 where should I store that file?
 man release doesn't give here any information about it.

This is documented somewhere in sysinstall(8), I guess. You can place
it on a floppy (yeah, right). I put it in
${TLR}/usr/src/release/install.cfg as you saw from the example in my
previous mail and it should then make it into the ISO. How exactly
this works, I can't remember right now ... Ah, src/release/Makefile
contains under the release.8 target:
-test -f ${.CURDIR}/install.cfg \
 cp ${.CURDIR}/install.cfg ${RD}/mfsfd

So it ends up in the MFS from which FreeBSD installs itself.

  So basically, sysinstall is intructed to not install any kernel, but
  after all distributions are extracted the following commands are run
 
  command=/bin/sh -c cd /dist/${RELEASE}/kernels  ./install.sh GENERIC
  system
  command=/bin/sh -c cd /dist/${RELEASE}/kernels  ./install.sh SMP
  system

 where can you say sysinstall that it should run such commands after
 the installation?

install.cfg, take a look at
/usr/src/usr.sbin/sysinstall/install.cfg

hth,
Uli
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Own Install CD with custom kernel

2007-09-24 Thread Matthias Fechner
Hello Ulrich,

* Ulrich Spoerlein [EMAIL PROTECTED] [23-09-07 17:19]:
 I'm using a Makefile to drive our release and package building and for
 the releases I'm using an install.cfg, which gets created on the fly,
 since the names of the kernels change now and then, here is the release
 target

thx a lot for your really great answer, but I have some more short
questions. :)
Do you copy the release target to the Makefile in
/usr/src/release/Makefile or do you execute from another place?


 rm -f ${TLR}/usr/src/release/.install.cfg
 [...]
 cd ${TRR}/R/ftp  find -d . | cpio --quiet -dumpl ${TFR}

hm, cannot found the variables TLR and TRR anywhere defined. Can you
please give me some more information how your buildprocess looks?

 And files/install.cfg contains the following

where should I store that file?
man release doesn't give here any information about it.

 So basically, sysinstall is intructed to not install any kernel, but
 after all distributions are extracted the following commands are run
 
 command=/bin/sh -c cd /dist/${RELEASE}/kernels  ./install.sh GENERIC
 system
 command=/bin/sh -c cd /dist/${RELEASE}/kernels  ./install.sh SMP
 system

where can you say sysinstall that it should run such commands after
the installation?


Best regards,
Matthias

-- 

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning. --
Rich Cook
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Own Install CD with custom kernel

2007-09-23 Thread Ulrich Spoerlein
On Thu, 20.09.2007 at 09:32:56 +0200, Matthias Fechner wrote:
 It seems that sysinstall will not install per default the new kernel.
 For a non SMP system (like mine) it is I4B.
 So it seems to me that I must change /usr/src/usr.sbin/sysinstall to
 do this. I attached a patch to this email which should do it.
 
 [...]
 
 I checked now the the installed system and there is absolutly no kernel
 installed. (no /boot/GENERIC, no /boot/I4B or anything else)
 
 I'm sure that I must oversaw something in sysinstall to change but I
 cannot find it.
 Can please anyone provide with some help?

Hi,

we need to install multiple kernels per system and instead of relying on
sysinstall (I couldn't figure out, how to install multiple kernels with
it, especially since it wants to install the default kernel to 'kernel')
I hacked up my own kernel installation

I'm using a Makefile to drive our release and package building and for
the releases I'm using an install.cfg, which gets created on the fly,
since the names of the kernels change now and then, here is the release
target

KERNELS=SERVER GENERIC SMP

release rerelease:
# Write automation script for sysinstall
rm -f ${TLR}/usr/src/release/.install.cfg
for k in ${KERNELS}; do printf %s\n%s\n command=/bin/sh -c \cd 
/dist/${RELEASE}/kernels  ./install.sh $$k\ system \
 ${TLR}/usr/src/release/.install.cfg; done
sed '/^#KERNELS#/r ${TLR}/usr/src/release/.install.cfg' 
files/install.cfg  ${TLR}/usr/src/release/install.cfg
cp files/src.diff ${TLR}/usr/src/release/src.diff
# Create a src patch for our kernels on the fly, so we can pass it to make 
release
(for i in ${KERNELS}; do diff -u /dev/null kernels/$$i 2/dev/null || 
true; done) | sed 's,kernels/,sys/i386/conf/,' \
 ${TLR}/usr/src/release/kernels.diff
# Copy them over again for rerelease, perhaps something changed
.if make(rerelease)
.for k in ${KERNELS}
-cp kernels/$k ${TRR}/usr/src/sys/i386/conf/
.endfor
.endif
cd ${TLR}/usr/src/release  make ${.TARGET} \
BUILDNAME=${RELEASE} \
CHROOTDIR=${TRR} \
WORLD_FLAGS=-j4 \
MODULES_WITH_WORLD=yes \
WITHOUT_MODULES='3dfx 3dfx_linux ath ath_hal ath_rate_amrr 
ath_rate_onoe ath_rate_sample aue\
bktr cardbus coda coda5 dcons dcons_crom fatm 
firewire firmware harp hatm \
if_ndis ip6fw ipw iwi joy kue ndis pccard ral 
splash syscons umodem ural urio\
uscanner utopia uvisor wi wlan wlan_acl 
wlan_ccmp wlan_tkip wlan_wep wlan_xauth' \
KERNEL_FLAGS=-j4 MODULES_WITH_WORLD=yes \
KERNELS_BASE=''\
NODOC=YES NOPORTS=YES NOSRC=YES NO_FLOPPIES=YES \
RELEASENOUPDATE=YES \ 
LOCAL_PATCHES='src.diff kernels.diff' \
KERNELS='${KERNELS}' \
CVSROOT=${CVSROOT} \ 
CVSCMDARGS='${SRCDATE}' \
RELEASETAG=${SRCBRANCH} 
cd ${TRR}/R/ftp  find -d . | cpio --quiet -dumpl ${TFR}

And files/install.cfg contains the following

debug=yes
mediaSetCDROM
# Select which distributions we want. We omit the kernels here, we do them by 
hand
dists= base doc manpages games catpages dict info
distSetCustom

# Partition Editor
diskInteractive=YES
bootManager=standard
diskPartitionEditor
diskLabelEditor

installCommit

# Magic marker, don't edit! Is set automatically from the Makefile!
#KERNELS#
# End of magic marker

So basically, sysinstall is intructed to not install any kernel, but
after all distributions are extracted the following commands are run

command=/bin/sh -c cd /dist/${RELEASE}/kernels  ./install.sh GENERIC
system
command=/bin/sh -c cd /dist/${RELEASE}/kernels  ./install.sh SMP
system

It has the nice side effekt of GENERIC and SMP landing in
/boot/{GENERIC,SMP}

We also ship a /boot/loader.conf that sets the correct kernel to boot
and is versioned and centrally controlled, yadda yadda yadda

hth,
Ulrich Spoerlein
-- 
It is better to remain silent and be thought a fool,
than to speak, and remove all doubt.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Own Install CD with custom kernel

2007-09-20 Thread Matthias Fechner
Hi,

I'm new to that list and I hope it is the right own to rise my question :)

I'm working currently on a custom FreeBSD install CD with included I4B.
But I have my problems and every try takes about 8 hours to rebuild
the CDs again so hopefully I'll get some help here to speed it up a
little :)

What I did:
Prepared my environment like (checkout cvs, copy files, created patch
etc. - default FreeBSD CDs builds fine)

It seems that sysinstall will not install per default the new kernel.
For a non SMP system (like mine) it is I4B.
So it seems to me that I must change /usr/src/usr.sbin/sysinstall to
do this. I attached a patch to this email which should do it.

cd /usr/src/release
make release CHROOTDIR=/home/storage/ownfreebsd BUILDNAME=FreeBSD-I4B \
CVSROOT=/home/storage/ncvs RELEASETAG=RELENG_6 MAKE_ISOS=1 \
KERNEL_FLAGS=-j4 WORLD_FLAGS=-j4 \
LOCAL_PATCHES=/root/patch.diff PATCH_FLAGS=-p1 \
KERNELS=I4B I4BSMP GENERIC SMP |tee /root/build.log

Then I execute the make release command and some hours later I got all
the ISOs I need to install my new system.

Ok so far so good. Now I booted with the new created ISO and try to
install from it. I checked if the right kernel is select in the
distribution selection and yes that is fine.
But at the installation itself it seems that sysinstall is not copying
the kernel to the right place. I got the following message (debugging
messages in sysinstall are enabled):
DEBUG: installFixupKernel: Install I4B kernel
DEBUG: Executing command 'mv /boot/I4B /boot/kernel'
mv: rename /boot/I4B to /boot/kernel: No such file or directory
DEBUG: Command 'mv /boot/I4B /boot/kernel' ressturns status of 1

I checked now the the installed system and there is absolutly no kernel
installed. (no /boot/GENERIC, no /boot/I4B or anything else)

I'm sure that I must oversaw something in sysinstall to change but I
cannot find it.
Can please anyone provide with some help?

Thx a lot!

Best regards,
Matthias

-- 

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning. --
Rich Cook

diff -Nur src.orig/usr.sbin/sysinstall/Makefile src/usr.sbin/sysinstall/Makefile
--- src.orig/usr.sbin/sysinstall/Makefile	2006-03-11 19:52:47.0 +0100
+++ src/usr.sbin/sysinstall/Makefile	2007-09-05 07:38:50.0 +0200
@@ -50,6 +50,9 @@
 .if exists(${.CURDIR}/../../sys/${MACHINE}/conf/SMP)
 CFLAGS+=-DWITH_SMP	
 .endif
+.if exists(${.CURDIR}/../../sys/${MACHINE}/conf/I4B)
+CFLAGS+=-DWITH_I4B	
+.endif
 DPADD+=	${LIBDEVINFO}
 LDADD+=	-ldevinfo
 .endif
diff -Nur src.orig/usr.sbin/sysinstall/dist.c src/usr.sbin/sysinstall/dist.c
--- src.orig/usr.sbin/sysinstall/dist.c	2007-03-30 21:21:56.0 +0200
+++ src/usr.sbin/sysinstall/dist.c	2007-09-06 01:37:43.0 +0200
@@ -100,8 +100,16 @@
 static Distribution KernelDistTable[] = {
 DTE_TARBALL(GENERIC,  KernelDists, KERNEL_GENERIC, /boot),
 #ifdef WITH_SMP
+#ifdef WITH_I4B
+DTE_TARBALL(I4BSMP,   KernelDists, KERNEL_I4BSMP,  /boot),
+#else
 DTE_TARBALL(SMP, 	KernelDists, KERNEL_SMP,	  /boot),
 #endif
+#else
+#ifdef WITH_I4B
+DTE_TARBALL(I4B,  KernelDists, KERNEL_I4B, /boot),
+#endif
+#endif
 DTE_END,
 };
 
@@ -216,11 +224,19 @@
 selectKernel(void)
 {
 #ifdef WITH_SMP
+#ifdef WITH_I4B
+return DIST_KERNEL_I4B;
+#else
 /* select default kernel based on deduced cpu count */
 return NCpus  1 ? DIST_KERNEL_SMP : DIST_KERNEL_GENERIC;
+#endif
+#else
+#ifdef WITH_I4B
+return DIST_KERNEL_I4B;
 #else
 return DIST_KERNEL_GENERIC;
 #endif
+#endif
 }
 
 int
diff -Nur src.orig/usr.sbin/sysinstall/dist.h src/usr.sbin/sysinstall/dist.h
--- src.orig/usr.sbin/sysinstall/dist.h	2006-03-11 19:52:47.0 +0100
+++ src/usr.sbin/sysinstall/dist.h	2007-09-06 01:31:31.0 +0200
@@ -74,6 +74,8 @@
 /* Subtypes for KERNEL distribution */
 #define DIST_KERNEL_GENERIC	0x1
 #define DIST_KERNEL_SMP		0x2
+#define DIST_KERNEL_I4B		0x4
+#define DIST_KERNEL_I4BSMP	0x8
 #define DIST_KERNEL_ALL		0xF
 
 /* Canned distribution sets */
diff -Nur src.orig/usr.sbin/sysinstall/install.c src/usr.sbin/sysinstall/install.c
--- src.orig/usr.sbin/sysinstall/install.c	2006-12-31 19:34:58.0 +0100
+++ src/usr.sbin/sysinstall/install.c	2007-09-15 09:27:35.0 +0200
@@ -910,13 +910,30 @@
 	 * NB: we assume any existing kernel has been saved
 	 * already and the /boot/kernel we remove is empty.
 	 */
+	msgDebug(installFixupKernel: Remove /boot/kernel\n);
 	vsystem(rm -rf /boot/kernel);
-#if WITH_SMP
-	if (dists  DIST_KERNEL_SMP)
+
+	msgDebug(installFixupKernel: Checking for SMP and I4B\n);
+	if (dists  DIST_KERNEL_I4BSMP)
+	{
+		msgDebug(installFixupKernel: Install I4BSMP kernel\n);
+		vsystem(mv /boot/I4BSMP /boot/kernel);
+	}
+	else if (dists  DIST_KERNEL_SMP)
+	{
+		msgDebug(installFixupKernel: Install SMP kernel\n);
 		vsystem(mv /boot/SMP /boot/kernel);
+	}
+	else