toaruos icon indicating copy to clipboard operation
toaruos copied to clipboard

Unable to build toaruos from source

Open saksham1345 opened this issue 2 years ago • 10 comments

K Lange sir, I am using your toaruos, so I git clone your GitHub project but the problem here is that I am unable to build an image file using the source when I run your given commands then till step 3 it's ok but when I run the 4th and last command "docker run -v pwd:/root/misaka -w /root/misaka -e LANG=C.UTF-8 -t toaruos/build-tools:1.99.x util/build-in-docker.sh"

It's throws an error that "unable to find the file/folder specified : build-in-docker.sh"

And when i run "make -f Makefile" it throws "no rule to make target: Makefile"

When i use "cd build" and then when i run "make image.iso" then again it throws me the same error "no rule to make target: image.iso" And after this it throws something like this "process_begin: CreateProcess(NULL, , ...) failed. make (e=2): The system cannot find the file specified. make: *** [setup] Error 2"

Please K Lange sir help me to solve this problem.

And a very kind and humble request to you that please 🥺 can you make a video tutorial on how to build toaruos from source step by step.

Thanks in advance.

saksham1345 avatar Jul 22 '22 15:07 saksham1345

process_begin: CreateProcess

Are you on Windows?

klange avatar Jul 22 '22 20:07 klange

Yes sir, I am using Windows 10

saksham1345 avatar Jul 23 '22 00:07 saksham1345

I do not support building under Windows, but will give an explanation of why this doesn't work here. I recommend setting up a WSL2 instance and running the Docker command again in that.

The main problem you are experiencing is that this part of the docker command:

-v `pwd`:/root/misaka

... is supposed to map the current directory into the Docker container. But this is a Unix shell command, and you are trying to run it in Windows, presumably in PowerShell or something and I have no idea what directory it's actually mounting or if that works at all. Then Docker-for-Windows spins up a Linux VM and it doesn't have the code to build, so build-in-docker.sh is missing.

klange avatar Jul 23 '22 02:07 klange

I do not support building under Windows.

Sir, can you please try to make it supported for windows also, it would be a great help by the time I will try Wsl2

saksham1345 avatar Jul 23 '22 07:07 saksham1345

A suggestion from StackOverflow is to add a leading / to that bind mount argument, something like -v "/${PWD}:/root/misaka" might work (or type out the full path), but may run into permissions or filesystem issues.

I do not provide support for (locally) building ToaruOS from source in general. The Docker container was built for CI builders to run builds automatically, and offers a one-off option for most users. For anyone interested in more involved development, setting up the toolchain is "left as an exercise for the reader" - most of it is "build gcc and binutils" which is a complicated, but "standard", process, and the rest is "install a bunch of other packages for the CD and UEFI parts of the build" which varies too much for me to provide helpful instructions (I can't even manage to keep track of the right package names on Debian/Ubuntu) - and I would strongly recommend against trying to do that on Windows anyway.

I question why anyone would be interested in some rando's boring hobby Unix clone OS and not already be running Linux or BSD themselves...

klange avatar Jul 23 '22 08:07 klange

rando's boring hobby Unix clone OS

It's not like that, your os is really good and you are also a very much skilled programmer i appreciate.

As you suggested to use wsl2 so I tried that one out so first it throws error standard_init_linux.go:228: exec user process caused: no such file or directory So I changed line ending from CRLF to LF then that error solved but after doing this it throws an error make: *** No rule to make traget 'base/lib/libc.so'. Stop.

As you told not to try in windows but the problem is I have no option other that this i haved to do solve it in windows only

saksham1345 avatar Jul 23 '22 08:07 saksham1345

Please try the complete instructions in the README from within the WSL2 instance with docker.io installed, the docker daemon running, and with a user in the docker group. If you are using a Git checkout you cloned from Windows, it may be corrupted by Windows filesystem limitations.

I was able to successfully complete a build using these instructions under WSL2 with an Ubuntu installation - had to go dig my Surface out of my closet and get it charged and updated first, but wanted to be sure the things I'm telling you work.

klange avatar Jul 23 '22 09:07 klange

In readme WSL2 instance is not there.

saksham1345 avatar Jul 23 '22 09:07 saksham1345

I am not sure what you mean.

  • Create an Ubuntu installation for WSL2.
  • In that installation, install Docker with sudo apt install docker.io
  • Start the Docker daemon with sudo systemctl start docker
  • Add the local user to the docker group with sudo usermod -a -G docker $USER
  • Make sure that group is active with newgrp docker
  • Run the steps from the README from the start:
  • git clone https://github.com/klange/toaruos
  • cd toaruos
  • git submodule update --init kuroko
  • docker pull toaruos/build-tools:1.99.x
  • docker run -v `pwd`:/root/misaka -w /root/misaka -e LANG=C.UTF-8 -t toaruos/build-tools:1.99.x util/build-in-docker.sh
    

klange avatar Jul 23 '22 09:07 klange

After thinking a lot I have finally decide to switch on Linux from windows but for that i want to know which one should I use Ubuntu/Debian for 4gb ram pc

saksham1345 avatar Jul 24 '22 07:07 saksham1345

@saksham1345 Have you been able to complete a build under WSL? As I was able to do so reliably, I would like to close this ticket.

klange avatar Aug 18 '22 23:08 klange