Fedora Remix maintained by the Rochester Institute of Technology (RIT) Linux Users Group, targeted at users new to Linux and RIT students, faculty, and staff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

444 lines
12 KiB

  1. #version=DEVEL
  2. # X Window System configuration information
  3. xconfig --startxonboot
  4. # Keyboard layouts
  5. keyboard 'us'
  6. # Use network installation
  7. url --mirrorlist="https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch"
  8. # System language
  9. lang en_US.UTF-8
  10. # Firewall configuration
  11. firewall --enabled --service=mdns
  12. repo --name="fedora" --mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
  13. repo --name="updates" --mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
  14. repo --name="rpmfusion-free" --mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-$releasever&arch=$basearch --includepkgs=rpmfusion-free-release
  15. repo --name="rpmfusion-free-updates" --mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-$releasever&arch=$basearch --includepkgs=rpmfusion-free-release
  16. # Shutdown after installation
  17. shutdown
  18. # Network information
  19. network --bootproto=dhcp --device=link --activate
  20. # System timezone
  21. timezone US/Eastern
  22. # System authorization information
  23. auth --useshadow --passalgo=sha512
  24. # SELinux configuration
  25. selinux --enforcing
  26. # System services
  27. services --disabled="sshd" --enabled="NetworkManager,ModemManager"
  28. # System bootloader configuration
  29. bootloader --location=none
  30. # Clear the Master Boot Record
  31. zerombr
  32. # Partition clearing information
  33. clearpart --all
  34. # Disk partitioning information
  35. part / --fstype="ext4" --size=5120
  36. part / --size=6144
  37. %post
  38. # FIXME: it'd be better to get this installed from a package
  39. cat > /etc/rc.d/init.d/livesys << EOF
  40. #!/bin/bash
  41. #
  42. # live: Init script for live image
  43. #
  44. # chkconfig: 345 00 99
  45. # description: Init script for live image.
  46. ### BEGIN INIT INFO
  47. # X-Start-Before: display-manager chronyd
  48. ### END INIT INFO
  49. . /etc/init.d/functions
  50. if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then
  51. exit 0
  52. fi
  53. if [ -e /.liveimg-configured ] ; then
  54. configdone=1
  55. fi
  56. exists() {
  57. which \$1 >/dev/null 2>&1 || return
  58. \$*
  59. }
  60. livedir="LiveOS"
  61. for arg in \`cat /proc/cmdline\` ; do
  62. if [ "\${arg##rd.live.dir=}" != "\${arg}" ]; then
  63. livedir=\${arg##rd.live.dir=}
  64. return
  65. fi
  66. if [ "\${arg##live_dir=}" != "\${arg}" ]; then
  67. livedir=\${arg##live_dir=}
  68. return
  69. fi
  70. done
  71. # enable swaps unless requested otherwise
  72. swaps=\`blkid -t TYPE=swap -o device\`
  73. if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
  74. for s in \$swaps ; do
  75. action "Enabling swap partition \$s" swapon \$s
  76. done
  77. fi
  78. if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /run/initramfs/live/\${livedir}/swap.img ] ; then
  79. action "Enabling swap file" swapon /run/initramfs/live/\${livedir}/swap.img
  80. fi
  81. mountPersistentHome() {
  82. # support label/uuid
  83. if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
  84. homedev=\`/sbin/blkid -o device -t "\$homedev"\`
  85. fi
  86. # if we're given a file rather than a blockdev, loopback it
  87. if [ "\${homedev##mtd}" != "\${homedev}" ]; then
  88. # mtd devs don't have a block device but get magic-mounted with -t jffs2
  89. mountopts="-t jffs2"
  90. elif [ ! -b "\$homedev" ]; then
  91. loopdev=\`losetup -f\`
  92. if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
  93. action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
  94. fi
  95. losetup \$loopdev \$homedev
  96. homedev=\$loopdev
  97. fi
  98. # if it's encrypted, we need to unlock it
  99. if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
  100. echo
  101. echo "Setting up encrypted /home device"
  102. plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
  103. homedev=/dev/mapper/EncHome
  104. fi
  105. # and finally do the mount
  106. mount \$mountopts \$homedev /home
  107. # if we have /home under what's passed for persistent home, then
  108. # we should make that the real /home. useful for mtd device on olpc
  109. if [ -d /home/home ]; then mount --bind /home/home /home ; fi
  110. [ -x /sbin/restorecon ] && /sbin/restorecon /home
  111. if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
  112. }
  113. findPersistentHome() {
  114. for arg in \`cat /proc/cmdline\` ; do
  115. if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
  116. homedev=\${arg##persistenthome=}
  117. return
  118. fi
  119. done
  120. }
  121. if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
  122. findPersistentHome
  123. elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then
  124. homedev=/run/initramfs/live/\${livedir}/home.img
  125. fi
  126. # if we have a persistent /home, then we want to go ahead and mount it
  127. if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
  128. action "Mounting persistent /home" mountPersistentHome
  129. fi
  130. if [ -n "\$configdone" ]; then
  131. exit 0
  132. fi
  133. # add fedora user with no passwd
  134. action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
  135. passwd -d liveuser > /dev/null
  136. usermod -aG wheel liveuser > /dev/null
  137. # Remove root password lock
  138. passwd -d root > /dev/null
  139. # turn off firstboot for livecd boots
  140. systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
  141. systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
  142. systemctl stop firstboot-text.service 2> /dev/null || :
  143. systemctl stop firstboot-graphical.service 2> /dev/null || :
  144. # don't use prelink on a running live image
  145. sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :
  146. # turn off mdmonitor by default
  147. systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
  148. systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
  149. systemctl stop mdmonitor.service 2> /dev/null || :
  150. systemctl stop mdmonitor-takeover.service 2> /dev/null || :
  151. # don't enable the gnome-settings-daemon packagekit plugin
  152. gsettings set org.gnome.software download-updates 'false' || :
  153. # don't start cron/at as they tend to spawn things which are
  154. # disk intensive that are painful on a live image
  155. systemctl --no-reload disable crond.service 2> /dev/null || :
  156. systemctl --no-reload disable atd.service 2> /dev/null || :
  157. systemctl stop crond.service 2> /dev/null || :
  158. systemctl stop atd.service 2> /dev/null || :
  159. # Don't sync the system clock when running live (RHBZ #1018162)
  160. sed -i 's/rtcsync//' /etc/chrony.conf
  161. # Mark things as configured
  162. touch /.liveimg-configured
  163. # add static hostname to work around xauth bug
  164. # https://bugzilla.redhat.com/show_bug.cgi?id=679486
  165. # the hostname must be something else than 'localhost'
  166. # https://bugzilla.redhat.com/show_bug.cgi?id=1370222
  167. echo "localhost-live" > /etc/hostname
  168. EOF
  169. # bah, hal starts way too late
  170. cat > /etc/rc.d/init.d/livesys-late << EOF
  171. #!/bin/bash
  172. #
  173. # live: Late init script for live image
  174. #
  175. # chkconfig: 345 99 01
  176. # description: Late init script for live image.
  177. . /etc/init.d/functions
  178. if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
  179. exit 0
  180. fi
  181. exists() {
  182. which \$1 >/dev/null 2>&1 || return
  183. \$*
  184. }
  185. touch /.liveimg-late-configured
  186. # read some variables out of /proc/cmdline
  187. for o in \`cat /proc/cmdline\` ; do
  188. case \$o in
  189. ks=*)
  190. ks="--kickstart=\${o#ks=}"
  191. ;;
  192. xdriver=*)
  193. xdriver="\${o#xdriver=}"
  194. ;;
  195. esac
  196. done
  197. # if liveinst or textinst is given, start anaconda
  198. if strstr "\`cat /proc/cmdline\`" liveinst ; then
  199. plymouth --quit
  200. /usr/sbin/liveinst \$ks
  201. fi
  202. if strstr "\`cat /proc/cmdline\`" textinst ; then
  203. plymouth --quit
  204. /usr/sbin/liveinst --text \$ks
  205. fi
  206. # configure X, allowing user to override xdriver
  207. if [ -n "\$xdriver" ]; then
  208. cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
  209. Section "Device"
  210. Identifier "Videocard0"
  211. Driver "\$xdriver"
  212. EndSection
  213. FOE
  214. fi
  215. EOF
  216. chmod 755 /etc/rc.d/init.d/livesys
  217. /sbin/restorecon /etc/rc.d/init.d/livesys
  218. /sbin/chkconfig --add livesys
  219. chmod 755 /etc/rc.d/init.d/livesys-late
  220. /sbin/restorecon /etc/rc.d/init.d/livesys-late
  221. /sbin/chkconfig --add livesys-late
  222. # enable tmpfs for /tmp
  223. systemctl enable tmp.mount
  224. # make it so that we don't do writing to the overlay for things which
  225. # are just tmpdirs/caches
  226. # note https://bugzilla.redhat.com/show_bug.cgi?id=1135475
  227. cat >> /etc/fstab << EOF
  228. vartmp /var/tmp tmpfs defaults 0 0
  229. EOF
  230. # work around for poor key import UI in PackageKit
  231. rm -f /var/lib/rpm/__db*
  232. releasever=$(rpm -q --qf '%{version}\n' --whatprovides system-release)
  233. basearch=$(uname -i)
  234. rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
  235. echo "Packages within this LiveCD"
  236. rpm -qa
  237. # Note that running rpm recreates the rpm db files which aren't needed or wanted
  238. rm -f /var/lib/rpm/__db*
  239. # go ahead and pre-make the man -k cache (#455968)
  240. /usr/bin/mandb
  241. # make sure there aren't core files lying around
  242. rm -f /core*
  243. # remove random seed, the newly installed instance should make it's own
  244. rm -f /var/lib/systemd/random-seed
  245. # convince readahead not to collect
  246. # FIXME: for systemd
  247. echo 'File created by kickstart. See systemd-update-done.service(8).' \
  248. | tee /etc/.updated >/var/.updated
  249. # Drop the rescue kernel and initramfs, we don't need them on the live media itself.
  250. # See bug 1317709
  251. rm -f /boot/\*-rescue*
  252. # Disable network service here, as doing it in the services line
  253. # fails due to RHBZ #1369794
  254. /sbin/chkconfig network off
  255. # Remove machine-id on pre generated images
  256. rm -f /etc/machine-id
  257. touch /etc/machine-id
  258. %end
  259. %post --nochroot
  260. cp $INSTALL_ROOT/usr/share/licenses/\*-release/\* $LIVE_ROOT/
  261. # only works on x86, x86_64
  262. if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
  263. if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
  264. cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS
  265. fi
  266. %end
  267. %post
  268. # THIS IS ALL RUN IN THE LIVE ROOT
  269. # cinnamon configuration
  270. # create /etc/sysconfig/desktop (needed for installation)
  271. cat > /etc/sysconfig/desktop <<EOF
  272. PREFERRED=/usr/bin/cinnamon-session
  273. DISPLAYMANAGER=/usr/sbin/lightdm
  274. EOF
  275. cat >> /etc/rc.d/init.d/livesys << EOF
  276. # set up lightdm autologin
  277. sed -i 's/^#autologin-user=.*/autologin-user=liveuser/' /etc/lightdm/lightdm.conf
  278. sed -i 's/^#autologin-user-timeout=.*/autologin-user-timeout=0/' /etc/lightdm/lightdm.conf
  279. #sed -i 's/^#show-language-selector=.*/show-language-selector=true/' /etc/lightdm/lightdm-gtk-greeter.conf
  280. # set Cinnamon as default session, otherwise login will fail
  281. sed -i 's/^#user-session=.*/user-session=cinnamon/' /etc/lightdm/lightdm.conf
  282. # Show harddisk install on the desktop
  283. sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop
  284. mkdir /home/liveuser/Desktop
  285. cp /usr/share/applications/liveinst.desktop /home/liveuser/Desktop
  286. # and mark it as executable
  287. chmod +x /home/liveuser/Desktop/liveinst.desktop
  288. # this goes at the end after all other changes.
  289. chown -R liveuser:liveuser /home/liveuser
  290. restorecon -R /home/liveuser
  291. EOF
  292. %end
  293. %post --nochroot
  294. # go to the backgrounds folder for custom images
  295. cd /usr/share/backgrounds/images
  296. # fetch custom RIT backgrounds
  297. #FIXME
  298. # Fetch rpm fusion scripts
  299. mkdir -p $INSTALL_ROOT/usr/share/autostart
  300. mkdir -p $INSTALLROOT/usr/local/tigeros
  301. cp -r /scripts/ $INSTALL_ROOT/usr/local/tigeros/
  302. ln -s $INSTALL_ROOT/home/liveuser/enablerpmfusion.sh $INSTALL_ROOT/usr/share/autostart/enablerpmfusion.sh
  303. ln -s $INSTALL_ROOT/usr/local/tigeros/FusionEnableLauncher.py $INSTALL_ROOT/usr/share/autostart/FusionEnableLauncher.py
  304. ln -s $INSTALL_ROOT/usr/local/tigeros/postinstall $INSTALL_ROOT/usr/share/autostart/postinstall
  305. chmod -R 755 $INSTALL_ROOT/usr/local/tigeros/
  306. # Download and install google chrome
  307. dnf --installroot=$INSTALL_ROOT install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
  308. restorecon -R $INSTALL_ROOT/home/liveuser
  309. %end
  310. %packages
  311. @anaconda-tools
  312. @base-x
  313. @cinnamon-desktop
  314. @core
  315. @dial-up
  316. @fonts
  317. @guest-desktop-agents
  318. @hardware-support
  319. @input-methods
  320. @libreoffice
  321. @multimedia
  322. @networkmanager-submodules
  323. @printing
  324. @standard
  325. aajohan-comfortaa-fonts
  326. anaconda
  327. desktop-backgrounds-basic
  328. dracut-live
  329. f24-backgrounds-extras-gnome
  330. generic-logos
  331. generic-release
  332. generic-release-notes
  333. gimp
  334. glibc-all-langpacks
  335. grub2-efi
  336. hexchat
  337. htop
  338. inkscape
  339. kernel
  340. kernel-modules
  341. kernel-modules-extra
  342. lynx
  343. memtest86+
  344. parole
  345. pidgin
  346. rhythmbox
  347. syslinux
  348. transmission
  349. yumex-dnf
  350. zsh
  351. #exclude things (packagekit breaks things, fedora-* packages are replaced by ones we customized.)
  352. -PackageKit*
  353. -autofs
  354. -coolkey
  355. -fedora-bookmarks
  356. -fedora-icon-theme
  357. -fedora-logos
  358. -fedora-release
  359. -fedora-release-notes
  360. -hplip
  361. -isdn4k-utils
  362. -mpage
  363. -numactl
  364. -policycoreutils-gui
  365. -sane-backends
  366. -sox
  367. -system-config-boot
  368. -system-config-language
  369. -system-config-network
  370. -system-config-rootpassword
  371. -system-config-services
  372. -xsane
  373. -xsane-gimp
  374. %end