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.

452 lines
12 KiB

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