Help! new user installing stuff...


Forum: Other Help Topics
Topic: Help! new user installing stuff...
started by: RobDollar

Posted by RobDollar on Mar. 12 2008,02:19
I'm trying to install a driver for my wireless card, it needs the "make" command. Unfortunately I cant connect to the internet any other way except for wireless (which I can't do currently), so I've used windows to download gnu-utils.dsl and gcc1-with-lib.dsl to my hdd, which I beleive are needed. Can I use these in DSL locally (instead of using apt-get or such) and if so how.

I'm a very new linux user, and have had only a little experience with it, please bear that in mind.

I'm intrigued by linux but have (obviously) a lot to learn about how it works. I am of course very used to windows, but I don't understand the need for the complexity of compiling programs when you install them?

Any info very welcome :)

Posted by andrewb on Mar. 12 2008,03:11
You'll also need gcc-2.95 as that is the compiler version used to compile the kernel & you need to match the compiler when compiling modules. You will need to load up gcc1-with-libs as well as it has the make command.

To use them boot into DSL, mount the windows partition & then use the MyDSL system to load the files you downloaded (I'e assuming your using v4.2.5). MyDSL appears on the desktop as a folder. Open the folder & double click the MyDSL icon in the folder to run the MyDSL system.

Once you've done that you will be able to use make. I would check the makefile you intend to use to ensure it points to the gcc-2.95 compiler before compiling anything.

Posted by RobDollar on Mar. 12 2008,04:21
Thanks for the reply. Heres the makefile, I'm assuming that it just won't work anyway considering it's got kernel 2.6 at the beginning, or can I change that?

Code Sample
all: module
MODULE_NAME := rt2570

#PATCHLEVEL := 6
#KERNDIR=/usr/src/linux-2.6
#MODDIR=/lib/modules/2.6.12/extra

ifeq ($(PATCHLEVEL),)
PATCHLEVEL := $(shell uname -r | cut -d. -f2)
endif

RESMAN_CORE_OBJS := rtusb_main.o
RESMAN_GLUE_OBJS := mlme.o rtusb_bulk.o connect.o sync.o rtusb_init.o rtmp_tkip.o wpa.o rtmp_wep.o rtusb_info.o assoc.o auth.o auth_rsp.o md5.o rtusb_io.o sanity.o rtusb_data.o

$(MODULE_NAME)-objs := $(RESMAN_CORE_OBJS) $(RESMAN_GLUE_OBJS)

ifdef TOPDIR
obj-m += $(MODULE_NAME).o
endif

EXTRA_CFLAGS += -I$(src)

ifdef KERNDIR
KERNEL_SOURCES := $(KERNDIR)
else
KERNEL_SOURCES := /lib/modules/$(shell uname -r)/build
endif

ifdef MODDIR
MODULE_ROOT := $(MODDIR)
else
MODULE_ROOT := /lib/modules/$(shell uname -r)/extra
endif

ifdef KERNOUT
KERNEL_OUTPUT := KBUILD_OUTPUT=$(KERNOUT)
else
KERNEL_OUTPUT :=
endif

src ?= .
obj ?= .

ifeq ($(PATCHLEVEL), 4)
MODULE_OBJECT := $(MODULE_NAME).o
MODULE_CONF := /etc/modules.conf
else
MODULE_OBJECT := $(MODULE_NAME).ko
MODULE_CONF := /etc/modprobe.conf
endif

ifeq ($(PATCHLEVEL), 4)
$(obj)/$(MODULE_NAME).o: $($(MODULE_NAME)-objs)
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $($(MODULE_NAME)-objs)
endif

KBUILD_PARAMS := -C $(KERNEL_SOURCES) SUBDIRS=$(CURDIR) $(KERNEL_OUTPUT)

module:
@$(MAKE) $(KBUILD_PARAMS) modules; \
if ! [ -f $(MODULE_OBJECT) ]; then \
echo "$(MODULE_OBJECT) failed to build!"; \
exit 1; \
fi

arm:
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=-mstructure-size-boundary=8 -I$(src)' modules;
if ! [ -f $(MODULE_OBJECT) ]; then \
echo "$(MODULE_OBJECT) failed to build!"; \
exit 1; \
fi

armdebug:
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=-mstructure-size-boundary=8 -I$(src) -DRT2500_DBG' modules;
if ! [ -f $(MODULE_OBJECT) ]; then \
echo "$(MODULE_OBJECT) failed to build!"; \
exit 1; \
fi

debug:
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=-I$(src) -DRT2500_DBG' modules; \
if ! [ -f $(MODULE_OBJECT) ]; then \
echo "$(MODULE_OBJECT) failed to build!"; \
exit 1; \
fi

debugfs:
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=-I$(src) -DRT2500_DBG -DRT2X00DEBUGFS' modules; \
if ! [ -f $(MODULE_OBJECT) ]; then \
echo "$(MODULE_OBJECT) failed to build!"; \
exit 1; \
fi

clean:
@rm -f $(RESMAN_GLUE_OBJS) $(RESMAN_CORE_OBJS) .*.{cmd,flags}
@rm -f $(MODULE_NAME).{o,ko,mod.{o,c}} built-in.o $(VERSION_HEADER) *~
@rm -fr .tmp_versions Module.symvers

modules_install:
@if ! [ -f $(MODULE_OBJECT) ]; then \
        $(MAKE) module; \
fi
ifeq ($(PATCHLEVEL),4)
@echo "install '$(MODULE_OBJECT)' to $(MODULE_ROOT)"
install -m 755 -o 0 -g 0 -d $(MODULE_ROOT)
install -m 644 -o 0 -g 0 $(MODULE_OBJECT) $(MODULE_ROOT)
/sbin/depmod -a
else
@echo "2.6 module install"
make $(KBUILD_PARAMS) modules_install
/sbin/depmod -a
endif


install: modules_install
@if ! grep -q 'rausb0' $(MODULE_CONF); then \
echo "append 'alias rausb0 rt2570' to $(MODULE_CONF)"; \
echo "alias rausb0 rt2570" >> $(MODULE_CONF); \
fi

install-fedora:
if ! [ -f $(MODULE_OBJECT) ]; then \
module; \
fi
@echo "install '$(MODULE_OBJECT)' to $(MODULE_ROOT)"
install -m 755 -o 0 -g 0 -d $(MODULE_ROOT)
install -m 644 -o 0 -g 0 $(MODULE_OBJECT) $(MODULE_ROOT)
/sbin/depmod -a

@if ! grep -q 'wlan0' /etc/modprobe.conf; then \
echo "append 'alias wlan0 rt2570' to /etc/modprobe.conf"; \
echo "alias wlan0 rt2570" >> /etc/modprobe.conf; \
echo "options rt2570 ifname=wlan%d" >> /etc/modprobe.conf; \
fi
ifeq ($(PATCHLEVEL), 4)
include $(KERNEL_SOURCES)/Rules.make
endif

Posted by ^thehatsrule^ on Mar. 12 2008,04:47
No, it could work (see PATCHLEVEL 4). It would probably be easier to read the docs though.  Those lines at the start are commented out anyways.
Posted by RobDollar on Mar. 12 2008,15:20
I've loaded the .dsl's gcc-2.95, gcc-with-lib and gnu-utils, using the local extension tool in mydsl (I'm assuming it doesn't matter the order you load them in).

The make command now works, but when I run make install, it says /lib/modules/2.6.12/build folder not found. That build folder seems to exist but not as a folder or file, I'm unsure why it's being displayed in bash & file manager.

Also, I'm doing this in dsl-n as from what I can tell this driver need the 2.6 kernel.

Posted by curaga on Mar. 12 2008,15:35
It's a symbolic link to the directory where the DSL-N kernel was built. You might need the 2.6.12 kernel sources to build that module.
Posted by RobDollar on Mar. 12 2008,18:27
Quote (curaga @ Mar. 12 2008,10:35)
It's a symbolic link to the directory where the DSL-N kernel was built. You might need the 2.6.12 kernel sources to build that module.


So if I get the 2.6.12 source, does that have the directory structure needed, or am I still going to have the same build directory problem?

Posted by curaga on Mar. 12 2008,18:35
It has everything needed - some modules might require you to finish the configuration first though (copy the DSL-N .config to the root of the new dir, type "make menuconfig", and exit without doing anything).

You don't have to extract it where the "build" link points to; just unpack it somewhere with space, it takes about 250mb, and then remove the old link and create a new one (ln -s /path/to/target /lib/modules/2.6.12/build)

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.