Skip to content

Commit

Permalink
Added NanoPi Duo target.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrspruitt committed Oct 2, 2017
1 parent 1442957 commit 576ee96
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 0 deletions.
52 changes: 52 additions & 0 deletions targets/nanopi_duo.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

IMAGE_MB=512
MIRROR=http://mirrors.kernel.org/debian
SYSTEM=debian
ARCH=armhf
SUITE=stretch

read -r -d '' EXTRA_PACKAGES << EOF
crda
dnsutils
dosfstools
ifupdown
iputils-ping
isc-dhcp-client
kmod
less
locales
net-tools
openssh-client
openssh-server
parted
rfkill
systemd
systemd-sysv
udev
vim-tiny
wireless-tools
wpasupplicant
EOF

HOSTNAME=nanopi_duo
LOCALE=en_US.UTF-8

post_install() {
find "${ROOTFS}/usr/share/doc" ! -name copyright -type f -delete
find "${ROOTFS}/usr/share/doc" -type d -delete > /dev/null 2>&1
rm -rf "${ROOTFS}/usr/share/man/"*
rm -rf "${ROOTFS}/usr/share/info/"*
rm -rf "${ROOTFS}/usr/share/lintian/"*

cat >> "${ROOTFS}/etc/securetty" << EOF
ttys0
EOF

cp -r "${DIBS}/targets/nanopi_duo_overlay/"* "${ROOTFS}"
sed -i "s/#PermitEmptyPasswords no/PermitEmptyPasswords yes/g" ${ROOTFS}/etc/ssh/sshd_config
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" ${ROOTFS}/etc/ssh/sshd_config
sed -i "s/UsePAM yes/UsePAM no/g" ${ROOTFS}/etc/ssh/sshd_config
run_target /usr/sbin/update-rc.d firstboot defaults
}
4 changes: 4 additions & 0 deletions targets/nanopi_duo_overlay/etc/apt/apt.conf.d/02nocache
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dir::Cache {
srcpkgcache "";
pkgcache "";
}
13 changes: 13 additions & 0 deletions targets/nanopi_duo_overlay/etc/dpkg/dpkg.cfg.d/01_smalldisk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# block documentation
path-exclude /usr/share/doc/*
# keep copyright files for legal reasons
path-include /usr/share/doc/*/copyright
path-exclude /usr/share/man/*
path-exclude /usr/share/groff/*
path-exclude /usr/share/info/*
# lintian stuff is small, but really unnecessary
path-exclude /usr/share/lintian/*
path-exclude /usr/share/linda/*
# block non-us locales
path-exclude /usr/share/locale/*
path-include /usr/share/locale/en*
1 change: 1 addition & 0 deletions targets/nanopi_duo_overlay/etc/fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
devpts /dev/pts devpts defaults,gid=5,mode=620 0 0
21 changes: 21 additions & 0 deletions targets/nanopi_duo_overlay/etc/init.d/firstboot
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: firstboot
# Required-Start: $remote_fs $syslog
# Required-Stop:
# X-Start-Before: sshd
# Default-Start: S
# Default-Stop:
# Short-Description: First boot configuration.
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

test "$1" = "start" || exit 0

#test -f /boot/firstboot.txt && . /boot/firstboot.txt

/usr/bin/ssh-keygen -A
update-rc.d firstboot disable

exit 0
3 changes: 3 additions & 0 deletions targets/nanopi_duo_overlay/etc/network/interfaces.d/eth0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
4 changes: 4 additions & 0 deletions targets/nanopi_duo_overlay/etc/network/interfaces.d/wlan0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
country=US

0 comments on commit 576ee96

Please sign in to comment.