[SCRIPT] for creating martian_modem(Agere LT Modem) module

Post tutorials, HOWTO's and other useful resources here.
Post Reply
Tonio
Contributor
Contributor
Posts: 266
Joined: 28 Dec 2010, 16:37
Distribution: Slackware,porteus,FreeBSD,Slax
Location: 127.0.0.1

[SCRIPT] for creating martian_modem(Agere LT Modem) module

Post#1 by Tonio » 28 Dec 2010, 20:14

Copy + paste code below & save to to text editor. Save it as martian.slaxbuild, then make it executable,

Code: Select all

chmod +x martian.slaxbuild
run it

Code: Select all

./martian.slaxbuild
and it should produce a martian-full-20100123.sq4.lzm module for martian modem. Forgot to mention, get source from linmodems web site http://linmodems.technion.ac.il/package ... 6/martian/

Code: Select all

#!/bin/bash

PKG=martian-full-20100123
TMP=/tmp/martian$$
# uncomment if you want wget to download source
# wget http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/martian/martian-full-20100123.tar.gz

#set -e

tar -zxvf $PKG*
mkdir -p $TMP/etc/rc.d/
cd $PKG/scripts/
sed -i '25 s|DEVICE="/dev/ttySM0"|DEVICE="/dev/modem"|g' martian
sed -i '25 a /sbin/depmod -a\' martian
sed -i '26 a sleep 3\' martian
sed -i '27 a /sbin/modprobe martian_dev' martian
#sed -i '28 s|echo "kernel module is not loaded!"|/sbin/modprobe martian_dev|g' martian
cp martian $TMP/etc/rc.d/rc.martian
chmod +x $TMP/etc/rc.d/rc.martian
cd ../
#cd $PKG
make all
make install

mkdir -p $TMP/lib/modules/`uname -r`/extra/
cp -ra /lib/modules/`uname -r`/extra/martian_dev.ko $TMP/lib/modules/`uname -r`/extra/
mkdir -p $TMP/usr/sbin/
cp -ra /usr/sbin/martian_modem $TMP/usr/sbin/
mkdir -p $TMP/usr/lib/debug/usr/sbin/
cp -ra /usr/lib/debug/usr/sbin/martian_modem.debug $TMP/usr/lib/debug/usr/sbin/

rm -rf /lib/modules/`uname -r`/extra/martian_dev.ko

# copy build script
cd ..
mkdir -p $TMP/usr/src/slaxbuilds/
cp $0 $TMP/usr/src/slaxbuilds/
find $TMP -type d | xargs chmod -v 755
find $TMP | grep .gz | xargs gunzip
find $TMP | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded

dir2lzm $TMP $PKG.sq4.lzm
rm -Rf $TMP
rm -Rf $PKG
chmod 755 $PKG.sq4.lzm

Tonio
Contributor
Contributor
Posts: 266
Joined: 28 Dec 2010, 16:37
Distribution: Slackware,porteus,FreeBSD,Slax
Location: 127.0.0.1

Re: [SCRIPT] for creating martian_modem(Agere LT Modem) modu

Post#2 by Tonio » 03 Jul 2011, 01:39

new change. now need to be named martian.pbuild, code attached:

New pbuild found here by Ahau (King of DOCS) with more precise directions:
http://porteus.org/info/docs/49-interne ... odule.html

Code: Select all

root@porteus:~/Downloads# cat martian.pbuild
#!/bin/bash

PKG=martian-full-20100123
TMP=/tmp/martian$
# uncomment if you want wget to download source
# wget http://linmodems.technion.ac.il/package ... 123.tar.gz

#set -e

tar -zxvf $PKG*
mkdir -p $TMP/etc/rc.d/
cd $PKG/scripts/
sed -i '25 s|DEVICE="/dev/ttySM0"|DEVICE="/dev/modem"|g' martian
sed -i '25 a /sbin/depmod -a\' martian
sed -i '26 a sleep 3\' martian
sed -i '27 a /sbin/modprobe martian_dev' martian
#sed -i '28 s|echo "kernel module is not loaded!"|/sbin/modprobe martian_dev|g' martian
cp martian $TMP/etc/rc.d/rc.martian
chmod +x $TMP/etc/rc.d/rc.martian
cd ../
#cd $PKG
make all
make install

mkdir -p $TMP/lib/modules/`uname -r`/extra/
cp -ra /lib/modules/`uname -r`/extra/martian_dev.ko $TMP/lib/modules/`uname -r`/extra/
mkdir -p $TMP/usr/sbin/
cp -ra /usr/sbin/martian_modem $TMP/usr/sbin/
mkdir -p $TMP/usr/lib/debug/usr/sbin/
cp -ra /usr/lib/debug/usr/sbin/martian_modem.debug $TMP/usr/lib/debug/usr/sbin/

rm -rf /lib/modules/`uname -r`/extra/martian_dev.ko

# copy build script
cd ..
mkdir -p $TMP/usr/src/pbuilds/
cp $0 $TMP/usr/src/pbuilds/
find $TMP -type d | xargs chmod -v 755
find $TMP | grep .gz | xargs gunzip
find $TMP | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded

dir2xzm $TMP $PKG.xzm
rm -Rf $TMP
rm -Rf $PKG

Post Reply