Advertisement
Guest User

Fedora Silverblue 37 podman to build VF2 image

a guest
Jan 3rd, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.41 KB | Software | 0 0
  1. Running within Fedora Silverblue 37, I attempted to build the VF2(visionfive 2) image from within a podman ubuntu 20.04(focal) container rather than from straight ubuntu focal.
  2. Unfortunately, I have not been able to successfully repeat the build to get all the described VF2 build binaries and images and such with the steps described below.
  3. Afterwards, how does one slip in/overlay the Fedora Silverblue 37 packages as much as possible into the VF2 image using the existing working VF2 kernel?
  4. Why is it that buildroot also annoying downloads all the dependant packages from different repositories within the build process?
  5. Why couldn't all these buildroot packages all be fetched beforehand AND THEN build?
  6. Why is it that we don't separate the package documentation from the package binaries and optionally build documentation afterwards? This could save enormous amounts of build time when iterating through all this.
  7.  
  8. ###fetch ubuntu 20.04 focal container
  9. podman pull ubuntu:focal-20221130
  10.  
  11. ### create a directory to share data between the container and the host fedora silverblue 37
  12. mkdir -p /mnt/vf2share
  13.  
  14. ###start ubuntu 20.04 focal container
  15. podman run -v ~/vf2share:/mnt/vf2share --net host -i -t ubuntu:focal-20221130 /bin/bash
  16.  
  17. ###Later we'll start it like this after it has been committed
  18. ###podman run -v /var/home/davidm/vf2share:/mnt/vf2share:Z --net host -i -t ubuntu-vf2-buildr /bin/bash
  19.  
  20. ###issues with group and owner in the build.  Attempted to resolve them with this alias, but did nothing to help.
  21. alias tar='tar --no-same-owner'
  22.  
  23. #############################inside ubuntu 20.04 focal container
  24.  
  25. mkdir visionfive2prep
  26. cd visionfive2prep/
  27.  
  28. apt update
  29. apt-get install curl
  30. apt-get install git-lfs
  31. apt-get install build-essential g++ git autoconf automake autotools-dev texinfo bison xxd curl flex gawk gdisk gperf libgmp-dev libmpfr-dev libmpc-dev libz-dev libssl-dev libncurses-dev libtool patchutils python screen texinfo unzip zlib1g-dev libyaml-dev wget cpio bc dosfstools mtools device-tree-compiler libglib2.0-dev libpixman-1-dev kpartx
  32. apt-get install rsync
  33. apt-get install time
  34. apt-get install emacs-nox
  35.  
  36. curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh -o script.deb.sh
  37. sudo bash ./script.deb.sh
  38.  
  39. git clone https://github.com/starfive-tech/VisionFive2.git
  40.  
  41. cd VisionFive2
  42.  
  43. cat .gitmodules
  44. [submodule "buildroot"]
  45.     path = buildroot
  46.     url = https://github.com/starfive-tech/buildroot.git
  47.     branch = JH7110_VisionFive2_devel
  48. [submodule "u-boot"]
  49.     path = u-boot
  50.     url = https://github.com/starfive-tech/u-boot.git
  51.     branch = JH7110_VisionFive2_devel
  52. [submodule "linux"]
  53.     path = linux
  54.     url = https://github.com/starfive-tech/linux.git
  55.     branch = JH7110_VisionFive2_devel
  56. [submodule "opensbi"]
  57.     path = opensbi
  58.     url = https://github.com/starfive-tech/opensbi.git
  59.     branch = master
  60.  
  61. Besides this one, the conf/buildroot_initramfs_config and conf/buildroot_rootfs_config also need to modify the
  62. BR2_KERNEL_HEADERS_CUSTOM_REPO_URL="git@github.com:starfive-tech/linux.git"
  63. to
  64. BR2_KERNEL_HEADERS_CUSTOM_REPO_URL="https://github.com/starfive-tech/linux.git"
  65.  
  66. cd VisionFive2
  67. git checkout JH7110_VisionFive2_devel
  68. git submodule update --init --recursive
  69.  
  70. cd buildroot && git checkout --track origin/JH7110_VisionFive2_devel && cd ..
  71. cd u-boot && git checkout --track origin/JH7110_VisionFive2_devel && cd ..
  72. cd linux && git checkout --track origin/JH7110_VisionFive2_devel && cd ..
  73. cd opensbi && git checkout master && cd ..
  74. cd soft_3rdpart && git checkout JH7110_VisionFive2_devel && cd ..
  75.  
  76. ##to capture all the build output run a shell in emacs with no color
  77. emacs -nw --color=no
  78. ##alt-x shell
  79. time make -j$(nproc)
  80. #############################FINISHED ubuntu 20.04 focal container
  81.  
  82. ###pause podman container
  83. ctrl-p ctrl-q
  84.  
  85. ###list podman containers
  86. podman ps
  87. CONTAINER ID  IMAGE                                    COMMAND     CREATED      STATUS          PORTS       NAMES
  88. 8c35f4187b36  docker.io/library/ubuntu:focal-20221130  /bin/bash   2 hours ago  Up 2 hours ago              admiring_wescoff
  89.  
  90. ###save all our actions and name the container
  91. podman commit 8c35f4187b36 ubuntu-vf2-buildr
  92.  
  93. ###attach back into the running session
  94. podman attach ubuntu-vf2-buildr
  95.  
  96. ###kill any running containers
  97. podman kill b2df210888d6
  98.  
  99. ###next time you want to use this container
  100. podman run -v /var/home/davidm/vf2share:/mnt/vf2share:Z --net host -i -t ubuntu-vf2-buildr /bin/bash
  101.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement