Add Raspbian stages

This commit is contained in:
Serge Schneider 2016-04-11 07:29:41 +01:00
parent 5200b19f9a
commit 99bf2f4d61
77 changed files with 777 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#!/bin/bash -e
install -m 644 files/sources.list ${ROOTFS_DIR}/etc/apt/
install -m 644 files/raspi.list ${ROOTFS_DIR}/etc/apt/sources.list.d/
if [ -n "$APT_PROXY" ]; then
install -m 644 files/51cache ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache
sed ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache -i -e "s|APT_PROXY|${APT_PROXY}|"
else
rm -f ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache
fi
on_chroot apt-key add - < files/raspberrypi.gpg.key
on_chroot sh -e - << EOF
apt-get update
apt-get dist-upgrade -y
EOF

View File

@ -0,0 +1 @@
Acquire::http { Proxy "APT_PROXY"; };

View File

@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.12 (GNU/Linux)
mQENBE/d7o8BCACrwqQacGJfn3tnMzGui6mv2lLxYbsOuy/+U4rqMmGEuo3h9m92
30E2EtypsoWczkBretzLUCFv+VUOxaA6sV9+puTqYGhhQZFuKUWcG7orf7QbZRuu
TxsEUepW5lg7MExmAu1JJzqM0kMQX8fVyWVDkjchZ/is4q3BPOUCJbUJOsE+kK/6
8kW6nWdhwSAjfDh06bA5wvoXNjYoDdnSZyVdcYCPEJXEg5jfF/+nmiFKMZBraHwn
eQsepr7rBXxNcEvDlSOPal11fg90KXpy7Umre1UcAZYJdQeWcHu7X5uoJx/MG5J8
ic6CwYmDaShIFa92f8qmFcna05+lppk76fsnABEBAAG0IFJhc3BiZXJyeSBQaSBB
cmNoaXZlIFNpZ25pbmcgS2V5iQE4BBMBAgAiBQJP3e6PAhsDBgsJCAcDAgYVCAIJ
CgsEFgIDAQIeAQIXgAAKCRCCsSmSf6MwPk6vB/9pePB3IukU9WC9Bammh3mpQTvL
OifbkzHkmAYxzjfK6D2I8pT0xMxy949+ThzJ7uL60p6T/32ED9DR3LHIMXZvKtuc
mQnSiNDX03E2p7lIP/htoxW2hDP2n8cdlNdt0M9IjaWBppsbO7IrDppG2B1aRLni
uD7v8bHRL2mKTtIDLX42Enl8aLAkJYgNWpZyPkDyOqamjijarIWjGEPCkaURF7g4
d44HvYhpbLMOrz1m6N5Bzoa5+nq3lmifeiWKxioFXU+Hy5bhtAM6ljVb59hbD2ra
X4+3LXC9oox2flmQnyqwoyfZqVgSQa0B41qEQo8t1bz6Q1Ti7fbMLThmbRHiuQEN
BE/d7o8BCADNlVtBZU63fm79SjHh5AEKFs0C3kwa0mOhp9oas/haDggmhiXdzeD3
49JWz9ZTx+vlTq0s+I+nIR1a+q+GL+hxYt4HhxoA6vlDMegVfvZKzqTX9Nr2VqQa
S4Kz3W5ULv81tw3WowK6i0L7pqDmvDqgm73mMbbxfHD0SyTt8+fk7qX6Ag2pZ4a9
ZdJGxvASkh0McGpbYJhk1WYD+eh4fqH3IaeJi6xtNoRdc5YXuzILnp+KaJyPE5CR
qUY5JibOD3qR7zDjP0ueP93jLqmoKltCdN5+yYEExtSwz5lXniiYOJp8LWFCgv5h
m8aYXkcJS1xVV9Ltno23YvX5edw9QY4hABEBAAGJAR8EGAECAAkFAk/d7o8CGwwA
CgkQgrEpkn+jMD5Figf/dIC1qtDMTbu5IsI5uZPX63xydaExQNYf98cq5H2fWF6O
yVR7ERzA2w33hI0yZQrqO6pU9SRnHRxCFvGv6y+mXXXMRcmjZG7GiD6tQWeN/3wb
EbAn5cg6CJ/Lk/BI4iRRfBX07LbYULCohlGkwBOkRo10T+Ld4vCCnBftCh5x2OtZ
TOWRULxP36y2PLGVNF+q9pho98qx+RIxvpofQM/842ZycjPJvzgVQsW4LT91KYAE
4TVf6JjwUM6HZDoiNcX6d7zOhNfQihXTsniZZ6rky287htsWVDNkqOi5T3oTxWUo
m++/7s3K3L0zWopdhMVcgg6Nt9gcjzqN1c0gy55L/g==
=mNSj
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -0,0 +1,3 @@
deb http://archive.raspberrypi.org/debian/ jessie main ui staging
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ jessie main ui

View File

@ -0,0 +1,3 @@
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

View File

@ -0,0 +1 @@
raspberrypi-bootloader

4
stage0/prerun.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -e
if [ ! -d ${ROOTFS_DIR} ]; then
bootstrap jessie ${ROOTFS_DIR} http://mirrordirector.raspbian.org/raspbian/
fi

4
stage1/00-boot-files/00-run.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -e
install -m 644 files/cmdline.txt ${ROOTFS_DIR}/boot/
install -m 644 files/config.txt ${ROOTFS_DIR}/boot/

View File

@ -0,0 +1 @@
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

View File

@ -0,0 +1,56 @@
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on

View File

@ -0,0 +1,33 @@
--- a/rootfs/etc/skel/.bashrc
+++ b/rootfs/etc/skel/.bashrc
@@ -43,7 +43,7 @@
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
-#force_color_prompt=yes
+force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
@@ -57,7 +57,7 @@
fi
if [ "$color_prompt" = yes ]; then
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
@@ -79,9 +79,9 @@
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
- #alias grep='grep --color=auto'
- #alias fgrep='fgrep --color=auto'
- #alias egrep='egrep --color=auto'
+ alias grep='grep --color=auto'
+ alias fgrep='fgrep --color=auto'
+ alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors

View File

@ -0,0 +1 @@
01-bashrc.diff

16
stage1/01-sys-tweaks/00-run.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash -e
install -d ${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d
install -m 644 files/noclear.conf ${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf
install -m 744 files/policy-rc.d ${ROOTFS_DIR}/usr/sbin/policy-rc.d
#install -v -m 644 files/fstab ${ROOTFS_DIR}/etc/fstab TODO: Necessary in systemd?
on_chroot sh -e - <<EOF
if ! id -u pi >/dev/null 2>&1; then
adduser --disabled-password --gecos "" pi
fi
echo "pi:raspberry" | chpasswd
echo "root:root" | chpasswd
EOF

View File

@ -0,0 +1,3 @@
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1

View File

@ -0,0 +1,2 @@
[Service]
TTYVTDisallocate=no

View File

@ -0,0 +1,2 @@
#!/bin/sh
exit 101

View File

@ -0,0 +1,9 @@
Index: jessie-stage1/rootfs/etc/hosts
===================================================================
--- jessie-stage1.orig/rootfs/etc/hosts
+++ jessie-stage1/rootfs/etc/hosts
@@ -3,3 +3,4 @@
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
+127.0.1.1 raspberrypi

View File

@ -0,0 +1,13 @@
Index: jessie-stage1/rootfs/lib/udev/rules.d/75-persistent-net-generator.rules
===================================================================
--- jessie-stage1.orig/rootfs/lib/udev/rules.d/75-persistent-net-generator.rules
+++ jessie-stage1/rootfs/lib/udev/rules.d/75-persistent-net-generator.rules
@@ -22,7 +22,7 @@ IMPORT{cmdline}="net.ifnames"
ENV{net.ifnames}=="1", GOTO="persistent_net_generator_end"
# device name whitelist
-KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
+KERNEL!="ath*|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
GOTO="persistent_net_generator_end"
# ignore Xen virtual interfaces

View File

@ -0,0 +1,2 @@
01-hosts.diff
02-persistant-net.diff

9
stage1/02-net-tweaks/00-run.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash -e
install -m 644 files/ipv6.conf ${ROOTFS_DIR}/etc/modprobe.d/ipv6.conf
install -m 644 files/interfaces ${ROOTFS_DIR}/etc/network/interfaces
install -m 644 files/hostname ${ROOTFS_DIR}/etc/hostname
on_chroot sh -e - << EOF
dpkg-divert --add --local /lib/udev/rules.d/75-persistent-net-generator.rules
EOF

View File

@ -0,0 +1 @@
raspberrypi

View File

@ -0,0 +1,4 @@
auto lo
iface lo inet loopback
iface eth0 inet dhcp

View File

@ -0,0 +1,3 @@
# Don't load ipv6 by default
alias net-pf-10 off
#alias ipv6 off

View File

@ -0,0 +1 @@
libraspberrypi-bin libraspberrypi0 raspi-config

4
stage1/prerun.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -e
if [ ! -d ${ROOTFS_DIR} ]; then
copy_previous
fi

View File

@ -0,0 +1,3 @@
#!/bin/bash -e
touch ${ROOTFS_DIR}/spindle_install

View File

@ -0,0 +1 @@
raspi-copies-and-fills

View File

@ -0,0 +1,3 @@
#!/bin/bash -e
rm -f ${ROOTFS_DIR}/spindle_install

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
ssh locales less fbset sudo psmisc strace module-init-tools ed ncdu crda
console-setup keyboard-configuration debconf-utils parted unzip
build-essential manpages-dev python bash-completion gdb pkg-config
python-rpi.gpio v4l-utils
avahi-daemon
lua5.1
luajit
hardlink ca-certificates curl
fake-hwclock ntp nfs-common usbutils
libraspberrypi-dev libraspberrypi-doc libfreetype6-dev
dosfstools
dphys-swapfile
raspberrypi-sys-mods
pi-bluetooth
apt-listchanges

View File

@ -0,0 +1 @@
cifs-utils

View File

@ -0,0 +1,10 @@
Index: jessie-stage2/rootfs/etc/sudoers
===================================================================
--- jessie-stage2.orig/rootfs/etc/sudoers
+++ jessie-stage2/rootfs/etc/sudoers
@@ -25,3 +25,5 @@ root ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
+
+pi ALL=(ALL) NOPASSWD: ALL

View File

@ -0,0 +1,22 @@
Index: jessie-stage2/rootfs/etc/default/useradd
===================================================================
--- jessie-stage2.orig/rootfs/etc/default/useradd
+++ jessie-stage2/rootfs/etc/default/useradd
@@ -5,7 +5,7 @@
# Similar to DHSELL in adduser. However, we use "sh" here because
# useradd is a low level utility and should be as general
# as possible
-SHELL=/bin/sh
+SHELL=/bin/bash
#
# The default group for users
# 100=users on Debian systems
@@ -29,7 +29,7 @@ SHELL=/bin/sh
# The SKEL variable specifies the directory containing "skeletal" user
# files; in other words, files such as a sample .profile that will be
# copied to the new user's home directory when it is created.
-# SKEL=/etc/skel
+SKEL=/etc/skel
#
# Defines whether the mail spool should be created while
# creating the account

View File

@ -0,0 +1,13 @@
Index: jessie-stage2/rootfs/etc/dphys-swapfile
===================================================================
--- jessie-stage2.orig/rootfs/etc/dphys-swapfile
+++ jessie-stage2/rootfs/etc/dphys-swapfile
@@ -13,7 +13,7 @@
# set size to absolute value, leaving empty (default) then uses computed value
# you most likely don't want this, unless you have an special disk situation
-#CONF_SWAPSIZE=
+CONF_SWAPSIZE=100
# set size to computed value, this times RAM size, dynamically adapts,
# guarantees that there is enough swap without wasting disk space on excess

View File

@ -0,0 +1,17 @@
Index: jessie-stage2/rootfs/etc/default/console-setup
===================================================================
--- jessie-stage2.orig/rootfs/etc/default/console-setup
+++ jessie-stage2/rootfs/etc/default/console-setup
@@ -6,9 +6,9 @@ ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="UTF-8"
-CODESET="Lat15"
-FONTFACE="Fixed"
-FONTSIZE="8x16"
+CODESET="guess"
+FONTFACE=""
+FONTSIZE=""
VIDEOMODE=

View File

@ -0,0 +1,12 @@
Index: jessie-stage2/rootfs/etc/inputrc
===================================================================
--- jessie-stage2.orig/rootfs/etc/inputrc
+++ jessie-stage2/rootfs/etc/inputrc
@@ -65,3 +65,7 @@ $endif
# "\e[F": end-of-line
$endif
+
+# mappings for up and down arrows search history
+# "\e[B": history-search-forward
+# "\e[A": history-search-backward

View File

@ -0,0 +1,26 @@
Index: jessie-stage2/rootfs/etc/login.defs
===================================================================
--- jessie-stage2.orig/rootfs/etc/login.defs
+++ jessie-stage2/rootfs/etc/login.defs
@@ -100,7 +100,7 @@ HUSHLOGIN_FILE .hushlogin
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
+ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
#
# Terminal permissions
Index: jessie-stage2/rootfs/etc/profile
===================================================================
--- jessie-stage2.orig/rootfs/etc/profile
+++ jessie-stage2/rootfs/etc/profile
@@ -4,7 +4,7 @@
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
- PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
+ PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
fi
export PATH

View File

@ -0,0 +1,15 @@
Index: jessie-stage2/rootfs/etc/rc.local
===================================================================
--- jessie-stage2.orig/rootfs/etc/rc.local
+++ jessie-stage2/rootfs/etc/rc.local
@@ -11,4 +11,10 @@
#
# By default this script does nothing.
+# Print the IP address
+_IP=$(hostname -I) || true
+if [ "$_IP" ]; then
+ printf "My IP address is %s\n" "$_IP"
+fi
+
exit 0

View File

@ -0,0 +1,5 @@
--- a/rootfs/boot/cmdline.txt
+++ b/rootfs/boot/cmdline.txt
@@ -1 +1 @@
-dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
+dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh

View File

@ -0,0 +1,8 @@
00-sudoers.diff
01-useradd.diff
02-swap.diff
03-console-setup.diff
04-inputrc.diff
05-path.diff
06-rc_local.diff
07-resize-init.diff

41
stage2/01-sys-tweaks/01-run.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash -e
install -m 755 files/regenerate_ssh_host_keys ${ROOTFS_DIR}/etc/init.d/
install -m 755 files/apply_noobs_os_config ${ROOTFS_DIR}/etc/init.d/
install -m 755 files/resize2fs_once ${ROOTFS_DIR}/etc/init.d/
install -d ${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d
install -m 644 files/ttyoutput.conf ${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/
install -m 644 files/50raspi ${ROOTFS_DIR}/etc/apt/apt.conf.d/
install -m 644 files/98-rpi.conf ${ROOTFS_DIR}/etc/sysctl.d/
on_chroot sh -e - <<EOF
systemctl disable hwclock.sh
systemctl disable nfs-common
systemctl disable rpcbind
systemctl disable ssh
systemctl enable regenerate_ssh_host_keys
systemctl enable apply_noobs_os_config
systemctl enable resize2fs_once
EOF
on_chroot sh -e - << \EOF
for GRP in input spi i2c gpio; do
groupadd -f -r $GRP
done
for GRP in adm dialout cdrom audio users sudo video games plugdev input gpio spi i2c netdev; do
adduser pi $GRP
done
EOF
on_chroot sh -e - <<EOF
setupcon --force --save-only -v
EOF
on_chroot sh -e - <<EOF
usermod --pass='*' root
EOF
rm -f ${ROOTFS_DIR}/etc/ssh/ssh_host_*_key*

View File

@ -0,0 +1,5 @@
# never use pdiffs. Current implementation is very slow on low-powered devices
Acquire::PDiffs "0";
# download up to 5 pdiffs:
#Acquire::PDiffs::FileLimit "5";

View File

@ -0,0 +1,3 @@
kernel.printk = 3 4 1 3
vm.swappiness=1
vm.min_free_kbytes = 8192

View File

@ -0,0 +1,31 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: apply_noobs_os_config
# Required-Start:
# Required-Stop:
# Default-Start: 2
# Default-Stop:
# Short-Description: Apply config from /boot/os_config.json
# Description:
### END INIT INFO
. /lib/lsb/init-functions
set -e
case "$1" in
start)
log_daemon_msg "Applying config from /boot/os_config.json (if it exists)"
if raspi-config --apply-os-config; then
update-rc.d apply_noobs_os_config remove
rm /etc/init.d/apply_noobs_os_config
log_end_msg 0
else
log_end_msg 1
fi
;;
*)
echo "Usage: $0 start" >&2
exit 3
;;
esac

View File

@ -0,0 +1,36 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: regenerate_ssh_host_keys
# Required-Start:
# Required-Stop:
# Default-Start: 2
# Default-Stop:
# Short-Description: Regenerate ssh host keys
# Description:
### END INIT INFO
. /lib/lsb/init-functions
set -e
case "$1" in
start)
log_daemon_msg "Regenerating ssh host keys (in background)"
nohup sh -c "if [ -e /dev/hwrng ]; then
dd if=/dev/hwrng of=/dev/urandom count=1 bs=4096
fi; \
yes | ssh-keygen -q -N '' -t dsa -f /etc/ssh/ssh_host_dsa_key && \
yes | ssh-keygen -q -N '' -t rsa -f /etc/ssh/ssh_host_rsa_key && \
yes | ssh-keygen -q -N '' -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key && \
yes | ssh-keygen -q -N '' -t ed25519 -f /etc/ssh/ssh_host_ed25519_key && \
systemctl enable ssh && sync && \
rm /etc/init.d/regenerate_ssh_host_keys && \
update-rc.d regenerate_ssh_host_keys remove && \
printf '\nfinished\n' && systemctl start ssh" > /var/log/regen_ssh_keys.log 2>&1 &
log_end_msg $?
;;
*)
echo "Usage: $0 start" >&2
exit 3
;;
esac

View File

@ -0,0 +1,25 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: resize2fs_once
# Required-Start:
# Required-Stop:
# Default-Start: 3
# Default-Stop:
# Short-Description: Resize the root filesystem to fill partition
# Description:
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting resize2fs_once"
ROOT_DEV=`grep -Eo 'root=[[:graph:]]+' /proc/cmdline | cut -d '=' -f 2-` &&
resize2fs $ROOT_DEV &&
update-rc.d resize2fs_once remove &&
rm /etc/init.d/resize2fs_once &&
log_end_msg $?
;;
*)
echo "Usage: $0 start" >&2
exit 3
;;
esac

View File

@ -0,0 +1,2 @@
[Service]
StandardOutput=tty

View File

@ -0,0 +1,2 @@
wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-ralink firmware-realtek
dhcpcd5

View File

@ -0,0 +1,27 @@
Index: jessie-stage2/rootfs/etc/network/interfaces
===================================================================
--- jessie-stage2.orig/rootfs/etc/network/interfaces
+++ jessie-stage2/rootfs/etc/network/interfaces
@@ -1,4 +1,20 @@
-auto lo
+# interfaces(5) file used by ifup(8) and ifdown(8)
+
+# Please note that this file is written to be used with dhcpcd
+# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
+# Include files from /etc/network/interfaces.d:
+source-directory /etc/network/interfaces.d
+
+auto lo
iface lo inet loopback
-iface eth0 inet dhcp
+
+iface eth0 inet manual
+
+allow-hotplug wlan0
+iface wlan0 inet manual
+ wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
+
+allow-hotplug wlan1
+iface wlan1 inet manual
+ wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

View File

@ -0,0 +1 @@
00-interfaces.diff

8
stage2/02-net-tweaks/01-run.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash -e
install -v -d ${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d
install -v -m 644 files/wait.conf ${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/
install -v -d ${ROOTFS_DIR}/etc/wpa_supplicant
install -v -m 600 files/wpa_supplicant.conf ${ROOTFS_DIR}/etc/wpa_supplicant/

View File

@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=/sbin/dhcpcd -q -w

View File

@ -0,0 +1,3 @@
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

5
stage2/03-cleanup/00-run.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash -e
on_chroot sh -e - <<EOF
apt-get clean
EOF

1
stage2/EXPORT_IMAGE Normal file
View File

@ -0,0 +1 @@
-lite

4
stage2/prerun.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -e
if [ ! -d ${ROOTFS_DIR} ]; then
copy_previous
fi

View File

@ -0,0 +1,8 @@
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
xpdf gtk2-engines alsa-utils
desktop-base
git-core rpi-update
omxplayer
raspberrypi-artwork
policykit-1
udisks

View File

@ -0,0 +1,6 @@
xserver-xorg-video-fbdev xserver-xorg xinit xserver-xorg-video-fbturbo
epiphany-browser
lxde lxtask menu-xdg gksu
netsurf-gtk zenity xdg-utils
gvfs-backends gvfs-fuse
lightdm gnome-themes-standard-data gnome-icon-theme

View File

@ -0,0 +1,13 @@
Index: jessie-stage3/rootfs/etc/lightdm/lightdm-gtk-greeter.conf
===================================================================
--- jessie-stage3.orig/rootfs/etc/lightdm/lightdm-gtk-greeter.conf
+++ jessie-stage3/rootfs/etc/lightdm/lightdm-gtk-greeter.conf
@@ -16,7 +16,7 @@
# screensaver-timeout = Timeout (in seconds) until the screen blanks when the greeter is called as lockscreen
#
[greeter]
-background=/usr/share/images/desktop-base/login-background.svg
+background=#ffffff
theme-name=Adwaita
#icon-theme-name=
#font-name=

View File

@ -0,0 +1 @@
01-lightdm.diff

15
stage3/01-tweaks/00-run.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash -e
on_chroot sh -e - <<EOF
update-alternatives --set libgksu-gconf-defaults /usr/share/libgksu/debian/gconf-defaults.libgksu-sudo
update-gconf-defaults
EOF
on_chroot sh -e - <<EOF
update-alternatives --install /usr/share/images/desktop-base/desktop-background \
desktop-background /usr/share/raspberrypi-artwork/raspberry-pi-logo.png 100
EOF
rm -f ${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/wait.conf
install -m 644 files/55-storage.pkla ${ROOTFS_DIR}/etc/polkit-1/localauthority/50-local.d/
install -m 644 files/75source-profile ${ROOTFS_DIR}/etc/X11/Xsession.d/

View File

@ -0,0 +1,6 @@
[Storage Permissions]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown
ResultAny=yes
ResultActive=yes
ResultInactive=no

View File

@ -0,0 +1,2 @@
[ -f /etc/profile ] && . /etc/profile
[ -f "$HOME/.profile" ] && . "$HOME/.profile"

4
stage3/prerun.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -e
if [ ! -d ${ROOTFS_DIR} ]; then
copy_previous
fi

View File

@ -0,0 +1,4 @@
# Enable realtime process priority?
jackd2 jackd/tweak_rt_limits boolean true
# Do you accept the Wolfram - Raspberry Pi® Bundle License Agreement?
wolfram-engine shared/accepted-wolfram-eula boolean true

View File

@ -0,0 +1,27 @@
java-common oracle-java8-jdk
libreoffice-sdbc-hsqldb
sonic-pi
python idle python3-pygame python-pygame python-tk
python3 idle3 python3-tk
python3-rpi.gpio
python3-pgzero
python-serial python3-serial
python-picamera python3-picamera
debian-reference-en dillo x2x
wolfram-engine
raspberrypi-net-mods raspberrypi-ui-mods
smartsim penguinspuzzle
python-pip python3-pip
python3-numpy
pypy
python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio
minecraft-pi python-minecraftpi
alacarte rc-gui sense-hat
claws-mail
tree
scratch nuscratch
greenfoot bluej
nodered
python-gpiozero python3-gpiozero
raspi-gpio
libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr

View File

@ -0,0 +1,3 @@
libreoffice libreoffice-gtk
timidity
pi-package

5
stage4/01-tweaks/00-run.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash -e
ln -sf /etc/systemd/system/autologin@.service ${ROOTFS_DIR}/etc/systemd/system/getty.target.wants/getty@tty1.service
install -v -m 644 files/40-scratch.rules ${ROOTFS_DIR}/etc/udev/rules.d/

View File

@ -0,0 +1 @@
ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0003", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

View File

@ -0,0 +1,13 @@
Index: jessie-stage4/rootfs/etc/lightdm/lightdm.conf
===================================================================
--- jessie-stage4.orig/rootfs/etc/lightdm/lightdm.conf
+++ jessie-stage4/rootfs/etc/lightdm/lightdm.conf
@@ -114,7 +114,7 @@
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
-#autologin-user=
+autologin-user=pi
#autologin-user-timeout=0
#autologin-in-background=false
#autologin-session=UNIMPLEMENTED

View File

@ -0,0 +1 @@
0-autologin.diff

54
stage4/02-extras/00-run.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash -e
HASH=`wget https://api.github.com/repos/KenT2/python-games/git/refs/heads/master -qO -| grep \"sha\" | cut -f 2 -d ':' | cut -f 2 -d \"`
HASH_LOCAL=`cat files/python_games.hash`
if [ ! -e files/python_games.tar.gz ] || [ "$HASH" != "$HASH_LOCAL" ]; then
wget "https://github.com/KenT2/python-games/tarball/master" -O files/python_games.tar.gz
echo $HASH > files/python_games.hash
fi
ln -sf pip3 ${ROOTFS_DIR}/usr/bin/pip-3.2
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/python_games
tar xvf files/python_games.tar.gz -C ${ROOTFS_DIR}/home/pi/python_games --strip-components=1
chown 1000:1000 ${ROOTFS_DIR}/home/pi/python_games -Rv
chmod +x ${ROOTFS_DIR}/home/pi/python_games/launcher.sh
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/BlueJ Projects"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/Greenfoot Projects"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/Scratch Projects"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local/share"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local/share/applications"
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/doc/BlueJ/ "${ROOTFS_DIR}/home/pi/Documents/BlueJ Projects"
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/doc/Greenfoot/ "${ROOTFS_DIR}/home/pi/Documents/Greenfoot Projects"
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/scratch/Projects/Demos/ "${ROOTFS_DIR}/home/pi/Documents/Scratch Projects"
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/pcmanfm
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/pcmanfm/LXDE-pi
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/openbox
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/lxsession
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.themes
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/gtk-3.0
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/lxpanel
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/Desktop
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/pcmanfm/LXDE-pi/pcmanfm.conf ${ROOTFS_DIR}/home/pi/.config/pcmanfm/LXDE-pi/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/pcmanfm/LXDE-pi/desktop-items-0.conf ${ROOTFS_DIR}/home/pi/.config/pcmanfm/LXDE-pi/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/openbox/lxde-pi-rc.xml ${ROOTFS_DIR}/home/pi/.config/openbox/
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/etc/xdg/lxsession/LXDE-pi ${ROOTFS_DIR}/home/pi/.config/lxsession/
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/themes/PiX ${ROOTFS_DIR}/home/pi/.themes/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/usr/share/raspi-ui-overrides/gtk.css ${ROOTFS_DIR}/home/pi/.config/gtk-3.0/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/usr/share/raspi-ui-overrides/Trolltech.conf ${ROOTFS_DIR}/home/pi/.config/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/lxpanel/launchtaskbar.cfg ${ROOTFS_DIR}/home/pi/.config/lxpanel/
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/etc/xdg/lxpanel/profile/LXDE-pi ${ROOTFS_DIR}/home/pi/.config/lxpanel/

2
stage4/02-extras/files/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
python_games.hash
python_games.tar.gz

5
stage4/03-cleanup/00-run.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash -e
on_chroot sh -e - <<EOF
apt-get clean
EOF

0
stage4/EXPORT_IMAGE Normal file
View File

0
stage4/EXPORT_NOOBS Normal file
View File

4
stage4/prerun.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -e
if [ ! -d ${ROOTFS_DIR} ]; then
copy_previous
fi