Intenet access with LiveCD?
by Jim Dever
Hi,
I was excited to see the release of the Fedora LiveCD as I'm looking
around at different distributions but for some reason I can't get it to
see my internet connection at all.
If anyone could point me in the right direction I'd appreciate it.
NIC: Cnet PRO200WL PCI (not wireless)
Router: Linksys RTP300
Output of ifconfig:
eth0 Link encap:Ethernet HWaddr 00:80:AD:79:95:90
inet addr: 192.168.15.102 Bcast: 192.168.15.255 Mask: 255.255.255.0
inet6 addr: fe80::280:adiff:fe79:9590/64 Scope: Link
UP BROADCAST MULTICAST MTU:1500 Metric: 1
RX packets: 13 errors: 170 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 10 dropped: 0 overruns: 0 carrier: 10
collisions: 0 txqueuelen: 1000
RX bytes: 2597 (2.5 KiB) TX bytes: 0 (0.0 b)
Interrupt: 201 Base address: 0xec00
-----
I noticed that it says UP but not RUNNING.
The Ubuntu LiveCD access the internet just fine so I know it's possible
to MAKE it work. I just like to see it work before making room for a
full install.
I've used Linux before but it's been ages ago and before I had a NIC so
I'm pretty new to this part.
Any help would be appreciated!
--
Jim
16 years, 10 months
Live USB converter script
by Jeremy Katz
When thinking about what we want for booting a live image with a USB
stick, I realized that realistically, we don't want to be distributing a
"live USB" image. Because that requires running dd and destroying
whatever data you already happen to have on your USB stick.
A better choice is to take the live CD image and copy the bits from it
to your USB stick. The result is the attached script. Run it with
arguments of the live CD iso image and the device of your USB key and it
copies over the bits of the live CD onto your USB stick and makes it
bootable. Supported filesystems for your USB stick are vfat/msdos and
ext23.
What do people think? It seems to work from some quick testing and it's
impressive just how much faster it is going from a USB stick.
Jeremy
16 years, 12 months
Caching downloaded RPMs
by J. Christopher Pereira Z.
Hi:
1) I'm building a LiveCD using a remote repository.
Everytime I restart the task, the packages are being redownloaded into the temporal/mounted dir.
Is there any option for caching the downloaded packages?
PS: I'm on FC6 building a FC7 live CD.
2) If there is no option or trick for caching, how can I download only some packages (+ dependencies) into my local repository for building a minimal LiveCD.
Thanks.
J. Christopher Pereira
Area Informática
IMATRONIX S.A.
(08) 573 45 18
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 11972 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
17 years
Fedora7-Test3-KDE (proposal)
by Sebastian Vahl
Hi.
attached is my current version of a kickstart file for a kde livecd.
I've also written a mail to fedora-devel-list with some explanations.
I would be really grateful for some comments. :)
Sebastian
17 years
building fc6 livecds
by Holger Levsen
Hi,
I try to build a fedora6 livecd on fedora6 with the livecd tool.
So I installed livecd and pykickstart from git/cvs, and I'll give you here a
brief rundown of the commands I used, so you can see if the cause for the
error is there:
git-clone git://git.fedoraproject.org/git/hosted/livecd
cd livecd
sudo make install
# install pykickstart with yum, to get the depends...
sudo yum install pykickstart
# livecd-tools need a newer version of pykickstart than fc6 has:
export CVSROOT=:pserver:anonymous@rhlinux.redhat.com:/usr/local/CVS
cvs login
cvs co pykickstart
cd pykickstart
sudo python2.4 setup.py install
Then I modified livecd-fedora-desktop.ks a bit, to use the fc6 repositories
and too later modify the packages etc. I've attached my
livecd-fedora-6-desktop.ks to this mail.
Then I ran the following command:
sudo livecd-creator
--config=/usr/share/livecd-tools/livecd-fedora-6-desktop.ks \
--fslabel=Fedora-6-Test1-LiveCD \
--repo=c6,http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os \
--repo=e6,http://download.fedora.devel.redhat.com/pub/fedora/linux/extras/6/i386
Which results in:
[...]
tune2fs 1.39 (29-May-2006)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Repository core is listed more than once in the configuration
Repository core is listed more than once in the configuration
Repository core-source is listed more than once in the configuration
Repository core-source is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository extras-source is listed more than once in the configuration
Repository extras-source is listed more than once in the configuration
Traceback (most recent call last):
File "/usr/bin/livecd-creator", line 867, in ?
main()
File "/usr/bin/livecd-creator", line 832, in main
if not target.setup(uncompressed_size, fs_label, base_on):
File "/usr/bin/livecd-creator", line 408, in setup
self.ayum.setup("%s/install_root" %(self.build_dir,))
File "/usr/bin/livecd-creator", line 179, in setup
self.doGenericSetup(s)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 90, in
doGenericSetup
self.doRepoSetup()
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 299, in
doRepoSetup
repo.setup(self.conf.cache)
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 498, in setup
raise Errors.RepoError, ('Cannot open/read repomd.xml file for
repository: %s' % self)
yum.Errors.RepoError: Cannot open/read repomd.xml file for repository: core
I dont think "Repository foo is listed more than once" errors are related, and
I probably just dont know enough about fedora repositories to figure out the
cause and the solution for the repomd.xml problem... greping in the livecd
sources for repomd didnt help :-/ And /var/cache/yum/core/repomd.xml exists.
Any help/pointers certainly welcome, if needed I'll happily provide more
configuration details.
regards,
Holger
17 years
[PATCH] Use UUID or label for the filesystem
by Jeremy Katz
The USB key could just have a UUID, so allow that if there's not a filesystem
label. And use vol_id for finding the filesystem type
---
creator/isotostick.sh | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/creator/isotostick.sh b/creator/isotostick.sh
index 8a70a05..8979c9d 100644
--- a/creator/isotostick.sh
+++ b/creator/isotostick.sh
@@ -61,13 +61,19 @@ mount -o loop $ISO $CDMNT || exitclean
USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
mount $USBDEV $USBMNT || exitclean
-USBLABEL=$(/lib/udev/vol_id -l $USBDEV)
-if [ -z "$USBLABEL" ]; then
- echo "Need to have a filesystem label on your USB device"
- exitclean
+USBLABEL=$(/lib/udev/vol_id -u $USBDEV)
+if [ -n "$USBLABEL" ]; then
+ USBLABEL="UUID=$USBLABEL" ;
+else
+ USBLABEL=$(/lib/udev/vol_id -l $USBDEV)
+ if [ -n "$USBLABEL" ]; then
+ USBLABEL="LABEL=$USBLABEL"
+ else
+ echo "Need to have a filesystem label or UUID for your USB device"
+ exitclean
+ fi
fi
-# FIXME: determining the filesystem type could be cleaner..
-USBFS=$(mount | grep $USBMNT |awk {'print $5'};)
+USBFS=$(/lib/udev/vol_id -t $USBDEV)
if [ "$USBFS" != "vfat" -a "$USBFS" != "msdos" -a "$USBFS" != "ext2" -a "$USBFS" != "ext3" ]; then
echo "USB filesystem must be vfat or ext[23]"
exitclean
@@ -90,7 +96,7 @@ cp $CDMNT/isolinux/* $USBMNT/syslinux/
echo "Updating boot config file"
# adjust label and fstype
-sed -i -e "s/CDLABEL=[^ ]*/LABEL=$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" $USBMNT/syslinux/isolinux.cfg
+sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" $USBMNT/syslinux/isolinux.cfg
echo "Installing boot loader"
if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
--
1.5.0.5
17 years
Re: [Fedora-livecd-list] [patch 00/20] Fix error handling and misc. cleanups
by Jeremy Katz
On Tue, 2007-03-27 at 15:14 +0100, Mark McLoughlin wrote:
> The background to this is that I was suprised to see that
> livecd-creator had rather poor error handling (e.g. not unmounting
> stuff after certain errors, obscure error messages etc.) since
> I thought that was the main reason to re-write pilgrim in python :-)
Heh, one step at a time :-)
>From a quick look, things looked reasonable. I'll try to get to taking
a closer look at them all later today
Jeremy
17 years
Re: [Fedora-livecd-list] [patch 06/20] Cleanup unmount() and teardown()
by Jeremy Katz
On Tue, 2007-03-27 at 15:14 +0100, Mark McLoughlin wrote:
> def unmount(self):
> """detaches system bind mounts and install_root for the file system and tears down loop devices used"""
> + shutil.rmtree(self.build_dir + "/yum-cache", ignore_errors=True)
Doesn't this end up removing the contents of all of your yum cache
(which gets bind mounted from your host)?
Jeremy
17 years
[patch 20/20] Clean up mount error reporting
by Mark McLoughlin
BindChrootMount, LoopbackMount, etc. all currently return False when
their methods succeed.
Make them raise an exception when there's an error so we have some
hope of getting a more detailed error message to the user.
Also, make mount() the call to do stuff on all these classes rather
than setup() on some and mount() on others.
Signed-off-by: Mark McLoughlin <markmc(a)redhat.com>
Index: livecd/creator/livecd-creator
===================================================================
--- livecd.orig/creator/livecd-creator
+++ livecd/creator/livecd-creator
@@ -29,6 +29,10 @@ import yum
import pykickstart.parser
import pykickstart.version
+class MountError(Exception):
+ def __init__(self, msg):
+ Exception.__init__(self, msg)
+
class InstallationError(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)
@@ -38,22 +42,21 @@ class BindChrootMount:
def __init__(self, src, chroot, dest = None):
self.src = src
self.root = chroot
- if dest:
- self.dest = dest
- else:
- self.dest = src
+
+ if not dest:
+ dest = src
+ self.dest = self.root + "/" + dest
self.mounted = False
def mount(self):
if not self.mounted:
- if not os.path.exists("%s/%s" %(self.root, self.dest)):
- os.makedirs("%s/%s" %(self.root, self.dest))
- rc = subprocess.call(["/bin/mount", "--bind", self.src,
- "%s/%s" %(self.root, self.dest)])
- if rc == 0:
- self.mounted = True
- return self.mounted
+ if not os.path.exists(self.dest):
+ os.makedirs(self.dest)
+ rc = subprocess.call(["/bin/mount", "--bind", self.src, self.dest])
+ if rc != 0:
+ raise MountError("Bind-mounting '%s' to '%s' failed" % (self.src, self.dest))
+ self.mounted = True
def umount(self):
if self.mounted:
@@ -70,42 +73,38 @@ class LoopbackMount:
self.mounted = False
self.losetup = False
+ self.rmdir = False
self.loopdev = None
- def cleanup(self, rmdir = True):
+ def cleanup(self):
self.umount()
self.lounsetup()
- if rmdir:
- try:
- os.rmdir(self.mountdir)
- except OSError, e:
- pass
def umount(self):
if self.mounted:
rc = subprocess.call(["/bin/umount", self.mountdir])
self.mounted = False
+ if self.rmdir:
+ try:
+ os.rmdir(self.mountdir)
+ except OSError, e:
+ pass
+ self.rmdir = False
+
def lounsetup(self):
- if self.losetup and self.loopdev:
+ if self.losetup:
rc = subprocess.call(["/sbin/losetup", "-d", self.loopdev])
self.losetup = False
self.loopdev = None
- def setup(self):
- if not os.path.exists(self.mountdir):
- os.makedirs(self.mountdir)
- if self.loopsetup():
- if self.mount():
- return True
- return False
-
def loopsetup(self):
if self.losetup:
- return self.losetup
+ return
+
rc = subprocess.call(["/sbin/losetup", "-f", self.lofile])
if rc != 0:
- return self.losetup
+ raise MountError("Failed to allocate loop device for '%s'" % self.lofile)
# succeeded; figure out which loopdevice we're using
buf = subprocess.Popen(["/sbin/losetup", "-a"],
@@ -119,32 +118,40 @@ class LoopbackMount:
self.loopdev = fields[0][:-1]
break
- if self.loopdev:
- self.losetup = True
- return self.losetup
+ if not self.loopdev:
+ raise MountError("Failed to find loop device associated with '%s' from '/sbin/losetup -a'" % self.lofile)
+
+ self.losetup = True
def mount(self):
- if self.mounted or not self.loopdev:
- return self.mounted
+ if self.mounted:
+ return
+
+ self.loopsetup()
+
+ if not os.path.isdir(self.mountdir):
+ os.makedirs(self.mountdir)
+ self.rmdir = True
+
args = [ "/bin/mount", self.loopdev, self.mountdir ]
if self.fstype:
args.extend(["-t", self.fstype])
+
rc = subprocess.call(args)
- if rc == 0:
- self.mounted = True
- return self.mounted
+ if rc != 0:
+ raise MountError("Failed to mount '%s' to '%s'" % (self.loopdev, self.mountdir))
+
+ self.mounted = True
class SparseExt3LoopbackMount(LoopbackMount):
- def __init__(self, lofile, mountdir, size, fslabel = None):
+ def __init__(self, lofile, mountdir, size, fslabel):
LoopbackMount.__init__(self, lofile, mountdir, fstype = "ext3")
self.size = size
self.fslabel = fslabel
- if not self.fslabel:
- self.fslabel = "livecd-" + time.strftime("%Y%m%d-%H%M")
def _createSparseFile(self):
dir = os.path.dirname(self.lofile)
- if not dir:
+ if not os.path.isdir(dir):
os.makedirs(dir)
# create the sparse file
@@ -158,14 +165,14 @@ class SparseExt3LoopbackMount(LoopbackMo
rc = subprocess.call(["/sbin/mkfs.ext3", "-F", "-L", self.fslabel,
"-m", "1", self.lofile])
if rc != 0:
- raise OSError, "Error creating filesystem: %d" %(rc,)
+ raise MountError("Error creating ext3 filesystem")
rc = subprocess.call(["/sbin/tune2fs", "-c0", "-i0", "-Odir_index",
"-ouser_xattr,acl", self.lofile])
- def setup(self):
+ def mount(self):
self._createSparseFile()
self._formatFilesystem()
- return LoopbackMount.setup(self)
+ return LoopbackMount.mount(self)
class LiveCDYum(yum.YumBase):
def __init__(self):
@@ -321,14 +328,18 @@ class InstallationTarget:
"squashfs")
try:
- if not isoloop.setup():
- raise InstallationError("Failed to loopback mount '%s'" % base_on)
+ try:
+ isoloop.mount()
+ except MountError, e:
+ raise InstallationError("Failed to loopback mount '%s' : %s" % (base_on, e))
if not os.path.exists(squashloop.lofile):
raise InstallationError("'%s' is not a valid live CD ISO : squashfs.img doesn't exist" % base_on)
- if not squashloop.setup():
- raise InstallationError("Failed to loopback mount squashfs.img from '%s'" % base_on)
+ try:
+ squashloop.mount()
+ except MountError, e:
+ raise InstallationError("Failed to loopback mount squashfs.img from '%s' : %s" % (base_on, e))
os_image = self.build_dir + "/base_on_squashfs/os.img"
@@ -376,11 +387,14 @@ class InstallationTarget:
%(self.build_dir,),
"%s/install_root"
%(self.build_dir,),
- image_size)
+ image_size,
+ self.fs_label)
- if not self.instloop.setup():
- raise InstallationError("Failed to loopback mount '%s'" % self.instloop.lofile)
+ try:
+ self.instloop.mount()
+ except MountError, e:
+ raise InstallationError("Failed to loopback mount '%s' : %s" % (self.instloop.lofile, e))
if not base_on:
# create a few directories needed if it's a new image
@@ -393,12 +407,7 @@ class InstallationTarget:
for (f, dest) in [("/sys", None), ("/proc", None), ("/dev", None),
("/dev/pts", None), ("/selinux", None),
(self.build_dir + "/yum-cache", "/var/cache/yum")]:
- b = BindChrootMount(f, self.build_dir + "/install_root", dest)
-
- if not b.mount():
- raise InstallationError("Cannot mount special file system '%s'" % f)
-
- self.bindmounts.append(b)
+ self.bindmounts.append(BindChrootMount(f, self.build_dir + "/install_root", dest))
# make sure /etc/mtab is current inside install_root
os.symlink("../proc/mounts", self.build_dir + "/install_root/etc/mtab")
--
17 years
[patch 19/20] Handle invalid %post interpreter
by Mark McLoughlin
A fairly unlikely one, but give a sane error if the user requests
an unknown interpreter for any %post scriptlet
Signed-off-by: Mark McLoughlin <markmc(a)redhat.com>
Index: livecd/creator/livecd-creator
===================================================================
--- livecd.orig/creator/livecd-creator
+++ livecd/creator/livecd-creator
@@ -19,6 +19,7 @@ import getopt
import os
import os.path
import sys
+import errno
import tempfile
import time
import traceback
@@ -543,10 +544,13 @@ class InstallationTarget:
os.close(fd)
os.chmod(path, 0700)
- subprocess.call([s.interp, "/tmp/%s" %(os.path.basename(path),)],
- preexec_fn = self.run_in_root)
- os.unlink(path)
-
+ try:
+ subprocess.call([s.interp, "/tmp/%s" %(os.path.basename(path),)],
+ preexec_fn = self.run_in_root)
+ except OSError, (err, msg):
+ raise InstallationError("Failed to execute %%post script with '%s' : %s" % (s.interp, msg))
+ finally:
+ os.unlink(path)
def get_kernel_version(self):
#
--
17 years