Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
guysoft committed Jun 30, 2017
2 parents 1fa1e93 + 2dfb18e commit 38a7fed
Show file tree
Hide file tree
Showing 13 changed files with 163 additions and 62 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#### What were you doing?

[Please be as specific as possible here]

#### What did you expect to happen?

#### What happened instead?

#### Was there an error message displayed? What did it say?

#### Version of FullPageOS?

[Can be found in /etc/fullpageos_version ALWAYS INCLUDE.]

#### Screenshot(s) showing the problem:

[If applicable. Always include if unsure or reporting UI issues.]
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ How to use it?
#. Boot the Pi from the SD card
#. Log into your Pi via SSH (it is located at ``fullpageos.local`` `if your computer supports bonjour <https://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux/overview>`_ or the IP address assigned by your router), default username is "pi", default password is "raspberry", change the password using the ``passwd`` command and expand the filesystem of the SD card through the corresponding option when running ``sudo raspi-config``.

Requirements
------------
* Raspberrypi 2 and newser or device running Armbian, Older Rasperry Pis are not currently supported. See `Raspberry Pi <https://github.com/guysoft/FullPageOS/issues/12>`_ and `Raspberry Pi <https://github.com/guysoft/FullPageOS/issues/43>`_.
* 2A power supply


Features
--------

Expand Down Expand Up @@ -87,6 +93,11 @@ After provisioning the machine, its also possible to run a nightly build which u

cd FullPageOS/src/vagrant
run_vagrant_build.sh
To build a variant on the machine simply run::

cd FullPageOS/src/vagrant
run_vagrant_build.sh [Variant]

Usage
~~~~~
Expand Down
108 changes: 87 additions & 21 deletions src/chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,98 @@ apt-get autoremove -y
#apt-get tools
apt-get -y --force-yes install python2.7 git screen checkinstall avahi-daemon libavahi-compat-libdnssd1 xterm

apt-get install -y --force-yes chromium-browser xdotool matchbox-window-manager xorg lightdm
if [ "$FULLPAGEOS_INCLUDE_CHROMIUM" == "yes" ]
then
apt-get install -y --force-yes chromium-browser
sudo -u pi sed -i 's@%BROWSER_START_SCRIPT%@/home/pi/scripts/start_chromium_browser@g' /home/pi/scripts/run_onepageos
fi

apt-get install -y --force-yes xdotool matchbox-window-manager xorg lightdm
apt-get install -y --force-yes vim x11vnc expect


#Install web stack
apt-get install -y lighttpd php5-common php5-cgi php5
lighty-enable-mod fastcgi-php
#service lighttpd force-reload
chown -R www-data:www-data /var/www/html
chmod 775 /var/www/html
usermod -a -G www-data pi
systemctl enable clear_lighttpd_cache.service
pushd /var/www/html
#Put git clones in place
gitclone FULLPAGEOS_DASHBOARD_REPO FullPageDashboard
gitclone FULLPAGEOS_WELCOME_REPO welcome
chown -R pi:pi FullPageDashboard
chown -R www-data:www-data FullPageDashboard
chmod 775 FullPageDashboard
pushd FullPageDashboard
sed -i "s@'INIT_URL_PATH', __DIR__ . '/init.txt'@'INIT_URL_PATH', '/boot/fullpagedashboard.txt'@g" config.php
if [ "$FULLPAGEOS_INCLUDE_LIGHTTPD" == "yes" ]
then
apt-get install -y lighttpd php5-common php5-cgi php5
lighty-enable-mod fastcgi-php
#service lighttpd force-reload
chown -R www-data:www-data /var/www/html
chmod 775 /var/www/html
usermod -a -G www-data pi
systemctl enable clear_lighttpd_cache.service
systemctl enable ssh.socket
pushd /var/www/html
#Put git clones in place
if [ "$FULLPAGEOS_INCLUDE_DASHBOARD" == "yes" ]
then
gitclone FULLPAGEOS_DASHBOARD_REPO FullPageDashboard
chown -R pi:pi FullPageDashboard
chown -R www-data:www-data FullPageDashboard
chmod 775 FullPageDashboard
pushd FullPageDashboard
sed -i "s@'INIT_URL_PATH', __DIR__ . '/init.txt'@'INIT_URL_PATH', '/boot/fullpagedashboard.txt'@g" config.php
popd
fi
#Set Welcome screen
if [ "$FULLPAGEOS_INCLUDE_WELCOME" == "yes" ]
then
gitclone FULLPAGEOS_WELCOME_REPO welcome
chown -R www-data:www-data welcome
fi
popd

#Set Welcome screen
chown -R www-data:www-data welcome
popd

if [ "$FULLPAGEOS_INCLUDE_ACCELERATION" == "yes" ]
then
#TODO enable_gpu
apt-get -y --force-yes install xcompmgr libgl1-mesa-dri mesa-utils compton libconfig9

# Hack to pass non-interactive install
mv /usr/bin/whiptail /usr/bin/whiptail.bak
echo "#!/bin/bash" > /usr/bin/whiptail
echo "exit 0" >> /usr/bin/whiptail
chmod 755 /usr/bin/whiptail
apt-get -y --force-yes install rpi-chromium-mods
rm /usr/bin/whiptail
mv /usr/bin/whiptail.bak /usr/bin/whiptail
if [ -e /usr/share/X11/xorg.conf.d/99-fbturbo.conf ]; then
mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/xorg.conf.d/99-fbturbo.~
fi

systemctl enable enable_gpu_first_boot.service

else
echo "gpu_mem=128" >> /boot/config.txt
fi

echo "enabled" > /boot/check_for_httpd
else
echo "disabled" > /boot/check_for_httpd
fi


#override timezone
if [ "$FULLPAGEOS_OVERRIDE_TIMEZONE" != "default" ]
then
echo "$FULLPAGEOS_OVERRIDE_TIMEZONE" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
fi

#override locale
if [ "$FULLPAGEOS_OVERRIDE_LOCALE" != "default" ]
then
sed -i '/^#.* '"$FULLPAGEOS_OVERRIDE_LOCALE"' /s/^# //' /etc/locale.gen
locale-gen
update-locale LANG="$FULLPAGEOS_OVERRIDE_LOCALE"
fi

#override password
if [ "$FULLPAGEOS_OVERRIDE_PASSWORD" != "default" ]
then
echo "pi:$FULLPAGEOS_OVERRIDE_PASSWORD" | chpasswd
fi


#reach pi by name
echo "$FULLPAGEOS_OVERRIDE_HOSTNAME" > /etc/hostname
Expand All @@ -61,7 +128,6 @@ chmod +x /root/bin/git
# enable raspicam
echo "# enable raspicam" >> /boot/config.txt
echo "start_x=1" >> /boot/config.txt
echo "gpu_mem=128" >> /boot/config.txt

# allow network configuration via /boot/fullpageos-network.txt
sed -i "s@iface wlan0 @iface wlan0-raspbian @g" /etc/network/interfaces
Expand Down
2 changes: 1 addition & 1 deletion src/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function mount_image() {

# mount root and boot partition
sudo mount -o loop,offset=$root_offset $image_path $mount_path/
sudo mount -o loop,offset=$boot_offset $image_path $mount_path/boot
sudo mount -o loop,offset=$boot_offset,sizelimit=$( expr $root_offset - $boot_offset ) $image_path $mount_path/boot
sudo mount -o bind /dev/pts $mount_path/dev/pts
}

Expand Down
15 changes: 15 additions & 0 deletions src/config
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ fi

[ -n "$FULLPAGEOS_OVERRIDE_HOSTNAME" ] || FULLPAGEOS_OVERRIDE_HOSTNAME=fullpageos

#override timezone, otherwise use image timezone
[ -n "$FULLPAGEOS_OVERRIDE_TIMEZONE" ] || FULLPAGEOS_OVERRIDE_TIMEZONE=default

#override locale, otherwise use image locale
[ -n "$FULLPAGEOS_OVERRIDE_LOCALE" ] || FULLPAGEOS_OVERRIDE_LOCALE=default

#override password, otherwise use image default
[ -n "$FULLPAGEOS_OVERRIDE_PASSWORD" ] || FULLPAGEOS_OVERRIDE_PASSWORD=default

[ -n "$FULLPAGEOS_INCLUDE_CHROMIUM" ] || FULLPAGEOS_INCLUDE_CHROMIUM=yes
[ -n "$FULLPAGEOS_INCLUDE_LIGHTTPD" ] || FULLPAGEOS_INCLUDE_LIGHTTPD=yes

# FullPageDashboard repo & branch
[ -n "$FULLPAGEOS_DASHBOARD_REPO_SHIP" ] || FULLPAGEOS_DASHBOARD_REPO_SHIP=https://github.com/amitdar/FullPageDashboard.git
Expand All @@ -67,6 +78,10 @@ fi
[ -n "$FULLPAGEOS_WELCOME_REPO_BRANCH" ] || FULLPAGEOS_WELCOME_REPO_BRANCH=master
[ -n "$FULLPAGEOS_INCLUDE_WELCOME" ] || FULLPAGEOS_INCLUDE_WELCOME=yes

# Add GPU acceleration
[ -n "$FULLPAGEOS_INCLUDE_ACCELERATION" ] || FULLPAGEOS_INCLUDE_ACCELERATION=yes


###############################################################################
# Rewrite any build urls that are not yet set if we have a repository mirror
# configured.
Expand Down
35 changes: 0 additions & 35 deletions src/filesystem/home/pi/.octoprint/config.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions src/filesystem/home/pi/scripts/enable_gpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
if [ ! -f /etc/gpu_enabled ]; then
sudo sed 's@matchbox-window-manager \&@compton --backend glx --unredir-if-possible --glx-swap-method buffer-age --glx-no-stencil --paint-on-overlay --vsync opengl &\nmatchbox-window-manager \&@g' -i /home/pi/scripts/run_onepageos
sudo sed -i /boot/cmdline.txt -e "s/ quiet//"
sudo sed -i /boot/cmdline.txt -e "s/ splash//"
sudo sed -i /boot/cmdline.txt -e "s/ plymouth.ignore-serial-consoles//"
sudo sed -i /boot/config.txt -e "s/^\#dtoverlay=vc4-kms-v3d/dtoverlay=vc4-kms-v3d/"
sudo sed -i /boot/config.txt -e "s/^gpu_mem/\#gpu_mem/"
printf "dtoverlay=vc4-kms-v3d\n" | sudo tee -a /boot/config.txt
touch /etc/gpu_enabled
sudo shutdown -r now
fi
4 changes: 2 additions & 2 deletions src/filesystem/home/pi/scripts/run_onepageos
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ matchbox-window-manager &
x11vnc -many -rfbauth /home/pi/.vnc/passwd &
while true
do
if [ $(curl -sL -w "%{http_code}\\n" "http://localhost/FullPageDashboard" -o /dev/null) == "200" ]; then
if [ $(curl -sL -w "%{http_code}\\n" "http://localhost/FullPageDashboard" -o /dev/null) == "200" ] || grep -q disabled "/boot/check_for_httpd" ; then
(sleep 15 ; /home/pi/scripts/fullscreen) &
xdotool mousemove 9000 9000
chromium-browser --kiosk --app=$(head -n 1 /boot/fullpageos.txt)
%BROWSER_START_SCRIPT%
fi
sleep 1
done
2 changes: 2 additions & 0 deletions src/filesystem/home/pi/scripts/start_chromium_browser
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
chromium-browser --kiosk --touch-events=enabled --disable-pinch --noerrdialogs --app=$(head -n 1 /boot/fullpageos.txt)
2 changes: 1 addition & 1 deletion src/filesystem/root/etc/fullpageos_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0
0.7.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=on first boot set up GPU acceleration
[Service]
ExecStart=/home/pi/scripts/enable_gpu
ExecStop=
[Install]
WantedBy=multi-user.target
9 changes: 8 additions & 1 deletion src/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
Vagrant.configure("2") do |o|
# o.vm.box = "fullpageos-build"
o.vm.box= "https://github.com/kraksoft/vagrant-box-ubuntu/releases/download/15.04/ubuntu-15.04-amd64.box"
#o.vm.box= "https://github.com/kraksoft/vagrant-box-ubuntu/releases/download/15.04/ubuntu-15.04-amd64.box"
o.vm.box= "ubuntu/zesty64"
o.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
o.vm.synced_folder "../../", "/FullPageOS", create:true, type: "nfs"
o.vm.network :private_network, ip: "192.168.55.55"
o.vm.provision :shell, :path => "setup.sh", args: ENV['SHELL_ARGS']

o.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end


end

0 comments on commit 38a7fed

Please sign in to comment.