Permalink
Browse files

Release 1.0.15

Feature - Added new PiNet logo designed by Amy Mather.
Improvement - Moved boot files to their new home in PiNet-Boot repository.
Improvement - Added additional URLs to the internet connection checker
Bugfix - Fixed a few typos, thanks to Tom Hartley for spotting them.
  • Loading branch information...
gbaman committed Aug 30, 2015
1 parent 151c4a9 commit f50c9c7d96716ef90c11f4f52d5e4011ada16bad
Showing with 36 additions and 14 deletions.
  1. +18 −8 Scripts/pinet-functions-python.py
  2. +5 −0 boot/README.md
  3. BIN images/pinet-icon.png
  4. +13 −6 pinet
@@ -22,9 +22,11 @@
RepositoryBase="https://github.com/pinet/"
RepositoryName="pinet"
BootRepository="PiNet-Boot"
RawRepositoryBase="https://raw.github.com/pinet/"
Repository=RepositoryBase + RepositoryName
RawRepository=RawRepositoryBase + RepositoryName
RawBootRepository=RawRepositoryBase + BootRepository
ReleaseBranch = "master"
configFileData = {}
@@ -489,21 +491,27 @@ def replaceBitOrAdd(file, string, newString):
textfile = findReplaceSection(textfile, string, newString)
writeTextFile(textfile, file)
def internet_on(timeoutLimit, returnType = True):
def internet_on(timeoutLimit = 5, returnType = True):
"""
Checks if there is an internet connection.
If there is, return a 0, if not, return a 1
"""
import urllib.request
#print("Checking internet")
try:
response=urllib.request.urlopen('http://18.62.0.96',timeout=int(timeoutLimit))
response=urllib.request.urlopen('http://www.google.com',timeout=int(timeoutLimit))
returnData(0)
#print("returning 0")
return True
except: pass
try:
response=urllib.request.urlopen('http://74.125.228.100',timeout=int(timeoutLimit))
response=urllib.request.urlopen('http://mirrordirector.raspbian.org/',timeout=int(timeoutLimit))
returnData(0)
#print("returning 0")
return True
except: pass
try:
response=urllib.request.urlopen('http://18.62.0.96',timeout=int(timeoutLimit))
returnData(0)
#print("returning 0")
return True
@@ -591,15 +599,16 @@ def checkUpdate(currentVersion):
whiptailBox("msgbox", "Update detected", "An update has been detected for PiNet. Select OK to view the Release History.", False)
displayChangeLog(currentVersion)
else:
print("No updates found")
print("No PiNet software updates found")
#print(thisVersion)
#print(currentVersion)
returnData(0)
def checkKernelFileUpdateWeb():
downloadFile(RawRepository +"/" + ReleaseBranch + "/boot/version.txt", "/tmp/kernelVersion.txt")
#downloadFile(RawRepository +"/" + ReleaseBranch + "/boot/version.txt", "/tmp/kernelVersion.txt")
downloadFile(RawBootRepository +"/" + ReleaseBranch + "/boot/version.txt", "/tmp/kernelVersion.txt")
import os.path
user=os.environ['SUDO_USER']
currentPath="/home/"+user+"/PiBoot/version.txt"
@@ -611,9 +620,11 @@ def checkKernelFileUpdateWeb():
return False
else:
returnData(0)
print("No kernel updates found")
return True
else:
returnData(0)
print("No kernel updates found")
def checkKernelUpdater():
downloadFile(RawRepository +"/" + ReleaseBranch + "/Scripts/kernelCheckUpdate.sh", "/tmp/kernelCheckUpdate.sh")
@@ -889,7 +900,7 @@ def installSoftwareList(holdOffInstall = False):
software.append(softwarePackage("Libreoffice", "A free office suite, similar to Microsoft office", "script", ["apt-get purge -y openjdk-6-jre-headless openjdk-7-jre-headless ca-certificates-java", "apt-get install -y libreoffice gcj-4.7-jre gcj-jre gcj-jre-headless libgcj13-awt"]))
software.append(softwarePackage("Arduino-IDE", "Programming environment for Arduino microcontrollers", "apt", ["arduino",]))
software.append(softwarePackage("Scratch-gpio", "A special version of scratch for GPIO work" , "scratchGPIO", ["",]))
software.append(softwarePackage("Python-hardware", "Python libraries for some addon boards", "pip", ["pibrella skywriter unicornhat piglow"]))
software.append(softwarePackage("Python-hardware", "Python libraries for a number of Pimoroni addon boards", "pip", ["pibrella skywriter unicornhat piglow"]))
software.append(softwarePackage("Epoptes", "Free and open source classroom management software", "epoptes", ["",]))
software.append(softwarePackage("BlueJ", "A Java IDE for developing programs quickly and easily", "script", ["rm -rf /tmp/bluej-314a.deb", "rm -rf /opt/ltsp/armhf/tmp/bluej-314a.deb", "wget http://bluej.org/download/files/bluej-314a.deb -O /tmp/bluej-314a.deb", "dpkg -i /tmp/bluej-314a.deb"]))
software.append(softwarePackage("Custom-package", "Allows you to enter the name of a package from Raspbian repository", "customApt", ["",]))
@@ -972,10 +983,9 @@ def nbdRun():
if len(sys.argv) == 1:
print("This python script does nothing on its own, it must be passed stuff")
installSoftwareList()
#print(getConfigParameter("/etc/pinet", "NBD="))
else:
getReleaseChannel()
if sys.argv[1] == "replaceLineOrAdd":
replaceLineOrAdd(sys.argv[2], sys.argv[3], sys.argv[4])
elif sys.argv[1] == "replaceBitOrAdd":
View
@@ -0,0 +1,5 @@
PiNet boot files (Legacy)
================
The PiNet SD card boot files were stored here up until (and including) the 3.18 kernel release. This folder is kept for legacy support for older versions of PiNet.
All future SD card boot files updates can be found at https://github.com/PiNet/PiNet-Boot
View
Binary file not shown.
View
19 pinet
@@ -3,7 +3,7 @@
#
# See LICENSE file for copyright and license details
version=1.0.14
version=1.0.15
#PiNet (Previously RaspberryPi-LTSP)
@@ -22,8 +22,10 @@ PythonStart="python3"
p="$PythonStart $PythonFunctions"
RepositoryBase="https://github.com/pinet/"
RepositoryName="pinet"
BootRepositoryName="PiNet-Boot"
RawRepositoryBase="https://raw.github.com/pinet/"
Repository="$RepositoryBase$RepositoryName"
BootRepository="$RepositoryBase$BootRepositoryName"
RawRepository="$RawRepositoryBase$RepositoryName"
ReleaseBranch="master" #Overwriten later on in SetupRepositories()
ltspBase="/opt/ltsp/"
@@ -290,7 +292,7 @@ if [ $Internet -eq 0 ]; then
mkdir /opt/PiNet/PiBootBackup
fi
rm -rf /tmp/PiBoot
git clone --no-single-branch --depth 1 $Repository.git /tmp/PiBoot #Clones main repository, including boot files
git clone --no-single-branch --depth 1 $BootRepository.git /tmp/PiBoot #Clones main repository, including boot files
(cd "/tmp/PiBoot"; git checkout "$ReleaseBranch")
rm -rf /opt/PiNet/PiBootBackup/*
cp -r /tmp/PiBoot/boot/* /opt/PiNet/PiBootBackup/
@@ -311,7 +313,6 @@ if [ -d "/opt/ltsp/armhf/bootfiles" ]; then
local newVersion=0
local currentVersion=$(head -n 1 "/opt/ltsp/armhf/bootfiles/version.txt")
local newVersion=$(head -n 1 "/opt/PiNet/PiBootBackup/version.txt")
echo "$currentVersion $newVersion"
if (( $currentVersion < $newVersion )); then
rm -rf "/opt/ltsp/armhf/bootfiles/"
cp -rf "/opt/PiNet/PiBootBackup/" "/opt/ltsp/armhf/bootfiles/"
@@ -674,6 +675,9 @@ ltsp-chroot --arch armhf update-rc.d nfs-common disable
ltsp-chroot --arch armhf update-rc.d rpcbind disable
ltsp-chroot --arch armhf apt-get install -y linux-image-3.18.0-trunk-rpi linux-image-3.18.0-trunk-rpi2 linux-image-3.12-1-rpi linux-image-3.10-3-rpi linux-image-3.2.0-4-rpi linux-image-rpi-rpfv linux-image-rpi2-rpfv
ltsp-chroot --arch armhf touch /boot/config.txt #Required due to bug in sense-hat package installer
ltsp-chroot --arch armhf apt-get install -y sense-hat
ltsp-chroot --arch armhf apt-get install -y libqt4-network #Remove this when Sonic-Pi 2 update fixing the dependency issue is released.
sudo DEBIAN_FRONTEND=noninteractive ltsp-chroot --arch armhf apt-get install -y sonic-pi
@@ -684,6 +688,9 @@ if [ ! -f /opt/ltsp/armhf/usr/local/bin/raspi2png ]; then
chmod 755 /opt/ltsp/armhf/usr/local/bin/raspi2png
fi
#Install pillow which is required for Raspberry Pi Sense HAT.
sudo ltsp-chroot sudo pip-3.2 install pillow
#Server software
apt-get install -y bindfs python3-feedparser ntp
@@ -1480,7 +1487,7 @@ CheckSharedFolderIntegrity(){
inFile=$(grep "bindfs" /usr/local/bin/bindfs-mount | wc -l)
inFolder=$(ls -1 /home/shared | wc -l)
if [ ! "$inFile" = "$inFolder" ]; then
whiptail --title "WARNING!!" --msgbox "Warning - The your shared folder permissions are wrong! This may be because you imported shared folders from a previous system. You must reselect the correct permission level for each folder now." 9 78
whiptail --title "WARNING!!" --msgbox "Warning - Your shared folder permissions are wrong! This may be because you imported shared folders from a previous system. You must reselect the correct permission level for each folder now." 9 78
for i in 1 2 3 4 5 6 7 8 9 10
do
ReplaceAnyTextOnLine /usr/local/bin/bindfs-mount "/home/shared/" ""
@@ -1662,7 +1669,7 @@ AddDesktopShortcutToUser() {
if [ ! -f "/home/$1/Desktop/pinet.desktop" ]; then
cat <<EOF1 >> /home/$1/Desktop/pinet.desktop
[Desktop Entry]
Version=1.0
Version=2.0
Name=PiNet
Comment=Raspberry Pi LTSP
Exec=sudo bash pinet
@@ -2594,7 +2601,7 @@ FullInstall(){
FixDesktopIcons #Adds desktop icons
InstallRaspberryPiUIMods
EnableNBDswap #Enables NBD swap for if the Pi runs out of RAM, it can use server as RAM using NBD
whiptail --title "Extra software" --msgbox "Select any additional software you want to use or use Install-Custom-software to install a specific package from the Raspbian apt repository if you know its name. To quit the menu, use the finished option. This menu can be later accessed from Install-Program from the main menu." 12 78
#whiptail --title "Extra software" --msgbox "Select any additional software you want to use or use Install-Custom-software to install a specific package from the Raspbian apt repository if you know its name. To quit the menu, use the finished option. This menu can be later accessed from Install-Program from the main menu." 12 78
#ExtraSoftware #Runs ExtraSoftware menu to let the user select additional software they wish to install
$p installSoftwareFromFile
DisableI2C_SPI

0 comments on commit f50c9c7

Please sign in to comment.