VERSION=1_5_0 DATE="April 2004" TESTFILE="" \ "struct { int a,b,c; } test = { .a = 0, .b = 1, .c = 2 }; " \ "static int __attribute__((__section__(\"test_section\"),__aligned__(1))) a = 0; " \ "static int b = 1; " \ "static int __attribute__((__section__(\"test_section\"),__aligned__(1))) c = 2; " \ "int" "main()" "{ return (&c != &(&a)[1]) ? -1 : 0; } " FILTER= grep -v "~" |\ grep -v "\#" |\ grep -v "isdntrace.-........-......"|\ grep -v ".orig" S=/usr/src I4B_FILES=\ ${S}/sys/i386/include/i4b*h \ ${S}/sys/i4b \ ${S}/usr.sbin/i4b \ # #${S}/etc/rc.d/isdnd \ #${S}/etc/rc.isdn \ #${S}/etc/isdn \ #${S}/share/examples/isdn \ #${S}/share/isdn \ #${S}/share/doc/en_US.ISO_8859-1/books/handbook/isdn.html # USB_FILES=\ ${S}/sys/dev/usb/ehci.c \ ${S}/sys/dev/usb/ehci_pci.c \ ${S}/sys/dev/usb/ehcireg.h \ ${S}/sys/dev/usb/ehcivar.h \ ${S}/sys/dev/usb/hid.c \ ${S}/sys/dev/usb/hid.h \ ${S}/sys/dev/usb/ohci.c \ ${S}/sys/dev/usb/ohci_pci.c \ ${S}/sys/dev/usb/ohcireg.h \ ${S}/sys/dev/usb/ohcivar.h \ ${S}/sys/dev/usb/uhci.c \ ${S}/sys/dev/usb/uhci_pci.c \ ${S}/sys/dev/usb/uhcireg.h \ ${S}/sys/dev/usb/uhcivar.h \ ${S}/sys/dev/usb/uhub.c \ ${S}/sys/dev/usb/usb.c \ ${S}/sys/dev/usb/usb.h \ ${S}/sys/dev/usb/usb_if.m \ ${S}/sys/dev/usb/usb_mem.c \ ${S}/sys/dev/usb/usb_mem.h \ ${S}/sys/dev/usb/usb_subr.c \ ${S}/sys/dev/usb/usbdi.c \ ${S}/sys/dev/usb/usbdi.h \ ${S}/sys/dev/usb/usbdi_util.c \ ${S}/sys/dev/usb/usbdi_util.h \ ${S}/sys/dev/usb/usbdivar.h \ ${S}/sys/dev/usb/usbhid.h \ CONFIG_FILES=\ ${S}/sys/conf/files \ ${S}/sys/conf/files.pc98 \ ${S}/sys/conf/files.i386 \ DIFF=new_ihfc_${VERSION}.diff.bz2 DIFF_FILES=\ ${S}/sys/i386/include/bus_at386.h \ \ ${S}/sys/dev/sound/pcm/vchan.c \ ${S}/sys/dev/sound/pcm/channel.c \ ${S}/sys/dev/sound/pcm/channel.h \ ${S}/sys/dev/sound/pcm/dsp.c \ ${S}/sys/dev/sound/isa/sb16.c \ ${S}/sys/dev/sound/isa/sb8.c \ MACHINE=/usr/include/machine MACHINE_FILES=\ ${MACHINE}/i4b*h \ BACKUP=i4b_system_backup_${VERSION}.tar.bz2 BACKUP_FILES=\ ${I4B_FILES} \ ${USB_FILES} \ ${CONFIG_FILES} \ ${DIFF_FILES} \ ${MACHINE_FILES} \ PACKAGE=new_ihfc_${VERSION}.tar.bz2 PACKAGE_FILES=`find \ ${I4B_FILES} \ ${USB_FILES} \ \ | ${FILTER}` FILES_APPEND='\n\ \#\n\ \# ISDN4BSD system-files\n\ \#\n\ i4b_drivers.o standard dependency \"$$S/i4b/layer4/i4b_drivers.awk Makefile\" compile-with \"$${AWK} -f $${.ALLSRC} | $${CC} -c -o $${.TARGET} $${ASM_CFLAGS} $${WERROR} -\" no-implicit-rule clean \"i4b_drivers.o\"\n\ i4b/driver/i4b_trace.c count i4btrc\n\ i4b/driver/i4b_rbch.c count i4brbch\n\ i4b/driver/i4b_tel.c count i4btel\n\ i4b/driver/i4b_ing.c count i4bing\n\ i4b/driver/i4b_ipr.c count i4bipr\n\ i4b/driver/i4b_isppp.c count i4bisppp\n\ i4b/driver/i4b_ctl.c optional i4bctl\n\ net/slcompress.c optional i4bipr i4bisppp\n\ net/if_spppsubr.c optional i4bisppp\n\ i4b/dss1/i4b_l2fsm.c optional i4bdss1 i4b \n\ i4b/layer4/i4b_i4bdrv.c optional i4b\n\ i4b/layer4/i4b_l4.c optional i4b\n\ i4b/layer4/i4b_l4mgmt.c optional i4b\n\ i4b/layer4/i4b_mbuf.c optional i4b\n\ i4b/layer1/i4b_l1.c optional i4b\n\ i4b/layer1/i4b_hdlc.c optional i4b\n\ ' FILES_I386_PC98_APPEND="\n\ \#\n\ \# new_ihfc driver\n\ \#\n\ i4b/layer1/ihfc2/i4b_ihfc2_l1if.c optional new_ihfc i4b\n\ i4b/layer1/ihfc2/i4b_ihfc2_pnp.c optional new_ihfc i4b\n\ i4b/layer1/ihfc2/i4b_ihfc2_drv.c optional new_ihfc i4b\n\ i4b/layer1/ihfc2/i4b_ihfc2_dev.c optional new_ihfc i4b\n\ " CHANNEL_H_APPEND="\n\ void chn_rel(dev_t dev, struct pcm_channel *rdch, struct pcm_channel *wrch, u_int32_t prio);\n\ int chn_get(dev_t dev, struct pcm_channel **rdch, struct pcm_channel **wrch, u_int32_t prio);\n\n" help: @echo "# " @echo "# ISDN4BSD v."${VERSION:C/_/./g}" - "${DATE} @echo "# " @echo "# source directory: "${S} @echo "# backup directory: "`pwd` @echo "# targets: ""help fetch all install deinstall deinstall_usb clean" @echo "# usage: ""make install" @echo "# " @echo "# " @echo "# 1. make sure the following lines are " @echo "# in your kernel configuration file:" @echo "# " @echo "# I4B section" @echo "# " @echo "options IPR_VJ" @echo "device \"i4bdss1\"" @echo "device \"i4b\"" @echo "device \"i4btrc\" 8" @echo "device \"i4bctl\"" @echo "device \"i4brbch\" 8" @echo "device \"i4btel\" 8" @echo "device \"i4bipr\" 8" @echo "device \"i4bisppp\" 8" @echo "" @echo "device new_ihfc" @echo "device pcm" @echo "device usb" @echo "" @echo "#" @echo "# 2. run your kernel configuration script" @echo "#" @echo "# 3. recompile the kernel (remove all *i4b*.o files" @echo "# from the compile directory, \"make clean build\" or " @echo "# just \"make depend all -DNO_MODULES -DNO_CLEAN\" or " @echo "# from \"/usr/src\" just \"make buildkernel KERNCONF=custom " @echo "# -DNO_MODULES -DNO_CLEAN\")" @echo "#" @echo "# 4. make a backup of the old kernel in case" @echo "# it doesn't work." @echo "#" @echo "# 5. reboot" @echo "#" @echo "" @echo "# Troubleshooting" @echo "# you can try:" @echo "# make deinstall_usb" @echo "#" @echo "" cc_test: Makefile # # compiler test # @echo "" @echo "Testing compiler ..." @echo "" @(echo ${TESTFILE} | cc -x c -o cc_test - ) && ./cc_test || @echo "you need to upgrade your 'cc' compiler (see /usr/ports/lang/??)" fetch: fetch http://home.c2i.net/hselasky/isdn4bsd/privat/temporary/${DIFF} fetch http://home.c2i.net/hselasky/isdn4bsd/privat/temporary/${PACKAGE} backup: # # make backup _once_ # @echo "" @echo "Collecting files and information ..." @echo "Installing to: "${S} @echo "" @echo "Please write down this location:" @echo `pwd`"/kernel" @echo "" @sleep 10 .if !exists(${BACKUP}.dont.remove) cp -rv /boot/kernel/kernel . cd ${S}/usr.sbin/i4b; make clean tar -jcvf ${BACKUP} -C/ ${BACKUP_FILES} @touch ${BACKUP}.dont.remove .endif update_pcm: cat ${S}/sys/dev/sound/pcm/dsp.c | \ sed -e s/relchns/chn_rel/g -e s/getchns/chn_get/g > pcm.temp cat pcm.temp > ${S}/sys/dev/sound/pcm/dsp.c cat ${S}/sys/dev/sound/pcm/channel.h | grep -v " chn_rel(" | grep -v " chn_get(" > pcm.temp { cat pcm.temp; printf ${CHANNEL_H_APPEND}; } > ${S}/sys/dev/sound/pcm/channel.h update_conf: # # update configuration # # cleanup .for FILE in ${CONFIG_FILES} cat ${FILE} | grep -v "i4b" > files.temp cat files.temp > ${FILE} .endfor # update printf ${FILES_APPEND} >> ${S}/sys/conf/files printf ${FILES_I386_PC98_APPEND} >> ${S}/sys/conf/files.pc98 printf ${FILES_I386_PC98_APPEND} >> ${S}/sys/conf/files.i386 all: build: install: help backup cc_test update_conf update_pcm ${DIFF} ${PACKAGE} # cleanup rm -f -rv ${I4B_FILES} ${USB_FILES} ${MACHINE_FILES} # install tar -jxvf ${PACKAGE} -C${S} # patch bzcat ${DIFF} | patch -d ${S} # update machine cp -rv ${S}/sys/i386/include/i4b*h ${MACHINE}/ # install cd ${S}/usr.sbin/i4b; make cleandepend clean depend all install man new_ihfc deinstall_usb: ${BACKUP} rm -f -rv ${USB_FILES} tar -jxvf ${BACKUP} -C/ ${USB_FILES:C/${S}/"*"/} deinstall: ${BACKUP} rm -f -rv ${I4B_FILES} ${USB_FILES} ${MACHINE_FILES} tar -jxvf ${BACKUP} -C/ # # make sure a new backup is made at next # install # rm -f ${BACKUP}.dont.remove clean: rm -f cc_test files.temp diffs.temp #${DIFF} ${PACKAGE} diffs: rm -f diffs.temp .for FILE in ${DIFF_FILES:C/${S}\///} @(( cd ${S}; diff -b -cr ${FILE}.ref ${FILE} ) || echo -n ) >> diffs.temp .endfor package: diffs cd ${S}/usr.sbin/i4b; make clean bzip2 -c diffs.temp > ${DIFF} (cd ${S}; tar --norecurse -jcvf - ${PACKAGE_FILES:C/${S}\///} ) > ${PACKAGE} list_files: cd ${S}; ls -l ${PACKAGE_FILES:C/${S}\///} uninstall: deinstall #-HPS