Quick and Dirty Guide to BFU'ing (Installing binary OpenSolaris Builds to system) Version 0.1 Fri Oct 28 11:27:12 EDT 2005 Written by: Omer Faruk Sen < ofsen __AT_ enderunix.org> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Every 2 weeks opensolaris releases new Builds which you can see directly on opensolaris.org website's Announcement section (For example Build 25 is available). To have these changes on your installed OpenSolaris you should use BFU system. First download things that are needed: -) http://www.genunix.org/mirror/SUNWonbld-20051021.i386.tar.bz2 -) http://www.genunix.org/mirror/opensolaris-bfu-20051021.i386.tar.bz2 First archive contains Solaris package of bfu which gets installed to /opt/onbld Second archive contains BFU archive itself BFU: Blindingly Fast Update or Bonwick/Faulkner Update (or sometimes called as Big F* Update) which is a set of cpio archives that directly installs contents of cpio to / without UPDATING package database. So it will break pkg environment and you can't and shouldn't use patch* or pkg* commands because you get LOTS of mismatched md5sums Now let's start: 1) bzip2 -dc opensolaris-bfu-20051021.i386.tar.bz2 | tar xf - 2) bzip2 -cd SUNWonbld-20051021.i386.tar.bz2 |tar -xf - 3) cd onbld/ 4) pkgadd -d . SUNWonbld (This package installs to /opt/onbld) 5) export PATH="/opt/onbld/bin:/opt/onbld/bin/`uname -p`:$PATH" (Do this with bash shell) /opt/onbld/bin contains scripts 6) which bfu (Be sure that you have done things right) 7) cd /buildsrc/archives-20051021 (which is the extraction output of opensolaris-bfu) 8) cd /buildsrc/archives-20051021/i386 9) ls -l ----------------------------------- BFU's---------------------- -bash-3.00# ls -l total 472534 -rw-rw-r-- 1 144780 staff 59707 Oct 15 05:20 conflict_resolution.gz -rw-rw-r-- 1 144780 staff 60220952 Oct 15 05:20 generic.kernel -rw-rw-r-- 1 144780 staff 19950280 Oct 15 05:20 generic.lib -rw-rw-r-- 1 144780 staff 2054056 Oct 15 05:20 generic.root -rw-rw-r-- 1 144780 staff 916480 Oct 15 05:20 generic.sbin -rw-rw-r-- 1 144780 staff 153202932 Oct 15 05:20 generic.usr -rw-rw-r-- 1 144780 staff 1259520 Oct 15 05:20 i86pc.boot -rw-rw-r-- 1 144780 staff 3809280 Oct 15 05:20 i86pc.root -rw-rw-r-- 1 144780 staff 245760 Oct 15 05:20 i86pc.usr -------------------------------- END OF BFU's--------------------- 10) bfu /buildsrc/archives-20051021/i386 Copying /opt/onbld/bin/bfu to /tmp/bfu.670 Executing /tmp/bfu.670 /buildsrc/archives-20051021/i386 Loading /buildsrc/archives-20051021/i386 on / Creating bfu execution environment ... /tmp/bfu.670[2150]: /net/onnv.eng/export/gate/public/bin/i386: not found cp: cannot access /net/onnv.eng/export/gate/public/bin/i386/fastfs cannot copy /net/onnv.eng/export/gate/public/bin/i386/fastfs 11) export FASTFS="/opt/onbld/bin/i386/fastfs" 12) export GZIPBIN="/usr/bin/gzip" 13) export BFULD="/opt/onbld/bin/`uname -p`/bfuld" 14) bfu /buildsrc/archives-20051021/i386 -bash-3.00# bfu /buildsrc/archives-20051021/i386 Copying /opt/onbld/bin/bfu to /tmp/bfu.2353 Executing /tmp/bfu.2353 /buildsrc/archives-20051021/i386 Loading /buildsrc/archives-20051021/i386 on / Creating bfu execution environment ... /tmp/bfu.2353[2318]: /net/onnv.eng/export/gate/public/bin/acr: cannot open chmod: WARNING: can't access /tmp/bfubin/acr Verifying archives ... Performing basic sanity checks ... /etc/svc/repository.db: passed integrity check Disabling kernel module unloading ... moddebug: 0 = 0x 20000 Quiescing init ... Unmounting /lib/libc.so.1 ... Disabling sendmail temporarily ... Disabling remote logins ... Disabling syslog temporarily ... Killing httpd ... Disabling fmd temporarily ... Killing nscd ... Turning on delayed i/o ... Filesystem Mode / safe /usr safe 2452 blocks Saving configuration files in /bfu.child ... 4592 blocks Removing init.d links ... done. Removing obsolete rc.d scripts ... done. Preserving user-installed perl modules... cp: cannot access /usr/perl5/site_perl/5.8.3/* Removing perl 5.8.3 packages Removing perl 5.8.3 from /var/sadm/install/contents Removing perl 5.8.3 from /usr/perl5 Extracting ufs modules for boot block ... 480 blocks Extracting generic.usr ... Extracting i86pc.usr ... 480 blocks Extracting generic.lib ... 38966 blocks Extracting generic.sbin ... 1790 blocks Extracting generic.kernel ... 117620 blocks Extracting generic.root ... 4012 blocks Extracting i86pc.root ... 7440 blocks Extracting i86pc.boot ... 2460 blocks Removing duplicate kernel binaries ... Simulating SUNWcry* installation... Cleaning up old Kerberos GSS-API mechanisms... Restoring configuration files. NEW conflict: boot/grub/menu.lst NEW conflict: boot/solaris/bootenv.rc restore: boot/solaris/devicedb/master update: etc/crypto/kcf.conf update: etc/crypto/pkcs11.conf .......... preserve: kernel/misc/amd64/sysinit preserve: kernel/misc/sysinit preserve: var/adm/utmpx preserve: var/adm/wtmpx preserve: var/log/syslog preserve: var/saf/zsmon/log restore: var/spool/cron/crontabs/root Create /platform/i86pc/boot_archive updating /platform/i86pc/boot_archive...this may take a minute For each file in conflict, your version has been restored. The new versions are under /bfu.conflicts. MAKE SURE YOU RESOLVE ALL CONFLICTS BEFORE REBOOTING. To install resolved changes required for reboot in the boot archive, invoke 'bootadm update-archive' Removing obsolete smf services ... Disabling unneeded inetd.conf entries ... Connecting platform and name service profiles ... Marking converted services as enabled ... cp: cannot access /net/greenline.eng/meta0/smf/post-5090532/sysidtool.xml bfu: could not copy /net/greenline.eng/meta0/smf/post-5090532/kdmconfig.xml Upgrade of pdp.faruk.net took 2:37. Turning off delayed i/o and syncing filesystems ... Filesystem Mode / safe /usr safe Entering post-bfu protected environment (shell: ksh). Edit configuration files as necessary, then reboot. bfu# 15) Should run ``automotic conflict resolution, acr '' before install (Something like mergemaster in FreeBSD) As you scroll up to the output of bfu you can see lots of conflict 16) bfu# pwd /bfu.conflicts bfu# acr ksh: acr: not found bfu# /opt/onbld/bin/acr Getting conflict resolution information from /buildsrc/archives-20051021/i386/conflict_resolution.gz: 590 blocks Building command list for the class action scripts: Begin processing files PROCESSING etc/driver_classes PROCESSING etc/name_to_major PROCESSING etc/path_to_inst PROCESSING etc/shadow PROCESSING etc/vold.conf PROCESSING etc/rmmount.conf PROCESSING etc/inet/hosts PROCESSING etc/inet/ipnodes PROCESSING etc/passwd PROCESSING etc/default/init PROCESSING etc/remote PROCESSING etc/nsswitch.conf PROCESSING etc/security/auth_attr PROCESSING etc/security/exec_attr PROCESSING etc/security/prof_attr PROCESSING etc/user_attr PROCESSING etc/vfstab PROCESSING boot/grub/menu.lst PROCESSING etc/default/nfs PROCESSING etc/openwin/server/etc/OWconfig PROCESSING boot/solaris/bootenv.rc PROCESSING etc/ssh/sshd_config PROCESSING etc/ssh/ssh_config See /tmp/acr.CpayZj/allresults for more information. NOTE: In /tmp/acr.CpayZj/allresults all RETURN CODE's should be 0 NOTE2: In / 3 BFU related directory generated -) /bfu.child (Things that are backed up before install) -) /bfu.parent (Things to install by BFU) -) /bfu.conflicts (Contains conflicts) Important Note: You should NOT do backward BFU 17) bfu# reboot ( You should run reboot or shutdown, not init...) BFU installs debug version of the tools and programs and kernel 18) Upon reboot you should see bfu'ed word in Message of the Day (MOTD) Something like that: Sun Microsystems Inc. SunOS 5.11 opensol-20051021 Oct. 14, 2005 SunOS Internal Development: stevel 2005-10-14 [tonic-split] bfu'ed from /buildsrc/archives-20051021/i386 on 2005-10-28 What if BFU breaks something? It is better to record output of /tmp/acr.CpayZj/allresults file somewhere else so you can see which files changed and results system boot failure Let's Start: 1) To simulate a break edit /etc/name_to_major and comment out line that start with ata and reboot 2) Now after breakage we should boot into failsafe mode in GRUB menu 3) After entering recovery environment. This recovery mode is different from single user mode. Because you enter to a ramfs. Your root file system becomes not your rootfs (/ partition on hd)that is installed on harddrive but a ramfs.It is weird that recovery mode directly enters to shell no login prompt. 4) After having a shell (# prompt) do: # mount /dev/dsk/c1d0s0 /a # cd /a # export TERM=sun # vi /etc/name_to_major # bootadm update-archive - # bootadm update-archive -R /a (This command updates /a/platform/i86pc/boot_archive) # reboot There are things that you may or sometimes should read: - Release Notes ( http://www.opensolaris.org/os/downloads/relnotes-20051021.txt) - Developer's Reference ( http://www.opensolaris.org/os/community/onnv/devref_toc) References: This paper is based on OpenSolaris Santa Clara User Group meeting held on June 2005 which was given by Keith Wesolowski and Mike Kupfer. Video of this meeting can be found http://www.genunix.org/osug/video/OSUG-June.avi