RISC-V Linux running on Qemu - linux

I am trying to run RISC-V linux on Qemu, following the instruction: Running 64- and 32-bit RISC-V Linux on QEMU
I have downloaded and installed the RISC-V GNU compiller Toolchain
./configure --prefix=/opt/riscv
make linux
and when I execute the command:
make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- defconfig
I got the following error:
:~/Documents/riscv64-linux/linux$ make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
scripts/Kconfig.include:39: compiler 'riscv64-unknown-linux-gnu-gcc' not found
make[1]: *** [scripts/kconfig/Makefile:73: defconfig] Error 1
make: *** [Makefile:602: defconfig] Error 2
Kindly, advice how can I fix this problem.

This is standart problem, try to type whereis riscv64-unknown-linux-gnu-gcc if it get nothing, try to type riscv64- and press tab, you should see necessary prefix you need paste after CROSS_COMPILE=. Also maybe you also need add PATH variable with path to riscv-toolchain's bin in ~/.bashrc or/and in ~/.profile.
Build own linux is a big task, maybe you should learn some manuals about toolchain and building linux.
riscv toolchain link

Related

Makefile: No such file or directory & No rule to make target, while compiling Linux kernel

I just download a linux kernel, add some systemcalls and then try to compile it.
While I use "make mrproper" and "menuconfig" it happened:
root#krasus-virtual-machine:/home/krasus/lib1/linux-5.19.10# make mrproper
Makefile:1022: scripts/Makefile.extrawarn: No such file or directory
make: *** No rule to make target "scripts/Makefile.extrawarn". Stop.
root#krasus-virtual-machine:/home/krasus/lib1/linux-5.19.10# make menuconfig
Makefile:611: scripts/Makefile.compiler: No such file or directory
make: *** No rule to make target "scripts/Makefile.compiler". Stop.
My vmware version is ubuntu 20.04.5 LTS with kernel 5.15.0-48,
The version of the kernel I'm compiling is linux-5.19.10.
I would really appreciate if you can give me some help, I've tried a lot but nothing worked, and now I'm crazzy about it.
Please forgive my poor English.

Arch Linux: make - no such file or directory

I have a problem by compiling a driver (WLAN-dongle Edimax ac600).
I´m using an Archlinux on my raspberry-pi and want to install my dongle for 5Ghz. During comiling the driver I get this message. I tried to install the linux-headers without success. (in other threads it will be a solution)
Here is my output of make:
[root#raspberry_pi_1 rtl8812AU]# make make ARCH=arm CROSS_COMPILE= -C
/lib/modules/4.9.43-1-ARCH/build M=/root/rtl8812AU modules make[1]:
*** /lib/modules/4.9.43-1-ARCH/build: No such file or directory. Stop. make: *** [Makefile:1576: modules] Error 2
I found out that my pi has a two-arch...-directories:
4.9.43-1-ARCH/
4.9.51-1-ARCH/
Only the second one has the build directory...
How can I fix the problem?!
thanks a lot,
a Linux noob...
[Reputation is too low to post comment]
Use uname -r to make sure which version of the kernel you use.
If it's 4.9.43 : you have newer version of the kernel and this confuse your installer. You should reboot on the 51 one
If it's 4.9.51 : You messed up your installation step and are trying to compile for an old target. You should review the compilation process and change every mention of the 4.9.43 to 4.9.51 since it's the version you use.
If you upgrade your kernel, you may have to rebuild the thing again (You may like to have script in the future ;) ) with the new kernel version.

compiling kernel -- 3.9.4 -- issues

I have a desktop on which fedora linux is installed. Kernel i am using is 3.9.4 .
I need to recompile my 3.9.4 kernel for CAN bus support.
My kernel source is here :---
[root#localhost 3.9.4-200.fc18.x86_64]# pwd
/usr/src/kernels/3.9.4-200.fc18.x86_64
Then i did -- make menuconfig, -- changed the configuration.
Error i get after -- make.
[root#localhost 3.9.4-200.fc18.x86_64]# make
make[1]: *** No rule to make target `/usr/src/kernels/3.9.4-200.fc18.x86_64/arch/x86/syscalls/syscall_32.tbl', needed by `arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h'. Stop.
make: *** [archheaders] Error 2
How to get rid of this error to compile my kernel ?
You need to get the entire source tree for the kernel. /usr/src/kernels/3.9.4-200.fc18.x86_64/ does not contain the entire source for the Fedora kernel, it only contains headers and makefiles for building additional modules.
You can either get the source rpm for that kernel and rebuild it. Or get a mainline kernel directly from kernel.org and build it.

error when building 32-bit linux kernel on 64-bit linux host

I am trying to build 32-bit linux kernel 2.6.9 on a 64-bit linux host with 2.6.9 (same version). Did some google search and tried the following:
step 1) make ARCH=i386 CFLAGS=-m32 menuconfig
step 2) make ARCH=i386 CFLAGS=-m32
Step 1 was okay. But step 2 got the following errors. What did I do wrong?
make ARCH=i386 CFLAGS=-m32
< snip >
In file included from include/asm/smp.h:18,
from include/linux/smp.h:17,
from include/linux/sched.h:23,
from arch/i386/kernel/asm-offsets.c:7:
include/asm/mpspec.h:6:25: mach_mpspec.h: No such file or directory
In file included from include/asm/smp.h:18,
from include/linux/smp.h:17,
from include/linux/sched.h:23,
from arch/i386/kernel/asm-offsets.c:7:
include/asm/mpspec.h:8: error: `MAX_MP_BUSSES' undeclared here (not in a function)
include/asm/mpspec.h:22: error: `MAX_IRQ_SOURCES' undeclared here (not in a function)
In file included from include/linux/smp.h:17,
from include/linux/sched.h:23,
from arch/i386/kernel/asm-offsets.c:7:
include/asm/smp.h:72:26: mach_apicdef.h: No such file or directory
make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
make: *** [arch/i386/kernel/asm-offsets.s] Error 2
The make ARCH=i386 should be sufficient assuming you have everything required by the build installed on the machine. I use this almost daily to build i386 on a "ubuntu 12.04".
If you have built a 64-bit kernel previously, you should have everything, and it's possible that you need to "make clean" or even "make mrproper" [save your .config somewhere safe for the latter], because I know for example asm_offsets.s will be different between 32 and 64-bit.

UML Linux - vmlinux.o Error 1 - final close failed: Input/output error

I'm trying to install UML linux. Kernel is 2.6.28.
I link to Linux files so that I have a read-only copy that I can revert back to.
I then run the commands:
make defconfig ARCH=um # works
make ARCH=um # errors out at the very end:
final close failed: Input/output error
make: *** [vmlinux.o] Error 1
Because of this error, my binary vmlinux never gets created so I can't run my own UML Linux. Any ideas?
Does this fix the problem?
Otherwise, more information is needed. Host's architecture, distribution, and versions of tools (GCC, binutils, Make, shell, ...).

Resources