aboutsummaryrefslogtreecommitdiffstats
path: root/stage1
diff options
context:
space:
mode:
authorSerge Schneider <[email protected]>2016-04-11 07:29:41 +0100
committerSerge Schneider <[email protected]>2016-04-11 07:34:01 +0100
commit99bf2f4d61abd32e275592800c1367b8e58bb16c (patch)
tree1d1f968829e592e70f10bb34ce32ff6c01afedc5 /stage1
parent5200b19f9a92de8ecee7476f366e0d2ce55516e4 (diff)
Add Raspbian stages
Diffstat (limited to 'stage1')
-rwxr-xr-xstage1/00-boot-files/00-run.sh4
-rw-r--r--stage1/00-boot-files/files/cmdline.txt1
-rw-r--r--stage1/00-boot-files/files/config.txt56
-rw-r--r--stage1/01-sys-tweaks/00-patches/01-bashrc.diff33
-rw-r--r--stage1/01-sys-tweaks/00-patches/series1
-rwxr-xr-xstage1/01-sys-tweaks/00-run.sh16
-rw-r--r--stage1/01-sys-tweaks/files/fstab3
-rw-r--r--stage1/01-sys-tweaks/files/noclear.conf2
-rwxr-xr-xstage1/01-sys-tweaks/files/policy-rc.d2
-rw-r--r--stage1/02-net-tweaks/00-patches/01-hosts.diff9
-rw-r--r--stage1/02-net-tweaks/00-patches/02-persistant-net.diff13
-rw-r--r--stage1/02-net-tweaks/00-patches/series2
-rwxr-xr-xstage1/02-net-tweaks/00-run.sh9
-rw-r--r--stage1/02-net-tweaks/files/hostname1
-rw-r--r--stage1/02-net-tweaks/files/interfaces4
-rw-r--r--stage1/02-net-tweaks/files/ipv6.conf3
-rw-r--r--stage1/03-install-packages/00-packages1
-rwxr-xr-xstage1/prerun.sh4
18 files changed, 164 insertions, 0 deletions
diff --git a/stage1/00-boot-files/00-run.sh b/stage1/00-boot-files/00-run.sh
new file mode 100755
index 0000000..2c976a8
--- /dev/null
+++ b/stage1/00-boot-files/00-run.sh
@@ -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/
diff --git a/stage1/00-boot-files/files/cmdline.txt b/stage1/00-boot-files/files/cmdline.txt
new file mode 100644
index 0000000..45c7f58
--- /dev/null
+++ b/stage1/00-boot-files/files/cmdline.txt
@@ -0,0 +1 @@
+dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
diff --git a/stage1/00-boot-files/files/config.txt b/stage1/00-boot-files/files/config.txt
new file mode 100644
index 0000000..69dfef2
--- /dev/null
+++ b/stage1/00-boot-files/files/config.txt
@@ -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
diff --git a/stage1/01-sys-tweaks/00-patches/01-bashrc.diff b/stage1/01-sys-tweaks/00-patches/01-bashrc.diff
new file mode 100644
index 0000000..efa2104
--- /dev/null
+++ b/stage1/01-sys-tweaks/00-patches/01-bashrc.diff
@@ -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
diff --git a/stage1/01-sys-tweaks/00-patches/series b/stage1/01-sys-tweaks/00-patches/series
new file mode 100644
index 0000000..6287f0b
--- /dev/null
+++ b/stage1/01-sys-tweaks/00-patches/series
@@ -0,0 +1 @@
+01-bashrc.diff
diff --git a/stage1/01-sys-tweaks/00-run.sh b/stage1/01-sys-tweaks/00-run.sh
new file mode 100755
index 0000000..5c6ce7e
--- /dev/null
+++ b/stage1/01-sys-tweaks/00-run.sh
@@ -0,0 +1,16 @@
+#!/bin/bash -e
+
+install -d ${ROOTFS_DIR}/etc/systemd/system/[email protected]
+install -m 644 files/noclear.conf ${ROOTFS_DIR}/etc/systemd/system/[email protected]/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
+
+
diff --git a/stage1/01-sys-tweaks/files/fstab b/stage1/01-sys-tweaks/files/fstab
new file mode 100644
index 0000000..68e5816
--- /dev/null
+++ b/stage1/01-sys-tweaks/files/fstab
@@ -0,0 +1,3 @@
+proc /proc proc defaults 0 0
+/dev/mmcblk0p1 /boot vfat defaults 0 2
+/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
diff --git a/stage1/01-sys-tweaks/files/noclear.conf b/stage1/01-sys-tweaks/files/noclear.conf
new file mode 100644
index 0000000..52671c7
--- /dev/null
+++ b/stage1/01-sys-tweaks/files/noclear.conf
@@ -0,0 +1,2 @@
+[Service]
+TTYVTDisallocate=no
diff --git a/stage1/01-sys-tweaks/files/policy-rc.d b/stage1/01-sys-tweaks/files/policy-rc.d
new file mode 100755
index 0000000..0b1556d
--- /dev/null
+++ b/stage1/01-sys-tweaks/files/policy-rc.d
@@ -0,0 +1,2 @@
+#!/bin/sh
+exit 101
diff --git a/stage1/02-net-tweaks/00-patches/01-hosts.diff b/stage1/02-net-tweaks/00-patches/01-hosts.diff
new file mode 100644
index 0000000..ad07ae5
--- /dev/null
+++ b/stage1/02-net-tweaks/00-patches/01-hosts.diff
@@ -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
diff --git a/stage1/02-net-tweaks/00-patches/02-persistant-net.diff b/stage1/02-net-tweaks/00-patches/02-persistant-net.diff
new file mode 100644
index 0000000..1e6a975
--- /dev/null
+++ b/stage1/02-net-tweaks/00-patches/02-persistant-net.diff
@@ -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
diff --git a/stage1/02-net-tweaks/00-patches/series b/stage1/02-net-tweaks/00-patches/series
new file mode 100644
index 0000000..5299ca1
--- /dev/null
+++ b/stage1/02-net-tweaks/00-patches/series
@@ -0,0 +1,2 @@
+01-hosts.diff
+02-persistant-net.diff
diff --git a/stage1/02-net-tweaks/00-run.sh b/stage1/02-net-tweaks/00-run.sh
new file mode 100755
index 0000000..fd6609a
--- /dev/null
+++ b/stage1/02-net-tweaks/00-run.sh
@@ -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
diff --git a/stage1/02-net-tweaks/files/hostname b/stage1/02-net-tweaks/files/hostname
new file mode 100644
index 0000000..41757af
--- /dev/null
+++ b/stage1/02-net-tweaks/files/hostname
@@ -0,0 +1 @@
+raspberrypi
diff --git a/stage1/02-net-tweaks/files/interfaces b/stage1/02-net-tweaks/files/interfaces
new file mode 100644
index 0000000..88a8c6a
--- /dev/null
+++ b/stage1/02-net-tweaks/files/interfaces
@@ -0,0 +1,4 @@
+auto lo
+
+iface lo inet loopback
+iface eth0 inet dhcp
diff --git a/stage1/02-net-tweaks/files/ipv6.conf b/stage1/02-net-tweaks/files/ipv6.conf
new file mode 100644
index 0000000..1a1c1a6
--- /dev/null
+++ b/stage1/02-net-tweaks/files/ipv6.conf
@@ -0,0 +1,3 @@
+# Don't load ipv6 by default
+alias net-pf-10 off
+#alias ipv6 off
diff --git a/stage1/03-install-packages/00-packages b/stage1/03-install-packages/00-packages
new file mode 100644
index 0000000..e8c148c
--- /dev/null
+++ b/stage1/03-install-packages/00-packages
@@ -0,0 +1 @@
+libraspberrypi-bin libraspberrypi0 raspi-config
diff --git a/stage1/prerun.sh b/stage1/prerun.sh
new file mode 100755
index 0000000..a5ea5f4
--- /dev/null
+++ b/stage1/prerun.sh
@@ -0,0 +1,4 @@
+#!/bin/bash -e
+if [ ! -d ${ROOTFS_DIR} ]; then
+ copy_previous
+fi