Editing Building FreeBSD World

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[[Category:OtherOS]]
=Introduction=
=Introduction=


* You can either cross-compile the FreeBSD world on your PC FreeBSD or compile it natively on PS3.
* You can either cross-compile the FreeBSD world on your PC freeBSD or compile it natively on PS3.
* Unfortunately, you can not change monitor resolution on PS3 FreeBSD dynamically yet. That means, you have to patch the loader and kernel syscon driver for your monitor resolution.
 
=Fetching Source Code=


<pre>
=Checking Out Head=
svn co svn://svn.freebsd.org/base/releng/9.1 /usr/devel
</pre>


Or use the head branch (very unstable):
<pre>
<pre>
svn co svn://svn.freebsd.org/base/head /usr/devel
svn co svn://svn.freebsd.org/base/head /usr/devel
Line 24: Line 16:


<pre>
<pre>
cd /usr/devel
# First apply patches if you want
# Update LV1 calls
cd /usr/devel/sys/powerpc/ps3
awk -f ps3-hv-asm.awk < ps3-hvcall.master > ps3-hvcall.S
awk -f ps3-hv-header.awk < ps3-hvcall.master > ps3-hvcall.h
cd /usr/devel/sys/powerpc/conf
cd /usr/devel/sys/powerpc/conf
mkdir /root/kernels
mkdir /root/kernels
cp GENERIC64 /root/kernels/PS3
cp GENERIC64 /root/kernels/PS3
ln -s /root/kernels/PS3
ln -s /root/kernels/PS3
cd ../../..
cd ../../..
env MAKEOBJDIRPREFIX=/usr/obj/PS3 make buildworld buildkernel installkernel installworld distribution \
env MAKEOBJDIRPREFIX=/usr/obj/PS3 make buildworld buildkernel installkernel installworld distribution \
TARGET=powerpc TARGET_ARCH=powerpc64 KERNCONF=PS3 DESTDIR=/root/PS3
TARGET=powerpc TARGET_ARCH=powerpc64 KERNCONF=PS3 DESTDIR=/root/PS3
cd /root/PS3
tar cvJf ../freebsd_world.tar.xz .
</pre>
</pre>
=Rebuilding Loader=
* If you make changes to loader source then you don't have to rebuild the whole world again. You can recompile the loader only.
<pre>
cd /usr/devel
env MAKEOBJDIRPREFIX=/usr/obj/PS3 make TARGET=powerpc TARGET_ARCH=powerpc64 buildenv
cd sys/boot
make all install DESTDIR=/root/PS3
</pre>
=Rebuilding Kernel=
* If you change your kernel configuration or make changes to kernel source then you don't have to rebuild the whole world again. You can recompile the kernel only.
<pre>
cd /usr/devel
env MAKEOBJDIRPREFIX=/usr/obj/PS3 make buildkernel installkernel \
TARGET=powerpc TARGET_ARCH=powerpc64 KERNCONF=PS3 DESTDIR=/root/PS3
</pre>
=Installing World on PS3 HDD=
* Use a PS3 FreeBSD LiveCD
==Creating New Filesystem==
<pre>
newfs -U /dev/ps3disk3p3
</pre>
==Extracting World==
* Store your FreeBSD world on a USB drive.
<pre>
mkdir /tmp/usb
mkdir /tmp/ufs
mount -t msdosfs /dev/da0s1 /tmp/usb
mount -t ufs /dev/ps3disk3p3 /tmp/ufs
cd /tmp/ufs
tar xvJf /tmp/usb/freebsd_world.tar.xz
</pre>
==/etc/fstab==
<pre>
/dev/ps3disk3p3        /      ufs    rw      1 1
/dev/ps3disk3p1        none    swap    sw      0 0
proc                    /proc  procfs  rw      0 0
</pre>
==/etc/rc.conf==
<pre>
hostname="freebsd"
ifconfig_glc0="SYNCDHCP"
sshd_enable="YES"
keyrate="fast"
keymap="us.iso"
#keymap="fr.iso"
#keymap="german.iso"
scrnmap="NO"
font8x16="iso15-8x16"
font8x14="iso15-8x14"
font8x8="iso15-8x8"
</pre>
==/etc/kboot.conf==
* My latest petitboot supports mounting UFS2 filesystems. In this case petitboot will add the FreeBSD boot entry automatically. With old petitboot image you have to mount UFS2 filesystem manually and kexec the file loader.ps3
<pre>
freebsd=/boot/loader.ps3
</pre>
{{BSD}}<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)

Templates used on this page: