[zaptel-commits] tzafrir: branch tzafrir/kernelmove r2172 - in
/team/tzafrir/kernelmove: ./ fi...
zaptel-commits at lists.digium.com
zaptel-commits at lists.digium.com
Sat Feb 17 11:16:27 MST 2007
Author: tzafrir
Date: Sat Feb 17 12:16:26 2007
New Revision: 2172
URL: http://svn.digium.com/view/zaptel?view=rev&rev=2172
Log:
kernel 2.4 building basically works now.
Added the ability to include subdirectories and such.
The firmware needs to be sorted out to build 2.4, though.
Added:
team/tzafrir/kernelmove/firmware/Makefile.linux24 (with props)
team/tzafrir/kernelmove/kernel/Makefile.octasic (with props)
team/tzafrir/kernelmove/kernel/makefile (with props)
team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24 (with props)
team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24 (with props)
Modified:
team/tzafrir/kernelmove/Makefile
team/tzafrir/kernelmove/TODO
Modified: team/tzafrir/kernelmove/Makefile
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove/Makefile?view=diff&rev=2172&r1=2171&r2=2172
==============================================================================
--- team/tzafrir/kernelmove/Makefile (original)
+++ team/tzafrir/kernelmove/Makefile Sat Feb 17 12:16:26 2007
@@ -188,7 +188,9 @@
modules: $(BUILDVER)
-linux24: prereq $(MODULESO) wct4xxp/wct4xxp.o
+#$(MODULESO) wct4xxp/wct4xxp.o
+linux24: prereq
+ make -C kernel #HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE) CFLAGS= #MODULES=$(MODULES) KSRC=$(KSRC) KVERS=$(KVERS) UNAME_M=$(UNAME_M)
linux26: prereq
@if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi
@@ -229,9 +231,9 @@
ztdummy.o: ztdummy.h
-$(MODULESO): %.o: %.c zaptel.h
- $(CC) $(KFLAGS) -o $@ -c $<
-
+#REM# $(MODULESO): %.o: %.c zaptel.h
+#REM# $(CC) $(KFLAGS) -o $@ -c $<
+#REM#
tor2ee.o: tor2-hw.h
tor2ee: LDLIBS+=-lpci
@@ -485,9 +487,7 @@
ifeq ($(BUILDVER),linux26)
$(KMAKE) clean
else
- $(MAKE) -C wct4xxp clean
- $(MAKE) -C ztcodec_dte clean
- $(MAKE) -C datamods clean
+ $(MAKE) -C kernel clean
endif
$(MAKE) -C firmware clean
rm -f xpp/*.ko xpp/*.mod.c xpp/.*o.cmd
Modified: team/tzafrir/kernelmove/TODO
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove/TODO?view=diff&rev=2172&r1=2171&r2=2172
==============================================================================
--- team/tzafrir/kernelmove/TODO (original)
+++ team/tzafrir/kernelmove/TODO Sat Feb 17 12:16:26 2007
@@ -1,10 +1,11 @@
Status of the branch:
-kernel 2.6 build basically getting close to work.
+* Kernel 2.6 builds
+* Kernel 2.4 basically builds (firmware building doesn't work)
TODO:
* Fix building the datamod dir(?)
-* kernel 2.4 .
+* firmwares: who's responsoble for them? Needs some rewrite.
* "Kbuild" is not good for some older 2.6 kernels. (Makefile/makefile?)
* How do we provide version.h to kernel dir?
* How do we provide zaptel.h to userspace?
Added: team/tzafrir/kernelmove/firmware/Makefile.linux24
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove/firmware/Makefile.linux24?view=auto&rev=2172
==============================================================================
--- team/tzafrir/kernelmove/firmware/Makefile.linux24 (added)
+++ team/tzafrir/kernelmove/firmware/Makefile.linux24 Sat Feb 17 12:16:26 2007
@@ -1,0 +1,110 @@
+#
+# Asterisk -- A telephony toolkit for Linux.
+#
+# Makefile for firmware downloading/installation
+#
+# Copyright (C) 2007, Digium, Inc.
+#
+# Joshua Colp <jcolp at digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+.PHONY: dist-clean all uninstall have_download install
+
+-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/makeopts
+
+PWD:=$(shell pwd)
+
+OCT6114_064_VERSION:=1.05.01
+OCT6114_128_VERSION:=1.05.01
+TC400M_VERSION:=MR5.6
+
+FIRMWARE_URL:=http://ftp.digium.com/pub/telephony/firmware/releases
+
+# Firmware files should use the naming convention: zaptel-fw-<base name>-<sub name>-<version> or zaptel-fw-<base name>-<version>
+# First example: zaptel-fw-oct6114-064-1.05.01
+# This means this is version 1.05.01 of the oct6114 64 firmware
+# Second example: zaptel-fw-tc400m-MR5.6
+# This means this is version MR5.6 of the tc400m firmware
+
+# Build a list of firmware package filenames we need
+FIRMWARE:=$(MENUSELECT_FIRMWARE:FIRMWARE-OCT6114-064=zaptel-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-OCT6114-128=zaptel-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-TC400M=zaptel-fw-tc400m-$(TC400M_VERSION).tar.gz)
+
+# Build a list of object files if hotplug will not be used
+OBJECT_FILES:=$(MENUSELECT_FIRMWARE:FIRMWARE-OCT6114-064=zaptel-fw-oct6114-064.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-128=zaptel-fw-oct6114-128.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-TC400M=zaptel-fw-tc400m.o)
+
+# If "fetch" is used, --continue is not a valid option.
+ifeq ($(WGET),wget)
+WGET_ARGS:=--continue
+endif
+
+all: $(FIRMWARE)
+
+have_download:
+ @if test "$(DOWNLOAD)" = ":" ; then \
+ echo "**************************************************"; \
+ echo "*** ***"; \
+ echo "*** You must have either wget or fetch to be ***"; \
+ echo "*** able to automatically download and install ***"; \
+ echo "*** the requested firmware packages. ***"; \
+ echo "*** ***"; \
+ echo "**************************************************"; \
+ exit 1; \
+ fi
+
+# Download and extract firmware tarball
+zaptel-fw-%.tar.gz: have_download
+ @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+ if test ! -f $@; then exit 1; fi; \
+ (cat $@ | gzip -d | tar -xf -)
+
+# Clean up any downloaded/extracted firmware packages
+dist-clean: clean
+ rm -f zaptel-fw-*.bin
+ rm -f zaptel-fw-*.tar.gz
+
+# Clean up anything we built
+clean:
+ rm -f zaptel-fw-*.o
+
+# Create object files suitable for linking against
+object-build: $(FIRMWARE) $(OBJECT_FILES)
+
+# Install all downloaded firmware images for hotplug usage and build headers for inclusion
+hotplug-install: $(FIRMWARE)
+ifneq (,$(FIRMWARE))
+ if [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-*.bin $(INSTALL_PREFIX)/usr/lib/hotplug/firmware; \
+ fi
+ if [ -d $(INSTALL_PREFIX)/lib/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-*.bin $(INSTALL_PREFIX)/lib/firmware; \
+ fi
+endif
+
+# Uninstall any installed zaptel firmware images from hotplug firmware directories
+hotplug-uninstall:
+ if [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ]; then \
+ rm -f $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/zaptel-fw-*.bin; \
+ fi
+ if [ -d $(INSTALL_PREFIX)/lib/firmware ]; then \
+ rm -f $(INSTALL_PREFIX)/lib/firmware/zaptel-fw-*.bin; \
+ fi
+
+# Build object file of an oct6114 064 firmware image for linking
+zaptel-fw-oct6114-064.o: zaptel-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz ../wct4xxp/base.o zaptel-fw-oct6114-064.bin
+ @echo Making firmware object file for zaptel-fw-oct6114-064.bin
+ ../build_tools/make_firmware_object zaptel-fw-oct6114-064.bin $@ ../wct4xxp/base.o
+
+# Build object file of an oct6114 128 firmware image for linking
+zaptel-fw-oct6114-128.o: zaptel-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz ../wct4xxp/base.o zaptel-fw-oct6114-128.bin
+ @echo Making firmware object file for zaptel-fw-oct6114-128.bin
+ ../build_tools/make_firmware_object zaptel-fw-oct6114-128.bin $@ ../wct4xxp/base.o
+
+# Build object file of a TC400M firmware image for linking
+zaptel-fw-tc400m.o:
Propchange: team/tzafrir/kernelmove/firmware/Makefile.linux24
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove/firmware/Makefile.linux24
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove/firmware/Makefile.linux24
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/tzafrir/kernelmove/kernel/Makefile.octasic
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove/kernel/Makefile.octasic?view=auto&rev=2172
==============================================================================
--- team/tzafrir/kernelmove/kernel/Makefile.octasic (added)
+++ team/tzafrir/kernelmove/kernel/Makefile.octasic Sat Feb 17 12:16:26 2007
@@ -1,0 +1,13 @@
+# Kernel 2.4 included Makefile
+#
+
+SUBDIR := oct612x
+
+OCTASIC_OBJS := $(shell oct612x/octasic-helper objects oct612x)
+OCTASIC_CFLAGS := $(shell oct612x/octasic-helper cflags oct612x) -Wno-undef
+
+MODS_MINOR := $(shell echo $(OCTASIC_OBJS) | sed -e 's/\.o\>//g')
+
+CLEAN_FILES += $(OCTASIC_OBJS)
+
+$(OCTASIC_OBJS): KFLAGS += $(OCTASIC_CFLAGS)
Propchange: team/tzafrir/kernelmove/kernel/Makefile.octasic
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove/kernel/Makefile.octasic
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove/kernel/Makefile.octasic
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/tzafrir/kernelmove/kernel/makefile
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove/kernel/makefile?view=auto&rev=2172
==============================================================================
--- team/tzafrir/kernelmove/kernel/makefile (added)
+++ team/tzafrir/kernelmove/kernel/makefile Sat Feb 17 12:16:26 2007
@@ -1,0 +1,97 @@
+# kernel/makefile: the makefile for building kernel 2.4's modules.
+#
+# It hould provide similar "interface" to the kernel 2.6 Kbuild system.
+#
+# Information passed from parent makefile:
+# MODULES: A list of target modules (without prefix of .o.
+# ZAP_SUBDIRS: A list of subdirectories to build.
+# KSRC: Path to kernel source tree.
+# KVERS: Target Kernel Version. (TODO: what about autoconf?)
+# UNAME_M: Target machine name (TODO: what about autoconf?)
+#
+
+KINCLUDES:=$(KSRC)/include
+KFLAGS=-I$(KINCLUDES) -O2
+#KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \
+# -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I$(KSRC)/drivers/net/wan -I$(KINCLUDES)/net
+KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB
+KFLAGS+=-Wall -I.
+KFLAGS+=-Wstrict-prototypes -fomit-frame-pointer
+KFLAGS+=-DSTANDALONE_ZAPATA
+# TODO: when exactly should I include this?
+KFLAGS+=-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h
+
+# I suspect that the following is either not necessary,
+# or should be added everywhere:
+#ifneq (,$(findstring ppc,$(UNAME_M)))
+#KFLAGS_PPC:=-msoft-float -fsigned-char
+#endif
+#KFLAGS+=$(KFLAGS_PPC)
+
+HOSTPROGS := gendigits makefw
+
+KGCC = $(CC) $(KFLAGS)
+
+ifneq (,$(findstring x86_64,$(UNAME_M)))
+ KFLAGS+=-mcmodel=kernel
+endif
+
+SUBDIR_INC := $(ZAP_SUBDIRS:%=%/Makefile.linux24)
+MODULESO := $(MODULES:%=%.o)
+TARGETS := $(MODULESO)
+MODS_MINOR :=
+
+CLEAN_FILES := *.o
+
+all: modules
+
+include Makefile.octasic
+include $(wildcard $(SUBDIR_INC))
+
+MODS := $(MODULESO) $(MODS_MINOR:%=%.o)
+
+modules: $(TARGETS)
+ @echo TARGETS=$(TARGETS)
+
+tor2.o: tor2-hw.h tor2fw.h
+
+zaptel.o: digits.h arith.h sec.h mec.h sec-2.h mec2.h mec3.h zconfig.h
+
+wcusb.o: wcusb.h
+
+wcfxsusb.o: wcfxsusb.h
+
+wctdm.o: wctdm.h
+
+wctdm24xxp.o: wctdm.h
+
+pciradio.o: radfw.h
+
+ztdummy.o: ztdummy.h
+
+$(MODS): %.o: %.c zaptel.h zconfig.h version.h
+ @echo now building target $@:
+ $(CC) $(KFLAGS) -o $@ -c $<
+
+# hack: let's assume that we will always need to build subdir/subdir.ko
+$(ZAP_SUBDIRS):
+
+gendigits: LDFLAGS+=-lm
+
+$(HOSTPROGS): %: %.c
+ $(HOSTCC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+zaptel.o: tones.h
+
+tones.h: gendigits
+ ./$^ > $@
+
+tor2fw.h: tormenta2.rbt makefw
+ ./makefw $< tor2fw > $@
+
+radfw.h: pciradio.rbt makefw
+ ./makefw $< radfw > $@
+
+clean:
+ rm -f $(CLEAN_FILES)
+
Propchange: team/tzafrir/kernelmove/kernel/makefile
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove/kernel/makefile
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove/kernel/makefile
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24?view=auto&rev=2172
==============================================================================
--- team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24 (added)
+++ team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24 Sat Feb 17 12:16:26 2007
@@ -1,0 +1,20 @@
+# Kernel 2.4 included Makefile
+#
+
+SUBDIR := wct4xxp
+
+MODS_MINOR += $(SUBDIR)/base
+MODS_MINOR += $(SUBDIR)/vpm450m
+
+TARGETS += $(SUBDIR)/$(SUBDIR).o
+CLEAN_FILES += $(SUBDIR)/*.o
+
+$(SUBDIR)/base.o: $(SUBDIR)/vpm450m.h $(SUBDIR)/wct4xxp.h
+
+$(SUBDIR)/vpm450m.o: $(SUBDIR)/vpm450m.h oct612x/include/oct6100api/oct6100_api.h
+$(SUBDIR)/vpm450m.o: KFLAGS += $(OCTASIC_CFLAGS) -Ioct612x/include
+
+$(SUBDIR)/wct4xxp.o: $(SUBDIR)/base.o $(SUBDIR)/vpm450m.o $(OCTASIC_OBJS) \
+ ../firmware/zaptel-fw-oct6114-064.o ../firmware/zaptel-fw-oct6114-128.o
+ $(LD) -r -o $@ $^
+
Propchange: team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove/kernel/wct4xxp/Makefile.linux24
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24?view=auto&rev=2172
==============================================================================
--- team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24 (added)
+++ team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24 Sat Feb 17 12:16:26 2007
@@ -1,0 +1,19 @@
+# Kernel 2.4 included Makefile
+#
+
+SUBDIR := ztcodec_dte
+
+MODS_MINOR += $(SUBDIR)/base
+
+# It seems ztcodec cannot be built with kernel 2.4 . So disabling it for now.
+ifeq (,)
+TARGETS += $(SUBDIR)/$(SUBDIR).o
+endif
+CLEAN_FILES += $(SUBDIR)/*.o
+
+$(SUBDIR)/firmware_dte.o: $(SUBDIR)/dte_firm.bin $(SUBDIR)/base.o
+ @echo Making firmware object file for $<
+ ../build_tools/make_firmware_object $< $@ $(SUBDIR)/base.o
+
+$(SUBDIR)/ztcodec_dte.o: $(SUBDIR)/base.o $(SUBDIR)/firmware_dte.o
+ $(LD) -r -o $@ $^
Propchange: team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove/kernel/ztcodec_dte/Makefile.linux24
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the zaptel-commits
mailing list