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.

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