Ventoy Forums
Successfuly Complied on Ubuntu based distribution - Printable Version

+- Ventoy Forums (
+-- Forum: Ventoy General Use (
+--- Forum: Ventoy Discussion Forum (
+--- Thread: Successfuly Complied on Ubuntu based distribution (/showthread.php?tid=1526)

Successfuly Complied on Ubuntu based distribution - Premiere - 01-26-2021

Haven't yet fully tested this and I had to make a quite a few changes to the build scripts to get everything to compiled,
So far it's working well. 

 I wounder if the -m32 and -stactic options will cause issues for the 32 bit versions?  Confused 

I will post a how to once I verify all the steps.

I Love open source.

RE: Successfuly Complied on Ubuntu based distribution - Premiere - 01-29-2021

Here is how I made it as simple as I can for Ubuntu this was also tested on 20.04.1

when you doing this in a live setting make a Folder called cow

sudo mkdir /cow
For the i386-pc the install process for building the img will have a cow if there is no cow dir LOL

Anyways you will follow Most of the steps in this document
make sure you have deb-src Uncommented if they are not there , the source repo is the same link just need one with a deb-src;
Set up your sources

sudo gediet /etc/apt/sources.list
#deb cdrom:[Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731)]/ focal>
deb focal main restricted
deb focal-security main restricted
deb focal-updates main restricted
deb focal universe
deb-src focal main restricted
deb-src focal-security main restricted
deb-src focal-updates main restricted
deb-src focal universe

sudo apt-get update && sudo apt-get build-dep grub-efi edk2 && sudo apt-get install xorriso gcc-multilib dos2unix

Set all Archives in correct directories

unzip -d /home/
mv dietlibc-0.34.tar.xz /home/Ventoy-master/DOC
mv musl-1.2.1.tar.gz /home/Ventoy-master/DOC
mv /home/Ventoy-master/EDK2/
mv aarch64--uclibc--stable-2020.08-1.tar.bz2 gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz -t /opt
mv -t /home/Ventoy-master/ExFAT/
mv grub-2.04.tar.xz /home/Ventoy-master/GRUB2/

First thing that will prevent errors is this command

Replace sh with ./ For bash source compatibility.

sudo sed -i 's/sh b/.\/b/g' /home/Ventoy-master/INSTALL/

IN the EDK2 this command fixes issues with 32 bit failing and it not executing source
sudo sed -i 's/GCC48/GCC5/g' /home/Ventoy-master/EDK2/ && sudo sed -i 's/#!\/bin\/sh/#!\/bin\/bash/' /home/Ventoy-master/EDK2/
sudo sed -i 's/#!\/bin\/sh/#!\/bin\/bash/' /home/Ventoy-master/EDK2/ && sudo sed -i 's/sh .\/b/.\/b/g' /home/Ventoy-master/EDK2/

These will allow GRUB2 to compile.
sudo sed -i 's/configure/configure --disable-werror/g' /home/Ventoy-master/GRUB2/
sudo sed -i 's/grub-mknetdir/if ["$1" = "uefi" ]\; then \nwpath="x86_64-efi"\nelif [ " $1" = "i386efi" ]\; then\n wpath="i386-efi"\nelse\nwpath="i386-pc" \nfi \ngrub-mknetdir --directory "$VT_DIR\/GRUB2\/INSTALL\/lib\/grub\/$wpath"/' /home/Ventoy-master/GRUB2/MOD_SRC/grub-2.04/

Make all Scripts executable:
sudo find /home/Ventoy-master/ -name "*.sh" -exec touch {} \; -exec chmod +x {} \;

This fixes a weird error with diet for VentoyTool.
sudo sed -i 's/int __bitwise/int __bitwise\;\ntypedef int/' /usr/include/linux/fs.h

sudo sh
2.3 Prepare third-part tools

cd /home/Ventoy-master/DOC/
tar xf musl-1.2.1.tar.gz
cd musl-1.2.1
./configure && make install

tar xf /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt
tar xf /opt/aarch64--uclibc--stable-2020.08-1.tar.bz2 -C /opt

2.4 Set PATH envrioment

export PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin:/opt/aarch64--uclibc--stable-2020.08-1/bin

better to add this line to /root/.bashrc and relogin as root

cd /home/Ventoy-master/INSTALL
sh /

That's it just tested all the commands right out of this document on a live cd.

I wonder if this will be better because its able to use gcc version 9.3.0.....

RE: Successfuly Complied on Ubuntu based distribution - Premiere - 02-06-2021

So ...
You dont need the source but you definitely need to use gcc 7.5 for the i386-pc. There is a glitch with the compilation of the lzma- D compressor( ONLY i386-pc) it will all compile fine with 7.5 no issues. It will end up having over 120 MB of white space with 9.3
Yet You only need a few more Libraries that can be obtained with install not the build-dep ,the gigabyte Of sources. I WILL edit the above and tell you here Smile. Also not sure but I recommend adding make distroclean to the GRUB2 at the bottom its missing for i386-pc. Unless they update it.