starfive-tech / VisionFive2

445 stars 79 forks source link

Instructions to fetch correct Ubuntu Focal 20.04 and not 20.04.5 #22

Open omac777 opened 1 year ago

omac777 commented 1 year ago

The build instructions indicate to use ubuntu 20.04, but when you attempt to go there on the ubuntu web site, it redirects you to an updated version of 20.04.5 which causes more build issues. Don't use that. https://releases.ubuntu.com/20.04/ubuntu-20.04.5-desktop-amd64.iso

You need to use the older original 20.04 version. Also disable and package upgrades and only install the original packages pinned to that 20.04 release. https://old-releases.ubuntu.com/releases/20.04/ubuntu-20.04-desktop-amd64.iso

omac777 commented 1 year ago

If you don't use the correct ubuntu 20.04 version, you will experience issues like this:

sudo 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
[sudo] password for davidm: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'zlib1g-dev' instead of 'libz-dev'
Note, selecting 'python-is-python2' instead of 'python'
bc is already the newest version (1.07.1-2build1).
bc set to manually installed.
dosfstools is already the newest version (4.1-2).
dosfstools set to manually installed.
gdisk is already the newest version (1.0.5-1).
gdisk set to manually installed.
mtools is already the newest version (4.0.24-1).
mtools set to manually installed.
cpio is already the newest version (2.13+dfsg-2ubuntu0.3).
cpio set to manually installed.
curl is already the newest version (7.68.0-1ubuntu2.14).
git is already the newest version (1:2.25.1-1ubuntu3.6).
git set to manually installed.
wget is already the newest version (1.20.3-1ubuntu2).
wget set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
 g++ : Depends: g++-9 (>= 9.3.0-3~) but it is not going to be installed
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.64.6-1~ubuntu20.04.3) but 2.64.6-1~ubuntu20.04.4 is to be installed
                  Depends: libglib2.0-bin (= 2.64.6-1~ubuntu20.04.3)
                  Depends: libmount-dev (>= 2.28) but it is not going to be installed
                  Depends: libpcre3-dev (>= 1:8.31) but it is not going to be installed
                  Depends: libselinux1-dev but it is not going to be installed
 libncurses-dev : Depends: libc6-dev but it is not going to be installed or
                           libc-dev
 libtool : Depends: libc6-dev but it is not going to be installed or
                    libc-dev
 zlib1g-dev : Depends: libc6-dev but it is not going to be installed or
                       libc-dev
E: Unable to correct problems, you have held broken packages.
omac777 commented 1 year ago

Screenshot from 2023-01-05 13-41-50 I disabled all ubuntu focal 20.04 repo package upgrades view the above picture for details. This ensures we build with the exact same packages as the starfive-tech team did.

omac777 commented 1 year ago

I built with focal 20.04 following the instructions very carefully. It took 93 minutes on an octacore amd phenomx8 with an oscoo sata ssd.

It seems to have succeeded please have a look at this log(expires in 30days). https://easyupload.io/tdzlzg I would upload these on github but my log file exceed upload max.

omac777 commented 1 year ago

None of these appeared in the work after the build. Perhaps there are errors in the build output above. It's not easy to get these build steps right.

work/ ├── visionfive2_fw_payload.img ├── image.fit ├── initramfs.cpio.gz ├── u-boot-spl.bin.normal.out ├── linux/arch/riscv/boot ├── dts │ └── starfive │ ├── jh7110-visionfive-v2-ac108.dtb │ ├── jh7110-visionfive-v2.dtb │ ├── jh7110-visionfive-v2-wm8960.dtb │ ├── vf2-overlay │ │ └── vf2-overlay-uart3-i2c.dtbo └── Image.gz

aiChaoSONG commented 1 year ago

Managed to compile with Ubuntu 22.04 and Linuxmint 21.1 by copying below libraries to /lib/x86_64-linux-gnu

libcrypto.so.1.1.zip