Re: [Fedora-livecd-list] using %post -nochroot - SOLVED
by dwoody1
On Saturday 19 January 2008 1:51 pm, Jeremy Katz wrote:
> On Sat, 2008-01-19 at 13:39 -0600, dcw wrote:
> > Using livecd-creator (ver. 13-4) I have made a livecd with a recompiled
> > kernel and it boots and works. I am now at the point of copying some
> > configuration files from the hard drive to the livecd using the
> > livecd-creator program.
>
> [snip]
>
> > I have not been able to determine what 'somewhere' should be.
>
> /mnt/sysimage is only relevant for anaconda installs -- creating live
> images on a real system, we can't guarantee that /mnt/sysimage exists or
> is being used for this purpose. Thus, you can instead use
> $INSTALL_ROOT. Which iirc, I also added to anaconda in F8
Thanks for your quick response.
I changed the ks file , reran livecd-creator and burned a CD. Worked
perfectly. Just a few more tweaks and this project will be done.
David
> Jeremy
>
> --
> Fedora-livecd-list mailing list
> Fedora-livecd-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-livecd-list
--
RD Woodyard, Inc.
-------------------------------------------------------
16 years, 3 months
using %post -nochroot
by dwoody1
Using livecd-creator (ver. 13-4) I have made a livecd with a recompiled kernel
and it boots and works. I am now at the point of copying some configuration
files from the hard drive to the livecd using the livecd-creator program.
The following method works:
%post
echo "nameserver 10.10.2.99" > /etc/resolv.conf
but I would like to use:
%post -nochroot
cp /etc/resolv.conf > /somewhere/etc/resolv.conf
I have not been able to determine what 'somewhere' should be.
I have never programed in python but I have looked through the livecd-creator
program and made several 'best' guesses but I have not found anything that
works. I have also searched the internet and I have found nothing that
addresses this.
The documentation on
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guid...
says to:
%post --nochroot
cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/mnt/sysimage does not exist.
Any help will be greatly appreciated,
David
16 years, 3 months
[PATCH] Add initramfs image creator
by apevec@redhat.com
Add initramfs image creator
Installed system is packaged as a cpio archive to be used as initramfs.
Based on markmc's patch:
http://people.redhat.com/markmc/live/livecd-creator-patches/livecd-initra...
Signed-off-by: Alan Pevec <apevec(a)redhat.com>
Index: livecd/imgcreate/creator.py
===================================================================
--- livecd.orig/imgcreate/creator.py
+++ livecd/imgcreate/creator.py
@@ -832,3 +832,58 @@ class LoopImageCreator(ImageCreator):
def _stage_final_image(self):
self._resparse()
shutil.move(self._image, self._outdir + "/" + self.name + ".img")
+
+
+class InitramfsImageCreator(ImageCreator):
+ """Installs a system into a cpio archive for initramfs.
+
+ InitramfsImageCreator is a straightforward ImageCreator subclass;
+ the installed system is packaged as a compressed cpio archive which can be
+ subsequently used for initramfs.
+
+ """
+
+ def __init__(self, ks, name):
+ """Initialize an InitramfsImageCreator instance.
+ """
+ ImageCreator.__init__(self, ks, name)
+
+ def _cdroot(self):
+ """Change into the install root.
+ """
+ os.chdir(self._instroot)
+
+ #
+ # Actual implementation
+ #
+ def _get_fstab(self):
+ s = "rootfs / ext3 defaults,noatime 0 0\n"
+ s += "devpts /dev/pts devpts gid=5,mode=620 0 0\n"
+ s += "tmpfs /dev/shm tmpfs defaults 0 0\n"
+ s += "proc /proc proc defaults 0 0\n"
+ s += "sysfs /sys sysfs defaults 0 0\n"
+ return s
+
+ def _mount_instroot(self, base_on = None):
+ if not base_on is None:
+ try:
+ subprocess.call(['/usr/bin/pax', '-rzf', base_on], preexec_fn=self._cdroot)
+ except OSError, e:
+ raise CreatorError("Failed to extract '%s': %s" % (base_on, e))
+
+ def __get_image(self):
+ return self._outdir + "/" + self.name + ".img"
+ _image = property(__get_image)
+ """The location of the initramfs archive.
+ """
+
+ def _stage_final_image(self):
+ try:
+ instroot_init = self._instroot + "/init"
+ if not os.path.lexists(instroot_init):
+ os.symlink("sbin/init", instroot_init)
+ subprocess.call(['/usr/bin/pax', '-w', '-zx', 'sv4cpio', '-s', '/^\.\///',
+ '-f', self._image, '.'], preexec_fn=self._cdroot)
+ except OSError, e:
+ raise CreatorError("Failed to create the initramfs image: %s" % e)
+
Index: livecd/livecd-tools.spec
===================================================================
--- livecd.orig/livecd-tools.spec
+++ livecd/livecd-tools.spec
@@ -20,6 +20,7 @@ Requires: squashfs-tools
Requires: pykickstart >= 0.96
Requires: dosfstools >= 2.11-8
Requires: isomd5sum
+Requires: pax
%ifarch %{ix86} x86_64
Requires: syslinux
%endif
16 years, 3 months
cant find filesystem /dev/root
by Lane Brooks
I am using the latest image-creator tool from the git repo to create an
custom fedora image based on fedora 8.
When I try to boot either from the physical image or in qemu, I get the
following error:
mount: could not find filesystem '/dev/root'
and then eventually switchroot fails and the system hangs. I have tried
the original kernel and the latest released kernel. I have rebuilt
initrd based on hda1, sda1, etc. in the /etc/fstab file and get the same
problem. I have tried grub, extlinux, and even booting directly in
qemu. No matter what I get this error.
The only thing I have gotten to work is to download a vanilla kernel and
build and install it manually. It seems as though the fedora kernel
does not find the ide drives, although I cannot verify this because the
text scrolls too quickly for me to see.
Anyone know what the problem is? I am not sure if this is the best list
to ask this question, so perhaps even suggesting a more appropriate list
would be helpful too.
Thanks,
Lane Brooks
16 years, 3 months
Traceback error: File exists when running livecd-creator on updated Fedora 7
by Elias Hunt
All,
I'll start by saying this process has been working perfectly for at
least a couple months now. However just yesterday I updated my build
system with the most recent Fedora 7 patches and built a new base ISO
with the new updates as well. Now I'm seeing the error below. If I'm
reading things correctly it's having trouble with /etc/mtab in the build
dir. I checked the still mounted build dir and found the link already
existing there. Aparently it was already done in the base ISO.
No matter the cause I need to try and figure out a solution. If there is
already one out there I'm happy to make use of it. Otherwise if someone
has a moment to help I would greatly appreciate it.
Happy to provide more information too if needed.
Thanks.
-Eli
/usr/bin/livecd-creator --config=dactest2.ks
--base-on=/mms/dac/buildtools/iso/m2s-dac-cd-base-4.1_F7.iso
--fslabel=dactest2-1200432110
mount: block device /dev/loop2 is write-protected, mounting read-only
Traceback (most recent call last):
File "/usr/bin/livecd-creator", line 1088, in <module>
sys.exit(main())
File "/usr/bin/livecd-creator", line 1067, in main
target.setup(options.uncompressed_size, options.base_on)
File "/usr/bin/livecd-creator", line 428, in setup
os.symlink("../proc/mounts", self.build_dir +
"/install_root/etc/mtab")
OSError: [Errno 17] File exists
--
Elias Hunt
Systems Engineer
M2S, Inc.
12 Commerce Ave.
W Lebanon, NH 03784
Ph: 603-298-5509 x365
Fax: 603-298-8816
hunt(a)m2s.com
16 years, 3 months
[PATCH] installroot mountpoint OSError
by Jeroen van Meeuwen
Hi,
When the installation root or mount point is attempted to be created,
and already exists, livecd-tools will show a traceback and fail to
continue. I'm thinking that creating the directory on which to loopmount
something doesn't need to show a traceback under this particular
circumstance, as livecd-tools should just ensure the directory is there.
Attached is a small patch resolving this (might also test if exists and
rmtree if it does and then recreate it).
Kind regards,
Jeroen van Meeuwen
-kanarip
16 years, 3 months
Issue with customized Fedora Live CD
by Sebastian Dziallas
Hi there!
I am going to build a customized Fedora Live CD with some educational
applications using revisor. In the repo config, I needed to exclude *.i586
and aspell-* (apart from aspell and aspell-en) to solve conflicts. In the
end, the image was successfully created (a little bit larger than expected,
currently approx. 750 MB, but that's not the problem).
I have tested the image in a VMware installation and there, I got the
following error message:
WARNING: Requested /sbin/init binary does not exist on rootfs.
Dropping to a shell. Good Luck!
Does anybody have an idea what might be causing this?
BTW: The kickstart file is, customized, but based on the original
livecd-fedora-8-desktop.ks, which also includes
livecd-fedora-8-base-desktop.ks.
Cheers,
Sebastian
16 years, 3 months
[ANNOUNCE] VirOS: it's alliiivvvveeee (at least for bug-free LiveUSB persistence)
by Douglas McClendon
Fellow Fedora LiveCD Enthusiasts:
I present, in lieu of actual FudCON participation, this new software
release-
VirOS-0.5-20080111, while still a few days away from being a functional
drop in replacement for livecd-creator which does not require root
privileges to run, does at least support adding my LiveUSB persistence
implementation to the Fedora-8 LiveCD, and similar LiveISO images.
(without requiring root privs, or running much faster as root if you
like living on the edge)
Basically it works like this-
viros lixmog --output=newlive.iso --addtrait=ZyX.overlay.f8 live.iso
if live.iso was the fedora 8 i686 livecd iso image, then newlive.iso
will be slightly modified to support LiveUSB persistence.
To use LiveUSB persistence, get the livecd-iso-to-disk script from the
/LiveOS/ subdirectory on the iso (as normal), and invoke it as normal,
but add an argument of
--overlay-size-mb 128
to create a 128MB persistence file on the resulting LiveUSB.
Really, you'll have more fun if you make it a 1024MB persistence file on
a 2G LiveUSB.
You can download the latest release of VirOS (in .tgz/.srpm/.rpm) here
http://filteredperception.org/downloads/viros-0.5.20080111/
and if you'd rather not test my software, but just check out the
official f8 livecd patched to support the feature, look here
http://filteredperception.org/downloads/overlay/20080111/
I'll omit the details on xdelta patching, as they were in a prior mail,
and to highlight the fact that this is still all very alpha/developer
quality stuff. I have not done a complete code review myself, therefore
it is too early for me to even ask others to do a code review.
But having finally ironed out the last known bugs with the persistence
feature, and having put together a reasonable rpm of the rest of the
stuff, I am actually pretty pleased with how it's shaping up....
Bug reports are welcome and expected... Enjoy...
-dmc
16 years, 3 months
Inheritance in kickstart and package removals
by Rahul Sundaram
Hi,
I am working on a Xfce spin of Fedora available at
http://sundaram.fedorapeople.org/livecd-fedora-8-xfce.ksa which as you
can see inherits the base desktop kickstart file which removes wget. I
have been trying to add it back in my kickstart file but wget is not in
the image created by livecd-creator. I have been able to reproduce this
consistently.
Seth Vidal on IRC commented that urlgrabber would serve the same purpose
as wget and of course curl is also there but regardless of value of wget
in the Xfce spin, this seems to be a bug that I can't add back packages
that are removed in the base kickstart file I am inheriting from. Comments?
Rahul
16 years, 3 months