Linux-Safety Archive mirror
 help / color / mirror / Atom feed
From: "Mohammed Billoo" <mab@mab-labs.com>
To: linux-safety@lists.elisa.tech
Subject: Docker container for ELISA
Date: Tue, 15 Sep 2020 19:03:42 -0400	[thread overview]
Message-ID: <CALkjhPoHqB330YO6uFOO3SnHShvF83xMkzzTp5HGnW-XVyJ3GA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

All,

Attached are the files needed to build a Docker container to support
the following tested operations against the latest-ish master (I need
to test it against Shuah's branch):

- checkpatch
- coccicheck
- sparse
- make menuconfig
- make (against the default x86 config)

To build the container, download the attached files to a location on
your local machine and run:
docker build -t elisa-kernel-builder . (the dot at the end is important)

Then checkout  Shuah's kernel to your local machine, cd to that
directory, and do the following:
$> docker run --rm -it -v $PWD:/opt/elisa/kernel -w /opt/elisa/kernel
elisa-kernel-builder <command>

where <command> can be any of the available commands to operate on the
kernel. For example, if I wanted to configure my checkout using the
docker container, I would do:
$> docker run --rm -it -v $PWD:/opt/elisa/kernel -w /opt/elisa/kernel
elisa-kernel-builder make menuconfig

To pass environment variables specify "-e VARNAME=VARVAL". For
example, if I wanted to run just my cocci script:
$> docker run --rm -it -v $PWD:/opt/elisa/kernel -w /opt/elisa/kernel
-e COCCI=scripts/coccinelle/misc/magic_numbers.cocci
elisa-kernel-builder make coccicheck MODE=report

Please continue to hammer away and test the container with other
workflows and find bugs/issues, since I banged this out in a few hours
and didn't thoroughly test this (I wanted to get this out before I
leave for the day).

We still need to figure out how to source control this.
-- 
Mohammed A Billoo
Founder
MAB Labs, LLC
www.mab-labs.com
201-338-2022

[-- Attachment #2: Dockerfile --]
[-- Type: application/octet-stream, Size: 1584 bytes --]

FROM ubuntu:18.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    apt-utils \
    automake \
    autoconf \
    bc \
    bison \
    build-essential \
    ca-certificates \
    clang-7 \
    curl \
    flex \
    git \
    gperf \
    lcov \
    llvm \
    libelf-dev \
    libgtk-3-dev \
    libncurses-dev \
    libssl-dev \
    libsqlite3-dev \
    libtool \
    libusb-1.0-0-dev \
    libxml2-dev \
    m4 \
    make \
    ninja-build \
    ocaml \
    perl \
    python3 \
    python3-pip \
    sqlite3 \
    unzip \
    wget \
    xz-utils \
    zip \
   && apt-get autoremove -y \
   && rm -rf /var/lib/apt/lists/* \
   && update-alternatives --install /usr/bin/python python /usr/bin/python3 10

RUN python -m pip install --upgrade pip virtualenv

# To build the image for a branch or a tag of IDF, pass --build-arg IDF_CLONE_BRANCH_OR_TAG=name.
# To build the image with a specific commit ID of IDF, pass --build-arg IDF_CHECKOUT_REF=commit-id.
# It is possibe to combine both, e.g.:
#   IDF_CLONE_BRANCH_OR_TAG=release/vX.Y
#   IDF_CHECKOUT_REF=<some commit on release/vX.Y branch>.
RUN git clone https://git.kernel.org/pub/scm/devel/sparse/sparse.git /opt/elisa/sparse && cd /opt/elisa/sparse && make && make install PREFIX=/usr
RUN git clone https://github.com/coccinelle/coccinelle.git /opt/elisa/coccinelle && cd /opt/elisa/coccinelle && ./autogen && ./configure && make && make install


COPY entrypoint.sh /opt/elisa/entrypoint.sh
RUN chmod +x /opt/elisa/entrypoint.sh

ENTRYPOINT [ "/opt/elisa/entrypoint.sh" ]
CMD [ "/bin/bash" ]

[-- Attachment #3: entrypoint.sh --]
[-- Type: application/x-shellscript, Size: 48 bytes --]

                 reply	other threads:[~2020-09-15 23:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALkjhPoHqB330YO6uFOO3SnHShvF83xMkzzTp5HGnW-XVyJ3GA@mail.gmail.com \
    --to=mab@mab-labs.com \
    --cc=linux-safety@lists.elisa.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).