Add Raspbian stages
This commit is contained in:
4
stage1/00-boot-files/00-run.sh
Executable file
4
stage1/00-boot-files/00-run.sh
Executable 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/
|
1
stage1/00-boot-files/files/cmdline.txt
Normal file
1
stage1/00-boot-files/files/cmdline.txt
Normal 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
|
56
stage1/00-boot-files/files/config.txt
Normal file
56
stage1/00-boot-files/files/config.txt
Normal 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
|
33
stage1/01-sys-tweaks/00-patches/01-bashrc.diff
Normal file
33
stage1/01-sys-tweaks/00-patches/01-bashrc.diff
Normal 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
|
1
stage1/01-sys-tweaks/00-patches/series
Normal file
1
stage1/01-sys-tweaks/00-patches/series
Normal file
@@ -0,0 +1 @@
|
||||
01-bashrc.diff
|
16
stage1/01-sys-tweaks/00-run.sh
Executable file
16
stage1/01-sys-tweaks/00-run.sh
Executable 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
|
||||
|
||||
|
3
stage1/01-sys-tweaks/files/fstab
Normal file
3
stage1/01-sys-tweaks/files/fstab
Normal 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
|
2
stage1/01-sys-tweaks/files/noclear.conf
Normal file
2
stage1/01-sys-tweaks/files/noclear.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
[Service]
|
||||
TTYVTDisallocate=no
|
2
stage1/01-sys-tweaks/files/policy-rc.d
Executable file
2
stage1/01-sys-tweaks/files/policy-rc.d
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exit 101
|
9
stage1/02-net-tweaks/00-patches/01-hosts.diff
Normal file
9
stage1/02-net-tweaks/00-patches/01-hosts.diff
Normal 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
|
13
stage1/02-net-tweaks/00-patches/02-persistant-net.diff
Normal file
13
stage1/02-net-tweaks/00-patches/02-persistant-net.diff
Normal 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
|
2
stage1/02-net-tweaks/00-patches/series
Normal file
2
stage1/02-net-tweaks/00-patches/series
Normal file
@@ -0,0 +1,2 @@
|
||||
01-hosts.diff
|
||||
02-persistant-net.diff
|
9
stage1/02-net-tweaks/00-run.sh
Executable file
9
stage1/02-net-tweaks/00-run.sh
Executable 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
|
1
stage1/02-net-tweaks/files/hostname
Normal file
1
stage1/02-net-tweaks/files/hostname
Normal file
@@ -0,0 +1 @@
|
||||
raspberrypi
|
4
stage1/02-net-tweaks/files/interfaces
Normal file
4
stage1/02-net-tweaks/files/interfaces
Normal file
@@ -0,0 +1,4 @@
|
||||
auto lo
|
||||
|
||||
iface lo inet loopback
|
||||
iface eth0 inet dhcp
|
3
stage1/02-net-tweaks/files/ipv6.conf
Normal file
3
stage1/02-net-tweaks/files/ipv6.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
# Don't load ipv6 by default
|
||||
alias net-pf-10 off
|
||||
#alias ipv6 off
|
1
stage1/03-install-packages/00-packages
Normal file
1
stage1/03-install-packages/00-packages
Normal file
@@ -0,0 +1 @@
|
||||
libraspberrypi-bin libraspberrypi0 raspi-config
|
4
stage1/prerun.sh
Executable file
4
stage1/prerun.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash -e
|
||||
if [ ! -d ${ROOTFS_DIR} ]; then
|
||||
copy_previous
|
||||
fi
|
Reference in New Issue
Block a user