I try to build the Linux kernel with Buildroot using Docker. I've created a simple Docker image:
FROM debian:7
MAINTAINER OrangeTux
RUN apt-get update && \
apt-get install -y \
build-essential \
bash \
bc \
binutils \
build-essential \
bzip2 \
cpio \
g++ \
gcc \
git \
gzip \
make \
libncurses5-dev \
patch \
perl \
python \
rsync \
sed \
tar \
unzip \
wget
WORKDIR /root
RUN git clone git://git.buildroot.net/buildroot
WORKDIR /root/buildroot
CMD ["/bin/bash"]
I want to keep dl/
andoutput/build/
when container stops, so I don't have to download and compile all dependencies every time. I also want the build products on my host. Therefore I start container like this:
$ docker run -ti -v $(pwd)/dl:/root/buildroot/dl -v \
$(pwd)/output/build:/root/buildroot/output/build -v \
$(pwd)/output/images:/root/buildroot/output/images orangetux/buildroot
I'm able to run make menuconfig
which builds the configuration for Buildroot. I've made a few modifications to the defaults. Here's the output of make savedefconfig
:
BR2_arm=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_DEFCONFIG="at91_dt"
The next step is to build linux-menuconfig
. This action failed and I've no clue what is going wrong:
$ make linux-menuconfig
/usr/bin/make -j1 HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
make[1]: Entering directory `/root/buildroot'
BR2_DEFCONFIG='' KCONFIG_AUTOCONFIG=/root/buildroot/output/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/root/buildroot/output/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/root/buildroot/output/build/buildroot-config/tristate.config BR2_CONFIG=/root/buildroot/.config BR2_EXTERNAL=support/dummy-external SKIP_LEGACY= /root/buildroot/output/build/buildroot-config/conf --silentoldconfig Config.in
*** Error during update of the configuration.
make[1]: *** [silentoldconfig] Error 1
make[1]: Leaving directory `/root/buildroot'
make: *** [/root/buildroot/output/build/buildroot-config/auto.conf] Error 2
The file /root/buildroot/output/build/buildroot-config/auto.conf
doesn't exists.
Why does the file not exists and how can I build linux-menuconfig
?
Best Answer
After extensive debugging I found out that mounting a folder on my host system at
/root/buildroot/output/
causes the problem. Remove this mount andmake linux-menuconfig
is possible.Further debugging revealed that mounting a host folder at
/root/buildroot/output/build
in the container is the problem. I've no clue why.