WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: STEP-BY-STEP BOOT AND INTERNET FROM SCRATCH  (Read 2233 times)

Offline grandma

  • Full Member
  • ***
  • Posts: 213
  • Never forget Grandma Loves You & made that candy4U
    • Back when a 10MB HD was $500 bucks
STEP-BY-STEP BOOT AND INTERNET FROM SCRATCH
« on: September 14, 2012, 04:29:26 PM »
Not sure if this is a wise idea - creating a STEP-BY-STEP tutorial for first boot from scratch, but a friend in Texas tried loading TC (I sent them bare-bones) and can't get either their WiFi working or the ETH0 using the built in TC Network setup...

So I figured I'd write a script that does the following and with your comments/suggestions, get it so it can get ANYONE online.

1. Checking drivers are loaded - primarily wireless tools and ethtools

2. Test the ETH port by looping through every gateway address of 192.168.1.1 through 192.168.255.255, along with every possible IP address 192.168.1.1 through 192.168.255.255 (royal slow pain) and before going into that massive loop checking a few settings with ifconfig to see if anything is LIVE yet - i.e. detect a 10.0.0.1 gateway.

Any suggestions for that loop and pre-checks are appreciated, otherwise I'll code it "the hard way". I am fairly familiar with wireless commands - like iwconfig etc. - but have never worked with the ETH settings and don't even have a live cable to test with - gonna be fun - may have to go to a friends (yipper).



~ Luv Grandma
"When children of all nations
play in the sandbox together
all morning-all day-all week, and
one fine sunny day; all year long ...
... then war will become an ancient memory
and Grandma can knit that sweater
you'll hold near to your heart
until long after you're my age.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: STEP-BY-STEP BOOT AND INTERNET FROM SCRATCH
« Reply #1 on: September 14, 2012, 04:39:02 PM »
Why not use "udhcpc"?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline grandma

  • Full Member
  • ***
  • Posts: 213
  • Never forget Grandma Loves You & made that candy4U
    • Back when a 10MB HD was $500 bucks
Re: STEP-BY-STEP BOOT AND INTERNET FROM SCRATCH
« Reply #2 on: September 15, 2012, 12:05:11 AM »
Not quite sure how the script would go. The method I use with the wireless is:

1. Check if wireless tools and wireless.2etc were already loaded and load if reqd.

2. Loop through wlan0 - wlan10 using sudo ifconfig wlanX (x=loop ptr) and look for any replies indicating a live antenna - create a list.

3. Do sudo iwlist wlanX scan (loop ptr) and create a list of hot spots - separating open and locked hot spots

4. Pick open hot spots (promiscuous) if a user hot spot has not already been locked in a file: i.e. SSID - MyNeighborsOpenWiFi using the command sudo iwconfig wlan0 ESSID "MyNeighborsOpenWiFi" - OR - go directly to a user configured hot spot with sudo iwconfig wlan0 ESSID "MyOwnWiFi" - OR (if WEP required) - sudo iwconfig wlan0 ESSID "MyNeighborsOpenWiFi" key MyWepKey

5. Now I do a udhcpc -b wlan0 (or wlan1 etc.)

6. Check iwconfig or ifconfig for data indicating bytes received or a valid link quality etc. - followed by a wget to a web page and check contents for things like <html>  and if valid looking text is found, assume connection is ok.

============================

For ethernet, the establishment of the eth0 requires ?ethtools? combined with (I assume) ifconfig

I "assume" I can go thru a similar process and will be testing this tomorrow (sat).

1. Check eth0 is alive

2. Attempt to get past the DSL cable modem to either an IP address or domain name resolved by a name server (not sure what command to use for that)

3. Once ifconfig or ?ethtools? etc. has established that eth0 is alive and a route exists, then ?sudo udhcpc -b eth0?

Not sure of the sequence here.

Will be playing with that...

WHEN it works, next step is to get PXE or a derivative to work. I have been told that its impossible to utilize "out of the box" bios and no CD/DVD or USB or HD drive installed utility to get PXE to fly via http - that a LOCAL SERVER must exist - and will be verifying that since my pal with the brand spanking new acer (and ka-krashed windows) is willing to play guinea pig. He does have a TC (3x version) on a USB Flash Drive he managed to get before Windows went ker-plunk with syslinux working fine and it goes to the wbar menu. At that point we tried to get wireless going (wireless tools installed) - with no response - and we used the control panel - network - and checked his eth0 settings (with a cat 5 plugged in) and it was all blank. He tried clicking USE DHCPC and SAVING it but when he went back in it had not saved...not sure why.

Since I have never really played with eth0 in TC (great success with wireless tools though) this step-by-step eth0 is all virgin territory for me.
~ Luv Grandma
"When children of all nations
play in the sandbox together
all morning-all day-all week, and
one fine sunny day; all year long ...
... then war will become an ancient memory
and Grandma can knit that sweater
you'll hold near to your heart
until long after you're my age.