aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2021-05-21 15:57:05 +0200
committerRichard Weinberger <richard@nod.at>2021-05-21 18:23:30 +0200
commit65baf4a48e21ad52153929cd79058a938a0117fc (patch)
treeb626d8efc07e8cab03a1da2af68a99ffe5842760
parent39056f856f41ab6333aa371109cd750580cbabd4 (diff)
downloadyocto-rpi-example-65baf4a48e21ad52153929cd79058a938a0117fc.tar.gz
More updates
- Add a minimal README - Imptove init.sh Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--README63
-rw-r--r--docker/Dockerfile19
-rwxr-xr-xinit.sh7
-rw-r--r--meta-itsyndikat/conf/conf-notes.txt41
4 files changed, 130 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..2568cbe
--- /dev/null
+++ b/README
@@ -0,0 +1,63 @@
+Cloning this repo
+-----------------
+
+$ git clone --recurse-submodules git://git.kernel.org/pub/scm/linux/kernel/git/rw/yocto-rpi-example.git
+
+OR
+
+$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/rw/yocto-rpi-example.git
+$ cd yocto-rpi-example
+$ git submodule update --init --recursive
+
+Required Packages for the Build Host
+------------------------------------
+
+Debian/Ubuntu:
+
+$ apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
+ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
+ xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
+ pylint3 xterm make xsltproc docbook-utils fop dblatex xmlto
+
+Fedora:
+
+$ dnf install gawk make wget tar bzip2 gzip python3 unzip perl patch \
+ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
+ ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
+ python3-pexpect findutils which file cpio python python3-pip xz python3-GitPython \
+ python3-jinja2 SDL-devel xterm rpcgen docbook-style-dsssl docbook-style-xsl \
+ docbook-dtds docbook-utils fop libxslt dblatex xmlto
+
+SUSE:
+
+$ zypper install python gcc gcc-c++ git chrpath make wget python-xml \
+ diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
+ python3-pexpect xz which python3-Jinja2 Mesa-libEGL1 libSDL-devel xterm rpcgen pip3 \
+ install GitPython dblatex xmlto
+
+
+When not building one of the above distros, please use docker or some chroot.
+
+This repo contains an example Ubuntu container.
+
+$ cd docker
+$ docker build --build-arg UID=$(id -u) -t yocto_builder .
+$ docker run -it -v /path/to/yocto-rpi-example:/home/builder/yocto yocto_builder
+container$ cd /home/builder/yocto/
+
+Building
+--------
+
+Open init.sh and set MACHINE either to raspberrypi4-64 or raspberrypi3-64.
+Other variants should work too, but are untested.
+
+Source the init.sh script and use bitbake
+
+$ . init.sh
+$ bitbake its-image
+
+The final image will be tmp/deploy/images/raspberrypi4-64/its-image-raspberrypi4-64.wic.bz2
+
+You can flash it into you SDCard using dd. e.g
+$ bzcat its-image-raspberrypi4-64.wic.bz2 | dd of=/dev/mmcblk0 bs=32M
+
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 0000000..6158715
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,19 @@
+FROM ubuntu:20.04
+
+ARG UID=1000
+VOLUME /home/builder/yocto/
+
+ENV DEBIAN_FRONTEND noninteractive
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US.UTF-8
+ENV LC_ALL en_US.UTF-8
+
+RUN apt-get update
+RUN apt-get install -y bash gawk wget git-core diffstat unzip texinfo gcc-multilib \
+ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
+ locales locales-all xz-utils debianutils iputils-ping python3-git python3-jinja2 \
+ libegl1-mesa libsdl1.2-dev pylint3 xterm
+
+RUN useradd -u $UID -s /bin/bash -d /home/builder/ builder
+USER builder
+CMD /bin/bash
diff --git a/init.sh b/init.sh
index 68432b9..3bfb7a4 100755
--- a/init.sh
+++ b/init.sh
@@ -1,5 +1,10 @@
+BASE="$(pwd)"
+
export TEMPLATECONF="$(pwd)/meta-itsyndikat/conf/"
+mkdir -p ${BASE}/downloads
+mkdir -p ${BASE}/sstate
+
. poky/oe-init-build-env builddir
cat << EOF > conf/auto.conf
@@ -7,4 +12,6 @@ MACHINE = "raspberrypi4-64"
DISTRO = "its"
hostname_pn-base-files = "trollhost"
KERNEL_MODULE_AUTOLOAD += " brcmfmac"
+DL_DIR = "${BASE}/downloads"
+SSTATE_DIR = "${BASE}/sstate"
EOF
diff --git a/meta-itsyndikat/conf/conf-notes.txt b/meta-itsyndikat/conf/conf-notes.txt
new file mode 100644
index 0000000..42b453e
--- /dev/null
+++ b/meta-itsyndikat/conf/conf-notes.txt
@@ -0,0 +1,41 @@
+
+### Shell environment set up for builds. ###
+
+ -------
+ --/ \--
+ / \
+/ \
+| |
+\ / -------
+ \ / / \
+ --\ /-- | | -------
+ ------- \ \/ \--
+ _______________________________________________ ----\ \
+ --/ \- / \
+ / \ | |
+/ \ \ /
+| | \ /
+\ / --\ /--
+ \- ------------- _______ / -------
+ \ / \ / \ /--
+ \ / \ / \ \_____________
+ | | | | | \--
+ / \ / \ | \-
+ --/ \-- --/ \-- \___ \-
+ / \ / \ \ \
+/ \ / \ | |
+| | | | ___/ __ |
+\ / \ / / / \ /
+ \ / \ / | | -\ /-
+ --\ /-- --\ /-- \ / --\ /--
+ ------- ------- ----- -------
+
+
+You can now run 'bitbake <target>'
+
+Common targets are:
+ its-image
+ its-image -c populate_sdk
+
+NOTE:
+conf/auto.conf is autogenerated! Modify init.sh, if needed.