Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build on Ubuntu following the given instructions #3

Open
alecz20 opened this issue Apr 17, 2024 · 1 comment
Open

Cannot build on Ubuntu following the given instructions #3

alecz20 opened this issue Apr 17, 2024 · 1 comment

Comments

@alecz20
Copy link

alecz20 commented Apr 17, 2024

Following exact instructions from the README:

Git Clone ok.

alex@alex-desktop:~/Desktop$ git clone \--recurse https://github.com/CloverHackyColor/CloverBootloader.git
Cloning into 'CloverBootloader'...
remote: Enumerating objects: 116191, done.
remote: Counting objects: 100% (2219/2219), done.
remote: Compressing objects: 100% (609/609), done.
remote: Total 116191 (delta 1692), reused 1795 (delta 1606), pack-reused 113972
Receiving objects: 100% (116191/116191), 222.28 MiB | 22.72 MiB/s, done.
Resolving deltas: 100% (64654/64654), done.
Updating files: 100% (35074/35074), done.
Submodule 'OpenCorePkg' (https://github.com/CloverHackyColor/OpenCorePkg.git) registered for path 'OpenCorePkg'
Cloning into '/home/alex/Desktop/CloverBootloader/OpenCorePkg'...
remote: Enumerating objects: 45442, done.        
remote: Counting objects: 100% (7508/7508), done.        
remote: Compressing objects: 100% (417/417), done.        
remote: Total 45442 (delta 7233), reused 7098 (delta 7091), pack-reused 37934        
Receiving objects: 100% (45442/45442), 216.99 MiB | 22.55 MiB/s, done.
Resolving deltas: 100% (33481/33481), done.
Submodule path 'OpenCorePkg': checked out '8865f874167989c020973b467dacf4461f7298f6'
alex@alex-desktop:~/Desktop$ cd CloverBootloader

cd CloverBootloader and ../edksetup.sh fails (obviously)

alex@alex-desktop:~/Desktop/CloverBootloader$ ../edksetup.sh
bash: ../edksetup.sh: No such file or directory

but there is a local file named edksetup.sh, and we can execute it with ./edksetup.sh

alex@alex-desktop:~/Desktop/CloverBootloader$ ./edksetup.sh
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 87: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 63: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 64: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 65: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 66: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 63: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 64: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 65: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 66: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 71: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 72: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 73: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 74: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 75: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 76: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
/home/alex/Desktop/CloverBootloader/BaseTools/BuildEnv: line 77: /home/alex/Desktop/CloverBootloader/Conf/BuildEnv.sh: No such file or directory
WORKSPACE: /home/alex/Desktop/CloverBootloader
EDK_TOOLS_PATH: /home/alex/Desktop/CloverBootloader/BaseTools
CONF_PATH: /home/alex/Desktop/CloverBootloader/Conf
Copying $EDK_TOOLS_PATH/Conf/build_rule.template
     to /home/alex/Desktop/CloverBootloader/Conf/build_rule.txt
cp: cannot create regular file '/home/alex/Desktop/CloverBootloader/Conf/build_rule.txt': No such file or directory
Copying $EDK_TOOLS_PATH/Conf/tools_def.template
     to /home/alex/Desktop/CloverBootloader/Conf/tools_def.txt
cp: cannot create regular file '/home/alex/Desktop/CloverBootloader/Conf/tools_def.txt': No such file or directory
Copying $EDK_TOOLS_PATH/Conf/target.template
     to /home/alex/Desktop/CloverBootloader/Conf/target.txt
cp: cannot create regular file '/home/alex/Desktop/CloverBootloader/Conf/target.txt': No such file or directory
./edksetup.sh: line 149: return: can only `return' from a function or sourced script

But it complains here is no Conf directory. So let's create it manually since the script seems to just copy files to that folder

alex@alex-desktop:~/Desktop/CloverBootloader$ mkdir Conf

Run again

alex@alex-desktop:~/Desktop/CloverBootloader$ ./edksetup.sh
WORKSPACE: /home/alex/Desktop/CloverBootloader
EDK_TOOLS_PATH: /home/alex/Desktop/CloverBootloader/BaseTools
CONF_PATH: /home/alex/Desktop/CloverBootloader/Conf
Copying $EDK_TOOLS_PATH/Conf/build_rule.template
     to /home/alex/Desktop/CloverBootloader/Conf/build_rule.txt
Copying $EDK_TOOLS_PATH/Conf/tools_def.template
     to /home/alex/Desktop/CloverBootloader/Conf/tools_def.txt
Copying $EDK_TOOLS_PATH/Conf/target.template
     to /home/alex/Desktop/CloverBootloader/Conf/target.txt
./edksetup.sh: line 149: return: can only `return' from a function or sourced script

This worked.

Next to build - fails with missing python3-distutils

alex@alex-desktop:~/Desktop/CloverBootloader$ ./ebuild.sh -fr
TOOLCHAIN_DIR: /usr
NASM_PREFIX: /usr/bin/
NASM_VER: 2.14.02
Initializing workspace
recreate Conf folder
WORKSPACE: /home/alex/Desktop/CloverBootloader
EDK_TOOLS_PATH: /home/alex/Desktop/CloverBootloader/BaseTools
CONF_PATH: /home/alex/Desktop/CloverBootloader/Conf
Copying $EDK_TOOLS_PATH/Conf/build_rule.template
     to /home/alex/Desktop/CloverBootloader/Conf/build_rule.txt
Copying $EDK_TOOLS_PATH/Conf/tools_def.template
     to /home/alex/Desktop/CloverBootloader/Conf/tools_def.txt
Copying $EDK_TOOLS_PATH/Conf/target.template
     to /home/alex/Desktop/CloverBootloader/Conf/target.txt
Building tools as they are not found
make: Entering directory '/home/alex/Desktop/CloverBootloader/BaseTools'
make -C Source/C
make[1]: Entering directory '/home/alex/Desktop/CloverBootloader/BaseTools/Source/C'
Attempting to detect HOST_ARCH from 'uname -m': x86_64
Detected HOST_ARCH of X64 using uname.
mkdir -p .
mkdir ./libs 
make -C Common
make[2]: Entering directory '/home/alex/Desktop/CloverBootloader/BaseTools/Source/C/Common'
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  BasePeCoff.c -o BasePeCoff.o
...
...
...
make[1]: Entering directory '/home/alex/Desktop/CloverBootloader/BaseTools/Tests'

Python reported: "No module named 'distutils.util"

make[1]: *** [GNUmakefile:11: test] Error 1
make[1]: Leaving directory '/home/alex/Desktop/CloverBootloader/BaseTools/Tests'
make: *** [GNUmakefile:19: Tests] Error 2
make: Leaving directory '/home/alex/Desktop/CloverBootloader/BaseTools'

Installed python3-distutils (i did using synaptic, but apt install python3-distutils would also work.

now the build was successful:

...
[NASM] boot1xalt.s -> /home/alex/Desktop/CloverBootloader/CloverPackage/CloverV2/BootSectors/boot1xalt
'Description.txt' -> '/home/alex/Desktop/CloverBootloader/CloverPackage/CloverV2/BootSectors/Description.txt'
'Installation.txt' -> '/home/alex/Desktop/CloverBootloader/CloverPackage/CloverV2/BootSectors/Installation.txt'
make: Leaving directory '/home/alex/Desktop/CloverBootloader/BootHFS'
Done!

* Clover build process took  2m12s  to complete.

I am not sure if my solution is the correct one, but I can raise a PR with these changes later.

@chris1111
Copy link
Collaborator

chris1111 commented Apr 17, 2024

Your solution looks good, see here it looks like your problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants