rescue mode network config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
      I want to mount my root drive and transfer files over to another box
in rescue mode.
If I configure the network using the text interface provided after the
rescue mode is selected
the speed of transfer is great. But if I answer no to that question and go
to a shell and type
ifconfig eth0 {IP} up and then do the transfer the speed is terrible. I am
not very knowledgable
about Python, but in rescue.py of stage2.img in /usr/lib/anaconda, what is
so different if
we configure the network here or later at the shell?

Here is the snippet of code I am referring to :



def runRescue(instPath, mountroot, id):

    for file in [ "services", "protocols", "group", "joe", "man.config",
                  "nsswitch.conf", "security" ]:
       os.symlink('/mnt/runtime/etc/' + file, '/etc/' + file)




###### This is the section ######
    # see if they would like networking enabled
    if not methodUsesNetworking(id.methodstr):
 screen = SnackScreen()

 while 1:
     rc = ButtonChoiceWindow(screen, _("Setup Networking"),
  _("Do you want to start the network interfaces on "
    "this system?"), [_("Yes"), _("No")])

     if rc != string.lower(_("No")):
  intf = RescueInterface(screen)

  # need to call sequence of screens, have to look in text.py
  #
  # this code is based on main loop in text.py, and if it
  # or the network step in dispatch.py change significantly
  # then this will certainly break
  #
                pyfile = "network_text"
  classNames = ("NetworkDeviceWindow", "NetworkGlobalWindow")

  lastrc = INSTALL_OK
  step = 0
  dir = 1

  while 1:
      s = "from %s import %s; nextWindow = %s" % \
   (pyfile, classNames[step], classNames[step])
      exec s

      win = nextWindow()

      if classNames[step] == "NetworkDeviceWindow":
   args = (id.network, dir, intf, 0)
      else:
   args = (id.network, dir, intf)
      rc = apply(win, (screen, ) + args)

      if rc == INSTALL_NOOP:
   rc = lastrc

      if rc == INSTALL_BACK:
   step = step - 1
   dir = - 1
      elif rc == INSTALL_OK:
   step = step + 1
   dir = 1

      lastrc = rc

      if step == -1:
   ButtonChoiceWindow(screen, _("Cancelled"),
        _("I can't go to the previous step "
          "from here. You will have to try "
          "again."),
        buttons=[_("OK")])
      elif step >= len(classNames):
   break

  startNetworking(id.network, intf)
  break
     else:
  break

 screen.finish()
#### end of section ###





    if (not mountroot):
        print
        print _("When finished please exit from the shell and your "
                "system will reboot.")
        print
 os.system("/bin/sh")
 sys.exit(0)

    # lets create some devices
    iutil.makeDriveDeviceNodes()

    # need loopback devices too
    for lpminor in range(8):
 dev = "loop%s" % (lpminor,)
 isys.makeDevInode(dev, "/dev/" + dev)

    screen = SnackScreen()
    intf = RescueInterface(screen)

    # prompt to see if we should try and find root filesystem and mount
    # everything in /etc/fstab on that root
    rc = ButtonChoiceWindow(screen, _("Rescue"),
        _("The rescue environment will now attempt to find your "
          "Linux installation and mount it under the directory "
          "%s.  You can then make any changes required to your "
          "system.  If you want to proceed with this step choose "
          "'Continue'.  You can also choose to mount your file systems "
          "read-only instead of read-write by choosing 'Read-Only'."
          "\n\n"
          "If for some reason this process fails you can choose 'Skip' "
          "and this step will be skipped and you will go directly to a "
          "command shell.\n\n") % (instPath,),
          [_("Continue"), _("Read-Only"), _("Skip")] )

    if rc == string.lower(_("Skip")):
        screen.finish()
        print
        print _("When finished please exit from the shell and your "
                "system will reboot.")
        print
        os.execv("/bin/sh", [ "-/bin/sh" ])



Any help would be greatly appreciated.

Thanks,
Sameer.



[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux