Abstract
This post describes an example of how one can manually convert a FreeBSD installation into a PC-BSD one using the install disk. There are more elegant ways of doing it, such as pulling things from PC-BSDs SVN and compiling only PC-BSD specific components.
Disclaimers and warnings
This was done purely for ‘fun’ to see if the programs would work reasonably well. Which is why FreeBSD 7.0-Release was used as a base and PC-BSD 1.5.0 as the overlay (which is based on an old build of FreeBSD 6.3). I do not recommend, endorse, or even suggest actually doing something like this beyond exploratory or playful thoughts at heart !!!
If anyone actually tries this, your on your own.
If someone actually tries this they should probably use a PC-BSD 1.5.1 disk build, the files are newer.
Installing the PC-BSD v1.5.0-v1.5.1 update will install FreeBSD 6.3 files and may break your system — note that I didn’t enable the updater for my user account during this process.
Now that you are warned…
My test partition is reserved fro testing various alpha/beta/rc releases of operating systems I wish to test. So I wiped it clean and set out to install a basic working FreeBSD system.
I Installed FreeBSD 7.0-Release via CD-ROM, using the express option, auto
partitioning to save time, X-Developer dist set, and configured the system
lightly (set root pw, network services etc).
You want the X.org and related drivers from the disk, so they match your release level — you also want source code for later to build a custom kernel (optional)
Booted the system and logged in as root, one vtty for work and one for logging my notes in vim over ssh.
Then began converting the system to a FreeBSD-PC-BSD hybrid. Since the FreeBSD auto mode for partitioning the slice only gave me a 512mb / and 512mb /tmp, I created a /usr/work directory to use.
NOTE:
actual PC-BSD systems require several gigs of space for / to ensure safe updates and this is noted during previous upgrade notes. My guess after reading some of the 1.4/1.5 scripts is the developers have ‘yet’ to figure out how to use mount -a for mounting the needed file systems before extracting files and reserved storage places with the default partitioning scheme
pkg_add -r lzma && rehash # to unpack pc-bsd files
mount -t cd9690 /dev/acd0 /mnt # mount pc-bsd disk 1
mkdir -m 0700 /usr/work
lzma d /mnt/PCBSD.tar.lzma /usr/work/PCBSD.tar
...
# lzma has fast decompression speeds but
# this is a ~451mb lzma file being
# unpacked into a 1.9gb tar file!
tar -C / -kpf /usr/work/PCBSD.tar # extract files without overwrite
cp /etc/rc.conf /etc/rc.conf.local # fix rc.conf
tar -C /tmp -f /usr/work/PCBSD.tar -px './etc'
cp /tmp/etc/rc.conf /etc/rc.conf
cp /tmp/etc/devfs.conf /etc/devfs.conf # modified in pc-bsd
vi /etc/ttys # start x on boot up
... # note the ttyvNum is arbitrary
#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
ttyv8 "/PCBSD/bin/pdm" xterm on secure
...
X -configure && mv /root/xorg.conf.new /etc/X11/xorg.conf
#
# create users and groups that come with PC-BSD 1.5.0 but not FreeBSD
# 7.0-Release. Numerical values for -u userid and -g groupid are taken from
# viewing a unified diff of the group files.
#
pw groupadd -n haldaemon -g 560
pw groupadd -n cups -g 193
pw groupadd -n cyrus -g 60
pw useradd -n haldaemon -u 560 -g 560 -L daemon -d /nonexistent
-s /usr/sbin/nologin
pw useradd -n cups -u 193 -g 193 -L daemon -d /nonexistent -s /usr/sbin/nologin
pw useradd -n cyrus -u 60 -g 60 -L daemon -d /nonexistent -s /usr/sbin/nologin
#
# add my own user with the bash shell as a test (because it. Note that I typically set
# user/group id numbers by year of birth.
#
pw groupadd -n Terry -g 1988
pw useradd -n Terry -u 1988 -L default -m -s bash -g Terry
-G wheel,operator
passwd Terry
...
#
# now build a custom kernel merging GENERIC with /PCBSD/conf/PCBSD.i386
# I find Micro GNU Emacs (mg) to be both light and effective for this task.
# -- normally I would use vimdiff
#
pkg_add -r mg && rehash # if using mg !
cat > ~/.mg
auto-fill-mode
set-fill-column 78
global-set-key "^x^f" find-file
global-set-key "^h" delete-backward-char
set-default-mode blink
^D # end of ~/.mg
diff -u /usr/src/sys/i386/conf/GENERIC /PCBSD/conf/PCBSD.i386 > /tmp/kern.diff
cd /usr/src/sys/i386/conf
mg KAI
... # kernel config attached at EOF
# used GENERIC and /tmp/kern.diff to
# write the file if needed.
cd /usr/src # compile & install kernel
make -j12 buildkernel KERNCONF=KAI
... # roughly 10 minutes later..
make -j12 installkernel KERNCONF=KAI
...
umount /mnt && cdcontrol -f /dev/acd0 eject
reboot # let's rock it and roll on to KDE
On reboot, I was greeted with KDM, PC-BSDs login theme, and a clean startup of KDE (no error message popups). I was able to install and use the Firefox PBI from PBIDir without problems. But as one can see in the screen shots, there are sound system related core dumps
I was also interested to see that there is now a ‘snd_emu10kx’ driver added in FreeBSD 7.0-Release which supports my card. So I guess I won’t have to manually compile the ‘outdated, unmaintained, etc’ audio/emu10kx port to get working sound, the manual page seems to suggest it is the same driver more or less. I only had to add an entry to my loader.conf file to get it loaded before PC-BSD sound detection system, just like audio/emu10kx from ports it won’t work (for me) if kldload’ed later on.
I found that although everything I tested was working fine, audio and video related apps were dumping core (mplayer at start, kaffeine during playback). So I did a pkg_delete on kaffeine and kaffeine-mozilla and reinstalled from packages and soon was blasting MP3’s from a FAT32 partition 😉
MPlayer needs to be recompiled as expected, The KDE sound system will likely need that to but otherwise I’ve observed no real breakages. Not that I’ve taken the time to test every single program!
Personal Opinions
If like me, your primary reason for using PC-BSD is a quick way of grabbing KDE — you would be better off installing PC-BSD! As far as setting up a working desktop system, one can do that easy through FreeBSD. If one doesn’t want to go into configuration details for ‘extra’s like PF or X11 using PC-BSD or DesktopBSD is a better idea anyway.
If all you want is PBI, export, compile, and install the necessary files from PC-BSDs SVN repository.
Kernel Configuration: KAI
Note to SATA hard drives out there, the ATA_STATIC_ID option effects device numbering. FreeBSD GENERIC kernel configuration uses it and detects my SATA drive as ‘ad4’, PC_BSD kernel configuration has it turned off and detects my drive as ‘ad0’ — I only have one SATA II hard drive installed.
Changing the ATA_STATIC_ID kernel option means you will havve to make sure /etc/fstab is in working shape unless you want to see a mount root prompt.
#
# Custom FreeBSD 7.0 kernel based on PC-BSD 1.5 Kernel config for FreeBSD 6.3
#
cpu I686_CPU
ident KAI
#options SCHED_$BSD # 4BSD scheduler
options SCHED_ULE # ULE scheduler ;-)
options PREEMPTION # ENABLE KERNEL THREAD PREEMPTION
options INET # INTERNETWORKING
options INET6 # IPV6 COMMUNICATIONS PROTOCOLS
options SCTP # STREAM CONTROL TRANSMISSION PROTOCOL
options FFS # BERKELEY FAST FILESYSTEM
options SOFTUPDATES # ENABLE FFS SOFT UPDATES SUPPORT
options UFS_ACL # SUPPORT FOR ACCESS CONTROL LISTS
options UFS_DIRHASH # IMPROVE PERFORMANCE ON BIG DIRECTORIES
options UFS_GJOURNAL # ENABLE GJOURNAL-BASED UFS JOURNALING
options MD_ROOT # MD IS A POTENTIAL ROOT device
options NFSCLIENT # NETWORK FILESYSTEM CLIENT
options NFSSERVER # NETWORK FILESYSTEM SERVER
options NFS_ROOT # NFS USABLE AS /, REQUIRES NFSCLIENT
options MSDOSFS # MSDOS FILESYSTEM
options CD9660 # ISO 9660 FILESYSTEM
options PROCFS # PROCESS FILESYSTEM (REQUIRES PSEUDOFS)
options PSEUDOFS # PSEUDO-FILESYSTEM FRAMEWORK
options GEOM_PART_GPT # GUID PARTITION TABLES.
options GEOM_LABEL # PROVIDES LABELIZATION
options COMPAT_43TTY # BSD 4.3 TTY COMPAT [KEEP THIS!]
options COMPAT_FREEBSD4 # COMPATIBLE WITH FREEBSD4
options COMPAT_FREEBSD5 # COMPATIBLE WITH FREEBSD5
options COMPAT_FREEBSD6 # COMPATIBLE WITH FREEBSD6
options SCSI_DELAY=5000 # DELAY (IN MS) BEFORE PROBING SCSI
options KTRACE # KTRACE(1) SUPPORT
options SYSVSHM # SYSV-STYLE SHARED MEMORY
options SYSVMSG # SYSV-STYLE MESSAGE QUEUES
options SYSVSEM # SYSV-STYLE SEMAPHORES
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B REAL-TIME EXTENSIONS
options KBD_INSTALL_CDEV # INSTALL A CDEV ENTRY IN /DEV
options ADAPTIVE_GIANT # GIANT MUTEX IS ADAPTIVE.
options STOP_NMI # STOP CPUS USING NMI INSTEAD OF IPI
options AUDIT # SECURITY EVENT AUDITING
# TO MAKE AN SMP KERNEL, THE NEXT TWO LINES ARE NEEDED
options SMP # SYMMETRIC MULTIPROCESSOR KERNEL
device apic # I/O APIC
# CPU FREQUENCY CONTROL
device cpufreq
# BUS SUPPORT.
device eisa
device pci
# FLOPPY DRIVES
device fdc
# ATA AND ATAPI deviceS
device ata
device atadisk # ATA DISK DRIVES
device ataraid # ATA RAID DRIVES
device atapicd # ATAPI CDROM DRIVES
device atapifd # ATAPI FLOPPY DRIVES
device atapist # ATAPI TAPE DRIVES
options ATA_STATIC_ID # STATIC device NUMBERING
device atapicam # Atapi CAM support
# SCSI CONTROLLERS
device ahb # EISA AHA1742 FAMILY
device ahc # AHA2940 AND ONBOARD AIC7XXX deviceS
options AHC_REG_PRETTY_PRINT # PRINT REGISTER BITFIELDS IN DEBUG
# OUTPUT. ADDS ~128K TO DRIVER.
device ahd # AHA39320/29320 AND ONBOARD AIC79XX deviceS
options AHD_REG_PRETTY_PRINT # PRINT REGISTER BITFIELDS IN DEBUG
# OUTPUT. ADDS ~215K TO DRIVER.
device amd # AMD 53C974 (TEKRAM DC-390(T))
device isp # QLOGIC FAMILY
#device ispfw # FIRMWARE FOR QLOGIC HBAS- NORMALLY A MODULE
device mpt # LSI-LOGIC MPT-FUSION
#device ncr # NCR/SYMBIOS LOGIC
device sym # NCR/SYMBIOS LOGIC (NEWER CHIPSETS + THOSE OF `NCR')
device trm # TEKRAM DC395U/UW/F DC315U ADAPTERS
device adv # ADVANSYS SCSI ADAPTERS
device adw # ADVANSYS WIDE SCSI ADAPTERS
device aha # ADAPTEC 154X SCSI ADAPTERS
device aic # ADAPTEC 15[012]X SCSI ADAPTERS, AIC-6[23]60.
device bt # BUSLOGIC/MYLEX MULTIMASTER SCSI ADAPTERS
device ncv # NCR 53C500
device nsp # WORKBIT NINJA SCSI-3
device stg # TMC 18C30/18C50
# SCSI PERIPHERALS
device scbus # SCSI BUS (REQUIRED FOR SCSI)
device ch # SCSI MEDIA CHANGERS
device da # DIRECT ACCESS (DISKS)
device sa # SEQUENTIAL ACCESS (TAPE ETC)
device cd # CD
device pass # PASSTHROUGH device (DIRECT SCSI ACCESS)
device ses # SCSI ENVIRONMENTAL SERVICES (AND SAF-TE)
# RAID CONTROLLERS INTERFACED TO THE SCSI SUBSYSTEM
device amr # AMI MEGARAID
device arcmsr # ARECA SATA II RAID
device asr # DPT SMARTRAID V, VI AND ADAPTEC SCSI RAID
device ciss # COMPAQ SMART RAID 5*
device dpt # DPT SMARTCACHE III, IV - SEE NOTES FOR options
device hptmv # HIGHPOINT ROCKETRAID 182X
device hptrr # HIGHPOINT ROCKETRAID 17XX, 22XX, 23XX, 25XX
device iir # INTEL INTEGRATED RAID
device ips # IBM (ADAPTEC) SERVERAID
device mly # MYLEX ACCELERAID/EXTREMERAID
device twa # 3WARE 9000 SERIES PATA/SATA RAID
# RAID CONTROLLERS
device aac # ADAPTEC FSA RAID
device aacp # SCSI PASSTHROUGH FOR AAC (REQUIRES CAM)
device ida # COMPAQ SMART RAID
device mfi # LSI MEGARAID SAS
device mlx # MYLEX DAC960 FAMILY
device pst # PROMISE SUPERTRAK SX6000
device twe # 3WARE ATA RAID
# ATKBDC0 CONTROLS BOTH THE KEYBOARD AND THE PS/2 MOUSE
device atkbdc # AT KEYBOARD CONTROLLER
device atkbd # AT KEYBOARD
device psm # PS/2 MOUSE
device vga # VGA VIDEO CARD DRIVER
device splash # SPLASH SCREEN AND SCREEN SAVER SUPPORT
# SYSCONS IS THE DEFAULT CONSOLE DRIVER, RESEMBLING AN SCO CONSOLE
device sc
device agp # SUPPORT SEVERAL AGP CHIPSETS
# POWER MANAGEMENT SUPPORT (SEE NOTES FOR MORE options)
#device apm
# ADD SUSPEND/RESUME SUPPORT FOR THE I8254.
device pmtimer
# PCCARD (PCMCIA) SUPPORT
# PCMCIA AND CARDBUS BRIDGE SUPPORT
device cbb # CARDBUS (YENTA) BRIDGE
device pccard # PC CARD (16-BIT) BUS
device cardbus # CARDBUS (32-BIT) BUS
# SERIAL (COM) PORTS
device sio # 8250, 16[45]50 BASED SERIAL PORTS
device uart # GENERIC UART DRIVER
# PARALLEL PORT
device ppc
device ppbus # PARALLEL PORT BUS (REQUIRED)
device lpt # PRINTER
device plip # TCP/IP OVER PARALLEL
device ppi # PARALLEL PORT INTERFACE device
#device vpo # REQUIRES SCBUS AND DA
# IF YOU'VE GOT A "DUMB" SERIAL OR PARALLEL PCI CARD THAT IS
# SUPPORTED BY THE PUC(4) GLUE DRIVER, UNCOMMENT THE FOLLOWING
# LINE TO ENABLE IT (CONNECTS TO SIO, UART AND/OR PPC DRIVERS):
#device puc
# PCI ETHERNET NICS.
device de # DEC/INTEL DC21X4X (``TULIP'')
device em # INTEL PRO/1000 ADAPTER GIGABIT ETHERNET CARD
device ixgb # INTEL PRO/10GBE ETHERNET CARD
device le # AMD AM7900 LANCE AND AM79C9XX PCNET
device txp # 3COM 3CR990 (``TYPHOON'')
device vx # 3COM 3C590, 3C595 (``VORTEX'')
# PCI ETHERNET NICS THAT USE THE COMMON MII BUS CONTROLLER CODE.
# NOTE: BE SURE TO KEEP THE 'device MIIBUS' LINE IN ORDER TO USE THESE NICS!
device miibus # MII BUS SUPPORT
device bce # BROADCOM BCM5706/BCM5708 GIGABIT ETHERNET
device bfe # BROADCOM BCM440X 10/100 ETHERNET
device bge # BROADCOM BCM570XX GIGABIT ETHERNET
device dc # DEC/INTEL 21143 AND VARIOUS WORKALIKES
device fxp # INTEL ETHEREXPRESS PRO/100B (82557, 82558)
device lge # LEVEL 1 LXT1001 GIGABIT ETHERNET
device msk # MARVELL/SYSKONNECT YUKON II GIGABIT ETHERNET
device nfe # NVIDIA NFORCE MCP ON-BOARD ETHERNET
device nge # NATSEMI DP83820 GIGABIT ETHERNET
#device nve # NVIDIA NFORCE MCP ON-BOARD ETHERNET NETWORKING
device pcn # AMD AM79C97X PCI 10/100 (PRECEDENCE OVER 'LE')
device re # REALTEK 8139C+/8169/8169S/8110S
device rl # REALTEK 8129/8139
device sf # ADAPTEC AIC-6915 (``STARFIRE'')
device sis # SILICON INTEGRATED SYSTEMS SIS 900/SIS 7016
device sk # SYSKONNECT SK-984X & SK-982X GIGABIT ETHERNET
device ste # SUNDANCE ST201 (D-LINK DFE-550TX)
device stge # SUNDANCE/TAMARACK TC9021 GIGABIT ETHERNET
device ti # ALTEON NETWORKS TIGON I/II GIGABIT ETHERNET
device tl # TEXAS INSTRUMENTS THUNDERLAN
device tx # SMC ETHERPOWER II (83C170 ``EPIC'')
device vge # VIA VT612X GIGABIT ETHERNET
device vr # VIA RHINE, RHINE II
device wb # WINBOND W89C840F
device xl # 3COM 3C90X (``BOOMERANG'', ``CYCLONE'')
# ISA ETHERNET NICS. PCCARD NICS INCLUDED.
device cs # CRYSTAL SEMICONDUCTOR CS89X0 NIC
# 'device ED' REQUIRES 'device MIIBUS'
device ed # NE[12]000, SMC ULTRA, 3C503, DS8390 CARDS
device ex # INTEL ETHEREXPRESS PRO/10 AND PRO/10+
device ep # ETHERLINK III BASED CARDS
device fe # FUJITSU MB8696X BASED CARDS
device ie # ETHEREXPRESS 8/16, 3C507, STARLAN 10 ETC.
device sn # SMC'S 9000 SERIES OF ETHERNET CHIPS
device xe # XIRCOM PCCARD ETHERNET
# WIRELESS NIC CARDS
device wlan # 802.11 SUPPORT
device wlan_wep # 802.11 WEP SUPPORT
device wlan_ccmp # 802.11 CCMP SUPPORT
device wlan_tkip # 802.11 TKIP SUPPORT
device wlan_amrr # AMRR TRANSMIT RATE CONTROL ALGORITHM
device wlan_scan_ap # 802.11 AP MODE SCANNING
device wlan_scan_sta # 802.11 STA MODE SCANNING
device an # AIRONET 4500/4800 802.11 WIRELESS NICS.
device ath # ATHEROS PCI/CARDBUS NIC'S
device ath_hal # ATHEROS HAL (HARDWARE ACCESS LAYER)
device ath_rate_sample # SAMPLERATE TX RATE CONTROL FOR ATH
device awi # BAYSTACK 660 AND OTHERS
device ral # RALINK TECHNOLOGY RT2500 WIRELESS NICS.
device wi # WAVELAN/INTERSIL/SYMBOL 802.11 WIRELESS NICS.
#device wl # OLDER NON 802.11 WAVELAN WIRELESS NIC.
# PSEUDO deviceS.
device loop # NETWORK LOOPBACK
device random # ENTROPY device
device ether # ETHERNET SUPPORT
device sl # KERNEL SLIP
device ppp # KERNEL PPP
device tun # PACKET TUNNEL.
device pty # PSEUDO-TTYS (TELNET ETC)
device md # MEMORY "DISKS"
device gif # IPV6 AND IPV4 TUNNELING
device faith # IPV6-TO-IPV4 RELAYING (TRANSLATION)
device firmware # FIRMWARE ASSIST MODULE
# THE `BPF' device ENABLES THE BERKELEY PACKET FILTER.
# BE AWARE OF THE ADMINISTRATIVE CONSEQUENCES OF ENABLING THIS!
# NOTE THAT 'BPF' IS REQUIRED FOR DHCP.
device bpf # BERKELEY PACKET FILTER
# USB SUPPORT
device uhci # UHCI PCI->USB INTERFACE
device ohci # OHCI PCI->USB INTERFACE
device ehci # EHCI PCI->USB INTERFACE (USB 2.0)
device usb # USB BUS (REQUIRED)
#device udbp # USB DOUBLE BULK PIPE deviceS
device ugen # GENERIC
device uhid # "HUMAN INTERFACE deviceS"
device ukbd # KEYBOARD
device ulpt # PRINTER
device umass # DISKS/MASS STORAGE - REQUIRES SCBUS AND DA
device ums # MOUSE
device ural # RALINK TECHNOLOGY RT2500USB WIRELESS NICS
device rum # RALINK TECHNOLOGY RT2501USB WIRELESS NICS
device urio # DIAMOND RIO 500 MP3 PLAYER
device uscanner # SCANNERS
# USB ETHERNET, REQUIRES MIIBUS
device aue # ADMTEK USB ETHERNET
device axe # ASIX ELECTRONICS USB ETHERNET
device cdce # GENERIC USB OVER ETHERNET
device cue # CATC USB ETHERNET
device kue # KAWASAKI LSI USB ETHERNET
device rue # REALTEK RTL8150 USB ETHERNET
# FIREWIRE SUPPORT
device firewire # FIREWIRE BUS CODE
device sbp # SCSI OVER FIREWIRE (REQUIRES SCBUS AND DA)
device fwe # ETHERNET OVER FIREWIRE (NON-STANDARD!)
device fwip # IP OVER FIREWIRE (RFC 2734,3146)
device dcons # DUMB CONSOLE DRIVER
device dcons_crom # CONFIGURATION ROM FOR DCONS
#
# from PC-BSD conf
#
options LIBICONV
options LIBMCHAIN
options CD9660_ICONV
options MSDOSFS_ICONV
options NTFS
options NTFS_ICONV
options UDF
options UDF_ICONV
options GEOM_UZIP # read only compressed disks
# wifi
device wlan
device wlan_wep
device wlan_ccmp
device wlan_tkip
device an
device ath
device ath_hal
device ath_rate_sample
device awi
device ral
device wi
device iwi
device ipw
device firmware
options DEVICE_POLLING
device pf
device pflog
device pfsync
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_CDNR
options ALTQ_PRIQ
options ALTQ_NOPCC
Originally posted on my Live Journal:
subject: Came here via google 😉
by: bridd at 2008-06-25 03:16 pm (UTC)
comment: Did you find the change to ULE scheduler
"#options SCHED_$BSD # 4BSD scheduler
options SCHED_ULE # ULE scheduler ;-)"
made any improvement to speed?
subject: Re: Came here via google 😉
by: sas_spidey01 at 2008-06-26 12:22 am (UTC)
comment: With the test machines hardware, I would probably have to place it under the load of a full desktop session (for me) and be converting the contents of my ~/Music directory to another file format in the background to take any real notice.
When my much slower laptop gets a chance to compare, I'll might get a chance when I upgrade. I'm rather interested to see how ULE performs 😉
subject: Re: Came here via google 😉
by: bridd at 2008-06-26 08:39 am (UTC)
comment: Heh, fair enough -I'm looking for ways to things as speedy as possible on my laptop, without sacrificing application stability =) Actually, thinking about it, I should do tests with ULE runninng video rendering !