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.

440 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. # cinnamon configuration
  269. # create /etc/sysconfig/desktop (needed for installation)
  270. cat > /etc/sysconfig/desktop <<EOF
  271. PREFERRED=/usr/bin/cinnamon-session
  272. DISPLAYMANAGER=/usr/sbin/lightdm
  273. EOF
  274. cat >> /etc/rc.d/init.d/livesys << EOF
  275. # set up lightdm autologin
  276. sed -i 's/^#autologin-user=.*/autologin-user=liveuser/' /etc/lightdm/lightdm.conf
  277. sed -i 's/^#autologin-user-timeout=.*/autologin-user-timeout=0/' /etc/lightdm/lightdm.conf
  278. #sed -i 's/^#show-language-selector=.*/show-language-selector=true/' /etc/lightdm/lightdm-gtk-greeter.conf
  279. # set Cinnamon as default session, otherwise login will fail
  280. sed -i 's/^#user-session=.*/user-session=cinnamon/' /etc/lightdm/lightdm.conf
  281. # Show harddisk install on the desktop
  282. sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop
  283. mkdir /home/liveuser/Desktop
  284. cp /usr/share/applications/liveinst.desktop /home/liveuser/Desktop
  285. # and mark it as executable
  286. chmod +x /home/liveuser/Desktop/liveinst.desktop
  287. # this goes at the end after all other changes.
  288. chown -R liveuser:liveuser /home/liveuser
  289. restorecon -R /home/liveuser
  290. EOF
  291. # go to the backgrounds folder for custom images
  292. cd /usr/share/backgrounds/images
  293. # fetch custom RIT backgrounds
  294. # Fetch rpm fusion scripts
  295. su -c "mkdir -p /usr/share/autostart"
  296. su -c "chmod a+rwx FusionEnableLauncher.py"
  297. su -c "chmod a+rwx enablerpmfusion.sh"
  298. su -c "cp FusionEnableLauncher.py /usr/share/autostart/FusionEnableLauncher.py"
  299. su -c "cp enablerpmfusion.sh /usr/share/autostart/enablerpmfusion.sh"
  300. # Download and install google chrome
  301. su -c "dnf install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm"
  302. %end
  303. %packages
  304. @anaconda-tools
  305. @base-x
  306. @cinnamon-desktop
  307. @core
  308. @dial-up
  309. @fonts
  310. @guest-desktop-agents
  311. @hardware-support
  312. @input-methods
  313. @libreoffice
  314. @multimedia
  315. @networkmanager-submodules
  316. @printing
  317. @standard
  318. aajohan-comfortaa-fonts
  319. anaconda
  320. desktop-backgrounds-basic
  321. dracut-live
  322. f24-backgrounds-extras-gnome
  323. generic-logos
  324. generic-release
  325. generic-release-notes
  326. gimp
  327. glibc-all-langpacks
  328. grub2-efi
  329. hexchat
  330. htop
  331. inkscape
  332. kernel
  333. kernel-modules
  334. kernel-modules-extra
  335. lynx
  336. memtest86+
  337. parole
  338. pidgin
  339. playonlinux
  340. rhythmbox
  341. syslinux
  342. transmission
  343. yumex-dnf
  344. zsh
  345. #exclude things (packagekit breaks things, fedora-* packages are replaced by ones we customized.)
  346. -PackageKit*
  347. -autofs
  348. -coolkey
  349. -fedora-bookmarks
  350. -fedora-icon-theme
  351. -fedora-logos
  352. -fedora-release
  353. -fedora-release-notes
  354. -hplip
  355. -isdn4k-utils
  356. -mpage
  357. -numactl
  358. -policycoreutils-gui
  359. -sane-backends
  360. -sox
  361. -system-config-boot
  362. -system-config-language
  363. -system-config-network
  364. -system-config-rootpassword
  365. -system-config-services
  366. -xsane
  367. -xsane-gimp
  368. %end