This email list is read-only. Emails sent to this list will be discarded
----------------------------------
debian/changelog | 5 +++--
libs/InstallImage.py | 32 +++++++++++++-------------------
libs/Mkinitrd.py | 10 +++++++---
libs/Platform.py | 5 ++++-
4 files changed, 27 insertions(+), 25 deletions(-)
New commits:
commit efc3693d81c9d7e4e67f89c1c4df5fe0ffea5d62
Author: Prajwal Mohan <[EMAIL PROTECTED]>
Date: Wed Jul 30 13:37:37 2008 -0700
Fixing problems with creating images for yum platforms on apt host
Diff in this email is a maximum of 400 lines.
diff --git a/debian/changelog b/debian/changelog
index e3baae5..1652cb5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -82,9 +82,10 @@ moblin-image-creator (0.45) UNRELEASED; urgency=low
[ Prajwal Mohan ]
* Making changes to Install Image to handle yum based platforms
* Making changes to Makefile
- * Adding creating grub menu
+ * Adding creating grub menu
+ * Fixing problems with creating images for yum platforms on apt host
- -- Prajwal Mohan <[EMAIL PROTECTED]> Tue, 29 Jul 2008 17:09:01 -0700
+ -- Prajwal Mohan <[EMAIL PROTECTED]> Wed, 30 Jul 2008 13:36:14 -0700
moblin-image-creator (0.44) gaston; urgency=low
diff --git a/libs/InstallImage.py b/libs/InstallImage.py
index e408a86..4820b05 100755
--- a/libs/InstallImage.py
+++ b/libs/InstallImage.py
@@ -397,29 +397,23 @@ class InstallImage(object):
def create_grub_menu_yum(self):
#FIXME: We need to generate grub menu
- print "Creating temporary grub menu.list....................."
+ print _("Creating the grub menu")
+ # remove previous menu.lst, since we are about to create one
menu_dir = os.path.join(self.target.path, "boot/grub")
menu_file = os.path.join(menu_dir, "menu.lst")
-
+ grub_conf = os.path.join(menu_dir, "grub.conf")
if os.path.exists(menu_file):
- os.unlink(menu_file)
+ os.unlink(menu_file)
+ if os.path.exists(grub_conf):
+ os.unlink(grub_conf)
if not os.path.exists(menu_dir):
- os.makedirs(menu_dir)
-
- out_file = open(menu_file, 'w')
- print >> out_file, """#Temp Grub menu.list
-
- default 0
- timeout 10
-
- title Moblin2 (2.6.25)
- root (hd0,0)
- kernel /vmlinuz-2.6.25-default boot=disk
- initrd /initrd.img-2.6.25-default
- """
- out_file.close()
- print "Done."
-
+ os.makedirs(menu_dir)
+ hd_kernel_cmdline =
self.project.get_target_hd_kernel_cmdline(self.target.name)
+ #execCommand does not seem to work. This command needs the
hd_kernel_cmdline to be within double quotes
+ #execComamnd uses split. This causes only the first part of
hd_kernel_cmdline to get picked up
+ #self.target.chroot("update-grub %s" % hd_kernel_cmdline)
+ cmd_line = "/sbin/update-grub \"%s\"" % hd_kernel_cmdline
+ os.popen("/usr/sbin/chroot %s %s" % (self.target.path, cmd_line))
def __str__(self):
return ("<InstallImage: project=%s, target=%s, name=%s>"
diff --git a/libs/Mkinitrd.py b/libs/Mkinitrd.py
index 11ca81b..a67b006 100755
--- a/libs/Mkinitrd.py
+++ b/libs/Mkinitrd.py
@@ -8,6 +8,7 @@ import sys
import tempfile
import SDK
+import mic_cfg
class Busybox(object):
def __init__(self, cmd_path, bin_path):
@@ -51,7 +52,7 @@ class Busybox(object):
shutil.copy(self.cmd_path, 'busybox')
for cmd in self.cmds:
- if not os.path.exists(cmd):
+ if not os.path.exists(cmd):
os.symlink("busybox", cmd)
os.chdir(save_cwd)
@@ -85,10 +86,13 @@ def create(project, initrd_file, fs_type='RAMFS'):
names = os.listdir(os.path.join(project.platform.path, 'initramfs'))
for name in names:
shutil.copy(os.path.join(project.platform.path, 'initramfs', name),
scratch_path)
-
# Create the initrd image file
os.chdir(scratch_path)
- cmd_string = "find -print | cpio --quiet -c -o | gzip -9 -c > " +
initrd_file
+
+ if mic_cfg.config.get('general', 'package_manager') == 'apt':
+ cmd_string = "find -print | cpio --quiet -H newc -o | gzip -9 -c > " +
initrd_file
+ if mic_cfg.config.get('general', 'package_manager') == 'yum':
+ cmd_string = "find -print | cpio --quiet -c -o | gzip -9 -c > " +
initrd_file
os.system(cmd_string)
os.chdir(save_cwd)
diff --git a/libs/Platform.py b/libs/Platform.py
index cffa677..d9fb0ed 100755
--- a/libs/Platform.py
+++ b/libs/Platform.py
@@ -153,7 +153,10 @@ class Platform(object):
basedir = os.path.dirname(rootstrap_file)
if not os.path.exists(basedir):
os.makedirs(basedir)
- cmd = "debootstrap --arch %s --include=apt --components=%s %s %s %s" %
(self.architecture, components, codename, chroot_dir, mirror)
+ if mic_cfg.config.get('general', 'package_manager') == 'apt':
+ cmd = "debootstrap --arch %s --include=apt --components=%s %s %s
%s" % (self.architecture, components, codename, chroot_dir, mirror)
+ elif mic_cfg.config.get('general', 'package_manager') == 'yum':
+ cmd = "/usr/sbin/debootstrap --arch %s --include=apt
--components=%s %s %s %s" % (self.architecture, components, codename,
chroot_dir, mirror)
output = []
# XXX Evil hack
if not os.path.isfile("/usr/lib/debootstrap/scripts/%s" % codename)
and not os.path.isfile("/usr/share/debootstrap/scripts/%s" % codename):
_______________________________________________
Commits mailing list
[email protected]
https://www.moblin.org/mailman/listinfo/commits