LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-06-2004, 09:06 PM   #1
tribeaffeldt
LQ Newbie
 
Registered: May 2004
Location: Madras, OR
Distribution: Fedora Core 6
Posts: 6

Rep: Reputation: 0
symlink to modem


I have to create a symbolic link to my modem every time I reboot. The modem is a USR 5610B and was not detected when first intalled, but USR support got me up and running using setserial and:

[root@localhost tribeaffeldt]# rm /dev/modem
rm: remove symbolic link `/dev/modem'? y
[root@localhost tribeaffeldt]# ln -s /dev/ttyS4 /dev/modem

Is there a way to either tell linux to remember this symlink or incorporate this script into startup text?

I am running Mandrake 9.2, with KDE 3.1.3, kernel 2.4.22. Here is my lspci:

[tribeaffeldt@localhost tribeaffeldt]$ lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8377 [KT400 AGP] Host Bridge
00:01.0 PCI bridge: VIA Technologies, Inc. VT8235 PCI Bridge
00:0f.0 Serial controller: 5610 56K FaxModem 56K FaxModem Model 5610 (rev 01)
00:10.0 USB Controller: VIA Technologies, Inc. USB (rev 80)
00:10.1 USB Controller: VIA Technologies, Inc. USB (rev 80)
00:10.2 USB Controller: VIA Technologies, Inc. USB (rev 80)
00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge
00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE (rev 06)
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235 AC97 Audio Controller (rev 50)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R250 If [Radeon 9000] (rev 01)
01:00.1 Display controller: ATI Technologies Inc Radeon R250 [Radeon 9000] (Secondary) (rev 01)

I am a newbie, so please be gentle.

Thank you,
Richard
 
Old 06-06-2004, 09:26 PM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Put your setserial command in /etc/rc.d/rc.local, the last script that is run at bootup.

# Mandrake links
Mandrake home page
Mandrake Users website
Software management configuration: Easy urpmi config for Mandrake
Software management: urpmi mini-HOWTO
Software management: All You Ever Wanted to Know About Urpmi But Never Dared Asking Before
You didn't install the developmental packages? As root, command:
urpmi gcc
An Introduction to the Midnight Commander. You can install it by commanding:
urpmi mc
Midnight Commander home page

Last edited by fancypiper; 06-08-2004 at 08:36 AM.
 
Old 06-07-2004, 11:12 PM   #3
tribeaffeldt
LQ Newbie
 
Registered: May 2004
Location: Madras, OR
Distribution: Fedora Core 6
Posts: 6

Original Poster
Rep: Reputation: 0
I need a few specifics on how to do that. I don't really know how to use setserial. Here is what I tried to do.

[tribeaffeldt@localhost tribeaffeldt]$ ls /etc/rc.d
init.d/ rc0.d/ rc2.d/ rc4.d/ rc6.d/ rc.modules*
rc* rc1.d/ rc3.d/ rc5.d/ rc.local* rc.sysinit*
[tribeaffeldt@localhost tribeaffeldt]$ ls rc.local*
ls: rc.local*: No such file or directory
[tribeaffeldt@localhost tribeaffeldt]$ ls rc.local
ls: rc.local: No such file or directory

The file you are talking about is here, but I can't look at it. Even if I could I'm not sure what I would need to do next. Is this something I open with vi editor? Will the command I insert be 'ln -s /dev/ttyS4 /dev/modem' or will it be more like 'setserial /dev/ttyS4 irq 10 port 0xb800'? Am I asking dumb questions?

Thanks,
Richard

P.S. I admire your bagpipes.
 
Old 06-08-2004, 08:42 AM   #4
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
I just wish I could play them better! Sorry for posting Red Hat links rather than Mandrake. I changed my previous post to reflect that, so re-check my previous post.

First gain root privilages from your user account by opening an x terminal and giving these commands, using roots password:[code]Tue Jun 08 09:46 AM fancy@uilleann ~ $ su -
Password:
Tue Jun 08 09:47 AM root@uilleann ~ #[code]Now launch your favorite editor from that terminal and open /etc/rc.d/rc.local and add your needed setserial statement.

What text editor is your favorite? Any text editor run as root will allow you to do the job. My favorite command line editor comes with Midnight Commander, mcedit. It is much easier to use than vi. See my above post on installing it with urpmi mc. My file for an example:
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
                                                                                                                             
touch /var/lock/subsys/local
# Configure my modem with info from cat /proc/pci
setserial /dev/ttyS2 irq 11 port 0xd400 uart 16550a
Replace my setserial line with the line you need.

Save the altered file, then use the root terminal to creat the symbolic link to the proper device. From the info you gave you need:

ln -s /dev/ttyS4 /dev/modem

Or, you could skip the symbolic link and change /dev/modem to /dev/ttyS4 in your connection config. Either should work.


Last edited by fancypiper; 06-08-2004 at 08:58 AM.
 
Old 06-09-2004, 11:13 PM   #5
tribeaffeldt
LQ Newbie
 
Registered: May 2004
Location: Madras, OR
Distribution: Fedora Core 6
Posts: 6

Original Poster
Rep: Reputation: 0
OK, I changed /etc/rc.d/rc.local as indicated below.

touch /var/lock/subsys/local
# Configure my modem with info from cat /proc/pci
setserial /dev/ttyS4 irq 10 port 0xb800 uart 16550a

Then I created the symbolic link like I have been doing.

[root@localhost tribeaffeldt]# ln -s /dev/ttyS4 /dev/modem
ln: `/dev/modem': File exists
[root@localhost tribeaffeldt]# rm /dev/modem
rm: remove symbolic link `/dev/modem'? y
[root@localhost tribeaffeldt]# ln -s /dev/ttyS4 /dev/modem

Which gets the modem working properly, but nothing has changed. I still have to recreate the symlink after rebooting.

I also tried to change the modem configuration through kppp and there is no ttyS4 to select, it stops at ttyS3.

There are three things that I'm unsure of at this stage of the game:
1. What did we accomplish by adding the setserial command to this file?
2. What is the 'uart 16550a' at the end of this command? I copied this from your example, but I don't know if it needs be different for me.
3. What next? Do I need to find the run level the modem configuration is in and change the script?

Kind regards,
Richard

P.S. I have some friends in Greenville, SC. It looks like thats not too far from Sparta. What really amazed me was how many Greenvilles there are in SC, NC and VA.
 
Old 06-10-2004, 05:51 AM   #6
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
1. That will eliminate the need to manually configure the modem by giving the setserial command automatically upon boot if you need it.

2. My uart is a real 16550a chip in my modem (a real modem rather than a winmodem), so I needed to put the info for my modem into /etc/rc.d/rc.local

The documention that comes with your modem driver (or found on their home page or forum) should tell you what you need. You may not even need that statement as I haven't read the documention for your winmodem (it's your modem after all, so that's your job). I decided that real hardware was much easier to use, configure, and is more reliable to boot, so I bought a real one and put the winmodem into file 13, the circular file.

3. I don't know. Personally, I would try to find the script that changes the symbolic link from pointing to /dev/ttyS4 to whatever it points to on boot (ls -al | less should show what it points to) and disable it, but as a newbie, it would probably be easier to add this line (after your modem statement in your /etc/rc.d/rc.local file if needed):
Code:
ln -sf /dev/ttyS4 /dev/modem
This will force the creation of the proper symbolic link after configuring the modem (if neederd in your case) automatically upon boot.

Mandrake (and Red Hat/Fedora) seems harder (to me) to configure because of thier strange scripts that change your manually configured stuff around without you wanting it to, similar to the expensive OS. That is one reason I use Gentoo.

If I have something mis configured, it only shows up once a month when I boot into Windows to check for updates, then re-boot into Linux. I just turn off my monitor and leave the box running all the time.

Last edited by fancypiper; 06-10-2004 at 06:11 AM.
 
Old 06-13-2004, 01:31 AM   #7
tribeaffeldt
LQ Newbie
 
Registered: May 2004
Location: Madras, OR
Distribution: Fedora Core 6
Posts: 6

Original Poster
Rep: Reputation: 0
Talking that solved it!!!

Adding the 'f' was the key to soving this puzzle. The end of my /etc/rc.d/rc.local file looks like this.

touch /var/lock/subsys/local
# Configure my modem with info from cat /proc/pci
ln -sf /dev/ttyS4 /dev/modem

I agree about real modems, that is why I bought this USR. Thanks for the tip about leaving the box and about Gentoo. I'd like to get my feet a little more wet with Mandrake, then maybe move up the Linux food chain. Also, thank you for all the useful links.

God bless you Fancypiper!
 
Old 06-13-2004, 09:48 AM   #8
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Of course, your comment is wrong (# Configure my modem with info from cat /proc/pci) because you have a winmodem and had to use something else, right?.

A better comment IMHO is what you did, rather than commenting on what someone else did.

# Remove old modem symbolic link and replace with the proper device my winmodem uses.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Symlink Fredde87 Linux - General 14 09-30-2005 08:06 PM
where is symlink? guitarfella Slackware 3 12-04-2004 07:34 AM
symlink evannextel Linux - Newbie 1 09-17-2003 03:54 PM
Modem symlink hassles 16977 Linux - Newbie 5 07-24-2003 10:18 AM
/dev/modem symlink mcleodnine Linux - Hardware 2 10-10-2002 08:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration