diff --git a/bananapi/.gitattributes b/bananapi/.gitattributes new file mode 100644 index 0000000..5a97bca --- /dev/null +++ b/bananapi/.gitattributes @@ -0,0 +1 @@ +*.tar filter=lfs diff=lfs merge=lfs -text diff --git a/bananapi/Dockerfile b/bananapi/Dockerfile new file mode 100644 index 0000000..bc02887 --- /dev/null +++ b/bananapi/Dockerfile @@ -0,0 +1,20 @@ +FROM sabayon/armhfp + +MAINTAINER geaaru + +# Set locales to en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +# Perform post-upgrade tasks (mirror sorting, updating repository db) +ADD ./scripts/setup.sh /setup.sh +RUN /bin/bash /setup.sh && rm -rf /setup.sh + +# Firmware and modules blob +ADD ./firmware_modules.tar / +ADD ./boot.tar /boot +# Set environment variables. +ENV HOME /root + +# Define working directory. +WORKDIR / + diff --git a/bananapi/boot.tar b/bananapi/boot.tar new file mode 100644 index 0000000..1b06ba9 --- /dev/null +++ b/bananapi/boot.tar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8896d8413a4d5f845835ca70c13ebc1cbe4fca4237db9b821d899ad02c0de67 +size 5509120 diff --git a/bananapi/firmware_modules.tar b/bananapi/firmware_modules.tar new file mode 100644 index 0000000..012e1f3 --- /dev/null +++ b/bananapi/firmware_modules.tar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8b21a0ed5708955936b50b75114c7a950140aa70f41fdb569900cb9d68a11b2 +size 17264640 diff --git a/bananapi/scripts/setup.sh b/bananapi/scripts/setup.sh new file mode 100755 index 0000000..b924c88 --- /dev/null +++ b/bananapi/scripts/setup.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Description: Script for prepare docker image of bananapi tree +# from sabayon/armhfp tree. + +/usr/sbin/env-update +. /etc/profile + +setup_bootfs_fstab() { + # add /dev/mmcblk0p1 to /etc/fstab + local boot_part_type="${1}" + echo "/dev/mmcblk0p1 /boot ${boot_part_type} defaults 0 2" >> /etc/fstab +} + +setup_rootfs_fstab() { + echo "/dev/mmcblk0p2 / ext4 noatime 0 1" >> /etc/fstab +} + +# Force armv7l entropy architecture (kernel is 64bit) +echo "armv7l" > /etc/entropy/.arch +echo "~arm" > /etc/entropy/packages/package.keywords +echo "arm" >> /etc/entropy/packages/package.keywords + +# Perform package upgrades +ACCEPT_LICENSE=* equo up && equo u + +# Networkmanager gives issues on aarch64 +systemctl disable NetworkManager +equo rm net-misc/networkmanager +cat > /etc/systemd/network/default_dhcp.network << "EOF" +[Network] +DHCP=ipv4 + +[DHCP] +UseDomains=true +EOF + +systemctl enable systemd-networkd + +# Cleanup +equo cleanup + +# Accepts configuration updates +echo -5 | equo conf update + +rm -rfv /etc/fstab +setup_rootfs_fstab + +exit 0