add fedora selinux mods
This commit is contained in:
@@ -520,19 +520,23 @@ prepare () {
|
|||||||
echo "$user ALL=NOPASSWD: /usr/sbin/reboot" >> /etc/sudoers.d/octoprint_reboot
|
echo "$user ALL=NOPASSWD: /usr/sbin/reboot" >> /etc/sudoers.d/octoprint_reboot
|
||||||
echo "This will install necessary packages, download and install OctoPrint and setup a base instance on this machine."
|
echo "This will install necessary packages, download and install OctoPrint and setup a base instance on this machine."
|
||||||
#install packages
|
#install packages
|
||||||
apt-get update > /dev/null
|
|
||||||
if [ $INSTALL -eq 2 ]; then
|
if [ $INSTALL -eq 2 ]; then
|
||||||
|
apt-get update > /dev/null
|
||||||
apt-get -y install make v4l-utils virtualenv python-is-python3 cmake libjpeg8-dev gcc g++ python3-dev build-essential python3-setuptools libyaml-dev python3-pip python3-venv
|
apt-get -y install make v4l-utils virtualenv python-is-python3 cmake libjpeg8-dev gcc g++ python3-dev build-essential python3-setuptools libyaml-dev python3-pip python3-venv
|
||||||
fi
|
fi
|
||||||
if [ $INSTALL -eq 3 ]; then
|
if [ $INSTALL -eq 3 ]; then
|
||||||
|
apt-get update > /dev/null
|
||||||
apt-get -y install make v4l-utils python3.9-venv cmake libjpeg8-dev gcc g++ python3-dev build-essential python3-setuptools libyaml-dev python3-pip
|
apt-get -y install make v4l-utils python3.9-venv cmake libjpeg8-dev gcc g++ python3-dev build-essential python3-setuptools libyaml-dev python3-pip
|
||||||
fi
|
fi
|
||||||
#Mint requires python3.8-venv?
|
#Mint requires python3.8-venv?
|
||||||
if [ $INSTALL -eq 4 ]; then
|
if [ $INSTALL -eq 4 ]; then
|
||||||
|
apt-get update > /dev/null
|
||||||
apt-get -y install make v4l-utils python3.8-venv cmake libjpeg8-dev gcc g++ python3-dev build-essential python3-setuptools libyaml-dev python3-pip
|
apt-get -y install make v4l-utils python3.8-venv cmake libjpeg8-dev gcc g++ python3-dev build-essential python3-setuptools libyaml-dev python3-pip
|
||||||
fi
|
fi
|
||||||
#Fedora35
|
#Fedora35
|
||||||
if [ $INSTALL -eq 5 ]; then
|
if [ $INSTALL -eq 5 ]; then
|
||||||
|
dnf update
|
||||||
dnf -y install python3-devel cmake libjpeg-turbo-devel
|
dnf -y install python3-devel cmake libjpeg-turbo-devel
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -554,6 +558,13 @@ prepare () {
|
|||||||
echo 'Updating config.yaml'
|
echo 'Updating config.yaml'
|
||||||
sudo -u $user mkdir /home/$user/.octoprint
|
sudo -u $user mkdir /home/$user/.octoprint
|
||||||
sudo -u $user cp -p $SCRIPTDIR/config.basic /home/$user/.octoprint/config.yaml
|
sudo -u $user cp -p $SCRIPTDIR/config.basic /home/$user/.octoprint/config.yaml
|
||||||
|
#Fedora has SELinux on by default so must make adjustments...
|
||||||
|
#Will need to do this for mjpeg-streamer as well
|
||||||
|
if [ $INSTALL -eq 5 ]; then
|
||||||
|
semanage fcontext -a -t bin_t '/home/$user/OctoPrint/bin/.*'
|
||||||
|
chcon -Rv -u system_u -t bin_t '/home/$user/OctoPrint/bin'
|
||||||
|
restorecon -R -v /home/$user/OctoPrint/bin
|
||||||
|
fi
|
||||||
echo 'Starting generic service on port 5000'
|
echo 'Starting generic service on port 5000'
|
||||||
systemctl start octoprint_default.service
|
systemctl start octoprint_default.service
|
||||||
systemctl enable octoprint_default.service
|
systemctl enable octoprint_default.service
|
||||||
|
|||||||
Reference in New Issue
Block a user