diff -Nur livecd-tools-21.1.old/imgcreate/creator.py livecd-tools-21.1/imgcreate/creator.py --- livecd-tools-21.1.old/imgcreate/creator.py 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/imgcreate/creator.py 2014-05-13 14:32:57.612911592 +0400 @@ -17,6 +17,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os +import time import os.path import stat import sys @@ -26,12 +27,10 @@ import subprocess import selinux -import yum import rpm from imgcreate.errors import * from imgcreate.fs import * -from imgcreate.yuminst import * from imgcreate import kickstart FSLABEL_MAXLEN = 32 @@ -504,17 +503,17 @@ self._mount_instroot(base_on) - for d in ("/dev/pts", "/etc", "/boot", "/var/log", "/var/cache/yum", "/sys", "/proc"): + for d in ("/dev/pts", "/etc", "/boot", "/var/log", "/var/cache/urpmi", "/sys", "/proc"): makedirs(self._instroot + d) - cachesrc = cachedir or (self.__builddir + "/yum-cache") + cachesrc = cachedir or (self.__builddir + "/urpmi-cache") makedirs(cachesrc) # bind mount system directories into _instroot for (f, dest) in [("/sys", None), ("/proc", None), ("/dev/pts", None), ("/dev/shm", None), (self.__selinux_mountpoint, self.__selinux_mountpoint), - (cachesrc, "/var/cache/yum")]: + (cachesrc, "/var/cache/urpmi")]: if os.path.exists(f): self.__bindmounts.append(BindChrootMount(f, self._instroot, dest)) else: @@ -573,104 +572,16 @@ shutil.rmtree(self.__builddir, ignore_errors = True) self.__builddir = None - def __select_packages(self, ayum): - skipped_pkgs = [] - for pkg in kickstart.get_packages(self.ks, - self._get_required_packages()): - try: - ayum.selectPackage(pkg) - except yum.Errors.InstallError, e: - if kickstart.ignore_missing(self.ks): - skipped_pkgs.append(pkg) - else: - raise CreatorError("Failed to find package '%s' : %s" % - (pkg, e)) - - for pkg in skipped_pkgs: - logging.warn("Skipping missing package '%s'" % (pkg,)) - - def __select_groups(self, ayum): - skipped_groups = [] - for group in kickstart.get_groups(self.ks): - try: - ayum.selectGroup(group.name, group.include) - except (yum.Errors.InstallError, yum.Errors.GroupsError), e: - if kickstart.ignore_missing(self.ks): - raise CreatorError("Failed to find group '%s' : %s" % - (group.name, e)) - else: - skipped_groups.append(group) - - for group in skipped_groups: - logging.warn("Skipping missing group '%s'" % (group.name,)) - - def __deselect_packages(self, ayum): - for pkg in kickstart.get_excluded(self.ks, - self._get_excluded_packages()): - ayum.deselectPackage(pkg) - - def install(self, repo_urls = {}): - """Install packages into the install root. - - This function installs the packages listed in the supplied kickstart - into the install root. By default, the packages are installed from the - repository URLs specified in the kickstart. - - repo_urls -- a dict which maps a repository name to a repository URL; - if supplied, this causes any repository URLs specified in - the kickstart to be overridden. - - """ - yum_conf = self._mktemp(prefix = "yum.conf-") - - ayum = LiveCDYum(releasever=self.releasever, useplugins=self.useplugins) - ayum.setup(yum_conf, self._instroot, cacheonly=self.cacheonly) + def install_urpmi(self, repo_urls = {}): + urpmi_conf = self.__builddir + "/urpmi_conf" + print urpmi_conf + time.sleep(5) for repo in kickstart.get_repos(self.ks, repo_urls): - (name, baseurl, mirrorlist, proxy, inc, exc, cost, sslverify) = repo - - yr = ayum.addRepository(name, baseurl, mirrorlist) - if inc: - yr.includepkgs = inc - if exc: - yr.exclude = exc - if proxy: - yr.proxy = proxy - if cost is not None: - yr.cost = cost - yr.sslverify = sslverify - ayum.setup(yum_conf, self._instroot) - - if kickstart.exclude_docs(self.ks): - rpm.addMacro("_excludedocs", "1") - if not kickstart.selinux_enabled(self.ks): - rpm.addMacro("__file_context_path", "%{nil}") - if kickstart.inst_langs(self.ks) != None: - rpm.addMacro("_install_langs", kickstart.inst_langs(self.ks)) - - try: - self.__select_packages(ayum) - self.__select_groups(ayum) - self.__deselect_packages(ayum) - - ayum.runInstall() - except yum.Errors.RepoError, e: - raise CreatorError("Unable to download from repo : %s" % (e,)) - except yum.Errors.YumBaseError, e: - raise CreatorError("Unable to install: %s" % (e,)) - finally: - ayum.closeRpmDB() - ayum.close() - os.unlink(yum_conf) - - # do some clean up to avoid lvm info leakage. this sucks. - for subdir in ("cache", "backup", "archive"): - lvmdir = self._instroot + "/etc/lvm/" + subdir - try: - for f in os.listdir(lvmdir): - os.unlink(lvmdir + "/" + f) - except: - pass + (name, baseurl, mirrorlist, proxy, inc, exc, cost) = repo + subprocess.call(["/usr/sbin/urpmi.addmedia", "--urpmi-root", urpmi_conf, name, baseurl]) + packages = self.ks.handler.packages.packageList + subprocess.call(["/usr/sbin/urpmi", "--auto", "--no-suggests", "--fastunsafe", "--debug", "--no-verify", "--urpmi-root", urpmi_conf, "--root", self._instroot] + packages) def _run_post_scripts(self): for s in kickstart.get_post_scripts(self.ks): @@ -729,9 +640,8 @@ kickstart.NetworkConfig(self._instroot).apply(ksh.network) kickstart.RPMMacroConfig(self._instroot).apply(self.ks) - self._create_bootconfig() - self._run_post_scripts() + self._create_bootconfig() kickstart.SelinuxConfig(self._instroot).apply(ksh.selinux) def launch_shell(self): diff -Nur livecd-tools-21.1.old/imgcreate/errors.py livecd-tools-21.1/imgcreate/errors.py --- livecd-tools-21.1.old/imgcreate/errors.py 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/imgcreate/errors.py 2014-05-13 14:33:34.192912683 +0400 @@ -56,3 +56,6 @@ pass class ResizeError(CreatorError): pass +class InitramfsError(CreatorError): + pass + diff -Nur livecd-tools-21.1.old/imgcreate/fs.py livecd-tools-21.1/imgcreate/fs.py --- livecd-tools-21.1.old/imgcreate/fs.py 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/imgcreate/fs.py 2014-05-13 14:35:02.152915304 +0400 @@ -73,9 +73,9 @@ def mksquashfs(in_img, out_img, compress_type): # Allow gzip to work for older versions of mksquashfs if not compress_type or compress_type == "gzip": - args = ["/sbin/mksquashfs", in_img, out_img] + args = ["/usr/bin/mksquashfs", in_img, out_img] else: - args = ["/sbin/mksquashfs", in_img, out_img, "-comp", compress_type] + args = ["/usr/bin/mksquashfs", in_img, out_img, "-comp", compress_type] if not sys.stdout.isatty(): args.append("-no-progress") @@ -610,7 +610,7 @@ # where C is the number of 512 byte sectors in use # try: - return int((out.split()[3]).split('/')[0]) * 512 + return int((out.split()[4]).split('/')[0]) * 512 except ValueError: raise SnapshotError("Failed to parse dmsetup status: " + out) diff -Nur livecd-tools-21.1.old/imgcreate/__init__.py livecd-tools-21.1/imgcreate/__init__.py --- livecd-tools-21.1.old/imgcreate/__init__.py 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/imgcreate/__init__.py 2014-05-13 14:35:34.680916273 +0400 @@ -18,7 +18,6 @@ from imgcreate.live import * from imgcreate.creator import * -from imgcreate.yuminst import * from imgcreate.kickstart import * from imgcreate.fs import * from imgcreate.debug import * diff -Nur livecd-tools-21.1.old/imgcreate/kickstart.py livecd-tools-21.1/imgcreate/kickstart.py --- livecd-tools-21.1.old/imgcreate/kickstart.py 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/imgcreate/kickstart.py 2014-05-13 14:35:55.884916905 +0400 @@ -25,11 +25,6 @@ import urlgrabber import selinux -try: - import system_config_keyboard.keyboard as keyboard -except ImportError: - import rhpl.keyboard as keyboard - import pykickstart.commands as kscommands import pykickstart.constants as ksconstants import pykickstart.errors as kserrors diff -Nur livecd-tools-21.1.old/imgcreate/live.py livecd-tools-21.1/imgcreate/live.py --- livecd-tools-21.1.old/imgcreate/live.py 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/imgcreate/live.py 2014-05-13 15:40:18.177031999 +0400 @@ -27,6 +27,7 @@ from imgcreate.errors import * from imgcreate.fs import * +from imgcreate.arch import * from imgcreate.creator import * class LiveImageCreatorBase(LoopImageCreator): @@ -118,9 +119,9 @@ """ r = kickstart.get_kernel_args(self.ks) if os.path.exists(self._instroot + "/usr/bin/rhgb"): - r += " rhgb" + r += " rhgb splash=silent logo.nologo" if os.path.exists(self._instroot + "/usr/bin/plymouth"): - r += " rhgb" + r += " rhgb splash=silent logo.nologo" return r def _get_mkisofs_options(self, isodir): @@ -244,8 +245,8 @@ isodir + "/isolinux/efiboot.img"]) subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT", isodir + "/isolinux/macboot.img", "-l", self.product, - "-n", "/usr/share/pixmaps/bootloader/fedora-media.vol", - "-i", "/usr/share/pixmaps/bootloader/fedora.icns", +# "-n", "/usr/share/pixmaps/bootloader/rosa-media.vol", +# "-i", "/usr/share/pixmaps/bootloader/rosa.icns", "-p", self.product]) def _create_bootconfig(self): @@ -262,7 +263,7 @@ return env def __extra_filesystems(self): - return "vfat msdos isofs ext4 xfs btrfs"; + return "vfat msdos isofs ext4 xfs =fs/nls btrfs"; def __extra_drivers(self): retval = "sr_mod sd_mod ide-cd cdrom " @@ -331,8 +332,14 @@ if os.path.exists("/usr/bin/isohybrid"): if os.path.exists(isodir + "/isolinux/efiboot.img"): subprocess.call(["/usr/bin/isohybrid", "-u", "-m", iso]) + subprocess.call(["/usr/bin/rosa-image-fix-x86.pl", iso]) + logging.warn("iso hacked with x86 version of script") + else: subprocess.call(["/usr/bin/isohybrid", iso]) + subprocess.call(["/usr/bin/rosa-image-fix-x86.pl", iso]) + logging.warn("iso hacked with x86 version of script") + self.__implant_md5sum(iso) @@ -445,12 +452,12 @@ def __copy_syslinux_background(self, isodest): background_path = self._instroot + \ - "/usr/share/anaconda/boot/syslinux-vesa-splash.jpg" + "/usr/share/gfxboot/themes/Rosa-EE/splash.jpg" if not os.path.exists(background_path): # fallback to F13 location background_path = self._instroot + \ - "/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg" + "/usr/share/gfxboot/themes/Rosa-EE/splash.jpg" if not os.path.exists(background_path): return False @@ -501,30 +508,27 @@ default %(menu)s timeout %(timeout)d menu background %(background)s -menu autoboot Starting %(title)s in # second{,s}. Press any key to interrupt. +menu autoboot Starting boot from local drive in # second{,s}. Press any key to interrupt. -menu clear +#menu clear menu title %(title)s -menu vshift 8 -menu rows 18 -menu margin 8 +#menu vshift 8 +#menu rows 18 +#menu margin 8 #menu hidden -menu helpmsgrow 15 -menu tabmsgrow 13 +#menu helpmsgrow 15 +#menu tabmsgrow 13 -menu color border * #00000000 #00000000 none -menu color sel 0 #ffffffff #00000000 none -menu color title 0 #ff7ba3d0 #00000000 none -menu color tabmsg 0 #ff3a6496 #00000000 none -menu color unsel 0 #84b8ffff #00000000 none -menu color hotsel 0 #84b8ffff #00000000 none -menu color hotkey 0 #ffffffff #00000000 none -menu color help 0 #ffffffff #00000000 none -menu color scrollbar 0 #ffffffff #ff355594 none -menu color timeout 0 #ffffffff #00000000 none -menu color timeout_msg 0 #ffffffff #00000000 none -menu color cmdmark 0 #84b8ffff #00000000 none -menu color cmdline 0 #ffffffff #00000000 none +menu color border 0 #ffffffff #00000000 +menu color sel 7 #ffffffff #ff000000 +menu color title 0 #ffffffff #00000000 +menu color tabmsg 0 #ffffffff #00000000 +menu color unsel 0 #ffffffff #00000000 +menu color hotsel 0 #ff000000 #ffffffff +menu color hotkey 7 #ffffffff #ff000000 +menu color timeout_msg 0 #ffffffff #00000000 +menu color timeout 0 #ffffffff #00000000 +menu color cmdline 0 #ffffffff #00000000 menu tabmsg Press Tab for full configuration options on menu items. menu separator @@ -574,11 +578,15 @@ default = self.__is_default_kernel(kernel, kernels) if default: - long = self.product + long = "ROSA Desktop" elif kernel.startswith("kernel-"): - long = "%s (%s)" % (self.product, kernel[7:]) + long = "%s (%s)" % ("ROSA Desktop", kernel[7:]) else: - long = "%s (%s)" % (self.product, kernel) + long = "%s (%s)" % ("ROSA Desktop", kernel) + + if os.path.exists(self._instroot + "/etc/system-release"): + long = subprocess.check_output("echo -n `sed 's, release .*$,,g' /etc/system-release`", shell=True) + logging.warn('using LSB info for syslinux names') # tell dracut not to ask for LUKS passwords or activate mdraid sets if isDracut: @@ -590,31 +598,38 @@ fslabel = self.fslabel, isofstype = "auto", liveargs = kern_opts, - long = "^Start " + long, + long = "Start " + long, short = "linux" + index, - extra = "", + extra = "quiet", help = "", index = index)) + kern_opts = kernel_options + " install" - if default: - linux[-1] += " menu default\n" - - basic.append(self.__get_image_stanza(is_xen, isDracut, + linux.append(self.__get_image_stanza(is_xen, isDracut, fslabel = self.fslabel, isofstype = "auto", liveargs = kern_opts, - long = "Start " + long + " in ^basic graphics mode.", - short = "basic" + index, - extra = "nomodeset", - help = "Try this option out if you're having trouble starting.", + long = "Install " + long, + short = "linux" + index, + extra = "quiet vga=788", + help = "", index = index)) - + linux.append(self.__get_image_stanza(is_xen, isDracut, + fslabel = self.fslabel, + isofstype = "auto", + liveargs = kern_opts, + long = "Install " + long + " in basic graphics mode", + short = "basic" + index, + extra = "xdriver=vesa nokmsboot install", + help = "Try this option out if you're having trouble installing.", + index = index)) + kern_opts = kernel_options if checkisomd5: check.append(self.__get_image_stanza(is_xen, isDracut, fslabel = self.fslabel, isofstype = "auto", liveargs = kern_opts, - long = "^Test this media & start " + long, + long = "Test this media & start " + long, short = "check" + index, extra = "rd.live.check", help = "", @@ -627,14 +642,14 @@ return (linux, basic, check) def __get_memtest_stanza(self, isodir): - memtest = glob.glob(self._instroot + "/boot/memtest86*") + memtest = glob.glob(self._instroot + "/boot/memtest*") if not memtest: return "" shutil.copyfile(memtest[0], isodir + "/isolinux/memtest") return """label memtest - menu label Run a ^memory test. + menu label Run a memory test. text help If your system is having issues, an problem with your system's memory may be the cause. Use this utility to @@ -645,9 +660,15 @@ def __get_local_stanza(self, isodir): return """label local - menu label Boot from ^local drive + menu label Boot from local drive localboot 0xffff """ + def __get_grub2_stanza(self, isodir): + return """label Rescue + menu label Run super grub2 disk + kernel memdisk + append initrd=sgb.iso +""" def _configure_syslinux_bootloader(self, isodir): """configure the boot loader""" @@ -670,6 +691,7 @@ linux, basic, check = self.__get_image_stanzas(isodir) # Add linux stanzas to main menu + cfg += self.__get_local_stanza(isodir) for s in linux: cfg += s cfg += "menu separator\n" @@ -686,7 +708,7 @@ cfg += self.__get_memtest_stanza(isodir) cfg += "menu separator\n" - cfg += self.__get_local_stanza(isodir) + cfg += self.__get_grub2_stanza(isodir) cfg += self._get_isolinux_stanzas(isodir) cfg += """menu separator @@ -712,14 +734,14 @@ If any of them are missing, return False. requires: shim.efi - gcdx64.efi + grub.efi fonts/unicode.pf2 """ fail = False missing = [] - files = [("/boot/efi/EFI/*/shim.efi", "/EFI/BOOT/BOOT%s.efi" % (self.efiarch,)), - ("/boot/efi/EFI/*/gcdx64.efi", "/EFI/BOOT/grubx64.efi"), - ("/boot/efi/EFI/*/fonts/unicode.pf2", "/EFI/BOOT/fonts/"), + files = [("/boot/efi/EFI/*/grub2-efi/shim.efi", "/EFI/BOOT/BOOT%s.efi" % (self.efiarch,)), + ("/boot/efi/EFI/*/grub2-efi/grub.efi", "/EFI/BOOT/grubx64.efi"), + ("/boot/grub2/fonts/unicode.pf2", "/EFI/BOOT/fonts/"), ] makedirs(isodir+"/EFI/BOOT/fonts/") for src, dest in files: @@ -821,7 +843,7 @@ cfgf.close() # first gen mactel machines get the bootloader name wrong apparently - if rpmUtils.arch.getBaseArch() == "i386": + if getBaseArch() == "i386": os.link(isodir + "/EFI/BOOT/BOOT%s.efi" % (self.efiarch), isodir + "/EFI/BOOT/BOOT.efi") @@ -1025,7 +1047,7 @@ return ["kernel.ppc"] + \ ppcLiveImageCreator._get_excluded_packages(self) -arch = rpmUtils.arch.getBaseArch() +arch = getBaseArch() if arch in ("i386", "x86_64"): LiveImageCreator = x86LiveImageCreator elif arch in ("ppc",): diff -Nur livecd-tools-21.1.old/tools/livecd-creator livecd-tools-21.1/tools/livecd-creator --- livecd-tools-21.1.old/tools/livecd-creator 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/tools/livecd-creator 2014-05-13 14:21:03.558890314 +0400 @@ -208,7 +208,7 @@ try: creator.mount(options.base_on, options.cachedir) - creator.install() + creator.install_urpmi() creator.configure() if options.give_shell: print "Launching shell. Exit to continue." diff -Nur livecd-tools-21.1.old/tools/livecd-iso-to-disk.sh livecd-tools-21.1/tools/livecd-iso-to-disk.sh --- livecd-tools-21.1.old/tools/livecd-iso-to-disk.sh 2014-04-16 01:59:22.000000000 +0400 +++ livecd-tools-21.1/tools/livecd-iso-to-disk.sh 2014-05-13 14:25:36.776898456 +0400 @@ -402,7 +402,7 @@ if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep -m1 $dev |awk {'print $2;'})" != "*" ]; then echo "Partition isn't marked bootable!" echo "You can mark the partition as bootable with " - echo " # /sbin/parted $device" + echo " # /usr/sbin/parted $device" echo " (parted) toggle N boot" echo " (parted) quit" exitclean @@ -430,8 +430,8 @@ read umount ${device}* &> /dev/null || : wipefs -a ${device} - /sbin/parted --script $device mklabel gpt - partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:) + /usr/sbin/parted --script $device mklabel gpt + partinfo=$(LC_ALL=C /usr/sbin/parted --script -m $device "unit MB print" |grep ^$device:) dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//') p1_size=$(($dev_size - 3)) @@ -442,7 +442,7 @@ fi p1_start=1 p1_end=$(($p1_size + 1)) - /sbin/parted -s $device u MB mkpart '"EFI System Partition"' fat32 $p1_start $p1_end set 1 boot on + /usr/sbin/parted -s $device u MB mkpart '"EFI System Partition"' fat32 $p1_start $p1_end set 1 boot on # Sometimes automount can be _really_ annoying. echo "Waiting for devices to settle..." /sbin/udevadm settle @@ -462,8 +462,8 @@ read umount ${device}* &> /dev/null || : wipefs -a ${device} - /sbin/parted --script $device mklabel msdos - partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit MB print" |grep ^$device:) + /usr/sbin/parted --script $device mklabel msdos + partinfo=$(LC_ALL=C /usr/sbin/parted --script -m $device "unit MB print" |grep ^$device:) dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//') p1_size=$(($dev_size - 3)) @@ -474,7 +474,7 @@ fi p1_start=1 p1_end=$(($p1_size + 1)) - /sbin/parted -s $device u MB mkpart primary fat32 $p1_start $p1_end set 1 boot on + /usr/sbin/parted -s $device u MB mkpart primary fat32 $p1_start $p1_end set 1 boot on # Sometimes automount can be _really_ annoying. echo "Waiting for devices to settle..." /sbin/udevadm settle @@ -498,8 +498,8 @@ read umount ${device}* &> /dev/null || : wipefs -a ${device} - /sbin/parted -s $device mklabel msdos - partinfo=$(LC_ALL=C /sbin/parted -s -m $device "u MB print" |grep ^$device:) + /usr/sbin/parted -s $device mklabel msdos + partinfo=$(LC_ALL=C /usr/sbin/parted -s -m $device "u MB print" |grep ^$device:) dev_size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/MB$//') p1_size=$(($dev_size - 3)) @@ -510,7 +510,7 @@ fi p1_start=1 p1_end=$(($p1_size + 1)) - /sbin/parted -s $device u MB mkpart primary ext2 $p1_start $p1_end set 1 boot on + /usr/sbin/parted -s $device u MB mkpart primary ext2 $p1_start $p1_end set 1 boot on # Sometimes automount can be _really_ annoying. echo "Waiting for devices to settle..." /sbin/udevadm settle @@ -532,13 +532,13 @@ dev=$1 getdisk $dev - if [ "$(LC_ALL=C /sbin/parted -m $device p 2>/dev/null |grep -ic :gpt:)" -eq "0" ]; then + if [ "$(LC_ALL=C /usr/sbin/parted -m $device p 2>/dev/null |grep -ic :gpt:)" -eq "0" ]; then echo "EFI boot requires a GPT partition table." echo "This can be done manually or you can run with --format" exitclean fi - partinfo=$(LC_ALL=C /sbin/parted --script -m $device "print" |grep ^$partnum:) + partinfo=$(LC_ALL=C /usr/sbin/parted --script -m $device "print" |grep ^$partnum:) volname=$(echo $partinfo |cut -d : -f 6) flags=$(echo $partinfo |cut -d : -f 7) if [ "$volname" != "EFI System Partition" ]; then @@ -549,7 +549,7 @@ if [ "$(echo $flags |grep -c boot)" = "0" ]; then echo "Partition isn't marked bootable!" echo "You can mark the partition as bootable with " - echo " # /sbin/parted $device" + echo " # /usr/sbin/parted $device" echo " (parted) toggle N boot" echo " (parted) quit" exitclean