5 # Extract FreeBSD world
9 tar xvJf ~/freebsd_world.tar.xz
11 cat >boot/loader.conf <<EOF
18 mkdir mnt/etc mnt/root
21 /dev/cd0 / cd9660 ro 0 0
22 md /mnt/etc mfs rw,-s8m,-S 2 0
23 md /mnt/root mfs rw,-s8m,-S 2 0
24 /mnt/etc /etc unionfs rw 0 0
25 /mnt/root /root unionfs rw 0 0
28 cat >etc/rc.conf <<EOF
31 hostname="freebsd-livecd"
33 ifconfig_glc0="SYNCDHCP"
52 sendmail_enable="NONE"
53 sendmail_submit_enable="NO"
54 sendmail_outbound_enable="NO"
55 sendmail_msp_queue_enable="NO"
62 # Enable sshd root login and empty passwords in etc/ssh/sshd_config
65 PasswordAuthentication yes
66 PermitEmptyPasswords yes
71 cat >etc/kboot.conf <<EOF
72 freebsd-livecd=/boot/loader.ps3
77 mkisofs -R -l -ldots -allow-lowercase -allow-multidot \
78 -V 'PS3 FreeBSD LiveCD' -volset 'PS3 FreeBSD' -hide boot.catalog \
79 -o ~/freebsd_livecd.iso .
81 Compressed FreeBSD LiveCD
82 --------------------------
84 # Create initial MD root filesystem
91 (cd /root/livecd/rescue && tar cf - .) | tar xf -
109 ROOT_IMAGE=/data/root.ufs.uzip
117 mount -t cd9660 /dev/cd0 $CDROM
119 mdmfs -P -F $CDROM/$ROOT_IMAGE -o ro md.uzip $BASEROOT
120 mdmfs -s 16m md $RWROOT
121 mount -t unionfs $RWROOT $BASEROOT
124 mount -t devfs devfs $DEVFS
126 mkdir -p $BASEROOT/$CDROM
127 mount -t nullfs -o ro $CDROM $BASEROOT/$CDROM
129 kenv init_shell="/bin/sh"
138 # Create MD root image
140 makefs -t ffs -B big -b 10% mfsroot.ufs mfsroot
150 (cd /root/livecd/boot && tar cf - .) | tar xf -
153 rm -f boot/kernel/*.symbols
154 rm -f boot/kernel/wlan*
155 rm -f boot/kernel/snd_*
156 rm -f boot/kernel/if_*
157 rm -f boot/kernel/ng_*
158 rm -f boot/kernel/isp*
159 gzip boot/kernel/kernel
161 cp ../mfsroot.ufs.gz boot/
163 cat >boot/loader.conf <<EOF
169 mfsroot_type="md_image"
170 mfsroot_name="/boot/mfsroot.ufs"
172 init_path="/rescue/init"
173 init_shell="/rescue/sh"
174 init_script="/init.sh"
175 init_chroot="/baseroot"
179 cat >etc/kboot.conf <<EOF
180 freebsd-livecd=/boot/loader.ps3
185 # Create final root filesystem image and compress it
187 makefs -t ffs -B big root.ufs livecd
189 mkdir livecd-uzip/data
190 cp root.ufs.uzip livecd-uzip/data
192 Installing ports on LiveCD
193 ---------------------------
195 tar xvJf ~/livecd.tar.xz
197 # Chroot into LiveCD root filesystem
199 mount -t devfs devfs /root/livecd/dev
200 cp /etc/resolv.conf /root/livecd/etc
202 chroot /root/livecd /bin/csh
206 # Fetch ports archive and extract it
208 fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz
217 # Install VIM lite edition
220 make BATCH=yes install clean
225 cat >/root/.vimrc <<EOF
242 make BATCH=yes install clean
246 make BATCH=yes install clean
250 make BATCH=yes install clean
254 make BATCH=yes install clean
258 make BATCH=yes install clean
262 make BATCH=yes install clean
266 make BATCH=yes install clean
270 make BATCH=yes install clean
280 rm -f /root/livecd/etc/resolv.conf
281 rm -f /root/livecd/root/.history
282 umount /root/livecd/dev