Browse Source

Added -y tag to dnf removal. Added code to potentially close port 27017 from semanage. Needs testing.

website
Tim Zabel 7 years ago
parent
commit
eebfad3542
11 changed files with 247 additions and 76 deletions
  1. +22
    -0
      ci-build.sh
  2. +2
    -1
      make-iso.sh
  3. +0
    -0
      scripts/FusionEnableLauncher.py
  4. +75
    -0
      scripts/cs/idea.sh
  5. +29
    -47
      scripts/cs/jflap.sh
  6. +0
    -0
      scripts/enablerpmfusion.sh
  7. +21
    -14
      scripts/postinstall
  8. +7
    -0
      scripts/removal
  9. +53
    -0
      scripts/se/alloy.sh
  10. +20
    -0
      scripts/se/spin.sh
  11. +18
    -14
      tigeros.ks

+ 22
- 0
ci-build.sh View File

@ -0,0 +1,22 @@
#!/bin/bash
set -eu
#####################################################################
# TigerOS Build Script for running on the build box with Jenkins CI #
# @author: Aidan Kahrs #
# #
# Usage: sudo bash build.sh #
# #
#####################################################################
wget -O tigeros.ks https://raw.githubusercontent.com/RITlug/TigerOS/master/tigeros.ks
mock -r fedora-25-x86_64 --init
mock -r fedora-25-x86_64 --copyin tigeros.ks ./tigeros.ks
mock -r fedora-25-x86_64 --install lorax-lmc-novirt git vim-minimal pykickstart svn
mock -r fedora-25-x86_64 --chroot "svn export https://github.com/RITlug/TigerOS/trunk/scripts/"
mock -r fedora-25-x86_64 --chroot "livemedia-creator --ks tigeros.ks --no-virt --resultdir /var/lmc --project TigerOS-Live --make-iso --volid TigerOS --iso-only --iso-name TigerOS.iso --releasever 25 --title TigerOS-live --macboot"
mock -r fedora-25-x86_64 --copyout /var/lmc/TigerOS.iso /srv/isos/TigerOS.iso
rm -rf /var/lmc/
cd /srv/isos/
sha512sum *.iso >CHECKSUM512

+ 2
- 1
make-iso.sh View File

@ -14,7 +14,8 @@ reset=`tput sgr0`
echo "${green}Welcome to the TigerOS build script${reset}" echo "${green}Welcome to the TigerOS build script${reset}"
mock -r fedora-25-x86_64 --init mock -r fedora-25-x86_64 --init
mock -r fedora-25-x86_64 --copyin tigeros.ks ./tigeros.ks mock -r fedora-25-x86_64 --copyin tigeros.ks ./tigeros.ks
mock -r fedora-25-x86_64 --install lorax-lmc-novirt git vim-minimal pykickstart
mock -r fedora-25-x86_64 --install lorax-lmc-novirt git vim-minimal pykickstart svn
mock -r fedora-25-x86_64 --chroot "svn export https://github.com/RITlug/TigerOS/trunk/scripts/"
echo "${green}Beginning build process${reset}" echo "${green}Beginning build process${reset}"
mock -r fedora-25-x86_64 --chroot "livemedia-creator --ks tigeros.ks --no-virt --resultdir /var/lmc --project TigerOS-Live --make-iso --volid TigerOS --iso-only --iso-name TigerOS.iso --releasever 25 --title TigerOS-live --macboot" mock -r fedora-25-x86_64 --chroot "livemedia-creator --ks tigeros.ks --no-virt --resultdir /var/lmc --project TigerOS-Live --make-iso --volid TigerOS --iso-only --iso-name TigerOS.iso --releasever 25 --title TigerOS-live --macboot"
mock -r fedora-25-x86_64 --copyout /var/lmc/TigerOS.iso TigerOS.iso mock -r fedora-25-x86_64 --copyout /var/lmc/TigerOS.iso TigerOS.iso

+ 0
- 0
scripts/FusionEnableLauncher.py View File


+ 75
- 0
scripts/cs/idea.sh View File

@ -0,0 +1,75 @@
#!/bin/sh -e
# IntelliJ installer script for TigerOS
# author: Josh Bicking <jhb2345@rit.edu>
DEPS=java-1.8.0-openjdk
PROG="IntelliJ IDEA Community Edition"
PROG_SHORT=idea-ce
VERSION=idea-IC-171.4073.35
TEMP_FILE=/tmp/ideaIC-2017.1.1.tar.gz
FILE_DIR=/usr/local
FILE=$FILE_DIR/$VERSION/bin/idea.sh
FILE_URL=https://download.jetbrains.com/idea/ideaIC-2017.1.1.tar.gz
LINK=$FILE_DIR/bin/$PROG_SHORT
ICON=$FILE_DIR/$VERSION/bin/idea.png
# Check that the current user is root
if [ $EUID != 0 ]
then
echo "Please run this script as root (sudo $@$0)."
exit
fi
## Removal
# Check if remove flag was passed
if [ ! -z "$1" ] && [ "$1" = "--remove" ]
then
rm $LINK
rm /usr/local/share/applications/jetbrains-idea-ce.desktop
rm -rf $FILE_DIR/$VERSION
# Remove local links if they were created
for i in `ls /home/`
do
rm -f /home/$i/.local/share/applications/jetbrains-idea-ce.desktop
done
else
## Installation
# Install dependencies
dnf install $DEPS -y
# Get the files
wget -O $TEMP_FILE $FILE_URL
# Extract the files
tar -xf $TEMP_FILE -C $FILE_DIR
# Make a link
ln -s $FILE $LINK
chmod +x $LINK
chmod -R 755 $FILE_DIR/$VERSION
# Make a desktop file
# IDEA's first time setup allows the user to make this file. Naming it as such means the user won't get a duplicate entry.
cat > /usr/local/share/applications/jetbrains-idea-ce.desktop <<EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=$PROG
Comment=The Drive to Develop
Exec=$LINK %f
Icon=$ICON
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=jetbrains-idea-ce
EOF
# Clean up
rm $TEMP_FILE
fi

+ 29
- 47
scripts/cs/jflap.sh View File

@ -1,11 +1,11 @@
#!/bin/sh -e #!/bin/sh -e
## JFLAP v7
# JFLAP installer script for TigerOS
# author: Josh Bicking <jhb2345@rit.edu>
DEPS=java-1.8.0-openjdk DEPS=java-1.8.0-openjdk
PROG=JFLAP PROG=JFLAP
DIR=/usr/share/java/JFLAP
FILE=JFLAP.jar
FILE=/usr/share/java/JFLAP.jar
FILE_URL=http://www.jflap.org/jflaptmp/may15-2011/withoutSource/JFLAP.jar FILE_URL=http://www.jflap.org/jflaptmp/may15-2011/withoutSource/JFLAP.jar
LINK=/usr/local/bin/jflap LINK=/usr/local/bin/jflap
ICON_URL=http://jflap.org/jflapLogo2.jpg ICON_URL=http://jflap.org/jflapLogo2.jpg
@ -18,69 +18,51 @@ then
exit exit
fi fi
## Removal
# Check if remove flag was passed
if [ ! -z "$1" ] && [ "$1" = "--remove" ]
then
# Install dependencies
rm $LINK
rm /usr/local/share/applications/$PROG.desktop
rm $FILE
rm /usr/local/share/icons/$PROG.jpg
dnf install $DEPS -y
else
## Installation
# Install dependencies
dnf install $DEPS -y
# Make the dirs
# Get the files
curl -o $FILE $FILE_URL
mkdir -p $DIR
# Get the files
curl -o $DIR/$FILE $FILE_URL
# Make a link
cat > $LINK <<EOF
# Make a link
cat > $LINK <<EOF
#!/bin/sh #!/bin/sh
cd \$HOME cd \$HOME
java -jar $DIR/$FILE
java -jar $FILE
EOF EOF
chmod +x $LINK
chmod +x $DIR/$FILE
chmod +x $LINK
chmod +x $FILE
# Make a desktop file
cat > /usr/local/share/applications/$PROG.desktop <<EOF
# Make a desktop file
cat > /usr/local/share/applications/$PROG.desktop <<EOF
[Desktop Entry] [Desktop Entry]
# The type as listed above
Type=Application Type=Application
# The version of the desktop entry specification to which this file complies
Version=7.0 Version=7.0
# The name of the application
Name=$PROG Name=$PROG
# A comment which can/will be used as a tooltip
Comment=Experiment with formal languages topics Comment=Experiment with formal languages topics
# The path to the folder in which the executable is run
Path= Path=
# The executable of the application, possibly with arguments.
Exec=$LINK Exec=$LINK
# The name of the icon that will be used to display this entry
Icon=/usr/local/share/icons/$PROG.jpg Icon=/usr/local/share/icons/$PROG.jpg
# Describes whether this application needs to be run in a terminal or not
Terminal=false Terminal=false
# Describes the categories in which this entry should be shown
Categories=Education;Languages;Java; Categories=Education;Languages;Java;
EOF EOF
# Get the icons
mkdir -p /usr/local/share/icons
curl -o /usr/local/share/icons/$PROG.jpg $ICON_URL
# Get the icons
mkdir -p /usr/local/share/icons
curl -o /usr/local/share/icons/$PROG.jpg $ICON_URL
fi

+ 0
- 0
scripts/enablerpmfusion.sh View File


+ 21
- 14
scripts/postinstall View File

@ -1,11 +1,13 @@
#!/bin/bash #!/bin/bash
# TigerOS postinstall package setup script # TigerOS postinstall package setup script
# author: Aidan Kahrs <axk4545@rit.edu>
# Check that the current user is root # Check that the current user is root
if [ $EUID != 0 ] if [ $EUID != 0 ]
then then
echo "Please run this script as root (sudo $@$0)."
echo "Please run this script as root ( $@$0)."
exit exit
fi fi
echo -e "Welcome to the TigerOS post install script.\n echo -e "Welcome to the TigerOS post install script.\n
@ -19,7 +21,7 @@ do
case $opt in case $opt in
"CS") "CS")
echo -e "Welcome to the TigerOS CS package installer script.\n echo -e "Welcome to the TigerOS CS package installer script.\n
This script will install Intellij, PyCharm, prolog, racket and JFLAP on your machine."
This script will install Intellij IDEA, PyCharm, PROLOG, Racket and JFLAP on your machine."
while true; do while true; do
read -p "Do you wish to continue? [y/n] " yn read -p "Do you wish to continue? [y/n] " yn
case $yn in case $yn in
@ -27,7 +29,11 @@ do
[Nn]* ) exit;; [Nn]* ) exit;;
esac esac
done done
#call/execute installer scripts here.
./cs/idea.sh
# TODO Pycharm
# TODO PROLOG
# TODO Racket
./cs/jflap.sh
;; ;;
"IT/WMC") "IT/WMC")
echo -e "Welcome to the TigerOS IT/WMC package installer script. echo -e "Welcome to the TigerOS IT/WMC package installer script.
@ -40,14 +46,15 @@ do
esac esac
done done
wget https://dev.mysql.com/get/mysql57-community-release-fc25-9.noarch.rpm -O mysql-repo.rpm wget https://dev.mysql.com/get/mysql57-community-release-fc25-9.noarch.rpm -O mysql-repo.rpm
sudo dnf install mysql-repo.rpm
sudo dnf install mysql-community-server
echo "mysql installed see https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/ step 4 for further instructions"
sudo dnf install mongodb
sudo semanage port -a -t mongod_port_t -p tcp 27017
#sudo dnf install httpd
sudo dnf install subversion filezilla nodejs php
#call jGRASP script here
dnf install -y mysql-repo.rpm
dnf install -y mysql-community-server
echo "mysql installed see "https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/" step 4 for further instructions"
dnf install -y mongodb
semanage port -a -t mongod_port_t -p tcp 27017
# dnf install -y httpd
dnf install -y subversion filezilla nodejs php
#call jGRASP script here
mysql_secure_installation
echo "Install finished" echo "Install finished"
exit exit
;; ;;
@ -61,7 +68,7 @@ do
[Nn]* ) exit;; [Nn]* ) exit;;
esac esac
done done
sudo dnf install wireshark python python3
dnf install -y wireshark-gtk python python3
#call jGrasp installer script here #call jGrasp installer script here
echo "Install finished" echo "Install finished"
exit exit
@ -76,8 +83,8 @@ do
[Nn]* ) exit;; [Nn]* ) exit;;
esac esac
done done
sudo dnf install eclipse-jdt ruby sqlite
#call Spin and Alloy install scripts here
dnf install -y eclipse-jdt ruby sqlite
./se/spin.sh && ./se/alloy.sh
echo "Install finished" echo "Install finished"
exit exit
;; ;;

+ 7
- 0
scripts/removal View File

@ -42,9 +42,16 @@ do
[Nn]* ) exit;; [Nn]* ) exit;;
esac esac
done done
<<<<<<< HEAD
sudo dnf -y remove mongodb subversion filezilla nodejs php mysql-repo.rpm mysql-community-server sudo dnf -y remove mongodb subversion filezilla nodejs php mysql-repo.rpm mysql-community-server
sudo semanage port -d -t mongod_port_t -p tcp 27017 sudo semanage port -d -t mongod_port_t -p tcp 27017
# WARNING --> port 27017 must be tested to make sure the above line of code closes it # WARNING --> port 27017 must be tested to make sure the above line of code closes it
=======
sudo dnf remove mongodb subversion filezilla nodejs php mysql-repo.rpm mysql-community-server
semanage port -d -t mongod_port_t -p tcp 27017
firewall-cmd --del-port=22017/tcp --permanent && firewall-cmd --reload
# jGrasp installer script must be implemented before it can be removed.
>>>>>>> 0af9527f0b706733ffa103ccb634d93f08c506f5
;; ;;
"NSSA/CIT") "NSSA/CIT")
echo -e "Welcome to the TigerOS NSSA/CIT package removal script.\n echo -e "Welcome to the TigerOS NSSA/CIT package removal script.\n

+ 53
- 0
scripts/se/alloy.sh View File

@ -0,0 +1,53 @@
#!/bin/sh -e
# JFLAP installer script for TigerOS
# author: Josh Bicking <jhb2345@rit.edu>
DEPS=java-1.8.0-openjdk
PROG=Alloy
FILE=/usr/share/java/alloy.jar
FILE_URL=http://alloy.mit.edu/alloy/downloads/alloy4.2.jar
LINK=/usr/local/bin/alloy
# Check that the current user is root
if [ $EUID != 0 ]
then
echo "Please run this script as root (sudo $@$0)."
exit
fi
# Install dependencies
dnf install $DEPS -y
# Get the files
curl -o $FILE $FILE_URL
# Make a link
cat > $LINK <<EOF
#!/bin/sh
cd \$HOME
java -jar $FILE
EOF
chmod +x $LINK
chmod +x $FILE
# Make a desktop file
cat > /usr/local/share/applications/$PROG.desktop <<EOF
[Desktop Entry]
Type=Application
Version=7.0
Name=$PROG
Comment=Experiment with formal languages topics
Path=
Exec=$LINK
Icon=/usr/local/share/icons/$PROG.jpg
Terminal=false
Categories=Education;Languages;Java;
EOF
# Get the icons
mkdir -p /usr/local/share/icons
unzip -j "$FILE" "images/logo.gif" -d "alloy.gif"

+ 20
- 0
scripts/se/spin.sh View File

@ -0,0 +1,20 @@
#!/bin/bash
# Spin install script for TigerOS
# author: Aidan Kahrs <axk4545@rit.edu>
# Check that the current user is root
if [ $EUID != 0 ]
then
echo "Please run this script as root (sudo $@$0)."
exit
fi
wget http://spinroot.com/spin/Src/spin646.tar.gz -O /tmp/spin.tar.gz
tar -xvf /tmp/spin.tar.gz
cd /tmp/Spin/Src*
dnf install -y byacc
make
install -p -m 755 spin /usr/local/bin/spin
sed -i 's#BIN=/usr/bin#BIN=/usr/local/bin#g' /tmp/Spin/iSpin/install.sh
dnf install tcl tk
bash /tmp/Spin/iSpin/install.sh
dnf remove byacc

+ 18
- 14
tigeros.ks View File

@ -242,8 +242,8 @@ fi
if [ -n "\$xdriver" ]; then if [ -n "\$xdriver" ]; then
cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
Section "Device" Section "Device"
Identifier "Videocard0"
Driver "\$xdriver"
Identifier "Videocard0"
Driver "\$xdriver"
EndSection EndSection
FOE FOE
fi fi
@ -295,7 +295,7 @@ echo 'File created by kickstart. See systemd-update-done.service(8).' \
# Drop the rescue kernel and initramfs, we don't need them on the live media itself. # Drop the rescue kernel and initramfs, we don't need them on the live media itself.
# See bug 1317709 # See bug 1317709
rm -f /boot/*-rescue*
rm -f /boot/\*-rescue*
# Disable network service here, as doing it in the services line # Disable network service here, as doing it in the services line
# fails due to RHBZ #1369794 # fails due to RHBZ #1369794
@ -308,7 +308,7 @@ touch /etc/machine-id
%end %end
%post --nochroot %post --nochroot
cp $INSTALL_ROOT/usr/share/licenses/*-release/* $LIVE_ROOT/
cp $INSTALL_ROOT/usr/share/licenses/\*-release/\* $LIVE_ROOT/
# only works on x86, x86_64 # only works on x86, x86_64
if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
@ -319,6 +319,7 @@ fi
%end %end
%post %post
# THIS IS ALL RUN IN THE LIVE ROOT
# cinnamon configuration # cinnamon configuration
# create /etc/sysconfig/desktop (needed for installation) # create /etc/sysconfig/desktop (needed for installation)
@ -351,24 +352,28 @@ chown -R liveuser:liveuser /home/liveuser
restorecon -R /home/liveuser restorecon -R /home/liveuser
EOF EOF
%end
%post --nochroot
# go to the backgrounds folder for custom images # go to the backgrounds folder for custom images
cd /usr/share/backgrounds/images cd /usr/share/backgrounds/images
# fetch custom RIT backgrounds # fetch custom RIT backgrounds
#FIXME
# Fetch rpm fusion scripts # Fetch rpm fusion scripts
su -c "mkdir -p /usr/share/autostart"
mkdir -p $INSTALL_ROOT/usr/share/autostart
mkdir -p $INSTALLROOT/usr/local/tigeros
cp -r /scripts/ $INSTALL_ROOT/usr/local/tigeros/
su -c "chmod a+rwx FusionEnableLauncher.py"
su -c "chmod a+rwx enablerpmfusion.sh"
ln -s $INSTALL_ROOT/home/liveuser/enablerpmfusion.sh $INSTALL_ROOT/usr/share/autostart/enablerpmfusion.sh
ln -s $INSTALL_ROOT/usr/local/tigeros/FusionEnableLauncher.py $INSTALL_ROOT/usr/share/autostart/FusionEnableLauncher.py
ln -s $INSTALL_ROOT/usr/local/tigeros/postinstall $INSTALL_ROOT/usr/share/autostart/postinstall
su -c "cp FusionEnableLauncher.py /usr/share/autostart/FusionEnableLauncher.py"
su -c "cp enablerpmfusion.sh /usr/share/autostart/enablerpmfusion.sh"
chmod -R 755 $INSTALL_ROOT/usr/local/tigeros/
# Download and install google chrome # Download and install google chrome
su -c "dnf install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm"
dnf --installroot=$INSTALL_ROOT install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
restorecon -R $INSTALL_ROOT/home/liveuser
%end %end
%packages %packages
@ -407,7 +412,6 @@ lynx
memtest86+ memtest86+
parole parole
pidgin pidgin
#playonlinux
rhythmbox rhythmbox
syslinux syslinux
transmission transmission
@ -420,7 +424,7 @@ zsh
-fedora-bookmarks -fedora-bookmarks
-fedora-icon-theme -fedora-icon-theme
-fedora-logos -fedora-logos
#-fedora-release
-fedora-release
-fedora-release-notes -fedora-release-notes
-hplip -hplip
-isdn4k-utils -isdn4k-utils

Loading…
Cancel
Save