Estou executando o Lubuntu 17.04 dentro de uma máquina virtual VMWare. Eu estou tentando compilar e instalar o driver para o meu D-Link DUB-1312 Gigabit Ethernet Adapter
. No entanto, recebo o erro no bloco de código abaixo quando tento executar make
. Depois de ler perguntas semelhantes em outros lugares, vi outros usuários perguntarem se o binutils
está instalado. Está instalado no meu sistema Lubuntu. Eu sou um usuário Linux inexperiente.
make -C /lib/modules/4.10.0-19-generic/build SUBDIRS=/home/magnus/Documents/DUB modules
make[1]: Entering directory '/usr/src/linux-headers-4.10.0-19-generic'
arch/x86/Makefile:140: CONFIG_X86_X32 enabled but no binutils support
./scripts/gcc-version.sh: line 25: gcc: command not found
./scripts/gcc-version.sh: line 26: gcc: command not found
make[1]: gcc: Command not found
make[1]: gcc: Command not found
make[1]: gcc: Command not found
make[1]: gcc: Command not found
make[1]: gcc: Command not found
CC [M] /home/magnus/Documents/DUB/DUB-13X2.o
/bin/sh: 1: gcc: not found
scripts/Makefile.build:301: recipe for target '/home/magnus/Documents/DUB/DUB-13X2.o' failed
make[2]: *** [/home/magnus/Documents/DUB/DUB-13X2.o] Error 127
Makefile:1524: recipe for target '_module_/home/magnus/Documents/DUB' failed
make[1]: *** [_module_/home/magnus/Documents/DUB] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-19-generic'
Makefile:30: recipe for target 'default' failed
make: *** [default] Error 2
Alguém tem alguma dica? Foi preso nisso por muito tempo.
EDIT: Depois de instalar gcc
, como Arun sugeriu, eu fiz algum progresso. Eu agora recebo um novo erro:
make -C /lib/modules/4.10.0-19-generic/build SUBDIRS=/home/magnus/Documents/DUB modules
make[1]: Entering directory '/usr/src/linux-headers-4.10.0-19-generic'
CC [M] /home/magnus/Documents/DUB/DUB-13X2.o
/home/magnus/Documents/DUB/DUB-13X2.c:55:6: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
" " __TIME__ " " __DATE__ "\n"
^~~~~~~~
/home/magnus/Documents/DUB/DUB-13X2.c:55:19: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
" " __TIME__ " " __DATE__ "\n"
^~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:301: recipe for target '/home/magnus/Documents/DUB/DUB-13X2.o' failed
make[2]: *** [/home/magnus/Documents/DUB/DUB-13X2.o] Error 1
Makefile:1524: recipe for target '_module_/home/magnus/Documents/DUB' failed
make[1]: *** [_module_/home/magnus/Documents/DUB] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-19-generic'
Makefile:30: recipe for target 'default' failed
make: *** [default] Error 2
Para qualquer um que possa perguntar, este é meu Makefile:
CURRENT = $(shell uname -r)
#TARGET = usbnet
#OBJS = usbnet.o
TARGET = DUB-13X2
OBJS = DUB-13X2.o
MDIR = drivers/net/usb
KDIR = /lib/modules/$(CURRENT)/build
#KDIR = /root/Desktop/Android/UBIQCONN/android-3.0
SUBLEVEL= $(shell uname -r | cut -d '.' -f 3 | cut -d '.' -f 1 | cut -d '-' -f 1 | cut -d '_' -f 1)
USBNET = $(shell find $(KDIR)/include/linux/usb/* -name usbnet.h)
ifneq (,$(filter $(SUBLEVEL),14 15 16 17 18 19 20 21))
MDIR = drivers/usb/net
#USBNET = $(shell find $(KDIR)/$(MDIR)/* -name usbnet.h)
endif
#ifneq (,$(filter $(SUBLEVEL),21 22 23 24))
#USBNET = $(shell find $(KDIR)/$(MDIR)/* -name usbnet.h)
#endif
#$(if $(USBNET),,$(error $(KDIR)/$(MDIR)/usbnet.h not found. please refer to readme file for the detailed description))
EXTRA_CFLAGS = -DEXPORT_SYMTAB
PWD = $(shell pwd)
DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
obj-m := $(TARGET).o
default:
make -C $(KDIR) SUBDIRS=$(PWD) modules
$(TARGET).o: $(OBJS)
$(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
install:
su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
.PHONY: modules clean
-include $(KDIR)/Rules.make
EDIT2: Eu adicionei a bandeira, -Wno-date-time, como Arun sugeriu. Isso fez o driver compilar! Depois de lutar um pouco mais, também consegui instalar o driver. Se a sua resposta, Arun, tivesse sido uma "resposta" e não um comentário, eu teria marcado isso como uma solução.