Closed BloodBlight closed 2 years ago
Looks like the other files are not there:
$ sudo updatedb
$ locate musl-strip
$ locate musl-ar
$
Hello. Thank you for your feedback.
Seems like --pure is not that pure on my fedora 35 box with bash
as a default shell :/.
Yes, which
is needed to create musl-strip
and musl-ar
symlinks (maybe it's stupid hack, so maybe I should find better way).
Would you please try something? I created fix-which-nix branch so you can try it and it should help. Maybe there will be another stuff missing.
Which distro/os do you use? And what is your default shell?
Ok. You have Ubuntu (sorry, missed that), but which version? I can try to reproduce it on VM.
Ubuntu 20.04
So, I think I am getting further, but I think some part of the compile is cached somehow, and I am not sure how to clear it:
rm -rf gray386linux
git clone --branch fix-which-nix https://github.com/marmolak/gray386linux.git
cd gray386linux
cd src/build-kernel-env-with-nix/
nix-shell --pure
make headers_install ARCH=i386 INSTALL_HDR_PATH=../gray386/
#... no errors
exit
cd ..
cd ..
cd src/build-env-with-nix/
nix-shell --pure
Nothing happened here... It started compiling at this point last time.... I THOUGHT at least. Is something "cached" somewhere for this compile? I even tried cloning the repo to a different locations to see if it would try compiling here... Nothing.
Also, I am not dropped into a different path that I would have expected:
#[nix-shell:~/Downloads/gray386linux/src]$
And so:
#[nix-shell:~/Downloads/gray386linux/src]$ CFLAGS="$CFLAGS -I$(realpath "${PWD}/../gray386/include")" ./configure --target=i386 --prefix=$(realpath "${PWD}/../gray386/")
realpath: /home/###SOME USERNAME###/Downloads/gray386linux/src/../gray386/include: No such file or directory
bash: ./configure: No such file or directory
So I tried:
cd ~/Downloads/gray386linux/src/build-env-with-nix
And get:
$ CFLAGS="$CFLAGS -I$(realpath "${PWD}/../gray386/include")" ./configure --target=i386 --prefix=$(realpath "${PWD}/../gray386/")
bash: ./configure: No such file or directory
If it helps:
[nix-shell:~/Downloads/Test2/gray386linux]$ find . -name configure
./src/musl-1.2.2/configure
Ok. There is some misunderstanding in documentation. I just don't want to have paths with versions hardcoded into docs, but some different approach (like LFS) with docs per release/update should be better.
build-kernel-env-with-nix
- it's just aimed to compile linux kernel (you need old gcc version to do that) and nothing more. So that's why is directory changed directly to kernel directory (and because I'm lazy :)).
build-env-with-nix
- is different beast. It allows to compile whole user land without CET (Control-flow Enforcement Technology) which is already handled by kernel patches, but it can slow down system as a whole during runtime (no measurements of any kind here so I don't have exact numbers).
You need to move to desired directory manually. build-env-with-nix
allows you to compile your own apps so more freedom is involved.
musl-1.2.2
.then
CFLAGS="$CFLAGS -I$(realpath "${PWD}/../gray386/include")" ./configure --target=i386 --prefix=$(realpath "${PWD}/../gray386/")
busybox-1.34.1
.etc...
Thank you for your testing. I need to think about docs again :).
Ahh, k. I will look over this more closely then, but I think I might be a bit over my head.
Say I wanted to add openssh-server? I am guessing I would have to pull the source for it, and then try and get that to compile in this... work space? Not even sure I would have enough RAM for that but... Adjusting any compile flags of course.
It's easy. You just need to change directory one by one and put commands from documentation.
Yes, if you want to have openssh server installed, you need to do it by your own or you can try to recompile dropbear (included) with server support.
Oh and about caching: nix does some kind of "caching". It stores derivation (in this case, gcc build) into nix store till update. It saves tons of time, because you don't want to recompile gcc each time when nix-shell is invoked.
BTW: could I close this issue as a fixed? Looks like you are move to another steps which are not related with original isssue.
Yep, I think so!
I have an Ubuntu VM that I am running this build on, and after this command:
I get:
The which command is installed and located at /usr/bin/which
I assume that it not being able to find the command is causing the next two lines to bug. Any ideas? I am new to the nix-shell.