-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for docker/container images (#1056)
This PR integrates a first-hand implementation for generating docker/container versions of RaspberryMatic. Please note, that this is still partly WIP and not released yet. So if you are testing the docker implementation you are somehwat on your own until we release this to the public. However, please warmly welcome this new supported virtual platform for RaspberryMatic! Co-authored-by: Jens Maus <[email protected]>
- Loading branch information
Showing
54 changed files
with
1,779 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
/download | ||
/release/*.zip | ||
/release/*.img | ||
/release/*.tar | ||
/release/*.sha256 |
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,10 @@ | ||
FROM scratch | ||
|
||
ARG TARGETARCH | ||
ARG tar_prefix=rootfs | ||
|
||
ADD $tar_prefix$TARGETARCH.tar / | ||
|
||
CMD ["/sbin/init"] | ||
VOLUME /usr/local | ||
EXPOSE 80 22 161 443 1900 1901 1902 5987 1999 2000 2001 2002 2010 8088 8181 9099 9292 9293 10000 23272 41999 42000 42001 42010 43438 43439 48181 48899 49292 49880 |
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,22 @@ | ||
#!/bin/sh | ||
|
||
# create VERSION file | ||
echo "VERSION=${PRODUCT_VERSION}" >${TARGET_DIR}/VERSION | ||
echo "PRODUCT=${PRODUCT}" >>${TARGET_DIR}/VERSION | ||
echo "PLATFORM=oci" >>${TARGET_DIR}/VERSION | ||
|
||
# fix some permissions | ||
[ -e ${TARGET_DIR}/etc/monitrc ] && chmod 600 ${TARGET_DIR}/etc/monitrc | ||
|
||
# remove unnecessary stuff from TARGET_DIR | ||
rm -f ${TARGET_DIR}/etc/init.d/S01InitZRAMSwap | ||
rm -f ${TARGET_DIR}/etc/init.d/S03InitURandom | ||
rm -f ${TARGET_DIR}/etc/init.d/S21rngd | ||
rm -f ${TARGET_DIR}/etc/init.d/S31bluetooth | ||
#rm -f ${TARGET_DIR}/etc/init.d/S40network | ||
rm -f ${TARGET_DIR}/etc/init.d/S49chrony | ||
rm -f ${TARGET_DIR}/bin/dhcp.script | ||
|
||
# link VERSION in /boot on rootfs | ||
mkdir -p ${TARGET_DIR}/boot | ||
ln -sf ../VERSION ${TARGET_DIR}/boot/VERSION |
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,26 @@ | ||
#!/bin/bash | ||
|
||
BOARD_DIR="$(dirname $0)" | ||
BOARD_NAME="$(basename ${BOARD_DIR})" | ||
|
||
# define DOCKER_ARCH on the BR2_CONFIG setup | ||
if grep -Eq "^BR2_x86_64=y$" ${BR2_CONFIG}; then | ||
DOCKER_ARCH=amd64 | ||
elif grep -Eq "^BR2_i386=y$" ${BR2_CONFIG}; then | ||
DOCKER_ARCH=i386 | ||
elif grep -Eq "^BR2_aarch64=y$" ${BR2_CONFIG}; then | ||
DOCKER_ARCH=arm64 | ||
elif grep -Eq "^BR2_arm=y$" ${BR2_CONFIG}; then | ||
DOCKER_ARCH=arm | ||
else | ||
echo "Unknown architecture" | ||
exit 1 | ||
fi | ||
|
||
# make sure a factory reset is performed upon fresh start | ||
touch "${TARGET_DIR}/usr/local/.doFactoryReset" | ||
|
||
#Create docker image | ||
docker build --file="${BOARD_DIR}/Dockerfile" --build-arg=tar_prefix=rootfs --tag=raspberrymatic:${DOCKER_ARCH}-latest ${BINARIES_DIR} | ||
|
||
exit $? |
111 changes: 111 additions & 0 deletions
111
buildroot-external/configs/raspmatic_oci_amd64_defconfig
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,111 @@ | ||
BR2_x86_64=y | ||
BR2_DL_DIR="$(TOPDIR)/../download" | ||
BR2_KERNEL_MIRROR="https://www.kernel.org/pub" | ||
BR2_GNU_MIRROR="http://ftp.gnu.org/pub/gnu" | ||
BR2_OPTIMIZE_2=y | ||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_EQ3_PATH)/patches" | ||
# BR2_COMPILER_PARANOID_UNSAFE_PATH is not set | ||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y | ||
BR2_KERNEL_HEADERS_4_4=y | ||
BR2_PACKAGE_GLIBC_UTILS=y | ||
BR2_TOOLCHAIN_BUILDROOT_CXX=y | ||
BR2_ROOTFS_LIB_DIR="lib" | ||
BR2_ROOTFS_LIB32_DIR="lib32" | ||
BR2_TARGET_GENERIC_HOSTNAME="" | ||
BR2_TARGET_GENERIC_ISSUE="Welcome to RaspberryMatic" | ||
BR2_TARGET_GENERIC_PASSWD_SHA512=y | ||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y | ||
# BR2_TARGET_GENERIC_GETTY is not set | ||
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set | ||
# BR2_ENABLE_LOCALE_PURGE is not set | ||
BR2_TARGET_TZ_INFO=y | ||
BR2_TARGET_LOCALTIME="Europe/Berlin" | ||
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_EQ3_PATH)/overlay/base $(BR2_EXTERNAL_EQ3_PATH)/overlay/base-raspmatic $(BR2_EXTERNAL_EQ3_PATH)/overlay/WebUI $(BR2_EXTERNAL_EQ3_PATH)/overlay/WebUI-raspmatic $(BR2_EXTERNAL_EQ3_PATH)/overlay/RFD $(BR2_EXTERNAL_EQ3_PATH)/overlay/base-raspmatic_oci" | ||
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_EQ3_PATH)/board/oci/post-build.sh" | ||
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_EQ3_PATH)/board/oci/post-image.sh" | ||
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_EQ3_PATH)/Busybox.config" | ||
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y | ||
BR2_PACKAGE_STRACE=y | ||
BR2_PACKAGE_JQ=y | ||
BR2_PACKAGE_DOSFSTOOLS=y | ||
BR2_PACKAGE_DOSFSTOOLS_FATLABEL=y | ||
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y | ||
BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT=y | ||
BR2_PACKAGE_E2FSPROGS=y | ||
BR2_PACKAGE_E2FSPROGS_E4DEFRAG=y | ||
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y | ||
BR2_PACKAGE_EXFAT=y | ||
BR2_PACKAGE_EXFAT_UTILS=y | ||
BR2_PACKAGE_F2FS_TOOLS=y | ||
BR2_PACKAGE_NTFS_3G=y | ||
BR2_PACKAGE_DEJAVU=y | ||
BR2_PACKAGE_LIBERATION=y | ||
BR2_PACKAGE_PSPLASH=y | ||
BR2_PACKAGE_PSPLASH_PATCH="$(BR2_EXTERNAL_EQ3_PATH)/patches/psplash/raspmatic" | ||
BR2_PACKAGE_I2C_TOOLS=y | ||
BR2_PACKAGE_RNG_TOOLS=y | ||
BR2_PACKAGE_NODEJS=y | ||
BR2_PACKAGE_NODEJS_NPM=y | ||
BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL="async accepts mc charenc encodeurl inherits moment range-parser unorm adm-zip compress-commons end-of-stream ipaddr.js moment-timezone raw-body unpipe archiver concat-map escape-html is-buffer ms readable-stream url archiver-utils content-disposition etag isarray negotiator remove-trailing-separator util-deprecate array-flatten content-type express jmespath node-dir safe-buffer utils-merge async cookie finalhandler jsonfile node-localstorage sax uuid aws-sdk cookie-signature forwarded lazystream normalize-path send vary balanced-match core-util-is fresh lodash on-finished serve-static walkdir base64-js crc fs-extra loop-protect once setprototypeof winreg big-integer crc32-stream fs.realpath md5 parseurl slide wrappy bl cron glob media-typer path-is-absolute statuses write-file-atomic body-parser crypt graceful-fs merge-descriptors path-to-regexp string_decoder ws brace-expansion crypto-browserify http-errors methods process-nextick-args suncalc xml2js buffer debug iconv-lite mime proxy-addr tar-stream xmlbuilder buffer-crc32 depd ieee754 mime-db punycode type-is xtend buffer-shims destroy imurmurhash mime-types qs ultron zip-stream bytes ee-first inflight minimatch querystring universalify" | ||
BR2_PACKAGE_CA_CERTIFICATES=y | ||
BR2_PACKAGE_LIBOPENSSL_BIN=y | ||
BR2_PACKAGE_FONTCONFIG=y | ||
BR2_PACKAGE_LIBUSB=y | ||
BR2_PACKAGE_LIBUSB_COMPAT=y | ||
BR2_PACKAGE_LIBCURL=y | ||
BR2_PACKAGE_LIBCURL_CURL=y | ||
BR2_PACKAGE_LIBDNET=y | ||
BR2_PACKAGE_LIBNETFILTER_CONNTRACK=y | ||
BR2_PACKAGE_MSMTP=y | ||
BR2_PACKAGE_AVAHI=y | ||
BR2_PACKAGE_CHRONY=y | ||
BR2_PACKAGE_ETHTOOL=y | ||
BR2_PACKAGE_IPTABLES=y | ||
BR2_PACKAGE_IW=y | ||
BR2_PACKAGE_LIGHTTPD=y | ||
BR2_PACKAGE_LIGHTTPD_OPENSSL=y | ||
BR2_PACKAGE_LIGHTTPD_ZLIB=y | ||
BR2_PACKAGE_LIGHTTPD_PCRE=y | ||
BR2_PACKAGE_NETSNMP=y | ||
BR2_PACKAGE_NETSNMP_WITH_MIB_MODULES="host ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/extensible ucd-snmp/pass mibII/mta_sendmail etherlike-mib/dot3StatsTable disman/event-mib agentx" | ||
BR2_PACKAGE_NTP=y | ||
# BR2_PACKAGE_NTP_NTPD is not set | ||
BR2_PACKAGE_NTP_NTPDATE=y | ||
BR2_PACKAGE_OPENSSH=y | ||
BR2_PACKAGE_OPENVPN=y | ||
BR2_PACKAGE_RSYNC=y | ||
BR2_PACKAGE_SER2NET=y | ||
BR2_PACKAGE_SOCAT=y | ||
BR2_PACKAGE_TCPDUMP=y | ||
BR2_PACKAGE_WGET=y | ||
BR2_PACKAGE_WIREGUARD_TOOLS=y | ||
BR2_PACKAGE_XINETD=y | ||
BR2_PACKAGE_FILE=y | ||
BR2_PACKAGE_LOCKFILE_PROGS=y | ||
BR2_PACKAGE_LOGROTATE=y | ||
BR2_PACKAGE_IRQBALANCE=y | ||
BR2_PACKAGE_MONIT=y | ||
BR2_PACKAGE_NUT=y | ||
BR2_PACKAGE_TAR=y | ||
BR2_PACKAGE_UTIL_LINUX_BINARIES=y | ||
BR2_PACKAGE_UTIL_LINUX_LOSETUP=y | ||
BR2_PACKAGE_UTIL_LINUX_RFKILL=y | ||
BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y | ||
BR2_PACKAGE_HOST_DOSFSTOOLS=y | ||
BR2_PACKAGE_HOST_E2FSPROGS=y | ||
BR2_PACKAGE_MULTILIB32=y | ||
BR2_PACKAGE_MULTILIB32_DEFCONFIG="multilib32_i686_defconfig" | ||
BR2_PACKAGE_OCCU=y | ||
BR2_PACKAGE_OCCU_RF_PROTOCOL_HM_HMIP=y | ||
BR2_PACKAGE_OCCU_WEBUI=y | ||
BR2_PACKAGE_OCCU_WEBUI_REGAHSS_BETA=y | ||
BR2_PACKAGE_OCCU_HMSERVER=y | ||
BR2_PACKAGE_CLOUDMATIC=y | ||
BR2_PACKAGE_HMLANGW=y | ||
BR2_PACKAGE_DETECT_RADIO_MODULE=y | ||
BR2_PACKAGE_DAEMONIZE=y | ||
BR2_PACKAGE_SSDPD=y | ||
BR2_PACKAGE_EQ3CONFIGD=y | ||
BR2_PACKAGE_NEOSERVER=y | ||
BR2_PACKAGE_RNDADDTOENTCNT=y | ||
BR2_PACKAGE_JAVA_AZUL=y |
Oops, something went wrong.