Build FreeBSD

Hi
I'm trying to rebuild my operating system using make. According to the handbook manual I've made a list named make.conf under /etc which contains:

Code:
WITHOUT_BLUETOOTH="YES"
WITHOUT_EXAMPLES="YES"
WITHOUT_FLOPPY="YES"
WITHOUT_GAMES="YES"
WITHOUT_MAN="YES"
WITHOUT_MAN_UTILS="YES"
WITHOUT_SHAREDOCS="YES"
WITHOUT_WIRELESS="YES"
WITHOUT_WIRELESS_SUPPORT="YES"
WITHOUT_AT="YES"
WITHOUT_CALENDAR="YES"
WITHOUT_INFO="YES"
WITHOUT_LOCALES="YES"
WITHOUT_ZFS="YES"
WITHOUT_BSD_CPIO="YES"
WITHOUT_CTM="YES"
WITHOUT_DICT="YES"
WITHOUT_GDB="YES"
WITHOUT_GNU="YES"
WITHOUT_GROFF="YES"
WITHOUT_HTML="YES"
WITHOU_INFO="YES"
WITHOUT_LPR="YES"
WITHOUT_MAIL="YES"
WITHOUT_PORTSNAP="YES"
WITHOUT_QUOTAS="YES"
WITHOUT_RCS="YES"
WITHOUT_SYSINSTALL="YES"
WITHOUT_BIND="YES"
WITHOUT_BIND_XML="YES"
WITHOUT_BIND_IDN="YES"
WITHOUT_BIND_SIGCHASE="YES"
WITHOUT_BIND_LARGE_FILE="YES"
WITHOUT_FREEBSD_UPDATE="YES"
WITHOUT_RESCUE="YES"
I expect to trim e.g. man pages after make buildworld and make installworld, but man pages still remain. What should I do? Am I missing something?
 
Install world installs all the new bits you just compiled, but doesn't remove anything. You need to run make delete-old to remove all the old stuff you are no longer building. And the make delete-old-libs to remove all the old libraries you are no longer building.

Note: you really should put all those settings into /etc/src.conf…
 
Also, after issuing # make delete-old-libs some of your ports may stop working, so you'll have to recompile them -- see handbook. Especially WITHOUT_MAN_UTILS might break some things, because most ports use them to build their own manpages.
 
phoenix said:
Install world installs all the new bits you just compiled, but doesn't remove anything. You need to run make delete-old to remove all the old stuff you are no longer building. And the make delete-old-libs to remove all the old libraries you are no longer building.

Here's what I do:
Code:
#make buildkernel KERNCONF=MYKERN
#make installkernel KERNCONF=MYKERN
#make buildworld
#make delete-old
#make delete-old-lib
#make installworld

Note: you really should put all those settings into /etc/src.conf…
And I did so. But changes I expect do not affect. Still I have e.g. man pages sysinstall ...
 
It's better to say that e.g. man command still remains but executing man src.conf causes this:
Code:
eval: tbl: not found
eval: groff: not found
And there's no calendar command anymore as I expected but it's directory remains: /usr/share/calendar
I also expect no shared documents
Code:
WITHOUT_SHAREDDOCS="YES"
but as I said this directory still remains.
 
Here's what I do:
Code:
#make buildkernel KERNCONF=MYKERN
#make installkernel KERNCONF=MYKERN
#make buildworld
#make delete-old
#make delete-old-lib
#make installworld

Hello @j4ck.

I think you're doing it in the wrong order. The correct way to rebuilding the FreeBSD is:

make buildworld
make buildkernel
make installkernel
make installworld
make check-old
make delete-old
make delete-old-libs

Build the new compiler first, then build the kernel with that new compiler (the old compiler may have bug and can't build the new kernel). Also, install the kernel before the world and then delete old files and libraries.

If you want to customize FreeBSD and build your own OS, why not installing the kernel and world in an alternate DESTDIR? Please see build(7).

For example:
make DESTDIR=/root/myos/workdir installkernel
make DESTDIR=/root/myos/workdir installworld
 
Last edited by a moderator:
If you want to customize FreeBSD and build your own OS, why not installing the kernel and world in an alternate DESTDIR?
And what should I do with that DESTDIR? consider that I've installed kernel and world into that DESTDIR, how can I use this as the new OS?
 
You mean make a bootable iso image? I also found this script after googleing /usr/src/release/i386/mkisoimages.sh.
So, this will be what I do:
#cd /usr/src
#make buildworld
#make buildkernel
#make DESTDIR=/root/myos/workdir installkernel
#make DESTDIR=/root/myos/workdir installworld
#mkisofs -R -no-emul-boot -b boot/cdboot -o myos.iso /root/myos/workdir
or
#sh /usr/src/release/i386/mkisoimages.sh -b IMAGE_LABEL IMAGE_NAME BASE_BITS_DIR
 
These are almost same. That script also use mkisofs(8)(). If you want to use the way I just suggested, you should adjust the /etc/fstab manually. But that script will adjust the fstab file automatically for you. Also, there is something that I forgot to mention. You should run the make distribution command after make installworld. This command will install the /etc directory for you.

Here is an example of fstab file:

Code:
/dev/iso9660/[B]CDLABEL[/B]   /    cd9660    ro    0    0

Replace the CDLABEL with the name of your CDROM.

HTH

Edit:
Oh, sorry, that script use makefs(8)(), not mkisofs(8)(). But the procedure is almost same.
 
I did exact the same process, but when I try to install and try my new OS, I face this error:
Code:
Operating system not found
 
j4ck said:
I did exact the same process, but when I try to install and try my new OS, I face this error:
Code:
Operating system not found

This is often caused by not setting the active flag for the bootable slice on the disk when using MBR partitioning.
 
This thread makes my head hurt. You don't need to build a CD to rebuild your operating system. The Handbook shows the correct procedure, as does @bkouhi. Don't build a CD, just reboot and it will boot the new version.
 
Last edited by a moderator:
Sorry for misunderstanding. I thought you want to build another operating system based on FreeBSD. But, what exactly do you want to do? If you just want to rebuild (or upgrade) your FreeBSD system, you don't need to build a CDROM, and even you don't need to use another DESTDIR. You only need a CDROM if you want to build your own OS based on FreeBSD. For example a FreeBSD with some modifications and extra features and maybe without unwanted parts.

Sorry again.
 
bkouhi said:
Sorry for misunderstanding. I thought you want to build another operating system based on FreeBSD. But, what exactly do you want to do? If you just want to rebuild (or upgrade) your FreeBSD system, you don't need to build a CDROM, and even you don't need to use another DESTDIR. You only need a CDROM if you want to build your own OS based on FreeBSD. For example a FreeBSD with some modifications and extra features and maybe without unwanted parts.

Sorry again.

Of course you got exactly what I mean. I want to build my own release and have it on a CD or memory stick. You showed the correct way of doing so. Thanks for that.
 
Back
Top