From katzj at fedoraproject.org Thu May 1 19:15:05 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Thu, 1 May 2008 19:15:05 +0000 (UTC) Subject: [Fedora-livecd-list] 3 commits - config/livecd-fedora-base-desktop.ks config/livecd-fedora-desktop.ks Message-ID: <20080501191505.E1AC812003C@hosted1.fedoraproject.org> config/livecd-fedora-base-desktop.ks | 10 ++++++++++ config/livecd-fedora-desktop.ks | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) New commits: commit 6a5af3474fbd03897622fbf9d395da9153fc7f92 Author: Jeremy Katz Date: Thu May 1 14:58:26 2008 -0400 Need to do the desktop file dance to stop PackageKit from starting diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks index efb6fcd..48b2745 100644 --- a/config/livecd-fedora-base-desktop.ks +++ b/config/livecd-fedora-base-desktop.ks @@ -115,6 +115,13 @@ gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_refresh_cache never >/dev/null gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/notify_available false >/dev/null +# apparently, the gconf keys aren't enough +mkdir -p /home/fedora/.config/autostart +echo "X-GNOME-Autostart-enabled=false" >> /home/fedora/.config/autostart/gpk-update-icon.desktop +chown -R fedora:fedora /home/fedora/.config + + + # don't start cron/at as they tend to spawn things which are # disk intensive that are painful on a live image chkconfig --level 345 crond off 2>/dev/null commit 6498e34d75c01836460e5da142605f6a8523f3b1 Author: Jeremy Katz Date: Thu May 1 14:35:33 2008 -0400 Pre-import the Fedora key to workaround poor pk ui when updating + importing diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks index e29abdf..efb6fcd 100644 --- a/config/livecd-fedora-base-desktop.ks +++ b/config/livecd-fedora-base-desktop.ks @@ -192,6 +192,9 @@ chmod 755 /etc/rc.d/init.d/fedora-late-live /sbin/restorecon /etc/rc.d/init.d/fedora-late-live /sbin/chkconfig --add fedora-late-live +# work around for poor key import UI in PackageKit +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora + # save a little bit of space at least... rm -f /boot/initrd* # make sure there aren't core files lying around commit 3495bd164598e10c4406e074a49bdf1422ccdcb2 Author: Jeremy Katz Date: Thu Apr 24 09:57:43 2008 -0400 More scim-python-ectomy diff --git a/config/livecd-fedora-desktop.ks b/config/livecd-fedora-desktop.ks index 3bec80b..f8e1f99 100644 --- a/config/livecd-fedora-desktop.ks +++ b/config/livecd-fedora-desktop.ks @@ -133,7 +133,7 @@ festvox-slt-arctic-hts # more fun with space saving -scim-lang-chinese --scim-python-chinese +-scim-python* scim-chewing scim-pinyin From katzj at fedoraproject.org Fri May 2 02:17:37 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Fri, 2 May 2008 02:17:37 +0000 (UTC) Subject: [Fedora-livecd-list] 2 commits - config/livecd-fedora-9-base-desktop.ks config/livecd-fedora-9-desktop.ks config/livecd-fedora-9-kde.ks livecd-tools.spec Makefile Message-ID: <20080502021737.2AFE412003C@hosted1.fedoraproject.org> Makefile | 2 config/livecd-fedora-9-base-desktop.ks | 223 +++++++++++++++++++++++++++++++++ config/livecd-fedora-9-desktop.ks | 172 +++++++++++++++++++++++++ config/livecd-fedora-9-kde.ks | 94 +++++++++++++ livecd-tools.spec | 10 + 5 files changed, 499 insertions(+), 2 deletions(-) New commits: commit 8f70c932e38d5762bce8d6bfd32e6072ff200df8 Author: Jeremy Katz Date: Thu May 1 21:58:29 2008 -0400 Bump version. diff --git a/Makefile b/Makefile index 22c9c2e..9d26df5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -VERSION = 015 +VERSION = 016 INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} diff --git a/livecd-tools.spec b/livecd-tools.spec index 56b82d4..b2c50f1 100644 --- a/livecd-tools.spec +++ b/livecd-tools.spec @@ -4,7 +4,7 @@ Summary: Tools for building live CD's Name: livecd-tools -Version: 015 +Version: 016 Release: 1%{?dist} License: GPLv2 Group: System Environment/Base @@ -62,6 +62,14 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/imgcreate/*.pyc %changelog +* Thu May 1 2008 Jeremy Katz - 016-1 +- Config changes all around, including F9 final configs +- Fix up the minimal image creation +- Fix odd traceback error on __del__ (#442443) +- Add late initscript and split things in half +- livecd-iso-to-disk: Check the available space on the stick (#443046) +- Fix partition size overriding (kanarip) + * Thu Mar 6 2008 Jeremy Katz - 015-1 - Support for using live isos with pxe booting (Richard W.M. Jones and Chris Lalancette) commit b693a8fad6f065200f0e674a4bf9a6166cd0bcb2 Author: Jeremy Katz Date: Thu May 1 21:57:55 2008 -0400 Add Fedora 9 configs diff --git a/config/livecd-fedora-9-base-desktop.ks b/config/livecd-fedora-9-base-desktop.ks new file mode 100644 index 0000000..70d4162 --- /dev/null +++ b/config/livecd-fedora-9-base-desktop.ks @@ -0,0 +1,223 @@ +lang en_US.UTF-8 +keyboard us +timezone US/Eastern +auth --useshadow --enablemd5 +selinux --enforcing +firewall --disabled +xconfig --startxonboot +part / --size 4096 +services --enabled=NetworkManager --disabled=network,sshd + +repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-9&arch=$basearch +repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f9&arch=$basearch + +%packages + at base-x + at base + at core + at fonts + at admin-tools + at dial-up + at hardware-support + at printing +kernel +memtest86+ + +# save some space +-specspo +-esc +-samba-client +-a2ps +-mpage +-redhat-lsb +-sox +-hplip +-hpijs +# smartcards won't really work on the livecd. +-coolkey +-ccid +# duplicate functionality +-pinfo +-vorbis-tools +-wget +# dasher is just too big +-dasher +# lose the compat stuff +-compat* + +# qlogic firmwares +-ql2100-firmware +-ql2200-firmware +-ql23xx-firmware +-ql2400-firmware + +# scanning takes quite a bit of space :/ +-xsane +-xsane-gimp +-sane-backends + +# livecd bits to set up the livecd and be able to install +anaconda +isomd5sum + +# make sure debuginfo doesn't end up on the live image +-*debuginfo +%end + +%post +# FIXME: it'd be better to get this installed from a package +cat > /etc/rc.d/init.d/fedora-live << EOF +#!/bin/bash +# +# live: Init script for live image +# +# chkconfig: 345 00 99 +# description: Init script for live image. + +. /etc/init.d/functions + +if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [ -e /.liveimg-configured ] ; then + exit 0 +fi + +exists() { + which \$1 >/dev/null 2>&1 || return + \$* +} + +touch /.liveimg-configured + +# mount live image +if [ -b /dev/live ]; then + mkdir -p /mnt/live + mount -o ro /dev/live /mnt/live +fi + +# enable swaps unless requested otherwise +swaps=\`blkid -t TYPE=swap -o device\` +if ! strstr "\`cat /proc/cmdline\`" noswap -a [ -n "\$swaps" ] ; then + for s in \$swaps ; do + action "Enabling swap partition \$s" swapon \$s + done +fi + +# add fedora user with no passwd +useradd -c "Fedora Live" fedora +passwd -d fedora > /dev/null + +# turn off firstboot for livecd boots +chkconfig --level 345 firstboot off 2>/dev/null + +# don't start yum-updatesd for livecd boots +chkconfig --level 345 yum-updatesd off 2>/dev/null + +# don't do packagekit checking by default +gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_get_updates never >/dev/null +gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_refresh_cache never >/dev/null +gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/notify_available false >/dev/null + +# apparently, the gconf keys aren't enough +mkdir -p /home/fedora/.config/autostart +echo "X-GNOME-Autostart-enabled=false" >> /home/fedora/.config/autostart/gpk-update-icon.desktop +chown -R fedora:fedora /home/fedora/.config + + + +# don't start cron/at as they tend to spawn things which are +# disk intensive that are painful on a live image +chkconfig --level 345 crond off 2>/dev/null +chkconfig --level 345 atd off 2>/dev/null +chkconfig --level 345 anacron off 2>/dev/null +chkconfig --level 345 readahead_early off 2>/dev/null +chkconfig --level 345 readahead_later off 2>/dev/null + +# Stopgap fix for RH #217966; should be fixed in HAL instead +touch /media/.hal-mtab + +# workaround clock syncing on shutdown that we don't want (#297421) +sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt +EOF + +# bah, hal starts way too late +cat > /etc/rc.d/init.d/fedora-late-live << EOF +#!/bin/bash +# +# live: Late init script for live image +# +# chkconfig: 345 99 01 +# description: Late init script for live image. + +. /etc/init.d/functions + +if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then + exit 0 +fi + +exists() { + which \$1 >/dev/null 2>&1 || return + \$* +} + +touch /.liveimg-late-configured + +# read some variables out of /proc/cmdline +for o in \`cat /proc/cmdline\` ; do + case \$o in + ks=*) + ks="\${o#ks=}" + ;; + xdriver=*) + xdriver="--set-driver=\${o#xdriver=}" + ;; + esac +done + + +# if liveinst or textinst is given, start anaconda +if strstr "\`cat /proc/cmdline\`" liveinst ; then + /usr/sbin/liveinst \$ks +fi +if strstr "\`cat /proc/cmdline\`" textinst ; then + /usr/sbin/liveinst --text \$ks +fi + +# configure X, allowing user to override xdriver +if [ -n "\$xdriver" ]; then + exists system-config-display --noui --reconfig --set-depth=24 \$xdriver +fi + +EOF + +# workaround avahi segfault (#279301) +touch /etc/resolv.conf +/sbin/restorecon /etc/resolv.conf + +chmod 755 /etc/rc.d/init.d/fedora-live +/sbin/restorecon /etc/rc.d/init.d/fedora-live +/sbin/chkconfig --add fedora-live + +chmod 755 /etc/rc.d/init.d/fedora-late-live +/sbin/restorecon /etc/rc.d/init.d/fedora-late-live +/sbin/chkconfig --add fedora-late-live + +# work around for poor key import UI in PackageKit +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora + +# save a little bit of space at least... +rm -f /boot/initrd* +# make sure there aren't core files lying around +rm -f /core* + +%end + + +%post --nochroot +cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL +cp $INSTALL_ROOT/usr/share/doc/HTML/readme-live-image/en_US/readme-live-image-en_US.txt $LIVE_ROOT/README + +# only works on x86, x86_64 +if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then + if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi + cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS +fi +%end diff --git a/config/livecd-fedora-9-desktop.ks b/config/livecd-fedora-9-desktop.ks new file mode 100644 index 0000000..f8e1f99 --- /dev/null +++ b/config/livecd-fedora-9-desktop.ks @@ -0,0 +1,172 @@ +%include livecd-fedora-base-desktop.ks + +%packages + at games + at graphical-internet + at graphics + at sound-and-video + at gnome-desktop +nss-mdns +NetworkManager-vpnc +NetworkManager-openvpn +# we don't include @office so that we don't get OOo. but some nice bits +abiword +gnumeric +#planner +#inkscape + + at albanian-support + at arabic-support + at assamese-support + at basque-support + at belarusian-support + at bengali-support + at brazilian-support + at british-support + at bulgarian-support + at catalan-support + at chinese-support + at czech-support + at danish-support + at dutch-support + at estonian-support + at finnish-support + at french-support + at galician-support + at georgian-support + at german-support + at greek-support + at gujarati-support + at hebrew-support + at hindi-support + at hungarian-support + at indonesian-support + at italian-support + at japanese-support + at kannada-support + at korean-support + at latvian-support + at lithuanian-support + at macedonian-support + at malayalam-support + at marathi-support + at nepali-support + at norwegian-support + at oriya-support + at persian-support + at polish-support + at portuguese-support + at punjabi-support + at romanian-support + at russian-support + at serbian-support + at slovak-support + at slovenian-support + at spanish-support + at swedish-support + at tamil-support + at telugu-support + at thai-support + at turkish-support + at ukrainian-support + at vietnamese-support + at welsh-support + +# The following locales have less than 50% translation coverage for the core +# GNOME stack, as found at http://l10n.gnome.org/languages/ + +#@afrikaans-support +#@armenian-support +#@bhutanese-support +#@bosnian-support +#@breton-support +#@croatian-support +#@esperanto-support +#@ethiopic-support +#@faeroese-support +#@filipino-support +#@gaelic-support +#@icelandic-support +#@inuktitut-support +#@irish-support +#@khmer-support +#@lao-support +#@low-saxon-support +#@malay-support +#@maori-support +#@mongolian-support +#@northern-sami-support +#@northern-sotho-support +#@samoan-support +#@sinhala-support +#@somali-support +#@southern-ndebele-support +#@southern-sotho-support +#@swati-support +#@tagalog-support +#@tibetan-support +#@tonga-support +#@tsonga-support +#@tswana-support +#@urdu-support +#@venda-support +#@walloon-support +#@xhosa-support +#@zulu-support + +# These fonts are only used in the commented-out locales above +-lklug-fonts +-abyssinica-fonts +-jomolhari-fonts + +# avoid weird case where we pull in more festival stuff than we need +festival +festvox-slt-arctic-hts + +# dictionaries are big +-aspell-* +-hunspell-* +-man-pages-* +-scim-tables-* +-wqy-bitmap-fonts +-dejavu-fonts-experimental + +# more fun with space saving +-scim-lang-chinese +-scim-python* +scim-chewing +scim-pinyin + +# save some space +-gnome-user-docs +-gimp-help +-evolution-help +-autofs +-nss_db +-vino +-dasher +-evince-dvi +-evince-djvu +# not needed for gnome +-acpid +# temporary - drags in many deps +-ekiga +-tomboy +-f-spot +%end + +%post +cat >> /etc/rc.d/init.d/fedora-live << EOF +# disable screensaver locking +gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-screensaver/lock_enabled false >/dev/null +# set up timed auto-login for after 60 seconds +cat >> /etc/gdm/custom.conf << FOE +[daemon] +TimedLoginEnable=true +TimedLogin=fedora +TimedLoginDelay=60 +FOE + +EOF + +%end diff --git a/config/livecd-fedora-9-kde.ks b/config/livecd-fedora-9-kde.ks new file mode 100644 index 0000000..8cefa08 --- /dev/null +++ b/config/livecd-fedora-9-kde.ks @@ -0,0 +1,94 @@ +%include livecd-fedora-base-desktop.ks + +%packages + at kde-desktop + +# include nm-applet directly +NetworkManager-gnome + +# unwanted packages from @kde-desktop +# don't include these for now to fit on a cd +# digikam (~11 megs), ktorrent (~3 megs), amarok (~14 megs), +# kdegames (~23 megs) +-amarok +-digikam +-kdeedu +-scribus +#-ktorrent +#-kdegames +#-kftpgrabber* + +# KDE 3 +koffice-kword +koffice-kspread +koffice-kpresenter +koffice-filters +k3b +filelight +# twinkle (~10 megs) +#twinkle + +# some extras +fuse +pavucontrol + +# additional fonts + at fonts +fonts-ISO8859-2 +#cjkunifonts-ukai +madan-fonts +fonts-KOI8-R +fonts-KOI8-R-100dpi +tibetan-machine-uni-fonts + +# FIXME/TODO: recheck the removals here +# try to remove some packages from livecd-fedora-base-desktop.ks +-gdm +-authconfig-gtk + +# save some space (from @base) +-make +-nss_db +-autofs + +%end + +%post + +# create /etc/sysconfig/desktop (needed for installation) +cat > /etc/sysconfig/desktop <> /etc/rc.d/init.d/fedora-live << EOF + +if [ -e /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png ] ; then + # use image also for kdm + mkdir -p /usr/share/apps/kdm/faces + cp /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png /usr/share/apps/kdm/faces/fedora.face.icon +fi + +# make fedora user use KDE +echo "startkde" > /home/fedora/.xsession +chmod a+x /home/fedora/.xsession +chown fedora:fedora /home/fedora/.xsession + +# set up autologin for user fedora +sed -i 's/#AutoLoginEnable=true/AutoLoginEnable=true/' /etc/kde/kdm/kdmrc +sed -i 's/#AutoLoginUser=fred/AutoLoginUser=fedora/' /etc/kde/kdm/kdmrc + +# set up user fedora as default user and preselected user +sed -i 's/#PreselectUser=Default/PreselectUser=Default/' /etc/kde/kdm/kdmrc +sed -i 's/#DefaultUser=johndoe/DefaultUser=fedora/' /etc/kde/kdm/kdmrc + +# add liveinst.desktop to favorites menu +mkdir -p /home/fedora/.kde/share/config/ +cat > /home/fedora/.kde/share/config/kickoffrc << MENU_EOF +[Favorites] +FavoriteURLs=/usr/share/applications/kde4/konqbrowser.desktop,/usr/share/applications/kde4/dolphin.desktop,/usr/share/applications/kde4/systemsettings.desktop,/usr/share/applications/liveinst.desktop +MENU_EOF +chown -R fedora:fedora /home/fedora/.kde/ + +%end From katzj at fedoraproject.org Fri May 2 02:17:39 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Fri, 2 May 2008 02:17:39 +0000 (UTC) Subject: [Fedora-livecd-list] Changes to 'refs/tags/livecd-tools-016' Message-ID: <20080502021739.649B912003D@hosted1.fedoraproject.org> Tag 'livecd-tools-016' created by Jeremy Katz at 2008-05-02 02:00 +0000 livecd-tools-016 Changes since livecd-tools-015-38: --- 0 files changed --- From katzj at fedoraproject.org Fri May 2 02:17:39 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Fri, 2 May 2008 02:17:39 +0000 (UTC) Subject: [Fedora-livecd-list] Changes to 'refs/tags/livecd-tools-013' Message-ID: <20080502021739.091B312003C@hosted1.fedoraproject.org> Tag 'livecd-tools-013' created by Jeremy Katz at 2008-03-24 23:06 +0000 livecd-tools-013 Changes since livecd-tools-012-46: --- 0 files changed --- From kanarip at kanarip.com Fri May 2 12:42:09 2008 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Fri, 02 May 2008 14:42:09 +0200 Subject: [Fedora-livecd-list] 2 commits - config/livecd-fedora-9-base-desktop.ks config/livecd-fedora-9-desktop.ks config/livecd-fedora-9-kde.ks livecd-tools.spec Makefile In-Reply-To: <20080502021737.2AFE412003C@hosted1.fedoraproject.org> References: <20080502021737.2AFE412003C@hosted1.fedoraproject.org> Message-ID: <481B0C21.5030603@kanarip.com> Jeremy Katz wrote: > Makefile | 2 > config/livecd-fedora-9-base-desktop.ks | 223 +++++++++++++++++++++++++++++++++ > config/livecd-fedora-9-desktop.ks | 172 +++++++++++++++++++++++++ > config/livecd-fedora-9-kde.ks | 94 +++++++++++++ > livecd-tools.spec | 10 + > 5 files changed, 499 insertions(+), 2 deletions(-) > Am I assuming correctly that only these spins made it into the Fedora 9 Release cycle? Kind regards, Jeroen van Meeuwen -kanarip From todd655495 at yahoo.com Fri May 2 14:44:15 2008 From: todd655495 at yahoo.com (Todd N) Date: Fri, 2 May 2008 07:44:15 -0700 (PDT) Subject: [Fedora-livecd-list] Custom spin of Fedora - non-package customizations In-Reply-To: <48173C91.2030202@datawranglers.com> Message-ID: <86919.62978.qm@web54007.mail.re2.yahoo.com> Thanks, Tim, for the information. OK, here's another one... I'd like to be able to make a bunch of Live CDs that are identical (with all of our customizations) EXCEPT for a small bit of information that will be different for each CD. Is there some special location on the Live CD image that these per-user configurations can be placed, after the image has been created? My goal here is to avoid having to run livecd-creator to create a slightly different image for each individual user. It would be a great help if there were some "override area" outside of the Live CD's ext3 (/) file system, such that any files placed there would take the place of the equivalent files within the Live CD's already created ext3 system. Thanks, Todd Tim Wood wrote: There really isn't a great tutorial for things beyond the basics (although if someone knows of one, please correct me). The mailing list archive is a good place to find this stuff as long as you throw the right search terms at it. But, a couple of quickies from my notes: For non-standard packages, create a basic archive (put the packages in a directory, run createrepo on that directory) and then add it to your list of repositories. Display settings... I believe that's a standard kickstart options. Maybe someone else will pipe up. You can directly change firefox-related stuff by editing /usr/lib/firefox-2.0.0.5/defaults/pref/all-redhat.js But, the simplest way (for me) to do this and the rest of the things you can to do is by booting up your livecd, customizing things to taste (e.g. set your browser config, cookies, etc) and then tar up the appropriate parts of /home/[username]. Copy that tar file to someplace your kickstart can reach and then add something in post %nochroot to untar the file & copy everything to /etc/skel/. I've never tried it, but you should (theoretically) be able to just tar up (make sure you use the permissions flag) the whole user home directory and just stomp /etc/skel in post %nochroot. Note, some things seem to be more resistant to this treatment than others. It appears that when the actual user directory is created some things are automatically set, overiding settings you throw into /etc/skel. For instance, I tend to just replace the default desktop graphic file (/usr/blah/blah/blah) rather than trying to convince /etc/skel to point to my custom graphic. Tim Todd N wrote: Hello, I am trying to determine the best way to create a custom spin of Fedora which, in addition to having a customized set of standard Fedora packages that we need for our environment, also includes changes like: * Browser configuration changes * Possible browser cookie(s) added * Display settings * Installation of non-standard packages (i.e. packages you would not find in a standard yum repository * Other custom changes to individual files I know that the Kickstart file allows for post install customizations. I am wondering whether anyone could point me towards a good tutorial that would help me in setting up these detailed config changes. I am also researching on my own, but any additional ideas are appreciated. Thanks much, Todd --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. --------------------------------- -- Fedora-livecd-list mailing list Fedora-livecd-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list -- _________________________________ Tim Wood, CLP, RHCT 719.338.7484 (tel) The Data Wranglers Web, Database & more since since 1994 www.datawranglers.com -- Fedora-livecd-list mailing list Fedora-livecd-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.wood at datawranglers.com Fri May 2 15:18:30 2008 From: tim.wood at datawranglers.com (Tim Wood) Date: Fri, 02 May 2008 09:18:30 -0600 Subject: [Fedora-livecd-list] Custom spin of Fedora - non-package customizations In-Reply-To: <86919.62978.qm@web54007.mail.re2.yahoo.com> References: <86919.62978.qm@web54007.mail.re2.yahoo.com> Message-ID: <481B30C6.4030507@datawranglers.com> I believe that if you mount the iso r/w (e.g. mount -o loop my.iso /mnt/iso), you'll be able to make the changes you're asking about. The iso/cd is actually mounted at something like /mnt/LiveCD so you can reference things that way. But, if someone else on the list remembers a step I'm leaving out, please point it out. If you end up going down the write-things-to-cf/usb route, you can do other things like using the persistence mechanism and/or creating a second partition and writing files there. Tim Todd N wrote: > Thanks, Tim, for the information. OK, here's another one... I'd like > to be able to make a bunch of Live CDs that are identical (with all of > our customizations) EXCEPT for a small bit of information that will be > different for each CD. Is there some special location on the Live CD > image that these per-user configurations can be placed, after the > image has been created? My goal here is to avoid having to run > livecd-creator to create a slightly different image for each > individual user. It would be a great help if there were some > "override area" outside of the Live CD's ext3 (/) file system, such > that any files placed there would take the place of the equivalent > files within the Live CD's already created ext3 system. > > Thanks, > Todd > > */Tim Wood /* wrote: > > There really isn't a great tutorial for things beyond the basics > (although if someone knows of one, please correct me). The > mailing list archive is a good place to find this stuff as long as > you throw the right search terms at it. But, a couple of quickies > from my notes: > > For non-standard packages, create a basic archive (put the > packages in a directory, run createrepo on that directory) and > then add it to your list of repositories. > > Display settings... I believe that's a standard kickstart > options. Maybe someone else will pipe up. > > You can directly change firefox-related stuff by editing > |/usr/lib/firefox-2.0.0.5/defaults/pref/all-redhat.js| > But, the simplest way (for me) to do this and the rest of the > things you can to do is by booting up your livecd, customizing > things to taste (e.g. set your browser config, cookies, etc) and > then tar up the appropriate parts of /home/[username]. Copy that > tar file to someplace your kickstart can reach and then add > something in post %nochroot to untar the file & copy everything to > /etc/skel/. I've never tried it, but you should (theoretically) > be able to just tar up (make sure you use the permissions flag) > the whole user home directory and just stomp /etc/skel in post > %nochroot. > > Note, some things seem to be more resistant to this treatment than > others. It appears that when the actual user directory is created > some things are automatically set, overiding settings you throw > into /etc/skel. For instance, I tend to just replace the default > desktop graphic file (/usr/blah/blah/blah) rather than trying to > convince /etc/skel to point to my custom graphic. > > Tim > > > > Todd N wrote: >> Hello, >> >> I am trying to determine the best way to create a custom spin of >> Fedora which, in addition to having a customized set of >> standard Fedora packages that we need for our environment, also >> includes changes like: >> >> * Browser configuration changes >> * Possible browser cookie(s) added >> * Display settings >> * Installation of non-standard packages (i.e. packages you would >> not find in a standard yum repository >> * Other custom changes to individual files >> >> I know that the Kickstart file allows for post install >> customizations. I am wondering whether anyone could point me >> towards a good tutorial that would help me in setting up these >> detailed config changes. I am also researching on my own, but >> any additional ideas are appreciated. >> >> Thanks much, >> Todd >> ------------------------------------------------------------------------ >> Be a better friend, newshound, and know-it-all with Yahoo! >> Mobile. Try it now. >> >> >> ------------------------------------------------------------------------ >> -- Fedora-livecd-list mailing list Fedora-livecd-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > > -- _________________________________ Tim Wood, CLP, RHCT 719.338.7484 (tel) The Data Wranglers Web, Database & more since since 1994 www.datawranglers.com > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > > ------------------------------------------------------------------------ > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try > it now. > > > ------------------------------------------------------------------------ > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > -- _________________________________ Tim Wood, CLP, RHCT 719.338.7484 (tel) The Data Wranglers Web, Database & more since since 1994 www.datawranglers.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From danjde at msw.it Fri May 2 16:32:42 2008 From: danjde at msw.it (Davide Marchi) Date: Fri, 02 May 2008 18:32:42 +0200 Subject: [Fedora-livecd-list] liveinstall (anaconda-11.3.0.50-2) hangs on install process Message-ID: <481B422A.5040009@msw.it> Hi, just rebuild cosmogoniA Live DVD (www.cosmogonia.org) now, im testing the livecd install process: the "liveinst" completes the previous procedures, but at the "post-install" procedure it hangs: remaining in attended for an indefinite time and the procedure still incomplete any suggestion? thanks! -- cosmogoniA noprovarenofareononfarenonc'?provare -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3271 bytes Desc: S/MIME Cryptographic Signature URL: From danjde at msw.it Sun May 4 12:41:48 2008 From: danjde at msw.it (Davide Marchi) Date: Sun, 04 May 2008 14:41:48 +0200 Subject: [Fedora-livecd-list] liveinstall (anaconda-11.3.0.50-2) hangs on install process Message-ID: <481DAF0C.1030402@msw.it> > > Hi, > just rebuild cosmogoniA Live DVD (www.cosmogonia.org) > > now, im testing the livecd install process: > > > the "liveinst" completes the previous procedures, but at the > "post-install" procedure it hangs: remaining in attended for an > indefinite time > and the procedure still incomplete > > any suggestion? > > thanks! > > -- > cosmogoniA > noprovarenofareononfarenonc'?provare > > Hi himself! Do you have perhaps disabled Selinux on your live cd ?!?.. This problem occurs, of course, because of a bug in Anaconda (anaconda-11.3.0.50-2): Anaconda is unable to complete the installation process _if the system is not Selinux enabled! _You have to enable Selinux on livecd (enforce or permissive), re run "liveinst", Anaconda only then will be able to complete the process ciao! -- cosmogoniA noprovarenofareononfarenonc'?provare -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3271 bytes Desc: S/MIME Cryptographic Signature URL: From sundaram at fedoraproject.org Sun May 4 13:22:33 2008 From: sundaram at fedoraproject.org (Rahul Sundaram) Date: Sun, 04 May 2008 18:52:33 +0530 Subject: [Fedora-livecd-list] liveinstall (anaconda-11.3.0.50-2) hangs on install process In-Reply-To: <481DAF0C.1030402@msw.it> References: <481DAF0C.1030402@msw.it> Message-ID: <481DB899.6080801@fedoraproject.org> Davide Marchi wrote: > Do you have perhaps disabled Selinux on your live cd ?!?.. > This problem occurs, of course, because of a bug in Anaconda > (anaconda-11.3.0.50-2): This isn't a bug in Anaconda. This is because loading the guest policy on the host system while installing packages into the chroot causes problems. Workaround is to set SELinux at permissive state when creating live cd images. Discussions at https://www.redhat.com/archives/fedora-selinux-list/2008-April/msg00047.html Rahul From astrand at cendio.se Mon May 5 14:39:02 2008 From: astrand at cendio.se (=?UTF-8?Q?Peter_=C3=85strand?=) Date: Mon, 5 May 2008 16:39:02 +0200 (CEST) Subject: [Fedora-livecd-list] Keyboard configuration Message-ID: It seems like the current LiveCD tools for F8 does not correctly handle keyboard configuration via Kickstart. We have a line: lang sv_SE.UTF-8 ...in our ks.cfg. The console keyboard layout is correctly set. However, The X11 layout is sometimes wrong: * On two machines, there's no /etc/X11/xorg.conf, and the layout is english. * On a third machine, there's a /etc/X11/xorg.conf (with a comment about system-config-keyboard), and the keyboard is correctly set. Any ideas why? I've found this comment in /usr/bin/livecd-creator: # next, the keyboard # FIXME: should this impact the X keyboard config too??? # or do we want to make X be able to do this mapping Has this FIXME been fixed, perhaps? Regards, --- Peter ?strand ThinLinc Chief Developer Cendio AB http://www.cendio.se Wallenbergs gata 4 583 30 Link?ping Phone: +46-13-21 46 00 From patrice.guay at nanotechnologies.qc.ca Mon May 5 14:59:50 2008 From: patrice.guay at nanotechnologies.qc.ca (Patrice Guay) Date: Mon, 05 May 2008 10:59:50 -0400 Subject: [Fedora-livecd-list] Keyboard configuration In-Reply-To: References: Message-ID: <481F20E6.8020202@nanotechnologies.qc.ca> Peter ?strand wrote : > It seems like the current LiveCD tools for F8 does not correctly handle > keyboard configuration via Kickstart. We have a line: > > lang sv_SE.UTF-8 > > ...in our ks.cfg. The console keyboard layout is correctly set. However, > The X11 layout is sometimes wrong: > On my own LiveCD respin, I patched the kudzu script so that the keyboard is correctly configured for X. Basically, I'm adding those 2 lines in /etc/init.d/kudzu: . /etc/sysconfig/keyboard /usr/bin/system-config-keyboard \$KEYTABLE 2&> /dev/null Regards, -- Patrice From astrand at cendio.se Mon May 5 15:04:49 2008 From: astrand at cendio.se (=?UTF-8?Q?Peter_=C3=85strand?=) Date: Mon, 5 May 2008 17:04:49 +0200 (CEST) Subject: [Fedora-livecd-list] Keyboard configuration In-Reply-To: <481F20E6.8020202@nanotechnologies.qc.ca> References: <481F20E6.8020202@nanotechnologies.qc.ca> Message-ID: > > It seems like the current LiveCD tools for F8 does not correctly handle > > keyboard configuration via Kickstart. We have a line: > > > > lang sv_SE.UTF-8 > > > > ...in our ks.cfg. The console keyboard layout is correctly set. However, > > The X11 layout is sometimes wrong: > > > > On my own LiveCD respin, I patched the kudzu script so that the keyboard is > correctly configured for X. Basically, I'm adding those 2 lines in > /etc/init.d/kudzu: > > . /etc/sysconfig/keyboard > /usr/bin/system-config-keyboard \$KEYTABLE 2&> /dev/null Thanks for the hint. But does this really work when there's no xorg.conf, or XF86Config, at all? /usr/share/system-config-keyboard/keyboard_backend.py contains: def modifyXconfig(self, fullname, layout, model, variant, options): #import xf86config and make the necessary changes if os.access("/etc/X11/XF86Config", os.W_OK) or os.access("/etc/X11/xorg.conf", os.W_OK): import xf86config In other words, modifyXconfig does nothing if there's no X config file. Regards, --- Peter ?strand ThinLinc Chief Developer Cendio AB http://www.cendio.se Wallenbergs gata 4 583 30 Link?ping Phone: +46-13-21 46 00 From patrice.guay at nanotechnologies.qc.ca Mon May 5 15:19:52 2008 From: patrice.guay at nanotechnologies.qc.ca (Patrice Guay) Date: Mon, 05 May 2008 11:19:52 -0400 Subject: [Fedora-livecd-list] Keyboard configuration In-Reply-To: References: <481F20E6.8020202@nanotechnologies.qc.ca> Message-ID: <481F2598.2090500@nanotechnologies.qc.ca> Peter ?strand a ?crit : >>> It seems like the current LiveCD tools for F8 does not correctly handle >>> keyboard configuration via Kickstart. We have a line: >>> >>> lang sv_SE.UTF-8 >>> >>> ...in our ks.cfg. The console keyboard layout is correctly set. However, >>> The X11 layout is sometimes wrong: >>> >>> >> On my own LiveCD respin, I patched the kudzu script so that the keyboard is >> correctly configured for X. Basically, I'm adding those 2 lines in >> /etc/init.d/kudzu: >> >> . /etc/sysconfig/keyboard >> /usr/bin/system-config-keyboard \$KEYTABLE 2&> /dev/null >> > > Thanks for the hint. But does this really work when there's no xorg.conf, > or XF86Config, at all? > /usr/share/system-config-keyboard/keyboard_backend.py contains: > > def modifyXconfig(self, fullname, layout, model, variant, options): > #import xf86config and make the necessary changes > if os.access("/etc/X11/XF86Config", os.W_OK) or os.access("/etc/X11/xorg.conf", os.W_OK): > import xf86config > > In other words, modifyXconfig does nothing if there's no X config file. > I think kudzu generates an xorg.conf if no configuration file is present. At least, that is the behavior on CentOS 5 (Fedora 6). -- Patrice From astrand at cendio.se Mon May 5 15:48:57 2008 From: astrand at cendio.se (=?UTF-8?Q?Peter_=C3=85strand?=) Date: Mon, 5 May 2008 17:48:57 +0200 (CEST) Subject: [Fedora-livecd-list] Keyboard configuration In-Reply-To: <481F2598.2090500@nanotechnologies.qc.ca> References: <481F20E6.8020202@nanotechnologies.qc.ca> <481F2598.2090500@nanotechnologies.qc.ca> Message-ID: On Mon, 5 May 2008, Patrice Guay wrote: > I think kudzu generates an xorg.conf if no configuration file is > present. At least, that is the behavior > on CentOS 5 (Fedora 6). Not on F8, it seems. However, adding "system-config-display --noui" to /etc/rc.local seems to fix the problem. Regards, --- Peter ?strand ThinLinc Chief Developer Cendio AB http://www.cendio.se Wallenbergs gata 4 583 30 Link?ping Phone: +46-13-21 46 00 From notting at fedoraproject.org Tue May 6 16:28:25 2008 From: notting at fedoraproject.org (Bill Nottingham) Date: Tue, 6 May 2008 16:28:25 +0000 (UTC) Subject: [Fedora-livecd-list] 3 commits - config/livecd-fedora-9-desktop.ks config/livecd-fedora-9-kde.ks livecd-tools.spec Makefile Message-ID: <20080506162825.C0EB4120041@hosted1.fedoraproject.org> Makefile | 2 +- config/livecd-fedora-9-desktop.ks | 2 +- config/livecd-fedora-9-kde.ks | 2 +- livecd-tools.spec | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) New commits: commit 1b0f74f8ba7992fd9d757f07484e743d693e1d55 Author: Bill Nottingham Date: Tue May 6 12:11:24 2008 -0400 bump to 017 diff --git a/Makefile b/Makefile index 9d26df5..4ac33b5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -VERSION = 016 +VERSION = 017 INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} commit 8470b7e054df5bcb2fa28568dd99809f5c53f6b1 Author: Bill Nottingham Date: Tue May 6 12:11:01 2008 -0400 bump release diff --git a/livecd-tools.spec b/livecd-tools.spec index b2c50f1..f6a5ef1 100644 --- a/livecd-tools.spec +++ b/livecd-tools.spec @@ -4,7 +4,7 @@ Summary: Tools for building live CD's Name: livecd-tools -Version: 016 +Version: 017 Release: 1%{?dist} License: GPLv2 Group: System Environment/Base @@ -62,6 +62,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/imgcreate/*.pyc %changelog +* Tue May 6 2008 Bill Nottingham - 017-1 +- fix F9 final configs + * Thu May 1 2008 Jeremy Katz - 016-1 - Config changes all around, including F9 final configs - Fix up the minimal image creation commit 677eb030a9149b30691c166e9b85b65d017a01b6 Author: Bill Nottingham Date: Tue May 6 12:10:00 2008 -0400 fix includes diff --git a/config/livecd-fedora-9-desktop.ks b/config/livecd-fedora-9-desktop.ks index f8e1f99..3e59073 100644 --- a/config/livecd-fedora-9-desktop.ks +++ b/config/livecd-fedora-9-desktop.ks @@ -1,4 +1,4 @@ -%include livecd-fedora-base-desktop.ks +%include livecd-fedora-9-base-desktop.ks %packages @games diff --git a/config/livecd-fedora-9-kde.ks b/config/livecd-fedora-9-kde.ks index 8cefa08..3f69d52 100644 --- a/config/livecd-fedora-9-kde.ks +++ b/config/livecd-fedora-9-kde.ks @@ -1,4 +1,4 @@ -%include livecd-fedora-base-desktop.ks +%include livecd-fedora-9-base-desktop.ks %packages @kde-desktop From notting at fedoraproject.org Tue May 6 19:49:58 2008 From: notting at fedoraproject.org (Bill Nottingham) Date: Tue, 6 May 2008 19:49:58 +0000 (UTC) Subject: [Fedora-livecd-list] config/livecd-fedora-9-base-desktop.ks config/livecd-fedora-base-desktop.ks Message-ID: <20080506194958.E92FB120041@hosted1.fedoraproject.org> config/livecd-fedora-9-base-desktop.ks | 1 + config/livecd-fedora-base-desktop.ks | 1 + 2 files changed, 2 insertions(+) New commits: commit 52818123d1acee1490345557c6bfe34a231afb70 Author: Bill Nottingham Date: Tue May 6 15:30:01 2008 -0400 remove db env before importing keys (Hey, makes the image smaller, too!) diff --git a/config/livecd-fedora-9-base-desktop.ks b/config/livecd-fedora-9-base-desktop.ks index 70d4162..0b21d9a 100644 --- a/config/livecd-fedora-9-base-desktop.ks +++ b/config/livecd-fedora-9-base-desktop.ks @@ -201,6 +201,7 @@ chmod 755 /etc/rc.d/init.d/fedora-late-live /sbin/chkconfig --add fedora-late-live # work around for poor key import UI in PackageKit +rm -f /var/lib/rpm/__db* rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora # save a little bit of space at least... diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks index 48b2745..ad5ec32 100644 --- a/config/livecd-fedora-base-desktop.ks +++ b/config/livecd-fedora-base-desktop.ks @@ -200,6 +200,7 @@ chmod 755 /etc/rc.d/init.d/fedora-late-live /sbin/chkconfig --add fedora-late-live # work around for poor key import UI in PackageKit +rm -f /var/lib/rpm/__db* rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora # save a little bit of space at least... From livecd at mjkern2000.fastmail.fm Fri May 9 18:21:47 2008 From: livecd at mjkern2000.fastmail.fm (livecd at mjkern2000.fastmail.fm) Date: Fri, 09 May 2008 11:21:47 -0700 Subject: [Fedora-livecd-list] Question In-Reply-To: <20080507160017.52F5B618E3E@hormel.redhat.com> References: <20080507160017.52F5B618E3E@hormel.redhat.com> Message-ID: <1210357307.16943.1252317073@webmail.messagingengine.com> I am looking for something that will make a kickstart config file for Fedora based on an installed and patched system that has all the configs and software installed that I want. Then I would like to build a live CD based on that workstation that would run on that same device (but without the hard drive, as the hard drive removes. I would put a flash drive there and do some sort of 'frugal install' onto the flash drive to boot the system) Then when I wanted to upgrade the system, I would put the hard drive back in, update and build a new kickstart config file, make a new live cd. Is this possible? What tools do I need from a kickstart standpoint to take a snap shot of a working system? I know how to use (or can figure out) the Livecd tools with kickstart and I can figure out how to make a frugal install of fedora livecd's on a flash drive, but I don't know how to make a kickstart snapshot. I could manually make a kickstart file that installed the software, but i am interested in having my background done, the menu changes saved, the wireless settings saved. I have to put a wep key in for my wireless to work and an too stupid with kickstart to know how to do that kind of stuff or where to look. Is this scenario possible, and where to do I go? -- mjkern2000 at fastmail.fm From ml at deadbabylon.de Sat May 10 23:51:25 2008 From: ml at deadbabylon.de (Sebastian Vahl) Date: Sun, 11 May 2008 01:51:25 +0200 Subject: [Fedora-livecd-list] template for localized kde live images Message-ID: <200805110151.25885.ml@deadbabylon.de> Hi. This is a FYI: I'm using attached template for my german version of the kde live images. So this might be interesting for others. Sebastian -------------- next part -------------- %include livecd-fedora-9-kde.ks # Define the language settings you want to use # use this command for a full list: # locale -a lang de_DE.UTF-8 # Define the keyboard type. # use this command for a full list: # system-config-keyboard --noui --help keyboard de-latin1-nodeadkeys # Define your timezone # See /usr/share/zoneinfo/ for a list # of timezones to use timezone Europe/Berlin %packages # include additional languages packages # please comment the language you want to use out #@afrikaans-support #@albanian-support #@arabic-support #@armenian-support #@assamese-support #@basque-support #@belarusian-support #@bengali-support #@bhutanese-support #@bosnian-support #@brazilian-support #@breton-support #@british-support #@bulgarian-support #@catalan-support #@chinese-support #@croatian-support #@czech-support #@danish-support #@dutch-support #@estonian-support #@ethiopic-support #@faeroese-support #@filipino-support #@finnish-support #@french-support #@gaelic-support #@galician-support #@georgian-support #@german-support #@greek-support #@gujarati-support #@hebrew-support #@hindi-support #@hungarian-support #@icelandic-support #@indonesian-support #@inuktitut-support #@irish-support #@italian-support #@japanese-support #@kannada-support #@khmer-support #@korean-support #@lao-support #@latvian-support #@lithuanian-support #@malay-support #@malayalam-support #@maori-support #@marathi-support #@northern-sotho-support #@norwegian-support #@oriya-support #@persian-support #@polish-support #@portuguese-support #@punjabi-support #@romanian-support #@russian-support #@samoan-support #@serbian-support #@sinhala-support #@slovak-support #@slovenian-support #@somali-support #@southern-ndebele-support #@southern-sotho-support #@spanish-support #@swati-support #@swedish-support #@tagalog-support #@tamil-support #@telugu-support #@thai-support #@tibetan-support #@tonga-support #@tsonga-support #@tswana-support #@turkish-support #@ukrainian-support #@urdu-support #@venda-support #@vietnamese-support #@welsh-support #@xhosa-support #@zulu-support # The version for x86 should fit on a single cd so we have to # remove some packages. These are proposals for a removal # remove fonts if they are not needed #-abyssinica-fonts #-baekmuk-ttf-fonts-* #-cjkunifonts-uming #-fonts-KOI8-R* #-jomolhari-fonts #-kacst-fonts #-lklug-fonts #-lohit-fonts-* #-madan-fonts #-paktype-fonts #-sazanami-fonts-gothic #-stix-fonts #-thaifonts-scalable #-tibetan-machine-uni-fonts #-VLGothic-fonts # removal of other packages for saving space: # ktorrent (~3 megs) # kdegames (~23 megs) #-ktorrent #-kdegames %end %post # append to initscript cat >> /etc/rc.d/init.d/fedora-live << EOF # set up localized keyboard since it is not used in /etc/X11/xorg.conf anymore and # KDE don't use /etc/sysconfig/keyboard. # Replace "de-latin1-nodeadkeys" with the keyboard layout you have used above mkdir -p /home/fedora/.kde/env echo "system-config-keyboard --noui de-latin1-nodeadkeys" > /home/fedora/.kde/env/keyboard.sh chmod +x /home/fedora/.kde/env/keyboard.sh chown -R fedora:fedora /home/fedora/.kde/env/ EOF %end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. URL: From kanarip at kanarip.com Sun May 11 01:11:26 2008 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Sun, 11 May 2008 03:11:26 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <200805110151.25885.ml@deadbabylon.de> References: <200805110151.25885.ml@deadbabylon.de> Message-ID: <482647BE.7050101@kanarip.com> Sebastian Vahl wrote: > Hi. > > This is a FYI: I'm using attached template for my german version of the kde > live images. So this might be interesting for others. > Would you object to me pushing this into the kickstart GIT repository? http://git.fedorahosted.org/git/?p=spin-kickstarts.git Kind regards, Jeroen van Meeuwen -kanarip From kanarip at kanarip.com Sun May 11 11:44:33 2008 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Sun, 11 May 2008 13:44:33 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <200805110151.25885.ml@deadbabylon.de> References: <200805110151.25885.ml@deadbabylon.de> Message-ID: <4826DC21.9040100@kanarip.com> Sebastian Vahl wrote: > Hi. > > This is a FYI: I'm using attached template for my german version of the kde > live images. So this might be interesting for others. > Looking at the actual kickstart; - is @german-support not included for any particular reason? space? - in %post another little something is appended to the fedora-live initscript, while as far as I can see the things that you do are persistent, and do not need to be reset/reinitialized during boot. Any particular reason for adding it to the init script nonetheless? Kind regards, Jeroen van Meeuwen -kanarip From ml at deadbabylon.de Sun May 11 22:44:27 2008 From: ml at deadbabylon.de (Sebastian Vahl) Date: Mon, 12 May 2008 00:44:27 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <482647BE.7050101@kanarip.com> References: <200805110151.25885.ml@deadbabylon.de> <482647BE.7050101@kanarip.com> Message-ID: <20080512004427.034be23e@moorgarten.schwarmsted> Am Sun, 11 May 2008 03:11:26 +0200 schrieb Jeroen van Meeuwen : > Sebastian Vahl wrote: > > Hi. > > > > This is a FYI: I'm using attached template for my german version of > > the kde live images. So this might be interesting for others. > > > > Would you object to me pushing this into the kickstart GIT repository? > > http://git.fedorahosted.org/git/?p=spin-kickstarts.git No, of course not. So please feel free to do so. Sebastian -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From ml at deadbabylon.de Mon May 12 15:51:49 2008 From: ml at deadbabylon.de (Sebastian Vahl) Date: Mon, 12 May 2008 17:51:49 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <4826DC21.9040100@kanarip.com> References: <200805110151.25885.ml@deadbabylon.de> <4826DC21.9040100@kanarip.com> Message-ID: <20080512175149.294e7568@moorgarten.schwarmsted> Am Sun, 11 May 2008 13:44:33 +0200 schrieb Jeroen van Meeuwen : > Sebastian Vahl wrote: > > Hi. > > > > This is a FYI: I'm using attached template for my german version of > > the kde live images. So this might be interesting for others. > > > > Looking at the actual kickstart; > > - is @german-support not included for any particular reason? space? I'm using it for the german version but I've outcommented it for the template. > > - in %post another little something is appended to the fedora-live > initscript, while as far as I can see the things that you do are > persistent, and do not need to be reset/reinitialized during boot. > Any particular reason for adding it to the init script nonetheless? That's because on the live images the standard keyboard layout is used when (the english version). So without using this workaround the localized keyboard (eg. de-latin1-nodeadkeys) won't be used. At least that's what I've discovered in my tests. Sebastian -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From kanarip at kanarip.com Mon May 12 23:33:49 2008 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Tue, 13 May 2008 01:33:49 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <20080512175149.294e7568@moorgarten.schwarmsted> References: <200805110151.25885.ml@deadbabylon.de> <4826DC21.9040100@kanarip.com> <20080512175149.294e7568@moorgarten.schwarmsted> Message-ID: <4828D3DD.40100@kanarip.com> Sebastian Vahl wrote: > Am Sun, 11 May 2008 13:44:33 +0200 > schrieb Jeroen van Meeuwen : >> - in %post another little something is appended to the fedora-live >> initscript, while as far as I can see the things that you do are >> persistent, and do not need to be reset/reinitialized during boot. >> Any particular reason for adding it to the init script nonetheless? > > That's because on the live images the standard keyboard layout is used > when (the english version). So without using this workaround the > localized keyboard (eg. de-latin1-nodeadkeys) won't be used. > At least that's what I've discovered in my tests. > I understand why it needs to be changed, but you're doing so via /etc/rc.d/init.d/fedora-live instead of just editing the files directly. I was wondering if this was intentional, as I can not think of a reason. Kind regards, Jeroen van Meeuwen -kanarip From olivares14031 at yahoo.com Tue May 13 02:39:58 2008 From: olivares14031 at yahoo.com (Antonio Olivares) Date: Mon, 12 May 2008 19:39:58 -0700 (PDT) Subject: [Fedora-livecd-list] Is there any possibility of Official Fedora Live CD to have Easylist Message-ID: <587390.83826.qm@web52607.mail.re2.yahoo.com> Dear all, I have checked out other livecds. I have tested for instance the Kubuntu LiveCD. I tried konqueror and to my surprise there were no adds the internet experience was awesome. I checked out the Adblock filters and they had a file called Easylist http://easylist.adblockplus.org/adblock_rick752.txt Is there any possibility of incorporating it in to Fedora's LiveCD? It stops a bunch of popups/ads that clog up the internet experience. It was included in konqueror. If the answer is no, then I apologize for asking as I can add it manually, but it is not for me, but for other potential Fedora users. I use Slax Linux Live CD as well and there I manually set it up and I browse without any distractions that would otherwise slow down my internet experience. I think the incorporation of this would make browsing experience better for potential users. My $0.02 Regards, Antonio From katzj at redhat.com Tue May 13 02:46:26 2008 From: katzj at redhat.com (Jeremy Katz) Date: Mon, 12 May 2008 22:46:26 -0400 Subject: [Fedora-livecd-list] Is there any possibility of Official Fedora Live CD to have Easylist In-Reply-To: <587390.83826.qm@web52607.mail.re2.yahoo.com> References: <587390.83826.qm@web52607.mail.re2.yahoo.com> Message-ID: <1210646786.12036.11.camel@aglarond.local> On Mon, 2008-05-12 at 19:39 -0700, Antonio Olivares wrote: > Is there any possibility of incorporating it in to > Fedora's LiveCD? It stops a bunch of popups/ads that > clog up the internet experience. It was included in > konqueror. If the answer is no, then I apologize for > asking as I can add it manually, but it is not for me, > but for other potential Fedora users. To get it included by default really means getting the firefox package's defaults changed. We try not to do a lot of messing with package defaults in the live config so that we can provide as consistent an experience as possible for *all* users of Fedora. Jeremy From ml at deadbabylon.de Tue May 13 13:05:54 2008 From: ml at deadbabylon.de (Sebastian Vahl) Date: Tue, 13 May 2008 15:05:54 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <4828D3DD.40100@kanarip.com> References: <200805110151.25885.ml@deadbabylon.de> <20080512175149.294e7568@moorgarten.schwarmsted> <4828D3DD.40100@kanarip.com> Message-ID: <200805131505.59129.ml@deadbabylon.de> Am Di 13.Mai 2008 schrieb Jeroen van Meeuwen: > Sebastian Vahl wrote: > > Am Sun, 11 May 2008 13:44:33 +0200 > > > > schrieb Jeroen van Meeuwen : > >> - in %post another little something is appended to the fedora-live > >> initscript, while as far as I can see the things that you do are > >> persistent, and do not need to be reset/reinitialized during boot. > >> Any particular reason for adding it to the init script nonetheless? > > > > That's because on the live images the standard keyboard layout is used > > when (the english version). So without using this workaround the > > localized keyboard (eg. de-latin1-nodeadkeys) won't be used. > > At least that's what I've discovered in my tests. > > I understand why it needs to be changed, but you're doing so via > /etc/rc.d/init.d/fedora-live instead of just editing the files directly. > I was wondering if this was intentional, as I can not think of a reason. Sorry, then I've misunderstood you. It was easier to use this script as to edit the xorg.conf. And I don't wanted to modify the config in /usr/share/kde-settings/kde-profile/default/share/config/kdeglobals to add the keyboard layout. Sebastian -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. URL: From olivares14031 at yahoo.com Tue May 13 13:07:05 2008 From: olivares14031 at yahoo.com (Antonio Olivares) Date: Tue, 13 May 2008 06:07:05 -0700 (PDT) Subject: [Fedora-livecd-list] Is there any possibility of Official Fedora Live CD to have Easylist In-Reply-To: <1210646786.12036.11.camel@aglarond.local> Message-ID: <835689.62047.qm@web52608.mail.re2.yahoo.com> --- Jeremy Katz wrote: > On Mon, 2008-05-12 at 19:39 -0700, Antonio Olivares > wrote: > > Is there any possibility of incorporating it in to > > Fedora's LiveCD? It stops a bunch of popups/ads > that > > clog up the internet experience. It was included > in > > konqueror. If the answer is no, then I apologize > for > > asking as I can add it manually, but it is not for > me, > > but for other potential Fedora users. > > To get it included by default really means getting > the firefox package's > defaults changed. We try not to do a lot of messing > with package > defaults in the live config so that we can provide > as consistent an > experience as possible for *all* users of Fedora. > Konqueror has it. Firefox comes almost plain only language packs are included as I can see. But there is no problem, it can be added later manually. Regards, Antonio > > Jeremy > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > From olivares14031 at yahoo.com Wed May 14 02:24:39 2008 From: olivares14031 at yahoo.com (Antonio Olivares) Date: Tue, 13 May 2008 19:24:39 -0700 (PDT) Subject: [Fedora-livecd-list] Re: F9 first impressions of release - and a couple niggles In-Reply-To: Message-ID: <928401.52132.qm@web52611.mail.re2.yahoo.com> --- Timothy Murphy wrote: > Fedora-9 KDE Live CD runs fine on my ThinkPad T43, > but I found the KDE changes rather disappointing. > I couldn't see the point of most of them, > eg the new symbols for making a window bigger or > smaller. > I couldn't see how to add an application to the > panel, > and the organisation of the main KDE menu seemed > bizarre. > To add to a panel, right click on the application and then select add to panel. It will be inserted to the right left of the workspace switcher and other icons next to the clock. This was mentioned in the previous threads. It takes getting used to it. There ares several things that we will all miss, but at some point things shall stabilize and we can feel more at home with this. > > It's a pity the CD isn't ejected when you shutdown, > as eg the Knoppix CD is. > This is a point that shall be addressed some more on the live-cd list. It shall be soon incorporated if more people ask for it. I will forward this to live-cd list so that they can see that people want this feature. > > > > -- > fedora-list mailing list > fedora-list at redhat.com > To unsubscribe: > https://www.redhat.com/mailman/listinfo/fedora-list > Regards, Antonio From shollyshos at gmail.com Wed May 14 09:19:49 2008 From: shollyshos at gmail.com (shollyshos seun) Date: Wed, 14 May 2008 11:19:49 +0200 Subject: [Fedora-livecd-list] add costomize packages to a live cd Message-ID: Hi, My name is sola i work for Center Of Open Source Technology. I am working on a project on how to create a live CD. I have succssfully created a fedora live cd. My problem is i don't know how to add packages like xampp, eclipse and notepad++ to my live cd. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kanarip at kanarip.com Wed May 14 11:36:59 2008 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Wed, 14 May 2008 13:36:59 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <200805131505.59129.ml@deadbabylon.de> References: <200805110151.25885.ml@deadbabylon.de> <20080512175149.294e7568@moorgarten.schwarmsted> <4828D3DD.40100@kanarip.com> <200805131505.59129.ml@deadbabylon.de> Message-ID: <482ACEDB.3050408@kanarip.com> Sebastian Vahl wrote: > Sorry, then I've misunderstood you. It was easier to use this script as to > edit the xorg.conf. And I don't wanted to modify the config > in /usr/share/kde-settings/kde-profile/default/share/config/kdeglobals to add > the keyboard layout. > So, would you mind if I submitted this with the execution of the localization parts in %post (e.g. during compose) rather then on boot (via /etc/init.d/rc.d/fedora-live) ? Kind regards, Jeroen van Meeuwen -kanarip From bkearney at redhat.com Wed May 14 12:15:50 2008 From: bkearney at redhat.com (Bryan Kearney) Date: Wed, 14 May 2008 08:15:50 -0400 Subject: [Fedora-livecd-list] add costomize packages to a live cd In-Reply-To: References: Message-ID: <482AD7F6.60107@redhat.com> Add them to the kickstart file which you used to generate the livecd. With eclipse, it is likely that the size will be above CD level and you will need to burn it to a DVD. -- bk shollyshos seun wrote: > Hi, > > My name is sola i work for Center Of Open Source Technology. I am > working on a project on how to create a live CD. > > I have succssfully created a fedora live cd. My problem is i don't know > how to add packages like xampp, eclipse and notepad++ to my live cd. > > > ------------------------------------------------------------------------ > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list From thiago.braga.santana at gmail.com Wed May 14 21:21:21 2008 From: thiago.braga.santana at gmail.com (Thiago Braga Santana) Date: Wed, 14 May 2008 18:21:21 -0300 Subject: [Fedora-livecd-list] livecd-iso-to-disk in program dialog with parameter --gauge Message-ID: Hello to everyone in livecd-list. I need to learn how to use the program livecd-iso-to-disk with the program dialog (with the parameter --gauge) to the installation process the image. Iso performs with the progress bar. Someone help me with this doubt? My project depends much of this information. Regards. Thiago Santana -------------- next part -------------- An HTML attachment was scrubbed... URL: From ml at deadbabylon.de Thu May 15 05:42:53 2008 From: ml at deadbabylon.de (Sebastian Vahl) Date: Thu, 15 May 2008 07:42:53 +0200 Subject: [Fedora-livecd-list] template for localized kde live images In-Reply-To: <482ACEDB.3050408@kanarip.com> References: <200805110151.25885.ml@deadbabylon.de> <200805131505.59129.ml@deadbabylon.de> <482ACEDB.3050408@kanarip.com> Message-ID: <200805150743.02857.ml@deadbabylon.de> Am Mi 14.Mai 2008 schrieb Jeroen van Meeuwen: > Sebastian Vahl wrote: > > Sorry, then I've misunderstood you. It was easier to use this script as > > to edit the xorg.conf. And I don't wanted to modify the config > > in /usr/share/kde-settings/kde-profile/default/share/config/kdeglobals to > > add the keyboard layout. > > So, would you mind if I submitted this with the execution of the > localization parts in %post (e.g. during compose) rather then on boot > (via /etc/init.d/rc.d/fedora-live) ? Of course you could make all the changes you want to make. :) Sebastian -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. URL: From mk at crc.dk Thu May 15 10:00:49 2008 From: mk at crc.dk (Mogens Kjaer) Date: Thu, 15 May 2008 12:00:49 +0200 Subject: [Fedora-livecd-list] F9 livecd: Danish keyboard? Message-ID: <482C09D1.3040803@crc.dk> I'm trying to make a respin of the F9 livecd. This should have Danish keyboard as default. I've tried the trick on: https://www.redhat.com/archives/fedora-livecd-list/2008-May/msg00014.html by adding /usr/bin/system-config-keyboard --noui dk >/tmp/keyboard.log 2>&1 to the /etc/rc.local file. I get the response: Loading /lib/kbd/keymaps/i386/qwerty/dk.map.gz in the logfile, but it's still set to US keyboard. If I run the command above after logging in, it works. How do I set this up automatically? Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Fax: +45 33 27 47 08 Email: mk at crc.dk Homepage: http://www.crc.dk From mk at crc.dk Thu May 15 11:04:50 2008 From: mk at crc.dk (Mogens Kjaer) Date: Thu, 15 May 2008 13:04:50 +0200 Subject: [Fedora-livecd-list] F9 livecd: Danish keyboard? In-Reply-To: <482C09D1.3040803@crc.dk> References: <482C09D1.3040803@crc.dk> Message-ID: <482C18D2.1060300@crc.dk> Mogens Kjaer wrote: > I'm trying to make a respin of the F9 livecd. > > This should have Danish keyboard as default. I found a solution. In the %post section: echo dk > /etc/X11/Xkbmap Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Fax: +45 33 27 47 08 Email: mk at crc.dk Homepage: http://www.crc.dk From dhuff at redhat.com Mon May 19 15:58:55 2008 From: dhuff at redhat.com (David Huff) Date: Mon, 19 May 2008 11:58:55 -0400 Subject: [Fedora-livecd-list] [PATCH] Make use of python logging API for debug messages In-Reply-To: <1208939716.4927.26.camel@muff> References: <1207859713-27684-1-git-send-email-dhuff@redhat.com> <1208939716.4927.26.camel@muff> Message-ID: <4831A3BF.1040707@redhat.com> New patch with Marks additions included, I have tested against the latest version of livecd-creator with no issues: From d915eac0fc27f6ff524561f3455dbbccc2c597ca Mon Sep 17 00:00:00 2001 From: huff Date: Mon, 19 May 2008 10:58:48 -0400 Subject: [PATCH] -Make-use-of-python-logging-API-for-debug-messages --- imgcreate/__init__.py | 4 ++- imgcreate/creator.py | 5 ++- imgcreate/debug.py | 96 +++++++++++++++++++++++++++++++++++++++++++++++++ imgcreate/live.py | 4 +- imgcreate/yuminst.py | 3 +- tools/image-creator | 7 +++- tools/livecd-creator | 8 +++- 7 files changed, 117 insertions(+), 10 deletions(-) create mode 100644 imgcreate/debug.py diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py index e535014..bcfb40e 100644 --- a/imgcreate/__init__.py +++ b/imgcreate/__init__.py @@ -21,6 +21,7 @@ from imgcreate.creator import * from imgcreate.yuminst import * from imgcreate.kickstart import * from imgcreate.fs import * +from imgcreate.debug import * """A set of classes for building Fedora system images. @@ -62,5 +63,6 @@ __all__ = ( 'LoopImageCreator', 'FSLABEL_MAXLEN', 'read_kickstart', - 'construct_name' + 'construct_name', + 'setup_logging', ) diff --git a/imgcreate/creator.py b/imgcreate/creator.py index 1028e32..febb847 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -22,6 +22,7 @@ import stat import sys import tempfile import shutil +import logging import yum import rpm @@ -522,7 +523,7 @@ class ImageCreator(object): (pkg, e)) for pkg in skipped_pkgs: - print >> sys.stderr, "Skipping missing package '%s'" % (pkg,) + logging.info("Skipping missing package '%s'" % (pkg,)) def __select_groups(self, ayum): skipped_groups = [] @@ -537,7 +538,7 @@ class ImageCreator(object): skipped_groups.append(group) for group in skipped_groups: - print >> sys.stderr, "Skipping missing group '%s'" % (group.name,) + logging.info("Skipping missing group '%s'" % (group.name,)) def __deselect_packages(self, ayum): for pkg in kickstart.get_excluded(self.ks, diff --git a/imgcreate/debug.py b/imgcreate/debug.py new file mode 100644 index 0000000..b8040b1 --- /dev/null +++ b/imgcreate/debug.py @@ -0,0 +1,96 @@ +# +# debug.py: Helper routines for debugging +# +# Copyright 2008, Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +import logging +import logging.handlers +import optparse +import sys + +DATE_FORMAT = "%a, %d %b %Y %H:%M:%S" +STREAM_FORMAT = "%(levelname)-6s %(message)s" +FILE_FORMAT = "[%(asctime)s %(process)d] %(levelname)s (%(module)s:%(lineno)d) %(message)s" + +LOGFILE_MAX_BYTES = 1024 * 1024 +LOGFILE_N_BACKUPS = 5 + +def handle_logging(option, opt, val, parser, logger, level): + if level < logger.level: + logger.setLevel(level) + +def handle_logfile(option, opt, val, parser, logger, stream): + try: + logfile = logging.handlers.RotatingFileHandler(val, "a", + LOGFILE_MAX_BYTES, + LOGFILE_N_BACKUPS) + except IOError, (err, msg): + raise optparse.OptionValueError("Cannot open file '%s' : %s" % + (val, msg)) + + logfile.setFormatter(logging.Formatter(FILE_FORMAT, DATE_FORMAT)) + + logger.removeHandler(stream) + logger.addHandler(logfile) + +def setup_logging(parser = None): + """Set up the root logger and add logging options. + + Set up the root logger so only warning/error messages are logged to stderr + by default. + + Also, optionally, add --debug, --verbose and --logfile command line options + to the supplied option parser, allowing the root logger configuration to be + modified by the user. + + Note, to avoid possible namespace clashes, setup_logging() will only ever + add these three options. No new options will be added in the future. + + parser -- an optparse.OptionParser instance, or None + + """ + logger = logging.getLogger() + + logger.setLevel(logging.WARN) + + stream = logging.StreamHandler(sys.stderr) + stream.setFormatter(logging.Formatter(STREAM_FORMAT, DATE_FORMAT)) + + logger.addHandler(stream) + + if parser is None: + return + + group = optparse.OptionGroup(parser, "Debugging options", + "These options control the output of logging information during image creation") + + group.add_option("-d", "--debug", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.DEBUG), + help = "Output debugging information") + + group.add_option("-v", "--verbose", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.INFO), + help = "Output verbose progress information") + + group.add_option("", "--logfile", type="string", + action = "callback", callback = handle_logfile, + callback_args = (logger, stream), + help = "Save debug information to FILE", metavar = "FILE") + + parser.add_option_group(group) diff --git a/imgcreate/live.py b/imgcreate/live.py index c6267f7..130f7fa 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -21,6 +21,7 @@ import os.path import glob import shutil import subprocess +import logging from imgcreate.errors import * from imgcreate.fs import * @@ -252,8 +253,7 @@ class LiveImageCreatorBase(LoopImageCreator): elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"): implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5" else: - print >> sys.stderr, \ - "isomd5sum not installed; not setting up mediacheck" + logging.warn("isomd5sum not installed; not setting up mediacheck") subprocess.call([implantisomd5, iso]) diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py index 80fc514..aebb822 100644 --- a/imgcreate/yuminst.py +++ b/imgcreate/yuminst.py @@ -18,6 +18,7 @@ import os import sys +import logging import yum import rpmUtils @@ -103,7 +104,7 @@ class LiveCDYum(yum.YumBase): pkgs.remove(x) self.tsInfo.conditionals[req] = pkgs else: - print >> sys.stderr, "No such package %s to remove" %(pkg,) + logging.warn("No such package %s to remove" %(pkg,)) def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT): yum.YumBase.selectGroup(self, grp) diff --git a/tools/image-creator b/tools/image-creator index aca9228..6f2604c 100755 --- a/tools/image-creator +++ b/tools/image-creator @@ -21,6 +21,7 @@ import os import sys import shutil import optparse +import logging import imgcreate @@ -30,6 +31,8 @@ def parse_options(args): parser.add_option("-n", "--name", type="string", dest="name", help="Image name and filesystem label") + imgcreate.setup_logging(parser) + (options, args) = parser.parse_args() if len(args) != 1: @@ -48,7 +51,7 @@ def main(): try: ks = imgcreate.read_kickstart(kscfg) except imgcreate.CreatorError, e: - print >> sys.stderr, "Error loading kickstart file '%s' : %s" % (kscfg, e) + logging.error("Unable to load kickstart file '%s' : %s" % (kscfg, e)) return 1 if options.name: @@ -61,7 +64,7 @@ def main(): try: creator.create() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating image : %s" % e + logging.error("Unable to create image : %s" % e) return 1 finally: creator.cleanup() diff --git a/tools/livecd-creator b/tools/livecd-creator index 7c08323..dddfddd 100755 --- a/tools/livecd-creator +++ b/tools/livecd-creator @@ -22,8 +22,10 @@ import os.path import sys import time import optparse +import logging import imgcreate +import imgcreate.debug class Usage(Exception): def __init__(self, msg = None, no_error = False): @@ -53,6 +55,8 @@ def parse_options(args): help="Cache directory to use (default: private cache") parser.add_option_group(sysopt) + imgcreate.setup_logging(parser) + # debug options not recommended for "production" images # Start a shell in the chroot for post-configuration. parser.add_option("-l", "--shell", action="store_true", dest="give_shell", @@ -101,7 +105,7 @@ def main(): "livecd-", maxlen = imgcreate.FSLABEL_MAXLEN) - print "Using label '%s' and name '%s'" % (fs_label, name) + logging.info("Using label '%s' and name '%s'" % (fs_label, name)) ks = imgcreate.read_kickstart(options.kscfg) @@ -121,7 +125,7 @@ def main(): creator.unmount() creator.package() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating Live CD : %s" % e + logging.error("Error creating Live CD : %s" % e) return 1 finally: creator.cleanup() -- 1.5.4.1 From katzj at redhat.com Mon May 19 17:23:02 2008 From: katzj at redhat.com (Jeremy Katz) Date: Mon, 19 May 2008 13:23:02 -0400 Subject: [Fedora-livecd-list] [PATCH] Make use of python logging API for debug messages In-Reply-To: <4831A3BF.1040707@redhat.com> References: <1207859713-27684-1-git-send-email-dhuff@redhat.com> <1208939716.4927.26.camel@muff> <4831A3BF.1040707@redhat.com> Message-ID: <1211217782.18476.33.camel@aglarond.local> This looks pretty good in general. But a few comments/questions. Most of which are nitpicky little things, but there's a little bit of meat in the middle :) On Mon, 2008-05-19 at 11:58 -0400, David Huff wrote: > diff --git a/imgcreate/creator.py b/imgcreate/creator.py > index 1028e32..febb847 100644 > --- a/imgcreate/creator.py > +++ b/imgcreate/creator.py > @@ -522,7 +523,7 @@ class ImageCreator(object): > (pkg, e)) > > for pkg in skipped_pkgs: > - print >> sys.stderr, "Skipping missing package '%s'" % (pkg,) > + logging.info("Skipping missing package '%s'" % (pkg,)) Maybe should be logging.warn? > @@ -537,7 +538,7 @@ class ImageCreator(object): > skipped_groups.append(group) > > for group in skipped_groups: > - print >> sys.stderr, "Skipping missing group '%s'" % > (group.name,) > + logging.info("Skipping missing group '%s'" % (group.name,)) And the same. > +def handle_logfile(option, opt, val, parser, logger, stream): > + try: > + logfile = logging.handlers.RotatingFileHandler(val, "a", > + LOGFILE_MAX_BYTES, > + LOGFILE_N_BACKUPS) A rotating log file seems like overkill here. Let's keep it just a simple file. > + logfile.setFormatter(logging.Formatter(FILE_FORMAT, DATE_FORMAT)) Is there really a convincing reason not to just stick with the default format handling? > +def setup_logging(parser = None): > + """Set up the root logger and add logging options. What happens if the utility doesn't call setup_logging()? It's important that the behavior be basically the same for anyone who has built something on top of the existing API who doesn't immediately go and add the setup_logging() call > diff --git a/tools/livecd-creator b/tools/livecd-creator > index 7c08323..dddfddd 100755 > --- a/tools/livecd-creator > +++ b/tools/livecd-creator > @@ -22,8 +22,10 @@ import os.path > import sys > import time > import optparse > +import logging > > import imgcreate > +import imgcreate.debug This import isn't needed anymore. Jeremy From dhuff at redhat.com Mon May 19 18:56:20 2008 From: dhuff at redhat.com (David Huff) Date: Mon, 19 May 2008 14:56:20 -0400 Subject: [Fedora-livecd-list] [PATCH] Make use of python logging API for debug messages In-Reply-To: <1211217782.18476.33.camel@aglarond.local> References: <1207859713-27684-1-git-send-email-dhuff@redhat.com> <1208939716.4927.26.camel@muff> <4831A3BF.1040707@redhat.com> <1211217782.18476.33.camel@aglarond.local> Message-ID: <4831CD54.2070801@redhat.com> Jeremy Katz wrote: > This looks pretty good in general. But a few comments/questions. Most > of which are nitpicky little things, but there's a little bit of meat in > the middle :) New patch attached which address issues listed above.... > What happens if the utility doesn't call setup_logging()? It's > important that the behavior be basically the same for anyone who has > built something on top of the existing API who doesn't immediately go > and add the setup_logging() call My understanding is that if they do not include setup_logging they will not get the debug options added to the parser so they will not be able to use -d or -v options however it will not break any utility that extends the livecd-tools. Please correct me if im wrong. -D From 86a3f099b58dbe9f9088db23a1c56c92b980a832 Mon Sep 17 00:00:00 2001 From: huff Date: Mon, 19 May 2008 14:41:18 -0400 Subject: [PATCH] -Make-use-of-python-logging-API-for-debug-messages2 --- imgcreate/__init__.py | 4 ++- imgcreate/creator.py | 5 ++- imgcreate/debug.py | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ imgcreate/live.py | 4 +- imgcreate/yuminst.py | 3 +- tools/image-creator | 7 +++- tools/livecd-creator | 7 +++- 7 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 imgcreate/debug.py diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py index e535014..bcfb40e 100644 --- a/imgcreate/__init__.py +++ b/imgcreate/__init__.py @@ -21,6 +21,7 @@ from imgcreate.creator import * from imgcreate.yuminst import * from imgcreate.kickstart import * from imgcreate.fs import * +from imgcreate.debug import * """A set of classes for building Fedora system images. @@ -62,5 +63,6 @@ __all__ = ( 'LoopImageCreator', 'FSLABEL_MAXLEN', 'read_kickstart', - 'construct_name' + 'construct_name', + 'setup_logging', ) diff --git a/imgcreate/creator.py b/imgcreate/creator.py index 1028e32..40ce1ef 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -22,6 +22,7 @@ import stat import sys import tempfile import shutil +import logging import yum import rpm @@ -522,7 +523,7 @@ class ImageCreator(object): (pkg, e)) for pkg in skipped_pkgs: - print >> sys.stderr, "Skipping missing package '%s'" % (pkg,) + logging.warn("Skipping missing package '%s'" % (pkg,)) def __select_groups(self, ayum): skipped_groups = [] @@ -537,7 +538,7 @@ class ImageCreator(object): skipped_groups.append(group) for group in skipped_groups: - print >> sys.stderr, "Skipping missing group '%s'" % (group.name,) + logging.warn("Skipping missing group '%s'" % (group.name,)) def __deselect_packages(self, ayum): for pkg in kickstart.get_excluded(self.ks, diff --git a/imgcreate/debug.py b/imgcreate/debug.py new file mode 100644 index 0000000..b9c2c61 --- /dev/null +++ b/imgcreate/debug.py @@ -0,0 +1,87 @@ +# +# debug.py: Helper routines for debugging +# +# Copyright 2008, Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +import logging +import logging.handlers +import optparse +import sys + + +def handle_logging(option, opt, val, parser, logger, level): + if level < logger.level: + logger.setLevel(level) + +def handle_logfile(option, opt, val, parser, logger, stream): + try: + logfile = logging.FileHandler + except IOError, (err, msg): + raise optparse.OptionValueError("Cannot open file '%s' : %s" % + (val, msg)) + + + logger.removeHandler(stream) + logger.addHandler(logfile) + +def setup_logging(parser = None): + """Set up the root logger and add logging options. + + Set up the root logger so only warning/error messages are logged to stderr + by default. + + Also, optionally, add --debug, --verbose and --logfile command line options + to the supplied option parser, allowing the root logger configuration to be + modified by the user. + + Note, to avoid possible namespace clashes, setup_logging() will only ever + add these three options. No new options will be added in the future. + + parser -- an optparse.OptionParser instance, or None + + """ + logger = logging.getLogger() + + logger.setLevel(logging.WARN) + + stream = logging.StreamHandler(sys.stderr) + + logger.addHandler(stream) + + if parser is None: + return + + group = optparse.OptionGroup(parser, "Debugging options", + "These options control the output of logging information during image creation") + + group.add_option("-d", "--debug", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.DEBUG), + help = "Output debugging information") + + group.add_option("-v", "--verbose", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.INFO), + help = "Output verbose progress information") + + group.add_option("", "--logfile", type="string", + action = "callback", callback = handle_logfile, + callback_args = (logger, stream), + help = "Save debug information to FILE", metavar = "FILE") + + parser.add_option_group(group) + diff --git a/imgcreate/live.py b/imgcreate/live.py index c6267f7..130f7fa 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -21,6 +21,7 @@ import os.path import glob import shutil import subprocess +import logging from imgcreate.errors import * from imgcreate.fs import * @@ -252,8 +253,7 @@ class LiveImageCreatorBase(LoopImageCreator): elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"): implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5" else: - print >> sys.stderr, \ - "isomd5sum not installed; not setting up mediacheck" + logging.warn("isomd5sum not installed; not setting up mediacheck") subprocess.call([implantisomd5, iso]) diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py index 80fc514..aebb822 100644 --- a/imgcreate/yuminst.py +++ b/imgcreate/yuminst.py @@ -18,6 +18,7 @@ import os import sys +import logging import yum import rpmUtils @@ -103,7 +104,7 @@ class LiveCDYum(yum.YumBase): pkgs.remove(x) self.tsInfo.conditionals[req] = pkgs else: - print >> sys.stderr, "No such package %s to remove" %(pkg,) + logging.warn("No such package %s to remove" %(pkg,)) def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT): yum.YumBase.selectGroup(self, grp) diff --git a/tools/image-creator b/tools/image-creator index aca9228..6f2604c 100755 --- a/tools/image-creator +++ b/tools/image-creator @@ -21,6 +21,7 @@ import os import sys import shutil import optparse +import logging import imgcreate @@ -30,6 +31,8 @@ def parse_options(args): parser.add_option("-n", "--name", type="string", dest="name", help="Image name and filesystem label") + imgcreate.setup_logging(parser) + (options, args) = parser.parse_args() if len(args) != 1: @@ -48,7 +51,7 @@ def main(): try: ks = imgcreate.read_kickstart(kscfg) except imgcreate.CreatorError, e: - print >> sys.stderr, "Error loading kickstart file '%s' : %s" % (kscfg, e) + logging.error("Unable to load kickstart file '%s' : %s" % (kscfg, e)) return 1 if options.name: @@ -61,7 +64,7 @@ def main(): try: creator.create() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating image : %s" % e + logging.error("Unable to create image : %s" % e) return 1 finally: creator.cleanup() diff --git a/tools/livecd-creator b/tools/livecd-creator index 7c08323..a3ece16 100755 --- a/tools/livecd-creator +++ b/tools/livecd-creator @@ -22,6 +22,7 @@ import os.path import sys import time import optparse +import logging import imgcreate @@ -53,6 +54,8 @@ def parse_options(args): help="Cache directory to use (default: private cache") parser.add_option_group(sysopt) + imgcreate.setup_logging(parser) + # debug options not recommended for "production" images # Start a shell in the chroot for post-configuration. parser.add_option("-l", "--shell", action="store_true", dest="give_shell", @@ -101,7 +104,7 @@ def main(): "livecd-", maxlen = imgcreate.FSLABEL_MAXLEN) - print "Using label '%s' and name '%s'" % (fs_label, name) + logging.info("Using label '%s' and name '%s'" % (fs_label, name)) ks = imgcreate.read_kickstart(options.kscfg) @@ -121,7 +124,7 @@ def main(): creator.unmount() creator.package() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating Live CD : %s" % e + logging.error("Error creating Live CD : %s" % e) return 1 finally: creator.cleanup() -- 1.5.4.1 From dhuff at redhat.com Tue May 20 20:49:59 2008 From: dhuff at redhat.com (David Huff) Date: Tue, 20 May 2008 16:49:59 -0400 Subject: [Fedora-livecd-list] [PATCH] Make use of python logging API for debug messages In-Reply-To: <4831CD54.2070801@redhat.com> References: <1207859713-27684-1-git-send-email-dhuff@redhat.com> <1208939716.4927.26.camel@muff> <4831A3BF.1040707@redhat.com> <1211217782.18476.33.camel@aglarond.local> <4831CD54.2070801@redhat.com> Message-ID: <48333977.4020905@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Huff wrote: | Jeremy Katz wrote: |> This looks pretty good in general. But a few comments/questions. Most |> of which are nitpicky little things, but there's a little bit of meat in |> the middle :) | | New patch attached which address issues listed above.... | Fixed FileHandler error...... ~From c239cc871b67ce86dc984d4beb308b0abea71c95 Mon Sep 17 00:00:00 2001 From: huff Date: Tue, 20 May 2008 16:21:11 -0400 Subject: [PATCH] -Make-use-of-python-logging-API-for-debug-messages3 - --- ~ imgcreate/__init__.py | 4 ++- ~ imgcreate/creator.py | 5 ++- ~ imgcreate/debug.py | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ ~ imgcreate/live.py | 4 +- ~ imgcreate/yuminst.py | 3 +- ~ tools/image-creator | 7 +++- ~ tools/livecd-creator | 7 +++- ~ 7 files changed, 107 insertions(+), 10 deletions(-) ~ create mode 100644 imgcreate/debug.py diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py index e535014..bcfb40e 100644 - --- a/imgcreate/__init__.py +++ b/imgcreate/__init__.py @@ -21,6 +21,7 @@ from imgcreate.creator import * ~ from imgcreate.yuminst import * ~ from imgcreate.kickstart import * ~ from imgcreate.fs import * +from imgcreate.debug import * ~ """A set of classes for building Fedora system images. @@ -62,5 +63,6 @@ __all__ = ( ~ 'LoopImageCreator', ~ 'FSLABEL_MAXLEN', ~ 'read_kickstart', - - 'construct_name' + 'construct_name', + 'setup_logging', ~ ) diff --git a/imgcreate/creator.py b/imgcreate/creator.py index 1028e32..40ce1ef 100644 - --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -22,6 +22,7 @@ import stat ~ import sys ~ import tempfile ~ import shutil +import logging ~ import yum ~ import rpm @@ -522,7 +523,7 @@ class ImageCreator(object): ~ (pkg, e)) ~ for pkg in skipped_pkgs: - - print >> sys.stderr, "Skipping missing package '%s'" % (pkg,) + logging.warn("Skipping missing package '%s'" % (pkg,)) ~ def __select_groups(self, ayum): ~ skipped_groups = [] @@ -537,7 +538,7 @@ class ImageCreator(object): ~ skipped_groups.append(group) ~ for group in skipped_groups: - - print >> sys.stderr, "Skipping missing group '%s'" % (group.name,) + logging.warn("Skipping missing group '%s'" % (group.name,)) ~ def __deselect_packages(self, ayum): ~ for pkg in kickstart.get_excluded(self.ks, diff --git a/imgcreate/debug.py b/imgcreate/debug.py new file mode 100644 index 0000000..99318f3 - --- /dev/null +++ b/imgcreate/debug.py @@ -0,0 +1,87 @@ +# +# debug.py: Helper routines for debugging +# +# Copyright 2008, Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +import logging +import logging.handlers +import optparse +import sys + + +def handle_logging(option, opt, val, parser, logger, level): + if level < logger.level: + logger.setLevel(level) + +def handle_logfile(option, opt, val, parser, logger, stream): + try: + logfile = logging.FileHandler(val,"a") + except IOError, (err, msg): + raise optparse.OptionValueError("Cannot open file '%s' : %s" % + (val, msg)) + + + logger.removeHandler(stream) + logger.addHandler(logfile) + +def setup_logging(parser = None): + """Set up the root logger and add logging options. + + Set up the root logger so only warning/error messages are logged to stderr + by default. + + Also, optionally, add --debug, --verbose and --logfile command line options + to the supplied option parser, allowing the root logger configuration to be + modified by the user. + + Note, to avoid possible namespace clashes, setup_logging() will only ever + add these three options. No new options will be added in the future. + + parser -- an optparse.OptionParser instance, or None + + """ + logger = logging.getLogger() + + logger.setLevel(logging.WARN) + + stream = logging.StreamHandler(sys.stderr) + + logger.addHandler(stream) + + if parser is None: + return + + group = optparse.OptionGroup(parser, "Debugging options", + "These options control the output of logging information during image creation") + + group.add_option("-d", "--debug", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.DEBUG), + help = "Output debugging information") + + group.add_option("-v", "--verbose", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.INFO), + help = "Output verbose progress information") + + group.add_option("", "--logfile", type="string", + action = "callback", callback = handle_logfile, + callback_args = (logger, stream), + help = "Save debug information to FILE", metavar = "FILE") + + parser.add_option_group(group) + diff --git a/imgcreate/live.py b/imgcreate/live.py index c6267f7..130f7fa 100644 - --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -21,6 +21,7 @@ import os.path ~ import glob ~ import shutil ~ import subprocess +import logging ~ from imgcreate.errors import * ~ from imgcreate.fs import * @@ -252,8 +253,7 @@ class LiveImageCreatorBase(LoopImageCreator): ~ elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"): ~ implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5" ~ else: - - print >> sys.stderr, \ - - "isomd5sum not installed; not setting up mediacheck" + logging.warn("isomd5sum not installed; not setting up mediacheck") ~ subprocess.call([implantisomd5, iso]) diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py index 80fc514..aebb822 100644 - --- a/imgcreate/yuminst.py +++ b/imgcreate/yuminst.py @@ -18,6 +18,7 @@ ~ import os ~ import sys +import logging ~ import yum ~ import rpmUtils @@ -103,7 +104,7 @@ class LiveCDYum(yum.YumBase): ~ pkgs.remove(x) ~ self.tsInfo.conditionals[req] = pkgs ~ else: - - print >> sys.stderr, "No such package %s to remove" %(pkg,) + logging.warn("No such package %s to remove" %(pkg,)) ~ def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT): ~ yum.YumBase.selectGroup(self, grp) diff --git a/tools/image-creator b/tools/image-creator index aca9228..6f2604c 100755 - --- a/tools/image-creator +++ b/tools/image-creator @@ -21,6 +21,7 @@ import os ~ import sys ~ import shutil ~ import optparse +import logging ~ import imgcreate @@ -30,6 +31,8 @@ def parse_options(args): ~ parser.add_option("-n", "--name", type="string", dest="name", ~ help="Image name and filesystem label") + imgcreate.setup_logging(parser) + ~ (options, args) = parser.parse_args() ~ if len(args) != 1: @@ -48,7 +51,7 @@ def main(): ~ try: ~ ks = imgcreate.read_kickstart(kscfg) ~ except imgcreate.CreatorError, e: - - print >> sys.stderr, "Error loading kickstart file '%s' : %s" % (kscfg, e) + logging.error("Unable to load kickstart file '%s' : %s" % (kscfg, e)) ~ return 1 ~ if options.name: @@ -61,7 +64,7 @@ def main(): ~ try: ~ creator.create() ~ except imgcreate.CreatorError, e: - - print >> sys.stderr, "Error creating image : %s" % e + logging.error("Unable to create image : %s" % e) ~ return 1 ~ finally: ~ creator.cleanup() diff --git a/tools/livecd-creator b/tools/livecd-creator index 7c08323..a3ece16 100755 - --- a/tools/livecd-creator +++ b/tools/livecd-creator @@ -22,6 +22,7 @@ import os.path ~ import sys ~ import time ~ import optparse +import logging ~ import imgcreate @@ -53,6 +54,8 @@ def parse_options(args): ~ help="Cache directory to use (default: private cache") ~ parser.add_option_group(sysopt) + imgcreate.setup_logging(parser) + ~ # debug options not recommended for "production" images ~ # Start a shell in the chroot for post-configuration. ~ parser.add_option("-l", "--shell", action="store_true", dest="give_shell", @@ -101,7 +104,7 @@ def main(): ~ "livecd-", ~ maxlen = imgcreate.FSLABEL_MAXLEN) - - print "Using label '%s' and name '%s'" % (fs_label, name) + logging.info("Using label '%s' and name '%s'" % (fs_label, name)) ~ ks = imgcreate.read_kickstart(options.kscfg) @@ -121,7 +124,7 @@ def main(): ~ creator.unmount() ~ creator.package() ~ except imgcreate.CreatorError, e: - - print >> sys.stderr, "Error creating Live CD : %s" % e + logging.error("Error creating Live CD : %s" % e) ~ return 1 ~ finally: ~ creator.cleanup() - -- 1.5.4.1 - -- David Huff Red Hat, Raleigh, NC Mobile: 919-796-3553 Office: 919-754-4129 GPG Key ID: 6A20BBF7 GPG Fingerprint: FE13 8AF6 0E58 D92E A4E1 2D0A 71C1 CADF 6A20 BBF7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFIMzl3ccHK32ogu/cRArHJAJ9RmBdEGoDjEAFFiNm/lYyLDwgZTgCgllwJ gQRf7bqZ1PPBY3B4qNdzwt8= =2awP -----END PGP SIGNATURE----- From katzj at redhat.com Tue May 20 23:47:38 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 20 May 2008 19:47:38 -0400 Subject: [Fedora-livecd-list] [PATCH] Make use of python logging API for debug messages In-Reply-To: <48333977.4020905@redhat.com> References: <1207859713-27684-1-git-send-email-dhuff@redhat.com> <1208939716.4927.26.camel@muff> <4831A3BF.1040707@redhat.com> <1211217782.18476.33.camel@aglarond.local> <4831CD54.2070801@redhat.com> <48333977.4020905@redhat.com> Message-ID: <1211327258.12052.46.camel@aglarond.local> On Tue, 2008-05-20 at 16:49 -0400, David Huff wrote: > David Huff wrote: > | Jeremy Katz wrote: > |> This looks pretty good in general. But a few comments/questions. Most > |> of which are nitpicky little things, but there's a little bit of meat in > |> the middle :) > | > | New patch attached which address issues listed above.... > | > > Fixed FileHandler error...... It looks fine, but something has seriously mangled the patch to the point that it doesn't apply (see the ~ at the beginning of lines). And actually, all of the patches you've sent are completely white-space mangled making applying them pretty painful. Can you get your mail client to not actually do the mangling? Jeremy From davidsonpaulo at gmail.com Wed May 21 05:43:32 2008 From: davidsonpaulo at gmail.com (Davidson Rodrigues Paulo) Date: Wed, 21 May 2008 02:43:32 -0300 Subject: [Fedora-livecd-list] [Utility] - Script to generate kickstart %packages section Message-ID: Hi, I was wondering about an easier way to include all packages actually installed on system in the %packages section of a kickstart file, using as few lines as possible, with groups, individual packages and exclusions, so I decided to create a BASH script to help doing that: getPackages.sh. If you want to test, just download it, give execution permission, take a comps.xml file and run it, as follows: $ chmod +x getPackages.sh $ su -c 'yum makecache' password: $ zcat /var/cache/yum/fedora/Fedora-9-comps.xml.gz > comps.xml $ ./getPackages.sh You're all welcome to test, modify and redistribute the code. I hope this can be useful. Best regards, -- Davidson Paulo Linux System Administrator LPI Certified Level 1: LPI000132770 Revista Fedora Brasil, Editor-In-Chief Fedora Project, Ambassador http://daveandnaty.blogspot.com/ http://davidsonenatalia.blogspot.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: getPackages.sh Type: application/x-sh Size: 2032 bytes Desc: not available URL: From dhuff at redhat.com Wed May 21 14:19:53 2008 From: dhuff at redhat.com (huff) Date: Wed, 21 May 2008 10:19:53 -0400 Subject: [Fedora-livecd-list] [PATCH] -Make-use-of-python-logging-API-for-debug-messages3 In-Reply-To: <48333977.4020905@redhat.com> References: <48333977.4020905@redhat.com> Message-ID: <1211379593-12188-1-git-send-email-dhuff@redhat.com> --- imgcreate/__init__.py | 4 ++- imgcreate/creator.py | 5 ++- imgcreate/debug.py | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ imgcreate/live.py | 4 +- imgcreate/yuminst.py | 3 +- tools/image-creator | 7 +++- tools/livecd-creator | 7 +++- 7 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 imgcreate/debug.py diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py index e535014..bcfb40e 100644 --- a/imgcreate/__init__.py +++ b/imgcreate/__init__.py @@ -21,6 +21,7 @@ from imgcreate.creator import * from imgcreate.yuminst import * from imgcreate.kickstart import * from imgcreate.fs import * +from imgcreate.debug import * """A set of classes for building Fedora system images. @@ -62,5 +63,6 @@ __all__ = ( 'LoopImageCreator', 'FSLABEL_MAXLEN', 'read_kickstart', - 'construct_name' + 'construct_name', + 'setup_logging', ) diff --git a/imgcreate/creator.py b/imgcreate/creator.py index 1028e32..40ce1ef 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -22,6 +22,7 @@ import stat import sys import tempfile import shutil +import logging import yum import rpm @@ -522,7 +523,7 @@ class ImageCreator(object): (pkg, e)) for pkg in skipped_pkgs: - print >> sys.stderr, "Skipping missing package '%s'" % (pkg,) + logging.warn("Skipping missing package '%s'" % (pkg,)) def __select_groups(self, ayum): skipped_groups = [] @@ -537,7 +538,7 @@ class ImageCreator(object): skipped_groups.append(group) for group in skipped_groups: - print >> sys.stderr, "Skipping missing group '%s'" % (group.name,) + logging.warn("Skipping missing group '%s'" % (group.name,)) def __deselect_packages(self, ayum): for pkg in kickstart.get_excluded(self.ks, diff --git a/imgcreate/debug.py b/imgcreate/debug.py new file mode 100644 index 0000000..99318f3 --- /dev/null +++ b/imgcreate/debug.py @@ -0,0 +1,87 @@ +# +# debug.py: Helper routines for debugging +# +# Copyright 2008, Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +import logging +import logging.handlers +import optparse +import sys + + +def handle_logging(option, opt, val, parser, logger, level): + if level < logger.level: + logger.setLevel(level) + +def handle_logfile(option, opt, val, parser, logger, stream): + try: + logfile = logging.FileHandler(val,"a") + except IOError, (err, msg): + raise optparse.OptionValueError("Cannot open file '%s' : %s" % + (val, msg)) + + + logger.removeHandler(stream) + logger.addHandler(logfile) + +def setup_logging(parser = None): + """Set up the root logger and add logging options. + + Set up the root logger so only warning/error messages are logged to stderr + by default. + + Also, optionally, add --debug, --verbose and --logfile command line options + to the supplied option parser, allowing the root logger configuration to be + modified by the user. + + Note, to avoid possible namespace clashes, setup_logging() will only ever + add these three options. No new options will be added in the future. + + parser -- an optparse.OptionParser instance, or None + + """ + logger = logging.getLogger() + + logger.setLevel(logging.WARN) + + stream = logging.StreamHandler(sys.stderr) + + logger.addHandler(stream) + + if parser is None: + return + + group = optparse.OptionGroup(parser, "Debugging options", + "These options control the output of logging information during image creation") + + group.add_option("-d", "--debug", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.DEBUG), + help = "Output debugging information") + + group.add_option("-v", "--verbose", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.INFO), + help = "Output verbose progress information") + + group.add_option("", "--logfile", type="string", + action = "callback", callback = handle_logfile, + callback_args = (logger, stream), + help = "Save debug information to FILE", metavar = "FILE") + + parser.add_option_group(group) + diff --git a/imgcreate/live.py b/imgcreate/live.py index c6267f7..130f7fa 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -21,6 +21,7 @@ import os.path import glob import shutil import subprocess +import logging from imgcreate.errors import * from imgcreate.fs import * @@ -252,8 +253,7 @@ class LiveImageCreatorBase(LoopImageCreator): elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"): implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5" else: - print >> sys.stderr, \ - "isomd5sum not installed; not setting up mediacheck" + logging.warn("isomd5sum not installed; not setting up mediacheck") subprocess.call([implantisomd5, iso]) diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py index 80fc514..aebb822 100644 --- a/imgcreate/yuminst.py +++ b/imgcreate/yuminst.py @@ -18,6 +18,7 @@ import os import sys +import logging import yum import rpmUtils @@ -103,7 +104,7 @@ class LiveCDYum(yum.YumBase): pkgs.remove(x) self.tsInfo.conditionals[req] = pkgs else: - print >> sys.stderr, "No such package %s to remove" %(pkg,) + logging.warn("No such package %s to remove" %(pkg,)) def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT): yum.YumBase.selectGroup(self, grp) diff --git a/tools/image-creator b/tools/image-creator index aca9228..6f2604c 100755 --- a/tools/image-creator +++ b/tools/image-creator @@ -21,6 +21,7 @@ import os import sys import shutil import optparse +import logging import imgcreate @@ -30,6 +31,8 @@ def parse_options(args): parser.add_option("-n", "--name", type="string", dest="name", help="Image name and filesystem label") + imgcreate.setup_logging(parser) + (options, args) = parser.parse_args() if len(args) != 1: @@ -48,7 +51,7 @@ def main(): try: ks = imgcreate.read_kickstart(kscfg) except imgcreate.CreatorError, e: - print >> sys.stderr, "Error loading kickstart file '%s' : %s" % (kscfg, e) + logging.error("Unable to load kickstart file '%s' : %s" % (kscfg, e)) return 1 if options.name: @@ -61,7 +64,7 @@ def main(): try: creator.create() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating image : %s" % e + logging.error("Unable to create image : %s" % e) return 1 finally: creator.cleanup() diff --git a/tools/livecd-creator b/tools/livecd-creator index 7c08323..a3ece16 100755 --- a/tools/livecd-creator +++ b/tools/livecd-creator @@ -22,6 +22,7 @@ import os.path import sys import time import optparse +import logging import imgcreate @@ -53,6 +54,8 @@ def parse_options(args): help="Cache directory to use (default: private cache") parser.add_option_group(sysopt) + imgcreate.setup_logging(parser) + # debug options not recommended for "production" images # Start a shell in the chroot for post-configuration. parser.add_option("-l", "--shell", action="store_true", dest="give_shell", @@ -101,7 +104,7 @@ def main(): "livecd-", maxlen = imgcreate.FSLABEL_MAXLEN) - print "Using label '%s' and name '%s'" % (fs_label, name) + logging.info("Using label '%s' and name '%s'" % (fs_label, name)) ks = imgcreate.read_kickstart(options.kscfg) @@ -121,7 +124,7 @@ def main(): creator.unmount() creator.package() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating Live CD : %s" % e + logging.error("Error creating Live CD : %s" % e) return 1 finally: creator.cleanup() -- 1.5.4.1 From katzj at redhat.com Wed May 21 14:32:13 2008 From: katzj at redhat.com (Jeremy Katz) Date: Wed, 21 May 2008 10:32:13 -0400 Subject: [Fedora-livecd-list] [PATCH] -Make-use-of-python-logging-API-for-debug-messages3 In-Reply-To: <1211379593-12188-1-git-send-email-dhuff@redhat.com> References: <48333977.4020905@redhat.com> <1211379593-12188-1-git-send-email-dhuff@redhat.com> Message-ID: <1211380333.12052.112.camel@aglarond.local> Thanks, applied Jeremy From katzj at fedoraproject.org Wed May 21 14:53:45 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Wed, 21 May 2008 14:53:45 +0000 (UTC) Subject: [Fedora-livecd-list] imgcreate/creator.py imgcreate/debug.py imgcreate/__init__.py imgcreate/live.py imgcreate/yuminst.py tools/image-creator tools/livecd-creator Message-ID: <20080521145345.7C00312000D@hosted1.fedoraproject.org> imgcreate/__init__.py | 4 +- imgcreate/creator.py | 5 +- imgcreate/debug.py | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ imgcreate/live.py | 4 +- imgcreate/yuminst.py | 3 + tools/image-creator | 7 ++-- tools/livecd-creator | 7 ++-- 7 files changed, 106 insertions(+), 10 deletions(-) New commits: commit 37932f4bd8735db53351553f69d35bda0ba2dd1b Author: David Huff Date: Wed May 21 10:19:53 2008 -0400 Make use of python logging API for debugging messages Use the python logging API for debugging rather than just outputting things directly to stdout/stderr diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py index e535014..bcfb40e 100644 --- a/imgcreate/__init__.py +++ b/imgcreate/__init__.py @@ -21,6 +21,7 @@ from imgcreate.creator import * from imgcreate.yuminst import * from imgcreate.kickstart import * from imgcreate.fs import * +from imgcreate.debug import * """A set of classes for building Fedora system images. @@ -62,5 +63,6 @@ __all__ = ( 'LoopImageCreator', 'FSLABEL_MAXLEN', 'read_kickstart', - 'construct_name' + 'construct_name', + 'setup_logging', ) diff --git a/imgcreate/creator.py b/imgcreate/creator.py index 1028e32..40ce1ef 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -22,6 +22,7 @@ import stat import sys import tempfile import shutil +import logging import yum import rpm @@ -522,7 +523,7 @@ class ImageCreator(object): (pkg, e)) for pkg in skipped_pkgs: - print >> sys.stderr, "Skipping missing package '%s'" % (pkg,) + logging.warn("Skipping missing package '%s'" % (pkg,)) def __select_groups(self, ayum): skipped_groups = [] @@ -537,7 +538,7 @@ class ImageCreator(object): skipped_groups.append(group) for group in skipped_groups: - print >> sys.stderr, "Skipping missing group '%s'" % (group.name,) + logging.warn("Skipping missing group '%s'" % (group.name,)) def __deselect_packages(self, ayum): for pkg in kickstart.get_excluded(self.ks, diff --git a/imgcreate/debug.py b/imgcreate/debug.py new file mode 100644 index 0000000..c45047d --- /dev/null +++ b/imgcreate/debug.py @@ -0,0 +1,86 @@ +# +# debug.py: Helper routines for debugging +# +# Copyright 2008, Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +import logging +import logging.handlers +import optparse +import sys + + +def handle_logging(option, opt, val, parser, logger, level): + if level < logger.level: + logger.setLevel(level) + +def handle_logfile(option, opt, val, parser, logger, stream): + try: + logfile = logging.FileHandler(val,"a") + except IOError, (err, msg): + raise optparse.OptionValueError("Cannot open file '%s' : %s" % + (val, msg)) + + + logger.removeHandler(stream) + logger.addHandler(logfile) + +def setup_logging(parser = None): + """Set up the root logger and add logging options. + + Set up the root logger so only warning/error messages are logged to stderr + by default. + + Also, optionally, add --debug, --verbose and --logfile command line options + to the supplied option parser, allowing the root logger configuration to be + modified by the user. + + Note, to avoid possible namespace clashes, setup_logging() will only ever + add these three options. No new options will be added in the future. + + parser -- an optparse.OptionParser instance, or None + + """ + logger = logging.getLogger() + + logger.setLevel(logging.WARN) + + stream = logging.StreamHandler(sys.stderr) + + logger.addHandler(stream) + + if parser is None: + return + + group = optparse.OptionGroup(parser, "Debugging options", + "These options control the output of logging information during image creation") + + group.add_option("-d", "--debug", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.DEBUG), + help = "Output debugging information") + + group.add_option("-v", "--verbose", + action = "callback", callback = handle_logging, + callback_args = (logger, logging.INFO), + help = "Output verbose progress information") + + group.add_option("", "--logfile", type="string", + action = "callback", callback = handle_logfile, + callback_args = (logger, stream), + help = "Save debug information to FILE", metavar = "FILE") + + parser.add_option_group(group) diff --git a/imgcreate/live.py b/imgcreate/live.py index c6267f7..130f7fa 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -21,6 +21,7 @@ import os.path import glob import shutil import subprocess +import logging from imgcreate.errors import * from imgcreate.fs import * @@ -252,8 +253,7 @@ class LiveImageCreatorBase(LoopImageCreator): elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"): implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5" else: - print >> sys.stderr, \ - "isomd5sum not installed; not setting up mediacheck" + logging.warn("isomd5sum not installed; not setting up mediacheck") subprocess.call([implantisomd5, iso]) diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py index 80fc514..aebb822 100644 --- a/imgcreate/yuminst.py +++ b/imgcreate/yuminst.py @@ -18,6 +18,7 @@ import os import sys +import logging import yum import rpmUtils @@ -103,7 +104,7 @@ class LiveCDYum(yum.YumBase): pkgs.remove(x) self.tsInfo.conditionals[req] = pkgs else: - print >> sys.stderr, "No such package %s to remove" %(pkg,) + logging.warn("No such package %s to remove" %(pkg,)) def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT): yum.YumBase.selectGroup(self, grp) diff --git a/tools/image-creator b/tools/image-creator index aca9228..6f2604c 100755 --- a/tools/image-creator +++ b/tools/image-creator @@ -21,6 +21,7 @@ import os import sys import shutil import optparse +import logging import imgcreate @@ -30,6 +31,8 @@ def parse_options(args): parser.add_option("-n", "--name", type="string", dest="name", help="Image name and filesystem label") + imgcreate.setup_logging(parser) + (options, args) = parser.parse_args() if len(args) != 1: @@ -48,7 +51,7 @@ def main(): try: ks = imgcreate.read_kickstart(kscfg) except imgcreate.CreatorError, e: - print >> sys.stderr, "Error loading kickstart file '%s' : %s" % (kscfg, e) + logging.error("Unable to load kickstart file '%s' : %s" % (kscfg, e)) return 1 if options.name: @@ -61,7 +64,7 @@ def main(): try: creator.create() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating image : %s" % e + logging.error("Unable to create image : %s" % e) return 1 finally: creator.cleanup() diff --git a/tools/livecd-creator b/tools/livecd-creator index 7c08323..a3ece16 100755 --- a/tools/livecd-creator +++ b/tools/livecd-creator @@ -22,6 +22,7 @@ import os.path import sys import time import optparse +import logging import imgcreate @@ -53,6 +54,8 @@ def parse_options(args): help="Cache directory to use (default: private cache") parser.add_option_group(sysopt) + imgcreate.setup_logging(parser) + # debug options not recommended for "production" images # Start a shell in the chroot for post-configuration. parser.add_option("-l", "--shell", action="store_true", dest="give_shell", @@ -101,7 +104,7 @@ def main(): "livecd-", maxlen = imgcreate.FSLABEL_MAXLEN) - print "Using label '%s' and name '%s'" % (fs_label, name) + logging.info("Using label '%s' and name '%s'" % (fs_label, name)) ks = imgcreate.read_kickstart(options.kscfg) @@ -121,7 +124,7 @@ def main(): creator.unmount() creator.package() except imgcreate.CreatorError, e: - print >> sys.stderr, "Error creating Live CD : %s" % e + logging.error("Error creating Live CD : %s" % e) return 1 finally: creator.cleanup() From dhuff at redhat.com Wed May 21 14:40:46 2008 From: dhuff at redhat.com (huff) Date: Wed, 21 May 2008 10:40:46 -0400 Subject: [Fedora-livecd-list] [PATCH] Refactor disk/mount classes to allow multi-partition/fs layouts In-Reply-To: <1207859838-27796-1-git-send-email-dhuff@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> Message-ID: <1211380848-13140-1-git-send-email-dhuff@redhat.com> I have broken this patch in to two separate patches: Refactor-disk-mount-classes-to-allow-multi-partitio.patch fs.py-kickstart.py-chages-for-mulit-partitions.patch Both depend on the python logging patch and the later, multi partition patch, depends on the Refactor patch. I have tested each incrementally against the latest version of livecd-creaotr with no known issues. From dhuff at redhat.com Wed May 21 14:40:48 2008 From: dhuff at redhat.com (huff) Date: Wed, 21 May 2008 10:40:48 -0400 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <1211380848-13140-2-git-send-email-dhuff@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> Message-ID: <1211380848-13140-3-git-send-email-dhuff@redhat.com> --- imgcreate/fs.py | 223 +++++++++++++++++++++++++++++++++++++++++++++++- imgcreate/kickstart.py | 4 + 2 files changed, 225 insertions(+), 2 deletions(-) diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 314a776..aaff4c3 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -357,11 +357,229 @@ class ExtDiskMount(DiskMount): def resparse(self, size = None): self.cleanup() - minsize = self.__resize_to_minimal() - self.disk.truncate(minsize) return minsize + +class PartitionedMount(Mount): + def __init__(self, disks, mountdir): + Mount.__init__(self, mountdir) + self.disks = {} + for name in disks.keys(): + self.disks[name] = { 'disk': disks[name], # Disk object + 'mapped': False, # True if kpartx mapping exists + 'numpart': 0, # Number of allocate partitions + 'partitions': [], # indexes to self.partitions + 'extended': 0, # Size of extended partition + 'offset': 0 } # Offset of next partition + + self.partitions = [] + self.mapped = False + self.mountOrder = [] + self.unmountOrder = [] + + def add_partition(self, size, disk, mountpoint, fstype = None): + self.partitions.append({'size': size, + 'mountpoint': mountpoint, # Mount relative to chroot + 'fstype': fstype, + 'disk': disk, # physical disk name holding partition + 'device': None, # kpartx device node for partition + 'mount': None, # Mount object + 'num': None}) # Partition number + + def __format_disks(self): + logging.debug("Formatting disks") + for dev in self.disks.keys(): + d = self.disks[dev] + logging.debug("Initializing partition table for %s" % (d['disk'].device)) + rc = subprocess.call(["/sbin/parted", "-s", d['disk'].device, "mklabel", "msdos"]) + if rc != 0: + raise MountError("Error writing partition table on %s" % d.device) + + logging.debug("Assigning partitions to disks") + for n in range(len(self.partitions)): + p = self.partitions[n] + + if not self.disks.has_key(p['disk']): + raise MountError("No disk %s for partition %s" % (p['disk'], p['mountpoint'])) + + d = self.disks[p['disk']] + d['numpart'] += 1 + if d['numpart'] > 3: + # Increase allocation of extended partition to hold this partition + d['extended'] += p['size'] + p['type'] = 'logical' + p['num'] = d['numpart'] + 1 + else: + p['type'] = 'primary' + p['num'] = d['numpart'] + + p['start'] = d['offset'] + d['offset'] += p['size'] + d['partitions'].append(n) + logging.debug("Assigned %s to %s%d at %d at size %d" % (p['mountpoint'], p['disk'], p['num'], p['start'], p['size'])) + + # XXX we should probably work in cylinder units to keep fdisk happier.. + start = 0 + logging.debug("Creating partitions") + for p in self.partitions: + d = self.disks[p['disk']] + if p['num'] == 5: + logging.debug("Added extended part at %d of size %d" % (p['start'], d['extended'])) + rc = subprocess.call(["/sbin/parted", "-s", d['disk'].device, "mkpart", "extended", + "%dM" % p['start'], "%dM" % (p['start'] + d['extended'])]) + + logging.debug("Add %s part at %d of size %d" % (p['type'], p['start'], p['size'])) + rc = subprocess.call(["/sbin/parted", "-s", d['disk'].device, "mkpart", + p['type'], "%dM" % p['start'], "%dM" % (p['start']+p['size'])]) + + # XXX disabled return code check because parted always fails to + # reload part table with loop devices. Annoying because we can't + # distinguish this failure from real partition failures :-( + if rc != 0 and 1 == 0: + raise MountError("Error creating partition on %s" % d['disk'].device) + + def __map_partitions(self): + for dev in self.disks.keys(): + d = self.disks[dev] + if d['mapped']: + continue + + kpartx = subprocess.Popen(["/sbin/kpartx", "-l", d['disk'].device], + stdout=subprocess.PIPE) + + kpartxOutput = kpartx.communicate()[0].split("\n") + # Strip trailing blank + kpartxOutput = kpartxOutput[0:len(kpartxOutput)-1] + + if kpartx.returncode: + raise MountError("Failed to query partition mapping for '%s'" % + d.device) + + # Quick sanity check that the number of partitions matches + # our expectation. If it doesn't, someone broke the code + # further up + if len(kpartxOutput) != d['numpart']: + raise MountError("Unexpected number of partitions from kpartx: %d != %d" % + (len(kpartxOutput), d['numpart'])) + + for i in range(len(kpartxOutput)): + line = kpartxOutput[i] + newdev = line.split()[0] + mapperdev = "/dev/mapper/" + newdev + loopdev = d['disk'].device + newdev[-1] + + logging.debug("Dev %s: %s -> %s" % (newdev, loopdev, mapperdev)) + pnum = d['partitions'][i] + self.partitions[pnum]['device'] = loopdev + + # grub's install wants partitions to be named + # to match their parent device + partition num + # kpartx doesn't work like this, so we add compat + # symlinks to point to /dev/mapper + os.symlink(mapperdev, loopdev) + + logging.debug("Adding partx mapping for %s" % d['disk'].device) + rc = subprocess.call(["/sbin/kpartx", "-a", d['disk'].device]) + if rc != 0: + raise MountError("Failed to map partitions for '%s'" % + d['disk'].device) + d['mapped'] = True + + + def __unmap_partitions(self): + for dev in self.disks.keys(): + d = self.disks[dev] + if not d['mapped']: + continue + + logging.debug("Removing compat symlinks") + for pnum in d['partitions']: + if self.partitions[pnum]['device'] != None: + os.unlink(self.partitions[pnum]['device']) + self.partitions[pnum]['device'] = None + + logging.debug("Unmapping %s" % d['disk'].device) + rc = subprocess.call(["/sbin/kpartx", "-d", d['disk'].device]) + if rc != 0: + raise MountError("Failed to unmap partitions for '%s'" % + d['disk'].device) + + d['mapped'] = False + + + def __calculate_mountorder(self): + for p in self.partitions: + self.mountOrder.append(p['mountpoint']) + self.unmountOrder.append(p['mountpoint']) + + self.mountOrder.sort() + self.unmountOrder.sort() + self.unmountOrder.reverse() + print str(self.mountOrder) + + def cleanup(self): + Mount.cleanup(self) + self.__unmap_partitions() + for dev in self.disks.keys(): + d = self.disks[dev] + try: + d['disk'].cleanup() + except: + pass + + def unmount(self): + for mp in self.unmountOrder: + if mp == 'swap': + continue + p = None + for p1 in self.partitions: + if p1['mountpoint'] == mp: + p = p1 + break + + if p['mount'] != None: + try: + p['mount'].cleanup() + except: + pass + p['mount'] = None + + def mount(self): + for dev in self.disks.keys(): + d = self.disks[dev] + d['disk'].create() + + self.__format_disks() + self.__map_partitions() + self.__calculate_mountorder() + + for mp in self.mountOrder: + p = None + for p1 in self.partitions: + if p1['mountpoint'] == mp: + p = p1 + break + + if mp == 'swap': + subprocess.call(["/sbin/mkswap", p['device']]) + continue + + rmmountdir = False + if p['mountpoint'] == "/": + rmmountdir = True + pdisk = ExtDiskMount(RawDisk(p['size'] * 1024 * 1024, p['device']), + self.mountdir + p['mountpoint'], + p['fstype'], + 4096, + p['mountpoint'], + rmmountdir) + pdisk.mount() + p['mount'] = pdisk + + def resparse(self, size = None): + # Can't re-sparse a disk image - too hard + pass class DeviceMapperSnapshot(object): def __init__(self, imgloop, cowloop): @@ -478,3 +696,4 @@ def create_image_minimizer(path, image, minimal_size): mksquashfs(cowloop.lofile, path) os.unlink(cowloop.lofile) + diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py index ef7b9e4..eff28bb 100644 --- a/imgcreate/kickstart.py +++ b/imgcreate/kickstart.py @@ -474,6 +474,9 @@ def get_groups(ks, required = []): def get_excluded(ks, required = []): return ks.handler.packages.excludedList + required +def get_partitions(ks, required = []): + return ks.handler.partition.partitions + def ignore_missing(ks): return ks.handler.packages.handleMissing == ksconstants.KS_MISSING_IGNORE @@ -490,3 +493,4 @@ def get_post_scripts(ks): def selinux_enabled(ks): return ks.handler.selinux.selinux == ksconstants.SELINUX_ENFORCING + -- 1.5.4.1 From dhuff at redhat.com Wed May 21 14:40:47 2008 From: dhuff at redhat.com (huff) Date: Wed, 21 May 2008 10:40:47 -0400 Subject: [Fedora-livecd-list] [PATCH] -Refactor-disk-mount-classes-to-allow-multi-partitions In-Reply-To: <1211380848-13140-1-git-send-email-dhuff@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> Message-ID: <1211380848-13140-2-git-send-email-dhuff@redhat.com> --- imgcreate/creator.py | 17 ++-- imgcreate/fs.py | 250 ++++++++++++++++++++++++++++++++------------------ imgcreate/live.py | 6 +- 3 files changed, 175 insertions(+), 98 deletions(-) diff --git a/imgcreate/creator.py b/imgcreate/creator.py index febb847..7ccbef9 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -208,7 +208,11 @@ class ImageCreator(object): """ s = "/dev/root / %s defaults,noatime 0 0\n" %(self._fstype) - s += "devpts /dev/pts devpts gid=5,mode=620 0 0\n" + s += self._get_fstab_special() + return s + + def _get_fstab_special(self): + 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" @@ -840,12 +844,11 @@ class LoopImageCreator(ImageCreator): if not base_on is None: shutil.copyfile(base_on, self._image) - self.__instloop = SparseExtLoopbackMount(self._image, - self._instroot, - self.__image_size, - self.__fstype, - self.__blocksize, - self.fslabel) + self.__instloop = ExtDiskMount(SparseLoopbackDisk(self._image, self.__image_size), + self._instroot, + self.__fstype, + self.__blocksize, + self.fslabel) try: self.__instloop.mount() diff --git a/imgcreate/fs.py b/imgcreate/fs.py index 98c0db4..314a776 100644 --- a/imgcreate/fs.py +++ b/imgcreate/fs.py @@ -24,6 +24,7 @@ import stat import subprocess import random import string +import logging from imgcreate.errors import * @@ -86,42 +87,51 @@ class BindChrootMount: subprocess.call(["/bin/umount", self.dest]) self.mounted = False -class LoopbackMount: - def __init__(self, lofile, mountdir, fstype = None): - self.lofile = lofile - self.mountdir = mountdir - self.fstype = fstype +class Disk: + def __init__(self, size, device = None): + self._device = device + self._size = size - self.mounted = False - self.losetup = False - self.rmdir = False - self.loopdev = None + def create(self): + pass def cleanup(self): - self.unmount() - self.lounsetup() + pass - def unmount(self): - if self.mounted: - rc = subprocess.call(["/bin/umount", self.mountdir]) - if rc == 0: - self.mounted = False + def get_device(self): + return self._device + def set_device(self, path): + self._device = path + device = property(get_device, set_device) - if self.rmdir and not self.mounted: - try: - os.rmdir(self.mountdir) - except OSError, e: - pass - self.rmdir = False + def get_size(self): + return self._size + size = property(get_size) + + +class RawDisk(Disk): + def __init__(self, size, device): + Disk.__init__(self, size, device) + + def fixed(self): + return True + + def exists(self): + return True + +class LoopbackDisk(Disk): + def __init__(self, lofile, size): + Disk.__init__(self, size) + self.lofile = lofile + + def fixed(self): + return False - def lounsetup(self): - if self.losetup: - rc = subprocess.call(["/sbin/losetup", "-d", self.loopdev]) - self.losetup = False - self.loopdev = None + def exists(self): + return os.path.exists(self.lofile) - def loopsetup(self): - if self.losetup: + def create(self): + if self.device is not None: return losetupProc = subprocess.Popen(["/sbin/losetup", "-f"], @@ -132,40 +142,27 @@ class LoopbackMount: raise MountError("Failed to allocate loop device for '%s'" % self.lofile) - self.loopdev = losetupOutput.split()[0] + device = losetupOutput.split()[0] - rc = subprocess.call(["/sbin/losetup", self.loopdev, self.lofile]) + logging.debug("Losetup add %s mapping to %s" % (device, self.lofile)) + rc = subprocess.call(["/sbin/losetup", device, self.lofile]) if rc != 0: raise MountError("Failed to allocate loop device for '%s'" % self.lofile) + self.device = device - self.losetup = True - - def mount(self): - if self.mounted: + def cleanup(self): + if self.device is None: return + logging.debug("Losetup remove %s" % self.device) + rc = subprocess.call(["/sbin/losetup", "-d", self.device]) + self.device = None - 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: - raise MountError("Failed to mount '%s' to '%s'" % - (self.loopdev, self.mountdir)) - - self.mounted = True - -class SparseLoopbackMount(LoopbackMount): - def __init__(self, lofile, mountdir, size, fstype = None): - LoopbackMount.__init__(self, lofile, mountdir, fstype) - self.size = size +class SparseLoopbackDisk(LoopbackDisk): + def __init__(self, lofile, size): + LoopbackDisk.__init__(self, lofile, size) def expand(self, create = False, size = None): flags = os.O_WRONLY @@ -176,6 +173,7 @@ class SparseLoopbackMount(LoopbackMount): if size is None: size = self.size + logging.debug("Extending sparse file %s to %d" % (self.lofile, size)) fd = os.open(self.lofile, flags) os.lseek(fd, size, 0) @@ -185,36 +183,107 @@ class SparseLoopbackMount(LoopbackMount): def truncate(self, size = None): if size is None: size = self.size + + logging.debug("Truncating sparse file %s to %d" % (self.lofile, size)) fd = os.open(self.lofile, os.O_WRONLY) os.ftruncate(fd, size) os.close(fd) def create(self): self.expand(create = True) + LoopbackDisk.create(self) + +class Mount: + def __init__(self, mountdir): + self.mountdir = mountdir + + def cleanup(self): + self.unmount() + + def mount(self): + pass + + def unmount(self): + pass + +class DiskMount(Mount): + def __init__(self, disk, mountdir, fstype = None, rmmountdir = True): + Mount.__init__(self, mountdir) + + self.disk = disk + self.fstype = fstype + self.rmmountdir = rmmountdir + + self.mounted = False + self.rmdir = False + + def cleanup(self): + Mount.cleanup(self) + self.disk.cleanup() + + def unmount(self): + if self.mounted: + logging.debug("Unmounting directory %s" % self.mountdir) + rc = subprocess.call(["/bin/umount", self.mountdir]) + if rc == 0: + self.mounted = False + + if self.rmdir and not self.mounted: + try: + os.rmdir(self.mountdir) + except OSError, e: + pass + self.rmdir = False + + + def __create(self): + self.disk.create() + -class SparseExtLoopbackMount(SparseLoopbackMount): - def __init__(self, lofile, mountdir, size, fstype, blocksize, fslabel): - SparseLoopbackMount.__init__(self, lofile, mountdir, size, fstype) + def mount(self): + if self.mounted: + return + + if not os.path.isdir(self.mountdir): + logging.debug("Creating mount point %s" % self.mountdir) + os.makedirs(self.mountdir) + self.rmdir = self.rmmountdir + + self.__create() + + logging.debug("Mounting %s at %s" % (self.disk.device, self.mountdir)) + args = [ "/bin/mount", self.disk.device, self.mountdir ] + if self.fstype: + args.extend(["-t", self.fstype]) + + rc = subprocess.call(args) + if rc != 0: + raise MountError("Failed to mount '%s' to '%s'" % + (self.disk.device, self.mountdir)) + + self.mounted = True + +class ExtDiskMount(DiskMount): + def __init__(self, disk, mountdir, fstype, blocksize, fslabel, rmmountdir=True): + DiskMount.__init__(self, disk, mountdir, fstype, rmmountdir) self.blocksize = blocksize self.fslabel = fslabel def __format_filesystem(self): + logging.debug("Formating %s filesystem on %s" % (self.fstype, self.disk.device)) rc = subprocess.call(["/sbin/mkfs." + self.fstype, "-F", "-L", self.fslabel, "-m", "1", "-b", str(self.blocksize), - self.lofile, - str(self.size / self.blocksize)]) + self.disk.device]) + # str(self.disk.size / self.blocksize)]) if rc != 0: raise MountError("Error creating %s filesystem" % (self.fstype,)) + logging.debug("Tuning filesystem on %s" % self.disk.device) subprocess.call(["/sbin/tune2fs", "-c0", "-i0", "-Odir_index", - "-ouser_xattr,acl", self.lofile]) - - def create(self): - SparseLoopbackMount.create(self) - self.__format_filesystem() + "-ouser_xattr,acl", self.disk.device]) - def resize(self, size = None): - current_size = os.stat(self.lofile)[stat.ST_SIZE] + def __resize_filesystem(self, size = None): + current_size = os.stat(self.disk.lofile)[stat.ST_SIZE] if size is None: size = self.size @@ -227,21 +296,28 @@ class SparseExtLoopbackMount(SparseLoopbackMount): self.__fsck() - resize2fs(self.lofile, size) - - if size < current_size: - self.truncate(size) + resize2fs(self.disk.lofile, size) return size - def mount(self): - if not os.path.isfile(self.lofile): - self.create() + def __create(self): + resize = False + if not self.disk.fixed() and self.disk.exists(): + resize = True + + self.disk.create() + + if resize: + self.__resize_filesystem() else: - self.resize() - return SparseLoopbackMount.mount(self) + self.__format_filesystem() + + def mount(self): + self.__create() + DiskMount.mount(self) def __fsck(self): - subprocess.call(["/sbin/e2fsck", "-f", "-y", self.lofile]) + logging.debug("Checking filesystem %s" % self.disk.lofile) + subprocess.call(["/sbin/e2fsck", "-f", "-y", self.disk.lofile]) def __get_size_from_filesystem(self): def parse_field(output, field): @@ -253,7 +329,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount): dev_null = os.open("/dev/null", os.O_WRONLY) try: - out = subprocess.Popen(['/sbin/dumpe2fs', '-h', self.lofile], + out = subprocess.Popen(['/sbin/dumpe2fs', '-h', self.disk.lofile], stdout = subprocess.PIPE, stderr = dev_null).communicate()[0] finally: @@ -273,7 +349,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount): while top != (bot + 1): t = bot + ((top - bot) / 2) - if not resize2fs(self.lofile, t): + if not resize2fs(self.disk.lofile, t): top = t else: bot = t @@ -284,8 +360,7 @@ class SparseExtLoopbackMount(SparseLoopbackMount): minsize = self.__resize_to_minimal() - self.truncate(minsize) - self.resize(size) + self.disk.truncate(minsize) return minsize class DeviceMapperSnapshot(object): @@ -306,8 +381,8 @@ class DeviceMapperSnapshot(object): if self.__created: return - self.imgloop.loopsetup() - self.cowloop.loopsetup() + self.imgloop.create() + self.cowloop.create() self.__name = "imgcreate-%d-%d" % (os.getpid(), random.randint(0, 2**16)) @@ -315,8 +390,8 @@ class DeviceMapperSnapshot(object): size = os.stat(self.imgloop.lofile)[stat.ST_SIZE] table = "0 %d snapshot %s %s p 8" % (size / 512, - self.imgloop.loopdev, - self.cowloop.loopdev) + self.imgloop.device, + self.cowloop.device) args = ["/sbin/dmsetup", "create", self.__name, "--table", table] if subprocess.call(args) != 0: @@ -382,15 +457,14 @@ class DeviceMapperSnapshot(object): # 8) Create a squashfs of the COW # def create_image_minimizer(path, image, minimal_size): - imgloop = LoopbackMount(image, "None") + imgloop = LoopbackDisk(image, None) # Passing bogus size - doesn't matter - cowloop = SparseLoopbackMount(os.path.join(os.path.dirname(path), "osmin"), - None, 64L * 1024L * 1024L) + cowloop = SparseLoopbackDisk(os.path.join(os.path.dirname(path), "osmin"), + 64L * 1024L * 1024L) snapshot = DeviceMapperSnapshot(imgloop, cowloop) try: - cowloop.create() snapshot.create() resize2fs(snapshot.path, minimal_size) diff --git a/imgcreate/live.py b/imgcreate/live.py index 130f7fa..9ecd3cf 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -129,7 +129,7 @@ class LiveImageCreatorBase(LoopImageCreator): # def __base_on_iso(self, base_on): """helper function to extract ext3 file system from a live CD ISO""" - isoloop = LoopbackMount(base_on, self._mkdtemp()) + isoloop = Mount(LoopbackDisk(base_on), self._mkdtemp()) try: isoloop.mount() @@ -143,10 +143,10 @@ class LiveImageCreatorBase(LoopImageCreator): else: squashimg = isoloop.mountdir + "/LiveOS/squashfs.img" - squashloop = LoopbackMount(squashimg, self._mkdtemp(), "squashfs") + squashloop = Mount(LoopbackDisk(squashimg), self._mkdtemp(), "squashfs") try: - if not os.path.exists(squashloop.lofile): + if not squashloop.disk.exists(): raise CreatorError("'%s' is not a valid live CD ISO : " "squashfs.img doesn't exist" % base_on) -- 1.5.4.1 From todd655495 at yahoo.com Fri May 23 04:07:35 2008 From: todd655495 at yahoo.com (Todd N) Date: Thu, 22 May 2008 21:07:35 -0700 (PDT) Subject: [Fedora-livecd-list] LiveCD and openvpn configs Message-ID: <661096.54212.qm@web54006.mail.re2.yahoo.com> Hello, I'm trying to build a Live CD that is set up with a working openvpn client. I have taken what I think are all the config settings for openvpn (from an already existing, configured OS with a functional openvpn setup), and placed them in /etc/skel in the Live CD's ext3 filesystem. (I got the configs from /home//.gconf/system/networking/connections.) I am also creating a user in the %post section of the pertinent kickstart file. I would expect that when the Live CD is booted, the user will be created and the openvpn settings will be copied in from /etc/skel to that user's home directory. On booting the Live CD I create, when first logging into the user's desktop the customized openvpn settings do not seem to be present. However, if I log out of that user and then log back in, the settings are there. Any ideas on what I might be doing wrong? Am I missing some other configurations? I will be happy to clarify if anyone has any questions on what I am asking - or trying to ask. :-) Thanks much, Todd -------------- next part -------------- An HTML attachment was scrubbed... URL: From fulko.hew at gmail.com Sat May 24 15:21:40 2008 From: fulko.hew at gmail.com (Fulko Hew) Date: Sat, 24 May 2008 11:21:40 -0400 Subject: [Fedora-livecd-list] failing at my first attempt at liveCD creation Message-ID: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> I'm failing at my first attempt at creating (or recreating) a live CD - I'm using Fedora 8 (because I don't find KDE in F9 usable yet) - I have SELinux disabled. Following the process described in the LiveCDHowTo, well, actually the step: livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks resulted in a complaint about SELinux not being enabled on the host system... Right, so I edited the '.ks' file and set selinux=--disabled This let it proceed through the build stage with the following errors: Installing: info ##################### [ 29/129] /var/tmp/rpm-tmp.42253: line 2: sed: command not found error: %post(info-4.12-1.fc10.i386) scriptlet failed, exit status 127 ... Installing: cracklib ##################### [ 45/129] /var/tmp/rpm-tmp.50225: line 2: getent: command not found /var/tmp/rpm-tmp.50225: line 3: getent: command not found ... Installing: kernel ##################### [124/129] device-mapper: table ioctl failed: No such device or address Command failed ... Installing: selinux-policy-targeted ##################### [129/129] libsemanage.dbase_llist_query: could not query record value libsepol.sepol_user_modify: MLS is enabled, but no MLS default level was defined for user guest_u libsepol.sepol_user_modify: could not load (null) into policy libsemanage.dbase_policydb_modify: could not modify record value libsemanage.semanage_base_merge_components: could not merge local modifications into policy /usr/sbin/semanage: Could not add SELinux user guest_u libsepol.sepol_user_modify: MLS is enabled, but no MLS default level was defined for user xguest_u libsepol.sepol_user_modify: could not load (null) into policy libsemanage.dbase_policydb_modify: could not modify record value libsemanage.semanage_base_merge_components: could not merge local modifications into policy /usr/sbin/semanage: Could not add SELinux user xguest_u Removing password for user root. passwd: Success Then I used the specified command to execute the ISO image: qemu -m 512 -cdrom livecd-fulko-200805241043.iso The first time I followed the procedure (a few days ago) to build the ISO and execute it, it wouldn't even boot. Today I retried the same procedure, and today it boots, but after it get to the point of starting udev, something flashes by on the screen (qemu window) and then the window goes black, and I can't see anything after that. I seems hung. So then I tried recreating the 'livecd-fedora-desktop.ks' version as per instructions and it dies with: Installing: tzdata ################### [ 21/1019] umount: /var/tmp/livecd-creator-PxlU8W/install_root: device is busy umount: /var/tmp/livecd-creator-PxlU8W/install_root: device is busy ioctl: LOOP_CLR_FD: Device or resource busy Traceback (most recent call last): File "/usr/bin/livecd-creator", line 1603, in sys.exit(main()) File "/usr/bin/livecd-creator", line 1575, in main target.install() File "/usr/bin/livecd-creator", line 948, in install self.installPackages() File "/usr/bin/livecd-creator", line 591, in installPackages self.ayum.runInstall() File "/usr/bin/livecd-creator", line 330, in runInstall return self.runTransaction(cb) File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 591, in runTransaction errors = self.ts.run(cb.callback, '') File "/usr/share/yum-cli/callback.py", line 124, in callback fd = os.open(rpmloc, os.O_RDONLY) OSError: [Errno 2] No such file or directory: '/var/tmp/livecd-creator-PxlU8W/install_root/var/cache/yum/development/packages/texlive-texmf-errata-fonts-2007-4.fc9.noarch.rpm' So I'm at a loss as to how to proceed to start testing this process even before I add my own customizations. Any help would be appreciated. TIA Fulko -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.wood at datawranglers.com Sat May 24 15:44:48 2008 From: tim.wood at datawranglers.com (Tim Wood) Date: Sat, 24 May 2008 09:44:48 -0600 Subject: [Fedora-livecd-list] failing at my first attempt at liveCD creation In-Reply-To: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> References: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> Message-ID: <483837F0.7030006@datawranglers.com> Once you get it to work, you'll find that you can't log in to the minimal livecd. That's just the way it's designed. So, I'd suggest switching to another one. It probably has a bunch of SELinux packages specified. I've found that (if I don't want SELinux), I have to do this to the kickstart. It looks like a lot of your failures are because certain commands arn't available: sed, getent, etc. Make sure they're installed. Then make sure your PATH variable includes their directories. Also, make sure /var/tmp is on a local drive. Pretty much any directory that livecd-creator uses needs to be on a local drive or you run the risk of strange build failures. Until you get it to build without these errors it's not going to boot under qemu. Tim Fulko Hew wrote: > > I'm failing at my first attempt at creating (or recreating) a live CD > > - I'm using Fedora 8 (because I don't find KDE in F9 usable yet) > - I have SELinux disabled. > > Following the process described in the LiveCDHowTo, well, actually > the step: > > livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks > > resulted in a complaint about SELinux not being enabled on the host > system... > Right, so I edited the '.ks' file and set selinux=--disabled > > This let it proceed through the build stage with the following errors: > > > > Installing: info ##################### [ 29/129] > /var/tmp/rpm-tmp.42253: line 2: sed: command not found > error: %post(info-4.12-1.fc10.i386) scriptlet failed, exit status 127 > > ... > > Installing: cracklib ##################### [ 45/129] > /var/tmp/rpm-tmp.50225: line 2: getent: command not found > /var/tmp/rpm-tmp.50225: line 3: getent: command not found > > ... > > Installing: kernel ##################### [124/129] > device-mapper: table ioctl failed: No such device or address > Command failed > > ... > > Installing: selinux-policy-targeted ##################### [129/129] > libsemanage.dbase_llist_query: could not query record value > libsepol.sepol_user_modify: MLS is enabled, but no MLS default level > was defined for user guest_u > libsepol.sepol_user_modify: could not load (null) into policy > libsemanage.dbase_policydb_modify: could not modify record value > libsemanage.semanage_base_merge_components: could not merge local > modifications into policy > /usr/sbin/semanage: Could not add SELinux user guest_u > libsepol.sepol_user_modify: MLS is enabled, but no MLS default level > was defined for user xguest_u > libsepol.sepol_user_modify: could not load (null) into policy > libsemanage.dbase_policydb_modify: could not modify record value > libsemanage.semanage_base_merge_components: could not merge local > modifications into policy > /usr/sbin/semanage: Could not add SELinux user xguest_u > Removing password for user root. > passwd: Success > > > Then I used the specified command to execute the ISO image: > > qemu -m 512 -cdrom livecd-fulko-200805241043.iso > > The first time I followed the procedure (a few days ago) to > build the ISO and execute it, it wouldn't even boot. > Today I retried the same procedure, and today it boots, > but after it get to the point of starting udev, something > flashes by on the screen (qemu window) and then the window > goes black, and I can't see anything after that. I seems hung. > > So then I tried recreating the 'livecd-fedora-desktop.ks' > version as per instructions and it dies with: > > Installing: tzdata ################### [ 21/1019] > umount: /var/tmp/livecd-creator-PxlU8W/install_root: device is busy > umount: /var/tmp/livecd-creator-PxlU8W/install_root: device is busy > ioctl: LOOP_CLR_FD: Device or resource busy > Traceback (most recent call last): > File "/usr/bin/livecd-creator", line 1603, in > sys.exit(main()) > File "/usr/bin/livecd-creator", line 1575, in main > target.install() > File "/usr/bin/livecd-creator", line 948, in install > self.installPackages() > File "/usr/bin/livecd-creator", line 591, in installPackages > self.ayum.runInstall() > File "/usr/bin/livecd-creator", line 330, in runInstall > return self.runTransaction(cb) > File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 591, > in runTransaction > errors = self.ts.run(cb.callback, '') > File "/usr/share/yum-cli/callback.py", line 124, in callback > fd = os.open(rpmloc, os.O_RDONLY) > OSError: [Errno 2] No such file or directory: > '/var/tmp/livecd-creator-PxlU8W/install_root/var/cache/yum/development/packages/texlive-texmf-errata-fonts-2007-4.fc9.noarch.rpm' > > > So I'm at a loss as to how to proceed to start testing this process > even before I add my own customizations. > > Any help would be appreciated. > > TIA > Fulko > > ------------------------------------------------------------------------ > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > -- _________________________________ Tim Wood, CLP, RHCT 719.338.7484 (tel) The Data Wranglers Web, Database & more since since 1994 www.datawranglers.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdogalt at yahoo.com Sat May 24 19:11:05 2008 From: jdogalt at yahoo.com (Jane Dogalt) Date: Sat, 24 May 2008 12:11:05 -0700 (PDT) Subject: [Fedora-livecd-list] my fedora 10 prophecy: the unsuckiness of liveusb persistence Message-ID: <791358.54323.qm@web56910.mail.re3.yahoo.com> Actually I hope to get this done ASAP for F9- ============ The problem: ============ LiveUSB persistence as currently implemented suffers from three really nasty imperfections. 1) df -h does not really tell you how much free disk space (aka persistent storage) you have. To find out how close you are to the edge of IO errors (aka disk/persistent-storage full), you actually need to pay attention to 3 things. The free space on the root filesystem, the free space in the device mapper snapshot overlay file, and the free space on the filesystem holding that file. It is the minimum of those 3 values that is your real constraint. 2) when you delete files that you have created, you do not necessarily free space. 3) on your LiveUSB, you have this nice 2GB rootfs compressed into a 700MB squashfs image, but everything you do in persistent/read-write land is done uncompressed. Throw the inefficiency of (2) on top of that, with the lack of user monitorability due to (1), and what you have is a feature that starts out looking really cool, but rather quickly dies a horrible death. ============= The Solution: ============= (1) is the easiest and most straightforward to solve. Just write a mechanism/function/script that exposes the real 'free space' number to the user, as a fraction of the original amount. Put this in a little meter on the gnome-panel along with a command line utility, and call it something appropriately cute, like the 'life bar' or 'live meter' or such... (2) and (3) however require a rather more clever solution, which just hit me a couple days ago. If you stare at my rebootless livecd/usb installer(a) and have a good understanding of how livecd-creator formats the rootfs into the form it exists on the LiveUSB, you might see where I'm headed. peace... -jdog (a) http://filteredperception.org/smiley/projects/viros/viros-0.5/traits/rliveinst/usr/sbin/rliveinst From jdogalt at yahoo.com Sat May 24 19:19:45 2008 From: jdogalt at yahoo.com (Jane Dogalt) Date: Sat, 24 May 2008 12:19:45 -0700 (PDT) Subject: [Fedora-livecd-list] my fedora 10 prophecy: the unsuckiness of liveusb persistence In-Reply-To: <791358.54323.qm@web56910.mail.re3.yahoo.com> Message-ID: <380263.91410.qm@web56905.mail.re3.yahoo.com> --- Jane Dogalt wrote: > LiveUSB persistence as currently implemented suffers from three really nasty > imperfections. > > 1) df -h does not really tell you how much free disk space (aka persistent > storage) you have. To find out how close you are to the edge of IO errors > (aka > disk/persistent-storage full), you actually need to pay attention to 3 > things. > The free space on the root filesystem, the free space in the device mapper > snapshot overlay file, and the free space on the filesystem holding that > file. > It is the minimum of those 3 values that is your real constraint. minor clarification- the 3rd constraint only matters if the overlay file is a sparse file, which, for the current typical use case on a vfat filesystem, is not the case. OTOH, since it is possible to (manually at the moment) increase the size of that file while running, the free space on the filesystem that holds it is a constraint, but just in a bit more complex way than the min(a,b,c) way I described. From igorsoares at gmail.com Sat May 24 23:58:16 2008 From: igorsoares at gmail.com (Igor Pires Soares) Date: Sat, 24 May 2008 20:58:16 -0300 Subject: [Fedora-livecd-list] Brazilian Portuguese localized spin for Fedora 9 Message-ID: <1211673496.3068.2.camel@AMD5600> Hello all! I created a spin for Brazilian users and would like to share some thoughts here. I managed enough space in order to include required localized packages such as hunspell-pt and openoffice.org-langpack-pt_BR. It was really good to get OpenOffice.org included because the DVD Installation Media is not installing the Language Pack by default, which is critical for localized desktops. The interesting thing is that the ISO created using livecd-tools-017-1 in Fedora 9 was 10 MB smaller than the one created using livecd-tools-013-1 in F8. With the newer version I got 690 MB and with the older one I got 700 MB, which still fits in a CD in my tests. Considering the size, I don't intend to make it grow anymore, in order to preserve the compatibility with older livecd-tools versions. So if somebody still runs F8 and wants to create the spin there will be no problem. The .ks files are available at Fedora People if anybody wants to take a look: http://igor.fedorapeople.org/spin-pt_BR/F9/ I am thinking about hosting them in our infrastructure at http://www.projetofedora.org/ and make a torrent with the ISO in the future, if nobody opposes to that. Regards, Igor Pires Soares From fulko.hew at gmail.com Sun May 25 12:33:08 2008 From: fulko.hew at gmail.com (Fulko Hew) Date: Sun, 25 May 2008 08:33:08 -0400 Subject: [Fedora-livecd-list] failing at my first attempt at liveCD creation In-Reply-To: <483837F0.7030006@datawranglers.com> References: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> <483837F0.7030006@datawranglers.com> Message-ID: <8204a4fe0805250533nc60e649oeb87483bd24c00c8@mail.gmail.com> On Sat, May 24, 2008 at 11:44 AM, Tim Wood wrote: > Once you get it to work, you'll find that you can't log in to the minimal > livecd. > Yes, I read that. But I was just trying to figure out whether or not I could get the process to work... and I couldn't. :-( Thats why I also tried the 'desktop' version. > That's just the way it's designed. So, I'd suggest switching to another > one. It probably has a bunch of SELinux packages specified. > They all seem to. > I've found that (if I don't want SELinux), I have to do this to the > kickstart. > Do what? Did you forget to write something here? It looks like a lot of your failures are because certain commands arn't > available: sed, getent, etc. Make sure they're installed. Then make sure > your PATH variable includes their directories. > I do have those things available... at least to me. I don't know about the environment that livecd-creator makes for itself though. Same things goes for PATH. I can execute those utilities. Also, make sure /var/tmp is on a local drive. Pretty much any directory > that livecd-creator uses needs to be on a local drive or you run the risk of > strange build failures. > Yup. everything is local. > Until you get it to build without these errors it's not going to boot under > qemu. > Thats why I'm looking for help/advice. When I tried to build the 'desktop' version it complained about 'gnome-blog' It all make me wonder if stuff hasn't been changed, and yet the livecd-creator tool and the kickstart files haven't been tracking? So... I still need advice. > Fulko Hew wrote: > > > I'm failing at my first attempt at creating (or recreating) a live CD > > - I'm using Fedora 8 (because I don't find KDE in F9 usable yet) > - I have SELinux disabled. > > Following the process described in the LiveCDHowTo, well, actually > the step: > > livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks > > resulted in a complaint about SELinux not being enabled on the host > system... > Right, so I edited the '.ks' file and set selinux=--disabled > > This let it proceed through the build stage with the following errors: > > > > Installing: info ##################### [ 29/129] > /var/tmp/rpm-tmp.42253: line 2: sed: command not found > error: %post(info-4.12-1.fc10.i386) scriptlet failed, exit status 127 > > ... > > Installing: cracklib ##################### [ 45/129] > /var/tmp/rpm-tmp.50225: line 2: getent: command not found > /var/tmp/rpm-tmp.50225: line 3: getent: command not found > > ... > > Installing: kernel ##################### [124/129] > device-mapper: table ioctl failed: No such device or address > Command failed > > ... > > Installing: selinux-policy-targeted ##################### [129/129] > libsemanage.dbase_llist_query: could not query record value > libsepol.sepol_user_modify: MLS is enabled, but no MLS default level was > defined for user guest_u > libsepol.sepol_user_modify: could not load (null) into policy > libsemanage.dbase_policydb_modify: could not modify record value > libsemanage.semanage_base_merge_components: could not merge local > modifications into policy > /usr/sbin/semanage: Could not add SELinux user guest_u > libsepol.sepol_user_modify: MLS is enabled, but no MLS default level was > defined for user xguest_u > libsepol.sepol_user_modify: could not load (null) into policy > libsemanage.dbase_policydb_modify: could not modify record value > libsemanage.semanage_base_merge_components: could not merge local > modifications into policy > /usr/sbin/semanage: Could not add SELinux user xguest_u > Removing password for user root. > passwd: Success > > > Then I used the specified command to execute the ISO image: > > qemu -m 512 -cdrom livecd-fulko-200805241043.iso > > The first time I followed the procedure (a few days ago) to > build the ISO and execute it, it wouldn't even boot. > Today I retried the same procedure, and today it boots, > but after it get to the point of starting udev, something > flashes by on the screen (qemu window) and then the window > goes black, and I can't see anything after that. I seems hung. > > So then I tried recreating the 'livecd-fedora-desktop.ks' > version as per instructions and it dies with: > > Installing: tzdata ################### [ 21/1019] > umount: /var/tmp/livecd-creator-PxlU8W/install_root: device is busy > umount: /var/tmp/livecd-creator-PxlU8W/install_root: device is busy > ioctl: LOOP_CLR_FD: Device or resource busy > Traceback (most recent call last): > File "/usr/bin/livecd-creator", line 1603, in > sys.exit(main()) > File "/usr/bin/livecd-creator", line 1575, in main > target.install() > File "/usr/bin/livecd-creator", line 948, in install > self.installPackages() > File "/usr/bin/livecd-creator", line 591, in installPackages > self.ayum.runInstall() > File "/usr/bin/livecd-creator", line 330, in runInstall > return self.runTransaction(cb) > File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 591, in > runTransaction > errors = self.ts.run(cb.callback, '') > File "/usr/share/yum-cli/callback.py", line 124, in callback > fd = os.open(rpmloc, os.O_RDONLY) > OSError: [Errno 2] No such file or directory: > '/var/tmp/livecd-creator-PxlU8W/install_root/var/cache/yum/development/packages/texlive-texmf-errata-fonts-2007-4.fc9.noarch.rpm' > > > So I'm at a loss as to how to proceed to start testing this process > even before I add my own customizations. > > Any help would be appreciated. > > TIA > Fulko > > ------------------------------ > > -- > Fedora-livecd-list mailing listFedora-livecd-list at redhat.comhttps://www.redhat.com/mailman/listinfo/fedora-livecd-list > > > > -- > _________________________________ > Tim Wood, CLP, RHCT > 719.338.7484 (tel) > > The Data Wranglers > Web, Database & more since since 1994 > www.datawranglers.com > > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.wood at datawranglers.com Sun May 25 16:46:16 2008 From: tim.wood at datawranglers.com (Tim Wood) Date: Sun, 25 May 2008 10:46:16 -0600 Subject: [Fedora-livecd-list] failing at my first attempt at liveCD creation In-Reply-To: <8204a4fe0805250533nc60e649oeb87483bd24c00c8@mail.gmail.com> References: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> <483837F0.7030006@datawranglers.com> <8204a4fe0805250533nc60e649oeb87483bd24c00c8@mail.gmail.com> Message-ID: <483997D8.4030304@datawranglers.com> > > I've found that (if I don't want SELinux), I have to do this to > the kickstart. > > > Do what? Did you forget to write something here? My fingers didn't keep up, did they :-) Look through the package list for anything that looks like an selinux package (usually the names begin with se), remove them. When you try to build, the list of packages will run by. If you still see anything to do with selinux, make a note and mark it to be removed in the package. So, if you see se_foo_bar_your_install, you would add this to your package list to remove it: -se_foo_bar_your_install > It looks like a lot of your failures are because certain commands > arn't available: sed, getent, etc. Make sure they're installed. > Then make sure your PATH variable includes their directories. > > > I do have those things available... at least to me. > I don't know about the environment that livecd-creator makes for > itself though. > Same things goes for PATH. I can execute those utilities. Strange... I believe livecd-creator uses your PATH. Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdogalt at yahoo.com Sun May 25 19:44:10 2008 From: jdogalt at yahoo.com (Jane Dogalt) Date: Sun, 25 May 2008 12:44:10 -0700 (PDT) Subject: [Fedora-livecd-list] failing at my first attempt at liveCD creation In-Reply-To: <483997D8.4030304@datawranglers.com> Message-ID: <267207.732.qm@web56909.mail.re3.yahoo.com> --- Tim Wood wrote: > > > > > I do have those things available... at least to me. > > I don't know about the environment that livecd-creator makes for > > itself though. > > Same things goes for PATH. I can execute those utilities. > Strange... I believe livecd-creator uses your PATH. livecd-creator is doing chroot rpm installs, something that incidentally selinux is fundamentally flawed in supporting (which is why amongst other reasons I vote for not setting it as Enforcing by default in a general purpose distro, but...). But my selinux complaints asside, the above sounds like sed (and other stuff) is being used by rpm post install scripts, but not properly installed prior to being used. I first guessed from your output that the info package's postinstall script was using sed, but failing to require it in the rpm metadata. So I checked my f9 version, and didn't see a sed invocation in the post install script for 'info'. Then I saw you were building an f10/rawhide, at which point, I think all bets are off. Try building an f9 livecd on f9, and use that as a basis for trying to get trickier stuff to work. I see your comment about using f8 instead of f9. In that case, I'd try building an f8 target. That's not to say that what you are trying shouldn't work, just that you'll be less likely to encounter bugs (which matters more when you are first getting started) (from my f9 livecd-tools, not 100% sure it's there on f8) /usr/share/livecd-tools/livecd-fedora-8-desktop.ks -dmc/jdog From jdogalt at yahoo.com Sun May 25 19:50:52 2008 From: jdogalt at yahoo.com (Jane Dogalt) Date: Sun, 25 May 2008 12:50:52 -0700 (PDT) Subject: [Fedora-livecd-list] failing at my first attempt at liveCD creation In-Reply-To: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> Message-ID: <340096.33702.qm@web56908.mail.re3.yahoo.com> --- Fulko Hew wrote: > I'm failing at my first attempt at creating (or recreating) a live CD > > - I'm using Fedora 8 (because I don't find KDE in F9 usable yet) > - I have SELinux disabled. > > Following the process described in the LiveCDHowTo, well, actually > the step: > > livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks > > resulted in a complaint about SELinux not being enabled on the host > system... > Right, so I edited the '.ks' file and set selinux=--disabled Also, the syntax is "selinux --disabled" (no '=') I think, though I don't know if that was your issue. From kanarip at kanarip.com Mon May 26 10:08:02 2008 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Mon, 26 May 2008 12:08:02 +0200 Subject: [Fedora-livecd-list] Brazilian Portuguese localized spin for Fedora 9 In-Reply-To: <1211673496.3068.2.camel@AMD5600> References: <1211673496.3068.2.camel@AMD5600> Message-ID: <483A8C02.9060804@kanarip.com> Igor Pires Soares wrote: > The .ks files are available at Fedora People if anybody wants to take a > look: > http://igor.fedorapeople.org/spin-pt_BR/F9/ > > I am thinking about hosting them in our infrastructure at > http://www.projetofedora.org/ and make a torrent with the ISO in the > future, if nobody opposes to that. > Hi Igor, I'd love to have them in the spin-kickstarts repository at http://git.fedorahosted.org/git/?p=spin-kickstarts.git If you look at the tree there and http://fedoraproject.org/wiki/SIGs/Spins/KickstartPool for a description of the kickstart pool, would you be able to follow the same model and create a kickstart for pt_BR that includes fedora-livecd-desktop.ks ? There's also some examples (all nl_NL kickstarts). Kind regards, Jeroen van Meeuwen From pedrofsilva at netcabo.pt Mon May 26 18:23:20 2008 From: pedrofsilva at netcabo.pt (Pedro Silva) Date: Mon, 26 May 2008 19:23:20 +0100 Subject: [Fedora-livecd-list] Custom kickstart/spins initial help Message-ID: <1211826200.3098.19.camel@localhost.localdomain> Hi all! I've been playing with livecd tools since f8 and I'm really enjoying all the stuff that it allows me to do. I use it mostly to build custom live cds, dvds and usb sticks. I just pick a stock kickstart file that comes with fedora, add some repos, change locale/keyboard/timezone and increase the list of packages. Works great! Great way to test rawhide too. Recently, I built a kickstart file that creates a livecd that allows me to use livecd tools. I can boot any machine with this livecd and start building more images using livecd tools. Hint: If you are trying to use network storage with livecd tools, forget smb/cifs shares, go for nfs. My livecd-creator process was crashing hard when I used smb/cifs shares for --cache and --tmpdir options in livecd-creator. When I switched to nfs, everything worked ok. I've also created a fedora account because I would like to contribute to the livecd/dvd project. I've also uploaded the necessary ssh/pgp keys. I never used git before, although I know what it is. I joined this mailing list yesterday and I already saw something I would like to do. Regarding the email about a Brazilian localized spin of Fedora, I would like to do the same but for a Portuguese spin. Can anyone give some initial tips to help me contribute? Regards, -- Pedro Silva -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: Esta ? uma parte de mensagem assinada digitalmente URL: From igorsoares at gmail.com Mon May 26 18:34:58 2008 From: igorsoares at gmail.com (Igor Pires Soares) Date: Mon, 26 May 2008 15:34:58 -0300 Subject: [Fedora-livecd-list] Brazilian Portuguese localized spin for Fedora 9 In-Reply-To: <483A8C02.9060804@kanarip.com> References: <1211673496.3068.2.camel@AMD5600> <483A8C02.9060804@kanarip.com> Message-ID: <1211826898.7072.7.camel@AMD5600> Em Seg, 2008-05-26 ?s 12:08 +0200, Jeroen van Meeuwen escreveu: > I'd love to have them in the spin-kickstarts repository at > http://git.fedorahosted.org/git/?p=spin-kickstarts.git > > If you look at the tree there and > http://fedoraproject.org/wiki/SIGs/Spins/KickstartPool for a description > of the kickstart pool, would you be able to follow the same model and > create a kickstart for pt_BR that includes fedora-livecd-desktop.ks ? Sure! I will edit the .ks files to follow the model, do some testing, and then I will send them to you. Thanks, Igor Pires Soares From msairam at intoto.com Tue May 27 07:21:14 2008 From: msairam at intoto.com (M P Sairam) Date: Tue, 27 May 2008 12:51:14 +0530 Subject: [Fedora-livecd-list] Live CD process Synchronization help Message-ID: <483BB66A.6060203@intoto.com> Hi, I need some help regarding process synchronization. I'm having problem when using multiple threads in the Live CD Image. Does it require any packages which i may missed to install? Please give me some suggestions on what could be the issue. thanks in advance, sairam ******************************************************************************** This email message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential, proprietary and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately notify the sender by reply email and destroy all copies of the original message. Thank you. Intoto Inc. From kanarip at kanarip.com Tue May 27 07:25:20 2008 From: kanarip at kanarip.com (Jeroen van Meeuwen) Date: Tue, 27 May 2008 09:25:20 +0200 Subject: [Fedora-livecd-list] Custom kickstart/spins initial help In-Reply-To: <1211826200.3098.19.camel@localhost.localdomain> References: <1211826200.3098.19.camel@localhost.localdomain> Message-ID: <483BB760.7030104@kanarip.com> Pedro Silva wrote: > Hi all! > > I've been playing with livecd tools since f8 and I'm really enjoying all > the stuff that it allows me to do. I use it mostly to build custom live > cds, dvds and usb sticks. I just pick a stock kickstart file that comes > with fedora, add some repos, change locale/keyboard/timezone and > increase the list of packages. Works great! Great way to test rawhide > too. > > Recently, I built a kickstart file that creates a livecd that allows me > to use livecd tools. I can boot any machine with this livecd and start > building more images using livecd tools. Hint: If you are trying to use > network storage with livecd tools, forget smb/cifs shares, go for nfs. > My livecd-creator process was crashing hard when I used smb/cifs shares > for --cache and --tmpdir options in livecd-creator. When I switched to > nfs, everything worked ok. > > I've also created a fedora account because I would like to contribute to > the livecd/dvd project. I've also uploaded the necessary ssh/pgp keys. > I never used git before, although I know what it is. > > I joined this mailing list yesterday and I already saw something I would > like to do. Regarding the email about a Brazilian localized spin of > Fedora, I would like to do the same but for a Portuguese spin. > > Can anyone give some initial tips to help me contribute? > Hi Pedro, Welcome to the club ;-) I'd love to see another localized spin as I'm still missing a few hundred different languages ;-) If you read the article http://fedoraproject.org/wiki/SIGs/Spins/KickstartPool about what it is we're trying to do, and how we try to make it as easy as possible to make spins localized, maybe getting a Portuguese Spin of your liking only takes a couple of minutes ;-) You can submit the result to me for a little check-up and then I can submit it to the kickstart pool. Let me know what you think and whether you need any help. Have fun! Kind regards, Jeroen van Meeuwen -kanarip From opensource at till.name Tue May 27 14:38:08 2008 From: opensource at till.name (Till Maas) Date: Tue, 27 May 2008 16:38:08 +0200 Subject: [Fedora-livecd-list] how is initrd0.img created? Message-ID: <200805271638.12633.opensource@till.name> Hiyas, I want to write a patch to support the selection of the keyboard at the kernel commandline, but I cannot see where the initrd0.img file is created, i.e. which file do I have to patch? Regards, Till -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. URL: From katzj at redhat.com Tue May 27 15:41:12 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 May 2008 11:41:12 -0400 Subject: [Fedora-livecd-list] how is initrd0.img created? In-Reply-To: <200805271638.12633.opensource@till.name> References: <200805271638.12633.opensource@till.name> Message-ID: <483C2B98.5030302@redhat.com> Till Maas wrote: > I want to write a patch to support the selection of the keyboard at the kernel > commandline, but I cannot see where the initrd0.img file is created, i.e. > which file do I have to patch? The initrd is created when mkinitrd[1] is run as a part of the kernel's %post. Then, the file is moved from /boot by livecd-creator after all the packages have been installed Jeremy [1] Which then ends up invoking /usr/libexec/mkliveinitrd as a bit of an implementation detail, but hopefully we'll be cleaning that up so that the initrd infrastructure is a bit better and requires less duplication over the next release cycle or so From katzj at redhat.com Tue May 27 16:57:02 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 May 2008 12:57:02 -0400 Subject: [Fedora-livecd-list] [PATCH] -Refactor-disk-mount-classes-to-allow-multi-partitions In-Reply-To: <1211380848-13140-2-git-send-email-dhuff@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> Message-ID: <483C3D5E.5050901@redhat.com> So this patch ends up changing the API of imgcreate which then has the possibility of breaking any other callers. While that would have been okay had the patch been finalized when it was first sent, we now can't do that. Instead, there at least needs to be a compatibility layer for the old API to continue working. This should be pretty trivial to wrap, though, so that both ways work. And then it would make sense to have this patch split up a bit so that it's a series which is 1) Add new classes 2) Compat shims switching over the old class types to sit on top of the new classes 3) Switch internal code users to use the new classes Jeremy From katzj at redhat.com Tue May 27 16:59:44 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 May 2008 12:59:44 -0400 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <1211380848-13140-3-git-send-email-dhuff@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> Message-ID: <483C3E00.8040108@redhat.com> This I'm still not sure that I really want to be carrying in imgcreate. There's already a lot of overlap functionality-wise with anaconda and I know that as soon as we start down this path, we'll end up having to add all the other crud for various more "advanced" partitioning things (especially LVM and dm-crypt). Maintaining one copy of that kind of code is enough for me ;-) I'd be okay with adding the kickstart hunk, though. And then there's really not any big reason that I can see why you couldn't just have the PartitionedDisk bits just in your caller rather than having them a part of the main imgcreate API Jeremy From katzj at redhat.com Tue May 27 17:01:43 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 May 2008 13:01:43 -0400 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <483C3E00.8040108@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> <483C3E00.8040108@redhat.com> Message-ID: <483C3E77.4090702@redhat.com> Jeremy Katz wrote: > This I'm still not sure that I really want to be carrying in imgcreate. > There's already a lot of overlap functionality-wise with anaconda and > I know that as soon as we start down this path, we'll end up having to > add all the other crud for various more "advanced" partitioning things > (especially LVM and dm-crypt). Maintaining one copy of that kind of > code is enough for me ;-) > > I'd be okay with adding the kickstart hunk, though. And then there's > really not any big reason that I can see why you couldn't just have the > PartitionedDisk bits just in your caller rather than having them a part > of the main imgcreate API ... although I would still strongly ask the question of looking at what you're doing and seeing if it makes sense to build your images by actually going through an install (in a VM of some sort) rather than using imgcreate once you get to the point of needing partitions, etc Jeremy From katzj at fedoraproject.org Tue May 27 20:04:59 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Tue, 27 May 2008 20:04:59 +0000 (UTC) Subject: [Fedora-livecd-list] config/livecd-fedora-base-desktop.ks Message-ID: <20080527200459.CFF2DA8172@lists.fedorahosted.org> config/livecd-fedora-base-desktop.ks | 8 ++++++++ 1 file changed, 8 insertions(+) New commits: commit c0f49393a954084e7a3bb9a6564096054aa6e49d Author: Jeremy Katz Date: Mon May 19 15:53:43 2008 -0400 Mount a tmpfs on /tmp, /var/tmp and /var/cache (#447127) dm-snapshot is pretty high-overhead for directories like /tmp, /var/tmp and /var/cache which are expected to have high turn-over. Let's make them tmpfs instead diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks index ad5ec32..dc6bed7 100644 --- a/config/livecd-fedora-base-desktop.ks +++ b/config/livecd-fedora-base-desktop.ks @@ -130,6 +130,14 @@ chkconfig --level 345 anacron off 2>/dev/null chkconfig --level 345 readahead_early off 2>/dev/null chkconfig --level 345 readahead_later off 2>/dev/null +# make it so that we don't do writing to the overlay for things which +# are just tmpdirs/caches +mount -t tmpfs varcache /tmp +(cd /var/cache ; find .) | (cd /tmp ; cpio --quiet -pmdu) +mount --move /tmp /var/cache +mount -t tmpfs tmp /tmp +mount -t tmpfs vartmp /var/tmp + # Stopgap fix for RH #217966; should be fixed in HAL instead touch /media/.hal-mtab From notting at redhat.com Tue May 27 19:51:04 2008 From: notting at redhat.com (Bill Nottingham) Date: Tue, 27 May 2008 15:51:04 -0400 Subject: [Fedora-livecd-list] config/livecd-fedora-base-desktop.ks In-Reply-To: <20080527200459.CFF2DA8172@lists.fedorahosted.org> References: <20080527200459.CFF2DA8172@lists.fedorahosted.org> Message-ID: <20080527195104.GA10345@nostromo.devel.redhat.com> > New commits: > commit c0f49393a954084e7a3bb9a6564096054aa6e49d > Author: Jeremy Katz > Date: Mon May 19 15:53:43 2008 -0400 > > Mount a tmpfs on /tmp, /var/tmp and /var/cache (#447127) > > dm-snapshot is pretty high-overhead for directories like /tmp, /var/tmp and > /var/cache which are expected to have high turn-over. Let's make them > tmpfs instead How does that work with yum upgrade on persistent images? Bill From katzj at fedoraproject.org Tue May 27 20:25:16 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Tue, 27 May 2008 20:25:16 +0000 (UTC) Subject: [Fedora-livecd-list] config/livecd-fedora-base-desktop.ks Message-ID: <20080527202516.733E7A8172@lists.fedorahosted.org> config/livecd-fedora-base-desktop.ks | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit bdd9dcd487a889793a8ded4dd45382b4ce49b4d4 Author: Jeremy Katz Date: Tue May 27 16:05:54 2008 -0400 Only mount over /var/cache/yum and not all of /var/cache diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks index dc6bed7..5da37aa 100644 --- a/config/livecd-fedora-base-desktop.ks +++ b/config/livecd-fedora-base-desktop.ks @@ -132,9 +132,7 @@ chkconfig --level 345 readahead_later off 2>/dev/null # make it so that we don't do writing to the overlay for things which # are just tmpdirs/caches -mount -t tmpfs varcache /tmp -(cd /var/cache ; find .) | (cd /tmp ; cpio --quiet -pmdu) -mount --move /tmp /var/cache +mount -t tmpfs varcacheyum /var/cache/yum mount -t tmpfs tmp /tmp mount -t tmpfs vartmp /var/tmp From katzj at redhat.com Tue May 27 20:06:00 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 May 2008 16:06:00 -0400 Subject: [Fedora-livecd-list] config/livecd-fedora-base-desktop.ks In-Reply-To: <20080527195104.GA10345@nostromo.devel.redhat.com> References: <20080527200459.CFF2DA8172@lists.fedorahosted.org> <20080527195104.GA10345@nostromo.devel.redhat.com> Message-ID: <483C69A8.9040203@redhat.com> Bill Nottingham wrote: >> New commits: >> commit c0f49393a954084e7a3bb9a6564096054aa6e49d >> Author: Jeremy Katz >> Date: Mon May 19 15:53:43 2008 -0400 >> >> Mount a tmpfs on /tmp, /var/tmp and /var/cache (#447127) >> >> dm-snapshot is pretty high-overhead for directories like /tmp, /var/tmp and >> /var/cache which are expected to have high turn-over. Let's make them >> tmpfs instead > > How does that work with yum upgrade on persistent images? It was actually to help that case (turnover with packages in /var/cache/yum eats up blocks fast). But yeah, other bits of /var/cache could matter and come from a package I guess. Will switch it to just overmount /var/cache/yum Jeremy From notting at redhat.com Tue May 27 20:13:49 2008 From: notting at redhat.com (Bill Nottingham) Date: Tue, 27 May 2008 16:13:49 -0400 Subject: [Fedora-livecd-list] config/livecd-fedora-base-desktop.ks In-Reply-To: <483C69A8.9040203@redhat.com> References: <20080527200459.CFF2DA8172@lists.fedorahosted.org> <20080527195104.GA10345@nostromo.devel.redhat.com> <483C69A8.9040203@redhat.com> Message-ID: <20080527201349.GA13176@nostromo.devel.redhat.com> Jeremy Katz (katzj at redhat.com) said: >>> /var/cache which are expected to have high turn-over. Let's make them >>> tmpfs instead >> >> How does that work with yum upgrade on persistent images? > > It was actually to help that case (turnover with packages in /var/cache/yum > eats up blocks fast). But yeah, other bits of /var/cache could matter and > come from a package I guess. Will switch it to just overmount > /var/cache/yum Right, but if that's a new openoffice package.... you may run tight on RAM pretty quickly. Bill From katzj at redhat.com Tue May 27 20:21:06 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 May 2008 16:21:06 -0400 Subject: [Fedora-livecd-list] config/livecd-fedora-base-desktop.ks In-Reply-To: <20080527201349.GA13176@nostromo.devel.redhat.com> References: <20080527200459.CFF2DA8172@lists.fedorahosted.org> <20080527195104.GA10345@nostromo.devel.redhat.com> <483C69A8.9040203@redhat.com> <20080527201349.GA13176@nostromo.devel.redhat.com> Message-ID: <483C6D32.5020904@redhat.com> Bill Nottingham wrote: > Jeremy Katz (katzj at redhat.com) said: >>>> /var/cache which are expected to have high turn-over. Let's make them >>>> tmpfs instead >>> How does that work with yum upgrade on persistent images? >> It was actually to help that case (turnover with packages in /var/cache/yum >> eats up blocks fast). But yeah, other bits of /var/cache could matter and >> come from a package I guess. Will switch it to just overmount >> /var/cache/yum > > Right, but if that's a new openoffice package.... you may run tight on RAM > pretty quickly. And if you instead are using an overlay that's one gig, that openoffice update has made the overlay half full. With no chance of reclaiming the space that was just for the downloaded bits from the rpm. Yeah, all answers kind of suck. Maybe unionfs will save us eventually. Jeremy From katzj at fedoraproject.org Tue May 27 20:32:22 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Tue, 27 May 2008 20:32:22 +0000 (UTC) Subject: [Fedora-livecd-list] 7 commits - imgcreate/creator.py imgcreate/kickstart.py imgcreate/live.py tools/livecd-iso-to-disk.sh Message-ID: <20080527203222.571A6A8172@lists.fedorahosted.org> imgcreate/creator.py | 4 ++++ imgcreate/kickstart.py | 15 ++++++++++++++- imgcreate/live.py | 4 +--- tools/livecd-iso-to-disk.sh | 22 ++++++++++++++++++++-- 4 files changed, 39 insertions(+), 6 deletions(-) New commits: commit 35f007112280dfa451ff7b51b65f917b4cad3715 Author: Jeremy Katz Date: Tue May 27 15:56:05 2008 -0400 Fix basing on a previous live image (#437906) diff --git a/imgcreate/creator.py b/imgcreate/creator.py index 40ce1ef..fc4298b 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -830,6 +830,9 @@ class LoopImageCreator(ImageCreator): """ return self.__instloop.resparse(size) + + def __base_on(self, base_on): + shutil.copyfile(base_on, self._image) # # Actual implementation @@ -838,6 +841,7 @@ class LoopImageCreator(ImageCreator): self.__imgdir = self._mkdtemp() if not base_on is None: + self.__base_on(base_on) shutil.copyfile(base_on, self._image) self.__instloop = SparseExtLoopbackMount(self._image, diff --git a/imgcreate/live.py b/imgcreate/live.py index 130f7fa..ef07d19 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -127,7 +127,7 @@ class LiveImageCreatorBase(LoopImageCreator): # # Actual implementation # - def __base_on_iso(self, base_on): + def __base_on(self, base_on): """helper function to extract ext3 file system from a live CD ISO""" isoloop = LoopbackMount(base_on, self._mkdtemp()) @@ -173,8 +173,6 @@ class LiveImageCreatorBase(LoopImageCreator): isoloop.cleanup() def _mount_instroot(self, base_on = None): - if not base_on is None: - self.__base_on_iso(base_on) LoopImageCreator._mount_instroot(self) self.__write_initrd_conf(self._instroot + "/etc/sysconfig/mkinitrd") commit 9fa8210e2db91e1c2d0493aed785d626ac7d176e Author: Jeremy Katz Date: Tue May 27 15:49:23 2008 -0400 Fix up tab/space inconsistency diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py index 7cc27ac..8f43f7c 100644 --- a/imgcreate/kickstart.py +++ b/imgcreate/kickstart.py @@ -151,7 +151,7 @@ class TimezoneConfig(KickstartConfig): try: shutil.copyfile(self.path("/usr/share/zoneinfo/%s" %(tz,)), self.path("/etc/localtime")) - except OSError, (errno, msg): + except OSError, (errno, msg): log.error("Error copying timezone: %s" %(msg,)) commit df086a2102b3c8f0103c5905d7b776e07b69cfbc Author: Jeremy Katz Date: Tue May 27 15:42:23 2008 -0400 Handle using a loop device as the device to use for the target (#447345) diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh index 5250a20..e4acf85 100644 --- a/tools/livecd-iso-to-disk.sh +++ b/tools/livecd-iso-to-disk.sh @@ -40,6 +40,11 @@ exitclean() { getdisk() { DEV=$1 + if [[ "$DEV" =~ "/dev/loop*" ]; then + device="/dev/$device" + return + fi + p=$(udevinfo -q path -n $DEV) if [ -e /sys/$p/device ]; then device=$(basename /sys/$p) commit 898e853e789314e343e8531fb25c03dc41ff4f0c Author: Jeremy Katz Date: Tue May 27 15:35:41 2008 -0400 Quote iso path (#446472) diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh index fb9d6e4..5250a20 100644 --- a/tools/livecd-iso-to-disk.sh +++ b/tools/livecd-iso-to-disk.sh @@ -194,7 +194,7 @@ fi if [ -z "$noverify" ]; then # verify the image echo "Verifying image..." - checkisomd5 --verbose $ISO + checkisomd5 --verbose "$ISO" if [ $? -ne 0 ]; then echo "Are you SURE you want to continue?" echo "Press Enter to continue or ctrl-c to abort" @@ -219,7 +219,7 @@ fi # FIXME: would be better if we had better mountpoints CDMNT=$(mktemp -d /media/cdtmp.XXXXXX) -mount -o loop,ro $ISO $CDMNT || exitclean +mount -o loop,ro "$ISO" $CDMNT || exitclean USBMNT=$(mktemp -d /media/usbdev.XXXXXX) mount $USBDEV $USBMNT || exitclean commit 77e575d26bf742c762023dbb28bc8116e917218b Author: Jeremy Katz Date: Tue May 27 15:29:35 2008 -0400 Make sure that the disk isn't mounted before writing to it (#446472) diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh index 4ec7f06..fb9d6e4 100644 --- a/tools/livecd-iso-to-disk.sh +++ b/tools/livecd-iso-to-disk.sh @@ -144,6 +144,18 @@ checkSyslinuxVersion() { fi } +checkMounted() { + dev=$1 + if grep -q "^$dev " /proc/mounts ; then + echo "$dev is mounted, please unmount for safety" + exitclean + fi + if grep -q "^$dev " /proc/swaps; then + echo "$dev is in use as a swap device, please disable swap" + exitclean + fi +} + if [ $(id -u) != 0 ]; then echo "You need to be root to run this script" exit 1 @@ -195,6 +207,7 @@ checkSyslinuxVersion checkFilesystem $USBDEV checkPartActive $USBDEV checkMBR $USBDEV +checkMounted $USBDEV [ -n $resetmbr ] && resetMBR $USBDEV if [ -n "$overlaysizemb" -a "$USBFS" = "vfat" ]; then commit d2de6738087c91ebf6eb570088d7b2d0296723c8 Author: Jeremy Katz Date: Tue May 27 15:24:36 2008 -0400 Handle copying timezone to /etc/localtime (#445624) diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py index efa1ef7..7cc27ac 100644 --- a/imgcreate/kickstart.py +++ b/imgcreate/kickstart.py @@ -18,6 +18,7 @@ import os import os.path +import shutil import subprocess import time @@ -147,6 +148,12 @@ class TimezoneConfig(KickstartConfig): f.write("ZONE=\"" + tz + "\"\n") f.write("UTC=" + utc + "\n") f.close() + try: + shutil.copyfile(self.path("/usr/share/zoneinfo/%s" %(tz,)), + self.path("/etc/localtime")) + except OSError, (errno, msg): + log.error("Error copying timezone: %s" %(msg,)) + class AuthConfig(KickstartConfig): """A class to apply a kickstart authconfig configuration to a system.""" commit 4793d9e38d18eeeb3a0464e331af23e573149fe2 Author: Jeremy Katz Date: Tue May 27 15:15:18 2008 -0400 Make sure that commands exist and give a suitable error message diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py index ef7b9e4..efa1ef7 100644 --- a/imgcreate/kickstart.py +++ b/imgcreate/kickstart.py @@ -107,6 +107,8 @@ class KickstartConfig(object): os.chdir("/") def call(self, args): + if not os.path.exists("%s/%s" %(self.chroot, args[0])): + raise errors.KickstartError("Unable to run %s!" %(args)) subprocess.call(args, preexec_fn = self.chroot) def apply(self): @@ -178,6 +180,10 @@ class RootPasswordConfig(KickstartConfig): self.call(["/usr/sbin/usermod", "-p", password, "root"]) def set_unencrypted(self, password): + for p in ("/bin/echo", "/usr/bin/passwd"): + if not os.path.exists("%s/%s" %(self.chroot, p)): + raise errors.KickstartError("Unable to set unencrypted password due to lack of %s" % p) + p1 = subprocess.Popen(["/bin/echo", password], stdout = subprocess.PIPE, preexec_fn = self.chroot) @@ -331,7 +337,7 @@ class NetworkConfig(KickstartConfig): for network in ksnet.network: if not network.device: - raise errros.KickstartError("No --device specified with " + raise errors.KickstartError("No --device specified with " "network kickstart command") if (network.onboot and network.bootProto.lower() != "dhcp" and From dex.mbox at googlemail.com Wed May 28 01:46:37 2008 From: dex.mbox at googlemail.com (dexter) Date: Wed, 28 May 2008 02:46:37 +0100 Subject: [Fedora-livecd-list] 7 commits - imgcreate/creator.py imgcreate/kickstart.py imgcreate/live.py tools/livecd-iso-to-disk.sh In-Reply-To: <20080527203222.571A6A8172@lists.fedorahosted.org> References: <20080527203222.571A6A8172@lists.fedorahosted.org> Message-ID: <200805280246.37712.dex.mbox@gmail.com> On Tue May 27 2008 21:32:22 Jeremy Katz wrote: > diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh > index 5250a20..e4acf85 100644 > --- a/tools/livecd-iso-to-disk.sh > +++ b/tools/livecd-iso-to-disk.sh > @@ -40,6 +40,11 @@ exitclean() { > ?getdisk() { > ? ? ?DEV=$1 > ? > + ? ?if [[ "$DEV" =~ "/dev/loop*" ]; then My eyes can't parse this construct [[ ] is it legal? /me reaches for my bash books. ...dex From katzj at fedoraproject.org Wed May 28 01:58:12 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Wed, 28 May 2008 01:58:12 +0000 (UTC) Subject: [Fedora-livecd-list] tools/livecd-iso-to-disk.sh Message-ID: <20080528015812.569CF12000A@lists.fedorahosted.org> tools/livecd-iso-to-disk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fa20e548176b2f82a59dde1ecd77c2c18f80cc8d Author: Jeremy Katz Date: Tue May 27 21:58:07 2008 -0400 Typo, part two. diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh index e4acf85..9676633 100644 --- a/tools/livecd-iso-to-disk.sh +++ b/tools/livecd-iso-to-disk.sh @@ -40,7 +40,7 @@ exitclean() { getdisk() { DEV=$1 - if [[ "$DEV" =~ "/dev/loop*" ]; then + if [[ "$DEV" =~ "/dev/loop*" ]]; then device="/dev/$device" return fi From katzj at redhat.com Wed May 28 01:59:10 2008 From: katzj at redhat.com (Jeremy Katz) Date: Tue, 27 May 2008 21:59:10 -0400 Subject: [Fedora-livecd-list] 7 commits - imgcreate/creator.py imgcreate/kickstart.py imgcreate/live.py tools/livecd-iso-to-disk.sh In-Reply-To: <200805280246.37712.dex.mbox@gmail.com> References: <20080527203222.571A6A8172@lists.fedorahosted.org> <200805280246.37712.dex.mbox@gmail.com> Message-ID: <483CBC6E.5080505@redhat.com> dexter wrote: > On Tue May 27 2008 21:32:22 Jeremy Katz wrote: >> diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh >> index 5250a20..e4acf85 100644 >> --- a/tools/livecd-iso-to-disk.sh >> +++ b/tools/livecd-iso-to-disk.sh >> @@ -40,6 +40,11 @@ exitclean() { >> getdisk() { >> DEV=$1 >> >> + if [[ "$DEV" =~ "/dev/loop*" ]; then > > My eyes can't parse this construct [[ ] is it legal? /me reaches for my bash > books. Good catch -- should have been [[ ]] but apparently I did an undo or somehow managed to flub it before committing. But fixed, thanks Jeremy From opensource at till.name Wed May 28 16:39:29 2008 From: opensource at till.name (Till Maas) Date: Wed, 28 May 2008 18:39:29 +0200 Subject: [Fedora-livecd-list] config/livecd-fedora-base-desktop.ks In-Reply-To: <20080527201349.GA13176@nostromo.devel.redhat.com> References: <20080527200459.CFF2DA8172@lists.fedorahosted.org> <483C69A8.9040203@redhat.com> <20080527201349.GA13176@nostromo.devel.redhat.com> Message-ID: <200805281839.34476.opensource@till.name> On Tue May 27 2008, Bill Nottingham wrote: > Right, but if that's a new openoffice package.... you may run tight on RAM > pretty quickly. tmpfs will also use swap space when it is needed and the livecd mounts it when available. Regards, Till -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. URL: From pedrofsilva at netcabo.pt Wed May 28 17:06:12 2008 From: pedrofsilva at netcabo.pt (Pedro Silva) Date: Wed, 28 May 2008 18:06:12 +0100 Subject: [Fedora-livecd-list] Custom kickstart/spins initial help In-Reply-To: <483BB760.7030104@kanarip.com> References: <1211826200.3098.19.camel@localhost.localdomain> <483BB760.7030104@kanarip.com> Message-ID: <1211994372.8329.4.camel@localhost.localdomain> Ter, 2008-05-27 ?s 09:25 +0200, Jeroen van Meeuwen escreveu: > Pedro Silva wrote: > > Hi all! > > > > I've been playing with livecd tools since f8 and I'm really enjoying all > > the stuff that it allows me to do. I use it mostly to build custom live > > cds, dvds and usb sticks. I just pick a stock kickstart file that comes > > with fedora, add some repos, change locale/keyboard/timezone and > > increase the list of packages. Works great! Great way to test rawhide > > too. > > > > Recently, I built a kickstart file that creates a livecd that allows me > > to use livecd tools. I can boot any machine with this livecd and start > > building more images using livecd tools. Hint: If you are trying to use > > network storage with livecd tools, forget smb/cifs shares, go for nfs. > > My livecd-creator process was crashing hard when I used smb/cifs shares > > for --cache and --tmpdir options in livecd-creator. When I switched to > > nfs, everything worked ok. > > > > I've also created a fedora account because I would like to contribute to > > the livecd/dvd project. I've also uploaded the necessary ssh/pgp keys. > > I never used git before, although I know what it is. > > > > I joined this mailing list yesterday and I already saw something I would > > like to do. Regarding the email about a Brazilian localized spin of > > Fedora, I would like to do the same but for a Portuguese spin. > > > > Can anyone give some initial tips to help me contribute? > > > > Hi Pedro, > > Welcome to the club ;-) I'd love to see another localized spin as I'm > still missing a few hundred different languages ;-) > > If you read the article > http://fedoraproject.org/wiki/SIGs/Spins/KickstartPool about what it is > we're trying to do, and how we try to make it as easy as possible to > make spins localized, maybe getting a Portuguese Spin of your liking > only takes a couple of minutes ;-) You can submit the result to me for a > little check-up and then I can submit it to the kickstart pool. > > Let me know what you think and whether you need any help. Have fun! > > Kind regards, > > Jeroen van Meeuwen > -kanarip > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list Thanks for the reply! I've just downloaded the latest .tar.gz from http://git.fedorahosted.org/git/?p=spin-kickstarts.git and made a .ks for pt_PT. I used the nl_NL has an example and changed the settings accordingly. I haven't tested it yet but since there were few changes, unless there is a typo, it should work. Tell me if it needs more changes. I don't use "includes" in my .ks files but I can see the advantages. Thanks -- Pedro Silva -------------- next part -------------- # fedora-livecd-desktop-pt_PT.ks # # Maintainer(s): # - Pedro Silva %include fedora-livecd-desktop.ks lang pt_PT.UTF-8 keyboard pt-latin1 timezone Europe/Lisbon %packages @portuguese-support %end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: Esta ? uma parte de mensagem assinada digitalmente URL: From dhuff at redhat.com Wed May 28 17:34:58 2008 From: dhuff at redhat.com (David Huff) Date: Wed, 28 May 2008 13:34:58 -0400 Subject: [Fedora-livecd-list] [PATCH] -Refactor-disk-mount-classes-to-allow-multi-partitions In-Reply-To: <483C3D5E.5050901@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <483C3D5E.5050901@redhat.com> Message-ID: <483D97C2.7070903@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jeremy Katz wrote: | So this patch ends up changing the API of imgcreate which then has the | possibility of breaking any other callers. While that would have been | okay had the patch been finalized when it was first sent, we now can't | do that. Why is this, just out of curiosity? Instead, there at least needs to be a compatibility layer for | the old API to continue working. This should be pretty trivial to wrap, | though, so that both ways work. And then it would make sense to have | this patch split up a bit so that it's a series which is | 1) Add new classes | 2) Compat shims switching over the old class types to sit on top of the | new classes | 3) Switch internal code users to use the new classes I will work on moving this over to this type of compatibility architecture. Do you know of any examples I can look at. | | Jeremy | | -- | Fedora-livecd-list mailing list | Fedora-livecd-list at redhat.com | https://www.redhat.com/mailman/listinfo/fedora-livecd-list - -- David Huff Red Hat, Raleigh, NC Mobile: 919-796-3553 Office: 919-754-4129 GPG Key ID: 6A20BBF7 GPG Fingerprint: FE13 8AF6 0E58 D92E A4E1 2D0A 71C1 CADF 6A20 BBF7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFIPZfBccHK32ogu/cRAubPAJ9c6imBocwAi0MrqRvsCebzwG1i+QCfbzGc 6JYgXEdgSZiFy27k5FjKzPs= =l38L -----END PGP SIGNATURE----- From dhuff at redhat.com Wed May 28 17:35:32 2008 From: dhuff at redhat.com (David Huff) Date: Wed, 28 May 2008 13:35:32 -0400 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <483C3E77.4090702@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> <483C3E00.8040108@redhat.com> <483C3E77.4090702@redhat.com> Message-ID: <483D97E4.3090702@redhat.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jeremy Katz wrote: | Jeremy Katz wrote: |> This I'm still not sure that I really want to be carrying in |> imgcreate. There's already a lot of overlap functionality-wise with |> anaconda and I know that as soon as we start down this path, we'll end |> up having to add all the other crud for various more "advanced" |> partitioning things (especially LVM and dm-crypt). Maintaining one |> copy of that kind of code is enough for me ;-) |> |> I'd be okay with adding the kickstart hunk, though. And then there's |> really not any big reason that I can see why you couldn't just have |> the PartitionedDisk bits just in your caller rather than having them a |> part of the main imgcreate API | | ... although I would still strongly ask the question of looking at what | you're doing and seeing if it makes sense to build your images by | actually going through an install (in a VM of some sort) rather than | using imgcreate once you get to the point of needing partitions, etc Partitions are needed for mainly two reasons. The most important reason is that it allows the use of grub. This makes any image created with this tool bootable and it looks and feels like any bare metal system. It also allows for the ability of creating multiple partitions so an appliance can have a septate data partition(s). This allows for flexibility in your update/data model, where if you want to, you can switch out your "appliance engine" and keep the data intact. The ability for a tool to create these partitioned disk images via the command like, livecd-creator, is very helpful in reproducing known state appliances, epically with the rising use of visualization. Going through a actual install in a vm limits you to VM container, xen, kvm, vmware and adds extra overhead of building on a machine with extra virt resources. We have also noticed that an image that was installed via anaconda is larger that an image created with the appliance creator tools. | | Jeremy | | -- | Fedora-livecd-list mailing list | Fedora-livecd-list at redhat.com | https://www.redhat.com/mailman/listinfo/fedora-livecd-list - -- David Huff Red Hat, Raleigh, NC Mobile: 919-796-3553 Office: 919-754-4129 GPG Key ID: 6A20BBF7 GPG Fingerprint: FE13 8AF6 0E58 D92E A4E1 2D0A 71C1 CADF 6A20 BBF7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFIPZfkccHK32ogu/cRAmclAKCI1upqzhaJWSGikyxlJ7LZMDfe4ACgj+F9 JJAE6je2msv+vFjc7zO2/Bk= =QtyL -----END PGP SIGNATURE----- From katzj at redhat.com Wed May 28 18:15:39 2008 From: katzj at redhat.com (Jeremy Katz) Date: Wed, 28 May 2008 14:15:39 -0400 Subject: [Fedora-livecd-list] [PATCH] -Refactor-disk-mount-classes-to-allow-multi-partitions In-Reply-To: <483D97C2.7070903@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <483C3D5E.5050901@redhat.com> <483D97C2.7070903@redhat.com> Message-ID: <483DA14B.2010707@redhat.com> David Huff wrote: > Jeremy Katz wrote: > | So this patch ends up changing the API of imgcreate which then has the > | possibility of breaking any other callers. While that would have been > | okay had the patch been finalized when it was first sent, we now can't > | do that. > > Why is this, just out of curiosity? When the patch was originally posted, we hadn't had a release of livecd-tools with the API. Now that the API is out there, we can't just change it out from under people. > Instead, there at least needs to be a compatibility layer for > | the old API to continue working. This should be pretty trivial to wrap, > | though, so that both ways work. And then it would make sense to have > | this patch split up a bit so that it's a series which is > | 1) Add new classes > | 2) Compat shims switching over the old class types to sit on top of the > | new classes > | 3) Switch internal code users to use the new classes > > I will work on moving this over to this type of compatibility > architecture. Do you know of any examples I can look at. Nothing off-hand. But it should be pretty straight-forward. You'll just want to create a new, eg, LoopbackSpareMount class that sits on top of the new classes and internally creates the LoopbackDisk, etc objects Jeremy From katzj at redhat.com Wed May 28 18:36:50 2008 From: katzj at redhat.com (Jeremy Katz) Date: Wed, 28 May 2008 14:36:50 -0400 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <483D97E4.3090702@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> <483C3E00.8040108@redhat.com> <483C3E77.4090702@redhat.com> <483D97E4.3090702@redhat.com> Message-ID: <483DA642.4040002@redhat.com> David Huff wrote: > Jeremy Katz wrote: > | Jeremy Katz wrote: > |> This I'm still not sure that I really want to be carrying in > |> imgcreate. There's already a lot of overlap functionality-wise with > |> anaconda and I know that as soon as we start down this path, we'll end > |> up having to add all the other crud for various more "advanced" > |> partitioning things (especially LVM and dm-crypt). Maintaining one > |> copy of that kind of code is enough for me ;-) > |> > |> I'd be okay with adding the kickstart hunk, though. And then there's > |> really not any big reason that I can see why you couldn't just have > |> the PartitionedDisk bits just in your caller rather than having them a > |> part of the main imgcreate API > | > | ... although I would still strongly ask the question of looking at what > | you're doing and seeing if it makes sense to build your images by > | actually going through an install (in a VM of some sort) rather than > | using imgcreate once you get to the point of needing partitions, etc > > Partitions are needed for mainly two reasons. The most important reason > is that it allows the use of grub. This makes any image created with > this tool bootable and it looks and feels like any bare metal system. > It also allows for the ability of creating multiple partitions so an > appliance can have a septate data partition(s). This allows for > flexibility in your update/data model, where if you want to, you can > switch out your "appliance engine" and keep the data intact. Oh, I can fully see why partitions are useful for a variety of cases... > The ability for a tool to create these partitioned disk images via the > command like, livecd-creator, is very helpful in reproducing known state > appliances, epically with the rising use of visualization. Going > through a actual install in a vm limits you to VM container, xen, kvm, > vmware and adds extra overhead of building on a machine with extra virt > resources. Reproducing known state should work just as well with a kickstart config and doing an install via, eg, virt-install. Yes, it adds overhead, but there are also advantages in functionality and it also means *not* maintaining this sort of code in multiple places. And that's a pretty big win as partitioning code is not in the least bit trivial. Especially as you start trying to handle more and more of the cases. > We have also noticed that an image that was installed via > anaconda is larger that an image created with the appliance creator tools. There shouldn't be any difference to speak of here. Take a look at the package sets and see if there's anything, but I wouldn't expect this at all. And if so, it's likely more due to bugs in imgcreate than anything else Jeremy From notting at redhat.com Wed May 28 20:04:43 2008 From: notting at redhat.com (Bill Nottingham) Date: Wed, 28 May 2008 16:04:43 -0400 Subject: [Fedora-livecd-list] Re: [RFC] Livecd-creator and selinux, we can play nice In-Reply-To: <1212004261.3079.87.camel@localhost.localdomain> References: <1212004261.3079.87.camel@localhost.localdomain> Message-ID: <20080528200443.GA16939@nostromo.devel.redhat.com> Eric Paris (eparis at redhat.com) said: > So I've spent a fair bit of time the last 2 weeks trying to get > livecd-creator and an selinux enforcing machine to play nicely together. > It doesn't look like much, but from the point of view of the livecd > creator I think the following patch is all we need. Working with > rawhide as the host system I was able to build F8, F9 and rawhide > livecd's with an enforcing machine. > > I wouldn't suggest jumping into enfocing builds just yet as there are > still some policy issues I need to work out with the selinux people but > I would like comments. Basically its quite simple, if selinux is on the > host we create a fake /selinux which tells the install chroot lies. > I've had to make some changes to some selinux libraries to support all > this, but I think we are just about there. > > I'll probably backport some of the kernel changes to F9 after they are > all tested and better settled but for now I'd like input on my livecd > changes.... My concern is this is a normal occurence (needing a chroot) that you're only patching in one place. Do we code this same logic into mock? Into pungi? Into yum --installroot? Into the documentation for admins on how to set up a chroot? (Also, for general use, we need this in a RHEL 5 kernel. Fun!) Bill From todd655495 at yahoo.com Wed May 28 21:27:09 2008 From: todd655495 at yahoo.com (Todd N) Date: Wed, 28 May 2008 14:27:09 -0700 (PDT) Subject: [Fedora-livecd-list] livecd-iso-to-disk broken in F9? Message-ID: <297214.5345.qm@web54002.mail.re2.yahoo.com> Hello, We are trying to use the livecd-iso-to-disk script in Fedora 9 to create a bootable USB drive. When running this script from a command prompt: # ./livecd-iso-to-disk all we get back is a line showing the command usage. However, the same command entered in Fedora 8, or even in Fedora 9 Beta, works fine. Has anyone else had this issue? Thanks Todd -------------- next part -------------- An HTML attachment was scrubbed... URL: From skvidal at fedoraproject.org Wed May 28 22:14:55 2008 From: skvidal at fedoraproject.org (seth vidal) Date: Wed, 28 May 2008 18:14:55 -0400 Subject: [Fedora-livecd-list] Re: [RFC] Livecd-creator and selinux, we can play nice In-Reply-To: <1212005483.3079.92.camel@localhost.localdomain> References: <1212004261.3079.87.camel@localhost.localdomain> <20080528200443.GA16939@nostromo.devel.redhat.com> <1212005483.3079.92.camel@localhost.localdomain> Message-ID: <1212012895.3563.3.camel@cutter> On Wed, 2008-05-28 at 16:11 -0400, Eric Paris wrote: > > My concern is this is a normal occurence (needing a chroot) > > Yes and no.... > sure looks like we'd need to make sure: yum, mock and rpm all know how to set this up given how it would impact chroot creation. We may want to drop this back to the lowest level chroot creation. -sv From markmc at redhat.com Thu May 29 07:00:58 2008 From: markmc at redhat.com (Mark McLoughlin) Date: Thu, 29 May 2008 08:00:58 +0100 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <483DA642.4040002@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> <483C3E00.8040108@redhat.com> <483C3E77.4090702@redhat.com> <483D97E4.3090702@redhat.com> <483DA642.4040002@redhat.com> Message-ID: <1212044458.3338.13.camel@muff> On Wed, 2008-05-28 at 14:36 -0400, Jeremy Katz wrote: > > The ability for a tool to create these partitioned disk images via the > > command like, livecd-creator, is very helpful in reproducing known state > > appliances, epically with the rising use of visualization. Going > > through a actual install in a vm limits you to VM container, xen, kvm, > > vmware and adds extra overhead of building on a machine with extra virt > > resources. > > Reproducing known state should work just as well with a kickstart config > and doing an install via, eg, virt-install. Yes, it adds overhead, but > there are also advantages in functionality and it also means *not* > maintaining this sort of code in multiple places. And that's a pretty > big win as partitioning code is not in the least bit trivial. > Especially as you start trying to handle more and more of the cases. That pretty lame - you're trying to curtail what use cases people make imgcreate support purely because we haven't figured out how to do a better job of sharing code with anaconda. The very least we should be doing is allowing imgcreate to be extended externally in this manner ... but that doesn't fix the "multiple copies of this code" issue, it merely pushes it elsewhere and makes it less likely it'll ever be fixed. Clearly, one advantage of imgcreate tools over a full blown anaconda install in a VM is that it's far less complex to debug when it all goes wrong. That's a huge advantage to people repeatedly rebuilding images as they develop a LiveCD or an appliance. Cheers, Mark. From katzj at redhat.com Thu May 29 12:31:50 2008 From: katzj at redhat.com (Jeremy Katz) Date: Thu, 29 May 2008 08:31:50 -0400 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <1212044458.3338.13.camel@muff> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> <483C3E00.8040108@redhat.com> <483C3E77.4090702@redhat.com> <483D97E4.3090702@redhat.com> <483DA642.4040002@redhat.com> <1212044458.3338.13.camel@muff> Message-ID: <483EA236.8020106@redhat.com> Mark McLoughlin wrote: > On Wed, 2008-05-28 at 14:36 -0400, Jeremy Katz wrote: >>> The ability for a tool to create these partitioned disk images via the >>> command like, livecd-creator, is very helpful in reproducing known state >>> appliances, epically with the rising use of visualization. Going >>> through a actual install in a vm limits you to VM container, xen, kvm, >>> vmware and adds extra overhead of building on a machine with extra virt >>> resources. >> Reproducing known state should work just as well with a kickstart config >> and doing an install via, eg, virt-install. Yes, it adds overhead, but >> there are also advantages in functionality and it also means *not* >> maintaining this sort of code in multiple places. And that's a pretty >> big win as partitioning code is not in the least bit trivial. >> Especially as you start trying to handle more and more of the cases. > > That pretty lame - you're trying to curtail what use cases people make > imgcreate support purely because we haven't figured out how to do a > better job of sharing code with anaconda. If there were multiple people really clamoring for support to do partitioned images, it would be one thing. But right now, it's one tool. And to then carry the onus outside of that tool for keeping the non-trivial bits working? > The very least we should be doing is allowing imgcreate to be extended > externally in this manner ... but that doesn't fix the "multiple copies > of this code" issue, it merely pushes it elsewhere and makes it less > likely it'll ever be fixed. But we are doing the work to allow an external appliance-creator to carry the functionality if desired. That's why the refactoring patch is reasonable (modulo fixing up the API break). > Clearly, one advantage of imgcreate tools over a full blown anaconda > install in a VM is that it's far less complex to debug when it all goes > wrong. That's a huge advantage to people repeatedly rebuilding images as > they develop a LiveCD or an appliance. The reason that it's less complex to debug is the fact that the code is more limited in what it supports than anaconda. Adding more (complicated) pieces is directly in contradiction to keeping things simple to debug Jeremy From katzj at redhat.com Thu May 29 12:32:31 2008 From: katzj at redhat.com (Jeremy Katz) Date: Thu, 29 May 2008 08:32:31 -0400 Subject: [Fedora-livecd-list] livecd-iso-to-disk broken in F9? In-Reply-To: <297214.5345.qm@web54002.mail.re2.yahoo.com> References: <297214.5345.qm@web54002.mail.re2.yahoo.com> Message-ID: <483EA25F.9090801@redhat.com> Todd N wrote: > We are trying to use the livecd-iso-to-disk script in Fedora 9 to create > a bootable USB drive. When running this script from a command prompt: > > # ./livecd-iso-to-disk > > all we get back is a line showing the command usage. However, the same > command entered in Fedora 8, or even in Fedora 9 Beta, works fine. Has > anyone else had this issue? Err... you need to give it more arguments than just that :) It's been working fine for me and I use it on a very regular basis Jeremy From katzj at redhat.com Thu May 29 12:41:31 2008 From: katzj at redhat.com (Jeremy Katz) Date: Thu, 29 May 2008 08:41:31 -0400 Subject: [Fedora-livecd-list] Re: [RFC] Livecd-creator and selinux, we can play nice In-Reply-To: <1212012895.3563.3.camel@cutter> References: <1212004261.3079.87.camel@localhost.localdomain> <20080528200443.GA16939@nostromo.devel.redhat.com> <1212005483.3079.92.camel@localhost.localdomain> <1212012895.3563.3.camel@cutter> Message-ID: <483EA47B.6080905@redhat.com> seth vidal wrote: > On Wed, 2008-05-28 at 16:11 -0400, Eric Paris wrote: >>> My concern is this is a normal occurence (needing a chroot) >> Yes and no.... > > sure looks like we'd need to make sure: > > yum, mock and rpm all know how to set this up given how it would impact > chroot creation. If we do so, then we should also make sure that all do things consistently wrt /dev for creating a chroot as well. And /proc and /sys. The reality is that the different applications do have a somewhat different idea of what they need/want out of their chroots and do things (or don't) accordingly. > We may want to drop this back to the lowest level chroot creation. Which isn't to say that we might not decide down the road to push it down the stack, but I don't know that livecd-creator is a bad place in the short to medium term as Eric continues looking at SELinux and chroot interactions (Right Eric? :-) Jeremy From katzj at redhat.com Thu May 29 12:51:12 2008 From: katzj at redhat.com (Jeremy Katz) Date: Thu, 29 May 2008 08:51:12 -0400 Subject: [Fedora-livecd-list] Re: [RFC] Livecd-creator and selinux, we can play nice In-Reply-To: <1212004261.3079.87.camel@localhost.localdomain> References: <1212004261.3079.87.camel@localhost.localdomain> Message-ID: <483EA6C0.2090009@redhat.com> Eric Paris wrote: > So I've spent a fair bit of time the last 2 weeks trying to get > livecd-creator and an selinux enforcing machine to play nicely together. > It doesn't look like much, but from the point of view of the livecd > creator I think the following patch is all we need. Working with > rawhide as the host system I was able to build F8, F9 and rawhide > livecd's with an enforcing machine. > > I wouldn't suggest jumping into enfocing builds just yet as there are > still some policy issues I need to work out with the selinux people but > I would like comments. Basically its quite simple, if selinux is on the > host we create a fake /selinux which tells the install chroot lies. > I've had to make some changes to some selinux libraries to support all > this, but I think we are just about there. Very cool and definitely long needed. Thanks for taking the time to really dive into this. And this is far simpler than the approach I had started looking at once upon a time (... which involved fuse) A few comments on the patch > diff -Naupr /usr/lib/python2.5/site-packages/imgcreate/creator.py /root/imgcreate-5-28-08/creator.py > --- /usr/lib/python2.5/site-packages/imgcreate/creator.py 2008-05-06 12:16:08.000000000 -0400 > +++ /root/imgcreate-5-28-08/creator.py 2008-05-28 15:48:30.000000000 -0400 > @@ -460,6 +457,37 @@ class ImageCreator(object): > os.symlink('/proc/self/fd/2', self._instroot + "/dev/stderr") > os.umask(origumask) > > + # if selinux exists on the host we need to lie to the chroot > + if os.path.exists("/selinux/enforce"): > + selinux_dir = self._instroot + "/selinux" > + > + # enforce=0 tells the chroot selinux is not enforcing > + # policyvers=99 tell the chroot to make the highest version of policy it can > + files = [('/enforce', '0'), > + ('/policyvers', '99')] Does the kernel guarantee that 99 will be the highest version of policy? Not that it likely matters much. Also, having this as a tuple rather than a list makes it marginally faster since we're never going to modify it > + for (file, value) in files: > + fd = os.open(selinux_dir + file, os.O_WRONLY | os.O_TRUNC | os.O_CREAT) > + os.write(fd, value) > + os.close(fd) > + > + # we steal mls from the host system for now, might be best to always set it to 1???? > + files = ["/selinux/mls"] > + for file in files: > + shutil.copyfile(file, self._instroot + file) > + > + # make /load -> /dev/null so chroot policy loads don't hurt anything > + os.mknod(selinux_dir + "/load", 0666 | stat.S_IFCHR, os.makedev(1, 3)) This being the big win :) > + # selinux is on whoo hooo > + if kickstart.selinux_enabled(self.ks): > + # label the fs like it is a root before the bind mounting > + cmd = "/sbin/setfiles -F -r %s %s %s" % (self._instroot, selinux.selinux_file_context_path(), self._instroot) > + os.system(cmd) > + # these dumb things don't get magically fixed, so make the user generic > + for f in ["/proc", "/sys", "/selinux"]: > + cmd = "chcon -u system_u %s" % (self._instroot + f) > + os.system(cmd) os.system is generally not preferred -- using the subprocess module is a lot safer. Also, overall it might be nice to encapsulate the /selinux creation here into its own __create_selinuxfs() method that gets called. /me makes a note to do that to the /dev creation too. > @@ -853,6 +881,18 @@ class LoopImageCreator(ImageCreator): > (self._image, e)) > > def _unmount_instroot(self): > + # if the system was running selinux clean up our lies > + if os.path.exists("/selinux/enforce"): > + files = ['/enforce', > + '/policyvers', > + '/mls', > + '/load'] Again a tuple versus a list > + for file in files: > + try: > + os.unlink(self._instroot + "/selinux" + file) > + except OSError: > + pass And again having it in a method is probably the nice thing to do. And I know I said to stick it into _unmount_instroot, but seeing where you've put the mount side, it probably makes more sense in unmount() instead Jeremy From notting at redhat.com Thu May 29 15:01:17 2008 From: notting at redhat.com (Bill Nottingham) Date: Thu, 29 May 2008 11:01:17 -0400 Subject: [Fedora-livecd-list] Re: [RFC] Livecd-creator and selinux, we can play nice In-Reply-To: <483EC427.4060009@redhat.com> References: <1212004261.3079.87.camel@localhost.localdomain> <20080528200443.GA16939@nostromo.devel.redhat.com> <483EC427.4060009@redhat.com> Message-ID: <20080529150117.GA13595@nostromo.devel.redhat.com> Daniel J Walsh (dwalsh at redhat.com) said: > Well I think we need to do a couple of these to figure out the common > requirements. > > I envision mock to be quite different then livecd. I think we need to > full the mock chroot to think SELinux is disabled and to do no labeling > in the chroot. This would allow us to confine the mock process to be > able to write to the chroot and label the chroot mock_rw_t. We could > then use SELinux to prevent mock environments from breaking out of the > chroot, and stop mock environments from doing evil network things within > the chroot. > > In livecd we need to be able to put down labels that the host machine > does not understand. The problem is that mock can be used to do non-build things. (For example, creating the anaconda install images.) Bill From bkearney at redhat.com Thu May 29 15:33:19 2008 From: bkearney at redhat.com (Bryan Kearney) Date: Thu, 29 May 2008 11:33:19 -0400 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <483EA236.8020106@redhat.com> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> <483C3E00.8040108@redhat.com> <483C3E77.4090702@redhat.com> <483D97E4.3090702@redhat.com> <483DA642.4040002@redhat.com> <1212044458.3338.13.camel@muff> <483EA236.8020106@redhat.com> Message-ID: <483ECCBF.8060405@redhat.com> Jeremy Katz wrote: > Mark McLoughlin wrote: >> On Wed, 2008-05-28 at 14:36 -0400, Jeremy Katz wrote: >>>> The ability for a tool to create these partitioned disk images via the >>>> command like, livecd-creator, is very helpful in reproducing known >>>> state >>>> appliances, epically with the rising use of visualization. Going >>>> through a actual install in a vm limits you to VM container, xen, kvm, >>>> vmware and adds extra overhead of building on a machine with extra virt >>>> resources. >>> Reproducing known state should work just as well with a kickstart >>> config and doing an install via, eg, virt-install. Yes, it adds >>> overhead, but there are also advantages in functionality and it also >>> means *not* maintaining this sort of code in multiple places. And >>> that's a pretty big win as partitioning code is not in the least bit >>> trivial. Especially as you start trying to handle more and more of >>> the cases. >> >> That pretty lame - you're trying to curtail what use cases people make >> imgcreate support purely because we haven't figured out how to do a >> better job of sharing code with anaconda. > > If there were multiple people really clamoring for support to do > partitioned images, it would be one thing. But right now, it's one > tool. And to then carry the onus outside of that tool for keeping the > non-trivial bits working? > >> The very least we should be doing is allowing imgcreate to be extended >> externally in this manner ... but that doesn't fix the "multiple copies >> of this code" issue, it merely pushes it elsewhere and makes it less >> likely it'll ever be fixed. > > But we are doing the work to allow an external appliance-creator to > carry the functionality if desired. That's why the refactoring patch is > reasonable (modulo fixing up the API break). > >> Clearly, one advantage of imgcreate tools over a full blown anaconda >> install in a VM is that it's far less complex to debug when it all goes >> wrong. That's a huge advantage to people repeatedly rebuilding images as >> they develop a LiveCD or an appliance. > > The reason that it's less complex to debug is the fact that the code is > more limited in what it supports than anaconda. Adding more > (complicated) pieces is directly in contradiction to keeping things > simple to debug > So.. to summarize.. as long as the partitioning code is in the appliance creator only.. we are fine. Is that correct? -- bk From tim.wood at datawranglers.com Thu May 29 15:48:14 2008 From: tim.wood at datawranglers.com (Tim Wood) Date: Thu, 29 May 2008 09:48:14 -0600 Subject: [Fedora-livecd-list] [PATCH] -fs.py-kickstart.py-chages-for-mulit-partitions In-Reply-To: <1212044458.3338.13.camel@muff> References: <1207859838-27796-1-git-send-email-dhuff@redhat.com> <1211380848-13140-1-git-send-email-dhuff@redhat.com> <1211380848-13140-2-git-send-email-dhuff@redhat.com> <1211380848-13140-3-git-send-email-dhuff@redhat.com> <483C3E00.8040108@redhat.com> <483C3E77.4090702@redhat.com> <483D97E4.3090702@redhat.com> <483DA642.4040002@redhat.com> <1212044458.3338.13.camel@muff> Message-ID: <483ED03E.4000301@datawranglers.com> I've been flat on my back for a while, so if I repeat anything previously sad, apologies. I've got a kickstart that is used to create a two partition solution on a 1G flash device. On the code side, I use a number of shell scripts. But, the main thing that makes is work is that I use a directory structure that looks like this project - files/ - partition_2/ - kickstart file files holds various odds & ends (some custom rpms, some specific files, etc). partition_2 holds all the stuff I want on the second partion. I then have a simple script that backbones the livecd creation process and a second script that bundles up everything in the partition 2 directory as another iso. When I'm ready to burn the stuff to flash, I run a second script that handles the partitioning, writes the livecd to the first partition and the partition_2 iso's contents to the second partition. Mark, if this sounds helpful, I'd be happy to tar/zip the scripts in question with some basic directions. If the person who created the livecd creation tool (sorry ... I've forgotten your name and I seem to have accidently deleted the email) is interested, I could turn it into an rpm that could become part of that kickstart. Tim Mark McLoughlin wrote: > On Wed, 2008-05-28 at 14:36 -0400, Jeremy Katz wrote: > >>> The ability for a tool to create these partitioned disk images via the >>> command like, livecd-creator, is very helpful in reproducing known state >>> appliances, epically with the rising use of visualization. Going >>> through a actual install in a vm limits you to VM container, xen, kvm, >>> vmware and adds extra overhead of building on a machine with extra virt >>> resources. >>> >> Reproducing known state should work just as well with a kickstart config >> and doing an install via, eg, virt-install. Yes, it adds overhead, but >> there are also advantages in functionality and it also means *not* >> maintaining this sort of code in multiple places. And that's a pretty >> big win as partitioning code is not in the least bit trivial. >> Especially as you start trying to handle more and more of the cases. >> > > That pretty lame - you're trying to curtail what use cases people make > imgcreate support purely because we haven't figured out how to do a > better job of sharing code with anaconda. > > The very least we should be doing is allowing imgcreate to be extended > externally in this manner ... but that doesn't fix the "multiple copies > of this code" issue, it merely pushes it elsewhere and makes it less > likely it'll ever be fixed. > > Clearly, one advantage of imgcreate tools over a full blown anaconda > install in a VM is that it's far less complex to debug when it all goes > wrong. That's a huge advantage to people repeatedly rebuilding images as > they develop a LiveCD or an appliance. > > Cheers, > Mark. > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > -- _________________________________ Tim Wood, CLP, RHCT 719.338.7484 (tel) The Data Wranglers Web, Database & more since since 1994 www.datawranglers.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From todd655495 at yahoo.com Thu May 29 16:10:25 2008 From: todd655495 at yahoo.com (Todd N) Date: Thu, 29 May 2008 09:10:25 -0700 (PDT) Subject: [Fedora-livecd-list] livecd-iso-to-disk broken in F9? In-Reply-To: <483EA25F.9090801@redhat.com> Message-ID: <82704.82605.qm@web54008.mail.re2.yahoo.com> Yes, we use the noverify and reset-mbr options along with /dev/sr0 as the input (and have also tried /mnt/live?) and /dev/sda1 as the output (no hard drive, so this corresponds to the USB). Worked fine previously, but now returns the usage() message. Jeremy Katz wrote: Todd N wrote: > We are trying to use the livecd-iso-to-disk script in Fedora 9 to create > a bootable USB drive. When running this script from a command prompt: > > # ./livecd-iso-to-disk > > all we get back is a line showing the command usage. However, the same > command entered in Fedora 8, or even in Fedora 9 Beta, works fine. Has > anyone else had this issue? Err... you need to give it more arguments than just that :) It's been working fine for me and I use it on a very regular basis Jeremy -- Fedora-livecd-list mailing list Fedora-livecd-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From todd655495 at yahoo.com Thu May 29 16:31:21 2008 From: todd655495 at yahoo.com (Todd N) Date: Thu, 29 May 2008 09:31:21 -0700 (PDT) Subject: [Fedora-livecd-list] livecd-iso-to-disk broken in F9? In-Reply-To: <82704.82605.qm@web54008.mail.re2.yahoo.com> Message-ID: <156736.98394.qm@web54012.mail.re2.yahoo.com> Correction: we also tried /dev/live as the input parameter (not /mnt/live). Also, this method worked in Fedora 9 Preview as well. Todd Todd N wrote: Yes, we use the noverify and reset-mbr options along with /dev/sr0 as the input (and have also tried /mnt/live?) and /dev/sda1 as the output (no hard drive, so this corresponds to the USB). Worked fine previously, but now returns the usage() message. Jeremy Katz wrote: Todd N wrote: > We are trying to use the livecd-iso-to-disk script in Fedora 9 to create > a bootable USB drive. When running this script from a command prompt: > > # ./livecd-iso-to-disk > > all we get back is a line showing the command usage. However, the same > command entered in Fedora 8, or even in Fedora 9 Beta, works fine. Has > anyone else had this issue? Err... you need to give it more arguments than just that :) It's been working fine for me and I use it on a very regular basis Jeremy -- Fedora-livecd-list mailing list Fedora-livecd-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list -- Fedora-livecd-list mailing list Fedora-livecd-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From katzj at redhat.com Thu May 29 16:44:29 2008 From: katzj at redhat.com (Jeremy Katz) Date: Thu, 29 May 2008 12:44:29 -0400 Subject: [Fedora-livecd-list] livecd-iso-to-disk broken in F9? In-Reply-To: <156736.98394.qm@web54012.mail.re2.yahoo.com> References: <156736.98394.qm@web54012.mail.re2.yahoo.com> Message-ID: <483EDD6D.2020105@redhat.com> Try running it with sh -x... that should at least give you an idea of where it's going wrong Jeremy Todd N wrote: > Correction: we also tried /dev/live as the input parameter (not > /mnt/live). Also, this method worked in Fedora 9 Preview as well. > > Todd > > */Todd N /* wrote: > > Yes, we use the noverify and reset-mbr options along with /dev/sr0 > as the input (and have also tried /mnt/live?) and /dev/sda1 as the > output (no hard drive, so this corresponds to the USB). Worked fine > previously, but now returns the usage() message. > > */Jeremy Katz /* wrote: > > Todd N wrote: > > We are trying to use the livecd-iso-to-disk script in Fedora > 9 to create > > a bootable USB drive. When running this script from a command > prompt: > > > > # ./livecd-iso-to-disk > > > > all we get back is a line showing the command usage. However, > the same > > command entered in Fedora 8, or even in Fedora 9 Beta, works > fine. Has > > anyone else had this issue? > > Err... you need to give it more arguments than just that :) It's > been > working fine for me and I use it on a very regular basis > > Jeremy > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > > > ------------------------------------------------------------------------ > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list From todd655495 at yahoo.com Thu May 29 18:56:25 2008 From: todd655495 at yahoo.com (Todd N) Date: Thu, 29 May 2008 11:56:25 -0700 (PDT) Subject: [Fedora-livecd-list] livecd-iso-to-disk broken in F9? In-Reply-To: <483EDD6D.2020105@redhat.com> Message-ID: <137291.7519.qm@web54008.mail.re2.yahoo.com> These are our results. [/dev/sr0 on /mnt/live type iso9660 (ro)] [root at localhost LiveOS]# sh -x ./livecd-iso-to-disk --reset-mbr --noverify /dev/sr0 /dev/sda1 + export PATH=/sbin:/usr/sbin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin + PATH=/sbin:/usr/sbin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin ++ id -u + '[' 0 '!=' 0 ']' + '[' 4 -gt 2 ']' + case $1 in + resetmbr=1 + shift + '[' 3 -gt 2 ']' + case $1 in + noverify=1 + shift + '[' 2 -gt 2 ']' ++ readlink -f /dev/sr0 + ISO=/dev/sr0 + USBDEV=/dev/sda1 + '[' -z /dev/sr0 -o '!' -f /dev/sr0 ']' + usage + echo './livecd-iso-to-disk [--reset-mbr] [--noverify] [--overlay-size-mb ] ' ./livecd-iso-to-disk [--reset-mbr] [--noverify] [--overlay-size-mb ] + exit 1 Jeremy Katz wrote: Try running it with sh -x... that should at least give you an idea of where it's going wrong Jeremy Todd N wrote: > Correction: we also tried /dev/live as the input parameter (not > /mnt/live). Also, this method worked in Fedora 9 Preview as well. > > Todd > > */Todd N /* wrote: > > Yes, we use the noverify and reset-mbr options along with /dev/sr0 > as the input (and have also tried /mnt/live?) and /dev/sda1 as the > output (no hard drive, so this corresponds to the USB). Worked fine > previously, but now returns the usage() message. > > */Jeremy Katz /* wrote: > > Todd N wrote: > > We are trying to use the livecd-iso-to-disk script in Fedora > 9 to create > > a bootable USB drive. When running this script from a command > prompt: > > > > # ./livecd-iso-to-disk > > > > all we get back is a line showing the command usage. However, > the same > > command entered in Fedora 8, or even in Fedora 9 Beta, works > fine. Has > > anyone else had this issue? > > Err... you need to give it more arguments than just that :) It's > been > working fine for me and I use it on a very regular basis > > Jeremy > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > > > > ------------------------------------------------------------------------ > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list -- Fedora-livecd-list mailing list Fedora-livecd-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-livecd-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From katzj at redhat.com Thu May 29 19:10:04 2008 From: katzj at redhat.com (Jeremy Katz) Date: Thu, 29 May 2008 15:10:04 -0400 Subject: [Fedora-livecd-list] livecd-iso-to-disk broken in F9? In-Reply-To: <137291.7519.qm@web54008.mail.re2.yahoo.com> References: <137291.7519.qm@web54008.mail.re2.yahoo.com> Message-ID: <483EFF8C.5000102@redhat.com> Todd N wrote: > These are our results. [/dev/sr0 on /mnt/live type iso9660 (ro)] [snip] > + '[' -z /dev/sr0 -o '!' -f /dev/sr0 ']' Hmmm... I see what it is. We changed so that we ensure that you're not using like a directory, but that then doesn't work with using the mounted block device. The "simple" fix would be to change the -f there to a -e, but that's not the best fix. I'll try to kludge something in shell to work more completely Jeremy From katzj at fedoraproject.org Thu May 29 21:04:51 2008 From: katzj at fedoraproject.org (Jeremy Katz) Date: Thu, 29 May 2008 21:04:51 +0000 (UTC) Subject: [Fedora-livecd-list] 2 commits - imgcreate/creator.py tools/livecd-iso-to-disk.sh Message-ID: <20080529210451.60BF9A825F@lists.fedorahosted.org> imgcreate/creator.py | 37 ++++++++++++++++++++----------------- tools/livecd-iso-to-disk.sh | 6 +++++- 2 files changed, 25 insertions(+), 18 deletions(-) New commits: commit fd5652933c0a49f8961d17bee5f0526bf1676a14 Author: Jeremy Katz Date: Thu May 29 17:04:41 2008 -0400 Allow isos to be blockdevs or regular files diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh index 9676633..69e97e3 100644 --- a/tools/livecd-iso-to-disk.sh +++ b/tools/livecd-iso-to-disk.sh @@ -188,7 +188,11 @@ done ISO=$(readlink -f "$1") USBDEV=$2 -if [ -z "$ISO" -o ! -f "$ISO" ]; then +if [ -z "$ISO" ]; then + usage +fi + +if [ ! -b "$ISO" -a ! -f "$ISO" ]; then usage fi commit 6e221ba27ed5a6c5a79ac1fbb7cfc5e11566e080 Author: Jeremy Katz Date: Thu May 29 08:53:25 2008 -0400 Move minimal /dev creation into a method diff --git a/imgcreate/creator.py b/imgcreate/creator.py index fc4298b..5d010a1 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -403,6 +403,24 @@ class ImageCreator(object): fstab.write(self._get_fstab()) fstab.close() + def __create_minimal_dev(self): + """Create a minimal /dev so that we don't corrupt the host /dev""" + origumask = os.umask(0000) + devices = (('null', 1, 3, 0666), + ('urandom',1, 9, 0666), + ('random', 1, 8, 0666), + ('full', 1, 7, 0666), + ('ptmx', 5, 2, 0666), + ('tty', 5, 0, 0666), + ('zero', 1, 5, 0666)) + for (node, major, minor, perm) in devices: + os.mknod(self._instroot + "/dev/" + node, perm | stat.S_IFCHR, os.makedev(major,minor)) + os.symlink('/proc/self/fd', self._instroot + "/dev/fd") + os.symlink('/proc/self/fd/0', self._instroot + "/dev/stdin") + os.symlink('/proc/self/fd/1', self._instroot + "/dev/stdout") + os.symlink('/proc/self/fd/2', self._instroot + "/dev/stderr") + os.umask(origumask) + def mount(self, base_on = None, cachedir = None): """Setup the target filesystem in preparation for an install. @@ -444,25 +462,10 @@ class ImageCreator(object): if kickstart.selinux_enabled(self.ks): self.__bindmounts.append(BindChrootMount("/selinux", self._instroot, None)) - # Create minimum /dev - origumask = os.umask(0000) - devices = [('null', 1, 3, 0666), - ('urandom',1, 9, 0666), - ('random', 1, 8, 0666), - ('full', 1, 7, 0666), - ('ptmx', 5, 2, 0666), - ('tty', 5, 0, 0666), - ('zero', 1, 5, 0666)] - for (node, major, minor, perm) in devices: - os.mknod(self._instroot + "/dev/" + node, perm | stat.S_IFCHR, os.makedev(major,minor)) - os.symlink('/proc/self/fd', self._instroot + "/dev/fd") - os.symlink('/proc/self/fd/0', self._instroot + "/dev/stdin") - os.symlink('/proc/self/fd/1', self._instroot + "/dev/stdout") - os.symlink('/proc/self/fd/2', self._instroot + "/dev/stderr") - os.umask(origumask) - self._do_bindmounts() + self.__create_minimal_dev() + os.symlink("../proc/mounts", self._instroot + "/etc/mtab") self.__write_fstab() From fulko.hew at gmail.com Sat May 31 14:09:14 2008 From: fulko.hew at gmail.com (Fulko Hew) Date: Sat, 31 May 2008 10:09:14 -0400 Subject: [Fedora-livecd-list] Re: failing at my first attempt at liveCD creation In-Reply-To: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> References: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> Message-ID: <8204a4fe0805310709o8bab916qc50dc288be774116@mail.gmail.com> On Sat, May 24, 2008 at 11:21 AM, Fulko Hew wrote: > > I'm failing at my first attempt at creating (or recreating) a live CD > > - I'm using Fedora 8 (because I don't find KDE in F9 usable yet) > - I have SELinux disabled. > > Following the process described in the LiveCDHowTo, well, actually > the step: > > livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks ... snip ... Following up on my own email... I am making progress, but not because I changed anything... I now have success in creating a live CD, just by running _exactly_ the same thing again. Now its basically working (without changing a thing... Yeah, I have a hard time believing that myself.) Now that I can basically create a bootable media... I want to customize it. But if I use the standard approach of always downloading the RPMs across the net, it takes a long time, so therefore I'd like to have a local repository to suck from. I haven't been able to find a 'good/working' set if instructions to follow that a) creates a local repo, and b) changes required to the kickstart file so it _successfully_ uses that local repo. Surely there must be a definitive set of instructions/docs for this _whole_ downloading/setup/building/customizing a liveCD process? (I haven't found any 'complete' instructions yet.) Pointers anyone? TIA Fulko -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.wood at datawranglers.com Sat May 31 16:59:36 2008 From: tim.wood at datawranglers.com (Tim Wood) Date: Sat, 31 May 2008 10:59:36 -0600 Subject: [Fedora-livecd-list] Re: failing at my first attempt at liveCD creation In-Reply-To: <8204a4fe0805310709o8bab916qc50dc288be774116@mail.gmail.com> References: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> <8204a4fe0805310709o8bab916qc50dc288be774116@mail.gmail.com> Message-ID: <484183F8.30000@datawranglers.com> You can also use package caching. I believe you add --cache=/path/to/cache to the livecd-creator command. You can check the mail archive for the directions. Tim Fulko Hew wrote: > > > On Sat, May 24, 2008 at 11:21 AM, Fulko Hew > wrote: > > > > I'm failing at my first attempt at creating (or recreating) a live CD > > > > - I'm using Fedora 8 (because I don't find KDE in F9 usable yet) > > - I have SELinux disabled. > > > > Following the process described in the LiveCDHowTo, well, actually > > the step: > > > > livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks > > > ... snip ... > > Following up on my own email... I am making progress, but not because > I changed anything... I now have success in creating a live CD, just by > running _exactly_ the same thing again. Now its basically working > (without changing a thing... Yeah, I have a hard time believing that > myself.) > > Now that I can basically create a bootable media... I want to > customize it. > But if I use the standard approach of always downloading the RPMs > across the net, it takes a long time, so therefore I'd like to have a > local > repository to suck from. I haven't been able to find a 'good/working' > set if instructions to follow that a) creates a local repo, and b) changes > required to the kickstart file so it _successfully_ uses that local repo. > > Surely there must be a definitive set of instructions/docs for this > _whole_ downloading/setup/building/customizing a liveCD process? > (I haven't found any 'complete' instructions yet.) Pointers anyone? > > TIA > Fulko > > ------------------------------------------------------------------------ > > -- > Fedora-livecd-list mailing list > Fedora-livecd-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-livecd-list > -- _________________________________ Tim Wood, CLP, RHCT 719.338.7484 (tel) The Data Wranglers Web, Database & more since since 1994 www.datawranglers.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvonau at shaw.ca Sat May 31 17:23:23 2008 From: jvonau at shaw.ca (Jerry Vonau) Date: Sat, 31 May 2008 12:23:23 -0500 Subject: [Fedora-livecd-list] Re: failing at my first attempt at liveCD creation In-Reply-To: <8204a4fe0805310709o8bab916qc50dc288be774116@mail.gmail.com> References: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> <8204a4fe0805310709o8bab916qc50dc288be774116@mail.gmail.com> Message-ID: <4841898B.5070508@shaw.ca> Fulko Hew wrote: > On Sat, May 24, 2008 at 11:21 AM, Fulko Hew wrote: >> I'm failing at my first attempt at creating (or recreating) a live CD >> >> - I'm using Fedora 8 (because I don't find KDE in F9 usable yet) >> - I have SELinux disabled. >> >> Following the process described in the LiveCDHowTo, well, actually >> the step: >> >> livecd-creator --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks > > > ... snip ... > > Following up on my own email... I am making progress, but not because > I changed anything... I now have success in creating a live CD, just by > running _exactly_ the same thing again. Now its basically working > (without changing a thing... Yeah, I have a hard time believing that > myself.) > > Now that I can basically create a bootable media... I want to customize it. > But if I use the standard approach of always downloading the RPMs > across the net, it takes a long time, so therefore I'd like to have a local > repository to suck from. I haven't been able to find a 'good/working' > set if instructions to follow that a) creates a local repo, and b) changes > required to the kickstart file so it _successfully_ uses that local repo. > > Surely there must be a definitive set of instructions/docs for this > _whole_ downloading/setup/building/customizing a liveCD process? > (I haven't found any 'complete' instructions yet.) Pointers anyone? > You could also use the --cachedir= setting in livecd-creator to keep the cache from being deleted in between runs. Yea, no complete instructions, but this comes close: http://www.informit.com/articles/article.aspx?p=1157197&seqNum=4 For a) grab the rpms and run createrepo examples at: http://fedoranews.org/alex/tutorial/yum/ http://fedoranews.org/contributors/hal_canary/yum/ For b) edit the --config= file changing the repo= line ie, from: repo --name=development \ --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch to: repo --name=development --baseurl=file:///path/to/your/repo Hope this helps, Jerry From jvonau at shaw.ca Sat May 31 17:25:41 2008 From: jvonau at shaw.ca (Jerry Vonau) Date: Sat, 31 May 2008 12:25:41 -0500 Subject: [Fedora-livecd-list] Re: failing at my first attempt at liveCD creation In-Reply-To: <4841898B.5070508@shaw.ca> References: <8204a4fe0805240821t385c6344i210e7ff8dd5cb67a@mail.gmail.com> <8204a4fe0805310709o8bab916qc50dc288be774116@mail.gmail.com> <4841898B.5070508@shaw.ca> Message-ID: <48418A15.2000906@shaw.ca> Jerry Vonau wrote: > You could also use the --cachedir= setting in livecd-creator to keep the > cache from being deleted in between runs. > Make that --cache= Jerry