xen livecd creation
by Patrice Guay
I'm trying to create a LiveCD with a xen enabled kernel (kernel-xen).
I'm using livecd-tools 013 (the last compatible version with CentOS5).
Creating a regular LiveCD works fine but I'm having trouble with the Xen
LiveCD.
The following files are created under the isolinux directory:
> boot.cat
> initrd0.img
> isolinux.bin
> isolinux.cfg
> mboot.c32
> splash.jpg
> vesamenu.c32
> vmlinuz0
> xen0.gz
Here is the relevant content of isolinux.cfg:
> default vesamenu.c32
> timeout 100
>
> [...]
>
> label linux0
> menu label Xen LiveCD
> kernel mboot.c32
> append xen0.gz --- vmlinuz0 --- initrd0.img root=CDLABEL=xen rootfstype=iso9660 ro quiet liveimg
> menu default
And here is the boot messages I get:
> [...]
> NET: Registered protocol family 17
> Using IP] No-Shortcut mod
> Freeing unused kernel memory: 176k freed
> Write protecting the kernel read-only data: 383k
> 4gb seg fixup, process init (pid 1), cs:ip 73:00xxxxxx
> 4gb seg fixup, process init (pid 1), cs:ip 73:00xxxxxx
> 4gb seg fixup, process init (pid 1), cs:ip 73:00xxxxxx
> [...]
> 4gb seg fixup, process init (pid 1), cs:ip 73:00xxxxxx
> kernel commandline:
> fstab suggests root=/dev/mapper/livecd-rw
> fstab suggests rootflags=defaults,noatime
> fstab suggests rootfstype=ext3
> init=/sbin/init
> root=/dev/mapper/livecd-rw
> rootflags=defaults,noatime
> rootfstype=ext3
> root_ro=0
> root_rw=0
> SCSI subsystem initialized
> loop: loaded (max 16 devices)
> starting udevd
> creating devices
> input: AT Translated Set 2 keyboard as /class/input/input0
> hdc: ATAPI 1X CD-ROM drive, 32kB Cache, UDMA(33)
> Uniform CD-ROM driver Revision: 3.20
> input: ImPS/2 Generic Wheel Mouse as /class/input/input1
> waiting for system to settle
> no root yet, udev rule will write symlink...
>
> waiting up to 60 seconds before dropping to emergency shell.
> [...]
> .....printk: 2869 messages suppressed.
> 4gb seg fixup, process init (pid 1), cs:ip 73:009f337c
>
> --------------------------------------
> WARNING: Cannot find root file system!
> --------------------------------------
>
> Create symlink /dev/root and then exit this shell to continue
> the boot sequence.
>
> bash: no job control in this shell
> bash 3.2#
Anyone has a clue about what is going wrong with this Xen LiveCD?
Thanks,
--
Patrice Guay
14 years, 8 months
imgcreate/live.py
by Jeremy Katz
imgcreate/live.py | 67 +++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 49 insertions(+), 18 deletions(-)
New commits:
commit c6b31fa922b322fc5b0b9f48bca3a9ff812f8bdb
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Aug 18 14:07:58 2009 -0400
Support dracut based initrds
With dracut, the initrd is named "initrd-generic-*.img", so support
looking for that. We also end up wanting to use a different root=
line which also lets the hybrid images Just Work (tm)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index f44e173..756097b 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -364,8 +364,14 @@ class x86LiveImageCreator(LiveImageCreatorBase):
shutil.copyfile(bootdir + "/vmlinuz-" + version,
isodir + "/isolinux/vmlinuz" + index)
- shutil.copyfile(bootdir + "/initrd-" + version + ".img",
- isodir + "/isolinux/initrd" + index + ".img")
+ isDracut = False
+ if os.path.exists(bootdir + "/initrd-generic-" + version + ".img"):
+ shutil.copyfile(bootdir + "/initrd-generic-" + version + ".img",
+ isodir + "/isolinux/initrd" + index + ".img")
+ isDracut = True
+ else:
+ shutil.copyfile(bootdir + "/initrd-" + version + ".img",
+ isodir + "/isolinux/initrd" + index + ".img")
is_xen = False
if os.path.exists(bootdir + "/xen.gz-" + version[:-3]):
@@ -373,7 +379,7 @@ class x86LiveImageCreator(LiveImageCreatorBase):
isodir + "/isolinux/xen" + index + ".gz")
is_xen = True
- return is_xen
+ return (is_xen, isDracut)
def __is_default_kernel(self, kernel, kernels):
if len(kernels) == 1:
@@ -408,18 +414,23 @@ menu hidden
menu hiddenrow 5
""" % args
- def __get_image_stanza(self, is_xen, **args):
+ def __get_image_stanza(self, is_xen, isDracut, **args):
+ if isDracut:
+ args["rootlabel"] = "live:LABEL=%(fslabel)s" % args
+ else:
+ args["rootlabel"] = "CDLABEL=%(fslabel)s" % args
+
if not is_xen:
template = """label %(short)s
menu label %(long)s
kernel vmlinuz%(index)s
- append initrd=initrd%(index)s.img root=CDLABEL=%(fslabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
+ append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
"""
else:
template = """label %(short)s
menu label %(long)s
kernel mboot.c32
- append xen%(index)s.gz --- vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s --- initrd%(index)s.img
+ append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s --- initrd%(index)s.img
"""
return template % args
@@ -438,7 +449,9 @@ menu hiddenrow 5
index = "0"
for version in versions:
- is_xen = self.__copy_kernel_and_initramfs(isodir, version, index)
+ (is_xen, isDracut) = self.__copy_kernel_and_initramfs(isodir, version, index)
+ if index == "0":
+ self._isDracut = isDracut
default = self.__is_default_kernel(kernel, kernels)
@@ -449,7 +462,7 @@ menu hiddenrow 5
else:
long = "Boot %s(%s)" % (self.name, kernel)
- cfg += self.__get_image_stanza(is_xen,
+ cfg += self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kernel_options,
@@ -462,7 +475,7 @@ menu hiddenrow 5
cfg += "menu default\n"
if checkisomd5:
- cfg += self.__get_image_stanza(is_xen,
+ cfg += self.__get_image_stanza(is_xen, isDracut,
fslabel = self.fslabel,
isofstype = "auto",
liveargs = kernel_options,
@@ -540,8 +553,12 @@ hiddenmenu
""" %args
def __get_efi_image_stanza(self, **args):
+ if self._isDracut:
+ args["rootlabel"] = "live:LABEL=%(fslabel)s" % args
+ else:
+ args["rootlabel"] = "CDLABEL=%(fslabel)s" % args
return """title %(long)s
- kernel /EFI/boot/vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
+ kernel /EFI/boot/vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
initrd /EFI/boot/initrd%(index)s.img
""" %args
@@ -649,6 +666,7 @@ class ppcLiveImageCreator(LiveImageCreatorBase):
return { "32" : False, "64" : True }
def __copy_kernel_and_initramfs(self, destdir, version):
+ isDracut = False
bootdir = self._instroot + "/boot"
makedirs(destdir)
@@ -656,8 +674,15 @@ class ppcLiveImageCreator(LiveImageCreatorBase):
shutil.copyfile(bootdir + "/vmlinuz-" + version,
destdir + "/vmlinuz")
- shutil.copyfile(bootdir + "/initrd-" + version + ".img",
- destdir + "/initrd.img")
+ if os.path.exists(bootdir + "/initrd-generic-" + version + ".img"):
+ shutil.copyfile(bootdir + "/initrd-" + version + ".img",
+ destdir + "/initrd.img")
+ isDracut = True
+ else:
+ shutil.copyfile(bootdir + "/initrd-" + version + ".img",
+ destdir + "/initrd.img")
+
+ return isDracut
def __get_basic_yaboot_config(self, **args):
return """
@@ -666,17 +691,21 @@ timeout=%(timeout)d
""" % args
def __get_image_stanza(self, **args):
+ if args["isDracut"]:
+ args["rootlabel"] = "live:LABEL=%(fslabel)s" % args
+ else:
+ args["rootlabel"] = "CDLABEL=%(fslabel)s" % args
return """
image=/ppc/ppc%(bit)s/vmlinuz
label=%(short)s
initrd=/ppc/ppc%(bit)s/initrd.img
read-only
- append="root=CDLABEL=%(fslabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s"
+ append="root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s"
""" % args
- def __write_yaboot_config(self, isodir, bit):
+ def __write_yaboot_config(self, isodir, bit, isDracut = False):
cfg = self.__get_basic_yaboot_config(name = self.name,
timeout = self._timeout * 100)
@@ -688,7 +717,8 @@ image=/ppc/ppc%(bit)s/vmlinuz
long = "Run from image",
extra = "",
bit = bit,
- liveargs = kernel_options)
+ liveargs = kernel_options,
+ isDracut = isDracut)
if self._has_checkisomd5():
cfg += self.__get_image_stanza(fslabel = self.fslabel,
@@ -697,7 +727,8 @@ image=/ppc/ppc%(bit)s/vmlinuz
long = "Verify and run from image",
extra = "check",
bit = bit,
- liveargs = kernel_options)
+ liveargs = kernel_options,
+ isDracut = isDracut)
f = open(isodir + "/ppc/ppc" + bit + "/yaboot.conf", "w")
f.write(cfg)
@@ -764,8 +795,8 @@ image=/ppc/ppc32/vmlinuz
self.__write_not_supported(isodir, bit)
continue
- self.__copy_kernel_and_initramfs(isodir + "/ppc/ppc" + bit, kernel)
- self.__write_yaboot_config(isodir, bit)
+ isDracut = self.__copy_kernel_and_initramfs(isodir + "/ppc/ppc" + bit, kernel)
+ self.__write_yaboot_config(isodir, bit, isDracut)
makedirs(isodir + "/etc")
if kernel_bits["32"] and not kernel_bits["64"]:
14 years, 8 months
imgcreate/live.py
by Jeremy Katz
imgcreate/live.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 832c78e2d6f54e130b845dd7d63fa457b0f513ea
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon Aug 17 10:50:01 2009 -0400
Fix my stupid typo. *sigh*
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 773d2c2..f44e173 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -173,7 +173,7 @@ class LiveImageCreatorBase(LoopImageCreator):
try:
shutil.copyfile(os_image, self._image)
- except IOError, e
+ except IOError, e:
raise CreatorError("Failed to copy base live image to %s for modification: %s" %(self._image, e))
finally:
squashloop.cleanup()
14 years, 8 months
2 commits - imgcreate/fs.py imgcreate/live.py
by Jeremy Katz
imgcreate/fs.py | 3 +++
imgcreate/live.py | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 2315f1a3cfbd38257e86b9f785f11e9a99784d67
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon Aug 17 09:50:08 2009 -0400
Apparently the python traceback isn't clear enough (#517841)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index b98f7b3..773d2c2 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -171,7 +171,10 @@ class LiveImageCreatorBase(LoopImageCreator):
"LiveOS/ext3fs.img nor os.img exist" %
base_on)
- shutil.copyfile(os_image, self._image)
+ try:
+ shutil.copyfile(os_image, self._image)
+ except IOError, e
+ raise CreatorError("Failed to copy base live image to %s for modification: %s" %(self._image, e))
finally:
squashloop.cleanup()
isoloop.cleanup()
commit 7a62ff24c4f1f7e46326210d0514e4b71de5772b
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon Aug 17 09:47:14 2009 -0400
Add a sleep to try to avoid tracebacks with snapshot removal (#506644)
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index a9512f2..31e5ca3 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -26,6 +26,7 @@ import random
import string
import logging
import tempfile
+import time
from imgcreate.errors import *
@@ -516,6 +517,8 @@ class DeviceMapperSnapshot(object):
if not self.__created:
return
+ # sleep to try to avoid any dm shenanigans
+ time.sleep(2)
rc = subprocess.call(["/sbin/dmsetup", "remove", self.__name])
if not ignore_errors and rc != 0:
raise SnapshotError("Could not remove snapshot device")
14 years, 8 months
Why resize back ext3fs.img to bigger size.
by Alexander Todorov
Hi,
in fs.py in ExtDiskMount.resparse() function we resize and truncate the image to
minimum possible size (i.e. ext3 becomes 100% full) and then resize it back to
the size specified in kickstart. In most cases this results in ext3fs.img which
when mounted has lots of free space on it.
Why is that ? It can be avoided by this simple patch:
---------------------------------
imgcreate/fs.py | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index 563b7a9..50ec5e7 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -470,7 +470,6 @@ class ExtDiskMount(DiskMount):
self.cleanup()
minsize = self.__resize_to_minimal()
self.disk.truncate(minsize)
- self.__resize_filesystem(size)
return minsize
class DeviceMapperSnapshot(object):
14 years, 8 months
3 commits - imgcreate/fs.py imgcreate/kickstart.py Makefile
by Jeremy Katz
Makefile | 2 +-
imgcreate/fs.py | 2 +-
imgcreate/kickstart.py | 12 +++++-------
3 files changed, 7 insertions(+), 9 deletions(-)
New commits:
commit ff31b963edb642ae210455cf38a88392feb84a9f
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Fri Aug 14 10:50:59 2009 -0400
If resize2fs fails, raise an error also (related to #517222)
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index 563b7a9..a9512f2 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -68,7 +68,7 @@ def resize2fs(fs, size = None, minimal = False):
args.append("%sK" %(size / 1024,))
ret = subprocess.call(args)
if ret != 0:
- return ret
+ raise ResizeError("resize2fs returned an error (%d)! image to debug at %s" %(ret, saved_image))
if e2fsck(fs) != 0:
raise ResizeError("fsck after resize returned an error! image to debug at %s" %(saved_image,))
commit b1496d9f5ee11c42ca4446eb5e4da9de025500cd
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Thu Jul 30 16:43:42 2009 -0400
Bumpv ersion
diff --git a/Makefile b/Makefile
index a3b2aa9..68cb635 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 024
+VERSION = 025
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 8d1a422ca611e7f05da8f8f3b8e46c7d3bcb4e86
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon Jul 27 09:26:58 2009 -0400
Use system-config-keyboard's bits in preference to rhpl.keyboard
system-config-keyboard >= 1.3.0 has support for the keyboard pieces
that used to be in rhpl. Use them if we can but fall back gracefully
as people running from git could be on older releases
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 83a62e4..98db856 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -24,7 +24,10 @@ import time
import logging
import urlgrabber
-import rhpl.keyboard
+try:
+ import system_config_keyboard.keyboard as keyboard
+except ImportError:
+ import rhpl.keyboard as keyboard
import pykickstart.commands as kscommands
import pykickstart.constants as ksconstants
@@ -132,12 +135,7 @@ class LanguageConfig(KickstartConfig):
class KeyboardConfig(KickstartConfig):
"""A class to apply a kickstart keyboard configuration to a system."""
def apply(self, kskeyboard):
- #
- # FIXME:
- # should this impact the X keyboard config too?
- # or do we want to make X be able to do this mapping?
- #
- k = rhpl.keyboard.Keyboard()
+ k = keyboard.Keyboard()
if kskeyboard.keyboard:
k.set(kskeyboard.keyboard)
k.write(self.instroot)
14 years, 8 months
Boot LiveCD over NFS
by Alexander Todorov
Good afternoon,
I've tested Scientific Linux diskless livecd boot:
http://www.livecd.ethz.ch/diskless.html
It works like a charm.
I found a similar page for Fedora:
http://fedoraproject.org/wiki/Features/PXE-NFS_Boot_LiveCD
The page says that Fedora livecd's are not capable of booting over nfs at the
moment.
Is anyone working on this? What is necessary to make the kernel and initrd from
the livecd NFS aware? I'm willing to help implement this but not sure what needs
to be done.
Has anyone tried a similar configuration and wants to share how(if) they got it
working?
Regards,
Alexander.
14 years, 8 months
[PATCH] Handle initrd-generic dracut initrd's
by Warren Togami
[PATCH] Handle initrd-generic dracut initrd's
Currently dist-f12 koji repo, but not yet f12-alpha.
diff --git a/imgcreate/live.py b/imgcreate/live.py
index b98f7b3..c4381b2 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -361,8 +361,13 @@ class x86LiveImageCreator(LiveImageCreatorBase):
shutil.copyfile(bootdir + "/vmlinuz-" + version,
isodir + "/isolinux/vmlinuz" + index)
- shutil.copyfile(bootdir + "/initrd-" + version + ".img",
- isodir + "/isolinux/initrd" + index + ".img")
+ imgpath=bootdir + "/initrd-generic-" + version + ".img"
+ if os.path.exists(imgpath):
+ shutil.copyfile(imgpath,
+ isodir + "/isolinux/initrd" + index + ".img")
+ else:
+ shutil.copyfile(bootdir + "/initrd-" + version + ".img",
+ isodir + "/isolinux/initrd" + index + ".img")
is_xen = False
if os.path.exists(bootdir + "/xen.gz-" + version[:-3]
14 years, 8 months
Big size difference in i686 and x86_64 versions of KDE live images
by Sebastian Vahl
Hi,
my KDE live images are showing a big size difference between the i686 and the
x86_64 images (around 40 megs). The slighlty different package list couldn't
explain this (i.e. atlas-sse (i686) vs. atlas (x86_64) is the only important
difference).
So I've compared the sizes of the installed packages (rpm -qa --qf "%{name}
{size}\n" | sort -nr). Many packages are different in size but the kernel does
have the biggest difference:
i686: 78453688
x86_64: 103736431
A test spin of the GNOME images doesn't show this difference (only 2 megs).
Does anybody has an explanation for this?
Or can somebody try to create a x86_64 version for comparison (with livecd-
creator and spins-kickstarts from git)?
Sebastian
[1] More package lists:
https://fedoraproject.org/w/index.php?title=SebastianVahl/CurrentPackageL...
14 years, 8 months
Hard disk install error for a Custom spin of Fedora 11
by kala
Dear Friends
I have created a custom live spin of fedora 11, the OS works fine while
booting from USB or DVD but when it comes to hard disk installation it gives
me an error which i couldnt able to solve. The first boot setup goes fine
and at the end it gives me a flash of error screen ( I managed to get a
screen shot of this which i am attaching as image) and then prompts me for
login. when i give passwd and enter it tries to login but the login screen
reappears (like cntrl+alt+backspace refreshing x server). even i couldnt
login into terminal even as root which is says permission denyed. please
help me solve the issue.
http://opendiscovery.org.in/30-07-09_2318.jpg
kala bharath
14 years, 8 months