BiscuitOS / BiscuitOS

Common scripts to build BiscuitOS
GNU General Public License v2.0
277 stars 73 forks source link

【编译错误】mount: /opt/BiscuitOS/output/linux-5.0-x86_64/rootfs/tmpfs/: mount failed: Operation not permitted. #27

Open BruceYang-yeu opened 2 years ago

BruceYang-yeu commented 2 years ago

【背景】

为了方便开发环境能够在不同机器上进行实验,希望使用dock搭建开发环境,提升跨平台性.

【问题】

使用dockerfile搭建编译环境后按照 BiscuitOS Linux 5.0 x86_64 Usermanual来编译,出现mount: /opt/BiscuitOS/output/linux-5.0-x86_64/rootfs/tmpfs/: mount failed: Operation not permitted.

【复现步骤】

docker build -t BiscuitOS:1.0 -f Dockerfile.cpp-env-ubuntu .
docker run -it -v /data/BiscuitOs/opt/BiscuitOs BiscuitOS:1.0  /bin/bash
cd BiscuitOS
make linux-5.0-x86_64_defconfig
make

【日志】

root@cb0c471ec88d:/opt/BiscuitOS# make linux-5.0-x86_64_defconfig
#
# configuration written to .config
#
root@cb0c471ec88d:/opt/BiscuitOS# 
root@cb0c471ec88d:/opt/BiscuitOS# make
scripts/kconfig/conf --silentoldconfig Kconfig
300+0 records in
300+0 records out
314572800 bytes (315 MB, 300 MiB) copied, 0.157463 s, 2.0 GB/s
mke2fs 1.45.5 (07-Jan-2020)
Suggestion: Use Linux kernel >= 3.18 for improved stability of the metadata and journal checksum features.
Discarding device blocks: done                            
Creating filesystem with 76800 4k blocks and 76800 inodes
Filesystem UUID: b33867e2-2223-4390-8914-e3ac8078f278
Superblock backups stored on blocks: 
        32768

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

mount: /opt/BiscuitOS/output/linux-5.0-x86_64/rootfs/tmpfs/: mount failed: Operation not permitted.
make: *** [/opt/BiscuitOS/fs/ext4/Makefile:33: /opt/BiscuitOS/fs/ext4/build] Error 1

【dockerfile】


# Build and run:
#   docker build -t BiscuitOS:1.0 -f Dockerfile.cpp-env-ubuntu .

FROM ubuntu:20.04

ENV SDK_HOME /opt

WORKDIR $SDK_HOME

ENV LANG=zh_CN.UTF-8 \
    LANGUAGE=zh_CN:zh \
    LC_ALL=zh_CN.UTF-8

RUN DEBIAN_FRONTEND="noninteractive" apt-get update && apt-get -y install tzdata

RUN apt-get update \
  && apt-get install -y build-essential \
      gcc \
      g++ \
      gdb \
      clang \
      make \
      ninja-build \
      cmake \
      autoconf \
      automake \
      locales-all \
      dos2unix \
      rsync \
      tar \
      dstat htop\
    python \
      python-dev \
    && apt-get clean

RUN apt-get update

# instal kernel develop tools
RUN apt-get --quiet update --yes
RUN apt-get install -y qemu gcc make gdb git figlet
RUN apt-get install -y libncurses5-dev iasl wget
RUN apt-get install -y device-tree-compiler
RUN apt-get install -y flex bison libssl-dev libglib2.0-dev
RUN apt-get install -y libfdt-dev libpixman-1-dev
RUN apt-get install -y python pkg-config u-boot-tools intltool xsltproc
RUN apt-get install -y gperf libglib2.0-dev libgirepository1.0-dev
RUN apt-get install -y gobject-introspection
RUN apt-get install -y python2.7-dev python-dev bridge-utils
RUN apt-get install -y uml-utilities net-tools
RUN apt-get install -y libattr1-dev libcap-dev
RUN apt-get install -y kpartx libsdl2-dev libsdl1.2-dev
RUN apt-get install -y debootstrap libarchive-tools
RUN apt-get install -y libelf-dev gcc-multilib g++-multilib
RUN apt-get install -y libcap-ng-dev
RUN apt-get install -y libmount-dev libselinux1-dev libffi-dev libpulse-dev \
RUN apt-get -y install sudo bc vim
# install for x64
RUN apt-get install lib32z1 lib32z1-dev

# config git username and email
RUN git config --global user.name "cooleyyang" &&\
    git config --global user.email "cooleyyang168@gmail.com"
zhao-newname commented 2 years ago

use fakeroot? @BruceYang-yeu

luxinhua commented 2 months ago

后来咋解决的 @BruceYang-yeu, 我也遇到了,就差这个了

BuddyZhang1 commented 2 months ago

加微信我远程来帮你看 ---- 回复的原邮件 ---- @.>发送日期2024年08月22日 01:22 @.> @.>主题Re: [BiscuitOS/BiscuitOS] 【编译错误】mount: /opt/BiscuitOS/output/linux-5.0-x86_64/rootfs/tmpfs/: mount failed: Operation not permitted. (Issue #27) 后来咋解决的 @BruceYang-yeu, 我也遇到了,就差这个了 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>