Find the answer to your Linux question:
Results 1 to 2 of 2
Is there a way to do this? On my laptop it starts my wireless network whatever since i got it to load the module. But the boot takes a very ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790

    Kernel parameter to start network


    Is there a way to do this?

    On my laptop it starts my wireless network whatever since i got it to load the module. But the boot takes a very long time since my dhcp timeout is rather long. Now i WOULD reduce this timeout, but sometimes at home it can take a fair while to get an ip through DHCP.

    So what i would like is a kernel option of nowireless which just will not load the kernel module for the wireless card. Is this possible? If so how!
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    I have solved this with a Simple init script as follows:
    Filename: /etc/init.d/wireless-init
    Code:
    #!/sbin/runscript
    
    depend(){
      need localmount
      after bootmisc hostname
      use isapnp isdn pcmcia usb wlan
    }
    
    start(){
      ebegin "Starting wireless-init"
      if [ "$LINES" -gt "0" ]; then
        modprobe $MODULE
      fi
      eend $?
    }
    
    stop(){
      ebegin "Stopping wireless-init"
      if [ "$LOADED" -gt "0" ]; then
        rmmod $MODULE $MODULE_DEPS
      fi
      eend $?
    }
    This also has a configuration file that gets read from /etc/conf.d/wireless-init
    Code:
    LINES=`grep -c wireless /proc/cmdline`
    LOADED=`lsmod | grep -g bcm43xx`
    
    MODULE="bcm43xx"
    MODULE_DEPS="ieee80211softmac ieee80211 ieee80211_crypt"
    Then add this to the default runlevel:

    Code:
    rc-update add wireless-init default
    That's enough to get the script to work, now to make grub tell linux wether to start the wireless or not!

    edit grub's menu (mine's located at /boot/grub/menu.lst). In there, make a copy of the existing boot item for linux, and then add wireless to the end of the kernel like as such:

    Code:
    title=Gentoo Linux 2.6.17 - Wireless
    root (hd0,5)
    kernel /boot/linux-2.6.17 root=/dev/hda6 video=vesafb:mttr:3,ywrap,1280x800-32@60 splash=verbose,theme=livecd-2006.0 wireless
    
    title=Gentoo Linux 2.6.17 - No Wireless
    root (hd0,5)
    kernel /boot/linux-2.6.17 root=/dev/hda6 video=vesafb:mttr:3,ywrap,1280x800-32@60 splash=verbose,theme=livecd-2006.0
    Now just reboot and choose wether you want wireless on at boot or not

    If anyone can suggest improvements to the script, that would be great. Also, the script seems to run at the very end of the boot process, not really where i want it. I want it to run around where the network gets started (hence i copied net.lo) Adding in
    Code:
    before urandom
    (the process that starts after eth0) to the depend() still didn't solve the problem.

    I have sorted this by changing the default runlevel to boot not default, and then adding
    Code:
    before *
    to the depend() section of the init script, but this was just to make it load a bit sooner, upto you wether you want it to boot earlier or are happy it starting at the end.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •