updated patches, added some red specific patches

This commit is contained in:
Alex Burmashev 2014-01-21 19:40:34 +04:00
parent af634de6d9
commit cc66b378cb
6 changed files with 86 additions and 47 deletions

View file

@ -1,20 +1,25 @@
diff -Nur livecd-tools-18.8.old/imgcreate/live.py livecd-tools-18.8/imgcreate/live.py
--- livecd-tools-18.8.old/imgcreate/live.py 2014-01-14 19:35:52.000000000 +0400
+++ livecd-tools-18.8/imgcreate/live.py 2014-01-14 19:42:22.603447886 +0400
@@ -325,6 +325,7 @@
--- livecd-tools-18.8.old/imgcreate/live.py 2014-01-21 16:45:02.415346403 +0400
+++ livecd-tools-18.8/imgcreate/live.py 2014-01-21 16:45:58.075348061 +0400
@@ -323,8 +323,12 @@
if os.path.exists("/usr/bin/isohybrid"):
if os.path.exists(isodir + "/isolinux/efiboot.img"):
subprocess.call(["/usr/bin/isohybrid", "-u", 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.pl", iso])
+ subprocess.call(["/usr/bin/rosa-image-fix-x86.pl", iso])
+ logging.warn("iso hacked with x86 version of script")
self.__implant_md5sum(iso)
@@ -337,7 +338,7 @@
else:
logging.warn("isomd5sum not installed; not setting up mediacheck")
return
-
+
subprocess.call([implantisomd5, iso])
@@ -671,7 +675,7 @@
return """label local
menu label Boot from local drive
menu default
- localboot 0x80
+ localboot 0xffff
"""
def _stage_final_image(self):
def __get_grub2_stanza(self, isodir):

View file

@ -0,0 +1,16 @@
diff -Nur livecd-tools-18.8.old/imgcreate/live.py livecd-tools-18.8/imgcreate/live.py
--- livecd-tools-18.8.old/imgcreate/live.py 2014-01-21 19:36:40.000000000 +0400
+++ livecd-tools-18.8/imgcreate/live.py 2014-01-21 19:38:29.961481813 +0400
@@ -114,9 +114,9 @@
"""
r = kickstart.get_kernel_args(self.ks)
if os.path.exists(self._instroot + "/usr/bin/rhgb"):
- r += " rhgb splash=silent logo.nologo"
- if os.path.exists(self._instroot + "/usr/bin/plymouth"):
- r += " rhgb splash=silent logo.nologo"
+ r += " rhgb splash=silent logo.nologo quiet"
+ if os.path.exists(self._instroot + "/bin/plymouth"):
+ r += " rhgb splash=silent logo.nologo quiet"
return r
def _get_mkisofs_options(self, isodir):

View file

@ -5,7 +5,7 @@
Summary: Tools for building live CDs
Name: livecd-tools
Version: 18.8
Release: 40
Release: 45
Epoch: 1
License: GPLv2
Group: System/Base
@ -17,7 +17,7 @@ URL: http://git.fedorahosted.org/git/livecd
# scp livecd*.tar.bz2 fedorahosted.org:livecd
Source0: http://fedorahosted.org/releases/l/i/livecd/%{name}-%{version}.tar.bz2
Source1: arch.py
Source2: rosa-image-fix.pl
Source3: rosa-image-fix-x86.pl
Patch0: livecd-tools-18.8.urpmi.rosa.patch
Patch1: livecd-tools-18.8.noyum.patch
Patch2: livecd-tools-18.8.more.fixes.patch
@ -35,6 +35,7 @@ Patch13: livecd-tools-18.8.fustunsafe.patch
Patch14: livecd-tools-18.8.debug.patch
Patch15: livecd-tools-18.8.hackfs.patch
Patch16: livecd-tools-18.8.splash.red.patch
Patch17: livecd-tools-18.8.plymouth.red.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: python-imgcreate = %{epoch}:%{version}-%{release}
@ -100,6 +101,7 @@ like live image or appliances.
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%build
make
@ -108,7 +110,8 @@ make
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%__install -m 0644 %{SOURCE1} %{buildroot}%{python_sitelib}/imgcreate/
%__install -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/
%__install -m 0755 %{SOURCE3} %{buildroot}%{_bindir}/
%clean
rm -rf $RPM_BUILD_ROOT
@ -125,7 +128,7 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/liveimage-mount
%{_bindir}/edit-livecd
%{_bindir}/mkbiarch
%{_bindir}/rosa-image-fix.pl
%{_bindir}/rosa-image-fix-x86.pl
/usr/share/doc/livecd-tools*
%files -n python-imgcreate

46
rosa-image-fix-x86.pl Executable file
View file

@ -0,0 +1,46 @@
#!/usr/bin/perl
use strict;
use warnings;
use Fcntl ':seek';
if (scalar(@ARGV) < 1) {
print "Usage: $0 iso-image-file\n";
exit;
}
my $filename = $ARGV[0];
my $file;
open($file, '+<', $filename) or die "Failed to open file $filename for read-write: $!";
binmode($file);
# Read the first sector (512 bytes) containing the MBR
my $mbr;
read($file, $mbr, 512) or die "Failed to read the MBR sector: $!";
# Extract the second partition record from the MBR (except for the "bootable" flag)
my $partition2 = substr($mbr, 463, 15);
# In 32-bit images we don't have the second partition (EFI), so here we'll create
# a fake partition without actual file system.
if ($partition2 eq ("\x00" x 15)) {
# Partition recod
$partition2 = "\x00\x02\x00" . # CHS: first sector = 2
"\xDA" . # partition type: non-filesystem data
"\x00\x02\x00" . # CHS: last sector = 2
"\x01\x00\x00\x00" . # LBA: first sector = 1
"\x01\x00\x00\x00"; # LBA: number of sectors = 1
}
# Now write back the desired partition table into MBR.
# The partition table starts at offset 446 and contains 4 records 16 bytes each. What we do:
# 1) Replace the first record with the second one (real or faked for 32-bit images);
# 2) Replace the first byte of the resulting first record with 0x80 (mark partition as active);
# 3) Delete the second partition by zeroing its contents.
substr($mbr, 446, 32) = "\x80" . $partition2 . ("\x00" x 16);
# Write the updated MBR back
seek($file, 0, SEEK_SET) or die "Failed to position at the beginning of the file: $!";
print $file $mbr;
close($file);

View file

@ -1,31 +0,0 @@
#!/usr/bin/perl
use strict;
use warnings;
use Fcntl ':seek';
if (scalar(@ARGV) < 1) {
print "Usage: $0 iso-image-file\n";
exit;
}
my $filename = $ARGV[0];
my $file;
open($file, '+<', $filename) or die "Failed to open file $filename for read-write: $!";
binmode($file);
# Read the first sector (512 bytes) containing the MBR
my $mbr;
read($file, $mbr, 512) or die "Failed to read the MBR sector: $!";
# The partition table starts at offset 446 and contains 4 records 16 bytes each. What we do:
# 1) Replace the first record with the second one;
# 2) Replace the first byte of teh resulting first record with 0x80 (active partition);
# 3) Delete the second partition by zeroing its contents.
substr($mbr, 446, 32) = "\x80" . substr($mbr, 463, 15) . ("\0" x 16);
# Write the updated MBR back
seek($file, 0, SEEK_SET) or die "Failed to position at the beginning of the file: $!";
print $file $mbr;
close($file);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB