-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from andni233/master
NanoPi R2S support
- Loading branch information
Showing
17 changed files
with
139 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Read build script documentation https://docs.armbian.com/Developer-Guide_Build-Options/ | ||
# for detailed explanation of these options and for additional options not listed here | ||
|
||
KERNEL_ONLY="no" # leave empty to select each time, set to "yes" or "no" to skip dialog prompt | ||
KERNEL_CONFIGURE="no" # leave empty to select each time, set to "yes" or "no" to skip dialog prompt | ||
BUILD_MINIMAL="yes" | ||
CLEAN_LEVEL="make,debs,oldcache" # comma-separated list of clean targets: "make" = make clean for selected kernel and u-boot, | ||
# "debs" = delete packages in "./output/debs" for current branch and family, | ||
# "alldebs" = delete all packages in "./output/debs", "images" = delete "./output/images", | ||
# "cache" = delete "./output/cache", "sources" = delete "./sources" | ||
# "oldcache" = remove old cached rootfs except for the newest 8 files | ||
|
||
REPOSITORY_INSTALL="" # comma-separated list of core modules which will be installed from repository | ||
# "u-boot", "kernel", "bsp", "armbian-config", "armbian-firmware" | ||
# leave empty to build from sources or use local cache | ||
|
||
DEST_LANG="C.UTF-8" # sl_SI.UTF-8, en_US.UTF-8 | ||
|
||
# advanced | ||
EXTERNAL_NEW="prebuilt" # compile and install or install prebuilt additional packages | ||
INSTALL_HEADERS="no" # install kernel headers package | ||
LIB_TAG="master" # change to "branchname" to use any branch currently available. | ||
USE_TORRENT="yes" # use torrent network for faster toolchain and cache download | ||
DOWNLOAD_MIRROR="" # set to "china" to use mirrors.tuna.tsinghua.edu.cn | ||
CARD_DEVICE="" # device name /dev/sdx of your SD card to burn directly to the card when done | ||
|
||
BRANCH="current" | ||
RELEASE="buster" | ||
BOARD="nanopi-r2s" | ||
HOST="znail" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
# arguments: $RELEASE $LINUXFAMILY $BOARD $BUILD_DESKTOP | ||
# | ||
# This is the image customization script | ||
|
||
# NOTE: It is copied to /tmp directory inside the image | ||
# and executed there inside chroot environment | ||
# so don't reference any files that are not already installed | ||
|
||
# NOTE: If you want to transfer files between chroot and host | ||
# userpatches/overlay directory on host is bind-mounted to /tmp/overlay in chroot | ||
# The sd card's root path is accessible via $SDCARD variable. | ||
|
||
RELEASE=$1 | ||
LINUXFAMILY=$2 | ||
BOARD=$3 | ||
BUILD_DESKTOP=$4 | ||
OVERLAY="/tmp/overlay" | ||
|
||
EnableKernelModules() { | ||
echo "sch_netem" >> /etc/modules | ||
echo "br_netfilter" >> /etc/modules | ||
} | ||
|
||
ConfigureNetwork() { | ||
install -v -m 700 "${OVERLAY}/update-network-interfaces" "/usr/local/bin" | ||
install -v -m 644 "${OVERLAY}/update-network-interfaces.service" "/etc/systemd/system/" | ||
rm -f "/etc/systemd/system/multi-user.target.wants/update-network-interfaces.service" | ||
ln -s "/etc/systemd/system/update-network-interfaces.service" "/etc/systemd/system/multi-user.target.wants/update-network-interfaces.service" | ||
# nanopi-r2s board support installs a udev rule to rename eth1 -> lan0. | ||
# We don't need that. | ||
rm -f "/etc/udev/rules.d/70-rename-lan.rules" | ||
} | ||
|
||
FixupHaveged() { | ||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866306 | ||
sed -i -e 's/DAEMON_ARGS="\?\([^"]*\)"\?/DAEMON_ARGS="\1 -d 16"/g' "/etc/default/haveged" | ||
} | ||
|
||
InstallZnail() { | ||
install -d "/opt/znail" | ||
install -v -m 600 "${OVERLAY}/requirements.txt" "/opt/znail/requirements.txt" | ||
install -v -m 600 -D -t "/opt/znail" "${OVERLAY}"/*.whl | ||
pushd "/opt/znail" | ||
python3 -m venv venv | ||
source "venv/bin/activate" | ||
pip3 install wheel | ||
pip3 install -r requirements.txt | ||
pip3 install *.whl | ||
popd | ||
install -v -m 644 "${OVERLAY}/znail.service" "/etc/systemd/system/" | ||
rm -f "/etc/systemd/system/multi-user.target.wants/znail.service" | ||
ln -s "/etc/systemd/system/znail.service" "/etc/systemd/system/multi-user.target.wants/znail.service" | ||
# Fake hub-ctrl to make znail start | ||
rm -f "/usr/local/bin/hub-ctrl" | ||
ln -s "/usr/bin/true" "/usr/local/bin/hub-ctrl" | ||
} | ||
|
||
EnableKernelModules "$@" | ||
ConfigureNetwork "$@" | ||
FixupHaveged "$@" | ||
InstallZnail "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PACKAGE_LIST_ADDITIONAL="$PACKAGE_LIST_ADDITIONAL bridge-utils ebtables iptables dnsmasq python3 python3-pip python3-venv python3-wheel git tcpdump vim" | ||
PACKAGE_LIST_RM="$PACKAGE_LIST_RM smartmontools" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.