Skip to content
This repository has been archived by the owner on May 30, 2018. It is now read-only.

Fixed scripts to support pi2 and pi3, without breaking backwards compatibility #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ these details are based on blog post [Jessie on Raspberry PI 2 with Docker and C


## 1. Installing X11 and LightDM on HypriotOS

### For RaspberryPi 2

Running the installer script need sudo privileges for some elevated commands.
```
curl -sSL https://github.com/hypriot/x11-on-HypriotOS/raw/master/install-x11-basics.sh | bash
Expand All @@ -36,6 +39,26 @@ Filesystem Size Used Avail Use% Mounted on
/dev/root 6.9G 1.1G 5.5G 17% /
```

### For RaspberryPi 3

Running the installer script need sudo privileges for some elevated commands.
```
curl -Lso /tmp/install-x11-basics.sh -H "Cache-Control: no-cache" https://raw.githubusercontent.com/hypriot/x11-on-HypriotOS/master/install-x11-basics.sh && \
chmod +x /tmp/install-x11-basics.sh && \
/tmp/install-x11-basics.sh -pi3
/tmp/install-x11-basics.sh -pi3
```
Depending on your internet connection this installation procedure takes approx. 10 minutes only.

Please reboot your system now to start X11 on your attached HDMI display.

- with X11 installed (8 GByte SD Card)
```
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.0G 950M 5.7G 15% /
```

## 2. Installing Chromium web browser on HypriotOS/X11
Running the installer script need sudo privileges for some elevated commands.
```
Expand All @@ -45,3 +68,12 @@ This takes approx. 5 minutes only.


Hypriot team, 2015

## Re-Compiling fbturbo

If you have fbturbo errors, you'll likely need get a fresh compile for your architecture. On your installation target, do the following:

1. Follow the: [fbturbo Driver Installation](https://github.com/ssvb/xf86-video-fbturbo/wiki/Installation) guide
1. Run the `fbturbo/fbturbo-create-tar.sh` script, on the same host you used to install fbturbo.
1. Capture the SHA-256 Sum of the newly created `fbturbo.tar.gz`, and update the `install-x11-basics.sh` script.
1. Verify that the `xorg.conf` hasn't changed, if it has, capture its SHA-256, and update `install-x11-basics.sh`
File renamed without changes.
Binary file added fbturbo/pi3/fbturbo.tar.gz
Binary file not shown.
17 changes: 17 additions & 0 deletions fbturbo/pi3/xorg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This is a minimal sample config file, which can be copied to
# /etc/X11/xorg.conf in order to make the Xorg server pick up
# and load xf86-video-fbturbo driver installed in the system.
#
# When troubleshooting, check /var/log/Xorg.0.log for the debugging
# output and error messages.
#
# Run "man fbturbo" to get additional information about the extra
# configuration options for tuning the driver.

Section "Device"
Identifier "Allwinner A10/A13 FBDEV"
Driver "fbturbo"
Option "fbdev" "/dev/fb0"

Option "SwapbuffersWait" "true"
EndSection
4 changes: 2 additions & 2 deletions install-chromium-browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ CHROMIUM_DEB_FILE2=chromium-browser_51.0.2704.106-0ubuntu0.15.04.1.1207_armhf.de
echo ""
echo " STEP 1: download Chromium .deb packages"
if [ ! -f /tmp/${CHROMIUM_DEB_FILE1} ]; then
wget -O /tmp/${CHROMIUM_DEB_FILE1} ${CHROMIUM_BASEURL}/${CHROMIUM_DEB_FILE1}
curl -Lo /tmp/${CHROMIUM_DEB_FILE1} ${CHROMIUM_BASEURL}/${CHROMIUM_DEB_FILE1}
fi
if [ ! -f /tmp/${CHROMIUM_DEB_FILE2} ]; then
wget -O /tmp/${CHROMIUM_DEB_FILE2} ${CHROMIUM_BASEURL}/${CHROMIUM_DEB_FILE2}
curl -Lo /tmp/${CHROMIUM_DEB_FILE2} ${CHROMIUM_BASEURL}/${CHROMIUM_DEB_FILE2}
fi
echo "...done"

Expand Down
59 changes: 55 additions & 4 deletions install-x11-basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@
set +x
set -e

OPTION=${1}
DEFAULT="-pi2"

PI2_FBTURBO_SHA256=2c919c28735bf2f694580bfa7ff79fee7b9da11b6f62d81f871ff0c6e6e1c0f1
PI3_FBTURBO_SHA256=a91fd5f18bad06784ef80688bc5827fa98c5712ced756eda2dc8e406bc4307a9
PI3_XORG_CONF_SHA256=d757fb4efd14fe1cf5b3892378a939b9d4119b50eb8e74e80b5e4562b95cceef

PI_VERSION=$(echo "${OPTION:-${DEFAULT}}" | sed 's/-//')
PI_VERSION_FBTURBO_SHA256=$(eval "echo $(echo "\${${PI_VERSION}_FBTURBO_SHA256}" | awk '{print toupper($0)}')")

echo "PI_VERSION=${PI_VERSION}"
echo "PI_VERSION_FBTURBO_SHA256=${PI_VERSION_FBTURBO_SHA256}"

usage() {

cat << EOF

Usage: ${0} [options]

Options:
-pi2 Installing x11 on a RaspberryPi 2 (This is the default if no option is supplied.)
-pi3 Installing x11 on a RaspberryPi 3

EOF

}

case "${OPTION}" in

-h|-help|--h|--help)
usage
exit 0
;;

esac

echo ""
echo "Installing basic X11 packages on HypriotOS"

Expand All @@ -25,14 +61,14 @@ echo "...done"
echo ""
echo " STEP 2: install X11 and LightDM"
sudo apt-get update
sudo apt-get install -y --no-install-recommends xserver-xorg xinit xserver-xorg-video-fbdev lxde lxde-common lightdm x11-xserver-utils
sudo apt-get install -y --no-install-recommends xserver-xorg xinit xserver-xorg-video-fbdev lxde lxde-common lightdm x11-xserver-utils dbus-x11
sudo apt-get install -y policykit-1 hal
echo "...done"


# --------------------------------------------------------------------
echo ""
echo " STEP 3: enable LightDM autologin for user=pi"
echo " STEP 3: enable LightDM autologin for user=pirate"
LIGHTDM_CONF_FILE=/etc/lightdm/lightdm.conf
if [ ! -f ${LIGHTDM_CONF_FILE}.sav ]; then
# backup original file
Expand All @@ -52,14 +88,29 @@ echo "...done"
# --------------------------------------------------------------------
echo ""
echo " STEP 4: install pre-compiled fbturbo"
FBTURBO_TAR_URL=https://github.com/hypriot/x11-on-HypriotOS/raw/master/fbturbo/fbturbo.tar.gz
FBTURBO_TAR_URL=https://github.com/hypriot/x11-on-HypriotOS/raw/master/fbturbo/${PI_VERSION}/fbturbo.tar.gz
FBTURBO_TAR_TMPFILE=/tmp/fbturbo.tar.gz
wget -O ${FBTURBO_TAR_TMPFILE} ${FBTURBO_TAR_URL}
curl -Lo ${FBTURBO_TAR_TMPFILE} ${FBTURBO_TAR_URL}
echo "${PI_VERSION_FBTURBO_SHA256} ${FBTURBO_TAR_TMPFILE}" | sha256sum -c
sudo tar xvf ${FBTURBO_TAR_TMPFILE} -C /
rm -f ${FBTURBO_TAR_TMPFILE}
echo "...done"


# --------------------------------------------------------------------
if [ "${PI_VERSION}" == "pi3" ]; then

echo ""
echo " STEP 5: update xorg.conf (pi3 only)"
XORG_CONF_URL=https://github.com/hypriot/x11-on-HypriotOS/raw/master/fbturbo/${PI_VERSION}/xorg.conf
XORG_CONF_TMPFILE=/tmp/xorg.conf
curl -Lo ${XORG_CONF_TMPFILE} ${XORG_CONF_URL}
echo "${PI3_XORG_CONF_SHA256} ${XORG_CONF_TMPFILE}" | sha256sum -c
sudo mv ${XORG_CONF_TMPFILE} /etc/X11/xorg.conf
echo "...done"

fi

# --------------------------------------------------------------------
echo ""
echo "...X11 installation done, please reboot"