Update Building HTPC; Fedora 18 + XBMC 12 on AT3N7A-I available.

Installing NFS based FC15

Preparing done on NFS server (mine was FC16 64-bit). First of all create new LV end add it to exports:

lvcreate -n fc15xbmc -L5g /dev/rootvg
mkfs.ext4 -j /dev/rootvg/fc15xbmc
vi /etc/fstab
mkdir /fc15xbmc
mount /fc15xbmc
vi /etc/exports
cd /fc15xbmc
mkdir -m1777 tmp
cd tmp

Install RPM itself. Locate FC repository on Internet and download rpm-XXX.rpm and all it's dependencies. Here is an example:

BASE="http://mirror.isoc.org.il/pub/fedora/releases/15/Fedora/i386/os/Packages/"
rpms="
rpm-4.9.0-6.fc15.i686.rpm
bash-4.2.10-2.fc15.i686.rpm
popt-1.13-8.fc15.i686.rpm
glibc-2.13.90-9.i686.rpm
basesystem-10.0-3.noarch.rpm
glibc-common-2.13.90-9.i686.rpm
setup-2.8.31-2.fc15.noarch.rpm
filesystem-2.4.40-1.fc15.i686.rpm
libgcc-4.6.0-6.fc15.i686.rpm
tzdata-2011d-3.fc15.noarch.rpm
coreutils-8.10-2.fc15.i686.rpm
curl-7.21.3-6.fc15.i686.rpm
db4-utils-4.8.30-3.fc15.i686.rpm
ncurses-5.8-2.20110319.fc15.i686.rpm
libcurl-7.21.3-6.fc15.i686.rpm
coreutils-libs-8.10-2.fc15.i686.rpm
jzlib-1.0.7-9.fc15.noarch.rpm
zlib-1.2.5-3.fc15.i686.rpm
libselinux-2.0.99-4.fc15.i686.rpm
rpm-libs-4.9.0-6.fc15.i686.rpm
nss-3.12.9-15.fc15.i686.rpm
nss-util-3.12.9-2.fc15.i686.rpm
nss-sysinit-3.12.9-15.fc15.i686.rpm
xz-libs-5.0.1-2.fc15.i686.rpm
lua-5.1.4-8.fc15.i686.rpm
elfutils-libelf-0.152-1.fc15.i686.rpm
db4-4.8.30-3.fc15.i686.rpm
libcap-2.17-2.fc15.i686.rpm
bzip2-libs-1.0.6-3.fc15.i686.rpm
libacl-2.2.49-9.fc15.i686.rpm
nspr-4.8.7-2.fc15.i686.rpm
sed-4.2.1-6.fc15.i686.rpm
nss-softokn-3.12.9-7.fc15.i686.rpm
nss-softokn-freebl-3.12.9-7.fc15.i686.rpm
ncurses-libs-5.8-2.20110319.fc15.i686.rpm
info-4.13a-15.fc15.i686.rpm
sqlite-3.7.5-3.fc15.i686.rpm
readline-6.2-2.fc15.i686.rpm
ncurses-base-5.8-2.20110319.fc15.i686.rpm
libsepol-2.0.42-2.fc15.i686.rpm
libssh2-1.2.7-1.fc15.i686.rpm
openssl-1.0.0d-1.fc15.i686.rpm
krb5-libs-1.9-7.fc15.i686.rpm
libcom_err-1.41.14-2.fc15.i686.rpm
ca-certificates-2011.70-2.fc15.noarch.rpm
openldap-2.4.24-2.fc15.i686.rpm
cyrus-sasl-lib-2.1.23-16.fc15.i686.rpm
libidn-1.19-2.fc15.i686.rpm
libattr-2.4.44-7.fc15.i686.rpm
keyutils-libs-1.2-7.fc15.i686.rpm
pam-1.1.3-8.fc15.i686.rpm
cracklib-2.8.18-2.fc15.i686.rpm
audit-libs-2.1.1-1.fc15.i686.rpm
cracklib-dicts-2.8.18-2.fc15.i686.rpm
gzip-1.4-3.fc15.i686.rpm
gmp-4.3.2-3.fc15.i686.rpm
libstdc++-4.6.0-6.fc15.i686.rpm
grep-2.7-5.fc15.i686.rpm
pcre-8.12-2.fc15.i686.rpm
"
for r in $rpms ; do wget $BASE/$r ; done
rpm --root=/fc15xbmc -ihv *rpm
FC16.txt

The --root=/fc15xbmc option tell host's RPM not deal with local RMP's database, but switch root to other location.

Now we have base root filesystem, let's make yum working instead of manual RMP installation. First of all, do chroot there.

cp /etc/resolv.conf /fc15xbmc/etc/
chroot /fc15xbmc /bin/bash
export PS1="CHROOT> "
cd /tmp
rm -rf *rpm
BASE="http://mirror.isoc.org.il/pub/fedora/releases/15/Fedora/i386/os/Packages/"
rpm -ihv $BASE/wget-1.12-3.fc15.i686.rpm
rpms="
fedora-release-15-1.noarch.rpm
fedora-release-rawhide-15-1.noarch.rpm
yum-3.2.29-4.fc15.noarch.rpm 
yum-utils-1.1.30-2.fc15.noarch.rpm  
python-kitchen-1.0.0-1.fc15.noarch.rpm 
python-2.7.1-7.fc15.i686.rpm 
yum-metadata-parser-1.1.4-4.fc15.i686.rpm 
rpm-python-4.9.0-6.fc15.i686.rpm 
python-urlgrabber-3.9.1-10.fc15.noarch.rpm 
python-iniparse-0.4-3.fc15.noarch.rpm 
python-pycurl-7.19.0-9.fc15.i686.rpm  
glib2-2.28.6-2.fc15.i686.rpm 
python-libs-2.7.1-7.fc15.i686.rpm  
python-chardet-2.0.1-3.fc15.noarch.rpm 
pygpgme-0.1-22.20101027bzr69.fc15.i686.rpm 
shared-mime-info-0.90-7.fc15.i686.rpm 
gpgme-1.3.0-4.fc15.i686.rpm 
gdbm-1.8.3-9.fc15.i686.rpm 
libffi-3.0.9-2.fc15.i686.rpm 
expat-2.0.1-11.fc15.i686.rpm 
gamin-0.1.10-9.fc15.i686.rpm 
pth-2.0.7-10.i686.rpm 
libgpg-error-1.9-2.fc15.i686.rpm 
libassuan-2.0.0-4.fc15.i686.rpm 
gnupg2-2.0.17-1.fc15.i686.rpm 
pkgconfig-0.25-3.fc15.i686.rpm 
libxml2-2.7.8-6.fc15.i686.rpm
pinentry-0.8.1-3.fc15.i686.rpm
file-libs-5.05-3.fc15.i686.rpm
chkconfig-1.3.52-1.fc15.i686.rpm
libgcrypt-1.4.6-1.fc15.i686.rpm
rpm-build-libs-4.9.0-6.fc15.i686.rpm
"
for r in $rpms ; do wget $BASE/$r ; done
rpm -ihv *rpm
yum clean

Yum ready. But it is too smart, so we should lay it about architecture. setarch command is part of util-linux package, we have to install it:

rm -f *rpm
BASE="http://mirror.isoc.org.il/pub/fedora/releases/15/Fedora/i386/os/Packages/"
rpms="
util-linux-2.19.1-1.fc15.i686.rpm
libblkid-2.19.1-1.fc15.i686.rpm
libuuid-2.19.1-1.fc15.i686.rpm
libmount-2.19.1-1.fc15.i686.rpm
libuuid-2.19.1-1.fc15.i686.rpm
libutempter-1.1.5-5.fc15.i686.rpm
shadow-utils-4.1.4.2-11.fc15.i686.rpm
"
for r in $rpms ; do wget $BASE/$r ; done
rpm -ihv *rpm
exit

You can exit from chroot environment to enter it in new way. I've created script for that:

root:/fc15xbmc # cat command_mount_chroot 
mount -o bind /proc proc
mount -o bind /sys sys
mount -o bind /dev dev
chroot . /usr/bin/setarch i686 /bin/bash -i
umount dev
umount sys
umount proc

Create /fc15xbmc/etc/fstab file to reflect NFS root:

# cat /fc15xbmc/etc/fstab 
192.168.1.1:/fc15xbmc /       nfs     nolock  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
tmpfs                   /tmp            tmpfs   defaults        0 0

Now enter to chroot environment and install all required things. Let's start with repository updates:

# cd /fc15xbmc && sh command_mount_chroot
rpm -ihv http://download1.rpmfusion.org/free/fedora/releases/15/Everything/i386/os/rpmfusion-free-release-15-1.noarch.rpm
rpm -ihv http://download1.rpmfusion.org/nonfree/fedora/releases/15/Everything/i386/os/rpmfusion-nonfree-release-15-1.noarch.rpm
rpm -ivh http://rpm.livna.org/livna-release.rpm
yum clean all
yum update -y
yum install -y kmod-nvidia xorg-x11-drv-nvidia vdpauinfo libvdpau twm xterm kdm xbmc nfs-utils \
	vim dracut-network passwd openssh-server syslog-ng pavucontrol pulseaudio-module-x11 \
	glx-utils xorg-x11-drv-keyboard xorg-x11-drv-mouse binutils gcc make make kernel-devel \
	xorg-x11-drv-evdev lsof strings ntp

Lets configure. First make our system bootable. As you remember, the HTPC board is AT3N7A-I from ASUSTeK, can boot from r8169 NIC. Still within chrooted environment, lets create suitable initrd:

# egrep -v "^$|^#" /etc/dracut.conf
logfile=/var/log/dracut.log
fileloglvl=6
dracutmodules+="nfs network base"
omit_dracutmodules+="xen btrfs dm dmraid dmsquash-live lvm mdraid multipath"
add_dracutmodules+="network nfs"
add_drivers+="r8169"
mdadmconf="no"
lvmconf="no"
# cd /boot && dracut -f initramfs-2.6.41.4-1.fc15.i686.img 2.6.41.4-1.fc15.i686 

Exit from chrooted environment and copy initramfs and kernel from /fc15xbmc/boot to /tftpboot directory at your PXE server.


If this was helpfull, please donate
Last modified by Oleg Volkov Wed Dec 28 12:23:24 IST 2011