cirosantilli / linux-kernel-module-cheat

The perfect emulation setup to study and develop the Linux kernel v5.4.3, kernel modules, QEMU, gem5 and x86_64, ARMv7 and ARMv8 userland and baremetal assembly, ANSI C, C++ and POSIX. GDB step debug and KGDB just work. Powered by Buildroot and crosstool-NG. Highly automated. Thoroughly documented. Automated tests. "Tested" in an Ubuntu 24.04 host.
https://cirosantilli.com/linux-kernel-module-cheat
GNU General Public License v3.0
4.21k stars 605 forks source link

make: *** [/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/.stamp_configured] Error 127 #84

Closed guoqinglei closed 5 years ago

guoqinglei commented 5 years ago

tom@tom-pc:~/git/linux-kernel-module-cheat$ sudo -H ./build --download-dependencies gem5-buildroot

the detailed error info is as follows:

   + sudo apt-get update
   Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
   Hit:2 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
   Hit:3 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
   Hit:4 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
   Reading package lists... Done                      
   + sudo apt-get install \
     bash \
     bc \
     binutils \
     bison \
     build-essential \
     bzip2 \
     cpio \
     device-tree-compiler \
     diod \
     flex \
     g++ \
     g++-aarch64-linux-gnu \
     g++-arm-linux-gnueabihf \
     gcc \
     gcc-aarch64-linux-gnu \
     gcc-arm-linux-gnueabihf \
     git \
     graphviz \
     gzip \
     libboost-all-dev \
     libelf-dev \
     libgoogle-perftools-dev \
     m4 \
     make \
     moreutils \
     patch \
     perl \
     protobuf-compiler \
     python-dev \
     python-matplotlib \
     python-pip \
     python3 \
     python3-pip \
     qemu-utils \
     rr \
     rsync \
     scons \
     sed \
     tar \
     tmux \
     unzip \
     vinagre \
     wget \
     zlib1g-dev \
   ;
   Reading package lists... Done
   Building dependency tree       
   Reading state information... Done
   bc is already the newest version (1.07.1-2).
   bison is already the newest version (2:3.0.4.dfsg-1build1).
   build-essential is already the newest version (12.4ubuntu1).
   cpio is already the newest version (2.12+dfsg-6).
   device-tree-compiler is already the newest version (1.4.5-3).
   flex is already the newest version (2.6.4-6).
   gzip is already the newest version (1.6-5ubuntu1).
   libgoogle-perftools-dev is already the newest version (2.5-2.2ubuntu3).
   m4 is already the newest version (1.4.18-1).
   make is already the newest version (4.1-9.1ubuntu1).
   python-dev is already the newest version (2.7.15~rc1-1).
   rsync is already the newest version (3.1.2-2.1ubuntu1).
   sed is already the newest version (4.4-2).
   unzip is already the newest version (6.0-21ubuntu1).
   zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
   diod is already the newest version (1.0.24-3).
   graphviz is already the newest version (2.40.1-2).
   libboost-all-dev is already the newest version (1.65.1.0ubuntu1).
   moreutils is already the newest version (0.60-1).
   protobuf-compiler is already the newest version (3.0.0-9.1ubuntu1).
   python-matplotlib is already the newest version (2.1.1-2ubuntu3).
   rr is already the newest version (5.1.0-1).
   scons is already the newest version (3.0.1-1).
   vinagre is already the newest version (3.22.0-5).
   bash is already the newest version (4.4.18-2ubuntu1.2).
   binutils is already the newest version (2.30-21ubuntu1~18.04.2).
   bzip2 is already the newest version (1.0.6-8.1ubuntu0.2).
   g++ is already the newest version (4:7.4.0-1ubuntu2.3).
   g++-aarch64-linux-gnu is already the newest version (4:7.4.0-1ubuntu2.3).
   g++-arm-linux-gnueabihf is already the newest version (4:7.4.0-1ubuntu2.3).
   gcc is already the newest version (4:7.4.0-1ubuntu2.3).
   gcc-aarch64-linux-gnu is already the newest version (4:7.4.0-1ubuntu2.3).
   gcc-arm-linux-gnueabihf is already the newest version (4:7.4.0-1ubuntu2.3).
   git is already the newest version (1:2.17.1-1ubuntu0.4).
   libelf-dev is already the newest version (0.170-0.4ubuntu0.1).
   patch is already the newest version (2.7.6-2ubuntu1.1).
   perl is already the newest version (5.26.1-6ubuntu0.3).
   python3 is already the newest version (3.6.7-1~18.04).
   qemu-utils is already the newest version (1:2.11+dfsg-1ubuntu7.17).
   tar is already the newest version (1.29b-2ubuntu0.1).
   tmux is already the newest version (2.6-3ubuntu0.2).
   wget is already the newest version (1.19.4-1ubuntu2.2).
   python-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
   python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
   0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
   + python -m pip install --user \
     pydot \
   ;
   Collecting pydot
   Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/pydot/
   Downloading https://files.pythonhosted.org/packages/33/d1/b1479a770f66d962f545c2101630ce1d5592d90cb4f083d38862e93d16d2/pydot-1.4.1-py2.py3-none-any.whl
   Requirement already satisfied: pyparsing>=2.1.4 in /usr/lib/python2.7/dist-packages (from pydot)
   Installing collected packages: pydot
   Successfully installed pydot-1.4.1
   + python3 -m pip install --user \
     pexpect==4.6.0 \
   ;
   Requirement already satisfied: pexpect==4.6.0 in /root/.local/lib/python3.6/site-packages
   Requirement already satisfied: ptyprocess>=0.5 in /root/.local/lib/python3.6/site-packages (from pexpect==4.6.0)
   + git \
     submodule \
     update \
     --init \
     --recursive \
     --jobs 4 \
     --progress \
     --depth 1 \
     -- \
     /home/tom/git/linux-kernel-module-cheat/submodules/binutils-gdb \
     /home/tom/git/linux-kernel-module-cheat/submodules/buildroot \
     /home/tom/git/linux-kernel-module-cheat/submodules/gcc \
     /home/tom/git/linux-kernel-module-cheat/submodules/gem5 \
     /home/tom/git/linux-kernel-module-cheat/submodules/glibc \
     /home/tom/git/linux-kernel-module-cheat/submodules/linux \
   ;
   + ./build-buildroot \
     --no-show-time \
   ;
   + cd /home/tom/git/linux-kernel-module-cheat/submodules/buildroot && \
     make \
     O=/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64 \
     BR2_EXTERNAL=../../buildroot_packages/kernel_modules:../../buildroot_packages/lkmc_many_files:../../buildroot_packages/parsec_benchmark:../../buildroot_packages/sample_package \
     qemu_x86_64_defconfig \
   ;
   #
   # configuration written to /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config
   #
   + cat \
     /home/tom/git/linux-kernel-module-cheat/buildroot_config/default \
     '>>' \
     /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config \
   ;
   + cat << 'EOF' >> /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config
   BR2_JLEVEL=4
   BR2_DL_DIR="/home/tom/git/linux-kernel-module-cheat/out/buildroot/download"
   # BR2_LINUX_KERNEL is not set
   BR2_GLOBAL_PATCH_DIR="../../patches/global"
   BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="../../busybox_config_fragment"
   BR2_PACKAGE_OVERRIDE_FILE="../../buildroot_override"
   BR2_ROOTFS_POST_BUILD_SCRIPT="../../rootfs-post-build-script"
   BR2_ROOTFS_USERS_TABLES="../../user_table"
   BR2_ROOTFS_OVERLAY="../../out/rootfs_overlay/x86_64"
   EOF
   + cd /home/tom/git/linux-kernel-module-cheat/submodules/buildroot && \
     make \
     O=/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64 \
     olddefconfig \
   ;
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4010:warning: override: reassigning to symbol BR2_CCACHE
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4013:warning: override: reassigning to symbol BR2_ENABLE_DEBUG
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4014:warning: override: reassigning to symbol BR2_GCC_ENABLE_GRAPHITE
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4015:warning: override: reassigning to symbol BR2_GCC_ENABLE_LTO
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4016:warning: override: reassigning to symbol BR2_GCC_ENABLE_OPENMP
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4017:warning: override: reassigning to symbol BR2_OPTIMIZE_0
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4017:warning: override: BR2_OPTIMIZE_0 changes choice state
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4018:warning: override: reassigning to symbol BR2_PTHREAD_DEBUG
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4019:warning: override: reassigning to symbol BR2_TOOLCHAIN_BUILDROOT_CXX
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4022:warning: override: reassigning to symbol BR2_TOOLCHAIN_BUILDROOT_GLIBC
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4022:warning: override: BR2_TOOLCHAIN_BUILDROOT_GLIBC changes choice state
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4023:warning: override: reassigning to symbol BR2_TOOLCHAIN_BUILDROOT_WCHAR
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4026:warning: override: reassigning to symbol BR2_TARGET_ROOTFS_CPIO
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4027:warning: override: reassigning to symbol BR2_TARGET_ROOTFS_EXT2
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4028:warning: override: reassigning to symbol BR2_TARGET_ROOTFS_EXT2_SIZE
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4029:warning: override: reassigning to symbol BR2_TARGET_ROOTFS_SQUASHFS
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4030:warning: override: reassigning to symbol BR2_TARGET_ROOTFS_INITRAMFS
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4032:warning: override: reassigning to symbol BR2_TARGET_ROOTFS_TAR
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4035:warning: override: reassigning to symbol BR2_PACKAGE_HOST_GDB
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4041:warning: override: reassigning to symbol BR2_PACKAGE_STRACE
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4044:warning: override: reassigning to symbol BR2_PACKAGE_HOST_DTC
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4051:warning: override: reassigning to symbol BR2_JLEVEL
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4052:warning: override: reassigning to symbol BR2_DL_DIR
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4053:warning: override: reassigning to symbol BR2_LINUX_KERNEL
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4054:warning: override: reassigning to symbol BR2_GLOBAL_PATCH_DIR
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4055:warning: override: reassigning to symbol BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4056:warning: override: reassigning to symbol BR2_PACKAGE_OVERRIDE_FILE
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4057:warning: override: reassigning to symbol BR2_ROOTFS_POST_BUILD_SCRIPT
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4058:warning: override: reassigning to symbol BR2_ROOTFS_USERS_TABLES
   /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config:4059:warning: override: reassigning to symbol BR2_ROOTFS_OVERLAY
   #
   # configuration written to /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/.config
   #
   + cd /home/tom/git/linux-kernel-module-cheat/submodules/buildroot && \
     make \
     'LKMC_PARSEC_BENCHMARK_SRCDIR="/home/tom/git/linux-kernel-module-cheat/submodules/parsec-benchmark"' \
     O=/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64 \
     V=0 \
     all \
   ;
   /usr/bin/make -j1 O=/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64 HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
   make[1]: Entering directory '/home/tom/git/linux-kernel-module-cheat/submodules/buildroot'
   make[1]: Leaving directory '/home/tom/git/linux-kernel-module-cheat/submodules/buildroot'
   >>> glibc custom Configuring
   mkdir -p /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/build
   # Do the configuration
   (cd /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/build; PATH="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin:/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" AR="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-ar" AS="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-as" LD="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-ld" NM="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-nm" CC="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-gcc" GCC="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-gcc" CPP="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-cpp" CXX="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-g++" FC="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-gfortran" F77="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-gfortran" RANLIB="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-ranlib" READELF="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-readelf" STRIP="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-strip" OBJCOPY="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-objcopy" OBJDUMP="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/ccache /usr/bin/gcc" GCC_FOR_BUILD="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/ccache /usr/bin/gcc" CXX_FOR_BUILD="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/ccache /usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/include" CFLAGS_FOR_BUILD="-O2 -I/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/include" CXXFLAGS_FOR_BUILD="-O2 -I/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/include" LDFLAGS_FOR_BUILD="-L/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/lib -Wl,-rpath,/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-as" DEFAULT_LINKER="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/x86_64-buildroot-linux-gnu-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O0 -g3" CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O0 -g3" LDFLAGS="" FCFLAGS=" -O0 -g3" FFLAGS=" -O0 -g3" PKG_CONFIG="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/bin/pkg-config" STAGING_DIR="/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/x86_64-buildroot-linux-gnu/sysroot" INTLTOOL_PERL=/usr/bin/perl CFLAGS="-O2 -g" CPPFLAGS="" CXXFLAGS="-O2 -g" /bin/bash /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/configure ac_cv_path_BASH_SHELL=/bin/bash libc_cv_forced_unwind=yes libc_cv_ssp=no --target=x86_64-buildroot-linux-gnu --host=x86_64-buildroot-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --enable-shared --enable-lock-elision --with-pkgversion="Buildroot" --without-cvs --disable-profile --without-gd --enable-obsolete-rpc --enable-kernel=4.17 --with-headers=/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/host/x86_64-buildroot-linux-gnu/sysroot/usr/include)
   /bin/bash: /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/configure: No such file or directory
   package/pkg-generic.mk:219: recipe for target '/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/.stamp_configured' failed
   make: *** [/home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/.stamp_configured] Error 127
   Traceback (most recent call last):
   File "./build", line 608, in <module>
   Main().cli()
   File "/home/tom/git/linux-kernel-module-cheat/cli_function.py", line 267, in cli
   exit_status = self.cli_noexit(*args, **kwargs)
   File "/home/tom/git/linux-kernel-module-cheat/cli_function.py", line 258, in cli_noexit
   return self._do_main(vars(args))
   File "/home/tom/git/linux-kernel-module-cheat/cli_function.py", line 152, in _do_main
   return self.main(**self._get_args(kwargs))
   File "/home/tom/git/linux-kernel-module-cheat/common.py", line 1289, in main
   ret = self.timed_main()
   File "./build", line 605, in timed_main
   component.build(self.env['arch'])
   File "./build", line 56, in build
   self.build_callback()
   File "./build", line 414, in f
   lkmc.import_path.import_path_main(component_file)(**args)
   File "/home/tom/git/linux-kernel-module-cheat/common.py", line 643, in __call__
   return super().__call__(**kwargs)
   File "/home/tom/git/linux-kernel-module-cheat/cli_function.py", line 149, in __call__
   return self._do_main(kwargs)
   File "/home/tom/git/linux-kernel-module-cheat/cli_function.py", line 152, in _do_main
   return self.main(**self._get_args(kwargs))
   File "/home/tom/git/linux-kernel-module-cheat/common.py", line 1289, in main
   ret = self.timed_main()
   File "/home/tom/git/linux-kernel-module-cheat/common.py", line 1712, in timed_main
   return self.build()
   File "/home/tom/git/linux-kernel-module-cheat/build-buildroot", line 166, in build
   cwd=self.env['buildroot_source_dir'],
   File "/home/tom/git/linux-kernel-module-cheat/shell_helpers.py", line 403, in run_cmd
   raise e
   Exception: Command exited with status: 2

anyone knows why this error happens ?

cirosantilli commented 5 years ago

I'll try it out on my machine.

But in any case, please don't use sudo with these scripts! :-)

cirosantilli commented 5 years ago

Hmmm, I cloned master at 6aa375df2ad3ce2e7d741d09b378503c25547df1 but ./build --download-dependencies gem5-buildroot worked for me on my Ubuntu 19.04.

Can you try to nuke everything and restart from scratch at that commit, without sudo?

If that doesn't work still, give the Docker setup a try: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/6aa375df2ad3ce2e7d741d09b378503c25547df1#docker

guoqinglei commented 5 years ago

I'll try it out on my machine.

But in any case, please don't use sudo with these scripts! :-)

I have pulled the master at 6aa3754 and run "./build --download-dependencies gem5-buildroot" without nuking everything from scratch, the error still exist. One thing should be mentioned that the command "./build --help" works normly. Is there any way to verify whether buildroot has been installed well ?

My ubuntu is 18.04 LTS, do I need to clean the build directory generated under "sudo ./build ***" ? and do the ./build from the scratch ?

cirosantilli commented 5 years ago

Yes, I recommend trying to completely remove the whole linux-kernel-module-cheat/ directory, then clone again and rebuild without sudo. I did a full clean build and it "worked on my machine" :-)

cirosantilli commented 5 years ago

You can try to see the state of the buildroot build, but I don't think it is worth it at this point, just too much complication. If the clean build fails, then try it.

You have to understand why that happened:

out/buildroot/build/default/x86_64/build/glibc-custom/configure: No such file or directory

Most likely candidate was that the submodule/glibc was not cloned properly. But ./build should do that automatically.

guoqinglei commented 5 years ago

You can try to see the state of the buildroot build, but I don't think it is worth it at this point, just too much complication. If the clean build fails, then try it.

You have to understand why that happened:

out/buildroot/build/default/x86_64/build/glibc-custom/configure: No such file or directory

Most likely candidate was that the submodule/glibc was not cloned properly. But ./build should do that automatically.

i am so happy that the clean build has succeeded. Although it took a long time to go. the tail info is as follows:

Creating regular file /home/tom/git/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/images/rootfs.ext2 Creating filesystem with 131072 4k blocks and 32768 inodes Filesystem UUID: 454214f4-002e-45aa-91a9-7d62fbc26396 Superblock backups stored on blocks: 32768, 98304

Allocating group tables: done
Writing inode tables: done
Copying files into the device: done Writing superblocks and filesystem accounting information: done

time 03:44:15

Thanks a lot.

cirosantilli commented 5 years ago

Great!

Yes, the build is a bit slow, I get 30 minutes from scratch on my high end 2018 laptop: https://cirosantilli.com/linux-kernel-module-cheat/#benchmark-builds I don't think there is much alternative in systems programming.