howtos:npreal2_driver_for_moxa_serial_devices
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | howtos:npreal2_driver_for_moxa_serial_devices [02/12/2018 21:34] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== npreal2.spec ===== | ||
+ | |||
+ | < | ||
+ | # This is a spec file for the MOXA Linux Real TTY Driver | ||
+ | |||
+ | %define kernel 2.6.18-194.8.1.el5 | ||
+ | %define _topdir / | ||
+ | %define name npreal2 | ||
+ | %define release 2.6.18_194.8.1.el5 | ||
+ | %define version 1.16 | ||
+ | %define buildroot %{_topdir}/ | ||
+ | %define NPPATH / | ||
+ | %define driverPath %{NPPATH}/ | ||
+ | %define Moxa_config %{driverPath}/ | ||
+ | %define MXLOADSVR %{driverPath}/ | ||
+ | |||
+ | BuildRoot: | ||
+ | Summary: MOXA Linux Real TTY Driver | ||
+ | License: Unknown | ||
+ | Packager: | ||
+ | Name: %{name} | ||
+ | Version: %{version} | ||
+ | Release: %{release} | ||
+ | Source: %{name}-%{version}.tar.gz | ||
+ | Prefix: /usr | ||
+ | Group: System/ | ||
+ | |||
+ | %description | ||
+ | The purpose of this driver is to map NPort serial port to host tty port. Using this driver, you can use NPort serial port as local tty port. | ||
+ | |||
+ | %prep | ||
+ | %setup -q | ||
+ | rm -rf %{buildroot} | ||
+ | mkdir -p %{buildroot} | ||
+ | |||
+ | |||
+ | %build | ||
+ | NPPATH="/ | ||
+ | driverPath="/ | ||
+ | make SP1 PATH1=$(pwd) | ||
+ | |||
+ | %install | ||
+ | |||
+ | NowPath=$(pwd) | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | |||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | # Refresh modules | ||
+ | depmod -a | ||
+ | |||
+ | %post | ||
+ | |||
+ | if [ -f / | ||
+ | then | ||
+ | echo " | ||
+ | cp %{Moxa_config} / | ||
+ | echo " | ||
+ | fi | ||
+ | |||
+ | %preun | ||
+ | cd %{driverPath} | ||
+ | for moxabox in $(cat %{driverPath}/ | ||
+ | ./mxdelsvr $moxabox | ||
+ | done | ||
+ | %postun | ||
+ | cat / | ||
+ | cat / | ||
+ | rm / | ||
+ | |||
+ | %files | ||
+ | %defattr(-, | ||
+ | |||
+ | / | ||
+ | / | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{NPPATH}/ | ||
+ | %{NPPATH}/ | ||
+ | %{NPPATH}/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== OLD npreal2.spec ===== | ||
+ | |||
+ | < | ||
+ | # This is a spec file for the MOXA Linux Real TTY Driver | ||
+ | %define kernel 2.6.18-164.11.1.el5 | ||
+ | %define _topdir / | ||
+ | %define name npreal2 | ||
+ | %define release 1 | ||
+ | %define version 1.16 | ||
+ | %define buildroot %{_topdir}/ | ||
+ | %define NPPATH / | ||
+ | %define driverPath / | ||
+ | |||
+ | BuildRoot: | ||
+ | Summary: MOXA Linux Real TTY Driver | ||
+ | License: Unknown | ||
+ | Packager: | ||
+ | Name: %{name} | ||
+ | Version: %{version} | ||
+ | Release: %{release} | ||
+ | Source: %{name}-%{version}.tar.gz | ||
+ | Prefix: /usr | ||
+ | Group: System/ | ||
+ | |||
+ | %description | ||
+ | The purpose of this driver is to map NPort serial port to host tty port. Using this driver, you can use NPort serial port as local tty port. | ||
+ | |||
+ | %prep | ||
+ | %setup -q | ||
+ | rm -rf %{buildroot} | ||
+ | mkdir %{buildroot} | ||
+ | |||
+ | |||
+ | %build | ||
+ | NPPATH="/ | ||
+ | driverPath="/ | ||
+ | make SP1 PATH1=$(pwd) | ||
+ | |||
+ | %install | ||
+ | |||
+ | NowPath=$(pwd) | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | mkdir -p %{buildroot}/ | ||
+ | |||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | cp -f $NowPath/ | ||
+ | |||
+ | %post | ||
+ | function error_occured { | ||
+ | echo " | ||
+ | ERROR OCCURRED!! | ||
+ | The driver could not be loaded. | ||
+ | Your kernel version is: `uname -r` | ||
+ | This package is build for: %{kernel} | ||
+ | Last 10 lines from kernel output: | ||
+ | ------------------------------------- | ||
+ | " | ||
+ | dmesg|tail -n 10 | ||
+ | exit | ||
+ | } | ||
+ | |||
+ | if [ -f / | ||
+ | then | ||
+ | kill -9 `ps aux|grep npreal2d|awk ' | ||
+ | lsmod | grep npreal2 | awk '$0 != "" | ||
+ | if [ $? -eq 0 ] | ||
+ | then | ||
+ | modprobe npreal2 | ||
+ | depmod -a | ||
+ | else | ||
+ | error_occured | ||
+ | fi | ||
+ | if [ $? -eq 0 ] | ||
+ | then | ||
+ | echo " | ||
+ | exit 0 | ||
+ | else | ||
+ | error_occured | ||
+ | fi | ||
+ | |||
+ | else | ||
+ | echo " | ||
+ | =============================================================================== | ||
+ | Installation process is completed. | ||
+ | The driver files are installed in / | ||
+ | Now you can "cd / | ||
+ | =============================================================================== | ||
+ | " | ||
+ | fi | ||
+ | |||
+ | %preun | ||
+ | cd %{driverPath} | ||
+ | for moxabox in $(cat %{driverPath}/ | ||
+ | ./mxdelsvr $moxabox | ||
+ | done | ||
+ | %postun | ||
+ | cat / | ||
+ | cat / | ||
+ | rm / | ||
+ | |||
+ | %files | ||
+ | %defattr(-, | ||
+ | |||
+ | / | ||
+ | / | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{driverPath}/ | ||
+ | %{NPPATH}/ | ||
+ | %{NPPATH}/ | ||
+ | %{NPPATH}/ | ||
+ | </ | ||
howtos/npreal2_driver_for_moxa_serial_devices.txt · Last modified: 02/12/2018 21:34 by 127.0.0.1