public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Wiktor W Brodlo" <wiktor@brodlo.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/anaconda:master commit in: gentoo/
Date: Thu, 11 Aug 2011 12:58:58 +0000 (UTC)	[thread overview]
Message-ID: <17fe1477e919c91e45476f712680ef107a57e0ec.wiktor@gentoo> (raw)

commit:     17fe1477e919c91e45476f712680ef107a57e0ec
Author:     wiktor w brodlo <wiktor <AT> brodlo <DOT> net>
AuthorDate: Thu Aug 11 12:58:20 2011 +0000
Commit:     Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net>
CommitDate: Thu Aug 11 12:58:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/anaconda.git;a=commit;h=17fe1477

Sync Portage and install from a stage3 tarball

---
 gentoo/utils.py |  133 +++++++-----------------------------------------------
 1 files changed, 18 insertions(+), 115 deletions(-)

diff --git a/gentoo/utils.py b/gentoo/utils.py
index 45a3888..017c8d4 100644
--- a/gentoo/utils.py
+++ b/gentoo/utils.py
@@ -760,113 +760,7 @@ class GentooInstall:
 
 
         action = _("System Installation")
-        copy_update_interval = 10
-        copy_update_counter = 9
-        # get file counters
-        total_files = 0
-        image_dir = self._prod_root
-        for z,z,files in os.walk(image_dir):
-            for file in files:
-                total_files += 1
-
-        self._progress.set_fraction(0.0)
-        self._progress.set_text(action)
-
-        def copy_other(fromfile, tofile):
-            proc = subprocess.Popen(("/bin/cp", "-a", fromfile, tofile),
-                stdout = subprocess.PIPE, stderr = subprocess.PIPE)
-            proc.wait()
-            del proc
-
-        def copy_reg(fromfile, tofile):
-            try:
-                shutil.copy2(fromfile, tofile)
-                user = os.stat(fromfile)[4]
-                group = os.stat(fromfile)[5]
-                os.chown(tofile, user, group)
-                shutil.copystat(fromfile, tofile)
-            except IOError, e:
-                if (e[0] == 40) or (e[0] == 2):
-                    # workaround for Too many levels of symbolic links
-                    copy_other(fromfile, tofile)
-                else:
-                    raise
-
-        def copy_lnk(fromfile, tofile):
-            source_link = os.readlink(fromfile)
-            if os.path.lexists(tofile):
-                os.remove(tofile)
-            os.symlink(source_link, tofile)
-
-        current_counter = 0
-        currentfile = "/"
-        image_dir_len = len(image_dir)
-        # Create the directory structure
-        # self.InstallFilesToIgnore
-        for currentdir, subdirs, files in os.walk(image_dir):
-
-            copy_update_counter += 1
-
-            for xdir in subdirs:
-
-                image_path_dir = currentdir + "/" + xdir
-                mydir = image_path_dir[image_dir_len:]
-                rootdir = self._root + mydir
-
-                # handle broken symlinks
-                if os.path.islink(rootdir) and not os.path.exists(rootdir):
-                    # broken symlink
-                    os.remove(rootdir)
-
-                # if our directory is a file on the live system
-                elif os.path.isfile(rootdir): # really weird...!
-                    os.remove(rootdir)
-
-                # if our directory is a symlink instead, then copy the symlink
-                if os.path.islink(image_path_dir) and not os.path.isdir(rootdir):
-                    # for security we skip live items that are dirs
-                    tolink = os.readlink(image_path_dir)
-                    if os.path.islink(rootdir):
-                        os.remove(rootdir)
-                    os.symlink(tolink,rootdir)
-                elif (not os.path.isdir(rootdir)) and \
-                    (not os.access(rootdir,os.R_OK)):
-                    os.makedirs(rootdir)
-
-                if not os.path.islink(rootdir):
-                    # symlink don't need permissions, also until os.walk
-                    # ends they might be broken
-                    user = os.stat(image_path_dir)[4]
-                    group = os.stat(image_path_dir)[5]
-                    os.chown(rootdir,user,group)
-                    shutil.copystat(image_path_dir,rootdir)
-
-            for path_file in sorted(files):
-
-                current_counter += 1
-                fromfile = currentdir + "/" + path_file
-                currentfile = fromfile[image_dir_len:]
-
-                if currentfile.startswith("/dev/"):
-                    continue
-
-
-                tofile = self._root + currentfile
-                st_info = os.lstat(fromfile)
-                if stat.S_ISREG(st_info[stat.ST_MODE]):
-                    copy_reg(fromfile, tofile)
-                elif stat.S_ISLNK(st_info[stat.ST_MODE]):
-                    copy_lnk(fromfile, tofile)
-                else:
-                    copy_other(fromfile, tofile)
-
-
-            if (copy_update_counter == copy_update_interval) or \
-                ((total_files - 1000) < current_counter):
-                # do that every 1000 iterations
-                copy_update_counter = 0
-                frac = float(current_counter)/total_files
-                self._progress.set_fraction(frac)
+        anaconda._intf.instProgress.terminal.run_command("tar xvjpf /tmp/stage3.tar.bz2 -C "+self._root)
 
         self._progress.set_fraction(1)
 
@@ -882,8 +776,8 @@ class GentooInstall:
 
     def copy_portage(self):
         self._progress.set_fraction(0.0)
-        self._progress.set_text(_("Copying the Portage tree (can take a long time)"))
-        subprocess.call(["cp", "--recursive", "/usr/portage", self._root+"/usr/"])
+        self._progress.set_text(_("Syncing the Portage tree (can take a long time)"))
+        self.portage.sync()
         # We need some packages from anaconda-overlay but ideally they should be added to portage
         self._progress.set_fraction(0.1)
         subprocess.call(["cp", "--recursive", "/anaconda-overlay/app-admin", self._root+"/usr/portage/"])
@@ -969,12 +863,21 @@ class GentooInstall:
         
     def install_kernel(self):
         self._progress.set_text(_("Installing the kernel"))
-        # TODO: Proper genkernel build
-        subprocess.call(["mount", "/dev/sr0", "/mnt/cdrom"])
-        shutil.copy2("/mnt/cdrom/boot/gentoo", self._root+"/boot/kernel-gentoo")
-        shutil.copy2("/mnt/cdrom/boot/gentoo.igz", self._root+"/boot/initrd-gentoo")
-        self._progress.set_fraction(0.9)
-        subprocess.call(["cp", "-PR", "/lib/modules", self._root+"/lib"])
+        if self.anaconda.genkernel:
+            subprocess.call(["mount", "/dev/sr0", "/mnt/cdrom"])
+            shutil.copy2("/mnt/cdrom/boot/gentoo", self._root+"/boot/kernel-gentoo")
+            shutil.copy2("/mnt/cdrom/boot/gentoo.igz", self._root+"/boot/initrd-gentoo")
+            self._progress.set_fraction(0.9)
+            subprocess.call(["cp", "-PR", "/lib/modules", self._root+"/lib"])
+        else:
+            shutil.copy2("/usr/src/linux-"+self.anaconda.kernel, self._root+"/usr/src/")
+            self._progress.set_fraction(0.5)
+            self._progress.set_text(_("Compiling your custom kernel"))
+            anaconda._intf.instProgress.terminal.run_command("chroot "+self._root+" eselect kernel set 1")
+            anaconda._intf.instProgress.terminal.run_command("cd "+self._root+"/usr/src/linux")
+            anaconda._intf.instProgress.terminal.run_command("make && make modules && make modules_install")
+            shutil.copy2(self+.root+"/usr/src/linux/arch/x86/boot/bzImage", self._root+"/boot/kernel-gentoo")
+            
         self._progress.set_fraction(1.0)
         
     def _get_langpacks(self):



             reply	other threads:[~2011-08-11 12:59 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 12:58 Wiktor W Brodlo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-22  4:28 [gentoo-commits] proj/anaconda:master commit in: gentoo/ Wiktor W Brodlo
2011-08-22  4:28 Wiktor W Brodlo
2011-08-21  1:30 Wiktor W Brodlo
2011-08-21  1:20 Wiktor W Brodlo
2011-08-21  1:13 Wiktor W Brodlo
2011-08-21  0:34 Wiktor W Brodlo
2011-08-21  0:03 Wiktor W Brodlo
2011-08-21  0:03 Wiktor W Brodlo
2011-08-21  0:03 Wiktor W Brodlo
2011-08-17  0:25 Wiktor W Brodlo
2011-07-21 22:18 Wiktor W Brodlo
2011-07-21 22:02 Wiktor W Brodlo
2011-07-21 21:14 Wiktor W Brodlo
2011-07-21 20:53 Wiktor W Brodlo
2011-07-12  3:31 Wiktor W Brodlo
2011-07-12  1:09 Wiktor W Brodlo
2011-07-11 17:53 Wiktor W Brodlo
2011-07-11 17:53 Wiktor W Brodlo
2011-07-11 17:53 Wiktor W Brodlo
2011-07-10 15:36 Wiktor W Brodlo
2011-07-10 12:13 Wiktor W Brodlo
2011-07-10  3:18 Wiktor W Brodlo
2011-07-08 22:07 Wiktor W Brodlo
2011-07-08 17:54 Wiktor W Brodlo
2011-07-08 17:19 Wiktor W Brodlo
2011-07-08 15:56 Wiktor W Brodlo
2011-07-08 15:27 Wiktor W Brodlo
2011-07-08 14:48 Wiktor W Brodlo
2011-07-08  3:28 Wiktor W Brodlo
2011-07-08  2:35 Wiktor W Brodlo
2011-07-08  1:42 Wiktor W Brodlo
2011-07-08  0:49 Wiktor W Brodlo
2011-07-07 23:57 Wiktor W Brodlo
2011-07-07 15:40 Wiktor W Brodlo
2011-07-07 14:08 Wiktor W Brodlo
2011-07-07  2:31 Wiktor W Brodlo
2011-07-06 20:46 Wiktor W Brodlo
2011-07-06 18:20 Wiktor W Brodlo
2011-07-06 16:42 Wiktor W Brodlo
2011-07-06 14:31 Wiktor W Brodlo
2011-07-06 11:51 Wiktor W Brodlo
2011-07-06 11:19 Wiktor W Brodlo
2011-07-05 20:45 Wiktor W Brodlo
2011-07-05 18:48 Wiktor W Brodlo
2011-07-05 16:09 Wiktor W Brodlo
2011-07-05 15:38 Wiktor W Brodlo
2011-07-05 14:31 Wiktor W Brodlo
2011-07-05 14:07 Wiktor W Brodlo
2011-07-05 13:55 Wiktor W Brodlo
2011-07-05 13:29 Wiktor W Brodlo
2011-07-05 13:22 Wiktor W Brodlo
2011-07-05 13:20 Wiktor W Brodlo
2011-07-05 12:53 Wiktor W Brodlo
2011-07-04 22:47 Wiktor W Brodlo
2011-07-04 22:34 Wiktor W Brodlo
2011-07-04 22:24 Wiktor W Brodlo
2011-07-04 21:19 Wiktor W Brodlo
2011-07-04 21:02 Wiktor W Brodlo
2011-07-04 20:56 Wiktor W Brodlo
2011-07-04 20:52 Wiktor W Brodlo
2011-07-04 16:59 Wiktor W Brodlo
2011-06-27 19:20 Wiktor W Brodlo
2011-06-27 18:27 Wiktor W Brodlo
2011-06-27 13:49 Wiktor W Brodlo
2011-06-27  0:20 Wiktor W Brodlo
2011-06-27  0:05 Wiktor W Brodlo
2011-06-27  0:03 Wiktor W Brodlo
2011-06-26 23:40 Wiktor W Brodlo
2011-06-26 23:28 Wiktor W Brodlo
2011-06-26 21:08 Wiktor W Brodlo
2011-06-26 21:03 Wiktor W Brodlo
2011-06-26 21:03 Wiktor W Brodlo
2011-06-26 19:05 Wiktor W Brodlo
2011-06-25  1:42 Wiktor W Brodlo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17fe1477e919c91e45476f712680ef107a57e0ec.wiktor@gentoo \
    --to=wiktor@brodlo.net \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox