Add mpc "network" ISO.

This commit is contained in:
Sean Bowe 2016-09-27 12:49:51 -06:00
parent 8fe69a6dca
commit 43a8296c8a
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
9 changed files with 87 additions and 0 deletions

2
.gitignore vendored
View File

@ -4,4 +4,6 @@ pk
vk
transcript
alpine-compute.iso
alpine-network.iso
iso/mpc_compute/mpc_compute.rs
iso/mpc_network/mpc_network.rs

View File

@ -9,8 +9,12 @@ cd ../../
sudo docker run --rm -it -v "$(pwd)":/home/rust/src mpc-musl-builder cargo build --release --bin compute --no-default-features
cp target/x86_64-unknown-linux-musl/release/compute iso/mpc_compute/mpc_compute.rs
sudo docker run --rm -it -v "$(pwd)":/home/rust/src mpc-musl-builder cargo build --release --bin network --no-default-features
cp target/x86_64-unknown-linux-musl/release/network iso/mpc_network/mpc_network.rs
cd iso
sudo docker build -t mpc-iso .
cd ..
sudo docker run --rm -it -v "$(pwd)":/home/builder/target mpc-iso cp -L alpine-compute.iso /home/builder/target/alpine-compute.iso
sudo docker run --rm -it -v "$(pwd)":/home/builder/target mpc-iso cp -L alpine-network.iso /home/builder/target/alpine-network.iso

View File

@ -47,6 +47,11 @@ RUN chown -R builder:abuild /root/.abuild
ADD mpc_compute /home/builder/mpc_compute/
RUN chown -R builder:abuild /home/builder/mpc_compute/
# Add the `mpc_network` package
ADD mpc_network /home/builder/mpc_network/
RUN chown -R builder:abuild /home/builder/mpc_network/
# Run some setup as `builder`
# Build the MPC "compute" package that runs at boot.
@ -56,6 +61,17 @@ WORKDIR /home/builder/mpc_compute/
RUN abuild checksum
RUN abuild -r
# Build the MPC "network" package that runs at boot.
RUN rm /home/builder/packages/builder/x86_64/APKINDEX.tar.gz
WORKDIR /home/builder/mpc_network/
RUN abuild checksum
RUN abuild -r
# Move built packages into apks_custom.
RUN cp -r /home/builder/packages/builder /home/builder/apks_custom/
# Add the custom apks repository
@ -74,9 +90,12 @@ WORKDIR /home/builder/alpine-iso/
# Grab the configurations for the ISOs
ADD alpine-compute.conf.mk /home/builder/alpine-iso/alpine-compute.conf.mk
ADD alpine-compute.packages /home/builder/alpine-iso/alpine-compute.packages
ADD alpine-network.conf.mk /home/builder/alpine-iso/alpine-network.conf.mk
ADD alpine-network.packages /home/builder/alpine-iso/alpine-network.packages
# Build the ISOs
USER root
RUN make BOOT_OPTS=pkgs=mpc_compute PROFILE=alpine-compute iso
RUN make BOOT_OPTS=pkgs=mpc_network PROFILE=alpine-network iso
RUN mkdir -p /home/builder/target/

View File

@ -0,0 +1,4 @@
ALPINE_NAME := alpine-network
ALPINE_VERSION := 1.0.0
MODLOOP_EXTRA :=
KERNEL_FLAVOR := grsec

View File

@ -0,0 +1,4 @@
alpine-base
syslinux
mpc_compute
xorriso

34
iso/mpc_network/APKBUILD Normal file
View File

@ -0,0 +1,34 @@
# Contributor:
# Maintainer:
pkgname=mpc_network
pkgver=1.0.0
pkgrel=0
pkgdesc="MPC network node binary"
url="https://z.cash/"
arch="x86_64"
license="MIT"
depends="alpine-base xorriso"
makedepends=""
install=""
subpackages=""
replaces="alpine-base"
source="mpc_network
inittab
mpc_network.rs
interfaces"
builddir="$srcdir/"
build() {
cd "$builddir"
}
package() {
cd "$builddir"
mkdir -p "$pkgdir"/bin/
mkdir -p "$pkgdir"/etc/
mkdir -p "$pkgdir"/etc/network/
cp mpc_network "$pkgdir"/bin/mpc_network
cp mpc_network.rs "$pkgdir"/bin/mpc_network.rs
cp inittab "$pkgdir"/etc/inittab
cp interfaces "$pkgdir"/etc/network/interfaces
}

11
iso/mpc_network/inittab Normal file
View File

@ -0,0 +1,11 @@
# /etc/inittab
::sysinit:/sbin/openrc sysinit
::sysinit:/sbin/openrc boot
::wait:/sbin/openrc default
tty1::respawn:/bin/mpc_network
tty2::respawn:/sbin/getty 38400 tty2
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/openrc shutdown

View File

@ -0,0 +1,2 @@
auto eth0
iface eth0 inet dhcp

7
iso/mpc_network/mpc_network Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
clear
cd /
/etc/init.d/networking start && /bin/mpc_network.rs
sleep 10000000