# Build a Raspberry Pi - XFCE install using livemedia-creator
# Note this image will only boot if you reformat the boot partition to vfat
# you can manually reformat the boot partition after image creation or use the script provided below
#
# Reformat boot partition script:
# http://scotland.proximity.on.ca/raspberrypi/test-releases/rpfr18v6/latest/revfat
lang en_US.UTF-8
keyboard us
timezone --utc US/Eastern
auth --useshadow --enablemd5
selinux --disabled
firewall --enabled --service=mdns,ssh
network --bootproto=dhcp --device=eth0 --onboot=on --activate --hostname=pidora.local
services --enabled=NetworkManager,sshd,ntpd --disabled=network
# Only use this with Anaconda for serial console installs, not with livemedia-creator.
# Use this for serial console-only installs
#skipx
# Set a default root password for Rasbberry Pi
rootpw --plaintext Pidora2014
# Repositories
# apparently we must use 'url' for the install repo for livemedia-creator
url --url="http://japan.proximity.on.ca/kojifiles/repos/f20-build/latest/armv6hl/"
#url --url="http://japan.proximity.on.ca/kojifiles/mash20/pidora-20-latest/pidora-20/armhfp/os/"
# and get updates for the builders
#repo --name=pidora --ignoregroups=true --baseurl="http://japan.proximity.on.ca/kojifiles/mash20/pidora-20-latest/pidora-20/armhfp/os/"
repo --name=pidora --ignoregroups=true --baseurl="http://japan.proximity.on.ca/kojifiles/mash20/pidora-20/armhfp/os/"
#repo --name=pidora-updates --baseurl="http://japan.proximity.on.ca/repos/f20-updates-build/latest/armv6hl/"
repo --name=pidora-rpfr --baseurl="http://japan.proximity.on.ca/kojifiles/repos/f20-rpfr-updates-build/latest/armv6hl/"
#repo --name=rpfr18g6 --baseurl="http://scotland.proximity.on.ca/~agreene/v6-groups/"
#
# Define how large you want your rootfs to be
#
bootloader --location=boot
zerombr
clearpart --all
## Need to create logical volume groups first then partition
part /boot --size 50 --fstype ext4 --label=boot --asprimary
part swap --size 255 --label=swap
part / --size 3000 --fstype ext4 --label=rootfs --asprimary
#
# Add all the packages after the base packages
#
%packages --ignoremissing
# Exclueded packages
-fedora-release
-fedora-release-notes
-fedora-logos
-generic-release
-system-config-date
-xorg-x11-drv-ati
-xorg-x11-drv-cirrus
-xorg-x11-drv-geode
-xorg-x11-drv-intel
-xorg-x11-drv-mga
-xorg-x11-drv-nouveau
-xorg-x11-drv-omap
-xorg-x11-drv-qxl
-xorg-x11-drv-vesa
-xorg-x11-drv-vmware
-smolt
-smolt-firstboot
-linux-firmware
-plymouth
-abrt*
-orage
-nfs-utils
-talk
-yp-tools
-ypbind
-coolkey
-system-config-keyboard
-system-config-keyboard-base
-irqbalance
-pcmciautils
-samba
-pulseaudio-gdm-hooks
-gnome-shell
-gdm-libs
-gdm
-gnome-session-xsession
# Complete package set
abattis-cantarell-fonts
accountsservice
accountsservice-libs
acl
abiword
adwaita-cursor-theme
adwaita-gtk2-theme
adwaita-gtk3-theme
aic94xx-firmware
albatross-gtk2-theme
albatross-gtk3-theme
albatross-xfwm4-theme
alsa-firmware
alsa-lib
alsa-tools-firmware
anaconda-yum-plugins
arj
at
atk
atmel-firmware
at-spi2-atk
at-spi2-core
attr
audit
audit-libs
audit-libs-python
authconfig
authconfig-gtk
avahi-autoipd
avahi-glib
avahi-libs
b43-fwcutter
b43-openfwwf
basesystem
bash
bash-completion
bc
bind-libs
bind-libs-lite
bind-license
bind-utils
binutils
bluebird-gtk2-theme
bluebird-gtk3-theme
bluebird-xfwm4-theme
blueman
bluez
bluez-libs
bridge-utils
#btrfs-progs
bzip2
bzip2-libs
ca-certificates
cairo
cairo-gobject
c-ares
cdparanoia-libs
celt
checkpolicy
chkconfig
chrony
cifs-utils
cloog-ppl
colord-libs
comps-extras
ConsoleKit
ConsoleKit-libs
ConsoleKit-x11
control-center-filesystem
coreutils
cpio
cpp
cracklib
cracklib-dicts
crda
createrepo
cronie
cronie-anacron
crontabs
cryptsetup
cryptsetup-libs
cups-libs
curl
cyrus-sasl
cyrus-sasl-gssapi
cyrus-sasl-lib
cyrus-sasl-plain
dbus
dbus-glib
dbus-libs
dbus-python
dbus-x11
dconf
dejavu-fonts-common
dejavu-sans-fonts
dejavu-sans-mono-fonts
dejavu-serif-fonts
deltarpm
desktop-backgrounds-basic
desktop-backgrounds-compat
desktop-backgrounds-gnome
desktop-file-utils
device-mapper
device-mapper-event
device-mapper-event-libs
device-mapper-libs
dhclient
dhcp-common
dhcp-libs
diffutils
dmraid
dmraid-events
dnsmasq
dos2unix
dosfstools
dump
e2fsprogs
e2fsprogs-libs
ebtables
ed
elfutils-libelf
emacs-filesystem
enchant
espeak
ethtool
exo
expat
fedora-icon-theme
file
file-libs
filesystem
findutils
finger
fipscheck
fipscheck-lib
firewall-config
firewalld
firstboot
flac
fontconfig
fontpackages-filesystem
fpaste
fprintd
fprintd-pam
freetype
ftp
fxload
gamin
garcon
gawk
gcc
GConf2
gcr
gdbm
gdisk
gdk-pixbuf2
gdm
geoclue
glib2
glibc
glibc-common
glibc-devel
glibc-headers
glib-networking
gmp
gnome-bluetooth-libs
gnome-desktop3
gnome-icon-theme
gnome-icon-theme-legacy
gnome-icon-theme-symbolic
gnome-keyring
gnome-keyring-pam
gnome-python2
gnome-python2-bonobo
gnome-python2-canvas
gnome-python2-gconf
gnome-python2-gnome
gnome-python2-gnomevfs
gnome-session
gnome-settings-daemon
gnome-themes
gnome-themes-standard
gnome-vfs2
gnupg2
gnutls
gobject-introspection
gpgme
#gpg-pubkey
grep
greybird-gtk2-theme
greybird-gtk3-theme
greybird-xfce4-notifyd-theme
greybird-xfwm4-theme
groff-base
gsettings-desktop-schemas
gsm
gstreamer
gstreamer1
gstreamer-plugins-base
gstreamer-tools
gtk2
gtk2-engines
gtk3
gtk-murrine-engine
gtk-unico-engine
gtk-xfce-engine
guake
gvfs
gvfs-obexftp
gzip
harfbuzz
hesiod
hicolor-icon-theme
hostname
hunspell
hunspell-en
hunspell-en-GB
hunspell-en-US
hwdata
ibus-libs
info
initscripts
iproute
iprutils
iptables
iptables-services
iptstate
iputils
irda-utils
iso-codes
ivtv-firmware
iw
iwl1000-firmware
iwl100-firmware
iwl105-firmware
iwl135-firmware
iwl2000-firmware
iwl2030-firmware
iwl3945-firmware
iwl4965-firmware
iwl5000-firmware
iwl5150-firmware
iwl6000-firmware
iwl6000g2a-firmware
iwl6000g2b-firmware
iwl6050-firmware
jack-audio-connection-kit
jack-audio-connection-kit-example-clients
jasper-libs
jbigkit-libs
js
json-c
json-glib
jwhois
kbd
keyutils
keyutils-libs
kmod
kmod-libs
kpartx
krb5-libs
kbd-misc
krb5-workstation
lcms2
lcms-libs
leafpad
less
lftp
libacl
libarchive
libart_lgpl
libassuan
libasyncns
libatasmart
libattr
libbasicobjects
libbcm2835
libblkid
libbluray
libbonobo
libbonoboui
libbsd
libcanberra
libcanberra-gtk2
libcanberra-gtk3
libcap
libcap-ng
libcdio
libcgroup
libcollection
libcom_err
libcroco
libcurl
libdaemon
libdb
libdb4
libdb-utils
libdhash
libdmx
libdrm
libedit
libee
liberation-fonts-common
liberation-mono-fonts
liberation-narrow-fonts
liberation-sans-fonts
liberation-serif-fonts
libertas-usb8388-firmware
libestr
libexif
libffi
libfontenc
libfprint
libgcc
libgcrypt
libglade2
libgnome
libgnomecanvas
libgnome-keyring
libgnomeui
libgomp
libgpg-error
libgsf
libgudev1
libical
libICE
libicu
libIDL
libidn
libimobiledevice
libini_config
libipa_hbac
libjpeg-turbo
libldb
liblognorm
libmcpp
libmicrohttpd
libmnl
libmodman
libmount
libmpc
libnetfilter_conntrack
libnfnetlink
libnl
libnl3
libnm-gtk
libnotify
libogg
libopenraw
libopenraw-gnome
libpath_utils
libpcap
libpciaccess
libpipeline
libplist
libpng
libproxy
libpwquality
libref_array
libreport
libreport-filesystem
libreport-gtk
libreport-newt
libreport-python
librsvg2
libsamplerate
libsecret
libselinux
libselinux-python
libselinux-utils
libsemanage
libsemanage-python
libsepol
libSM
libsndfile
libsoup
libss
libssh2
libsss_idmap
libstdc++
libsysfs
libtalloc
libtasn1
libtdb
libtevent
libthai
libtheora
libtiff
libtool-ltdl
libudisks2
libusb
libusbx
libuser
libuser-python
libutempter
libuuid
libvisual
libvorbis
libwacom
libwacom-data
libwayland-client
libwayland-server
libwbclient
libwnck
libX11
libX11-common
libXau
libxcb
libXcomposite
libXcursor
libXdamage
libXdmcp
libXevie
libXext
libxfce4ui
libxfce4util
libxfcegui4
libXfixes
libXfont
libXft
libXi
libXinerama
libxkbfile
libxklavier
libxml2
libxml2-python
libXmu
libXpm
libXrandr
libXrender
libXres
libXScrnSaver
libxslt
libXt
libXtst
libXv
libXxf86dga
libXxf86misc
libXxf86vm
libyaml
lightdm
lightdm-gobject
lightdm-gtk
linux-atm-libs
linux-firmware
llvm-libs
logrotate
lsof
lua
lzo
m4
mailcap
mailx
make
man-db
man-pages
mcpp
mdadm
mesa-dri-drivers
mesa-dri-filesystem
mesa-libEGL
mesa-libgbm
mesa-libGL
mesa-libglapi
metacity
midori
mlocate
mobile-broadband-provider-info
mpfr
mtdev
mtools
mtr
nano
ncurses
ncurses-base
ncurses-libs
NetworkManager
network-manager-applet
NetworkManager-glib
NetworkManager-openvpn
NetworkManager-pptp
NetworkManager-vpnc
newt
newt-python
nm-connection-editor
nodoka-filesystem
nortc
notification-daemon
notify-python
nspr
nss
nss-myhostname
nss-softokn
nss-softokn-freebl
nss-sysinit
nss-tools
nss-util
ntfs-3g
ntfsprogs
ntpdate
ntsysv
obex-data-server
openjpeg-libs
openldap
openobex
openssh
openssh-askpass
openssh-clients
openssh-server
openssl
openssl-libs
openvpn
orage
ORBit2
orc
p11-kit
PackageKit
PackageKit-glib
PackageKit-yum
PackageKit-yum-plugin
pam
pam_krb5
pam_pkcs11
pango
parted
passwd
passwdqc
passwdqc-lib
pciutils
pciutils-libs
pcre
pcsc-lite-libs
perl
perl-Carp
perl-Device-BCM2835
perl-Filter
perl-libs
perl-macros
perl-Module-Pluggable
perl-parent
perl-PathTools
perl-Pod-Escapes
perl-Pod-Parser
perl-Pod-Perldoc
perl-Pod-Simple
perl-Scalar-List-Utils
perl-Socket
perl-threads
perl-threads-shared
perl-URI
pi3d
pinentry
pinentry-gtk
pinfo
pixman
pkcs11-helper
pkgconfig
pm-utils
policycoreutils
policycoreutils-devel
policycoreutils-python
polkit
polkit-gnome
poppler
poppler-data
poppler-glib
popt
ppl
ppl-pwl
ppp
pptp
prelink
preupgrade
procmail
procps-ng
psacct
psmisc
pth
pulseaudio
pulseaudio-gdm-hooks
pulseaudio-libs
pulseaudio-libs-glib2
pycairo
pygobject2
pygobject3
pygobject3-base
pygpgme
pygtk2
pygtk2-libglade
pyliblzma
pyorbit
pytalloc
python
python-chardet
python-decorator
python-deltarpm
python-ethtool
python-iniparse
python-IPy
python-kitchen
python-libs
python-meh
python-pexpect
python-pwquality
python-pycurl
python-slip
python-slip-dbus
python-urlgrabber
pyxdg
ql2400-firmware
ql2500-firmware
qrencode-libs
quota
quota-nls
raspberrypi-config
pidora-logos
raspberrypi-firstboot-mod
raspberrypi-kernel*
pidora-release
raspberrypi-release-notes
#raspberrypi-rootfs-resize
epiphany-rpi
rootfs-resize
raspberrypi-headless
raspberrypi-system-config-date
raspberrypi-system-config-keyboard
raspberrypi-system-config-keyboard-base
raspberrypi-vc-demo-source
raspberrypi-vc-firmware
raspberrypi-vc-libs
raspberrypi-vc-libs-devel
raspberrypi-vc-static
raspberrypi-vc-utils
raspi-splash
rdate
rdist
readline
recordmydesktop
redhat-menus
rmt
rng-tools
rootfiles
rpm
rpm-build-libs
rpm-libs
rpm-python
rsh
rsync
rsyslog
rtkit
ruby
rubygem-bigdecimal
rubygem-io-console
rubygem-json
rubygem-rdoc
rubygems
ruby-irb
ruby-libs
samba-libs
sed
selinux-policy
selinux-policy-devel
selinux-policy-doc
selinux-policy-targeted
sendmail
setools-libs
setools-libs-python
setroubleshoot
setroubleshoot-plugins
setroubleshoot-server
setserial
setup
setuptool
sg3_utils-libs
sgpio
shadow-utils
shared-mime-info
sl
slang
smartmontools
smp_utils
smp_utils-libs
sos
sound-theme-freedesktop
speex
spherical-cow-backgrounds-gnome
spherical-cow-backgrounds-single
sqlite
sssd
sssd-client
startup-notification
strace
stunnel
sudo
symlinks
system-config-firewall-base
system-config-firewall-tui
system-config-users
systemd
systemd-libs
systemd-sysv
sysvinit-tools
taglib
tar
tcpdump
tcp_wrappers
tcp_wrappers-libs
telnet
Terminal
Thunar
thunar-archive-plugin
thunar-media-tags-plugin
thunar-volman
time
tmpwatch
traceroute
tree
tumbler
tzdata
uboot-tools
udisks
udisks2
unique
units
unzip
upower
usb_modeswitch
usb_modeswitch-data
usbmuxd
usbutils
usermode
usermode-gtk
ustr
util-linux
vconfig
vim-minimal
vpnc
vpnc-script
vte
webkitgtk
webrtc-audio-processing
wget
which
wireless-tools
wiringpi
words
wpa_supplicant
xarchiver
xcb-util
xdg-user-dirs
xdg-user-dirs-gtk
xdg-utils
xfce4-about
xfce4-appfinder
xfce4-datetime-plugin
xfce4-icon-theme
xfce4-mixer
xfce4-notifyd
xfce4-panel
xfce4-places-plugin
xfce4-power-manager
xfce4-quicklauncher-plugin
xfce4-screenshooter
xfce4-screenshooter-plugin
xfce4-session
xfce4-session-engines
xfce4-settings
xfce4-xkb-plugin
xfconf
xfdesktop
xfsprogs
xfwm4
xfwm4-theme-nodoka
xfwm4-themes
xkeyboard-config
xml-common
xorg-x11-drv-evdev
xorg-x11-drv-fbdev
xorg-x11-drv-fbturbo
xorg-x11-fonts-ISO8859-1-100dpi
xorg-x11-font-utils
xorg-x11-server-common
xorg-x11-server-utils
xorg-x11-server-Xorg
xorg-x11-utils
xorg-x11-xauth
xorg-x11-xinit
xorg-x11-xkb-utils
xscreensaver-base
xz
xz-libs
yum
yumex
yum-langpacks
yum-metadata-parser
yum-presto
yum-utils
zd1211-firmware
zenity
zip
zlib
%end
# more configuration
%post --log=ks-log-info.txt
echo "##### $(date) - Post-installation file configuration"
#mkdir -p /mnt/sysimage/boot/grub2/
# /etc/fstab
cat << EOF > /etc/fstab
LABEL="rootfs" / ext4 defaults,noatime 1 1
LABEL="BOOT" /boot vfat defaults 1 2
EOF
#cat << EOF > /boot/config.txt
# Raspberry Pi configuration file
#
# Composite video mode: Disabled (HDMI output)
# Composite aspect ratio: Disabled
# Overscan: Disabled (image is full scan area)
# HDMI resolution: From EDID
# HDMI sound: Enabled
#
# Text fields for firstboot module follow:
#
#Title: HDMI only, no overscan
#Desc: HDMI output only. Picture may go off the edge of some screens.
#
#hdmi_force_hotplug=1
#disable_overscan=1
#hdmi_drive=2
#start_file=start_x.elf
#fixup_file=fixup_x.elf
#gpu_mem=128
#EOF
# /etc/hosts
cat << EOF > ${fsdir}/etc/hosts
127.0.0.1 localhost localhost.localdomain pidora.local
EOF
# root password
sed -i 's|^root:.*|root:x:0:0:root:/root:/bin/bash|' /etc/passwd
sed -i 's|^SELINUX=enforcing|SELINUX=permissive|' /etc/selinux/config
# hostname
cat << EOF > /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=pidora.local
NETWORKWAIT=1
EOF
# should be blacklisted, floods dmesg with logs
# /etc/modprobe.d/blacklist.conf
cat << EOF > /etc/modprobe.d/blacklist.conf
blacklist evbug
EOF
# create a releasever var
cat << EOF > /etc/yum/vars/releasever
20
EOF
#swapiness settings
cat << EOF > /etc/sysctl.conf
vm.swappiness=1
EOF
# Boot optimizations
cat << EOF > /tmp/optimize-systemd
#!/bin/bash
echo "Optimizing systemd within chroot."
#fedora-storage-init-late.service fedora-storage-init.service plymouth-halt.service plymouth-kexec.service plymouth-poweroff.service plymouth-quit.service plymouth-quit-wait.service plymouth-read-write.service plymouth-reboot.service plymouth-start.service mdmonitor.service mdmonitor-takeover.service auditd.service avahi-daemon.service avahi-daemon.socket bluetooth.target dev-hugepages.mount dev-mqueue.mount fedora-configure.service fedora-loadmodules.service fedora-readonly.service ip6tables.service sys-kernel-config.mount sys-kernel-debug.mount systemd-readahead-collect.service systemd-readahead-done.service systemd-readahead-done.timer systemd-readahead-replay.service
EOF
chmod 0755 /tmp/optimize-systemd
for i in gdm.service iprupdate.service iprdump.service iprinit.service firewalld.service auditd.service sendmail.service sm-client.service dmraid-activation.service bluetooth.service fedora-readonly.service sys-kerenl-debug.mount rtkit-daemon.service kmod-static-nodes.service
do
systemctl disable $i
systemctl mask $i
done
#modules loaded
for i in nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6table_mangle bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat nf_nat iptable_mangle nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_filter ebtables ip6table_filter ip6_tables nls_ascii autofs4
do
modprobe $i
done
# gtk icon theme
mkdir -p /etc/gtk-3.0/
cat << EOF > /etc/gtk-3.0/settings.ini
[Settings]
gtk-icon-theme-name=gnome
EOF
# Headless service file fix
cat << EOF > /usr/lib/systemd/system/headless-mode.service
[Unit]
Description=Checking the status of headless mode
After=sound.target network.target
Before=firstboot-graphical.service
[Service]
Type=simple
ExecStart=/usr/bin/headon
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
# Pidora 2014 Mock config file
cat << EOF > /etc/mock/pidora-20-armv6hl.cfg
# Auto-generated by the Koji build system
config_opts['root'] = 'pidora-19-armv6hl'
config_opts['chroothome'] = '/builddir'
config_opts['use_host_resolv'] = False
config_opts['basedir'] = '/var/lib/mock'
config_opts['rpmbuild_timeout'] = 86400
config_opts['yum.conf'] = '[main]\ncachedir=/var/cache/yum\ndebuglevel=1\nlogfile=/var/log/yum.log\nreposdir=/dev/null\nretries=20\nobsoletes=1\ngpgcheck=0\nassumeyes=1\n\n# repos\n\n[build]\nname=build\nbaseurl=http://koji.pidora.ca//repos/f20-build/30395/armv6hl\n'
config_opts['chroot_setup_cmd'] = 'groupinstall build'
config_opts['target_arch'] = 'armv6hl'
config_opts['root'] = 'f20'
config_opts['plugin_conf']['root_cache_enable'] = False
config_opts['plugin_conf']['yum_cache_enable'] = False
config_opts['plugin_conf']['ccache_enable'] = False
config_opts['macros']['%_host'] = 'armv6hl-koji-linux-gnu'
config_opts['macros']['%_host_cpu'] = 'armv6hl'
config_opts['macros']['%vendor'] = 'Koji'
config_opts['macros']['%distribution'] = 'Koji Testing'
config_opts['macros']['%_topdir'] = '/builddir/build'
config_opts['macros']['%_rpmfilename'] = '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'
config_opts['macros']['%packager'] = 'Koji'
EOF
# Enable needed services
for i in nortc.service lightdm.service firstboot-graphical.service polkit.service headless-mode.service
do
systemctl enable $i
done
# Missing symlink for sendmail.pid
ln -s /var/run /run
# run ld config for raspberrypi-vc-libs
ldconfig
# set graphical target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
echo "##### $(date) - Final configurations"
# Firstboot timezone bug fix
sed -i "s|self.priority = 99|self.priority = 98|" /usr/share/firstboot/modules/date.py
# Firstboot reboot fix
echo ' os.system("/sbin/reboot")' >> /usr/sbin/firstboot
# Turning of quiet mode for debug purposes
#sed -i "s|quiet||" /boot/cmdline.txt
# selinux disabled (memory requirements)
sed -i "s|SELINUX=.*|SELINUX=disabled|" /etc/selinux/config
for X in passwd shadow group gshadow
do
echo "==================================== $X"
ls -l /etc/$X
echo "------------------------------------"
cat /etc/$X
done
echo "===================================="
pwconv
grpconv
# password for root (password=raspberrypi, overwritten by firstboot)
sed -i 's|root:.*:|root:$6$KW0GGbE5$zlEB9.PbHVh8kmXj1WMFGLJGwwthhU4oXn2oNxHZllbUSzTsVhTZ9jts8RC7uicuUCWyrsZ1e2yEj4ErDLOHQ/:15525:0:99999:7:::|' /etc/shadow
# default network configuration (dhcp)
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED=yes
EOF
# force remove this package
yum remove -y gnome-session-xsession
%end