Add Raspbian stages
This commit is contained in:
5
stage2/01-sys-tweaks/files/50raspi
Normal file
5
stage2/01-sys-tweaks/files/50raspi
Normal 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";
|
3
stage2/01-sys-tweaks/files/98-rpi.conf
Normal file
3
stage2/01-sys-tweaks/files/98-rpi.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
kernel.printk = 3 4 1 3
|
||||
vm.swappiness=1
|
||||
vm.min_free_kbytes = 8192
|
31
stage2/01-sys-tweaks/files/apply_noobs_os_config
Normal file
31
stage2/01-sys-tweaks/files/apply_noobs_os_config
Normal 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
|
36
stage2/01-sys-tweaks/files/regenerate_ssh_host_keys
Normal file
36
stage2/01-sys-tweaks/files/regenerate_ssh_host_keys
Normal 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
|
25
stage2/01-sys-tweaks/files/resize2fs_once
Normal file
25
stage2/01-sys-tweaks/files/resize2fs_once
Normal 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
|
2
stage2/01-sys-tweaks/files/ttyoutput.conf
Normal file
2
stage2/01-sys-tweaks/files/ttyoutput.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
[Service]
|
||||
StandardOutput=tty
|
Reference in New Issue
Block a user