From 924d0996522add7148010b5945ec524f450706f6 Mon Sep 17 00:00:00 2001 From: SteadyQuad Date: Sat, 19 Sep 2020 17:02:20 +0200 Subject: [PATCH] Add support for Docker image for building --- Dockerfile | 24 ++++++++++++++++++++++++ README.md | 30 ++++++++++++++++++++++++++++-- rundocker.sh | 2 ++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100755 rundocker.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6dc422b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Set up build stage +FROM ubuntu:18.04 AS buildstage +ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Amsterdam + +RUN dpkg --add-architecture i386 + +RUN apt-get update && \ + apt-get -y install zip wget git build-essential make \ + libc6:i386 libncurses5:i386 libstdc++6:i386 + +ENV ROOTDIR=/pocketbook-jailbreak +WORKDIR ${ROOTDIR} + +RUN wget https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--musl--stable-2018.11-1.tar.bz2 +RUN tar -xvf armv7-eabihf--musl--stable-2018.11-1.tar.bz2 + +RUN wget https://github.com/ezdiy/pocketbook-sdk5/archive/master.tar.gz +RUN tar -xvf master.tar.gz + +ENV PATH="${ROOTDIR}/pocketbook-sdk5-master/bin:${ROOTDIR}/armv7-eabihf--musl--stable-2018.11-1/bin:${PATH}" + +WORKDIR /pbjb + +CMD make diff --git a/README.md b/README.md index 5156eea..effe139 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,37 @@ Use https://www.mobileread.com/forums/showthread.php?p=3921722 if you have an is по русски: http://4pda.ru/forum/index.php?s=&showtopic=886480&view=findpost&p=92768601 -This tree uses both Pocketbook SDK for dynamic linking, as well as static musl libc cross comppiler +This tree uses both Pocketbook SDK for dynamic linking, as well as static musl libc cross compiler for critical services (ssh and smb). The SDK has poor portability between firmware versions, but allows for using ncurses or openssl (those are not suitable for static linking). -For static musl cross compier: https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--musl--stable-2018.11-1.tar.bz2 +For static musl cross compiler: https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--musl--stable-2018.11-1.tar.bz2 For SDK cross compiler: https://github.com/ezdiy/pocketbook-sdk5/archive/master.tar.gz Unpack, and point your $PATH to 'bin' folder in both SDKs (gcc are differentiated by cross prefix, cc and cc5 in makefile). + +Alternatively you can use a Docker image for compiling and linking, it contains the necessary (i386) packages and the above compilers/toolchains. + +Requirements: [installed Docker environment](https://docs.docker.com/get-docker) + +To prepare the Docker image, clone this repository with its submodule(s), if you haven't yet: + +```console +git clone https://github.com/ezdiy/pbjb.git --recurse-submodules +``` + +build the image: +```console +cd pbjb +docker build -t pbjb . +``` + +To build pbjb, run the image (from within the same pbjb directory), this runs 'make': +```console +./rundocker.sh +``` + +You can also specify a command to run, e.g. to run a 'make clean': +```console +./rundocker.sh make clean +``` diff --git a/rundocker.sh b/rundocker.sh new file mode 100755 index 0000000..444e23c --- /dev/null +++ b/rundocker.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run --rm -it --volume=$(pwd):/pbjb pbjb "$@" \ No newline at end of file