[-]
[+]
|
Changed |
kiwi.changes
|
|
[-]
[+]
|
Changed |
kiwi.spec
^
|
|
[-]
[+]
|
Changed |
_link
^
|
@@ -1,4 +1,4 @@
-<link project="openSUSE.org:Virtualization:Appliances" package="kiwi" baserev="4407e661481b17db223c72dd69d1642c">
+<link project="openSUSE.org:Virtualization:Appliances" package="kiwi" baserev="fc9a513b6a1cd06b4d478a9ef2df9356">
<patches>
<branch/>
</patches>
|
|
Changed |
kiwi-docu.tar.bz2
^
|
|
Changed |
kiwi-repo.tar.bz2
^
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/.revision
^
|
@@ -1 +1 @@
-ebd8893921c64778cfbbfc49f1a949aeeb024ac7
+a5383995be60605e247a6c829f7bfef791130471
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/Makefile
^
|
@@ -48,6 +48,7 @@
# build tools
#--------------------------------------------
${MAKE} -C tools all
+ ${MAKE} -C locale all
#============================================
# install .revision file
|
[-]
[+]
|
Deleted |
kiwi.tar.bz2/README
^
|
@@ -1,44 +0,0 @@
-KIWI
-====
-
-The openSUSE KIWI Image System provides a complete operating
-system image solution for Linux supported hardware platforms as
-well as for virtualization systems like Xen, VMware, etc. The KIWI
-architecture was designed as a two level system. The first stage,
-based on a valid software package source, creates a so called
-unpacked image according to the provided image description.
-The second stage creates from a required unpacked image an
-operating system image. The result of the second stage is called
-a packed image or short an image.
-
-Installation
-------------
-
-packages for kiwi are provided at the openSUSE buildservice:
-http://download.opensuse.org/repositories/Virtualization:/Appliances/
-
-Usage
------
-
-* make sure you have the kiwi-templates package installed
-* build a live ISO example:
-
- kiwi --build suse-XXX-JeOS -d /tmp/myimage --type iso
-
-* run your OS in a VM like kvm
-
- kvm -cdrom /tmp/myimage/*.iso
-
-Contributing
-------------
-
-1. Fork it.
-2. Create a branch (`git checkout -b my_kiwi`)
-3. Commit your changes (`git commit -am "Added Snarkdown"`)
-4. Push to the branch (`git push origin my_kiwi`)
-5. Create an [Issue][1] with a link to your branch
-6. Enjoy a refreshing Diet Coke and wait
-
-also see the git-review gem
-
-Remember to have fun :)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/README.mkd
^
|
@@ -0,0 +1,54 @@
+KIWI
+====
+
+Introduction
+------------
+
+The openSUSE KIWI Image System provides a complete operating
+system image solution for Linux supported hardware platforms as
+well as for virtualization systems like Xen, VMware, etc. The KIWI
+architecture was designed as a two level system. The first stage,
+based on a valid software package source, creates a so called
+unpacked image according to the provided image description.
+The second stage creates from a required unpacked image an
+operating system image. The result of the second stage is called
+a packed image or short an image.
+
+Installation
+------------
+
+packages for kiwi are provided at the openSUSE buildservice:
+http://download.opensuse.org/repositories/Virtualization:/Appliances/
+
+Usage
+-----
+
+1. make sure you have the kiwi-templates package installed
+2. build a live ISO example:
+
+```kiwi --build suse-XXX-JeOS -d /tmp/myimage --type iso
+```
+
+3. run your OS in a VM like kvm
+
+```kvm -cdrom /tmp/myimage/*.iso
+```
+
+Mailing list
+------------
+
+* http://groups.google.com/group/kiwi-images
+
+Contributing
+------------
+
+1. Fork it.
+2. Create a branch (`git checkout -b my_kiwi`)
+3. Commit your changes (`git commit -am "Added Snarkdown"`)
+4. Push to the branch (`git push origin my_kiwi`)
+5. Create an [Issue][1] with a link to your branch
+6. Enjoy a refreshing Diet Coke and wait
+
+also see the git-review gem
+
+Remember to have fun :)
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/kiwi.pl
^
|
@@ -138,6 +138,7 @@
my $imageTarget = $cmdL -> getImageTargetDir();
my $rootTarget = $imageTarget.'/build/image-root';
$cmdL -> setRootTargetDir ($rootTarget);
+ $cmdL -> setOperationMode ("prepare", $cmdL->getConfigDir());
$cmdL -> setForceNewRoot (1);
mkdir $imageTarget;
$kic = new KIWIImageCreator ($kiwi, $cmdL);
@@ -148,6 +149,7 @@
# Setup create
#------------------------------------------
$cmdL -> setConfigDir ($rootTarget);
+ $cmdL -> setOperationMode ("create",$rootTarget);
$cmdL -> setForceNewRoot (0);
$kic -> initialize();
if (! $kic -> createImage ($kiwi,$cmdL)) {
@@ -657,6 +659,7 @@
my $GrubChainload; # install grub loader in first partition not MBR
my $FatStorage; # size of fat partition if syslinux is used
my $DiskStartSector; # location of start sector (default is 32)
+ my $EditBootConfig; # allow to run script before bootloader install
my $PackageManager; # package manager to use
my $Version; # version information
#==========================================
@@ -706,6 +709,7 @@
"fs-inodesize=i" => \$FSInodeSize,
"fs-journalsize=i" => \$FSJournalSize,
"fs-max-mount-count=i" => \$FSMaxMountCount,
+ "edit-bootconfig=s" => \$EditBootConfig,
"grub-chainload" => \$GrubChainload,
"gzip-cmd=s" => \$GzipCmd,
"help|h" => \$Help,
@@ -777,6 +781,12 @@
\@Exclude,\@Skip,$MigrateNoFiles,$MigrateNoTemplate
);
#========================================
+ # check if edit-bootconfig option is set
+ #----------------------------------------
+ if (defined $EditBootConfig) {
+ $cmdL -> setEditBootConfig ($EditBootConfig);
+ }
+ #========================================
# check if fat-storage option is set
#----------------------------------------
if (defined $FatStorage) {
@@ -1041,6 +1051,18 @@
}
$Build =~ s/\/$//;
}
+ if (defined $InitCache) {
+ if (($InitCache !~ /^\//) && (! -d $InitCache)) {
+ $InitCache = $gdata->{System}."/".$InitCache;
+ }
+ $InitCache =~ s/\/$//;
+ }
+ if (defined $ListXMLInfo) {
+ if (($ListXMLInfo !~ /^\//) && (! -d $ListXMLInfo)) {
+ $ListXMLInfo = $gdata->{System}."/".$ListXMLInfo;
+ }
+ $ListXMLInfo =~ s/\/$//;
+ }
#========================================
# store uniq path to image description
#----------------------------------------
@@ -1214,6 +1236,11 @@
$cmdL -> setLogFile ("terminal");
$kiwi -> done ();
}
+ if (($EditBootConfig) && (! -e $EditBootConfig)) {
+ $kiwi -> error ("Boot config script $EditBootConfig doesn't exist");
+ $kiwi -> failed ();
+ kiwiExit (1);
+ }
if (($targetDevice) && (! -b $targetDevice)) {
$kiwi -> error ("Target device $targetDevice doesn't exist");
$kiwi -> failed ();
@@ -1309,7 +1336,7 @@
print " kiwi --installstick <initrd>\n";
print " [ --installstick-system <vmx-system-image> ]\n";
print "Image format conversion:\n";
- print " kiwi --convert <systemImage> [ --format <vmdk|ovf|qcow2> ]\n";
+ print " kiwi --convert <systemImage> [ --format <vmdk|ovf|qcow2|..> ]\n";
print "Helper Tools:\n";
print " kiwi --createpassword\n";
print " kiwi --createhash <image-path>\n";
@@ -1498,7 +1525,7 @@
"$system/$image"
);
if ($controlFile) {
- $kiwi -> info ($image);
+ $kiwi -> info ("* \033[1;32m".$image."\033[m\017\n");
my $xml = new KIWIXML (
$kiwi,$system."/".$image,undef,undef,$cmdL
);
@@ -1506,7 +1533,7 @@
next;
}
my $version = $xml -> getImageVersion();
- $kiwi -> note (" -> Version: $version");
+ $kiwi -> info ("Version: $version");
$kiwi -> done();
}
}
@@ -1649,13 +1676,6 @@
# private Exit function, exit safely
# ---
my $code = $_[0];
- my $gdata= $global -> getGlobals();
- #==========================================
- # Write temporary XML changes to logfile
- #------------------------------------------
- if (defined $kiwi) {
- $kiwi -> writeXML ($gdata->{Pretty});
- }
#==========================================
# Create log object if we don't have one...
#------------------------------------------
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/ar/LC_MESSAGES/kiwi.po
^
|
@@ -8,6 +8,7 @@
"PO-Revision-Date: 2009-09-24 11:55\n"
"Last-Translator: Novell Language <language@novell.com>\n"
"Language-Team: Novell Language <language@novell.com>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/cs/LC_MESSAGES/kiwi.po
^
|
@@ -5,6 +5,7 @@
"PO-Revision-Date: 2005-07-31 14:37+0200\n"
"Last-Translator: Klara Cihlarova <koty@seznam.cz>\n"
"Language-Team: Czech <cs@li.org>\n"
+"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/de/LC_MESSAGES/kiwi.po
^
|
@@ -6,6 +6,7 @@
"PO-Revision-Date: 2009-10-19 21:48+0200\n"
"Last-Translator: Hermann-Josef Beckers <hj.beckers@onlinehome.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
+"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -23,11 +24,9 @@
msgid "Do you accept the license agreement ?"
msgstr "Akzeptieren Sie die Lizenzvereinbarung?"
-# power-off message
msgid "Do you want to start the System-Recovery ?"
msgstr "Möchten Sie die System-Wiederherstellung nun starten?"
-# power-off message
msgid "Do you want to start the System-Restore ?"
msgstr "Möchten Sie die System-Zurücksicherug nun starten?"
@@ -38,7 +37,7 @@
msgstr "Alle Daten auf %1 werden gelöscht, weitermachen?"
msgid "Clean sweep..."
-msgstr "Bereinigung ..."
+msgstr "Bereinigung..."
msgid "%1 files from %2 restored..."
msgstr "%1 Dateien von %2 zurückgesichert ..."
@@ -46,13 +45,11 @@
msgid "backing up: %1..."
msgstr "Sicherung: %1 ..."
-#, fuzzy
msgid "archiving: %1..."
-msgstr "Sicherung: %1 ..."
+msgstr "Archivierung: %1 ..."
-#, fuzzy
msgid "restoring: %1..."
-msgstr "Sicherung: %1 ..."
+msgstr "Wiederherstellung: %1 ..."
msgid "Yes"
msgstr "Ja"
@@ -63,7 +60,6 @@
msgid "OK"
msgstr "OK"
-# cancel button label
msgid "Cancel"
msgstr "Verwerfen"
@@ -71,30 +67,29 @@
msgstr "Exit"
msgid "Please remove the CD/DVD before reboot"
-msgstr ""
+msgstr "Bitte entfernen Sie die CD/DVD vor dem Neustart"
msgid "Please unplug the USB stick before reboot"
-msgstr ""
+msgstr "Bitte entnehmen Sie den USB Stick vor dem Neustart"
-#, fuzzy
msgid "Installation..."
-msgstr "Installation"
+msgstr "Installation..."
-#, fuzzy
msgid "Loading %1"
-msgstr "Fehler beim Laden von %1"
+msgstr "Lade %1"
msgid "Verifying %1"
-msgstr ""
+msgstr "Prüfe %1"
msgid "Select disk for installation:"
-msgstr ""
+msgstr "Festplattenauswahl"
msgid "Select %1 partition for installation:"
-msgstr ""
+msgstr "Auswahl der %1 Partition für die Installation:"
msgid "System will be shutdown. Remove USB stick before power on"
msgstr ""
+"System wird heruntergefahren, bitte Stick entnehmen vor dem Einschalten"
msgid "Please remove the CD/DVD before shutdown"
-msgstr ""
+msgstr "Bitte entfernen Sie die CD/DVD vor dem Herunterfahren"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/el/LC_MESSAGES/kiwi.po
^
|
@@ -5,6 +5,7 @@
"PO-Revision-Date: 2005-08-24 17:53+0300\n"
"Last-Translator: Hellenic SuSE Translation Team <hstg@billg.gr>\n"
"Language-Team: Hellenic-Ελληνικά-Greek <hstg@billg.gr>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/es/LC_MESSAGES/kiwi.po
^
|
@@ -13,6 +13,7 @@
"PO-Revision-Date: 2010-04-12 13:03-0600\n"
"Last-Translator: Alex Rodriguez <alexio44@opensuse.org.ni>\n"
"Language-Team: Spanish <opensuse-translation-es@opensuse.org>\n"
+"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/fi/LC_MESSAGES/kiwi.po
^
|
@@ -10,6 +10,7 @@
"PO-Revision-Date: 2010-04-20 22:59+0300\n"
"Last-Translator: Jyri Palokangas <jmp@opensuse.org>\n"
"Language-Team: TRANSLATIONS <kde-i18n-doc@kde.org>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/fr/LC_MESSAGES/kiwi.po
^
|
@@ -6,6 +6,7 @@
"PO-Revision-Date: 2010-05-02 18:55+0100\n"
"Last-Translator: Guillaume GARDET <guillaume.gadret@opensuse.org>\n"
"Language-Team: French <opensuse-fr@opensuse.org>\n"
+"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/hu/LC_MESSAGES/kiwi.po
^
|
@@ -10,10 +10,10 @@
"PO-Revision-Date: 2010-04-04 14:49+0200\n"
"Last-Translator: kalman <kkemenczy@gmail.com>\n"
"Language-Team: Hungarian <kde-i18n-doc@kde.org>\n"
+"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: hu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Pootle 2.0.2\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/it/LC_MESSAGES/kiwi.po
^
|
@@ -5,6 +5,7 @@
"PO-Revision-Date: 2010-04-08 12:19+0100\n"
"Last-Translator: Andrea Florio <andrea@opensuse.org>\n"
"Language-Team: Novell Language <language@novell.com>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/ja/LC_MESSAGES/kiwi.po
^
|
@@ -7,6 +7,7 @@
"PO-Revision-Date: 2010-04-11 09:34+0900\n"
"Last-Translator: Yasuhiko Kamata <belphegor@belbel.or.jp>\n"
"Language-Team: Japanese <opensuse-ja@opensuse.org>\n"
+"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/ko/LC_MESSAGES/kiwi.po
^
|
@@ -5,6 +5,7 @@
"PO-Revision-Date: 2010-04-07 11:12+0900\n"
"Last-Translator: Yunseok Choi <xein@naver.com>\n"
"Language-Team: Korean <xein@naver.com>\n"
+"Language: ko\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/nl/LC_MESSAGES/kiwi.po
^
|
@@ -12,6 +12,7 @@
"PO-Revision-Date: 2010-04-07 09:01+0200\n"
"Last-Translator: Freek de Kruijf <freek@opensuse.org>\n"
"Language-Team: Dutch <yast-nl-l10n@lists.sf.kovoks.nl>\n"
+"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/pl/LC_MESSAGES/kiwi.po
^
|
@@ -11,6 +11,7 @@
"PO-Revision-Date: 2010-04-29 10:57+0100\n"
"Last-Translator: Mirek Rogoziński <miroslaw.rogozinski@opensuse.biz>\n"
"Language-Team: <pl@li.org>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/pt_BR/LC_MESSAGES/kiwi.po
^
|
@@ -11,6 +11,7 @@
"PO-Revision-Date: 2010-05-05 18:13-0300\n"
"Last-Translator: Isis Binder <isis.binder@gmail.com>\n"
"Language-Team: Novell Language <language@novell.com>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/ru/LC_MESSAGES/kiwi.po
^
|
@@ -6,11 +6,12 @@
"PO-Revision-Date: 2010-04-10 20:32+0300\n"
"Last-Translator: Alexander Melentyev <alex239@gmail.com>\n"
"Language-Team: Russian <opensuse-translation-ru@opensuse.org>\n"
+"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
-"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.0\n"
#. /.../
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/sv/LC_MESSAGES/kiwi.po
^
|
@@ -11,6 +11,7 @@
"PO-Revision-Date: 2005-09-18 19:09+0200\n"
"Last-Translator: Mattias Newzella <newzella@linux.se>\n"
"Language-Team: Swedish <sv@li.org>\n"
+"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/tr/LC_MESSAGES/kiwi.po
^
|
@@ -8,6 +8,7 @@
"PO-Revision-Date: 2009-09-24 12:27\n"
"Last-Translator: Novell Language <language@novell.com>\n"
"Language-Team: Novell Language <language@novell.com>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/uk/LC_MESSAGES/kiwi.po
^
|
@@ -13,12 +13,13 @@
"PO-Revision-Date: 2010-04-26 22:19-0700\n"
"Last-Translator: I. Petrouchtchak <ivanpetrouchtchak@yahoo.com>\n"
"Language-Team: Ukrainian <kde-i18n-doc@kde.org>\n"
+"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 1.0\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
-"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#. /.../
#. Copyright (c) 2005 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/zh_CN/LC_MESSAGES/kiwi.po
^
|
@@ -11,6 +11,7 @@
"PO-Revision-Date: 2005-03-09 13:54+0100\n"
"Last-Translator: Novell Language <language@novell.com>\n"
"Language-Team: Novell Language <language@novell.com>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/locale/zh_TW/LC_MESSAGES/kiwi.po
^
|
@@ -12,6 +12,7 @@
"PO-Revision-Date: 2009-10-22 23:47+0800\n"
"Last-Translator: swyear <swyear@gmail.com>\n"
"Language-Team: Chinese Traditional <zh@li.org>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIBoot.pm
^
|
@@ -119,7 +119,7 @@
if (defined $system) {
if ((-f $system) || (-b $system)) {
my %fsattr = $main::global -> checkFileSystem ($system);
- if ($fsattr{readonly}) {
+ if (($fsattr{readonly}) || ($fsattr{type} eq "luks")) {
$syszip = $main::global -> isize ($system);
} else {
$syszip = 0;
@@ -279,7 +279,7 @@
#==========================================
# check for activated volume group
#------------------------------------------
- $sdev = $this -> checkLVMbind ($sdev);
+ $sdev = $this -> checkLVMbind ($sdev,$this->{loop});
#==========================================
# perform mount call
#------------------------------------------
@@ -385,8 +385,8 @@
my $sizeBytes;
my $minInodes;
my $sizeXMLBytes = 0;
- my $spare = 1.5;
- my $journal = 12 * 1024 * 1024;
+ my $spare = 100 * 1024 * 1024; # 100M free
+ my $fsoverhead = 1.4;
my $fsopts = $cmdL -> getFilesystemOptions();
my $inodesize = $fsopts->[1];
my $inoderatio = $fsopts->[2];
@@ -399,20 +399,20 @@
# System is specified as a directory...
$minInodes = qxx ("find $system | wc -l");
$sizeBytes = qxx ("du -s --block-size=1 $system | cut -f1");
+ $sizeBytes*= $fsoverhead;
chomp $minInodes;
chomp $sizeBytes;
$minInodes*= 2;
$sizeBytes+= $minInodes * $inodesize;
- $sizeBytes*= $spare;
- $sizeBytes+= $journal;
$sizeBytes+= $kernelSize;
- $sizeBytes+= ($initrdSize * 1.5);
+ $sizeBytes+= $initrdSize;
+ $sizeBytes+= $spare;
} else {
# system is specified as a file...
$sizeBytes = $main::global -> isize ($system);
$sizeBytes+= $kernelSize;
- $sizeBytes+= ($initrdSize * 1.5);
- $sizeBytes*= 1.1;
+ $sizeBytes+= $initrdSize;
+ $sizeBytes+= $spare;
}
#==========================================
# Store optional size setup from XML
@@ -784,7 +784,7 @@
#==========================================
# check for activated volume group
#------------------------------------------
- $sdev = $this -> checkLVMbind ($sdev);
+ $sdev = $this -> checkLVMbind ($sdev,$this->{loop});
#==========================================
# perform mount call
#------------------------------------------
@@ -921,7 +921,7 @@
$kiwi -> failed ();
return undef;
}
- print FD "IMAGE=$namecd\n";
+ print FD "IMAGE='".$namecd."'\n";
close FD;
$kiwi -> info ("Importing system image: $system");
$status = qxx ("mv $system $tmpdir 2>&1");
@@ -950,7 +950,8 @@
if ($bootloader eq "grub") {
# let isolinux run grub second stage...
$base = "-R -J -f -b boot/grub/stage2 -no-emul-boot $volid";
- $opts = "-boot-load-size 4 -boot-info-table -udf -allow-limited-size";
+ $opts = "-boot-load-size 4 -boot-info-table -udf -allow-limited-size ";
+ $opts.= "-pad -joliet-long";
} elsif ($bootloader =~ /(sys|ext)linux/) {
# turn sys/extlinux configuation into a isolinux configuration...
my $cfg_ext = "$tmpdir/boot/syslinux/syslinux.cfg";
@@ -963,10 +964,11 @@
qxx ("mv $tmpdir/boot/linux $tmpdir/boot/syslinux");
qxx ("mv $tmpdir/boot/syslinux $tmpdir/boot/loader 2>&1");
$base = "-R -J -f -b boot/loader/isolinux.bin -no-emul-boot $volid";
- $opts = "-boot-load-size 4 -boot-info-table -udf -allow-limited-size";
+ $opts = "-boot-load-size 4 -boot-info-table -udf -allow-limited-size ";
+ $opts.= "-pad -joliet-long";
} elsif ($bootloader eq "lilo") {
$base = "-r";
- $opts = "-U -chrp-boot";
+ $opts = "-U -chrp-boot -pad -joliet-long";
} else {
# don't know how to use this bootloader together with isolinux
$kiwi -> failed ();
@@ -979,7 +981,7 @@
$name = $wdir."/".$name;
}
my $iso = new KIWIIsoLinux (
- $kiwi,$tmpdir,$name,undef,"checkmedia"
+ $kiwi,$tmpdir,$name,undef,"checkmedia",$this->{cmdL}
);
if (! defined $iso) {
return undef;
@@ -1149,7 +1151,7 @@
#==========================================
# check for activated volume group
#------------------------------------------
- $sdev = $this -> checkLVMbind ($sdev);
+ $sdev = $this -> checkLVMbind ($sdev,$this->{loop});
#==========================================
# perform mount call
#------------------------------------------
@@ -1487,7 +1489,7 @@
$this -> cleanLoop ();
return undef;
}
- print FD "IMAGE=$nameusb\n";
+ print FD "IMAGE='".$nameusb."'\n";
close FD;
$main::global -> umount();
$kiwi -> done();
@@ -1734,6 +1736,7 @@
"Adding $splitMB MB space for split read-write portion"
);
$this -> __updateDiskSize ($splitMB);
+ $kiwi -> done();
}
#==========================================
# obtain filesystem type from xml data
@@ -1809,14 +1812,18 @@
#------------------------------------------
my $dmap; # device map
my $root; # root device
+ if (! defined $system) {
+ $kiwi -> error ("No system image given");
+ $kiwi -> failed ();
+ return undef;
+ }
+ if (! $haveDiskDevice) {
+ $kiwi -> info ("Creating virtual disk...");
+ } else {
+ $kiwi -> info ("Using disk device $haveDiskDevice...");
+ }
while (1) {
- if (! defined $system) {
- $kiwi -> error ("No system image given");
- $kiwi -> failed ();
- return undef;
- }
if (! $haveDiskDevice) {
- $kiwi -> info ("Creating virtual disk...");
$status = qxx ("qemu-img create $diskname $this->{vmsize} 2>&1");
$result = $? >> 8;
if ($result != 0) {
@@ -1832,7 +1839,6 @@
return undef;
}
} else {
- $kiwi -> info ("Using disk device $haveDiskDevice...");
# /.../
# the following is required for suse studio to determine the
# size of the image target disk. It has no relevance for the
@@ -2160,23 +2166,47 @@
#------------------------------------------
if (($lvm) && (%lvmparts)) {
my $VGroup = $this->{lvmgroup};
+ my @paths = ();
+ my %phash = ();
+ #==========================================
+ # Create path names in correct order
+ #------------------------------------------
+ sub numeric {
+ ($a <=> $b) || ($a cmp $b);
+ }
foreach my $name (keys %lvmparts) {
- my $device = "/dev/$VGroup/LV$name";
my $pname = $name; $pname =~ s/_/\//g;
- $status = qxx ("mkdir -p $loopdir/$pname 2>&1");
- $result = $? >> 8;
- if ($result != 0) {
- $kiwi -> error ("Can't create mount point $loopdir/$pname");
- $this -> cleanLoop ();
- return undef;
- }
- if (! $this -> setupFilesystem ($FSTypeRO,$device,$pname)) {
- $this -> cleanLoop ();
- return undef;
- }
- if (! $main::global -> mount ($device, "$loopdir/$pname")) {
- $this -> cleanLoop ();
- return undef;
+ $pname =~ s/^\///;
+ $pname =~ s/\s*$//;
+ push @paths,$pname;
+ }
+ foreach my $name (@paths) {
+ my $part = split (/\//,$name);
+ push @{$phash{$part}},$name;
+ }
+ #==========================================
+ # Create filesystems and Mount LVM volumes
+ #------------------------------------------
+ foreach my $level (sort numeric keys %phash) {
+ foreach my $pname (@{$phash{$level}}) {
+ my $lname = $pname; $lname =~ s/\//_/g;
+ my $device = "/dev/$VGroup/LV$lname";
+ $status = qxx ("mkdir -p $loopdir/$pname 2>&1");
+ $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> error ("Can't create mount point $loopdir/$pname");
+ $this -> cleanLoop ();
+ return undef;
+ }
+ if (! $this -> setupFilesystem ($FSTypeRO,$device,$pname)) {
+ $this -> cleanLoop ();
+ return undef;
+ }
+ $kiwi -> loginfo ("Mounting logical volume: $pname\n");
+ if (! $main::global -> mount ($device, "$loopdir/$pname")) {
+ $this -> cleanLoop ();
+ return undef;
+ }
}
}
}
@@ -2184,9 +2214,7 @@
# Copy root tree to disk
#------------------------------------------
$kiwi -> info ("Copying system image tree on disk");
- $status = qxx (
- "tar --one-file-system -cf - -C $system . | tar -x -C $loopdir 2>&1"
- );
+ $status = qxx ("rsync -aHXA --one-file-system $system/ $loopdir 2>&1");
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
@@ -2289,7 +2317,7 @@
($lvm) || ($bootloader eq "extlinux")
) {
$root = $deviceMap{dmapper};
- $kiwi -> info ("Creating ext2 boot filesystem");
+ $kiwi -> info ("Creating ext3 boot filesystem");
if (($haveluks) || ($needBootP)) {
if (($syszip) || ($haveSplit) || ($dmapper)) {
$root = $deviceMap{3};
@@ -2306,8 +2334,8 @@
my %FSopts = $main::global -> checkFSOptions(
@{$cmdL -> getFilesystemOptions()}
);
- my $fsopts = $FSopts{ext2};
- my $fstool = "mkfs.ext2";
+ my $fsopts = $FSopts{ext3};
+ my $fstool = "mkfs.ext3";
$status = qxx ("$fstool $fsopts $root 2>&1");
$result = $? >> 8;
if ($result != 0) {
@@ -2495,12 +2523,13 @@
my $kiwi = $this->{kiwi};
my $initrd = $this->{initrd};
my $system = $this->{system};
- my $irddir = $initrd."_".$$.".vmxsystem";
my $xml = $this->{xml};
my $zipper = $this->{gdata}->{Gzip};
my $newird;
- if (! mkdir $irddir) {
- $kiwi -> error ("Failed to create vmxsystem directory");
+ my $irddir = qxx ("mktemp -q -d /tmp/kiwiird.XXXXXX"); chomp $irddir;
+ my $result = $? >> 8;
+ if ($result != 0) {
+ $kiwi -> error ("Couldn't create tmp dir: $irddir: $!");
$kiwi -> failed ();
return undef;
}
@@ -2509,7 +2538,7 @@
#------------------------------------------
my $unzip = "$this->{gdata}->{Gzip} -cd $initrd 2>&1";
my $status = qxx ("$unzip | (cd $irddir && cpio -di 2>&1)");
- my $result = $? >> 8;
+ $result = $? >> 8;
if ($result != 0) {
$kiwi -> error ("Failed to extract initrd data: $!");
$kiwi -> failed ();
@@ -2542,7 +2571,7 @@
qxx ("rm -rf $irddir");
return undef;
}
- print FD "IMAGE=$namecd\n";
+ print FD "IMAGE='".$namecd."'\n";
close FD;
}
#==========================================
@@ -2690,7 +2719,7 @@
$main::global -> umount();
if ((defined $loop) && ($loop =~ /loop/)) {
if (defined $lvm) {
- qxx ("vgchange -an $this->{lvmgroup} 2>&1");
+ qxx ("vgchange -an 2>&1");
}
$this -> cleanLoopMaps();
qxx ("/sbin/losetup -d $loop 2>&1");
@@ -2806,8 +2835,7 @@
#------------------------------------------
if ($loader eq "grub") {
my $stages = "'usr/lib/grub/*'";
- my $message= "'image/loader/message'";
- my $gbinary= "'usr/sbin/grub'";
+ my $figure = "'image/loader/message'";
my $unzip = "$zipper -cd $initrd 2>&1";
$status = qxx ( "mkdir -p $tmpdir/boot/grub 2>&1" );
$result = $? >> 8;
@@ -2818,50 +2846,28 @@
return undef;
}
#==========================================
- # Get Grub binary from initrd
- #------------------------------------------
- $kiwi -> info ("Importing grub binary");
- if ($zipped) {
- $status= qxx ("$unzip | (cd $tmpdir && cpio -di $gbinary 2>&1)");
- } else {
- $status= qxx ("cat $initrd|(cd $tmpdir && cpio -di $gbinary 2>&1)");
- }
- if (! -e $tmpdir."/usr/sbin/grub" ) {
- $kiwi -> failed ();
- $kiwi -> error ("No grub bootloader found in initrd: $status");
- $kiwi -> failed ();
- return undef;
- }
- $kiwi -> done ();
- #==========================================
# Get Grub graphics boot message
#------------------------------------------
- $kiwi -> info ("Importing graphics boot message");
+ $kiwi -> info ("Importing graphics boot message and stage files");
if ($zipped) {
- $status= qxx ("$unzip | (cd $tmpdir && cpio -di $message 2>&1)");
+ $status= qxx (
+ "$unzip | (cd $tmpdir && cpio -i -d $figure -d $stages 2>&1)"
+ );
} else {
- $status= qxx ("cat $initrd|(cd $tmpdir && cpio -di $message 2>&1)");
+ $status= qxx (
+ "cat $initrd|(cd $tmpdir && cpio -i -d $figure -d $stages 2>&1)"
+ );
}
if (-e $tmpdir."/image/loader/message") {
- $status = qxx ("mv $tmpdir/$message $tmpdir/boot/message 2>&1");
+ $status = qxx ("mv $tmpdir/$figure $tmpdir/boot/message 2>&1");
$result = $? >> 8;
$kiwi -> done();
} else {
$kiwi -> skipped();
}
#==========================================
- # Get Grub stage files from initrd
+ # check Grub stage files...
#------------------------------------------
- $kiwi -> info ("Importing grub stages");
- if ($zipped) {
- $status = qxx (
- "$unzip | (cd $tmpdir && cpio -di $stages 2>&1)"
- );
- } else {
- $status = qxx (
- "cat $initrd | (cd $tmpdir && cpio -di $stages 2>&1)"
- );
- }
if (glob($tmpdir."/usr/lib/grub/*")) {
$status = qxx (
"mv $tmpdir/usr/lib/grub/* $tmpdir/boot/grub 2>&1"
@@ -2874,7 +2880,7 @@
$result = $? >> 8;
}
} else {
- $kiwi -> skipped (); chomp $status;
+ chomp $status;
$kiwi -> error ("Failed importing grub stages: $status");
$kiwi -> skipped ();
$kiwi -> info ("Trying to use grub stages from local machine");
@@ -2887,13 +2893,11 @@
$result = $? >> 8;
}
if ($result != 0) {
- $kiwi -> failed ();
$kiwi -> error ("Failed importing grub stages: $status");
$kiwi -> failed ();
return undef;
}
}
- $kiwi -> done();
}
#==========================================
# syslinux
@@ -2962,8 +2966,7 @@
#==========================================
# setup boot loader default boot label/nr
#------------------------------------------
- my $defaultBootLabel = $label;
- my $defaultBootNr = 0;
+ my $defaultBootNr = 0;
if ($xml) {
%type = %{$xml->getImageTypeAndAttributes()};
$cmdline = $type{cmdline};
@@ -2987,15 +2990,9 @@
# 2 -> Failsafe -- Install/Restore $label
# ----
if ($type{installboot} eq "install") {
- $defaultBootLabel= makeLabel (
- "Install/Restore $label"
- );
$defaultBootNr = 1;
}
if ($type{installboot} eq "failsafe-install") {
- $defaultBootLabel= makeLabel (
- "Failsafe -- Install/Restore $label"
- );
$defaultBootNr = 2;
}
}
@@ -3057,11 +3054,18 @@
return undef;
}
#==========================================
+ # Compat link
+ #------------------------------------------
+ qxx ("cd $tmpdir/boot/grub && ln -s menu.lst grub.conf");
+ #==========================================
# General grub setup
#------------------------------------------
print FD "color cyan/blue white/blue\n";
print FD "default $defaultBootNr\n";
- my $bootTimeout = $type{boottimeout} ? int $type{boottimeout} : 10;
+ my $bootTimeout = 10;
+ if (defined $type{boottimeout}) {
+ $bootTimeout = $type{boottimeout};
+ }
if ($type{fastboot}) {
$bootTimeout = 0;
}
@@ -3069,7 +3073,11 @@
if ($type =~ /^KIWI (CD|USB)/) {
my $dev = $1 eq 'CD' ? '(cd)' : '(hd0,0)';
if (! $type{fastboot}) {
- print FD "gfxmenu $dev/boot/message\n";
+ if (-e "$tmpdir/boot/grub/splash.xpm.gz") {
+ print FD "splashimage=$dev/boot/grub/splash.xpm.gz\n"
+ } elsif (-e "$tmpdir/boot/message") {
+ print FD "gfxmenu $dev/boot/message\n";
+ }
}
print FD "title Boot from Hard Disk\n";
if ($dev eq '(cd)') {
@@ -3092,7 +3100,11 @@
print FD "title $title\n";
} else {
$title = $this -> makeLabel ("$label [ $type ]");
- print FD "gfxmenu (hd0,$bootpart)/boot/message\n";
+ if (-e "$tmpdir/boot/grub/splash.xpm.gz") {
+ print FD "splashimage=(hd0,$bootpart)/boot/grub/splash.xpm.gz\n"
+ } elsif (-e "$tmpdir/boot/message") {
+ print FD "gfxmenu (hd0,$bootpart)/boot/message\n";
+ }
print FD "title $title\n";
}
#==========================================
@@ -3246,12 +3258,23 @@
#==========================================
# General syslinux setup
#------------------------------------------
- print FD "default $defaultBootLabel"."\n";
print FD "implicit 1"."\n";
print FD "prompt 1"."\n";
- my $bootTimeout = $type{boottimeout} ? int $type{boottimeout} : 200;
+ my $bootTimeout = 100;
+ if (defined $type{boottimeout}) {
+ $bootTimeout = $type{boottimeout};
+ if (int ($bootTimeout) == 0) {
+ # /.../
+ # a timeout value of 0 disables the timeout in syslinux
+ # therefore we set the smallest possible value in that case
+ # which is 1/10 sec
+ # ----
+ $bootTimeout = 1;
+ }
+ }
print FD "timeout $bootTimeout"."\n";
print FD "display isolinux.msg"."\n";
+ my @labels = ();
if (-f "$gfx/bootlogo") {
if ($syslinux_new_format) {
print FD "ui gfxboot bootlogo isolinux.msg"."\n";
@@ -3259,16 +3282,33 @@
print FD "gfxboot bootlogo"."\n";
}
}
+ #==========================================
+ # Setup default title
+ #------------------------------------------
+ if ($type =~ /^KIWI (CD|USB)/) {
+ if ($defaultBootNr == 0) {
+ $title = $this -> makeLabel ("Boot from Hard Disk");
+ } elsif ($defaultBootNr == 1) {
+ $title = $this -> makeLabel ("Install/Restore $label");
+ } else {
+ $title = $this -> makeLabel (
+ "Failsafe -- Install/Restore $label"
+ );
+ }
+ } else {
+ $title = $this -> makeLabel ("$label [ $type ]");
+ }
+ print FD "default $title"."\n";
if ($type =~ /^KIWI (CD|USB)/) {
$title = $this -> makeLabel ("Boot from Hard Disk");
print FD "label $title\n";
print FD "localboot 0x80\n";
$title = $this -> makeLabel ("Install/Restore $label");
- print FD "label $title\n";
} else {
$title = $this -> makeLabel ("$label [ $type ]");
- print FD "label $title"."\n";
}
+ print FD "label $title"."\n";
+ push @labels,$title;
#==========================================
# Standard boot
#------------------------------------------
@@ -3320,6 +3360,7 @@
$title = $this -> makeLabel ("Failsafe -- $label [ $type ]");
print FD "label $title"."\n";
}
+ push @labels,$title;
if (! $isxen) {
if ($type =~ /^KIWI CD/) {
print FD "kernel linux\n";
@@ -3360,6 +3401,22 @@
}
print FD $cmdline;
close FD;
+ #==========================================
+ # setup isolinux.msg file
+ #------------------------------------------
+ if (! open (FD,">$tmpdir/boot/syslinux/isolinux.msg")) {
+ $kiwi -> failed();
+ $kiwi -> error ("Failed to create isolinux.msg: $!");
+ $kiwi -> failed ();
+ return undef;
+ }
+ print FD "\n"."Welcome !"."\n\n";
+ foreach my $label (@labels) {
+ print FD "$label"."\n";
+ }
+ print FD "\n\n";
+ print FD "Have a lot of fun..."."\n";
+ close FD;
$kiwi -> done();
}
#==========================================
@@ -3596,9 +3653,20 @@
my $bootpart = $this->{bootpart};
my $chainload= $this->{chainload};
my $lvm = $this->{lvm};
+ my $cmdL = $this->{cmdL};
+ my $locator = new KIWILocator($kiwi);
my $result;
my $status;
#==========================================
+ # Check for edit boot config
+ #------------------------------------------
+ if ($cmdL) {
+ my $editBoot = $cmdL -> getEditBootConfig();
+ if (($editBoot) && (-e $editBoot)) {
+ system ("cd $tmpdir && bash --norc -c $editBoot");
+ }
+ }
+ #==========================================
# Check boot partition number
#------------------------------------------
if (! defined $bootpart) {
@@ -3610,6 +3678,11 @@
if ($loader eq "grub") {
$kiwi -> info ("Installing grub on device: $diskname");
#==========================================
+ # Clean loop maps
+ #------------------------------------------
+ $this -> cleanLoopMaps();
+ $this -> cleanLoop();
+ #==========================================
# Create device map for the disk
#------------------------------------------
my $dmfile = "$tmpdir/grub-device.map";
@@ -3623,36 +3696,51 @@
print $dmfd "(hd0) $diskname\n";
$dmfd -> close();
#==========================================
- # Install grub in batch mode
+ # Create command list to install grub
#------------------------------------------
- my $grub = "/usr/sbin/grub";
- my $grubOptions = "--device-map $dmfile --no-floppy --batch";
- $kiwi -> loginfo ("GRUB: $grub $grubOptions\n");
- qxx ("mount --bind $tmpdir/boot/grub /boot/grub");
- if (! open (FD,"|$grub $grubOptions &> $tmpdir/grub.log")) {
+ my $cmdfile = "$tmpdir/grub-device.cmds";
+ if (! $dmfd -> open(">$cmdfile")) {
$kiwi -> failed ();
- $kiwi -> error ("Couldn't call grub: $!");
+ $kiwi -> error ("Couldn't create grub command list: $!");
$kiwi -> failed ();
return undef;
}
- print FD "device (hd0) $diskname\n";
- print FD "root (hd0,$bootpart)\n";
+ print $dmfd "device (hd0) $diskname\n";
+ print $dmfd "root (hd0,$bootpart)\n";
if ($chainload) {
- print FD "setup (hd0,0)\n";
+ print $dmfd "setup (hd0,0)\n";
} else {
- print FD "setup (hd0)\n";
+ print $dmfd "setup (hd0)\n";
}
- print FD "quit\n";
- close FD;
+ print $dmfd "quit\n";
+ $dmfd -> close();
+ #==========================================
+ # Install grub in batch mode
+ #------------------------------------------
+ my $grub = $locator -> getExecPath ('grub');
+ if (! $grub) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Can't locate grub binary");
+ $kiwi -> failed ();
+ return undef;
+ }
+ my $grubOptions = "--device-map $dmfile --no-floppy --batch";
+ qxx ("mount --bind $tmpdir/boot/grub /boot/grub");
+ qxx ("$grub $grubOptions < $cmdfile &> $tmpdir/grub.log");
qxx ("umount /boot/grub");
my $glog;
- if (open (FD,"$tmpdir/grub.log")) {
- my @glog = <FD>; close FD;
+ if ($dmfd -> open ("$tmpdir/grub.log")) {
+ my @glog = <$dmfd>; $dmfd -> close();
+ if ($dmfd -> open ("$cmdfile")) {
+ my @cmdlog = <$dmfd>; $dmfd -> close();
+ push @glog,"GRUB: commands:";
+ push @glog,@cmdlog;
+ }
my $stage1 = grep { /^\s*Running.*succeeded$/ } @glog;
my $stage1_5 = grep { /^\s*Running.*are embedded\.$/ } @glog;
$result = !(($stage1 == 1) && ($stage1_5 == 1));
$glog = join ("\n",@glog);
- $kiwi -> loginfo ("GRUB: $glog");
+ $kiwi -> loginfo ("GRUB: $glog\n");
}
if ($result != 1) {
my $boot = "'boot sector'";
@@ -4047,8 +4135,15 @@
# ---
my $this = shift;
my $sdev = shift;
+ my $disk = shift;
my @groups;
#==========================================
+ # check for lvm flag on disk
+ #------------------------------------------
+ if (! $this-> __getPartID ($disk,"lvm")) {
+ return $sdev;
+ }
+ #==========================================
# activate volume groups
#------------------------------------------
open (my $SCAN,"vgscan 2>/dev/null |");
@@ -4085,12 +4180,12 @@
}
#==========================================
-# getCylinderSizeAndCount
+# getGeometry
#------------------------------------------
-sub getCylinderSizeAndCount {
+sub getGeometry {
# ...
- # obtain cylinder size and count for the specified disk.
- # The function returns the size in kB (10^3 B) or zero on error
+ # obtain number of sectors from the given
+ # disk device and return it
# ---
my $this = shift;
my $disk = shift;
@@ -4098,21 +4193,23 @@
my $status;
my $result;
my $parted;
+ my $locator = new KIWILocator($kiwi);
+ my $parted_exec = $locator -> getExecPath("parted");
$status = qxx ("dd if=/dev/zero of=$disk bs=512 count=1 2>&1");
$result = $? >> 8;
if ($result != 0) {
$kiwi -> loginfo ($status);
return 0;
}
- $status = qxx ("/usr/sbin/parted -s $disk mklabel msdos 2>&1");
+ $status = qxx ("$parted_exec -s $disk mklabel msdos 2>&1");
$result = $? >> 8;
if ($result != 0) {
$kiwi -> loginfo ($status);
return 0;
}
- $parted = "/usr/sbin/parted -m $disk unit cyl print";
+ $parted = "$parted_exec -m $disk unit s print";
$status = qxx (
- "$parted | head -n 3 | tail -n 1 | cut -f4 -d: | tr -d 'kB;'"
+ "$parted | head -n 3 | tail -n 1 | cut -f2 -d:"
);
$result = $? >> 8;
if ($result != 0) {
@@ -4120,103 +4217,93 @@
return 0;
}
chomp $status;
- $this->{pDiskCylinderSize} = $status;
- $status = qxx (
- "$parted | head -n 3 | tail -n 1 | cut -f1 -d:"
+ $status =~ s/s//;
+ $status --;
+ $this->{pDiskSectors} = $status;
+ $kiwi -> loginfo (
+ "Disk Sector count is: $this->{pDiskSectors}\n"
);
- $result = $? >> 8;
- if ($result != 0) {
- $kiwi -> loginfo ($status);
- return 0;
- }
- chomp $status;
- $this->{pDiskCylinders} = $status;
return $status;
}
#==========================================
-# getCylinder
+# getSector
#------------------------------------------
-sub getCylinder {
+sub getSector {
# ...
- # given a size in MB this function calculates the
- # aligned cylinder count according to the used disk
- # if no size is given the maximum value is used
- # ---
+ # turn the given size in MB to the number of
+ # required sectors
+ # ----
my $this = shift;
my $size = shift;
- my $csize = $this->{pDiskCylinderSize};
- my $count = $this->{pDiskCylinders};
- my $cyls;
- if (! defined $csize) {
- return 0;
- }
+ my $count = $this->{pDiskSectors};
+ my $secsz = 512;
+ my $sectors;
if ($size =~ /\+(.*)M$/) {
- $cyls = sprintf ("%.0f",($size * 1048576) / ($csize * 1000));
+ $sectors = sprintf ("%.0f",($size * 1048576) / $secsz);
+ if ($sectors == 0) {
+ $sectors = 8;
+ }
} else {
- $cyls = $count;
+ $sectors = $count;
}
- return $cyls;
+ return $sectors;
}
#==========================================
-# resetCylinder
+# resetGeometry
#------------------------------------------
-sub resetCylinder {
+sub resetGeometry {
# ...
- # reset global cylinder size and count
+ # reset global disk geometry information
# ---
my $this = shift;
- undef $this->{pDiskCylinders};
- undef $this->{pDiskCylinderSize};
+ undef $this->{pDiskSectors};
undef $this->{pStart};
undef $this->{pStopp};
return $this;
}
#==========================================
-# initCylinders
+# initGeometry
#------------------------------------------
-sub initCylinders {
+sub initGeometry {
# ...
- # calculate cylinder size and count for parted to create
- # the appropriate partition. On success the cylinder count
- # will be returned, on error zero is returned
+ # setup start sector and stop cylinder for the given size at
+ # first invocation the start cylinder is set to the default
+ # value from the global space or to the value specified on
+ # the commandline. On any subsequent call the start sector is
+ # calculated from the end sector of the previos partition
+ # and the new value gets aligned to be modulo 8 clean. The
+ # function returns the number of sectors which represents
+ # the given size
# ---
my $this = shift;
my $device = shift;
my $size = shift;
my $kiwi = $this->{kiwi};
my $cmdL = $this->{cmdL};
- my $cylsize= $this->{pDiskCylinderSize};
- my $secsize= 512;
- my $cyls = 0;
- my $status;
- my $result;
- if (! defined $this->{pDiskCylinders}) {
- my $cylcount = $this -> getCylinderSizeAndCount($device);
- if ($cylcount == 0) {
- return 0;
- }
- $cylsize= $this->{pDiskCylinderSize};
- }
- $cyls = $this -> getCylinder ($size);
- if ($cyls == 0) {
- return 0;
- }
+ my $locator= new KIWILocator($kiwi);
if (! defined $this->{pStart}) {
- $cylsize *= 1024;
- $this->{pStart} = sprintf (
- "%.0f",(($cmdL->getDiskStartSector() * $secsize) / $cylsize)
- );
+ $this->{pStart} = $cmdL->getDiskStartSector();
} else {
- $this->{pStart} = $this->{pStopp};
- }
- $this->{pStopp} = $this->{pStart} + $cyls;
- if ($this->{pStopp} > $this->{pDiskCylinders}) {
- $this->{pStopp} = $this->{pDiskCylinders}
+ my $parted_exec = $locator -> getExecPath("parted");
+ my $parted = "$parted_exec -m $device unit s print";
+ my $status = qxx (
+ "$parted | grep :$this->{pStart} | cut -f3 -d:"
+ );
+ $status=~ s/s//;
+ $status = int ($status / 8);
+ $status*= 8;
+ $status+= 8;
+ $this->{pStart} = $status;
+ }
+ my $sector = $this -> getSector ($size);
+ $this->{pStopp} = $this->{pStart} + $sector;
+ if ($this->{pStopp} > $this->{pDiskSectors}) {
+ $this->{pStopp} = $this->{pDiskSectors}
}
- return $cyls;
+ return $sector;
}
#==========================================
@@ -4239,6 +4326,8 @@
my $status;
my $ignore;
my $action;
+ my $locator = new KIWILocator($kiwi);
+ my $parted_exec = $locator -> getExecPath("parted");
if (! defined $tool) {
$tool = "parted";
}
@@ -4305,44 +4394,32 @@
# parted
#------------------------------------------
/^parted/ && do {
- my @p_cmd = ();
- $this -> resetCylinder();
+ my $p_cmd = ();
+ $this -> resetGeometry();
+ $this -> getGeometry ($device);
for (my $count=0;$count<@commands;$count++) {
my $cmd = $commands[$count];
if ($cmd eq "n") {
my $size = $commands[$count+4];
- $this -> initCylinders ($device,$size);
- push (@p_cmd,
- "mkpart primary $this->{pStart} $this->{pStopp}"
- );
+ $this -> initGeometry ($device,$size);
+ $p_cmd = "mkpart primary $this->{pStart} $this->{pStopp}";
+ $kiwi -> loginfo ("PARTED input: $device [$p_cmd]\n");
+ qxx ("$parted_exec -s $device unit s $p_cmd 2>&1");
}
if ($cmd eq "t") {
my $index= $commands[$count+1];
my $type = $commands[$count+2];
- push (@p_cmd,"set $index type 0x$type");
+ $p_cmd = "set $index type 0x$type";
+ $kiwi -> loginfo ("PARTED input: $device [$p_cmd]\n");
+ qxx ("$parted_exec -s $device unit s $p_cmd 2>&1");
}
if ($cmd eq "a") {
my $index= $commands[$count+1];
- push (@p_cmd,"set $index boot on");
+ $p_cmd = "set $index boot on";
+ $kiwi -> loginfo ("PARTED input: $device [$p_cmd]\n");
+ qxx ("$parted_exec -s $device unit s $p_cmd 2>&1");
}
}
- $kiwi -> loginfo (
- "PARTED input: $device [@p_cmd]"
- );
- my $align="";
- $status = qxx ("/usr/sbin/parted --help | grep -q align=");
- $result = $? >> 8;
- if ($result == 0) {
- $align="-a cyl";
- }
- foreach my $p_cmd (@p_cmd) {
- $status= qxx (
- "/usr/sbin/parted $align -s $device unit cyl $p_cmd 2>&1"
- );
- $result= $? >> 8;
- $kiwi -> loginfo ($status);
- sleep (1);
- }
last SWITCH;
}
}
@@ -5044,7 +5121,7 @@
my $bbytes = qxx ("du -s --block-size=1 $boot | cut -f1"); chomp $bbytes;
# 3 times the size should be enough for kernel updates
my $gotMB = sprintf ("%.0f",(($bbytes / 1048576) * 3));
- my $minMB = 100;
+ my $minMB = 150;
if ($gotMB < $minMB) {
$gotMB = $minMB;
}
@@ -5172,9 +5249,21 @@
#===========================================
# adapt min size according to cmdline or XML
#-------------------------------------------
- if ($cmdlBytes > $minBytes) {
+ if ($cmdlBytes > 0) {
+ if ($cmdlBytes < $minBytes) {
+ $kiwi -> warning (
+ "given size is smaller than calculated min size"
+ );
+ $kiwi -> oops();
+ }
$minBytes = $cmdlBytes;
- } elsif ($XMLBytes > $minBytes) {
+ } elsif ($XMLBytes > 0) {
+ if ($XMLBytes < $minBytes) {
+ $kiwi -> warning (
+ "given size is smaller than calculated min size"
+ );
+ $kiwi -> oops();
+ }
$minBytes = $XMLBytes;
}
#==========================================
@@ -5215,4 +5304,27 @@
return $this;
}
+#==========================================
+# __getPartID
+#------------------------------------------
+sub __getPartID {
+ # ...
+ # try to find the partition number which references
+ # the provided flag like "boot" or "lvm"
+ # ---
+ my $this = shift;
+ my $disk = shift;
+ my $flag = shift;
+ my $fd = new FileHandle;
+ if ($fd -> open ("parted -m $disk print | cut -f1,7 -d:|")) {
+ while (my $line = <$fd>) {
+ if ($line =~ /^(\d):[ ,]*$flag/) {
+ return $1;
+ }
+ }
+ $fd -> close();
+ }
+ return 0;
+}
+
1;
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWICache.kiwi
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="cache-builder">
+<image schemaversion="5.3" name="cache-builder">
<description type="system">
<author>Marcus Schäfer</author>
<contact>ms@novell.com</contact>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWICache.pm
^
|
@@ -312,7 +312,7 @@
#==========================================
# write XML changes to logfile...
#------------------------------------------
- $kiwi -> writeXML ($this->{gdata}->{Pretty});
+ $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty});
#==========================================
# Reformat log file for human readers...
#------------------------------------------
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWICollect.pm
^
|
@@ -904,7 +904,7 @@
}
$this->addDebugPackage($srcname."-debuginfo".$suffix, $arch, $packPointer);
$this->addDebugPackage($srcname."-debugsource", $arch, $packPointer);
- $this->addDebugPackage($basename."-debuginfo".$suffix, $arch, $packPointer);
+ $this->addDebugPackage($basename."-debuginfo".$suffix, $arch, $packPointer) unless $srcname eq $basename;
};
}
}
@@ -1166,7 +1166,7 @@
my @themes = readdir(TD);
closedir(TD);
my $found=0;
- foreach my $d(@themes) {
+ foreach my $d(sort(@themes)) {
if($d =~ m{$thema}i) {
$this->logMsg("I", "Using thema $d");
$thema = $d; # changed after I saw that yast2-slideshow has a thema "SuSE-SLES" (matches "SuSE", but not in line 831)
@@ -1175,7 +1175,7 @@
}
}
if($found==0) {
- foreach my $d(@themes) {
+ foreach my $d(sort(@themes)) {
if($d =~ m{linux|sles|suse}i) {
$this->logMsg("W", "Using fallback theme $d instead of $thema");
$thema = $d;
@@ -1185,8 +1185,7 @@
}
## $thema is now the thema to use:
for my $i(1..3) {
- ## @lars: wtf soll denn sein, wenn es CD2 gibt, aber die Konfig der Medien kein Medium "2" hat?
- ## Laut Rudi (tm) ist das zulässig!
+ # drop not used configs when media does not exist
if(-d "$tmp/SuSE/$thema/CD$i" and $this->{m_basesubdir}->{$i} and -d "$tmp/SuSE/$thema/CD$i") {
qx(cp -a $tmp/SuSE/$thema/CD$i/* $this->{m_basesubdir}->{$i});
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWICommandLine.pm
^
|
@@ -675,6 +675,9 @@
}
my $absPath = File::Spec->rel2abs($logPath);
my ($volume, $path, $file) = File::Spec->splitpath($logPath);
+ if ($path eq '') {
+ $path = './';
+ }
if (! -w $path) {
my $msg = "Unable to write to location $path, cannot create log file.";
$this -> {kiwi} -> error ($msg);
@@ -1310,4 +1313,22 @@
return $this->{startsector};
}
+#==========================================
+# setEditBootConfig
+#------------------------------------------
+sub setEditBootConfig {
+ my $this = shift;
+ my $value = shift;
+ $this->{editbootconfig} = File::Spec->rel2abs($value);
+ return 1;
+}
+
+#==========================================
+# getEditBootConfig
+#------------------------------------------
+sub getEditBootConfig {
+ my $this = shift;
+ return $this->{editbootconfig};
+}
+
1;
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIConfig.sh
^
|
@@ -985,7 +985,8 @@
setterm kpartx vgcfgbackup vgcfgrestore lsdasd dasd_configure
qeth_configure fdasd mkdosfs egrep mkfs.xfs mdadm yes fdisk
startproc zfcp_host_configure zfcp_disk_configure vgrename
- kpartx_id mpath_id dmraid dmevent_tool
+ kpartx_id mpath_id dmraid dmevent_tool which mpath_wait seq
+ route
"
tools="$tools $@"
for path in /sbin /usr/sbin /usr/bin /bin;do
@@ -1013,7 +1014,7 @@
/etc/protocols /etc/services /etc/termcap /etc/aliases
/etc/bash.bashrc /etc/filesystems /etc/ld.so.conf /etc/magic
/etc/group /etc/passwd /etc/nsswitch.conf /etc/scsi_id.config
- /etc/netconfig
+ /etc/netconfig /etc/hosts /etc/resolv.conf
"
for i in $files;do
if [ -e $i ];then
@@ -1039,6 +1040,21 @@
}
#======================================
+# rhelSplashToGrub
+#--------------------------------------
+function rhelSplashToGrub {
+ local grub_stage=/usr/lib/grub
+ local rhel_logos=/boot/grub/splash.xpm.gz
+ if [ ! -e $rhel_logos ];then
+ return
+ fi
+ if [ ! -d $grub_stage ];then
+ mkdir -p $grub_stage
+ fi
+ mv $rhel_logos $grub_stage
+}
+
+#======================================
# suseGFXBoot
#--------------------------------------
function suseGFXBoot {
@@ -1574,6 +1590,11 @@
1|2|3|5)
sed -i "s/id:[0123456]:initdefault:/id:$RUNLEVEL:initdefault:/" \
/etc/inittab
+ if test -d /etc/systemd/system; then
+ ln -sf \
+ /lib/systemd/system/runlevel$RUNLEVEL.target \
+ /etc/systemd/system/default.target
+ fi
;;
*)
echo "Invalid runlevel argument: $RUNLEVEL"
@@ -1634,4 +1655,14 @@
fi
}
+#======================================
+# baseSetupBootLoaderCompatLinks
+#--------------------------------------
+function baseSetupBootLoaderCompatLinks {
+ if [ ! -d /usr/lib/grub ];then
+ mkdir -p /usr/lib/grub
+ cp -l /usr/share/grub/*/* /usr/lib/grub
+ fi
+}
+
# vim: set noexpandtab:
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIEC2Region.txt
^
|
@@ -1,10 +1,10 @@
# /.../
# Ec2 region table for correct Amazon kernel (aki) assignment
# ----
-AP-Japan-i386=aki-d209a2d3
-AP-Japan-x86_64=aki-d409a2d5
-AP-Singapore-i386=aki-13d5aa41
-AP-Singapore-x86_64=aki-11d5aa43
+AP-Northeast-i386=aki-d209a2d3
+AP-Northeast-x86_64=aki-d409a2d5
+AP-Southeast-i386=aki-13d5aa41
+AP-Southeast-x86_64=aki-11d5aa43
EU-West-i386=aki-4deec439
EU-West-x86_64=aki-4feec43b
US-East-i386=aki-407d9529
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIGlobals.pm
^
|
@@ -40,7 +40,7 @@
# Globals (generic)
#------------------------------------------
my %data;
- $data{Version} = "4.94.1";
+ $data{Version} = "4.98.15";
$data{Publisher} = "SUSE LINUX Products GmbH";
$data{Preparer} = "KIWI - http://kiwi.berlios.de";
$data{ConfigName} = "config.xml";
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIImage.pm
^
|
@@ -187,6 +187,7 @@
my @falistImage;
my @fplistImage;
my @fplistDelete;
+ my @driverList;
my %fixedBootInclude;
my @node;
#==========================================
@@ -227,10 +228,12 @@
# Store general data
#------------------------------------------
$changeset{"packagemanager"} = $src_xml->getPackageManager();
+ $changeset{"showlicense"} = $src_xml->getLicenseNames();
$changeset{"domain"} = $src_xml->getXenDomain();
$changeset{"displayname"} = $src_xml->getImageDisplayName();
$changeset{"locale"} = $src_xml->getLocale();
$changeset{"boot-theme"} = $src_xml->getBootTheme();
+ $changeset{"allFreeVolume"} = $src_xml->getAllFreeVolume();
#==========================================
# Store repositories
#------------------------------------------
@@ -250,6 +253,21 @@
}
$changeset{"repositories"} = \%repos;
#==========================================
+ # Store drivers section if any
+ #------------------------------------------
+ @node = $src_xml->getDriversNodeList() -> get_nodelist();
+ foreach my $element (@node) {
+ if (! $src_xml -> __requestedProfile ($element)) {
+ next;
+ }
+ my @files = $element->getElementsByTagName ("file");
+ foreach my $element (@files) {
+ my $driver = $element -> getAttribute ("name");
+ push (@driverList,$driver);
+ }
+ }
+ $changeset{"driverList"} = \@driverList;
+ #==========================================
# Store boot included packages
#------------------------------------------
@node = $src_xml->getPackageNodeList() -> get_nodelist();
@@ -815,6 +833,7 @@
my $this = shift;
my $kiwi = $this->{kiwi};
my $xml = $this->{xml};
+ my %type = %{$xml->getImageTypeAndAttributes()};
#==========================================
# PRE filesystem setup
#------------------------------------------
@@ -837,7 +856,6 @@
#==========================================
# Compress image using gzip
#------------------------------------------
- my %type = %{$xml->getImageTypeAndAttributes()};
if (($type{compressed}) && ($type{compressed} eq 'true')) {
if (! $this -> compressImage ($name)) {
return undef;
@@ -1913,15 +1931,15 @@
return undef;
}
if ((! defined $gzip) || ($gzip =~ /^(unified|clic)/)) {
- print FD "IMAGE=/dev/ram1;$namecd\n";
+ print FD "IMAGE='/dev/ram1;$namecd'\n";
} else {
- print FD "IMAGE=/dev/loop1;$namecd\n";
+ print FD "IMAGE='/dev/loop1;$namecd'\n";
}
if (defined $gzip) {
if ($gzip =~ /^unified/) {
- print FD "UNIONFS_CONFIG=/dev/ram1,/dev/loop1,aufs\n";
+ print FD "UNIONFS_CONFIG='/dev/ram1,/dev/loop1,aufs'\n";
} elsif ($gzip =~ /^clic/) {
- print FD "UNIONFS_CONFIG=/dev/ram1,/dev/loop1,clicfs\n";
+ print FD "UNIONFS_CONFIG='/dev/ram1,/dev/loop1,clicfs'\n";
} else {
print FD "COMBINED_IMAGE=yes\n";
}
@@ -1946,7 +1964,7 @@
$attr .= " -V \"$stype{volid}\"";
}
my $isolinux = new KIWIIsoLinux (
- $kiwi,$CD,$name,$attr,"checkmedia"
+ $kiwi,$CD,$name,$attr,"checkmedia",$this->{cmdL}
);
if (defined $isolinux) {
$isoerror = 0;
@@ -2783,9 +2801,9 @@
# Create logical extend
#------------------------------------------
if (! defined $haveExtend) {
- if (! $this -> buildLogicalExtend ($name,$mBytes."M")) {
- return undef;
- }
+ if (! $this -> buildLogicalExtend ($name,$mBytes."M")) {
+ return undef;
+ }
}
return $name;
}
@@ -2867,8 +2885,8 @@
# IMAGE information
#------------------------------------------
if (($type{compressed}) && ($type{compressed} eq 'true')) {
- print FD "IMAGE=${device}${targetPartition};";
- print FD "$namecd;$server;$blocks;compressed";
+ print FD "IMAGE='${device}${targetPartition};";
+ print FD "$namecd;$server;$blocks;compressed'";
if ("$type{type}" eq "split" && defined $this->{imageTreeRW}) {
print FD ",${device}${targetPartitionNext}";
print FD ";$namerw;$server;$blocks;compressed\n";
@@ -2876,8 +2894,8 @@
print FD "\n";
}
} else {
- print FD "IMAGE=${device}${targetPartition};";
- print FD "$namecd;$server;$blocks";
+ print FD "IMAGE='${device}${targetPartition};";
+ print FD "$namecd;$server;$blocks'";
if ("$type{type}" eq "split" && defined $this->{imageTreeRW}) {
print FD ",${device}${targetPartitionNext}";
print FD ";$namerw;$server;$blocks\n";
@@ -2917,7 +2935,7 @@
$valid = 1;
}
if ($valid) {
- print FD "UNIONFS_CONFIG=$value\n";
+ print FD "UNIONFS_CONFIG='".$value."'\n";
}
}
#==========================================
@@ -3223,13 +3241,11 @@
$kiwi -> info ("Copying physical to logical [$name]...");
my $free = qxx ("df -h $extend 2>&1");
$kiwi -> loginfo ("getSize: mount: $free\n");
- my $data = qxx (
- "tar --one-file-system -cf - -C $source . | tar -x -C $extend 2>&1"
- );
+ my $data = qxx ("rsync -aHXA --one-file-system $source/ $extend 2>&1");
my $code = $? >> 8;
if ($code != 0) {
$kiwi -> failed ();
- $kiwi -> info ("tar based copy failed: $data");
+ $kiwi -> info ("rsync based copy failed: $data");
$kiwi -> failed ();
$this -> cleanMount();
return undef;
@@ -3756,8 +3772,6 @@
$tree = $imageTree;
}
if ($type{luks}) {
- $kiwi -> warning ("LUKS extension not supported for squashfs");
- $kiwi -> skipped ();
$this -> restoreImageDest();
}
unlink ("$this->{imageDest}/$name");
@@ -3771,8 +3785,50 @@
$kiwi -> error ($data);
return undef;
}
+ #==========================================
+ # Check for LUKS extension
+ #------------------------------------------
+ if ($type{luks}) {
+ my $outimg = $this->{imageDest}."/".$name;
+ my $squashimg = $outimg.".squashfs";
+ my $cipher = "$type{luks}";
+ my $data = qxx ("mv $outimg $squashimg 2>&1");
+ my $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to rename squashfs image");
+ $kiwi -> failed ();
+ return undef;
+ }
+ my $bytes = int ((-s $squashimg) * 1.1);
+ $data = qxx (
+ "dd if=/dev/zero of=$outimg bs=1 seek=$bytes count=1 2>&1"
+ );
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to create luks loop container");
+ $kiwi -> failed ();
+ return undef;
+ }
+ if (! $this -> setupEncoding ($name.".squashfs",$outimg,$cipher)) {
+ return undef;
+ }
+ $data = qxx (
+ "dd if=$squashimg of=$this->{imageDest}/$name.squashfs 2>&1"
+ );
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Failed to dump squashfs to luks loop: $data");
+ $kiwi -> failed ();
+ $this -> cleanLuks();
+ return undef;
+ }
+ }
$this -> restoreImageDest();
$data = qxx ("chmod 644 $this->{imageDest}/$name");
+ $data = qxx ("rm -f $this->{imageDest}/$name.squashfs");
$data = qxx ("cd $this->{imageDest} && ln -vs $name $name.squashfs 2>&1");
$this -> remapImageDest();
$kiwi -> loginfo ($data);
@@ -3967,8 +4023,8 @@
my $xml = $this->{xml};
my $mini = qxx ("find $extend | wc -l"); chomp $mini;
my $minsize= qxx ("du -s --block-size=1 $extend | cut -f1"); chomp $minsize;
- my $spare = 1.5;
- my $journal= 12 * 1024 * 1024;
+ my $fsohead= 1.4;
+ my $spare = 100 * 1024 * 1024;
my $files = $mini;
my $fsopts = $cmdL -> getFilesystemOptions();
my $isize = $fsopts->[1];
@@ -3979,16 +4035,14 @@
#------------------------------------------
$mini *= 2;
#==========================================
- # Minimum size calculated in Byte + spare
+ # Minimum size calculated in Byte
#------------------------------------------
$kiwi -> loginfo ("getSize: files: $files\n");
- $kiwi -> loginfo ("getSize: spare: $spare\n");
$kiwi -> loginfo ("getSize: usage: $minsize Bytes\n");
$kiwi -> loginfo ("getSize: inode: $isize Bytes\n");
- $kiwi -> loginfo ("getSize: journ: $journal Bytes\n");
+ $minsize *= $fsohead;
$minsize += $mini * $isize;
- $minsize *= $spare;
- $minsize += $journal;
+ $minsize += $spare;
$xmlsize = $minsize;
$kiwi -> loginfo ("getSize: minsz: $minsize Bytes\n");
#==========================================
@@ -4391,6 +4445,8 @@
if (-d $spldir) {
qxx ("rm -rf $spldir 2>&1");
}
+ $this -> cleanMount();
+ $this -> cleanLuks();
return $this;
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIImageCreator.pm
^
|
@@ -160,6 +160,9 @@
$kiwi -> failed ();
return undef;
}
+ if (! $this -> __checkImageIntegrity() ) {
+ return undef;
+ }
$kiwi -> info ("--> Prepare boot image (initrd)...\n");
my $xml = new KIWIXML (
$kiwi,$configDir,undef,undef,$cmdL,$changeset
@@ -171,6 +174,7 @@
# Apply XML over rides from command line
#------------------------------------------
$xml = $this -> __applyBaseXMLOverrides($xml);
+ $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty});
return $this -> __prepareTree (
$xml,$configDir,$rootTgtDir,$systemTree
);
@@ -227,6 +231,7 @@
#------------------------------------------
$xml = $this -> __applyBaseXMLOverrides($xml);
$xml = $this -> __applyAdditionalXMLOverrides($xml);
+ $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty});
if (! $krc -> prepareChecks()) {
return undef;
}
@@ -307,6 +312,7 @@
#------------------------------------------
$xml = $this -> __applyBaseXMLOverrides($xml);
$xml = $this -> __applyAdditionalXMLOverrides($xml);
+ $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty});
if (! $krc -> prepareChecks()) {
return undef;
}
@@ -347,6 +353,9 @@
if (! $isValid) {
return undef;
}
+ if (! $this -> __checkImageIntegrity() ) {
+ return undef;
+ }
$kiwi -> info ("--> Create boot image (initrd)...\n");
my $xml = new KIWIXML (
$kiwi,$configDir,"cpio",undef,$cmdL
@@ -358,6 +367,7 @@
# Apply XML over rides from command line
#------------------------------------------
$xml = $this -> __applyBaseXMLOverrides($xml);
+ $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty});
#==========================================
# Create destdir if needed
#------------------------------------------
@@ -415,6 +425,9 @@
$kiwi -> failed ();
return undef;
}
+ if (! $this -> __checkImageIntegrity() ) {
+ return undef;
+ }
#==========================================
# Setup the image XML description
#------------------------------------------
@@ -446,6 +459,13 @@
$kiwi,$cmdL,$xml
);
#==========================================
+ # Check for edit bootconfig in XML
+ #------------------------------------------
+ my $editBoot = $xml -> getEditBootConfig();
+ if ($editBoot) {
+ $cmdL -> setEditBootConfig ($editBoot);
+ }
+ #==========================================
# Check for default destination in XML
#------------------------------------------
if (! $target) {
@@ -467,6 +487,7 @@
#------------------------------------------
$xml = $this -> __applyBaseXMLOverrides($xml);
$xml = $this -> __applyAdditionalXMLOverrides($xml);
+ $kiwi -> writeXMLDiff ($this->{gdata}->{Pretty});
if (! $krc -> createChecks()) {
return undef;
}
@@ -533,7 +554,7 @@
@deleteList = keys %uniq;
}
if ((@addonList) || (@deleteList)) {
- $kiwi -> info ("Image update:");
+ $kiwi -> info ("Image update:\n");
if (@addonList) {
$kiwi -> info ("--> Install/Update: @addonList\n");
}
@@ -1357,8 +1378,6 @@
}
if ($image) {
$image -> cleanMount ();
- $image -> restoreCDRootData ();
- $image -> restoreSplitExtend ();
}
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIImageFormat.pm
^
|
@@ -155,6 +155,9 @@
if ($format eq "vmdk") {
$kiwi -> info ("Starting raw => $format conversion\n");
return $this -> createVMDK();
+ } elsif ($format eq "vhd") {
+ $kiwi -> info ("Starting raw => $format conversion\n");
+ return $this -> createVHD();
} elsif ($format eq "ovf") {
$kiwi -> info ("Starting raw => $format conversion\n");
return $this -> createOVF();
@@ -319,23 +322,25 @@
}
#==========================================
-# createQCOW2
+# createVHD
#------------------------------------------
-sub createQCOW2 {
+sub createVHD {
my $this = shift;
my $kiwi = $this->{kiwi};
- my $format = $this->{format};
+ my %vmwc = %{$this->{vmwref}};
my $source = $this->{image};
my $target = $source;
+ my $convert;
my $status;
my $result;
- $kiwi -> info ("Creating $format image...");
- $target =~ s/\.raw$/\.$format/;
- $status = qxx ("qemu-img convert -f raw $source -O $format $target 2>&1");
+ $kiwi -> info ("Creating vhd image...");
+ $target =~ s/\.raw$/\.vhd/;
+ $convert = "convert -f raw $source -O vpc";
+ $status = qxx ("qemu-img $convert $target 2>&1");
$result = $? >> 8;
if ($result != 0) {
$kiwi -> failed ();
- $kiwi -> error ("Couldn't create $format image: $status");
+ $kiwi -> error ("Couldn't create vhd image: $status");
$kiwi -> failed ();
return undef;
}
@@ -344,6 +349,14 @@
}
#==========================================
+# createQCOW2
+#------------------------------------------
+sub createQCOW2 {
+ my $this = shift;
+ return $this -> createVMDK();
+}
+
+#==========================================
# createEC2
#------------------------------------------
sub createEC2 {
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIIsoLinux.pm
^
|
@@ -57,6 +57,7 @@
my $dest = shift; # destination for the iso file
my $params = shift; # global genisoimage/mkisofs parameters
my $mediacheck = shift; # run tagmedia with --check y/n
+ my $cmdL = shift; # commandline params
#==========================================
# Constructor setup
#------------------------------------------
@@ -204,6 +205,7 @@
$this -> {tool} = $tool;
$this -> {check} = $mediacheck;
$this -> {gdata} = $main::global -> getGlobals();
+ $this -> {cmdL} = $cmdL;
return $this;
}
@@ -688,7 +690,14 @@
my $para = $this -> {params};
my $ldir = $this -> {tmpdir};
my $prog = $this -> {tool};
+ my $cmdL = $this -> {cmdL};
my $cmdln= "$prog $para -o $dest $ldir $src 2>&1";
+ if ($cmdL) {
+ my $editBoot = $cmdL -> getEditBootConfig();
+ if (($editBoot) && (-e $editBoot)) {
+ system ("cd $src && bash --norc -c $editBoot");
+ }
+ }
$kiwi -> loginfo ( "Calling: $cmdln\n" );
my $data = qxx ( $cmdln );
my $code = $? >> 8;
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWILinuxRC.sh
^
|
@@ -34,10 +34,11 @@
#--------------------------------------
arch=`uname -m`
if [ "$arch" = "ppc64" ];then
- loader=lilo
+ test -z "$loader" && export loader=lilo
test -z "$ELOG_BOOTSHELL" && export ELOG_BOOTSHELL=/dev/hvc0
test -z "$ELOG_CONSOLE" && export ELOG_CONSOLE=/dev/hvc0
else
+ test -z "$loader" && export loader=grub
test -z "$ELOG_CONSOLE" && export ELOG_CONSOLE=/dev/tty3
test -z "$ELOG_BOOTSHELL" && export ELOG_BOOTSHELL=/dev/tty2
fi
@@ -66,7 +67,7 @@
test -z "$CONSOLE" && export CONSOLE=/dev/console
test -z "$REDIRECT" && export REDIRECT=/dev/tty1
fi
-if [ -e /usr/sbin/parted ];then
+if which parted &>/dev/null;then
if parted -h | grep -q '\-\-align';then
export PARTED_HAVE_ALIGN=1
fi
@@ -228,27 +229,26 @@
# will export each entry of the file as variable into
# the current shell environment
# ----
- IFS="
- "
- local prefix=$1 #change name of key with a prefix
+ local prefix=$1
+ cat - | grep -v ^# > /tmp/srcme
+ # remove start/stop quoting from values
+ sed -i -e s"#\(^[a-zA-Z0-9_]\+\)=[\"']\(.*\)[\"']#\1=\2#" /tmp/srcme
+ # remove backslash quotes if any
+ sed -i -e s"#\\\\\(.\)#\1#g" /tmp/srcme
+ # quote simple quotation marks
+ sed -i -e s"#'#'\\\\''#g" /tmp/srcme
+ # add '...' quoting to values
+ sed -i -e s"#\(^[a-zA-Z0-9_]\+\)=\(.*\)#\1='\2'#" /tmp/srcme
+ source /tmp/srcme
while read line;do
- echo $line | grep -qi "^#" && continue
- key=`echo "$line" | cut -d '=' -f1`
- item=`echo "$line" | cut -d '=' -f2-`
- if [ -z "$key" ] || [ -z "$item" ];then
- continue
- fi
- if ! echo $item | grep -E -q "^(\"|')";then
- item="'"$item"'"
- fi
- Debug "$prefix$key=$item"
- eval export "$prefix$key\=$item"
- done
+ key=$(echo "$line" | cut -d '=' -f1)
+ eval "export $key"
+ test -z "$prefix" || eval "export $prefix$key=\$$key"
+ done < /tmp/srcme
if [ ! -z "$ERROR_INTERRUPT" ];then
Echo -e "$ERROR_INTERRUPT"
systemException "*** interrupted ****" "shell"
fi
- IFS=$IFS_ORIG
}
#======================================
# unsetFile
@@ -324,10 +324,11 @@
fi
test -e /proc/splash && echo verbose > /proc/splash
if [ $what = "reboot" ];then
- if cat /proc/cmdline | grep -qi "kiwidebug=1";then
+ if cat /proc/cmdline 2>/dev/null | grep -qi "kiwidebug=1";then
what="shell"
fi
fi
+ runHook preException "$@"
Echo "$1"
case "$what" in
"reboot")
@@ -397,46 +398,67 @@
popd >/dev/null
}
#======================================
-# copyDevices
+# createInitialDevices
#--------------------------------------
function createInitialDevices {
local prefix=$1
+ #======================================
+ # create master dev dir
+ #--------------------------------------
mkdir -p $prefix
if [ ! -d $prefix ];then
return
fi
- if [ -e $prefix/null ];then
- rm -f $prefix/null
+ #======================================
+ # mount devtmpfs or tmpfs
+ #--------------------------------------
+ if mount -t devtmpfs -o mode=0755,nr_inodes=0 devtmpfs $prefix; then
+ export have_devtmpfs=true
+ else
+ export have_devtmpfs=false
+ mount -t tmpfs -o mode=0755,nr_inodes=0 udev $prefix
+ mknod -m 0666 $prefix/tty c 5 0
+ mknod -m 0600 $prefix/console c 5 1
+ mknod -m 0666 $prefix/ptmx c 5 2
+ mknod -m 0666 $prefix/null c 1 3
+ mknod -m 0600 $prefix/kmsg c 1 11
+ mknod -m 0660 $prefix/snapshot c 10 231
+ mknod -m 0666 $prefix/random c 1 8
+ mknod -m 0644 $prefix/urandom c 1 9
fi
- test -c $prefix/tty || mknod -m 0666 $prefix/tty c 5 0
- test -c $prefix/tty1 || mknod -m 0666 $prefix/tty1 c 4 1
- test -c $prefix/tty2 || mknod -m 0666 $prefix/tty2 c 4 2
- test -c $prefix/tty3 || mknod -m 0666 $prefix/tty3 c 4 3
- test -c $prefix/tty4 || mknod -m 0666 $prefix/tty4 c 4 4
- test -c $prefix/console || mknod -m 0600 $prefix/console c 5 1
- test -c $prefix/ptmx || mknod -m 0666 $prefix/ptmx c 5 2
+ #======================================
+ # mount shared mem tmpfs
+ #--------------------------------------
+ mkdir -m 1777 $prefix/shm
+ mount -t tmpfs -o mode=1777 tmpfs $prefix/shm
+ #======================================
+ # mount devpts tmpfs
+ #--------------------------------------
+ mkdir -m 0755 $prefix/pts
+ mount -t devpts -o mode=0620,gid=5 devpts $prefix/pts
+ #======================================
+ # link default descriptors
+ #--------------------------------------
+ ln -s /proc/self/fd $prefix/fd
+ ln -s fd/0 $prefix/stdin
+ ln -s fd/1 $prefix/stdout
+ ln -s fd/2 $prefix/stderr
+ #======================================
+ # setup dev/console
+ #--------------------------------------
exec < $prefix/console > $prefix/console
- test -c $prefix/null || mknod -m 0666 $prefix/null c 1 3
- test -c $prefix/kmsg || mknod -m 0600 $prefix/kmsg c 1 11
- test -c $prefix/snapshot || mknod -m 0660 $prefix/snapshot c 10 231
- test -c $prefix/random || mknod -m 0666 $prefix/random c 1 8
- test -c $prefix/urandom || mknod -m 0644 $prefix/urandom c 1 9
- test -b $prefix/loop0 || mknod -m 0640 $prefix/loop0 b 7 0
- test -b $prefix/loop1 || mknod -m 0640 $prefix/loop1 b 7 1
- test -b $prefix/loop2 || mknod -m 0640 $prefix/loop2 b 7 2
- mkdir -p -m 0755 $prefix/pts
- mkdir -p -m 1777 $prefix/shm
- test -L $prefix/fd || ln -s /proc/self/fd $prefix/fd
- test -L $prefix/stdin || ln -s fd/0 $prefix/stdin
- test -L $prefix/stdout || ln -s fd/1 $prefix/stdout
- test -L $prefix/stderr || ln -s fd/2 $prefix/stderr
}
+
+
#======================================
# mount_rpc_pipefs
#--------------------------------------
function mount_rpc_pipefs {
# See if the file system is there yet
- case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
+ if [ ! -e /var/lib/nfs/rpc_pipefs ];then
+ return 0
+ fi
+ case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs 2>/dev/null` in
*67596969*)
return 0;;
esac
@@ -447,7 +469,7 @@
#--------------------------------------
function umount_rpc_pipefs {
# See if the file system is there
- case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
+ case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs 2>/dev/null` in
*67596969*)
umount /var/lib/nfs/rpc_pipefs
esac
@@ -620,8 +642,6 @@
mount -t tmpfs -o mode=0755 udev /dev
# static nodes
createInitialDevices /dev
- # terminal devices
- mount -t devpts devpts /dev/pts
# load modules required before udev
moduleLoadBeforeUdev
# start the udev daemon
@@ -714,9 +734,6 @@
# ----
resetBootBind
local arch=`uname -m`
- if [ -z "$loader" ];then
- loader="grub"
- fi
case $arch-$loader in
i*86-grub) installBootLoaderGrub ;;
x86_64-grub) installBootLoaderGrub ;;
@@ -732,8 +749,9 @@
"*** boot loader install for $arch-$loader not implemented ***" \
"reboot"
esac
+ masterBootID=0xffffffff
if [ ! -z "$masterBootID" ];then
- Echo "writing MBR ID back to master boot record: $masterBootID"
+ Echo "writing default MBR ID to master boot record: $masterBootID"
masterBootIDHex=$(echo $masterBootID |\
sed 's/^0x\(..\)\(..\)\(..\)\(..\)$/\\x\4\\x\3\\x\2\\x\1/')
echo -e -n $masterBootIDHex | dd of=$imageDiskDevice \
@@ -750,9 +768,6 @@
# happens according to the architecture of the system
# ----
local arch=`uname -m`
- if [ -z "$loader" ];then
- loader="grub"
- fi
case $arch-$loader in
i*86-grub) installBootLoaderGrubRecovery ;;
x86_64-grub) installBootLoaderGrubRecovery ;;
@@ -809,9 +824,9 @@
# install the grub according to the contents of
# /etc/grub.conf and /boot/grub/menu.lst
# ----
- if [ -x /usr/sbin/grub ];then
+ if which grub &>/dev/null;then
Echo "Installing boot loader..."
- /usr/sbin/grub --batch --no-floppy < /etc/grub.conf 1>&2
+ grub --batch --no-floppy < /etc/grub.conf 1>&2
if [ ! $? = 0 ];then
Echo "Failed to install boot loader"
fi
@@ -878,8 +893,8 @@
echo "root (hd0,$gdevreco)" >> $input
echo "setup (hd0,$gdevreco)" >> $input
echo "quit" >> $input
- if [ -x /usr/sbin/grub ];then
- /usr/sbin/grub --batch < $input 1>&2
+ if which grub &>/dev/null;then
+ grub --batch < $input 1>&2
rm -f $input
else
Echo "Image doesn't have grub installed"
@@ -890,6 +905,64 @@
fi
}
#======================================
+# setupRHELInitrd
+#--------------------------------------
+function setupRHELInitrd {
+ # /.../
+ # call mkinitrd on RHEL systems to create the distro initrd.
+ # Note: mkinitrd will be obsolete on RHEL in future releases
+ # so this function is a candiate for a rewrite
+ # ----
+ bootLoaderOK=1
+ local umountProc=0
+ local umountSys=0
+ local systemMap=0
+ local haveVMX=0
+ local params
+ local running
+ local rlinux
+ local rinitrd
+ local kernel_version=`uname -r`
+ for i in `find /boot/ -name "System.map*"`;do
+ systemMap=1
+ done
+ if [ $systemMap -eq 1 ];then
+ if [ ! -e /proc/mounts ];then
+ mount -t proc proc /proc
+ umountProc=1
+ fi
+ if [ ! -e /sys/block ];then
+ mount -t sysfs sysfs /sys
+ umountSys=1
+ fi
+ if [ $bootLoaderOK = "1" ];then
+ if [ -f /boot/initrd.vmx ];then
+ rm -f /boot/initrd.vmx
+ rm -f /boot/linux.vmx
+ rm -f /boot/initrd-*.img ##remove the dist's initrd image
+ haveVMX=1
+ fi
+ fi
+ params=" -f /boot/initrd-$kernel_version $kernel_version"
+ if ! mkinitrd $params;then
+ Echo "Can't create initrd"
+ systemIntegrity=unknown
+ bootLoaderOK=0
+ fi
+ if [ $umountSys -eq 1 ];then
+ umount /sys
+ fi
+ if [ $umountProc -eq 1 ];then
+ umount /proc
+ fi
+ else
+ Echo "Image doesn't include kernel system map"
+ Echo "Can't create initrd"
+ systemIntegrity=unknown
+ bootLoaderOK=0
+ fi
+}
+#======================================
# setupSUSEInitrd
#--------------------------------------
function setupSUSEInitrd {
@@ -995,15 +1068,9 @@
local arch=`uname -m`
local para=""
while [ $# -gt 0 ];do
- para="$para \"$1\""
+ para="$para '$1'"
shift
done
- if [ ! -z "$kiwi_bootloader" ];then
- loader=$kiwi_bootloader
- fi
- if [ -z "$loader" ];then
- loader="grub"
- fi
case $arch-$loader in
i*86-grub) eval setupBootLoaderGrub $para ;;
x86_64-grub) eval setupBootLoaderGrub $para ;;
@@ -1070,12 +1137,9 @@
local arch=`uname -m`
local para=""
while [ $# -gt 0 ];do
- para="$para \"$1\""
+ para="$para '$1'"
shift
done
- if [ -z "$loader" ];then
- loader="grub"
- fi
case $arch-$loader in
i*86-grub) eval setupBootLoaderGrubRecovery $para ;;
x86_64-grub) eval setupBootLoaderGrubRecovery $para ;;
@@ -1175,6 +1239,9 @@
if [ ! -z "$imageDiskDevice" ];then
echo -n " disk=$(getDiskID $imageDiskDevice)" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo -n " vga=$fbmode loader=$loader" >> $conf
echo -n " splash=silent" >> $conf
echo -n " $KIWI_INITRD_PARAMS" >> $conf
@@ -1201,6 +1268,9 @@
if [ ! -z "$imageDiskDevice" ];then
echo -n " disk=$(getDiskID $imageDiskDevice)" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo -n " vga=$fbmode loader=$loader" >> $conf
echo -n " splash=silent" >> $conf
echo -n " $KIWI_INITRD_PARAMS" >> $conf
@@ -1274,6 +1344,9 @@
if [ ! -z "$imageDiskDevice" ];then
echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
echo -n " vga=$fbmode splash=silent" >> $menu
echo -n " $KIWI_INITRD_PARAMS" >> $menu
echo -n " $KIWI_KERNEL_OPTIONS" >> $menu
@@ -1288,6 +1361,9 @@
if [ ! -z "$imageDiskDevice" ];then
echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
echo -n " vga=$fbmode splash=silent" >> $menu
echo -n " $KIWI_INITRD_PARAMS" >> $menu
echo -n " $KIWI_KERNEL_OPTIONS" >> $menu
@@ -1310,6 +1386,9 @@
if [ ! -z "$imageDiskDevice" ];then
echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
echo -n " vga=$fbmode splash=silent" >> $menu
echo -n " $KIWI_INITRD_PARAMS" >> $menu
echo -n " $KIWI_KERNEL_OPTIONS" >> $menu
@@ -1324,6 +1403,9 @@
if [ ! -z "$imageDiskDevice" ];then
echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
echo -n " vga=$fbmode splash=silent" >> $menu
echo -n " $KIWI_INITRD_PARAMS" >> $menu
echo -n " $KIWI_KERNEL_OPTIONS" >> $menu
@@ -1362,12 +1444,6 @@
local diskByID=`getDiskID $rdev`
local swapByID=`getDiskID $swap swap`
#======================================
- # check for boot image .profile
- #--------------------------------------
- if [ -f /.profile ];then
- importFile < /.profile
- fi
- #======================================
# check for bootloader displayname
#--------------------------------------
if [ -z "$kiwi_oemtitle" ] && [ ! -z "$kiwi_displayname" ];then
@@ -1484,6 +1560,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo -n " $KIWI_INITRD_PARAMS" >> $conf
echo -n " $KIWI_KERNEL_OPTIONS" >> $conf
echo " loader=$loader\"" >> $conf
@@ -1501,6 +1580,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo -n " $KIWI_INITRD_PARAMS" >> $conf
echo -n " $KIWI_KERNEL_OPTIONS" >> $conf
echo " loader=$loader x11failsafe\"" >> $conf
@@ -1563,12 +1645,6 @@
local diskByID=`getDiskID $rdev`
local swapByID=`getDiskID $swap swap`
#======================================
- # check for boot image .profile
- #--------------------------------------
- if [ -f /.profile ];then
- importFile < /.profile
- fi
- #======================================
# check for bootloader displayname
#--------------------------------------
if [ -z "$kiwi_oemtitle" ] && [ ! -z "$kiwi_displayname" ];then
@@ -1682,6 +1758,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo " showopts" >> $conf
fi
#======================================
@@ -1715,6 +1794,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo -n " showopts ide=nodma apm=off acpi=off" >> $conf
echo -n " noresume selinux=0 nosmp" >> $conf
echo " noapic maxcpus=0 edd=off" >> $conf
@@ -1789,12 +1871,6 @@
local diskByID=`getDiskID $rdev`
local swapByID=`getDiskID $swap swap`
#======================================
- # check for boot image .profile
- #--------------------------------------
- if [ -f /.profile ];then
- importFile < /.profile
- fi
- #======================================
# check for system image .profile
#--------------------------------------
if [ -f $mountPrefix/image/.profile ];then
@@ -1844,7 +1920,9 @@
# create menu.lst file
#--------------------------------------
echo "timeout $KIWI_BOOT_TIMEOUT" > $menu
- if [ -f /image/loader/message ] || [ -f /boot/message ];then
+ if [ -f $mountPrefix/boot/grub/splash.xpm.gz ];then
+ echo "splashimage=$gdev/boot/grub/splash.xpm.gz" >> $menu
+ elif [ -f /image/loader/message ] || [ -f /boot/message ];then
echo "gfxmenu $gdev/boot/message" >> $menu
fi
local count=1
@@ -1881,7 +1959,7 @@
echo -n " module /boot/$kernel" >> $menu
echo -n " root=$diskByID" >> $menu
if [ ! -z "$imageDiskDevice" ];then
- echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
+ echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
echo -n " $console vga=$fbmode splash=silent" >> $menu
if [ ! -z "$swap" ];then
@@ -1897,13 +1975,16 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
echo " showopts" >> $menu
echo " module /boot/$initrd" >> $menu
else
echo -n " kernel $gdev/boot/$kernel" >> $menu
echo -n " root=$diskByID" >> $menu
if [ ! -z "$imageDiskDevice" ];then
- echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
+ echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
echo -n " $console vga=$fbmode splash=silent" >> $menu
if [ ! -z "$swap" ];then
@@ -1919,6 +2000,10 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
+
echo " showopts" >> $menu
echo " initrd $gdev/boot/$initrd" >> $menu
fi
@@ -1933,7 +2018,7 @@
echo -n " module /boot/$kernel" >> $menu
echo -n " root=$diskByID" >> $menu
if [ ! -z "$imageDiskDevice" ];then
- echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
+ echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
echo -n " $console vga=$fbmode splash=silent" >> $menu
echo -n " $KIWI_INITRD_PARAMS" >> $menu
@@ -1941,6 +2026,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
echo -n " showopts ide=nodma apm=off acpi=off" >> $menu
echo -n " noresume selinux=0 nosmp" >> $menu
if [ -e /dev/xvc0 ];then
@@ -1954,7 +2042,7 @@
echo -n " kernel $gdev/boot/$kernel" >> $menu
echo -n " root=$diskByID" >> $menu
if [ ! -z "$imageDiskDevice" ];then
- echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
+ echo -n " disk=$(getDiskID $imageDiskDevice)" >> $menu
fi
echo -n " $console vga=$fbmode splash=silent" >> $menu
echo -n " $KIWI_INITRD_PARAMS" >> $menu
@@ -1962,6 +2050,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $menu
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $menu
+ fi
echo -n " showopts ide=nodma apm=off acpi=off" >> $menu
echo -n " noresume selinux=0 nosmp" >> $menu
if [ -e /dev/xvc0 ];then
@@ -2054,12 +2145,6 @@
local diskByID=`getDiskID $rdev`
local swapByID=`getDiskID $swap swap`
#======================================
- # check for boot image .profile
- #--------------------------------------
- if [ -f /.profile ];then
- importFile < /.profile
- fi
- #======================================
# check for bootloader displayname
#--------------------------------------
if [ -z "$kiwi_oemtitle" ] && [ ! -z "$kiwi_displayname" ];then
@@ -2141,7 +2226,7 @@
"*** lilo: Xen dom0 boot not implemented ***" \
"reboot"
else
- echo "default=\"$title\"" >> $conf
+ echo "default=\"$title\"" >> $conf
echo "image=/boot/$kernel" >> $conf
echo "label=\"$title\"" >> $conf
echo "initrd=/boot/$initrd" >> $conf
@@ -2170,6 +2255,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo " showopts\"" >> $conf
fi
#======================================
@@ -2209,6 +2297,9 @@
if [ "$haveLVM" = "yes" ];then
echo -n " VGROUP=$VGROUP" >> $conf
fi
+ if [ -f $mountPrefix/bin/systemd ];then
+ echo -n " init=/bin/systemd" >> $conf
+ fi
echo -n " showopts ide=nodma apm=off" >> $conf
echo " acpi=off noresume selinux=0 nosmp\"" >> $conf
fi
@@ -2252,6 +2343,9 @@
# create the /sysconfig/network file according to the PXE
# boot interface.
# ----
+ if [ -z "$PXE_IFACE" ];then
+ return
+ fi
local prefix=$1
local niface=$prefix/etc/sysconfig/network/ifcfg-$PXE_IFACE
mkdir -p $prefix/etc/sysconfig/network
@@ -2442,9 +2536,18 @@
[ ! "$partMount" = "x" ] && \
[ ! "$partMount" = "/" ]
then
- device=$(ddn $DISK $count)
+ if [ ! -z "$RAID" ];then
+ device=/dev/md$((count - 1))
+ else
+ device=$(ddn $DISK $count)
+ fi
probeFileSystem $device
- echo "$device $partMount $FSTYPE defaults 0 0" >> $nfstab
+ if [ ! "$FSTYPE" = "luks" ] ; then
+ if [ ! -d $prefix/$partMount ];then
+ mkdir -p $prefix/$partMount
+ fi
+ echo "$device $partMount $FSTYPE defaults 0 0" >> $nfstab
+ fi
fi
done
}
@@ -2463,6 +2566,8 @@
srcprefix=/mnt
fi
local sysimg_ktempl=$srcprefix/var/adm/fillup-templates/sysconfig.kernel
+ local sysimg_ktempl2=$sysimg_ktempl-mkinitrd
+ local sysimg_ktempl3=/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
local sysimg_syskernel=$srcprefix/etc/sysconfig/kernel
local syskernel=$destprefix/etc/sysconfig/kernel
local newstyle_mkinitrd=$srcprefix/lib/mkinitrd/scripts/boot-usb.sh
@@ -2472,7 +2577,11 @@
#======================================
# check for sysconfig template file
#--------------------------------------
- if [ ! -f $sysimg_ktempl ];then
+ if \
+ [ ! -f $sysimg_ktempl ] && \
+ [ ! -f $sysimg_ktempl2 ] && \
+ [ ! -f $sysimg_ktempl3 ]
+ then
systemException \
"Can't find kernel sysconfig template in system image !" \
"reboot"
@@ -2708,27 +2817,24 @@
echo $SYSTEM_MD5STATUS | cut -f$1 -d:
}
#======================================
-# waitForUSBDeviceScan
+# waitForIdleEventQueue
#--------------------------------------
-function waitForUSBDeviceScan {
- local devices=0
- if [ ! "$HAVE_USB" = "yes" ];then
- return
- fi
- if [ ! "$SCAN_USB" = "complete" ];then
- Echo -n "Waiting for USB device scan to complete..."
- while \
- [ $(dmesg|grep -c 'usb-storage: device scan complete') -lt 1 ] && \
- [ $devices -lt 15 ]
- do
- echo -n .
- sleep 1
- devices=$(( $devices + 1 ))
- done
- echo
+function waitForIdleEventQueue {
+ local devs=0
+ local p_devs=1
+ local timeout=5
+ Echo -n "Waiting for devices to settle..."
+ while true;do
udevPending
- SCAN_USB=complete
- fi
+ devs=$(ls -1 /dev | wc -l)
+ if [ $devs -eq $p_devs ];then
+ break
+ fi
+ p_devs=$devs
+ sleep $timeout
+ echo -n .
+ done
+ echo
}
#======================================
# probeUSB
@@ -2737,9 +2843,6 @@
local module=""
local stdevs=""
local hwicmd="/usr/sbin/hwinfo"
- export HAVE_USB="no"
- export SCAN_USB="not-started"
- udevPending
if [ $HAVE_MODULES_ORDER = 0 ];then
#======================================
# load host controller modules
@@ -2794,19 +2897,16 @@
modprobe $i &>/dev/null
done
fi
- if [ -e /sys/bus/usb/devices ];then
- stdevs=$(ls -1 /sys/bus/usb/devices/ | wc -l)
- if [ $stdevs -gt 0 ];then
- export HAVE_USB="yes"
- fi
- fi
- waitForUSBDeviceScan
}
#======================================
# probeDevices
#--------------------------------------
function probeDevices {
local skipUSB=$1
+ udevPending
+ if [ $HAVE_MODULES_ORDER = 0 ];then
+ waitForIdleEventQueue
+ fi
#======================================
# probe USB devices and load modules
#--------------------------------------
@@ -2884,10 +2984,13 @@
#======================================
# Manual loading of modules
#--------------------------------------
- for i in rd brd edd dm-mod xennet xenblk virtio_blk;do
+ for i in rd brd edd dm-mod xennet xenblk virtio_blk loop;do
modprobe $i &>/dev/null
done
udevPending
+ if [ $HAVE_MODULES_ORDER = 0 ];then
+ waitForIdleEventQueue
+ fi
}
#======================================
# CDDevice
@@ -2914,7 +3017,7 @@
test -z $cddev && cddev=$i || cddev=$cddev:$i
fi
done
- if [ ! -z "$cddev" ] || [ $count -eq 12 ]; then
+ if [ ! -z "$cddev" ] || [ $count -eq 4 ]; then
break
else
echo -n .
@@ -2924,15 +3027,6 @@
udevPending
done
echo
- if [ -z "$cddev" ];then
- USBStickDevice
- if [ $stickFound = 0 ];then
- systemException \
- "Failed to detect CD/DVD or USB drive !" \
- "reboot"
- fi
- cddev=$stickDevice
- fi
}
#======================================
# USBStickDevice
@@ -2943,7 +3037,6 @@
#======================================
# search for USB removable devices
#--------------------------------------
- waitForUSBDeviceScan
for device in /sys/bus/usb/drivers/usb-storage/*;do
if [ ! -L $device ];then
continue
@@ -3086,121 +3179,194 @@
echo "1"
}
#======================================
-# CDMount
+# searchImageCDMedia
#--------------------------------------
-function CDMount {
+function searchImageCDMedia {
# /.../
- # search all CD/DVD drives and use the one we can find
- # the CD configuration on. This also includes hybrid
- # devices which appears as a disk
+ # search for the first CD/DVD device which
+ # contains a KIWI image signature
# ----
+ local IFS
local count=0
- local ecode=0
- local cdopt
- mkdir -p /cdrom
- if [ -f /.profile ];then
- importFile < /.profile
- fi
#======================================
- # check for hybrid mbr ID
+ # lookup devices from hwinfo
#--------------------------------------
- if [ ! -z "$kiwi_hybrid" ];then
- searchBIOSBootDevice
- ecode=$?
- if [ ! $ecode = 0 ];then
- if [ $ecode = 2 ];then
- systemException "$biosBootDevice" "reboot"
- fi
- unset kiwi_hybrid
- fi
+ CDDevice
+ if [ -z "$cddev" ];then
+ return
fi
#======================================
- # walk through media
+ # check device contents
#--------------------------------------
- if [ -z "$kiwi_hybrid" ];then
- #======================================
- # search for CD/DVD devices
- #--------------------------------------
- CDDevice
- Echo -n "Mounting live boot drive..."
- while true;do
- IFS=":"; for i in $cddev;do
- cdopt=$(CDMountOption $i)
- if [ -x /usr/bin/driveready ];then
- driveready $i&& eval mount $cdopt -o ro $i /cdrom >/dev/null
- else
- eval mount $cdopt -o ro $i /cdrom >/dev/null
- fi
- if [ -f $LIVECD_CONFIG ];then
- cddev=$i; echo
- #======================================
- # run mediacheck if requested and boot
- #--------------------------------------
- if [ "$mediacheck" = 1 ]; then
- test -e /proc/splash && echo verbose > /proc/splash
- checkmedia $cddev
- Echo -n "Press ENTER for reboot: "; read nope
- /sbin/reboot -f -i >/dev/null
- fi
- #======================================
- # device found go with it
- #--------------------------------------
- IFS=$IFS_ORIG
- return
- fi
- umount $i &>/dev/null
- done
- IFS=$IFS_ORIG
- if [ $count -eq 12 ]; then
- break
+ Echo -n "Checking CD/DVD device(s)..."
+ while true;do
+ IFS=":" ; for i in $cddev;do
+ cdopt=$(CDMountOption $i)
+ if [ -x /usr/bin/driveready ];then
+ driveready $i&& eval mount $cdopt -o ro $i /cdrom >/dev/null
else
- echo -n .
- sleep 1
+ eval mount $cdopt -o ro $i /cdrom >/dev/null
fi
- count=`expr $count + 1`
- done
- else
- #======================================
- # search for hybrid device
- #--------------------------------------
- if [ "$kiwi_hybridpersistent" = "yes" ];then
- protectedDevice=$(echo $biosBootDevice | sed -e s@/dev/@@)
- protectedDisk=$(cat /sys/block/$protectedDevice/ro)
- if [ $protectedDisk = "0" ];then
- createHybridPersistent $biosBootDevice
+ if [ -f $LIVECD_CONFIG ];then
+ cddev=$i; echo
+ umount $i &>/dev/null
+ return
fi
+ umount $i &>/dev/null
+ done
+ if [ $count -eq 3 ]; then
+ break
+ else
+ echo -n .
+ sleep 1
fi
- cddev=$(ddn "${biosBootDevice}" "$(GetBootable "${biosBootDevice}")")
- Echo -n "Mounting hybrid live boot drive ${cddev}..."
- kiwiMount "$cddev" "/cdrom" "-o ro"
- if [ -f $LIVECD_CONFIG ];then
- echo
- #======================================
- # run mediacheck if requested and boot
- #--------------------------------------
- if [ "$mediacheck" = 1 ]; then
- test -e /proc/splash && echo verbose > /proc/splash
- checkmedia $cddev
- Echo -n "Press ENTER for reboot: "; read nope
- /sbin/reboot -f -i >/dev/null
- fi
- #======================================
- # search hybrid for a write partition
- #--------------------------------------
- export HYBRID_RW=$(ddn $biosBootDevice $HYBRID_PERSISTENT_PART)
- #======================================
- # LIVECD_CONFIG found go with it
- #--------------------------------------
- return
+ count=$(($count + 1))
+ done
+ unset cddev
+ echo "not found"
+}
+#======================================
+# searchImageUSBMedia
+#--------------------------------------
+function searchImageUSBMedia {
+ # /.../
+ # search for the first USB device which
+ # contains a KIWI image signature
+ # ----
+ USBStickDevice
+ Echo -n "Checking USB device(s)..."
+ if [ ! $stickFound = 0 ];then
+ cddev=$stickDevice; echo
+ return
+ fi
+ echo "not found"
+}
+#======================================
+# searchImageHybridMedia
+#--------------------------------------
+function searchImageHybridMedia {
+ # /.../
+ # search for the first disk device which
+ # contains a KIWI image signature
+ # ----
+ local ecode
+ local hddev
+ #======================================
+ # check for hybrid configuration
+ #--------------------------------------
+ if [ -z "$kiwi_hybrid" ];then
+ return
+ fi
+ #======================================
+ # check for hybrid mbr ID
+ #--------------------------------------
+ searchBIOSBootDevice
+ ecode=$?
+ Echo -n "Checking Hybrid disk device(s)..."
+ if [ ! $ecode = 0 ];then
+ if [ $ecode = 2 ];then
+ systemException "$biosBootDevice" "reboot"
fi
+ echo "not found"
+ return
+ fi
+ #======================================
+ # check image signature
+ #--------------------------------------
+ hddev=$(ddn "${biosBootDevice}" "$(GetBootable "${biosBootDevice}")")
+ kiwiMount "$hddev" "/cdrom" "-o ro"
+ if [ -f $LIVECD_CONFIG ];then
+ cddev=$hddev; echo
umount $cddev &>/dev/null
+ return
fi
- echo
+ umount $hddev &>/dev/null
+ echo "not found"
+}
+#======================================
+# CDMount
+#--------------------------------------
+function CDMount {
+ # /.../
+ # search all CD/DVD drives and use the one we can find
+ # the CD configuration on. This also includes hybrid
+ # devices which appears as a disk
+ # ----
+ local mode=$1
+ mkdir -p /cdrom
+ #======================================
+ # 1) CD/DVD devices
+ #--------------------------------------
+ searchImageCDMedia
+ if [ ! -z "$cddev" ];then
+ eval mount $cdopt -o ro $cddev /cdrom 1>&2
+ if [ "$mode" = "install" ];then
+ # /.../
+ # if we found an install CD/DVD any disk device
+ # is free to serve as install target
+ # ----
+ unset imageDiskDevice
+ fi
+ return
+ fi
+ #======================================
+ # 2) hybrid disk devices
+ #--------------------------------------
+ searchImageHybridMedia
+ if [ ! -z "$cddev" ];then
+ setupHybridPersistent
+ kiwiMount "$cddev" "/cdrom" "-o ro" 1>&2
+ return
+ fi
+ #======================================
+ # Bad news
+ #--------------------------------------
systemException \
"Couldn't find Live image configuration file" \
"reboot"
}
#======================================
+# runMediaCheck
+#--------------------------------------
+function runMediaCheck {
+ # /.../
+ # run checkmedia program on the specified device
+ # ----
+ local device=$1
+ if [ ! "$mediacheck" = 1 ]; then
+ return
+ fi
+ test -e /proc/splash && echo verbose > /proc/splash
+ checkmedia $device
+ Echo -n "Press ENTER for reboot: "; read nope
+ /sbin/reboot -f -i >/dev/null
+}
+#======================================
+# setupHybridFeatures
+#--------------------------------------
+function setupHybridPersistent {
+ # /.../
+ # create a write partition for hybrid images if requested
+ # and store the device name in HYBRID_RW
+ # ----
+ local protectedDevice
+ local protectedDisk
+ #======================================
+ # create write partition for hybrid
+ #--------------------------------------
+ if [ "$kiwi_hybridpersistent" = "yes" ];then
+ protectedDevice=$(echo $biosBootDevice | sed -e s@/dev/@@)
+ protectedDisk=$(cat /sys/block/$protectedDevice/ro)
+ if [ $protectedDisk = "0" ];then
+ createHybridPersistent $biosBootDevice
+ fi
+ fi
+ #======================================
+ # store hybrid write partition device
+ #--------------------------------------
+ export HYBRID_RW=$(ddn $biosBootDevice $HYBRID_PERSISTENT_PART)
+}
+#======================================
# CDUmount
#--------------------------------------
function CDUmount {
@@ -3245,8 +3411,7 @@
#--------------------------------------
function searchBusIDBootDevice {
# /.../
- # if searchBIOSBootDevice did not return a result this
- # function is called to check for a DASD or ZFCP device
+ # check for a DASD or ZFCP devices
# like they exist on the s390 architecture. If found the
# device is set online and the biosBootDevice variable
# is set to this device for further processing
@@ -3257,6 +3422,17 @@
local wwpn
local slun
#======================================
+ # check for custom device init command
+ #--------------------------------------
+ if [ ! -z "$DEVICE_INIT" ];then
+ if ! eval $DEVICE_INIT;then
+ export biosBootDevice="Failed to call: $DEVICE_INIT"
+ return 1
+ fi
+ export biosBootDevice=$DISK
+ return 0
+ fi
+ #======================================
# determine device type: dasd or zfcp
#--------------------------------------
if [ -z "$ipl_type" ];then
@@ -3314,40 +3490,49 @@
return 0
}
#======================================
-# searchBIOSBootDevice
+# lookupDiskDevices
#--------------------------------------
-function searchBIOSBootDevice {
+function lookupDiskDevices {
# /.../
- # search for the BIOS boot device which is the device
- # with the BIOS id 0x80. The test may fail if the boot
- # device is a CD/DVD drive. If the test fails we search
- # for the MBR disk label and compare it with the kiwi
- # written mbrid file in /boot/grub/ of the system image
+ # use hwinfo to search for disk device nodes
# ----
- IFS=$IFS_ORIG
local h=/usr/sbin/hwinfo
local c="Device File:|BIOS id"
- local ddevs=`$h --disk|grep -E "$c"|sed -e"s@(.*)@@"|cut -f2 -d:|tr -d " "`
- local cmpd=/tmp/mbrids
- local ifix=0
- local matched
- local bios
- local file
+ udevPending
+ diskDevices=$($h --disk | \
+ grep -E "$c" | sed -e"s@(.*)@@" | cut -f2 -d: | tr -d " ")
+}
+#======================================
+# lookupBiosBootDevice
+#--------------------------------------
+function lookupBiosBootDevice {
+ # /.../
+ # check for devices which have 0x80 bios flag assigned
+ # ----
+ local curd
local pred
- #======================================
- # Store device with BIOS id 0x80
- #--------------------------------------
- for curd in $ddevs;do
+ for curd in $diskDevices;do
if [ $curd = "0x80" ];then
- bios=$pred; break
+ bios=$pred
+ return
fi
pred=$curd
done
- #======================================
- # Search and copy all mbrid files
- #--------------------------------------
+}
+#======================================
+# storeIDFiles
+#--------------------------------------
+function storeIDFiles {
+ # /.../
+ # store mbrid from the devices into files
+ # ----
+ local cmpd=/tmp/mbrids
+ local ifix=0
+ local curd
+ local id
+ local dev
mkdir -p $cmpd
- for curd in $ddevs;do
+ for curd in $diskDevices;do
if [ ! $(echo $curd | cut -c 1) = "/" ];then
continue
fi
@@ -3365,46 +3550,107 @@
umount /mnt
done
done
+}
+#======================================
+# searchBIOSBootDevice
+#--------------------------------------
+function searchBIOSBootDevice {
+ # /.../
+ # search for the boot device. The edd 0x80 information
+ # is used here but not trusted. Trusted is the MBR disk
+ # disk label which is compared with the kiwi written
+ # mbrid file in /boot/grub/ of the system image
+ # ----
+ IFS=$IFS_ORIG
+ local cmpd=/tmp/mbrids
+ local ifix
+ local match_count
+ local matched
+ local curd
+ local file
+ local mbrML
+ local mbrMB
+ local mbrI
+ local try_count=0
#======================================
- # Read mbrid from the newest mbrid file
- #--------------------------------------
- file=$(ls -1t $cmpd 2>/dev/null | head -n 1)
- if [ -z "$file" ];then
- export biosBootDevice="Failed to find MBR identifier !"
- return 1
- fi
- read mbrI < $cmpd/$file
- #======================================
- # Compare ID with MBR entry
+ # Lookup until found
#--------------------------------------
- ifix=0
- for curd in $ddevs;do
- if [ ! -b $curd ];then
- continue
+ while true;do
+ #======================================
+ # initialize variables
+ #--------------------------------------
+ ifix=0
+ match_count=0
+ try_count=$((try_count + 1))
+ #======================================
+ # stop after a long time of retry
+ #--------------------------------------
+ if [ $try_count -eq 30 ];then
+ export biosBootDevice="Failed to find boot device !"
+ return 1
fi
- mbrML=`dd if=$curd bs=1 count=4 skip=$((0x1b8))|hexdump -n4 -e '"0x%08x"'`
- mbrMB=`echo $mbrML | sed 's/^0x\(..\)\(..\)\(..\)\(..\)$/0x\4\3\2\1/'`
- if [ "$mbrML" = "$mbrI" ] || [ "$mbrMB" = "$mbrI" ];then
- ifix=1
- matched=$curd
- if [ "$mbrML" = "$mbrI" ];then
- export masterBootID=$mbrML
- fi
- if [ "$mbrMB" = "$mbrI" ];then
- export masterBootID=$mbrMB
+ #======================================
+ # create device list
+ #--------------------------------------
+ lookupDiskDevices
+ lookupBiosBootDevice
+ #======================================
+ # store MBR id files from device list
+ #--------------------------------------
+ storeIDFiles
+ #======================================
+ # Read mbrid from the newest mbrid file
+ #--------------------------------------
+ file=$(ls -1t $cmpd 2>/dev/null | head -n 1)
+ if [ -z "$file" ];then
+ export biosBootDevice="Failed to find MBR identifier !"
+ sleep 1; continue
+ fi
+ #======================================
+ # Compare ID with MBR entry
+ #--------------------------------------
+ read mbrI < $cmpd/$file
+ for curd in $diskDevices;do
+ if [ ! -b $curd ];then
+ continue
fi
- if [ "$curd" = "$bios" ];then
- export biosBootDevice=$curd
- return 0
+ mbrML=$(dd if=$curd bs=1 count=4 skip=$((0x1b8)) | \
+ hexdump -n4 -e '"0x%08x"')
+ mbrMB=$(echo $mbrML | \
+ sed 's/^0x\(..\)\(..\)\(..\)\(..\)$/0x\4\3\2\1/')
+ if [ "$mbrML" = "$mbrI" ] || [ "$mbrMB" = "$mbrI" ];then
+ ifix=1
+ matched=$curd
+ match_count=$(($match_count + 1))
+ if [ "$mbrML" = "$mbrI" ];then
+ export masterBootID=$mbrML
+ fi
+ if [ "$mbrMB" = "$mbrI" ];then
+ export masterBootID=$mbrMB
+ fi
+ if [ "$curd" = "$bios" ];then
+ export biosBootDevice=$curd
+ return 0
+ fi
fi
+ done
+ #======================================
+ # Multiple matches are bad
+ #--------------------------------------
+ if [ $match_count -gt 1 ];then
+ export biosBootDevice="multiple devices matches same MBR ID: $mbrI"
+ return 2
+ fi
+ #======================================
+ # Found it...
+ #--------------------------------------
+ if [ $ifix -eq 1 ];then
+ export biosBootDevice=$matched
+ return 0
fi
+ export biosBootDevice="No devices matches MBR ID: $mbrI !"
+ sleep 1
done
- if [ $ifix -eq 1 ];then
- export biosBootDevice=$matched
- return 0
- fi
- export biosBootDevice="No devices matches MBR identifier: $mbrI !"
- return 2
}
#======================================
# searchVolumeGroup
@@ -3419,12 +3665,8 @@
if [ ! "$kiwi_lvm" = "true" ];then
return 1
fi
- Echo "Searching for $VGROUP volume group..."
- if vgscan 2>&1 | grep -q "$VGROUP"; then
- vgchange -a y $VGROUP
- return $?
- fi
- return 1
+ Echo "Activating $VGROUP volume group..."
+ vgchange -a y $VGROUP
}
#======================================
# searchSwapSpace
@@ -3450,32 +3692,6 @@
done
}
#======================================
-# searchDiskSpace
-#--------------------------------------
-function searchDiskSpace {
- # /.../
- # search for a free non swap partition
- # ----
- if [ ! -z $kiwinoswapsearch ];then
- return
- fi
- local hwapp=/usr/sbin/hwinfo
- local diskdevs=`$hwapp --disk | grep "Device File:" | cut -f2 -d:`
- diskdevs=`echo $diskdevs | sed -e "s@(.*)@@"`
- for diskdev in $diskdevs;do
- for disknr in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15;do
- id=`partitionID $diskdev $disknr`
- if [ -z $id ];then
- id=0
- fi
- if [ "$id" -ne 82 ] && [ "$id" -ne 0 ];then
- echo $diskdev$disknr
- return
- fi
- done
- done
-}
-#======================================
# updateMTAB
#--------------------------------------
function updateMTAB {
@@ -3485,7 +3701,11 @@
mount -t proc proc /proc
umount=1
fi
- cat /proc/mounts > $prefix/etc/mtab
+ if [ -e /proc/self/mounts ];then
+ pushd $prefix/etc >/dev/null
+ rm -f mtab && ln -s /proc/self/mounts mtab
+ popd >/dev/null
+ fi
if [ $umount -eq 1 ];then
umount /proc
fi
@@ -3698,16 +3918,16 @@
qeth_cmd="$qeth_cmd -l"
fi
if [ -n "$portname" ];then
- qeth_cmd="$qeth_cmd -p$portname"
+ qeth_cmd="$qeth_cmd -p $portname"
fi
if [ -n "$portno" ];then
- qeth_cmd="$qeth_cmd -n$portno"
+ qeth_cmd="$qeth_cmd -n $portno"
fi
qeth_cmd="$qeth_cmd $readchannel $writechannel"
if [ -n "$datachannel" ];then
qeth_cmd="$qeth_cmd $datachannel"
fi
- $qeth_cmd 1
+ eval $qeth_cmd 1
;;
"ctc")
/sbin/ctc_configure $readchannel $writechannel 1 $ctcprotocol
@@ -3725,6 +3945,34 @@
"Failed to bring up the network: $instnetdev" \
"reboot"
fi
+ udevPending
+}
+#======================================
+# convertCIDRToNetmask
+#--------------------------------------
+function convertCIDRToNetmask {
+ # /.../
+ # convert the CIDR part to a useable netmask
+ # ----
+ local cidr=$1
+ local count=0
+ for count in `seq 1 4`;do
+ if [ $((cidr / 8)) -gt 0 ];then
+ echo -n 255
+ else
+ local remainder=$((cidr % 8))
+ if [ $remainder -gt 0 ];then
+ echo -n $(( value = 256 - (256 >> remainder)))
+ else
+ echo -n 0
+ fi
+ fi
+ cidr=$((cidr - 8))
+ if [ $count -lt 4 ];then
+ echo -n .
+ fi
+ done
+ echo
}
#======================================
# setupNetworkStatic
@@ -3735,7 +3983,15 @@
# or save the configuration depending on 'up' parameter
# ----
local up=$1
- if [ "$up" == "1" ];then
+ if [[ $hostip =~ / ]];then
+ #======================================
+ # interpret the CIDR part and remove it from the hostip
+ #--------------------------------------
+ local cidr=$(echo $hostip | cut -f2 -d/)
+ hostip=$(echo $hostip | cut -f1 -d/)
+ netmask=$(convertCIDRToNetmask $cidr)
+ fi
+ if [ "$up" = "1" ];then
#======================================
# activate network
#--------------------------------------
@@ -3754,11 +4010,12 @@
if [ ! $? = 0 ];then
systemException "Failed to set up the network: $iface" "reboot"
fi
- else
+ export iface_static=$iface
+ elif [ ! -z $iface_static ];then
#======================================
# write network setup
#--------------------------------------
- local netFile="/etc/sysconfig/network/ifcfg-$iface"
+ local netFile="/etc/sysconfig/network/ifcfg-$iface_static"
echo "BOOTPROTO='static'" > $netFile
echo "STARTMODE='auto'" >> $netFile
echo "IPADDR='$hostip'" >> $netFile
@@ -3770,7 +4027,7 @@
echo "REMOTE_IPADDR='$pointopoint'" >> $netFile
fi
fi
- setupDefaultGateway
+ setupDefaultGateway $up
setupDNS
}
#======================================
@@ -3917,7 +4174,7 @@
function fdasdGetPartitionID {
local count=1
for i in $(fdasd -s -p $1 | grep -E '^[ ]+\/' |\
- awk -v OFS=":" '$1=$1' | cut -f5 -d:);do
+ awk -v OFS=":" '$1=$1' | cut -f5 -d:);do
if [ $count = $2 ];then
if $i = 2;then
echo 82
@@ -4053,7 +4310,7 @@
# if there is a downloaded kernel and initrd from the KIWI_INITRD
# setup. the kernelList function won't find initrds that gets
# downloaded over tftp so make sure the vmlinu[zx]/initrd combo
- # gets added
+ # gets added as well as the linux.vmx/initrd.vmx combo
# ----
if [ -e $prefix/boot/vmlinuz ];then
KERNEL_LIST="vmlinuz:initrd"
@@ -4063,6 +4320,10 @@
KERNEL_LIST="vmlinux:initrd"
KERNEL_NAME[1]=vmlinux
fi
+ if [ -e $prefix/boot/linux.vmx ];then
+ KERNEL_LIST="vmlinux:initrd"
+ KERNEL_NAME[1]="vmlinux"
+ fi
fi
KERNEL_LIST=$(echo $KERNEL_LIST | sed -e s@^,@@)
export KERNEL_LIST
@@ -4207,7 +4468,11 @@
modfile=/etc/modprobe.conf.local
fi
if [ -f $modfile ];then
- sed -i -e s"@rd_size=.*@rd_size=$ramdisk_size@" $modfile
+ if grep -q rd_size $modfile;then
+ sed -i -e s"@rd_size=.*@rd_size=$ramdisk_size@" $modfile
+ else
+ echo "options brd rd_size=$ramdisk_size" >> $modfile
+ fi
fi
fi
if [ ! -z "$lang" ];then
@@ -4483,7 +4748,6 @@
fi
clic_cmd="$clic_cmd -m $haveMByte"
clic_cmd="$clic_cmd -c $HYBRID_PERSISTENT_DIR/.clicfs_COW"
- clic_cmd="$clic_cmd --ignore-cow-errors"
else
# write into a device directly
clic_cmd="$clic_cmd -m $haveMByte -c $rwDevice --ignore-cow-errors"
@@ -4607,10 +4871,10 @@
local mountDevice=$1
local loopf=$2
local roDevice=$mountDevice
- if [ "$haveLVM" = "yes" ]; then
- local rwDevice="/dev/$VGROUP/LVRoot"
- elif [ "$haveLuks" = "yes" ]; then
+ if [ "$haveLuks" = "yes" ]; then
local rwDevice="/dev/mapper/luksReadWrite"
+ elif [ "$haveLVM" = "yes" ]; then
+ local rwDevice="/dev/$VGROUP/LVRoot"
else
local rwDevice=`getNextPartition $mountDevice`
fi
@@ -4754,7 +5018,12 @@
# setup boot partition
#--------------------------------------
if [ ! "$arch" = "ppc64" ];then
- if [ "$LOCAL_BOOT" = "no" ] && [ $retval = 0 ] && [ -z "$RESTORE" ];then
+ if \
+ [ "$LOCAL_BOOT" = "no" ] && \
+ [ ! "$systemIntegrity" = "fine" ] && \
+ [ $retval = 0 ] && \
+ [ -z "$RESTORE" ]
+ then
setupBootPartition
fi
fi
@@ -4959,6 +5228,8 @@
if [ -z "$kiwistderr" ] && [ ! -z $kiwidebug ];then
Echo "Starting boot shell on $ELOG_BOOTSHELL"
setctsid -f $ELOG_BOOTSHELL /bin/bash -i
+ ELOGSHELL_PID=$(fuser $ELOG_BOOTSHELL | tr -d " ")
+ echo ELOGSHELL_PID=$ELOGSHELL_PID >> /iprocs
fi
}
#======================================
@@ -4973,9 +5244,9 @@
mount -t proc proc /proc
umountProc=1
fi
- if [ -z "$kiwistderr" ];then
+ if [ ! -z "$ELOGSHELL_PID" ];then
Echo "Stopping boot shell"
- fuser -k $ELOG_BOOTSHELL >/dev/null
+ kill $ELOGSHELL_PID &>/dev/null
fi
if [ $umountProc -eq 1 ];then
umount /proc
@@ -5032,6 +5303,77 @@
}
#======================================
+# atftpProgress
+#--------------------------------------
+function atftpProgress {
+ # /.../
+ # atftp doesn't use a stream based download and sometimes
+ # seek back and forth which makes it hard to use pipes for
+ # progress indication. Therefore we watch the trace output
+ # ----
+ local imgsize=$1 # image size in MB
+ local prefix=$2 # line prefix text
+ local file=$3 # file with progress data
+ local blocksize=$4 # blocksize use for download
+ local bytes=0 # log lines multiplied by blocksize
+ local lines=0 # log lines
+ local percent=0 # in percent of all
+ local all=$((imgsize * 1024 * 1024))
+ local line
+ local step=0
+ # number of cycles for approx. 2% steps
+ local max_step=$(($all / $blocksize / 25))
+ cat < dev/null > $file.tmp
+ #======================================
+ # print progress information
+ #--------------------------------------
+ while read line ;do
+ echo "$line" >> $file.tmp
+ let step=step+1
+ if [ $step -lt $max_step ]; then
+ continue
+ fi
+ step=0
+ # /.../
+ # the trace logs two lines indicating one download block of
+ # blocksize bytes. We assume only full blocks. At the end
+ # it might happen that only a part of blocksize bytes is
+ # required. The function does not precisely calculate them
+ # and assumes blocksize bytes. imho that's ok for the progress
+ # bar. In order to be exact the function would have to sum
+ # up all bytes from the trace log for each iteration which
+ # would cause the download to pause because it has to wait
+ # for the progress bar to get ready
+ # ----
+ # the same block can be transferred multiple times
+ lines=$(grep "^sent ACK" $file.tmp | sort -u | wc -l)
+ bytes=$((lines * $blocksize))
+ percent=$(echo "scale=2; $bytes * 100" | bc)
+ percent=$(echo "scale=0; $percent / $all" | bc)
+ echo -en "$prefix ( $percent%)\r"
+ done
+ grep -v "^\(received \)\|\(sent \)" $file.tmp > $file
+ rm $file.tmp
+ echo
+}
+
+#======================================
+# encodeURL
+#--------------------------------------
+function encodeURL {
+ # /.../
+ # encode special characters in URL's to correctly
+ # serve as input for fetchFile and putFile
+ # ----
+ local STR
+ local CH
+ STR="$@"
+ echo -n "$STR" | while read -n1 CH; do
+ [[ $CH =~ [-_A-Za-z0-9./] ]] && printf "$CH" || printf "%%%x" \'"$CH"
+ done
+}
+
+#======================================
# fetchFile
#--------------------------------------
function fetchFile {
@@ -5046,8 +5388,10 @@
local host=$4
local type=$5
local chunk=$6
+ local encoded_path
local dump
local call
+ local call_pid
if test -z "$chunk";then
chunk=4k
fi
@@ -5068,20 +5412,21 @@
fi
fi
if test "$izip" = "compressed"; then
- path=$(echo $path | sed -e s@\\.gz@@)
+ path=$(echo "$path" | sed -e s@\\.gz@@)
path="$path.gz"
fi
+ encoded_path=$(encodeURL "$path")
#======================================
# setup progress meta information
#--------------------------------------
- dump="dd bs=$chunk of=$dest"
+ dump="dd bs=$chunk of=\"$dest\""
showProgress=0
- if [ -x /usr/bin/dcounter ] && [ -f /etc/image.md5 ];then
+ if [ -x /usr/bin/dcounter ] && [ -f /etc/image.md5 ] && [ -b "$dest" ];then
showProgress=1
read sum1 blocks blocksize zblocks zblocksize < /etc/image.md5
needBytes=`expr $blocks \* $blocksize`
needMByte=`expr $needBytes / 1048576`
- progressBaseName=$(basename $path)
+ progressBaseName=$(basename "$path")
TEXT_LOAD=$(getText "Loading %1" "$progressBaseName")
dump="dcounter -s $needMByte -l \"$TEXT_LOAD \" 2>/progress | $dump"
fi
@@ -5091,28 +5436,34 @@
case "$type" in
"http")
if test "$izip" = "compressed"; then
- call="curl -f http://$host/$path 2>$TRANSFER_ERRORS_FILE |\
+ call="curl -f http://$host/$encoded_path \
+ 2>$TRANSFER_ERRORS_FILE |\
gzip -d 2>>$TRANSFER_ERRORS_FILE | $dump"
else
- call="curl -f http://$host/$path 2> $TRANSFER_ERRORS_FILE |\
+ call="curl -f http://$host/$encoded_path \
+ 2>$TRANSFER_ERRORS_FILE |\
$dump"
fi
;;
"https")
if test "$izip" = "compressed"; then
- call="curl -f -k https://$host/$path 2>$TRANSFER_ERRORS_FILE |\
+ call="curl -f -k https://$host/$encoded_path \
+ 2>$TRANSFER_ERRORS_FILE |\
gzip -d 2>>$TRANSFER_ERRORS_FILE | $dump"
else
- call="curl -f -k https://$host/$path 2> $TRANSFER_ERRORS_FILE |\
+ call="curl -f -k https://$host/$encoded_path \
+ 2>$TRANSFER_ERRORS_FILE |\
$dump"
fi
;;
"ftp")
if test "$izip" = "compressed"; then
- call="curl ftp://$host/$path 2>$TRANSFER_ERRORS_FILE |\
+ call="curl ftp://$host/$encoded_path \
+ 2>$TRANSFER_ERRORS_FILE |\
gzip -d 2>>$TRANSFER_ERRORS_FILE | $dump"
else
- call="curl ftp://$host/$path 2> $TRANSFER_ERRORS_FILE |\
+ call="curl ftp://$host/$encoded_path \
+ 2>$TRANSFER_ERRORS_FILE |\
$dump"
fi
;;
@@ -5130,15 +5481,27 @@
# mutlicast is disabled because you can't seek in a pipe
# atftp is disabled because it doesn't work with pipes
call="busybox tftp \
- -b $imageBlkSize -g -r $path \
+ -b $imageBlkSize -g -r \"$path\" \
-l >(gzip -d 2>>$TRANSFER_ERRORS_FILE | $dump) \
$host 2>>$TRANSFER_ERRORS_FILE"
else
- call="atftp \
- --option \"$multicast_atftp\" \
- --option \"blksize $imageBlkSize\" \
- -g -r $path -l >($dump) \
- $host &> $TRANSFER_ERRORS_FILE"
+ if [ $showProgress -eq 1 ];then
+ call="atftp \
+ --trace \
+ --option \"$multicast_atftp\" \
+ --option \"blksize $imageBlkSize\" \
+ -g -r \"$path\" -l \"$dest\" $host 2>&1 | \
+ atftpProgress \
+ $needMByte \"$TEXT_LOAD\" \
+ $TRANSFER_ERRORS_FILE $imageBlkSize \
+ > /progress"
+ else
+ call="atftp \
+ --option \"$multicast_atftp\" \
+ --option \"blksize $imageBlkSize\" \
+ -g -r \"$path\" -l \"$dest\" $host \
+ &> $TRANSFER_ERRORS_FILE"
+ fi
fi
;;
*)
@@ -5150,21 +5513,31 @@
#--------------------------------------
if [ $showProgress -eq 1 ];then
test -e /progress || mkfifo /progress
+ test -e /tmp/load_code && rm -f /tmp/load_code
errorLogStop
(
eval $call &>/dev/null
- loadCode=$?
+ echo $? > /tmp/load_code
)&
+ call_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
clear
+ wait $call_pid
+ loadCode=`cat /tmp/load_code`
+ if [ -z "$loadCode" ]; then
+ systemException \
+ "Failed to get the download process return value" \
+ "reboot"
+ fi
else
eval $call
loadCode=$?
@@ -5188,6 +5561,7 @@
local dest=$2
local host=$3
local type=$4
+ local encoded_dest
if test -z "$path"; then
systemException "No path specified" "reboot"
fi
@@ -5204,21 +5578,25 @@
type="$SERVERTYPE"
fi
fi
+ encoded_dest=$(encodeURL "$dest")
case "$type" in
"http")
- curl -f -T $path http://$host/$dest > $TRANSFER_ERRORS_FILE 2>&1
+ curl -f -T "$path" http://$host/$encoded_dest \
+ > $TRANSFER_ERRORS_FILE 2>&1
return $?
;;
"https")
- curl -f -T $path https://$host/$dest > $TRANSFER_ERRORS_FILE 2>&1
+ curl -f -T "$path" https://$host/$encoded_dest \
+ > $TRANSFER_ERRORS_FILE 2>&1
return $?
;;
"ftp")
- curl -T $path ftp://$host/$dest > $TRANSFER_ERRORS_FILE 2>&1
+ curl -T "$path" ftp://$host/$encoded_dest \
+ > $TRANSFER_ERRORS_FILE 2>&1
return $?
;;
"tftp")
- atftp -p -l $path -r $dest $host >/dev/null 2>&1
+ atftp -p -l "$path" -r "$dest" $host >/dev/null 2>&1
return $?
;;
*)
@@ -5547,6 +5925,16 @@
local reboot=no
local option=$@
#======================================
+ # check for init kernel option
+ #--------------------------------------
+ if [ -z "$init" ];then
+ if [ -f /mnt/bin/systemd ];then
+ export init=/bin/systemd
+ else
+ export init=/sbin/init
+ fi
+ fi
+ #======================================
# turn runlevel 4 to 5 if found
#--------------------------------------
option=$(echo $@ | sed -e s@4@5@)
@@ -5598,7 +5986,7 @@
exec /lib/mkinitrd/bin/run-init -c /dev/console /mnt /bin/bash -c \
"/preinit ; . /include ; cleanImage ; exec /sbin/reboot -f -i"
fi
- if [ $rebootinter = "yes" ];then
+ if [ "$rebootinter" = "yes" ];then
Echo "Reboot requested... rebooting after preinit"
if [ "$OEMInstallType" = "CD" ];then
TEXT_DUMP=$TEXT_CDPULL
@@ -5613,12 +6001,12 @@
exec /lib/mkinitrd/bin/run-init -c /dev/console /mnt /bin/bash -c \
"/preinit ; . /include ; cleanImage ; exec /sbin/reboot -f -i"
fi
- if [ $shutdown = "yes" ];then
+ if [ "$shutdown" = "yes" ];then
Echo "Shutdown requested... system shutdown after preinit"
exec /lib/mkinitrd/bin/run-init -c /dev/console /mnt /bin/bash -c \
"/preinit ; . /include ; cleanImage ; exec /sbin/halt -fihp"
fi
- if [ $shutdowninter = "yes" ];then
+ if [ "$shutdowninter" = "yes" ];then
Echo "Shutdown requested... system shutdown after preinit"
if [ "$OEMInstallType" = "CD" ];then
TEXT_DUMP=$TEXT_CDPULL_SDOWN
@@ -5633,13 +6021,16 @@
exec /lib/mkinitrd/bin/run-init -c /dev/console /mnt /bin/bash -c \
"/preinit ; . /include ; cleanImage ; exec /sbin/halt -fihp"
fi
- # FIXME: clicfs / nfsroot doesn't like run-init
- if [ ! "$haveClicFS" = "yes" ] && [ -z "$NFSROOT" ];then
+ # FIXME: clicfs / nfsroot / RHEL doesn't like run-init
+ if \
+ [ ! "$haveClicFS" = "yes" ] && [ -z "$NFSROOT" ] && \
+ [ ! -e /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]
+ then
exec /lib/mkinitrd/bin/run-init -c /dev/console /mnt /bin/bash -c \
- "/preinit ; . /include ; cleanImage ; exec /sbin/init $option"
+ "/preinit ; . /include ; cleanImage ; exec $init $option"
else
cd /mnt && exec chroot . /bin/bash -c \
- "/preinit ; . /include ; cleanImage ; exec /sbin/init $option"
+ "/preinit ; . /include ; cleanImage ; exec $init $option"
fi
}
#======================================
@@ -5655,8 +6046,10 @@
local rwDevice=`getDiskID $1`
local roDevice=`getDiskID $2`
local unionFST=$3
- rwDeviceLuks=$(luksOpen $rwDevice luksReadWrite)
- roDeviceLuks=$(luksOpen $roDevice luksReadOnly)
+ luksOpen $rwDevice luksReadWrite
+ rwDeviceLuks=$luksDeviceOpened
+ luksOpen $roDevice luksReadOnly
+ roDeviceLuks=$luksDeviceOpened
if [ ! $rwDeviceLuks = $rwDevice ];then
rwDevice=$rwDeviceLuks
export haveLuks="yes"
@@ -5733,9 +6126,6 @@
# underscores. current bootloaders show the
# underscore sign as as space in the boot menu
# ---
- if [ -z "$loader" ];then
- loader="grub"
- fi
if [ ! $loader = "syslinux" ] && [ ! $loader = "extlinux" ];then
echo $1 | tr " " "_"
else
@@ -5821,31 +6211,68 @@
# ----
local ldev=$1
local name=$2
+ local retry=1
local info
- if [ -z $name ];then
- name=luksroot
+ #======================================
+ # no map name set, build it from device
+ #--------------------------------------
+ if [ -z "$name" ];then
+ name=luks_$(basename $ldev)
fi
+ #======================================
+ # luks map already exists, return
+ #--------------------------------------
if [ -e /dev/mapper/$name ];then
- echo /dev/mapper/$name; return
+ export luksDeviceOpened=/dev/mapper/$name
+ return
fi
+ #======================================
+ # check device for luks extension
+ #--------------------------------------
if ! cryptsetup isLuks $ldev &>/dev/null;then
- echo $ldev; return
+ export luksDeviceOpened=$ldev
+ return
fi
+ #======================================
+ # ask for passphrase if not cached
+ #--------------------------------------
while true;do
- if [ ! -e /tmp/luks ];then
- LUKS_OPEN=$(runInteractive \
+ if [ -z "$luks_pass" ];then
+ Echo "Try: $retry"
+ errorLogStop
+ luks_pass=$(runInteractive \
"--stdout --insecure --passwordbox "\"$TEXT_LUKS\"" 10 60"
)
- echo $LUKS_OPEN > /tmp/luks
+ errorLogContinue
fi
- info=$(cat /tmp/luks | cryptsetup luksOpen $ldev $name 2>&1)
- if [ $? = 0 ];then
+ if echo "$luks_pass" | cryptsetup luksOpen $ldev $name;then
break
fi
- rm -f /tmp/luks
- Dialog --stdout --timeout 10 --msgbox "\"Error: $info\"" 8 60
+ unset luks_pass
+ if [ -n "$luks_open_can_fail" ]; then
+ unset luksDeviceOpened
+ return 1
+ fi
+ if [ $retry -eq 3 ];then
+ systemException \
+ "Max retries reached... reboot" \
+ "reboot"
+ fi
+ retry=$(($retry + 1))
done
- echo /dev/mapper/$name
+ #======================================
+ # wait for the luks map to appear
+ #--------------------------------------
+ if ! waitForStorageDevice /dev/mapper/$name &>/dev/null;then
+ systemException \
+ "LUKS map /dev/mapper/$name doesn't appear... fatal !" \
+ "reboot"
+ fi
+ #======================================
+ # store luks device and return
+ #--------------------------------------
+ export luksDeviceOpened=/dev/mapper/$name
+ return 0
}
#======================================
# luksResize
@@ -5873,7 +6300,18 @@
# /.../
# close all open LUKS mappings
# ----
- local name
+ local name=$1
+ #======================================
+ # close specified name if set
+ #--------------------------------------
+ if [ -n "$1" ]; then
+ name=$(basename $1)
+ cryptsetup luksClose $name
+ return
+ fi
+ #======================================
+ # close all luks* map names
+ #--------------------------------------
for i in /dev/mapper/luks*;do
name=$(basename $i)
cryptsetup luksClose $name
@@ -5915,9 +6353,6 @@
local en_GB=English
local code
local lang
- if [ -f /.profile ];then
- importFile < /.profile
- fi
if [ ! -z "$kiwi_oemunattended" ] && [ "$DIALOG_LANG" = "ask" ];then
DIALOG_LANG=en_US
fi
@@ -5996,52 +6431,47 @@
function displayEULA {
# /.../
# display in a dialog window the text part of the
- # selected language file or the default file
- # /license.txt or /EULA.txt
+ # selected language file(s). The files are searched
+ # by the names in kiwi_showlicense
# ----
local code=$(echo $DIALOG_LANG | cut -f1 -d_)
- #======================================
- # check license files
- #--------------------------------------
- local files=$(find /license.*txt 2>/dev/null)
- if [ -z "$files" ];then
- return
+ if [ -z "$kiwi_showlicense" ];then
+ kiwi_showlicense="license EULA"
fi
- #======================================
- # use selected file or default
- #--------------------------------------
- code=/license.$code.txt
- if [ ! -f $code ];then
- code=/license.txt
+ for name in $kiwi_showlicense;do
+ #======================================
+ # select license file by name
+ #--------------------------------------
+ code=/$name.$code.txt
if [ ! -f $code ];then
- code=/EULA.txt
+ code=/$name.txt
fi
- fi
- #======================================
- # check selected file and show it
- #--------------------------------------
- if [ ! -f $code ];then
- Echo "License file $code not found... skipped"
- return
- fi
- while true;do
- Dialog --textbox $code 20 70 \
- --and-widget --extra-button \
- --extra-label "$TEXT_NO" \
- --ok-label "$TEXT_YES" \
- --cancel-label "$TEXT_CANCEL" \
- --yesno "\"$TEXT_LICENSE\"" \
- 5 45
- case $? in
- 0 ) break
- ;;
- 1 ) continue
- ;;
- * ) systemException \
- "License not accepted... reboot" \
- "reboot"
- ;;
- esac
+ if [ ! -f $code ];then
+ Echo "License with basename $name not found... skipped"
+ continue
+ fi
+ #======================================
+ # show license until accepted
+ #--------------------------------------
+ while true;do
+ Dialog --textbox $code 20 70 \
+ --and-widget --extra-button \
+ --extra-label "$TEXT_NO" \
+ --ok-label "$TEXT_YES" \
+ --cancel-label "$TEXT_CANCEL" \
+ --yesno "\"$TEXT_LICENSE\"" \
+ 5 45
+ case $? in
+ 0 ) break
+ ;;
+ 1 ) continue
+ ;;
+ * ) systemException \
+ "License not accepted... reboot" \
+ "reboot"
+ ;;
+ esac
+ done
done
}
#======================================
@@ -6057,8 +6487,16 @@
# the /dev/disk/<name>-partN schema is used
# ----
if echo $1 | grep -q "^\/dev\/disk\/" ; then
+ if [ -e $1"_part"$2 ]; then
+ echo $1"_part"$2
+ return
+ fi
echo $1"-part"$2
return
+ elif echo $1 | grep -q "^\/dev\/ram";then
+ name=$(echo $1 | tr -d /dev)
+ echo /dev/mapper/${name}p$2
+ return
fi
local lastc=$(echo $1 | sed -e 's@\(^.*\)\(.$\)@\2@')
if echo $lastc | grep -qP "^\d+$";then
@@ -6144,6 +6582,29 @@
#--------------------------------------
if mount -L hybrid /cow;then
Echo "Existing persistent hybrid partition found"
+ #======================================
+ # does the cow file exist
+ #--------------------------------------
+ if [ ! -f /cow/.clicfs_COW ];then
+ Echo "Can't find cow file on write partition... deactivated"
+ unset kiwi_hybridpersistent
+ umount /cow
+ rmdir /cow
+ return
+ fi
+ #======================================
+ # is the cow file valid
+ #--------------------------------------
+ if [ -x /usr/bin/clicfs_fsck ] && ! clicfs_fsck /cow/.clicfs_COW;then
+ Echo "COW file is broken... deactivated"
+ unset kiwi_hybridpersistent
+ umount /cow
+ rmdir /cow
+ return
+ fi
+ #======================================
+ # everything ok, go ahead
+ #--------------------------------------
umount /cow
rmdir /cow
return
@@ -6310,7 +6771,7 @@
#--------------------------------------
function partedSectorInit {
# /.../
- # return start/end sectors of current partitions.
+ # return aligned start/end sectors of current table.
# ----
IFS=$IFS_ORIG
local disk=$1
@@ -6329,13 +6790,16 @@
startSectors=${startSectors}:${s_start}s
fi
if [ -z "$endSectors" ];then
- endSectors=$((s_stopp + 1))s
+ endSectors=$((s_stopp/8*8+8))s
else
- endSectors=$endSectors:$((s_stopp + 1))s
+ endSectors=$endSectors:$((s_stopp/8*8+8))s
fi
done
+ # /.../
+ # in case of an empty disk we use the following start sector
+ # ----
if [ -z "$startSectors" ];then
- startSectors=1
+ startSectors=2048s
fi
}
#======================================
@@ -6780,7 +7244,7 @@
SERVER=tftp.$DOMAIN
fi
Echo "Checking Server name: $SERVER"
- if ! ping -c 1 $SERVER >/dev/null 2>&1;then
+ if ! ping -c 1 -w 30 $SERVER >/dev/null 2>&1;then
Echo "Server: $SERVER not found"
if [ -z "$SERVERTYPE" ] || [ "$SERVERTYPE" = "tftp" ]; then
if [ ! -z "$DHCPSIADDR" ];then
@@ -6865,6 +7329,66 @@
# pxePartitionInput
#--------------------------------------
function pxePartitionInput {
+ if [ $PARTITIONER = "fdasd" ];then
+ pxePartitionInputFDASD
+ else
+ pxePartitionInputGeneric
+ fi
+}
+#======================================
+# pxeRaidPartitionInput
+#--------------------------------------
+function pxeRaidPartitionInput {
+ if [ $PARTITIONER = "fdasd" ];then
+ pxeRaidPartitionInputFDASD
+ else
+ pxeRaidPartitionInputGeneric
+ fi
+}
+#======================================
+# pxePartitionInputFDASD
+#--------------------------------------
+function pxePartitionInputFDASD {
+ local field=0
+ local count=0
+ local IFS=","
+ for i in $PART;do
+ field=0
+ count=$((count + 1))
+ IFS=";" ; for n in $i;do
+ case $field in
+ 0) partSize=$n ; field=1 ;;
+ 1) partID=$n ; field=2 ;;
+ 2) partMount=$n;
+ esac
+ done
+ partSize=$(pxeSizeToMB $partSize)
+ if [ "$partID" = '82' ] || [ "$partID" = 'S' ];then
+ partID=2
+ elif [ "$partID" = '83' ] || [ "$partID" = 'L' ];then
+ partID=1
+ elif [ "$partID" -eq '8e' ] || [ "$partID" = 'V' ];then
+ partID=4
+ else
+ partID=1
+ fi
+ echo -n "n . $partSize "
+ if [ $partID = "2" ] || [ $partID = "4" ];then
+ echo -n "t $count $partID "
+ fi
+ done
+ echo "w"
+}
+#======================================
+# pxeRaidPartitionInputFDASD
+#--------------------------------------
+function pxeRaidPartitionInputFDASD {
+ pxePartitionInputFDASD
+}
+#======================================
+# pxePartitionInputGeneric
+#--------------------------------------
+function pxePartitionInputGeneric {
local field=0
local count=0
local IFS=","
@@ -6903,9 +7427,9 @@
echo "w q"
}
#======================================
-# pxeRaidPartitionInput
+# pxeRaidPartitionInputGeneric
#--------------------------------------
-function pxeRaidPartitionInput {
+function pxeRaidPartitionInputGeneric {
local field=0
local count=0
local IFS=","
@@ -7183,7 +7707,7 @@
# syslboot / luksboot
#--------------------------------------
if [ -z "$bootid" ];then
- test "$loader" = "syslinux" && pSearch=6
+ test "$loader" = "syslinux" && pSearch=c
for i in 4 3 2;do
pType=$(partitionID $imageDiskDevice $i)
if [ "$pType" = $pSearch ];then
@@ -7206,10 +7730,6 @@
fi
return
fi
- if [ ! -z "$COMBINED_IMAGE" ];then
- # split image, /boot must be on the fsreadwrite area
- return
- fi
if [ -z "$imageDiskDevice" ];then
# no disk device like for live ISO based on clicfs
return
@@ -7221,21 +7741,32 @@
# no such boot device like for live ISO hybrid disk
return
fi
- mkdir -p /mnt/$mpoint
- mount $imageBootDevice /mnt/$mpoint
- if \
- [ -z "$UNIONFS_CONFIG" ] &&
- [ -z "$COMBINED_IMAGE" ] &&
- [ "$bootid" = "1" ]
- then
- rm -fr /mnt/$mpoint/*
+ #======================================
+ # copy boot data from image to bootpart
+ #--------------------------------------
+ mkdir -p /$mpoint
+ mount $imageBootDevice /$mpoint
+ if [ -z "$COMBINED_IMAGE" ];then
+ cp -a /mnt/boot /$mpoint
+ if [ -e /boot.tgz ];then
+ tar -xf /boot.tgz -C /$mpoint
+ fi
fi
- cp -a /mnt/boot /mnt/$mpoint
- if [ -e /boot.tgz ];then
- tar -xf /boot.tgz -C /mnt/$mpoint
+ umount /$mpoint
+ rmdir /$mpoint
+ #======================================
+ # bind mount boot partition
+ #--------------------------------------
+ # the resetBootBind() function will resolve this to a
+ # standard /boot mount when the bootloader will be
+ # installed in preinit.
+ # ---
+ if ! isFSTypeReadOnly;then
+ rm -rf /mnt/boot
+ mkdir /mnt/boot
fi
- rm -rf /mnt/boot
- mkdir /mnt/boot
+ mkdir /mnt/$mpoint
+ mount $imageBootDevice /mnt/$mpoint
mount --bind \
/mnt/$mpoint/boot /mnt/boot
}
@@ -7284,6 +7815,43 @@
done
}
#======================================
+# setupTTY
+#--------------------------------------
+function setupTTY {
+ # /.../
+ # create tty device nodes in case we don't have devtmpfs
+ # ----
+ local tty_driver
+ local major
+ local minor
+ local tty
+ if $have_devtmpfs;then
+ return
+ fi
+ if [ "$console" ]; then
+ tty_driver="${tty_driver:+$tty_driver }${console%%,*}"
+ fi
+ for o in $tty_driver; do
+ case "$o" in
+ ttyS*) test -e /dev/$o || mknod -m 0660 /dev/$o c 4 64 ;;
+ tty*) test -e /dev/$o || mknod -m 0660 /dev/$o c 4 1 ;;
+ esac
+ done
+ tty_driver=$(showconsole -n 2>/dev/null)
+ if test -n "$tty_driver" ; then
+ major=${tty_driver%% *}
+ minor=${tty_driver##* }
+ if test $major -eq 4 -a $minor -lt 64 ; then
+ tty=/dev/tty$minor
+ test -e $tty || mknod -m 0660 $tty c 4 $minor
+ fi
+ if test $major -eq 4 -a $minor -ge 64 ; then
+ tty=/dev/ttyS$((64-$minor))
+ test -e $tty || mknod -m 0660 $tty c 4 $minor
+ fi
+ fi
+}
+#======================================
# setupConsole
#--------------------------------------
function setupConsole {
@@ -7293,27 +7861,36 @@
# ----
local itab=/etc/inittab
local stty=/etc/securetty
+ local xvc="X0:12345:respawn:/sbin/mingetty --noclear xvc0 linux"
+ local hvc="H0:12345:respawn:/sbin/mingetty --noclear hvc0 linux"
+ #======================================
+ # create tty nodes if not done
+ #--------------------------------------
+ setupTTY
+ #======================================
+ # setup xvc console (xen)
+ #--------------------------------------
if [ -e /sys/class/tty/xvc0 ];then
if ! cat $itab | grep -v '^#' | grep -q xvc0;then
- echo "X0:12345:respawn:/sbin/mingetty --noclear xvc0 linux" >> $itab
- echo xvc0 >> $stty
+ echo "$xvc" >> $itab
+ echo "xvc0" >> $stty
fi
fi
+ #======================================
+ # setup hvc console (kvm)
+ #--------------------------------------
if [ -e /sys/class/tty/hvc0 ];then
if ! cat $itab | grep -v '^#' | grep -q hvc0;then
- echo "H0:12345:respawn:/sbin/mingetty --noclear hvc0 linux" >> $itab
- echo hvc0 >> $stty
+ echo "$hvc" >> $itab
+ echo "hvc0" >> $stty
fi
fi
+ #======================================
+ # remove ttyS0 if not present
+ #--------------------------------------
if [ ! -e /sys/class/tty/ttyS0 ];then
cat $itab | grep -vi 'ttyS0' > $itab.new && mv $itab.new $itab
fi
- if [ "$arch" = "ppc64" ];then
- if [ -e /sys/class/tty/ttyS0 -a ! -e /sys/class/tty/hvc0 ];then
- cat $itab | grep -vi 'ttyS0' > $itab.new && mv $itab.new $itab
- echo "S0:12345:respawn:/sbin/agetty -L 19200 ttyS0 vt102" >> $itab
- fi
- fi
}
#======================================
# cleanPartitionTable
@@ -7367,7 +7944,7 @@
echo "kpartx -d $diskLoop" >> $reset
if searchVolumeGroup; then
diskLoop=/dev/$VGROUP/LVRoot
- echo "vgchange -an" >> $reset
+ echo "vgchange -a n $VGROUP" >> $reset
else
diskLoop=$(echo $diskLoop | cut -f3 -d '/')
diskLoop=/dev/mapper/${diskLoop}p1
@@ -7584,16 +8161,46 @@
fi
}
#======================================
+# createOriginSnapshot
+#--------------------------------------
+function createOriginSnapshot {
+ # /.../
+ # create a snapshot origin which allows to keep
+ # track of any changes happened during the live
+ # time of the image. This origin snapshot requires
+ # the use of the btrfs filesystem
+ # ----
+ if [ ! "$FSTYPE" = "btrfs" ];then
+ return
+ fi
+ if [ ! -x /sbin/btrfsctl ];then
+ echo "btrfsprogrs not installed... skipped"
+ return
+ fi
+ btrfsctl -s origin /
+}
+#======================================
# initialize
#--------------------------------------
function initialize {
#======================================
+ # Exports boot image .profile
+ #--------------------------------------
+ if [ -f /.profile ];then
+ importFile < /.profile
+ if [ ! -z "$kiwi_bootloader" ];then
+ loader=$kiwi_bootloader
+ fi
+ fi
+ #======================================
# Check partitioner capabilities
#--------------------------------------
- if [ $PARTITIONER = "unsupported" ];then
- systemException \
- "Installed parted version is too old" \
- "reboot"
+ if echo $kiwi_iname | grep -qE '(oem|net)boot';then
+ if [ $PARTITIONER = "unsupported" ];then
+ systemException \
+ "Installed parted version is too old" \
+ "reboot"
+ fi
fi
#======================================
# Check for hotfix kernel
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWILocator.pm
^
|
@@ -4,7 +4,7 @@
# PROJECT : OpenSUSE Build-Service
# COPYRIGHT : (c) 2011 SUSE LINUX Products GmbH, Germany
# :
-# AUTHOR : Robert Schweikert <rschweikert@novell.com>
+# AUTHOR : Robert Schweikert <rjschwei@suse.com>
# :
# BELONGS TO : Operating System images
# :
@@ -89,7 +89,7 @@
$kiwi -> info ("Removing old root directory '$root'");
if (-e $root."/base-system") {
$kiwi -> failed();
- $kiwi -> info ("Mount point /base-system exists");
+ $kiwi -> error ("Mount point '$root/base-system' exists");
$kiwi -> failed();
return undef;
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWILog.pm
^
|
@@ -56,7 +56,6 @@
$this->{showLevel} = [0,1,2,3,4,5];
$this->{channel} = *STDOUT;
$this->{errorOk} = 0;
- $this->{state} = "O";
$this->{message} = "initialize";
$this->{used} = 1;
$this -> getPrefix (1);
@@ -224,7 +223,6 @@
print $FD " done\n";
}
$this -> saveInCache (" done\n");
- $this->{state} = "O";
}
#==========================================
@@ -248,7 +246,6 @@
print $FD " failed\n";
}
$this -> saveInCache (" failed\n");
- $this->{state} = "O";
}
#==========================================
@@ -272,7 +269,6 @@
print $FD " skipped\n";
}
$this -> saveInCache (" skipped\n");
- $this->{state} = "O";
}
#==========================================
@@ -296,7 +292,29 @@
print $FD " notset\n";
}
$this -> saveInCache (" notset\n");
- $this->{state} = "O";
+}
+
+#==========================================
+# oops
+#------------------------------------------
+sub oops {
+ # ...
+ # This is the cyan "oops" flag
+ # ---
+ my $this = shift;
+ my $rootEFD = $this->{rootefd};
+ my $FD = $this->{channel};
+ if ((! defined $this->{fileLog}) && (! defined $this->{nocolor})) {
+ $this -> doStat();
+ print $FD "\033[1;36moops\n";
+ $this -> doNorm();
+ if ($this->{errorOk}) {
+ print $rootEFD " notset\n";
+ }
+ } else {
+ print $FD " oops\n";
+ }
+ $this -> saveInCache (" oops\n");
}
#==========================================
@@ -420,7 +438,6 @@
my $logdata = $_[1];
my $flag = $_[2];
my @mcache = ();
- my $needcr = "";
my $date = $this -> getPrefix ( $lglevel );
#==========================================
# check log status
@@ -429,21 +446,10 @@
$logdata = $lglevel;
$lglevel = 1;
}
- if (($this->{state} eq "I") && ($lglevel != 5)) {
- $needcr = "\n";
- }
if (defined $this->{mcache}) {
@mcache = @{$this->{mcache}};
}
#==========================================
- # save log status
- #------------------------------------------
- if ($logdata !~ /\n$/) {
- $this->{state} = "I";
- } else {
- $this->{state} = "O";
- }
- #==========================================
# set log status
#------------------------------------------
my @showLevel = @{$this->{showLevel}};
@@ -460,16 +466,16 @@
next;
}
if (($lglevel == 1) || ($lglevel == 2)) {
- $result = $needcr.$date.$logdata;
+ $result = $date.$logdata;
} elsif ($lglevel == 5) {
- $result = $needcr.$logdata;
+ $result = $logdata;
} elsif ($lglevel == 3) {
- $result = $needcr.$date.$logdata;
+ $result = $date.$logdata;
if ($this->trace()) {
$main::BT[$main::TL] = eval { Carp::longmess ($main::TT.$main::TL++) };
}
} else {
- $result = Carp::longmess($needcr.$logdata);
+ $result = Carp::longmess($logdata);
}
}
#==========================================
@@ -646,17 +652,6 @@
}
#==========================================
-# state
-#------------------------------------------
-sub state {
- # ...
- # get current cursor log state
- # ---
- my $this = shift;
- return $this->{state};
-}
-
-#==========================================
# terminalLogging
#------------------------------------------
sub terminalLogging {
@@ -1003,9 +998,9 @@
}
#==========================================
-# writeXML
+# writeXMLDiff
#------------------------------------------
-sub writeXML {
+sub writeXMLDiff {
my $this = shift;
my $pretty = shift;
my $data = $this->{xmlString};
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIManager.pm
^
|
@@ -779,7 +779,6 @@
if ($manager eq "zypper") {
my @zypper = @{$this->{zypper}};
my $stype = "private";
- my $prio;
qxx ("rm -f $dataDir/*.repo");
if (! $chroot) {
$stype = "public";
@@ -795,6 +794,7 @@
foreach my $alias (keys %{$source{$stype}}) {
my @sopts = @{$source{$stype}{$alias}};
my @zopts = ();
+ my $prio;
foreach my $opt (@sopts) {
next if ! defined $opt;
$opt =~ /(.*?)=(.*)/;
@@ -850,18 +850,36 @@
$kiwi -> info ("Adding bootstrap zypper service: $alias");
$data = qxx ("@zypper --root \"$root\" $sadd 2>&1");
$code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("zypper: $data");
+ return undef;
+ }
+ $kiwi -> done ();
} else {
my @zypper= @{$this->{zypper_chroot}};
$kiwi -> info ("Adding chroot zypper service: $alias");
$data = qxx ("@kchroot @zypper $sadd 2>&1");
$code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("zypper: $data");
+ return undef;
+ }
+ $kiwi -> done ();
+ if ($source{$alias}{imgincl}) {
+ $kiwi -> info ("Adding $alias repo to image");
+ $sadd =~ s/--keep-packages//;
+ $data = qxx ("@kchroot zypper $sadd 2>&1");
+ $code = $? >> 8;
+ if ($code != 0) {
+ $kiwi -> failed ();
+ $kiwi -> error ("zypper: $data");
+ return undef;
+ }
+ $kiwi -> done ();
+ }
}
- if ($code != 0) {
- $kiwi -> failed ();
- $kiwi -> error ("zypper: $data");
- return undef;
- }
- $kiwi -> done ();
if ( $prio ) {
$kiwi -> info ("--> Set priority to: $prio");
my $modrepo = "modifyrepo -p $prio $alias";
@@ -1266,7 +1284,7 @@
print $fd "while kill -0 \$SPID &>/dev/null; do sleep 1;done\n";
print $fd "echo 1 > $screenCall.exit; exit 1; }\n";
print $fd "trap clean INT TERM\n";
- print $fd "for i in @@addonPackages;do\n";
+ print $fd "for i in @addonPackages;do\n";
print $fd "\tif ! @kchroot @yum list all \$i;then\n";
print $fd "\t\tECODE=1\n";
print $fd "\t\techo \$ECODE > $screenCall.exit\n";
@@ -1634,7 +1652,7 @@
print $fd "SPID=\$!;wait \$SPID\n";
}
if (@addonPackages) {
- print $fd "for i in @@addonPackages;do\n";
+ print $fd "for i in @addonPackages;do\n";
print $fd "\tif ! @kchroot @yum list all \$i;then\n";
print $fd "\t\tECODE=1\n";
print $fd "\t\techo \$ECODE > $screenCall.exit\n";
@@ -2330,6 +2348,7 @@
if ($manager eq "yum") {
$kiwi -> info ("Removing yum repo(s) in: $dataDir");
qxx ("rm -f $dataDir/*.repo 2>&1");
+ $kiwi -> done();
}
return $this;
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIMigrate.pm
^
|
@@ -84,6 +84,7 @@
$kiwi -> failed ();
return undef;
}
+ $this->{gdata} = $main::global -> getGlobals();
my $product = $this -> getOperatingSystemVersion();
if (! defined $product) {
$kiwi -> failed ();
@@ -226,7 +227,6 @@
$this->{product} = $product;
$this->{mount} = [];
$this->{autoyastCloneList} = \@autoyastCloneList;
- $this->{gdata} = $main::global -> getGlobals();
return $this;
}
@@ -691,6 +691,7 @@
return undef;
}
foreach my $repo (@list) {
+ $repo =~ s/^\s+//g;
if ($repo =~ /^\d.*\|(.*)\|.*\|(.*)\|.*\|(.*)\|(.*)\|(.*)\|/) {
my $enabled = $2;
my $source = $5;
@@ -811,7 +812,7 @@
#==========================================
# <description>
#------------------------------------------
- print FD '<image schemaversion="4.8" ';
+ print FD '<image schemaversion="5.3" ';
print FD 'name="suse-migration-'.$product.'">'."\n";
print FD "\t".'<description type="system">'."\n";
print FD "\t\t".'<author>***AUTHOR***</author>'."\n";
@@ -824,8 +825,7 @@
print FD "\t".'<preferences>'."\n";
print FD "\t\t".'<type image="oem" boot="oemboot/suse-'.$product.'"';
print FD ' filesystem="ext3" installiso="true">'."\n";
- print FD "\t\t\t".'<oemconfig>'."\n";
- print FD "\t\t\t".'</oemconfig>'."\n";
+ print FD "\t\t\t".'<oemconfig/>'."\n";
print FD "\t\t".'</type>'."\n";
print FD "\t\t".'<version>1.1.1</version>'."\n";
print FD "\t\t".'<packagemanager>zypper</packagemanager>'."\n";
@@ -856,9 +856,10 @@
#==========================================
# <packages>
#------------------------------------------
- print FD "\t".'<packages type="image">'."\n";
+ print FD "\t".'<packages type="bootstrap">'."\n";
if (defined $pats) {
foreach my $pattern (sort @{$pats}) {
+ $pattern =~ s/^pattern://;
print FD "\t\t".'<opensusePattern name="'.$pattern.'"/>'."\n";
}
}
@@ -868,15 +869,6 @@
}
}
print FD "\t".'</packages>'."\n";
- #==========================================
- # <packages type="bootstrap">
- #------------------------------------------
- print FD "\t".'<packages type="bootstrap">'."\n";
- print FD "\t\t".'<package name="filesystem"/>'."\n";
- print FD "\t\t".'<package name="glibc-locale"/>'."\n";
- print FD "\t\t".'<package name="cracklib-dict-full"/>'."\n";
- print FD "\t\t".'<package name="openssl-certs"/>'."\n";
- print FD "\t".'</packages>'."\n";
print FD '</image>'."\n";
close FD;
return $this;
@@ -1119,15 +1111,15 @@
my $name = $1;
$name =~ s/^ +//g;
$name =~ s/ +$//g;
- $pathash{"$name"} = "$name";
+ $pathash{"pattern:$name"} = "$name";
}
}
@patlist = keys %pathash;
}
$this->{patterns} = \@patlist;
my $psolve = new KIWISatSolver (
- $kiwi,\@patlist,\@urllist,undef,undef,undef,
- "silent","plusRecommended"
+ $kiwi,\@patlist,\@urllist,"solve-patterns",
+ undef,undef,undef,"plusRecommended"
);
my @result = ();
if (! defined $psolve) {
@@ -1180,8 +1172,8 @@
my $repo = $psolve -> getRepo();
my $pool = $psolve -> getPool();
my $xsolve = new KIWISatSolver (
- $kiwi,\@result,\@urllist,"solve-packages",$repo,$pool,
- "silent","plusRecommended"
+ $kiwi,\@result,\@urllist,"solve-packages",
+ $repo,$pool,undef,"plusRecommended"
);
if (! defined $xsolve) {
$kiwi -> error ("Failed to solve packages");
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIMigrate.txt
^
|
@@ -11,3 +11,5 @@
openSUSE-11.1=suse-11.1
openSUSE-11.2=suse-11.2
openSUSE-11.3=suse-11.3
+openSUSE-11.4=suse-11.4
+openSUSE-12.1=suse-12.1
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIOverlay.pm
^
|
@@ -214,7 +214,9 @@
qxx ("$cmd 2>&1");
}
}
- qxx ("rm -rf $tmpdir 2>&1");
+ if (($tmpdir) && (-d $tmpdir)) {
+ qxx ("rm -rf $tmpdir 2>&1");
+ }
return $this;
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIRoot.pm
^
|
@@ -109,6 +109,7 @@
my $user = $repository{$source}[3];
my $pwd = $repository{$source}[4];
my $plic = $repository{$source}[5];
+ my $imgincl = $repository{$source}[6];
my $urlHandler = new KIWIURL ($kiwi,$cmdL,$this,$user,$pwd);
my $publics_url = $urlHandler -> normalizePath ($source);
if ($publics_url =~ /^\//) {
@@ -167,9 +168,14 @@
$sourceChannel{private}{$channel} = \@private_options;
$sourceChannel{public}{$channel} = \@public_options;
$sourceChannel{$channel}{license} = 0;
+ $sourceChannel{$channel}{imgincl} = 0;
if (($plic) && ("$plic" eq "true")) {
$sourceChannel{$channel}{license} = 1;
}
+ if (($imgincl) && ("$imgincl" eq "true")) {
+ $kiwi -> info ("Retain $channel\n");
+ $sourceChannel{$channel}{imgincl} = 1;
+ }
$count++;
}
#==========================================
@@ -415,8 +421,9 @@
if (-f '/.buildenv') {
qxx ("touch $root/.buildenv");
}
- # need mtab at least empty for mount calls
- qxx ("touch $root/etc/mtab");
+ # need mtab link for mount calls
+ qxx ("ln -s /proc/self/mounts $root/etc/mtab");
+ # need sysconfig/bootloader to make post scripts happy
qxx ("touch $root/etc/sysconfig/bootloader");
}
# need user/group files as template
@@ -673,9 +680,11 @@
my $needHosts = $this->{needHosts};
if ($needResolvConf) {
qxx ("rm -f $root/etc/resolv.conf");
+ undef $this->{needResolvConf};
}
if ($needHosts) {
qxx ("rm -f $root/etc/hosts");
+ undef $this->{needHosts};
}
}
@@ -921,7 +930,7 @@
}
}
next if ! $ok;
- my $data = qxx ("chroot $root chown -c root:root \"$file\" 2>&1");
+ my $data = qxx ("chroot $root chown -c root:root '".$file."' 2>&1");
my $code = $? >> 8;
if ($code != 0) {
$kiwi -> warning (
@@ -1081,6 +1090,7 @@
$kiwi -> failed ();
$kiwi -> info ($data);
$kiwi -> failed ();
+ return undef;
} else {
$kiwi -> loginfo ("$script: $data");
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIRuntimeChecker.pm
^
|
@@ -25,7 +25,7 @@
require Exporter;
use KIWILocator;
use KIWILog;
-
+use KIWIQX;
#==========================================
# Exports
@@ -127,12 +127,62 @@
if (! $this -> __checkRootRecycleCapability()) {
return undef;
}
+ if (! $this -> __hasValidArchives()) {
+ return undef;
+ }
return 1;
}
#==========================================
# Private helper methods
#------------------------------------------
+#==========================================
+# __hasValidArchives
+#------------------------------------------
+sub __hasValidArchives {
+ # ...
+ # check if the optional given archives doesn't
+ # include bogus files
+ # ---
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my $xml = $this->{xml};
+ my $cmdL = $this->{cmdArgs};
+ my @list = $xml -> getArchiveList();
+ my $desc = $cmdL-> getConfigDir();
+ my @nogo = ('^etc\/YaST2\/licenses\/.*');
+ #==========================================
+ # check for origin of image description
+ #------------------------------------------
+ if (open FD,"$desc/image/main::Prepare") {
+ $desc = <FD>; close FD;
+ }
+ #==========================================
+ # check archive contents
+ #------------------------------------------
+ foreach my $ar (@list) {
+ if (! -f "$desc/$ar") {
+ $kiwi -> warning ("specified archive $ar doesn't exist in $desc");
+ $kiwi -> skipped ();
+ next;
+ }
+ my $contents = qxx ("tar -tf $desc/$ar 2>&1");
+ foreach my $exp (@nogo) {
+ if (grep (/$exp/,$contents)) {
+ $kiwi -> error ("bogus archive contents in $ar");
+ $kiwi -> failed ();
+ $kiwi -> error ("archive matches: $exp");
+ $kiwi -> failed ();
+ return undef;
+ }
+ }
+ }
+ return 1;
+}
+
+#==========================================
+# __haveValidTypeString
+#------------------------------------------
sub __haveValidTypeString {
# ...
# if the commandline data set contains buildtype
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWISchema.rnc
^
|
@@ -26,16 +26,16 @@
db:releaseinfo [
"$Id: kiwi.rnc 2957 2008-01-11 12:53:39Z thomas-schraitle $"
]
- db:releaseinfo [ "RNC Schema Version 5.2" ]
+ db:releaseinfo [ "RNC Schema Version 5.3" ]
db:pubdate [ "START" ]
db:pubdate [ "2008-01-08" ]
]
-image-name = xsd:token {pattern = "[^\s/]+"}
+image-name = xsd:token {pattern = "[a-zA-Z0-9_\-\.]+"}
locale-name = xsd:token {pattern = "[a-z]{2}_[A-Z]{2}(,[a-z]{2}_[A-Z]{2})*"}
mac-address-type = xsd:token {pattern = "([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}"}
size-type = xsd:token {pattern = "\d*|image"}
-volume-size-type = xsd:token {pattern = "\d+|\d+M|\d+G"}
+volume-size-type = xsd:token {pattern = "\d+|\d+M|\d+G|all"}
#==========================================
# start with image description
@@ -60,7 +60,7 @@
attribute xsi:schemaLocation { xsd:anyURI }
k.image.schemaversion.attribute =
## The allowed Schema version (fixed value)
- attribute schemaversion { "5.2" }
+ attribute schemaversion { "5.3" }
k.image.kiwirevision.attribute =
## A kiwi git revision number which is known to build
## a working image from this description. If the kiwi git
@@ -292,7 +292,7 @@
db:para [
"Specify the region/availability zone in EC2 for this image.\x{a}"~
"Values are limited to the EC2 recognized zones:\x{a}"~
- "AP-Japan, AP-Singapore, EU-West, US-East, and US-West"
+ "AP-Northeast, AP-Southeast, EU-West, US-East, and US-West"
]
]
element ec2region {
@@ -807,6 +807,10 @@
## source argument doesn't really explain what this repository
## contains
attribute alias { text }
+ k.repository.imageinclude.attribute =
+ ## Specify whether or not this repository should be configured in the
+ ## resulting image. Boolean value true or false, the default is false.
+ attribute imageinclude { xsd:boolean }
k.repository.prefer-license.attribute =
attribute prefer-license { xsd:boolean }
k.repository.priority.attribute =
@@ -828,6 +832,7 @@
k.repository.profiles.attribute? &
k.repository.status.attribute? &
k.repository.alias.attribute? &
+ k.repository.imageinclude.attribute? &
k.repository.prefer-license.attribute? &
k.repository.priority.attribute? &
k.repository.password.attribute? &
@@ -1385,6 +1390,25 @@
}
#==========================================
+# common element <showlicense>
+#
+div {
+ k.showlicense.attlist = empty
+ k.showlicense =
+ ## Setup showlicense
+ [
+ db:para [
+ "Image license setup. The specfied license name\x{a}"~
+ "will be displayed in a dialog window on boot."
+ ]
+ ]
+ element showlicense {
+ k.showlicense.attlist,
+ text
+ }
+}
+
+#==========================================
# common element <timezone>
#
div {
@@ -1411,6 +1435,12 @@
## Specifies the path of the boot image (initrd), relative
## to /usr/share/kiwi/image
attribute boot { text }
+ k.type.editbootconfig.attribute =
+ ## Specifies the path to a script which is called right
+ ## before the bootloader is installed. The script runs
+ ## relative to the directory which contains the image
+ ## structure
+ attribute editbootconfig { text }
k.type.bootkernel.attribute =
## Specifies the kernel boot profile defined in the boot
## image description. When kiwi builds the boot image the
@@ -1460,7 +1490,7 @@
k.type.format.attribute =
## Specifies the format of the virtual disk.
attribute format {
- "ec2" | "ovf" | "qcow2" | "vmdk"
+ "ec2" | "ovf" | "qcow2" | "vmdk" | "vhd"
}
k.type.fsnocheck.attribute =
## Turn off periodic filesystem checks on ext2/3/4.
@@ -1536,6 +1566,7 @@
attribute volid { text }
k.type.attlist =
k.type.boot.attribute? &
+ k.type.editbootconfig.attribute? &
k.type.bootkernel.attribute? &
k.type.bootloader.attribute? &
k.type.bootprofile.attribute? &
@@ -2385,6 +2416,7 @@
k.rpm-force? &
k.timezone? &
k.type* &
+ k.showlicense* &
k.version?
}
}
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWISchema.rng
^
|
@@ -23,13 +23,13 @@
<grammar xmlns:db="http://docbook.org/ns/docbook" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<db:info>
<db:releaseinfo>$Id: kiwi.rnc 2957 2008-01-11 12:53:39Z thomas-schraitle $</db:releaseinfo>
- <db:releaseinfo>RNC Schema Version 5.2</db:releaseinfo>
+ <db:releaseinfo>RNC Schema Version 5.3</db:releaseinfo>
<db:pubdate>START</db:pubdate>
<db:pubdate>2008-01-08</db:pubdate>
</db:info>
<define name="image-name">
<data type="token">
- <param name="pattern">[^\s/]+</param>
+ <param name="pattern">[a-zA-Z0-9_\-\.]+</param>
</data>
</define>
<define name="locale-name">
@@ -49,7 +49,7 @@
</define>
<define name="volume-size-type">
<data type="token">
- <param name="pattern">\d+|\d+M|\d+G</param>
+ <param name="pattern">\d+|\d+M|\d+G|all</param>
</data>
</define>
<!--
@@ -91,7 +91,7 @@
<define name="k.image.schemaversion.attribute">
<attribute name="schemaversion">
<a:documentation>The allowed Schema version (fixed value)</a:documentation>
- <value>5.2</value>
+ <value>5.3</value>
</attribute>
</define>
<define name="k.image.kiwirevision.attribute">
@@ -444,7 +444,7 @@
<a:documentation>Specify the region/availability zone</a:documentation>
<db:para>Specify the region/availability zone in EC2 for this image.
Values are limited to the EC2 recognized zones:
-AP-Japan, AP-Singapore, EU-West, US-East, and US-West</db:para>
+AP-Northeast, AP-Southeast, EU-West, US-East, and US-West</db:para>
<ref name="k.ec2region.attlist"/>
<text/>
</element>
@@ -1204,6 +1204,13 @@
contains</a:documentation>
</attribute>
</define>
+ <define name="k.repository.imageinclude.attribute">
+ <attribute name="imageinclude">
+ <a:documentation>Specify whether or not this repository should be configured in the
+resulting image. Boolean value true or false, the default is false.</a:documentation>
+ <data type="boolean"/>
+ </attribute>
+ </define>
<define name="k.repository.prefer-license.attribute">
<attribute name="prefer-license">
<data type="boolean"/>
@@ -1243,6 +1250,9 @@
<ref name="k.repository.alias.attribute"/>
</optional>
<optional>
+ <ref name="k.repository.imageinclude.attribute"/>
+ </optional>
+ <optional>
<ref name="k.repository.prefer-license.attribute"/>
</optional>
<optional>
@@ -1859,6 +1869,25 @@
</div>
<!--
==========================================
+ common element <showlicense>
+
+ -->
+ <div>
+ <define name="k.showlicense.attlist">
+ <empty/>
+ </define>
+ <define name="k.showlicense">
+ <element name="showlicense">
+ <a:documentation>Setup showlicense</a:documentation>
+ <db:para>Image license setup. The specfied license name
+will be displayed in a dialog window on boot.</db:para>
+ <ref name="k.showlicense.attlist"/>
+ <text/>
+ </element>
+ </define>
+ </div>
+ <!--
+ ==========================================
common element <timezone>
-->
@@ -1888,6 +1917,14 @@
to /usr/share/kiwi/image</a:documentation>
</attribute>
</define>
+ <define name="k.type.editbootconfig.attribute">
+ <attribute name="editbootconfig">
+ <a:documentation>Specifies the path to a script which is called right
+before the bootloader is installed. The script runs
+relative to the directory which contains the image
+structure</a:documentation>
+ </attribute>
+ </define>
<define name="k.type.bootkernel.attribute">
<attribute name="bootkernel">
<a:documentation>Specifies the kernel boot profile defined in the boot
@@ -1976,6 +2013,7 @@
<value>ovf</value>
<value>qcow2</value>
<value>vmdk</value>
+ <value>vhd</value>
</choice>
</attribute>
</define>
@@ -2123,6 +2161,9 @@
<ref name="k.type.boot.attribute"/>
</optional>
<optional>
+ <ref name="k.type.editbootconfig.attribute"/>
+ </optional>
+ <optional>
<ref name="k.type.bootkernel.attribute"/>
</optional>
<optional>
@@ -3469,6 +3510,9 @@
<zeroOrMore>
<ref name="k.type"/>
</zeroOrMore>
+ <zeroOrMore>
+ <ref name="k.showlicense"/>
+ </zeroOrMore>
<optional>
<ref name="k.version"/>
</optional>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIXML.pm
^
|
@@ -170,6 +170,7 @@
$this->{repositNodeList} = $repositNodeList;
$this->{packageNodeList} = $packageNodeList;
$this->{instsrcNodeList} = $instsrcNodeList;
+ $this->{driversNodeList} = $driversNodeList;
#==========================================
# Read and create profile hash
#------------------------------------------
@@ -214,13 +215,12 @@
#==========================================
# Store object data
#------------------------------------------
- $this->{driversNodeList} = $driversNodeList;
$this->{usrdataNodeList} = $usrdataNodeList;
$this->{controlFile} = $controlFile;
#==========================================
- # Store object data (create URL list)
+ # Store object data
#------------------------------------------
- $this -> createURLList ();
+ $this -> updateXML();
return $this;
}
@@ -331,6 +331,28 @@
}
#==========================================
+# getURLHash
+#------------------------------------------
+sub getURLHash {
+ my $this = shift;
+ if (! $this->{urlhash}) {
+ $this -> createURLList();
+ }
+ return $this->{urlhash};
+}
+
+#==========================================
+# getURLList
+#------------------------------------------
+sub getURLList {
+ my $this = shift;
+ if (! $this->{urllist}) {
+ $this -> createURLList();
+ }
+ return $this->{urllist};
+}
+
+#==========================================
# getImageName
#------------------------------------------
sub getImageName {
@@ -514,6 +536,28 @@
}
#==========================================
+# getEditBootConfig
+#------------------------------------------
+sub getEditBootConfig {
+ # ...
+ # Get the type specific editbootconfig value.
+ # ---
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my $tnode= $this->{typeNode};
+ my $editBoot = $tnode -> getAttribute ("editbootconfig");
+ if ((! defined $editBoot) || ("$editBoot" eq "")) {
+ return undef;
+ }
+ if (! -e $editBoot) {
+ $kiwi -> warning ("Boot config script $editBoot doesn't exist");
+ $kiwi -> skipped ();
+ return undef;
+ }
+ return File::Spec->rel2abs($editBoot);
+}
+
+#==========================================
# getImageDefaultDestination
#------------------------------------------
sub getImageDefaultDestination {
@@ -953,6 +997,28 @@
}
#==========================================
+# getLicenseNames
+#------------------------------------------
+sub getLicenseNames {
+ # ...
+ # Get the names of all showlicense elements and return
+ # them as a list to the caller
+ # ---
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my $node = $this -> getPreferencesNodeByTagName ("showlicense");
+ my @lics = $node -> getElementsByTagName ("showlicense");
+ my @names = ();
+ foreach my $node (@lics) {
+ push (@names,$node -> textContent());
+ }
+ if (@names) {
+ return \@names;
+ }
+ return undef;
+}
+
+#==========================================
# getXenDomain
#------------------------------------------
sub getXenDomain {
@@ -1804,13 +1870,14 @@
#--------------------------------------------
my $type = $element -> getAttribute("type");
my $alias= $element -> getAttribute("alias");
+ my $imgincl = $element -> getAttribute("imageinclude");
my $prio = $element -> getAttribute("priority");
my $user = $element -> getAttribute("username");
my $pwd = $element -> getAttribute("password");
my $plic = $element -> getAttribute("prefer-license");
my $stag = $element -> getElementsByTagName ("source") -> get_node(1);
my $source = $this -> resolveLink ( $stag -> getAttribute ("path") );
- $result{$source} = [$type,$alias,$prio,$user,$pwd,$plic];
+ $result{$source} = [$type,$alias,$prio,$user,$pwd,$plic,$imgincl];
}
return %result;
}
@@ -1907,12 +1974,8 @@
#------------------------------------------
sub addRepository {
# ...
- # Add a repository node to the current list of repos
- # this is done by reading the xml description file again and
- # overwriting the first repository node with the new data
- # A new object XML::LibXML::NodeList is created which
- # contains the changed element. The element is then appended
- # the the global repositNodeList
+ # Add a repository section to the current list of
+ # repos and update repositNodeList accordingly.
# ---
my $this = shift;
my $kiwi = $this->{kiwi};
@@ -1971,6 +2034,41 @@
}
#==========================================
+# addDrivers
+#------------------------------------------
+sub addDrivers {
+ # ...
+ # Add the given driver list to the specified drivers
+ # section of the xml description parse tree.
+ # ----
+ my $this = shift;
+ my @drvs = @_;
+ my $kiwi = $this->{kiwi};
+ my $nodes = $this->{driversNodeList};
+ my $nodeNumber = -1;
+ for (my $i=1;$i<= $nodes->size();$i++) {
+ my $node = $nodes -> get_node($i);
+ if (! $this -> __requestedProfile ($node)) {
+ next;
+ }
+ $nodeNumber = $i;
+ }
+ if ($nodeNumber < 0) {
+ $kiwi -> loginfo ("addDrivers: no drivers section found... skipped\n");
+ return $this;
+ }
+ foreach my $driver (@drvs) {
+ next if ($driver eq "");
+ my $addElement = new XML::LibXML::Element ("file");
+ $addElement -> setAttribute("name",$driver);
+ $nodes -> get_node($nodeNumber)
+ -> appendChild ($addElement);
+ }
+ $this -> updateXML();
+ return $this;
+}
+
+#==========================================
# addPackages
#------------------------------------------
sub addPackages {
@@ -1982,21 +2080,44 @@
my $ptype = shift;
my $bincl = shift;
my $nodes = shift;
+ my $kiwi = $this->{kiwi};
my @packs = @_;
if (! defined $nodes) {
$nodes = $this->{packageNodeList};
}
- my $nodeNumber = 1;
+ my $nodeNumber = -1;
+ my $nodeNumberBootStrap = -1;
for (my $i=1;$i<= $nodes->size();$i++) {
my $node = $nodes -> get_node($i);
my $type = $node -> getAttribute ("type");
if (! $this -> __requestedProfile ($node)) {
next;
}
+ if ($type eq "bootstrap") {
+ $nodeNumberBootStrap = $i;
+ }
if ($type eq $ptype) {
- $nodeNumber = $i; last;
+ $nodeNumber = $i;
}
}
+ if ($nodeNumberBootStrap < 0) {
+ $kiwi -> warning (
+ "Failed to add @packs, package(s), no bootstrap section found"
+ );
+ $kiwi -> skipped ();
+ return $this;
+ }
+ if (($nodeNumber < 0) && ($ptype eq "image")) {
+ $kiwi -> warning (
+ "addPackages: no image section found, adding to bootstrap"
+ );
+ $kiwi -> done();
+ $nodeNumber = $nodeNumberBootStrap;
+ }
+ if ($nodeNumber < 0) {
+ $kiwi -> loginfo ("addPackages: no $ptype section found... skipped\n");
+ return $this;
+ }
foreach my $pack (@packs) {
next if ($pack eq "");
my $addElement = new XML::LibXML::Element ("package");
@@ -2097,7 +2218,7 @@
# section of the xml description parse tree.
# ----
my $this = shift;
- return $this -> addPackages ("bootstrap",undef,undef,@_);
+ return $this -> addPackages ("image",undef,undef,@_);
}
#==========================================
@@ -2193,6 +2314,10 @@
my $size = getImageSize ($this);
my $name = getImageName ($this);
my $dname= getImageDisplayName ($this);
+ my $lics = getLicenseNames ($this);
+ if ($lics) {
+ $result{kiwi_showlicense} = join(" ",@{$lics});
+ }
if (@delp) {
$result{kiwi_delete} = join(" ",@delp);
}
@@ -2213,7 +2338,7 @@
if ((%type) && ($type{bootloader})) {
$result{kiwi_bootloader} = $type{bootloader};
}
- if ((%type) && ($type{boottimeout})) {
+ if ((%type) && (defined $type{boottimeout})) {
$result{KIWI_BOOT_TIMEOUT} = $type{boottimeout};
}
if ((%type) && ($type{installboot})) {
@@ -2249,7 +2374,7 @@
$result{kiwi_iname} = $name;
}
if ($dname) {
- $result{kiwi_displayname} = $dname;
+ $result{kiwi_displayname} = quotemeta $dname;
}
if ($iver) {
$result{kiwi_iversion} = $iver;
@@ -2315,6 +2440,16 @@
$result{kiwi_xendomain} = $xendomain;
}
#==========================================
+ # systemdisk
+ #------------------------------------------
+ my $allFreeVolume = $this -> getAllFreeVolume();
+ if (defined $allFreeVolume) {
+ $allFreeVolume =~ s/^\///;
+ $allFreeVolume =~ s/\//_/g;
+ $allFreeVolume = "LV".$allFreeVolume;
+ $result{kiwi_allFreeVolume} = $allFreeVolume;
+ }
+ #==========================================
# oemconfig
#------------------------------------------
my $tnode= $this->{typeNode};
@@ -2470,6 +2605,36 @@
}
#==========================================
+# getAllFreeVolume
+#------------------------------------------
+sub getAllFreeVolume {
+ # ...
+ # search the volume list if there is one volume which
+ # has the freespace="all" attribute set. By default
+ # LVRoot is the volume which gets all free space
+ # assigned
+ # ---
+ my $this = shift;
+ my $kiwi = $this->{kiwi};
+ my $allFree = "Root";
+ my $tnode= $this->{typeNode};
+ my $node = $tnode -> getElementsByTagName ("systemdisk") -> get_node(1);
+ if (! defined $node) {
+ return $allFree;
+ }
+ my @vollist = $node -> getElementsByTagName ("volume");
+ foreach my $volume (@vollist) {
+ my $name = $volume -> getAttribute ("name");
+ my $free = $volume -> getAttribute ("freespace");
+ if ((defined $free) && ($free eq "all")) {
+ $allFree = $name;
+ last;
+ }
+ }
+ return $allFree;
+}
+
+#==========================================
# getLVMVolumes
#------------------------------------------
sub getLVMVolumes {
@@ -2496,7 +2661,7 @@
if ($size) {
$haveAbsolute = 1;
$usedValue = $size;
- } elsif ($free) {
+ } elsif (($free) && ($free ne "all")) {
$usedValue = $free;
$haveAbsolute = 0;
}
@@ -2862,6 +3027,7 @@
my $what = shift;
my $nopac= shift;
my $kiwi = $this->{kiwi};
+ my $urllist = $this -> getURLList();
my %pattr;
my $nodes;
if ($what ne "metapackages") {
@@ -2976,7 +3142,7 @@
#------------------------------------------
# 1) try to use libsatsolver...
my $psolve = new KIWISatSolver (
- $kiwi,\@pattlist,$this->{urllist},"solve-patterns",
+ $kiwi,\@pattlist,$urllist,"solve-patterns",
undef,undef,undef,$ptype
);
if (! defined $psolve) {
@@ -3152,6 +3318,7 @@
my $kiwi = $this->{kiwi};
my $nodes = $this->{packageNodeList};
my $manager = $this->getPackageManager();
+ my $urllist = $this -> getURLList();
my @result = ();
my @delete = ();
my %meta = ();
@@ -3241,7 +3408,7 @@
}
} else {
my $psolve = new KIWISatSolver (
- $kiwi,\@result,$this->{urllist},"solve-patterns",
+ $kiwi,\@result,$urllist,"solve-patterns",
undef,undef,undef,$ptype
);
if (! defined $psolve) {
@@ -3422,6 +3589,18 @@
}
#==========================================
+# getDriversNodeList
+#------------------------------------------
+sub getDriversNodeList {
+ # ...
+ # Return a list of all <drivers> nodes. Each list member
+ # is an XML::LibXML::Element object pointer
+ # ---
+ my $this = shift;
+ return $this->{driversNodeList};
+}
+
+#==========================================
# getPackageNodeList
#------------------------------------------
sub getPackageNodeList {
@@ -4180,7 +4359,9 @@
my $type = $element -> getAttribute("type");
my $source= $element -> getElementsByTagName("source")
-> get_node(1) -> getAttribute ("path");
- $this -> addRepository ([$type],[$source]);
+ my $alias = $element -> getAttribute("alias");
+ my $prio = $element -> getAttribute("priority");
+ $this -> addRepository ([$type],[$source],[$alias],[$prio]);
}
}
# 2) add those repos which are part of the changeset
@@ -4198,7 +4379,18 @@
$kiwi -> done ();
}
#==========================================
- # 2) merge/update packages
+ # 2) merge/update drivers
+ #------------------------------------------
+ if (@{$changeset->{driverList}}) {
+ $kiwi -> info ("Updating driver(s):\n");
+ my @drivers = @{$changeset->{driverList}};
+ foreach my $d (@drivers) {
+ $kiwi -> info ("--> $d\n");
+ }
+ $this -> addDrivers (@drivers);
+ }
+ #==========================================
+ # 3) merge/update packages
#------------------------------------------
if (@{$changeset->{fplistImage}}) {
$kiwi -> info ("Updating package(s):\n");
@@ -4218,7 +4410,7 @@
}
}
#==========================================
- # 3) merge/update archives
+ # 4) merge/update archives
#------------------------------------------
if (@{$changeset->{falistImage}}) {
$kiwi -> info ("Updating archive(s):\n");
@@ -4231,13 +4423,13 @@
);
}
#==========================================
- # 4) merge/update machine attribs in type
+ # 5) merge/update machine attribs in type
#------------------------------------------
if (defined $changeset->{"domain"}) {
$this -> __setMachineAttribute ("domain",$changeset);
}
#==========================================
- # 5) merge/update preferences in type
+ # 6) merge/update preferences and type
#------------------------------------------
if (defined $changeset->{"locale"}) {
$this -> __setOptionsElement ("locale",$changeset);
@@ -4248,6 +4440,9 @@
if (defined $changeset->{"packagemanager"}) {
$this -> __setOptionsElement ("packagemanager",$changeset);
}
+ if (defined $changeset->{"showlicense"}) {
+ $this -> __addOptionsElement ("showlicense",$changeset);
+ }
if (defined $changeset->{"oem-swap"}) {
$this -> __setOEMOptionsElement ("oem-swap",$changeset);
}
@@ -4303,7 +4498,7 @@
$this -> __setSystemDiskElement (undef,$changeset);
}
#==========================================
- # 6) merge/update type attributes
+ # 7) merge/update type attributes
#------------------------------------------
if (defined $changeset->{"hybrid"}) {
$this -> __setTypeAttribute (
@@ -4346,7 +4541,7 @@
);
}
#==========================================
- # 7) merge/update image attribs, toplevel
+ # 8) merge/update image attribs, toplevel
#------------------------------------------
if (defined $changeset->{"displayname"}) {
$this -> __setImageAttribute (
@@ -4354,12 +4549,41 @@
);
}
#==========================================
- # 8) cleanup reqProfiles
+ # 9) merge/update all free volume
+ #------------------------------------------
+ if (defined $changeset->{"allFreeVolume"}) {
+ $this -> __addAllFreeVolume ($changeset->{"allFreeVolume"});
+ }
+ #==========================================
+ # 10) cleanup reqProfiles
#------------------------------------------
$this->{reqProfiles} = $reqProfiles;
}
#==========================================
+# __addAllFreeVolume
+#------------------------------------------
+sub __addAllFreeVolume {
+ # ...
+ # Add the given volume to the systemdisk section
+ # ---
+ my $this = shift;
+ my $volume= shift;
+ my $kiwi = $this->{kiwi};
+ my $tnode = $this->{typeNode};
+ my $disk = $tnode -> getElementsByTagName ("systemdisk") -> get_node(1);
+ if (! defined $disk) {
+ return $this;
+ }
+ my $addElement = new XML::LibXML::Element ("volume");
+ $addElement -> setAttribute("name",$volume);
+ $addElement -> setAttribute("freespace","all");
+ $disk -> appendChild ($addElement);
+ $this -> updateXML();
+ return $this;
+}
+
+#==========================================
# __setOptionsElement
#------------------------------------------
sub __setOptionsElement {
@@ -4390,6 +4614,35 @@
$this -> updateXML();
return $this;
}
+
+#==========================================
+# __addOptionsElement
+#------------------------------------------
+sub __addOptionsElement {
+ # ...
+ # add a new element into the current preferences XML tree
+ # the data reference must be an array. Each element of the
+ # array is processed as new XML element
+ # ---
+ my $this = shift;
+ my $item = shift;
+ my $data = shift;
+ my $kiwi = $this->{kiwi};
+ my $value= $data->{$item};
+ if (! $value) {
+ return $this;
+ }
+ foreach my $text (@{$value}) {
+ $kiwi -> info ("Adding element $item: $text");
+ my $addElement = new XML::LibXML::Element ("$item");
+ $addElement -> appendText ($text);
+ my $opts = $this -> getPreferencesNodeByTagName ("$item");
+ $opts -> appendChild ($addElement);
+ $kiwi -> done ();
+ }
+ $this -> updateXML();
+ return $this;
+}
#==========================================
# __setOEMOptionsElement
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIXMLInfo.pm
^
|
@@ -20,6 +20,7 @@
use strict;
use warnings;
require Exporter;
+use File::Find;
use XML::LibXML;
#==========================================
@@ -135,18 +136,28 @@
# ---
my $this = shift;
my $requests = shift;
+ my $kiwi = $this->{kiwi};
my $infoRequests = $this -> __checkRequests($requests);
if (! $infoRequests) {
return undef;
}
+ my $outfile = qxx ("mktemp -q /tmp/kiwi-xmlinfo-XXXXXX 2>&1");
+ my $code = $? >> 8; chomp $outfile;
+ if ($code != 0) {
+ $kiwi -> error ("Couldn't create tmp file: $outfile: $!");
+ $kiwi -> failed ();
+ return undef;
+ }
$this -> {kiwi} -> info ("Reading image description [ListXMLInfo]...\n");
my $infoTree = $this -> __getTree($infoRequests);
if (! $infoTree) {
return undef;
}
- open (my $F, "|xsltproc $this->{gdata}->{Pretty} -");
+ open (my $F, "|xsltproc $this->{gdata}->{Pretty} - | cat > $outfile");
print $F $infoTree -> toString();
close $F;
+ system ("cat $outfile");
+ $kiwi -> info ("Requested information written to: $outfile\n");
return 1;
}
@@ -184,6 +195,8 @@
$supportedInfoReq{'patterns'} = 'List configured patterns';
$supportedInfoReq{'profiles'} = 'List profiles';
$supportedInfoReq{'repo-patterns'} = 'List available patterns from repos';
+ $supportedInfoReq{'overlay-files'} = 'List of files in root overlay';
+ $supportedInfoReq{'archives'} = 'List of tar archives to be installed';
$supportedInfoReq{'size'} = 'List install/delete size estimation';
$supportedInfoReq{'sources'} = 'List configured source URLs';
$supportedInfoReq{'types'} = 'List configured types';
@@ -272,12 +285,50 @@
# Initialize XML imagescan element
#------------------------------------------
my $scan = new XML::LibXML::Element ("imagescan");
+ $scan -> setAttribute ("description",$this->{configDir});
#==========================================
# Walk through selection list
#------------------------------------------
for my $info (@infoRequests) {
SWITCH: for ($info) {
#==========================================
+ # overlay-files
+ #------------------------------------------
+ /^overlay-files/ && do {
+ my %result;
+ sub generateWanted {
+ my $filehash = shift;
+ my $basedir = shift;
+ return sub {
+ my $file = $File::Find::name;
+ if (! -d $file) {
+ $file =~ s/$basedir//;
+ $file = "[root/]$file";
+ $filehash->{$file} = $basedir;
+ }
+ }
+ }
+ if (! -d $this->{configDir}."/root") {
+ $kiwi -> info ("No overlay root directory present\n");
+ } else {
+ my $wref = generateWanted (
+ \%result,$this->{configDir}."/root/"
+ );
+ my $rdir = $this->{configDir}."/root";
+ find({ wanted => $wref, follow => 0 }, $rdir);
+ if (! %result) {
+ $kiwi -> info ("No overlay files found\n");
+ } else {
+ foreach my $file (sort keys %result) {
+ my $overlay = new XML::LibXML::Element ("overlay");
+ $overlay -> setAttribute ("file","$file");
+ $scan -> appendChild ($overlay);
+ }
+ }
+ }
+ last SWITCH;
+ };
+ #==========================================
# repo-patterns
#------------------------------------------
/^repo-patterns/ && do {
@@ -428,6 +479,19 @@
}
last SWITCH;
};
+ /^archives/ && do {
+ my @archives = $xml -> getArchiveList();
+ if ((scalar @archives) == 0) {
+ $kiwi -> info ("No archives available\n");
+ } else {
+ foreach my $archive (@archives) {
+ my $anode = new XML::LibXML::Element ("archive");
+ $anode -> setAttribute ("name","$archive");
+ $scan -> appendChild ($anode);
+ }
+ }
+ last SWITCH;
+ };
#==========================================
# profiles
#------------------------------------------
@@ -476,15 +540,16 @@
my $this = shift;
my $xml = shift;
my $kiwi = $this->{kiwi};
+ my $uhash= $xml -> getURLHash();
my @mountPnts;
- if ($xml->{urlhash}) {
- for my $source (keys %{$xml->{urlhash}}) {
+ if ($uhash) {
+ for my $source (keys %{$uhash}) {
#==========================================
# iso:// sources
#------------------------------------------
if ($source =~ /^iso:\/\/(.*)/) {
my $iso = $1;
- my $dir = $xml->{urlhash}->{$source};
+ my $dir = $uhash->{$source};
my $data = qxx ("mkdir -p $dir; mount -o loop $iso $dir 2>&1");
my $code = $? >> 8;
if ($code != 0) {
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/modules/KIWIXMLValidator.pm
^
|
@@ -61,7 +61,10 @@
#==========================================
# Check pre-conditions
#------------------------------------------
- if (! -f $configPath) {
+ if ((! $configPath) || (! -f $configPath)) {
+ if (! $configPath) {
+ $configPath = "undefined";
+ }
$kiwi -> error ("Could not find specified configuration: $configPath");
$kiwi -> failed ();
return undef;
@@ -309,7 +312,8 @@
return 1;
}
my @regions = $ec2ConfNodes[0] -> getElementsByTagName('ec2region');
- my @supportedRegions = qw /AP-Japan AP-Singapore EU-West US-East US-West/;
+ my @supportedRegions =
+ qw /AP-Northeast AP-Southeast EU-West US-East US-West/;
my @selectedRegions = ();
for my $region (@regions) {
my $regionStr = $region -> textContent();
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/rhel-05.4/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-rhel-05.4">
+<image schemaversion="5.3" name="initrd-isoboot-rhel-05.4">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -61,8 +61,8 @@
<repository type="rpm-md" status="replaceable">
<source path="iso:///image/CDs/RHEL-5.4-%arch-DVD.iso/Server"/>
</repository>
- <repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/rhel-repo/rhel-054-repo"/>
+ <repository type="rpm-md" status="fixed" priority="1">
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/rhel-054/RedHat_RHEL-5"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/rhel-linuxrc
^
|
@@ -175,7 +175,8 @@
if [ -z "$UNIONFS_CONFIG" ];then
probeFileSystem $imageDevice
if [ "$FSTYPE" = "luks" ];then
- imageDevice=$(luksOpen $imageDevice)
+ luksOpen $imageDevice
+ imageDevice=$luksDeviceOpened
probeFileSystem $imageDevice
export haveLuks=yes
fi
@@ -187,53 +188,7 @@
#--------------------------------------
swapSpace=`searchSwapSpace`
if [ ! -z "$swapSpace" ];then
- #======================================
- # 11.1) use an existing swap partition
- #--------------------------------------
Echo "Found swap space on: $swapSpace"
-else
- #======================================
- # 11.1) use a swap file on a free part.
- #--------------------------------------
- swapDevice=`searchDiskSpace`
- if [ ! -z "$swapDevice" ];then
- FSTYPE_SAVE=$FSTYPE
- probeFileSystem $swapDevice
- SWTYPE=$FSTYPE
- FSTYPE=$FSTYPE_SAVE
- if [ $SWTYPE = "unknown" ];then
- Echo "Can't use unknown filesystem for swap file... skipped"
- else
- Echo "Setting up swap file on: $swapDevice -> $SWTYPE"
- mRAM=`cat /proc/meminfo | grep MemTotal | cut -f2 -d:`
- mRAM=`echo $mRAM | cut -f1 -d" "`
- SWSIZE=`expr $mRAM / 1024`
- SWSIZE=`expr $SWSIZE \* 2`
- if [ $SWSIZE -lt 64 ];then
- SWSIZE=64
- fi
- SWDIR=/liveswap
- SWFILE=$SWDIR/kiwiswap
- mkdir -p $SWDIR
- if ! mount -t $SWTYPE $swapDevice $SWDIR;then
- Echo "Failed to mount swap device on: $swapDevice"
- unset swapDevice
- fi
- if [ ! -f $SWFILE ];then
- dd if=/dev/zero of=$SWFILE bs=1M count=$SWSIZE >/dev/null
- if [ ! $? = 0 ];then
- Echo "Failed to create swap file on: $swapDevice"
- unset swapDevice
- fi
- if ! mkswap $SWFILE >/dev/null;then
- Echo "Failed to initialize swap file"
- unset swapDevice
- fi
- fi
- Echo "Created swap file: kiwiswap [ $SWSIZE MB ]"
- umount $SWDIR
- fi
- fi
fi
#======================================
@@ -300,10 +255,6 @@
updateRootDeviceFstab /config $imageDevice
if [ ! -z "$swapSpace" ];then
updateSwapDeviceFstab /config $swapSpace
-elif [ ! -z "$swapDevice" ];then
- mkdir -p /mnt/liveswap
- echo "$swapDevice /liveswap $SWTYPE defaults 1 1" >> /config/etc/fstab
- echo "/liveswap/kiwiswap swap swap prio=42 0 0" >> /config/etc/fstab
fi
#======================================
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/rhel-preinit
^
|
@@ -24,3 +24,14 @@
#--------------------------------------
Echo "Calling pre-init stage in system image"
errorLogStart
+
+#======================================
+# 2) update auth config
+#--------------------------------------
+authconfig --updateall
+
+#======================================
+# 3) clean mount
+#--------------------------------------
+umountSystemFilesystems
+
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-11.3/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-suse-11.3">
+<image schemaversion="5.3" name="initrd-isoboot-suse-11.3">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -76,7 +76,7 @@
<packages type="bootstrap" profiles="pae">
<package name="kernel-pae"/>
</packages>
- <packages type="image" profiles="rt">
+ <packages type="bootstrap" profiles="rt">
<package name="kernel-rt"/>
</packages>
<packages type="bootstrap" profiles="xenk">
@@ -171,7 +171,6 @@
<package name="mktemp"/>
<package name="mtools"/>
<package name="net-tools"/>
- <package name="netcfg"/>
<package name="openSUSE-release"/>
<package name="openldap2-client"/>
<package name="openslp"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-11.4/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-suse-11.4">
+<image schemaversion="5.3" name="initrd-isoboot-suse-11.4">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -79,7 +79,7 @@
<packages type="bootstrap" profiles="pae">
<package name="kernel-pae"/>
</packages>
- <packages type="image" profiles="rt">
+ <packages type="bootstrap" profiles="rt">
<package name="kernel-rt"/>
</packages>
<packages type="bootstrap" profiles="xenk">
@@ -175,7 +175,6 @@
<package name="mktemp"/>
<package name="mtools"/>
<package name="net-tools"/>
- <package name="netcfg"/>
<package name="openSUSE-release"/>
<package name="openldap2-client"/>
<package name="openslp"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-12.1/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-suse-12.1">
+<image schemaversion="5.3" name="initrd-isoboot-suse-12.1">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -79,12 +79,13 @@
<packages type="bootstrap" profiles="pae">
<package name="kernel-pae"/>
</packages>
- <packages type="image" profiles="rt">
+ <packages type="bootstrap" profiles="rt">
<package name="kernel-rt"/>
</packages>
<packages type="bootstrap" profiles="xenk">
<package name="kernel-xen"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="bootstrap" profiles="desktop">
<package name="kernel-desktop"/>
@@ -175,7 +176,6 @@
<package name="mktemp"/>
<package name="mtools"/>
<package name="net-tools"/>
- <package name="netcfg"/>
<package name="openSUSE-release"/>
<package name="openldap2-client"/>
<package name="openslp"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-SLED10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-suse-SLED10">
+<image schemaversion="5.3" name="initrd-isoboot-suse-SLED10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -24,6 +24,7 @@
<file name="usb/input/usbhid.ko"/>
</drivers>
<drivers type="drivers">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/ide/*"/>
<file name="drivers/block/loop.ko"/>
@@ -53,7 +54,7 @@
<source path="/mounts/machcd2/dists/full-sle10-sp2-%arch"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -84,7 +85,7 @@
<package name="gfxboot"/>
<package name="syslinux"/>
<package name="make"/>
- <package name="memtest86"/>
+ <package name="memtest86+"/>
<package name="hdparm"/>
<package name="grub"/>
<package name="bootsplash"/>
@@ -126,6 +127,6 @@
<package name="syslinux"/>
<package name="gfxboot"/>
<package name="make"/>
- <package name="memtest86"/>
+ <package name="memtest86+"/>
</packages>
</image>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-SLED11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-suse-SLED11">
+<image schemaversion="5.3" name="initrd-isoboot-suse-SLED11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -70,7 +70,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -80,14 +80,15 @@
<package name="kernel-pae"/>
<package name="kernel-pae-base"/>
</packages>
- <packages type="image" profiles="rt">
+ <packages type="bootstrap" profiles="rt">
<package name="kernel-rt"/>
<package name="kernel-rt-base"/>
</packages>
<packages type="bootstrap" profiles="xenk">
<package name="kernel-xen"/>
<package name="kernel-xen-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
@@ -183,7 +184,6 @@
<package name="mktemp"/>
<package name="mtools"/>
<package name="net-tools"/>
- <package name="netcfg"/>
<package name="openldap2-client"/>
<package name="openslp"/>
<package name="openssl-certs"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-SLES10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-suse-SLES10">
+<image schemaversion="5.3" name="initrd-isoboot-suse-SLES10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -24,6 +24,7 @@
<file name="usb/input/usbhid.ko"/>
</drivers>
<drivers type="drivers">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/ide/*"/>
<file name="drivers/block/loop.ko"/>
@@ -53,7 +54,7 @@
<source path="/mounts/machcd2/dists/full-sle10-sp2-%arch"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -85,7 +86,7 @@
<package name="gfxboot"/>
<package name="syslinux"/>
<package name="make"/>
- <package name="memtest86"/>
+ <package name="memtest86+"/>
<package name="hdparm"/>
<package name="grub"/>
<package name="bootsplash"/>
@@ -132,6 +133,6 @@
<package name="syslinux"/>
<package name="gfxboot"/>
<package name="make"/>
- <package name="memtest86"/>
+ <package name="memtest86+"/>
</packages>
</image>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-isoboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-isoboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -70,7 +70,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -80,14 +80,15 @@
<package name="kernel-pae"/>
<package name="kernel-pae-base"/>
</packages>
- <packages type="image" profiles="rt">
+ <packages type="bootstrap" profiles="rt">
<package name="kernel-rt"/>
<package name="kernel-rt-base"/>
</packages>
<packages type="bootstrap" profiles="xenk">
<package name="kernel-xen"/>
<package name="kernel-xen-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="bootstrap">
<package name="adaptec-firmware"/>
@@ -184,7 +185,6 @@
<package name="mktemp"/>
<package name="mtools"/>
<package name="net-tools"/>
- <package name="netcfg"/>
<package name="openldap2-client"/>
<package name="openslp"/>
<package name="openssl-certs"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-linuxrc
^
|
@@ -91,6 +91,7 @@
# 7) Mount the CD device
#--------------------------------------
CDMount
+runMediaCheck
#======================================
# 8) Load configuration
@@ -116,8 +117,9 @@
2) imageVersion=$n
esac
done
+ IFS=$IFS_ORIG
imageReadOnly="$imageName"
- imageReadOnly=`echo $imageReadOnly | sed -e s@.$ARCH@@`
+ imageReadOnly=$(echo $imageReadOnly | sed -e "s@\.${ARCH}\$@@")
imageReadOnly="$imageReadOnly-read-only.$ARCH-$imageVersion"
imageName="/cdrom/$imageName-$imageVersion"
gzippName=$imageName.gz
@@ -126,7 +128,6 @@
continue
fi
while true;do
- IFS=" "
read sum1 blocks blocksize zblocks zblocksize < $imageMD5s
if ! validateSize;then
systemException \
@@ -175,7 +176,8 @@
if [ -z "$UNIONFS_CONFIG" ];then
probeFileSystem $imageDevice
if [ "$FSTYPE" = "luks" ];then
- imageDevice=$(luksOpen $imageDevice)
+ luksOpen $imageDevice
+ imageDevice=$luksDeviceOpened
probeFileSystem $imageDevice
export haveLuks=yes
fi
@@ -187,53 +189,7 @@
#--------------------------------------
swapSpace=`searchSwapSpace`
if [ ! -z "$swapSpace" ];then
- #======================================
- # 11.1) use an existing swap partition
- #--------------------------------------
Echo "Found swap space on: $swapSpace"
-else
- #======================================
- # 11.1) use a swap file on a free part.
- #--------------------------------------
- swapDevice=`searchDiskSpace`
- if [ ! -z "$swapDevice" ];then
- FSTYPE_SAVE=$FSTYPE
- probeFileSystem $swapDevice
- SWTYPE=$FSTYPE
- FSTYPE=$FSTYPE_SAVE
- if [ $SWTYPE = "unknown" ];then
- Echo "Can't use unknown filesystem for swap file... skipped"
- else
- Echo "Setting up swap file on: $swapDevice -> $SWTYPE"
- mRAM=`cat /proc/meminfo | grep MemTotal | cut -f2 -d:`
- mRAM=`echo $mRAM | cut -f1 -d" "`
- SWSIZE=`expr $mRAM / 1024`
- SWSIZE=`expr $SWSIZE \* 2`
- if [ $SWSIZE -lt 64 ];then
- SWSIZE=64
- fi
- SWDIR=/liveswap
- SWFILE=$SWDIR/kiwiswap
- mkdir -p $SWDIR
- if ! mount -t $SWTYPE $swapDevice $SWDIR;then
- Echo "Failed to mount swap device on: $swapDevice"
- unset swapDevice
- fi
- if [ ! -f $SWFILE ];then
- dd if=/dev/zero of=$SWFILE bs=1M count=$SWSIZE >/dev/null
- if [ ! $? = 0 ];then
- Echo "Failed to create swap file on: $swapDevice"
- unset swapDevice
- fi
- if ! mkswap $SWFILE >/dev/null;then
- Echo "Failed to initialize swap file"
- unset swapDevice
- fi
- fi
- Echo "Created swap file: kiwiswap [ $SWSIZE MB ]"
- umount $SWDIR
- fi
- fi
fi
#======================================
@@ -300,10 +256,6 @@
updateRootDeviceFstab /config $imageDevice
if [ ! -z "$swapSpace" ];then
updateSwapDeviceFstab /config $swapSpace
-elif [ ! -z "$swapDevice" ];then
- mkdir -p /mnt/liveswap
- echo "$swapDevice /liveswap $SWTYPE defaults 1 1" >> /config/etc/fstab
- echo "/liveswap/kiwiswap swap swap prio=42 0 0" >> /config/etc/fstab
fi
#======================================
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/isoboot/suse-preinit
^
|
@@ -41,6 +41,11 @@
createFramebufferDevices
#======================================
-# 5) clean mount
+# 5) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 6) clean mount
#--------------------------------------
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-11.3/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-11.3">
+<image schemaversion="5.3" name="initrd-netboot-suse-11.3">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -26,6 +26,7 @@
<file name="drivers/xen/*"/>
</drivers>
<drivers type="drivers" profiles="default,xen">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/hid/*"/>
<file name="drivers/input/keyboard/*"/>
@@ -75,6 +76,7 @@
<file name="lib/crc16.ko"/>
</drivers>
<drivers type="drivers" profiles="diskless">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/ide/*"/>
<file name="drivers/block/loop.ko"/>
@@ -138,7 +140,7 @@
<source path="/image/CDs/full-11.3-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -159,6 +161,7 @@
<package name="xen"/>
</packages>
<packages type="image" profiles="default,xen">
+ <package name="cryptsetup"/>
<package name="bc"/>
<package name="adaptec-firmware"/>
<package name="clicfs"/>
@@ -237,7 +240,6 @@
<package name="diffutils"/>
<package name="expat"/>
<package name="fillup"/>
- <package name="gawk"/>
<package name="gdbm"/>
<package name="glib2"/>
<package name="glibc-locale"/>
@@ -265,7 +267,6 @@
<package name="pm-utils"/>
<package name="pmtools"/>
<package name="suse-build-key"/>
- <package name="fribidi"/>
<package name="make"/>
</packages>
<packages type="delete" profiles="diskless">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-11.4/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-11.4">
+<image schemaversion="5.3" name="initrd-netboot-suse-11.4">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -26,6 +26,7 @@
<file name="drivers/xen/*"/>
</drivers>
<drivers type="drivers" profiles="default,xen">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/hid/*"/>
<file name="drivers/input/keyboard/*"/>
@@ -78,6 +79,7 @@
<file name="drivers/gpu/drm/radeon/radeon.ko"/>
</drivers>
<drivers type="drivers" profiles="diskless">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/ide/*"/>
<file name="drivers/block/loop.ko"/>
@@ -162,6 +164,7 @@
<package name="xen"/>
</packages>
<packages type="image" profiles="default,xen">
+ <package name="cryptsetup"/>
<package name="bc"/>
<package name="adaptec-firmware"/>
<package name="clicfs"/>
@@ -241,7 +244,6 @@
<package name="diffutils"/>
<package name="expat"/>
<package name="fillup"/>
- <package name="gawk"/>
<package name="gdbm"/>
<package name="glib2"/>
<package name="glibc-locale"/>
@@ -269,7 +271,6 @@
<package name="pm-utils"/>
<package name="pmtools"/>
<package name="suse-build-key"/>
- <package name="fribidi"/>
<package name="make"/>
</packages>
<packages type="delete" profiles="diskless">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-12.1/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-12.1">
+<image schemaversion="5.3" name="initrd-netboot-suse-12.1">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -26,6 +26,7 @@
<file name="drivers/xen/*"/>
</drivers>
<drivers type="drivers" profiles="default,xen">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/hid/*"/>
<file name="drivers/input/keyboard/*"/>
@@ -78,6 +79,7 @@
<file name="drivers/gpu/drm/radeon/radeon.ko"/>
</drivers>
<drivers type="drivers" profiles="diskless">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/ide/*"/>
<file name="drivers/block/loop.ko"/>
@@ -159,9 +161,11 @@
<package name="kernel-desktop"/>
</packages>
<packages type="image" profiles="xen">
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="default,xen">
+ <package name="cryptsetup"/>
<package name="bc"/>
<package name="adaptec-firmware"/>
<package name="clicfs"/>
@@ -241,7 +245,6 @@
<package name="diffutils"/>
<package name="expat"/>
<package name="fillup"/>
- <package name="gawk"/>
<package name="gdbm"/>
<package name="glib2"/>
<package name="glibc-locale"/>
@@ -269,7 +272,6 @@
<package name="pm-utils"/>
<package name="pmtools"/>
<package name="suse-build-key"/>
- <package name="fribidi"/>
<package name="make"/>
</packages>
<packages type="delete" profiles="diskless">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-SLED10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-SLED10">
+<image schemaversion="5.3" name="initrd-netboot-suse-SLED10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -24,6 +24,7 @@
<file name="usb/input/usbhid.ko"/>
</drivers>
<drivers type="drivers">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/ide/*"/>
<file name="drivers/cdrom/*"/>
@@ -56,7 +57,7 @@
<source path="ftp://dist.suse.de/install/SLP/SLED-10-SP2-GMC/%arch/DVD1"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -110,7 +111,6 @@
<package name="perl-gettext"/>
<package name="perl-Bootloader"/>
<package name="pam-modules"/>
- <package name="gawk"/>
<package name="gnome-filesystem"/>
<package name="openslp"/>
<package name="suse-build-key"/>
@@ -128,7 +128,6 @@
<package name="ash"/>
<package name="gdbm"/>
<package name="gfxboot"/>
- <package name="fribidi"/>
<package name="make"/>
</packages>
</image>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-SLED11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-SLED11">
+<image schemaversion="5.3" name="initrd-netboot-suse-SLED11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -30,6 +30,7 @@
<file name="usb/storage/usb-storage.ko"/>
</drivers>
<drivers type="drivers" profiles="default,xen">
+ <file name="crypto/*"/>
<file name="drivers/gpu/drm/i915/i915.ko"/>
<file name="drivers/char/agp/intel-agp.ko"/>
<file name="drivers/md/*"/>
@@ -69,6 +70,7 @@
<file name="drivers/acpi/dock.ko"/>
</drivers>
<drivers type="drivers" profiles="diskless">
+ <file name="crypto/*"/>
<file name="drivers/gpu/drm/i915/i915.ko"/>
<file name="drivers/char/agp/intel-agp.ko"/>
<file name="drivers/md/*"/>
@@ -132,7 +134,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -151,9 +153,11 @@
<package name="kernel-xen-base"/>
</packages>
<packages type="image" profiles="xen">
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="default,xen">
+ <package name="cryptsetup"/>
<package name="bc"/>
<package name="curl"/>
<package name="psmisc"/>
@@ -226,7 +230,6 @@
<package name="diffutils"/>
<package name="expat"/>
<package name="fillup"/>
- <package name="gawk"/>
<package name="gdbm"/>
<package name="glib2"/>
<package name="glibc-locale"/>
@@ -254,7 +257,6 @@
<package name="pm-utils"/>
<package name="pmtools"/>
<package name="suse-build-key"/>
- <package name="fribidi"/>
<package name="make"/>
</packages>
<packages type="delete" profiles="diskless">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-SLES10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-SLES10">
+<image schemaversion="5.3" name="initrd-netboot-suse-SLES10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -24,6 +24,7 @@
<file name="usb/input/usbhid.ko"/>
</drivers>
<drivers type="drivers">
+ <file name="crypto/*"/>
<file name="drivers/md/*"/>
<file name="drivers/ide/*"/>
<file name="drivers/cdrom/*"/>
@@ -56,7 +57,7 @@
<source path="ftp://dist.suse.de/install/SLP/SLES-10-SP2-GMC/%arch/DVD1"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -112,7 +113,6 @@
<package name="perl-gettext"/>
<package name="perl-Bootloader"/>
<package name="pam-modules"/>
- <package name="gawk"/>
<package name="gnome-filesystem"/>
<package name="openslp"/>
<package name="suse-build-key"/>
@@ -130,7 +130,6 @@
<package name="ash"/>
<package name="gdbm"/>
<package name="gfxboot"/>
- <package name="fribidi"/>
<package name="make"/>
</packages>
</image>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-netboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -30,6 +30,7 @@
<file name="usb/storage/usb-storage.ko"/>
</drivers>
<drivers type="drivers" profiles="default,xen">
+ <file name="crypto/*"/>
<file name="drivers/gpu/drm/i915/i915.ko"/>
<file name="drivers/char/agp/intel-agp.ko"/>
<file name="drivers/md/*"/>
@@ -69,6 +70,7 @@
<file name="drivers/acpi/dock.ko"/>
</drivers>
<drivers type="drivers" profiles="diskless">
+ <file name="crypto/*"/>
<file name="drivers/gpu/drm/i915/i915.ko"/>
<file name="drivers/char/agp/intel-agp.ko"/>
<file name="drivers/md/*"/>
@@ -132,7 +134,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -151,9 +153,11 @@
<package name="kernel-xen-base"/>
</packages>
<packages type="image" profiles="xen">
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="default,xen">
+ <package name="cryptsetup"/>
<package name="bc"/>
<package name="adaptec-firmware"/>
<package name="curl"/>
@@ -227,7 +231,6 @@
<package name="diffutils"/>
<package name="expat"/>
<package name="fillup"/>
- <package name="gawk"/>
<package name="gdbm"/>
<package name="glib2"/>
<package name="glibc-locale"/>
@@ -255,7 +258,6 @@
<package name="pm-utils"/>
<package name="pmtools"/>
<package name="suse-build-key"/>
- <package name="fribidi"/>
<package name="make"/>
</packages>
<packages type="delete" profiles="diskless">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-linuxrc
^
|
@@ -93,7 +93,7 @@
# 4) Include proc/cmdline information
#--------------------------------------
includeKernelParameters
-if [ ! -z $IMAGE ];then
+if [ ! -z "$IMAGE" ];then
# /.../
# if the image information is already in place at this stage
# it comes from the cmdline data which means we are not booting
@@ -259,7 +259,12 @@
runHook postprobe
#======================================
-# 11) Check for diskful station
+# 11) Select language if not in cmdline
+#--------------------------------------
+selectLanguage
+
+#======================================
+# 12) Check for diskful station
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
checkDevice=$DISK
@@ -282,7 +287,7 @@
fi
#======================================
-# 12) Check for installed system
+# 13) Check for installed system
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $haveDisk = "1" ];then
if [ ! -z "$RAID" ];then
@@ -302,6 +307,17 @@
done
updateNeeded initialize
if linuxPartition $imageDiskDevice;then
+ probeFileSystem $imageDevice
+ if [ "$FSTYPE" = "luks" ];then
+ luks_open_can_fail=yes
+ if luksOpen $imageDevice ; then
+ imageDevice=$luksDeviceOpened
+ imageRODevice=$imageDevice
+ probeFileSystem $imageRootDevice
+ export haveLuks=yes
+ fi
+ unset luks_open_can_fail
+ fi
if mountSystem $imageDevice;then
updateNeeded
umountSystem
@@ -316,6 +332,9 @@
RELOAD_IMAGE="yes"
systemIntegrity="clean"
fi
+ if [ -n "$haveLuks" ]; then
+ luksClose $imageDevice
+ fi
else
systemIntegrity="clean"
fi
@@ -323,10 +342,10 @@
fi
#======================================
-# 13) Create ptable on diskful system
+# 14) Create ptable on diskful system
#--------------------------------------
+runHook prepartition
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
- runHook prepartition
#======================================
# Create partition table
#--------------------------------------
@@ -392,11 +411,13 @@
else
export imageSwapDevice=$(pxeRaidSwapDevice)
fi
+ runHook preswap
if [ ! -z "$imageSwapDevice" ];then
if ! mkswap $imageSwapDevice 1>&2;then
systemException "Failed to create swap signature" "reboot"
fi
fi
+ runHook postswap
#======================================
# Setup boot space if requested
#--------------------------------------
@@ -406,11 +427,11 @@
createFilesystem $imageBootDevice
fi
fi
- runHook postpartition
fi
+runHook postpartition
#======================================
-# 14) Setup root device environment
+# 15) Setup root device environment
#--------------------------------------
runHook predownload
if \
@@ -418,7 +439,7 @@
([ $haveDisk = "1" ] || [ $haveRamDisk = "1" ])
then
#======================================
- # 14.1) Download network client image
+ # 15.1) Download network client image
#--------------------------------------
count=0
IFS="," ; for i in $IMAGE;do
@@ -439,9 +460,6 @@
imageRootDevice=$imageDevice
imageRootName=$imageName
fi
- if [ $count = 2 ];then
- imageNextRootDevice=$imageDevice
- fi
# /.../
# start download only if installed system is different
# from the image on the pxe boot server
@@ -505,15 +523,18 @@
eval $dump 2>/progress |\
head --bytes=$verifyBytes | md5sum - > /etc/ireal.md5
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
errorLogContinue
else
@@ -541,28 +562,29 @@
Echo -b " within the appropriate .md5 file for this image"
echo
if [ -z "$DISK" ];then
- Echo -b "4) ramdisk size is too small for the image:"
- Echo -b " check the ramdisk_size parameter of the PXE"
- Echo -b " configuration file on the TFTP server"
+ Echo -b "4) ramdisk size is too small for the image:"
+ Echo -b " check the ramdisk_size parameter of the PXE"
+ Echo -b " configuration file on the TFTP server"
else
- Echo -b "4) partition size is too small for the image:"
- Echo -b " check the PART line in the image config file on the"
- Echo -b " TFTP server"
+ Echo -b "4) partition size is too small for the image:"
+ Echo -b " check the PART line in the image config file on the"
+ Echo -b " TFTP server"
fi
echo
Echo "Retry to load image..."
sleep 15
done
- if [ ! -z "$DISK" ];then
- probeFileSystem $imageDevice
- resizeFilesystem $imageDevice
+ imageRootDevice=$imageDevice
+ if [ ! -z "$UNIONFS_CONFIG" ];then
+ imageRWDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`
+ imageRODevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`
fi
rm -f /etc/ireal.md5
rm -f /etc/image.md5
done
else
#======================================
- # 14.2) Check for local boot
+ # 15.2) Check for local boot
#--------------------------------------
if [ $LOCAL_BOOT = "yes" ];then
imageDisk=$(dn $root)
@@ -571,14 +593,12 @@
imageRootName="Local-System"
if [ ! -z "$UNIONFS_CONFIG" ];then
unionFST=$UNIONFS_CONFIG
- setupUnionFS $(ddn $imageDisk 3) $(ddn $imageDisk 2) $unionFST
- fi
- if [ ! -z "$COMBINED_IMAGE" ];then
- imageNextRootDevice=$(ddn $imageDisk 3)
+ imageRWDevice=$(ddn $imageDisk 3)
+ imageRODevice=$(ddn $imageDisk 2)
fi
fi
#======================================
- # 14.3) Check for NFS root
+ # 15.3) Check for NFS root
#--------------------------------------
if [ ! -z "$NFSROOT" ];then
IFS="," ; for i in $NFSROOT;do
@@ -602,18 +622,20 @@
if [ ! -z "$COMBINED_IMAGE" ] || [ ! -z "$UNIONFS_CONFIG" ];then
imageRootDevice="-o vers=3,ro $nfsRootServer:$nfsRootDevice"
fi
+ imageRootName="NFSRoot-System"
+ systemIntegrity="clean"
+ export FSTYPE=nfs
if [ ! -z "$UNIONFS_CONFIG" ];then
+ imageRWDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`
+ imageRODevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`
unionFST=`echo $UNIONFS_CONFIG | cut -d , -f 3`
if [ "$unionFST" = "clicfs" ];then
systemException "clicfs over NFSROOT is not supported" "reboot"
fi
fi
- imageRootName="NFSRoot-System"
- systemIntegrity="clean"
- export FSTYPE=nfs
fi
#======================================
- # 14.4) Check for NBD root
+ # 15.4) Check for NBD root
#--------------------------------------
if [ ! -z "$NBDROOT" ];then
if ! modprobe nbd;then
@@ -708,18 +730,15 @@
# setup union if basic root filesystem is read-only
# ----
imageRootDevice=$nbdDevice
- probeFileSystem $imageRootDevice
- Echo "Filesystem of remote root system is: $FSTYPE"
- if [ -z "$COMBINED_IMAGE" ];then
- if isFSTypeReadOnly;then
- setupUnionFS "$nbdwriteDevice" "$imageRootDevice" $unionFST
- fi
- fi
imageRootName="NBDRoot-System"
systemIntegrity="clean"
+ if [ -z "$COMBINED_IMAGE" ];then
+ imageRWDevice=$nbdwriteDevice
+ imageRODevice=$imageRootDevice
+ fi
fi
#======================================
- # 14.5) Check for AOE root
+ # 15.5) Check for AOE root
#--------------------------------------
if [ ! -z "$AOEROOT" ];then
aoeRODevice=`echo $AOEROOT | cut -d , -f 1`
@@ -746,50 +765,81 @@
fi
Echo "Mounting AoE root system: $aoeRODevice..."
imageRootDevice=$aoeRODevice
- probeFileSystem $imageRootDevice
- Echo "Filesystem of remote root system is: $FSTYPE"
- if [ -z "$COMBINED_IMAGE" ];then
- if isFSTypeReadOnly;then
- setupUnionFS "$aoeRWDevice" "$imageRootDevice" $unionFST
- fi
- fi
imageRootName="AOERoot-System"
systemIntegrity="clean"
+ if [ -z "$COMBINED_IMAGE" ];then
+ imageRWDevice=$aoeRWDevice
+ imageRODevice=$imageRootDevice
+ fi
fi
fi
runHook postdownload
#======================================
-# 15) Mount OS image to /mnt
+# 16) Get filesystem type
#--------------------------------------
-runHook premount
-if ! mountSystem;then
- systemException "Failed to mount root filesystem" "reboot"
+if [ -b $imageRootDevice ];then
+ probeFileSystem $imageRootDevice
+ if [ "$FSTYPE" = "luks" ];then
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
+ imageRODevice=$imageRootDevice
+ probeFileSystem $imageRootDevice
+ export haveLuks=yes
+ fi
+ if [ "$FSTYPE" = "unknown" ];then
+ systemException \
+ "Couldn't determine filesystem type... abort" \
+ "reboot"
+ fi
+fi
+
+#======================================
+# 17) resize fs on diskful client
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
+ if [ $haveDisk = "1" ] || [ $haveRamDisk = "1" ];then
+ resizeFilesystem $imageRootDevice
+ fi
fi
-validateRootTree
-runHook postmount
#======================================
-# 16) Setup boot device contents
+# 18) Check filesystem
+#--------------------------------------
+Echo "Filesystem of PXE system is: $FSTYPE -> $imageRootDevice"
+if isFSTypeReadOnly;then
+ if [ ! -z "$imageRWDevice" ] && [ ! -z "$imageRODevice" ];then
+ setupUnionFS $imageRWDevice $imageRODevice $unionFST
+ fi
+fi
+
+#======================================
+# 19) Setup bootid for this table
#--------------------------------------
if [ ! -z "$imageBootDevice" ];then
+ # bootid is boot partition
export bootid=$(nd $imageBootDevice)
- cd /mnt/boot && tar -czf /tmp/boot.tgz .
- rm -rf /mnt/boot/* && mount $imageBootDevice /mnt/boot
- cd /mnt/boot && tar -xf /tmp/boot.tgz
- rm -f /tmp/boot.tgz
else
+ # bootid is root partition
export bootid=$(nd $imageRootDevice)
fi
if [ ! -z "$RAID" ];then
# raid md devices start with 0 but partition id's start with 1
bootid=$((bootid + 1))
- # make mdadm.conf available in system image
- cp /mdadm.conf /mnt/etc
fi
#======================================
-# 17) Import fixed configuration files
+# 20) Mount OS image to /mnt
+#--------------------------------------
+runHook premount
+if ! mountSystem;then
+ systemException "Failed to mount root filesystem" "reboot"
+fi
+validateRootTree
+runHook postmount
+
+#======================================
+# 21) Import fixed configuration files
#--------------------------------------
runHook preconfig
if [ $LOCAL_BOOT = "no" ] || [ ! -z "$RELOAD_CONFIG" ];then
@@ -797,13 +847,19 @@
Echo "Configuration files reload forced via RELOAD_CONFIG..."
fi
#=======================================
- # 17.0) Import NFS root files
+ # 21.0) Import NFS root files
#---------------------------------------
if [ ! -z "$NFSROOT" ];then
test -f /etc/resolv.conf && cp /etc/resolv.conf /mnt/etc
fi
#=======================================
- # 17.1) Import files from backup
+ # 21.1) Import RAID config file
+ #---------------------------------------
+ if [ ! -z "$RAID" ];then
+ cp /mdadm.conf /mnt/etc
+ fi
+ #=======================================
+ # 21.2) Import files from backup
#---------------------------------------
BCFG_BASE='etc/KIWI'
BCFG_NAME='InstalledConfigFiles'
@@ -813,7 +869,7 @@
ALL_CCONF=`condenseConfigData "$CONF,$VENDOR_CONF"`
ALL_CBK_CONF=`condenseConfigData "$BK_CONF,$BK_VENDOR_CONF"`
#=======================================
- # 17.2) Store new configuration
+ # 21.3) Store new configuration
#---------------------------------------
mkdir /config
mkdir -p /config/$BCFG_BASE
@@ -821,7 +877,7 @@
echo "CONF=$CONF" > "/config/$BCFG_BASE/$BCFG_NAME"
echo "VENDOR_CONF=$VENDOR_CONF" >> "/config/$BCFG_BASE/$BCFG_NAME"
#=======================================
- # 17.3) Get files from CONF, VENDOR_CONF
+ # 21.4) Get files from CONF, VENDOR_CONF
#---------------------------------------
IFS="," ; for i in $ALL_CCONF;do
unset configHash
@@ -862,7 +918,7 @@
fi
done
#=======================================
- # 17.4) check config files to be deleted
+ # 21.5) check config files to be deleted
#---------------------------------------
IFS="," ; for i in $ALL_CBK_CONF;do
BKconfigDest=`echo "$i" | cut -d ';' -f 2`
@@ -881,7 +937,7 @@
done
IFS=$IFS_ORIG
#=======================================
- # 17.5) Check for KIWI_INITRD
+ # 21.6) Check for KIWI_INITRD
#---------------------------------------
if [ $haveDisk = "1" ] && [ $systemIntegrity = "clean" ];then
if [ ! -z "$KIWI_INITRD" ] && [ ! -z "$KIWI_KERNEL" ];then
@@ -908,7 +964,7 @@
runHook postconfig
#======================================
-# 18) check filesystem and kernels
+# 22) check filesystem and kernels
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
if [ "$FSTYPE" != "nfs" ];then
@@ -918,14 +974,14 @@
fi
#======================================
-# 19) setup ird/kernel links for union
+# 23) setup ird/kernel links for union
#--------------------------------------
if [ "$LOCAL_BOOT" = "no" ] && [ $systemIntegrity = "clean" ];then
setupKernelLinks
fi
#======================================
-# 20) Create system dependant files
+# 24) Create system dependant files
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
mkdir -p /config
@@ -942,7 +998,7 @@
fi
#======================================
-# 21) send DHCP_RELEASE, reset cache
+# 25) send DHCP_RELEASE, reset cache
#--------------------------------------
runHook preNetworkRelease
if [ $LOCAL_BOOT = "no" ];then
@@ -950,25 +1006,25 @@
fi
#======================================
-# 22) copy system dependant files
+# 26) copy system dependant files
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
setupConfigFiles
fi
#======================================
-# 23) update system dependant files
+# 27) update system dependant files
#--------------------------------------
setupInittab /mnt
echo 256 > /proc/sys/kernel/real-root-dev
#======================================
-# 24) umount system filesystems
+# 28) umount system filesystems
#--------------------------------------
umountSystemFilesystems
#======================================
-# 25) copy initrd files to image
+# 29) copy initrd files to image
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
if canWrite /mnt;then
@@ -979,18 +1035,18 @@
fi
#======================================
-# 26) kill boot shell
+# 30) kill boot shell
#--------------------------------------
killShell
killBlogD
#======================================
-# 27) Activate new root
+# 31) Activate new root
#--------------------------------------
runHook preactivate
activateImage
#======================================
-# 28) Unmount initrd / system init
+# 32) Unmount initrd / system init
#--------------------------------------
bootImage $@
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/netboot/suse-preinit
^
|
@@ -132,7 +132,12 @@
kernelCheck
#======================================
-# 13) kill udev
+# 13) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 14) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-11.3/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-11.3">
+<image schemaversion="5.3" name="initrd-oemboot-suse-11.3">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -28,6 +28,7 @@
<file name="drivers/hwmon/*"/>
<file name="drivers/acpi/*"/>
<file name="drivers/virtio/*"/>
+ <file name="drivers/block/brd.ko"/>
<file name="drivers/block/cciss.ko"/>
<file name="drivers/block/virtio_blk.ko"/>
<file name="drivers/char/hw_random/virtio-rng.ko"/>
@@ -82,7 +83,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -146,6 +147,7 @@
<package name="syslinux"/>
<package name="dosfstools"/>
<package name="xfsprogs"/>
+ <package name="iputils"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-11.4/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-11.4">
+<image schemaversion="5.3" name="initrd-oemboot-suse-11.4">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -28,6 +28,7 @@
<file name="drivers/hwmon/*"/>
<file name="drivers/acpi/*"/>
<file name="drivers/virtio/*"/>
+ <file name="drivers/block/brd.ko"/>
<file name="drivers/block/cciss.ko"/>
<file name="drivers/block/virtio_blk.ko"/>
<file name="drivers/char/hw_random/virtio-rng.ko"/>
@@ -84,6 +85,9 @@
<repository type="yast2" status="replaceable">
<source path="/image/CDs/full-i386"/>
</repository>
+ <repository type="rpm-md" status="fixed">
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-11.4/openSUSE_11.4"/>
+ </repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
</packages>
@@ -147,6 +151,7 @@
<package name="dosfstools"/>
<package name="xfsprogs"/>
<package name="kernel-firmware"/>
+ <package name="iputils"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-12.1/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-12.1">
+<image schemaversion="5.3" name="initrd-oemboot-suse-12.1">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -28,6 +28,7 @@
<file name="drivers/hwmon/*"/>
<file name="drivers/acpi/*"/>
<file name="drivers/virtio/*"/>
+ <file name="drivers/block/brd.ko"/>
<file name="drivers/block/cciss.ko"/>
<file name="drivers/block/virtio_blk.ko"/>
<file name="drivers/char/hw_random/virtio-rng.ko"/>
@@ -92,7 +93,8 @@
</packages>
<packages type="image" profiles="xenk">
<package name="kernel-xen"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
@@ -147,6 +149,7 @@
<package name="dosfstools"/>
<package name="xfsprogs"/>
<package name="kernel-firmware"/>
+ <package name="iputils"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-SLED10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-SLED10">
+<image schemaversion="5.3" name="initrd-oemboot-suse-SLED10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -59,7 +59,7 @@
<source path="ftp://dist.suse.de/install/SLP/SLED-10-SP2-GMC/%arch/DVD1"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -112,6 +112,7 @@
<package name="glibc"/>
<package name="glibc-locale"/>
<package name="openssl"/>
+ <package name="iputils"/>
</packages>
<packages type="delete">
<package name="cracklib-dict-small"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-SLED11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-SLED11">
+<image schemaversion="5.3" name="initrd-oemboot-suse-SLED11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -30,6 +30,7 @@
<file name="drivers/acpi/*"/>
<file name="drivers/usb/*"/>
<file name="drivers/virtio/*"/>
+ <file name="drivers/block/brd.ko"/>
<file name="drivers/block/cciss.ko"/>
<file name="drivers/block/virtio_blk.ko"/>
<file name="drivers/char/hw_random/virtio-rng.ko"/>
@@ -73,7 +74,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -86,12 +87,14 @@
<packages type="image" profiles="xenk">
<package name="kernel-xen"/>
<package name="kernel-xen-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
<package name="kernel-ec2-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="rt">
<package name="kernel-rt"/>
@@ -132,6 +135,7 @@
<package name="gettext-runtime"/>
<package name="syslinux"/>
<package name="dosfstools"/>
+ <package name="iputils"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-SLES10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-SLES10">
+<image schemaversion="5.3" name="initrd-oemboot-suse-SLES10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -59,7 +59,7 @@
<source path="ftp://dist.suse.de/install/SLP/SLES-10-SP2-GMC/%arch/DVD1"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
@@ -114,6 +114,7 @@
<package name="glibc"/>
<package name="glibc-locale"/>
<package name="openssl"/>
+ <package name="iputils"/>
</packages>
<packages type="delete">
<package name="cracklib-dict-small"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-oemboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -30,6 +30,7 @@
<file name="drivers/acpi/*"/>
<file name="drivers/usb/*"/>
<file name="drivers/virtio/*"/>
+ <file name="drivers/block/brd.ko"/>
<file name="drivers/block/cciss.ko"/>
<file name="drivers/block/virtio_blk.ko"/>
<file name="drivers/char/hw_random/virtio-rng.ko"/>
@@ -73,7 +74,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -86,12 +87,14 @@
<packages type="image" profiles="xenk">
<package name="kernel-xen"/>
<package name="kernel-xen-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
<package name="kernel-ec2-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="rt">
<package name="kernel-rt"/>
@@ -136,6 +139,7 @@
<package name="kpartx"/>
<package name="syslinux"/>
<package name="dosfstools"/>
+ <package name="iputils"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-dump
^
|
@@ -153,16 +153,19 @@
#======================================
# Search CD/DVD/USB stick and mount it
#--------------------------------------
+ waitForIdleEventQueue
if [ -z "$pxe" ];then
USBStickDevice install
if [ $stickFound = 0 ];then
Echo "Search for USB stick failed, checking CD/DVD drive"
- CDMount
+ CDMount install
export OEMInstallType=CD
+ export imageDiskDevice=$biosBootDevice
else
Echo "Found Stick: $stickRoot -> $stickSerial"
mkdir -p /cdrom && mount $(ddn $stickRoot 2) /cdrom
export OEMInstallType=USB
+ export imageDiskDevice=$stickRoot
unset stickSerial
fi
else
@@ -185,6 +188,9 @@
cut -f1 -d"("`
fi
export deviceDisks=`echo $deviceDisks`
+ if [ ! -z "$ramdisk" ];then
+ deviceDisks="$deviceDisks /dev/ram1"
+ fi
if [ -z "$deviceDisks" ];then
systemException \
"No device(s) for installation found... abort" \
@@ -436,7 +442,8 @@
pname=`echo $partitions | cut -f1 -d:`
imageDevice=$pname
rID=$(nd $pname)
- instItems[0]=$imageName:$imageDevice
+ instItems[0]=$imageName
+ instPaths[0]=$imageDevice
else
#======================================
# There is a choice, let the user do it
@@ -490,19 +497,26 @@
if [ $p = /dev/mapper/${loop}p1 ];then
imageDevice=$selectedPart
bID=$(nd $selectedPart)
- instItems[0]=/dev/mapper/${loop}p1:$imageDevice
+ instItems[0]=/dev/mapper/${loop}p1
+ instPaths[0]=$imageDevice
elif [ $p = /dev/mapper/${loop}p2 ];then
rID=$(nd $selectedPart)
- instItems[1]=/dev/mapper/${loop}p2:$selectedPart
+ instItems[1]=/dev/mapper/${loop}p2
+ instPaths[1]=$selectedPart
fi
done
# /.../
- # reverse order of instItems because
- # root partition must be first entry
+ # reverse order of instItems and instPaths because
+ # the root partition must be the first entry
# ----
+ # instItems
instItems_tmp=${instItems[0]}
instItems[0]=${instItems[1]}
instItems[1]=$instItems_tmp
+ # instPaths
+ instPaths_tmp=${instPaths[0]}
+ instPaths[0]=${instPaths[1]}
+ instPaths[1]=$instPaths_tmp
fi
#======================================
# Search for a swap space
@@ -531,7 +545,8 @@
setupDeviceNames $rID $sID no $bID no
fi
else
- instItems[0]=$imageName:$imageDevice
+ instItems[0]=$imageName
+ instPaths[0]=$imageDevice
fi
#======================================
# Checks and MD5 sums...
@@ -563,13 +578,13 @@
#--------------------------------------
if [ ! -z "$pxe" ];then
multicast="disable"
- fetchFile $imageMD5 /image.md5 uncompressed $imageServer
+ fetchFile $imageMD5 /etc/image.md5 uncompressed $imageServer
if test $loadCode != 0 || ! loadOK "$loadStatus";then
systemException \
"Download of $imageMD5 failed: $loadStatus" \
"reboot"
fi
- imageMD5=/image.md5
+ imageMD5=/etc/image.md5
fi
fi
#======================================
@@ -579,9 +594,8 @@
#======================================
# Warn me before performing the install
#--------------------------------------
- for i in ${instItems[*]}; do
- Target=$(echo $i | cut -f2 -d:)
- items="$items,$Target"
+ for i in ${instPaths[*]}; do
+ items="$items,$i"
done
items=$(echo $items | sed -e s@^,@@)
Echo "Entering installation mode for disk: $items"
@@ -596,12 +610,13 @@
fi
fi
clear
- for i in ${instItems[*]};do
+ instIndex=0
+ while [ $instIndex -lt ${#instItems[*]} ];do
#======================================
# Setup source and target data
#--------------------------------------
- Source=$(echo $i | cut -f1 -d:)
- Target=$(echo $i | cut -f2 -d:)
+ Source=${instItems[$instIndex]}
+ Target=${instPaths[$instIndex]}
if [ -z "$OEM_PARTITION_INSTALL" ];then
if ! read sum1 blocks blocksize zblocks zblocksize < $imageMD5;then
systemException \
@@ -664,15 +679,18 @@
"reboot"
fi
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
else
if ! eval $dump | dd bs=32k of=$Target &>/dev/null; then
@@ -694,6 +712,7 @@
"reboot"
fi
fi
+ instIndex=$((instIndex + 1))
done
#======================================
# Clear loops if required
@@ -720,15 +739,18 @@
eval $dump 2>/progress |\
head --bytes=$verifyBytes | md5sum - > /etc/ireal.md5
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
errorLogContinue
else
@@ -761,6 +783,9 @@
#--------------------------------------
if [ -z "$OEM_PARTITION_INSTALL" ];then
blockdev --rereadpt $imageDevice
+ if echo $imageDevice | grep -q "^\/dev\/ram";then
+ kpartx -a $imageDevice
+ fi
deviceTest=$(ddn $imageDevice 1)
if ! waitForStorageDevice $deviceTest;then
systemException \
@@ -818,15 +843,18 @@
dPID=$(pidof mst)
kill $dPID
)&
+ dump_pid=$!
echo "mst -f /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 50
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
popd &>/dev/null
clear
else
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-linuxrc
^
|
@@ -119,7 +119,11 @@
# Check for LUKS extension on root fs
#--------------------------------------
if [ "$FSTYPE" = "luks" ];then
- imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
+ if [ -e /dev/$VGROUP/LVComp ];then
+ imageRODevice=$imageRootDevice
+ fi
probeFileSystem $imageRootDevice
export haveLuks=yes
fi
@@ -214,23 +218,26 @@
# 9) Search boot device...
#--------------------------------------
if [ -z "$pxe" ];then
- Echo "Searching for boot device..."
- if [ "$LOCAL_BOOT" = "no" ];then
- if ! searchBIOSBootDevice;then
- if [ ! -z "$cdinst" ];then
- biosBootDevice=/dev/cdrom
- else
+ if [ ! -z "$cdinst" ];then
+ biosBootDevice=/dev/cdrom
+ else
+ Echo "Searching for boot device..."
+ if [ "$LOCAL_BOOT" = "no" ];then
+ if ! searchBIOSBootDevice;then
systemException "$biosBootDevice" "reboot"
fi
+ export imageDiskDevice=$biosBootDevice
+ else
+ waitForStorageDevice $disk
+ export imageDiskDevice=$(dn $disk)
+ if [ ! -z "$KIWI_RECOVERY" ];then
+ export imageRecoveryDevice=$(
+ ddn $imageDiskDevice $KIWI_RECOVERY
+ )
+ fi
fi
- export imageDiskDevice=$biosBootDevice
- else
- export imageDiskDevice=$(dn $disk)
- if [ ! -z "$KIWI_RECOVERY" ];then
- export imageRecoveryDevice=$(ddn $imageDiskDevice $KIWI_RECOVERY)
- fi
+ Echo "Found boot device: $imageDiskDevice"
fi
- Echo "Found boot device: $imageDiskDevice"
fi
#======================================
@@ -278,6 +285,9 @@
probeFileSystem $deviceResize
export KIWI_INITRD_PARAMS
fi
+ if [ "$haveLVM" = "yes" ] && [ ! -z "$allFreeVolume" ];then
+ deviceResize=/dev/$VGROUP/$allFreeVolume
+ fi
if [ ! -z "$deviceResize" ] && partitionSize $deviceResize &>/dev/null;then
if [ ! -z "$OEM_RECOVERY" ];then
KIWI_INITRD_PARAMS="$KIWI_INITRD_PARAMS LOCAL_BOOT=yes"
@@ -465,15 +475,18 @@
dPID=$(pidof mst)
kill $dPID
)&
+ dump_pid=$!
echo "mst -f /progress | dialog \
--backtitle \"$TEXT_RECOVERYTITLE\" \
--progressbox 3 50
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
#======================================
# 16.4) restore temporary stored files
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-preinit
^
|
@@ -124,12 +124,17 @@
setupConsole
#======================================
-# 11) Run user script
+# 11) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 12) Run user script
#--------------------------------------
runHook preCallInit
#======================================
-# 12) kill udev
+# 13) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/oemboot/suse-repart
^
|
@@ -372,12 +372,19 @@
recoParam=no
swapParam=no
#======================================
+ # setup all free volume name
+ #--------------------------------------
+ export allFreeVolume=LVRoot
+ if [ ! -z "$kiwi_allFreeVolume" ];then
+ allFreeVolume=$kiwi_allFreeVolume
+ fi
+ #======================================
# close open device mappings
#--------------------------------------
if [ "$haveLuks" = "yes" ];then
luksClose
fi
- vgchange -an
+ vgchange -a n $VGROUP
#======================================
# resize LVM partition
#--------------------------------------
@@ -405,7 +412,7 @@
1 $swapParam $recoParam $bootParam yes $VGROUP
callPartitioner $input
waitForStorageDevice $(ddn $imageDiskDevice $extendID)
- vgchange -an
+ vgchange -a n $VGROUP
#======================================
# extend volume group with rest space
#--------------------------------------
@@ -422,12 +429,12 @@
swapParam=yes
fi
#======================================
- # Extend LVRoot...
+ # Extend all free volume...
#--------------------------------------
if [ -z "$OEM_SYSTEMSIZE" ];then
- lvextend -l +100%FREE /dev/$VGROUP/LVRoot
+ lvextend -l +100%FREE /dev/$VGROUP/$allFreeVolume
else
- lvextend --size $OEM_SYSTEMSIZE"M" /dev/$VGROUP/LVRoot
+ lvextend --size $OEM_SYSTEMSIZE"M" /dev/$VGROUP/$allFreeVolume
fi
#======================================
# setup new device names
@@ -777,9 +784,11 @@
# createLuksMaps
#--------------------------------------
function createLuksMaps {
- export imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ export imageRootDevice=$luksDeviceOpened
if isFSTypeReadOnly;then
- export imageIOWRDevice=$(luksOpen $imageIOWRDevice luksReadWrite)
+ luksOpen $imageIOWRDevice luksReadWrite
+ export imageIOWRDevice=$luksDeviceOpened
export imageRWDevice=$imageIOWRDevice
export imageRODevice=$imageRootDevice
fi
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4/config.sh
^
|
@@ -0,0 +1,51 @@
+#!/bin/bash
+#================
+# FILE : config.sh
+#----------------
+# PROJECT : OpenSuSE KIWI Image System
+# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
+# :
+# AUTHOR : Marcus Schaefer <ms@suse.de>
+# :
+# BELONGS TO : Operating System images
+# :
+# DESCRIPTION : configuration script for SUSE based
+# : operating systems
+# :
+# :
+# STATUS : BETA
+#----------------
+#======================================
+# Functions...
+#--------------------------------------
+test -f /.kconfig && . /.kconfig
+test -f /.profile && . /.profile
+
+#======================================
+# Greeting...
+#--------------------------------------
+echo "Configure image: [$kiwi_iname]..."
+
+#======================================
+# Keep UTF-8 locale
+#--------------------------------------
+baseStripLocales \
+ $(for i in $(echo $kiwi_language | tr "," " ");do echo -n "$i.utf8 ";done)
+baseStripTranslations kiwi.mo
+
+#======================================
+# Setup link for the grub stage files
+#--------------------------------------
+baseSetupBootLoaderCompatLinks
+
+#======================================
+# check for RHEL boot logo
+#--------------------------------------
+rhelSplashToGrub
+
+#======================================
+# Umount kernel filesystems
+#--------------------------------------
+baseCleanMount
+
+exit 0
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4/config.xml
^
|
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<image schemaversion="5.3" name="initrd-vmxboot-rhel-05.4">
+ <description type="boot">
+ <author>Marcus Schaefer</author>
+ <contact>ms@novell.com</contact>
+ <specification>boot/initrd image used for LiveDVD media</specification>
+ </description>
+ <preferences>
+ <type image="cpio" bootprofile="default" bootkernel="std"/>
+ <version>2.1.2</version>
+ <packagemanager>yum</packagemanager>
+ <rpm-check-signatures>false</rpm-check-signatures>
+ </preferences>
+ <profiles>
+ <profile name="default" description="Booting default setup"/>
+ <profile name="std" description="KERNEL: Default"/>
+ </profiles>
+ <drivers type="drivers">
+ <file name="crypto/*"/>
+ <file name="drivers/virtio/*"/>
+ <file name="drivers/block/virtio_blk.ko"/>
+ <file name="drivers/char/hw_random/virtio-rng.ko"/>
+ <file name="drivers/net/virtio_net.ko"/>
+ <file name="drivers/md/*"/>
+ <file name="drivers/hid/*"/>
+ <file name="drivers/input/keyboard/*"/>
+ <file name="drivers/input/mouse/*"/>
+ <file name="drivers/usb/*"/>
+ <file name="drivers/ide/*"/>
+ <file name="drivers/block/loop.ko"/>
+ <file name="drivers/block/brd.ko"/>
+ <file name="fs/ext3/*"/>
+ <file name="fs/ext4/*"/>
+ <file name="fs/ext2/*"/>
+ <file name="fs/fat/*"/>
+ <file name="fs/vfat/*"/>
+ <file name="fs/binfmt_aout.ko"/>
+ <file name="fs/binfmt_misc.ko"/>
+ <file name="fs/mbcache.ko"/>
+ <file name="fs/quota_v1.ko"/>
+ <file name="fs/quota_v2.ko"/>
+ <file name="fs/jbd/*"/>
+ <file name="fs/jbd2/*"/>
+ <file name="fs/fuse/*"/>
+ <file name="fs/squashfs/*"/>
+ <file name="fs/nls/nls_utf8.ko"/>
+ <file name="fs/nls/nls_cp437.ko"/>
+ <file name="fs/nls/nls_iso8859-1.ko"/>
+ <file name="drivers/cdrom/*"/>
+ <file name="drivers/scsi/*"/>
+ <file name="drivers/message/fusion/*"/>
+ <file name="drivers/ata/*"/>
+ <file name="drivers/ieee1394/*"/>
+ <file name="drivers/parport/*"/>
+ <file name="drivers/acpi/dock.ko"/>
+ <file name="drivers/firmware/edd.ko"/>
+ <file name="lib/crc-t10dif.ko"/>
+ <file name="lib/crc16.ko"/>
+ </drivers>
+ <repository type="rpm-md" status="replaceable">
+ <source path="iso:///image/CDs/RHEL-5.4-%arch-DVD.iso/Server"/>
+ </repository>
+ <repository type="rpm-md" status="fixed" priority="1">
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/rhel-054/RedHat_RHEL-5"/>
+ </repository>
+ <packages type="image" profiles="std">
+ <package name="kernel"/>
+ </packages>
+ <packages type="bootstrap">
+ <package name="filesystem"/>
+ <package name="basesystem"/>
+ <package name="yum-priorities"/>
+ </packages>
+ <packages type="image">
+ <package name="psmisc"/>
+ <package name="bind-libs"/>
+ <package name="bind-utils"/>
+ <package name="gawk"/>
+ <package name="iproute"/>
+ <package name="lvm2"/>
+ <package name="setup"/>
+ <package name="initscripts"/>
+ <package name="sysfsutils"/>
+ <package name="file"/>
+ <package name="make"/>
+ <package name="memtest86+"/>
+ <package name="hdparm"/>
+ <package name="grub"/>
+ <package name="tar"/>
+ <package name="rpm"/>
+ <package name="cryptsetup-luks"/>
+ <package name="dialog"/>
+ <package name="kiwi-tools"/>
+ <package name="coreutils"/>
+ <package name="hwinfo"/>
+ <package name="pam"/>
+ <package name="parted"/>
+ </packages>
+ <packages type="delete">
+ <package name="cracklib-dicts"/>
+ <package name="audit-libs"/>
+ <package name="bind-libs"/>
+ <package name="bind-utils"/>
+ <package name="binutils"/>
+ <package name="cpio"/>
+ <package name="cyrus-sasl"/>
+ <package name="db4"/>
+ <package name="dbus-glib"/>
+ <package name="diffutils"/>
+ <package name="expat"/>
+ <package name="freetype"/>
+ <package name="gawk"/>
+ <package name="gdbm"/>
+ <package name="glib2"/>
+ <package name="hdparm"/>
+ <package name="info"/>
+ <package name="iproute"/>
+ <package name="irqbalance"/>
+ <package name="logrotate"/>
+ <package name="make"/>
+ <package name="mdadm"/>
+ <package name="memtest86+"/>
+ <package name="mingetty"/>
+ <package name="mktemp"/>
+ <package name="mtools"/>
+ <package name="net-tools"/>
+ <package name="openldap-clients"/>
+ <package name="perl"/>
+ <package name="perl-HTML-Parser"/>
+ <package name="perl-HTML-Tagset"/>
+ <package name="pm-utils"/>
+ <package name="setserial"/>
+ <package name="syslinux"/>
+ <package name="postfix"/>
+ <package name="keyutils-libs"/>
+ </packages>
+</image>
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4/images.sh
^
|
@@ -0,0 +1,43 @@
+#!/bin/sh
+test -f /.kconfig && . /.kconfig
+test -f /.profile && . /.profile
+
+echo "Configure image: [$kiwi_iname]..."
+
+#==========================================
+# pack boot includes
+#------------------------------------------
+basePackBootIncludes
+
+#==========================================
+# remove unneded kernel files
+#------------------------------------------
+rhelStripKernel
+
+#==========================================
+# setup gfxboot
+#------------------------------------------
+rhelGFXBoot SLES grub
+
+#==========================================
+# remove unneeded packages
+#------------------------------------------
+rpm -e --nodeps --noscripts \
+ $(rpm -q `baseGetPackagesForDeletion` | grep -v "is not installed")
+
+#==========================================
+# remove unneeded files
+#------------------------------------------
+rhelStripInitrd
+
+#==========================================
+# unpack boot includes
+#------------------------------------------
+baseUnpackBootIncludes
+
+#==========================================
+# umount /proc
+#------------------------------------------
+umount /proc &>/dev/null
+
+exit 0
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4/root
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4/root/include
^
|
+(symlink to /usr/share/kiwi/modules/KIWILinuxRC.sh)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4/root/linuxrc
^
|
+(symlink to ../../rhel-linuxrc)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-05.4/root/preinit
^
|
+(symlink to ../../rhel-preinit)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-linuxrc
^
|
@@ -0,0 +1,289 @@
+#!/bin/bash
+#================
+# FILE : linuxrc
+#----------------
+# PROJECT : OpenSuSE KIWI Image System
+# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
+# :
+# AUTHOR : Marcus Schaefer <ms@suse.de>
+# :
+# BELONGS TO : Operating System images
+# :
+# DESCRIPTION : This file is changed to become the real
+# : linuxrc script which is used to prepare the
+# : operating system for the main image
+# :
+# :
+# STATUS : BETA
+#----------------
+#======================================
+# Exports (General)
+#--------------------------------------
+export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
+export IFS_ORIG=$IFS
+export ARCH=`arch`
+export DEBUG=0
+
+#======================================
+# Exports (Booting)
+#--------------------------------------
+export DOMURD_MODULES="xennet xenblk"
+export INITRD_MODULES=""
+export LOCAL_BOOT="no"
+export systemIntegrity="clean"
+export KERNEL_LIST
+
+#======================================
+# Exports (Alias)
+#--------------------------------------
+export SYSALIAS="undefined"
+export NAME=0
+
+#======================================
+# Exports (Partitioning)
+#--------------------------------------
+export PART_FILE="/etc/partition.table"
+export PART_MOUNT
+export PART_DEV
+export PART_COUNT=0
+export PART_NUMBER=0
+export PART_NEED_EXTENDED=0
+export PART_NEED_FILL=0
+export NO_FILE_SYSTEM=0
+
+#======================================
+# Exports (Status)
+#--------------------------------------
+export SYSTEM_INTEGRITY
+export SYSTEM_MD5STATUS
+
+#======================================
+# Functions
+#--------------------------------------
+. /include
+initialize
+
+#======================================
+# Beautify Startup
+#--------------------------------------
+echo "Loading KIWI VMX Boot-System..."
+echo "-------------------------------"
+
+#======================================
+# Update library path
+#--------------------------------------
+ldconfig
+
+#======================================
+# 1) Mounting local file systems
+#--------------------------------------
+mountSystemFilesystems &>/dev/null
+closeKernelConsole
+
+#======================================
+# 2) Prepare module load support
+#--------------------------------------
+touch /etc/modules.conf
+touch /lib/modules/*/modules.dep
+
+#======================================
+# 3) run udevd
+#--------------------------------------
+udevStart
+
+#======================================
+# 4) Include proc/cmdline information
+#--------------------------------------
+includeKernelParameters
+if [ ! -z $UNIONFS_CONFIG ] || [ "$COMBINED_IMAGE" = "local" ];then
+ # /.../
+ # if the unionfs/combined information is already in place at this
+ # stage it comes from the cmdline data which means we are not
+ # booting the first time
+ # ----
+ export LOCAL_BOOT="yes"
+fi
+
+#======================================
+# 5) start boot shell
+#--------------------------------------
+startBlogD
+startShell
+errorLogStart
+openKernelConsole
+
+#======================================
+# 6) Including required kernel modules
+#--------------------------------------
+probeDevices
+
+#======================================
+# 7) Select language if not in cmdline
+#--------------------------------------
+selectLanguage
+
+#======================================
+# 8) Search boot device...
+#--------------------------------------
+Echo "Searching for boot device..."
+if [ "$LOCAL_BOOT" = "no" ];then
+ if ! searchBIOSBootDevice;then
+ systemException "$biosBootDevice" "reboot"
+ fi
+ export imageDiskDevice=$biosBootDevice
+else
+ export imageDiskDevice=$(dn $disk)
+fi
+Echo "Found boot device: $imageDiskDevice"
+
+#======================================
+# 9) Setup device names...
+#--------------------------------------
+export imageRootDevice=$(ddn $imageDiskDevice 1)
+export imageRWDevice=$(ddn $imageDiskDevice 2)
+if [ ! -z "$kiwi_ramonly" ];then
+ export imageRWDevice=/dev/ram1
+fi
+export imageRODevice=$(ddn $imageDiskDevice 1)
+if [ -z "$imageDiskDevice" ];then
+ systemException \
+ "Couldn't find any boot device... abort" \
+ "reboot"
+fi
+if searchVolumeGroup; then
+ export haveLVM=yes
+ if [ -e /dev/$VGROUP/LVComp ];then
+ export imageRootDevice=/dev/$VGROUP/LVComp
+ else
+ export imageRootDevice=/dev/$VGROUP/LVRoot
+ fi
+ export imageRWDevice=/dev/$VGROUP/LVRoot
+ if [ ! -z "$kiwi_ramonly" ];then
+ export imageRWDevice=/dev/ram1
+ fi
+ export imageRODevice=/dev/$VGROUP/LVComp
+ export imageBootDevice=$(ddn $imageDiskDevice 1)
+fi
+
+#======================================
+# 10) Get filesystem type
+#--------------------------------------
+probeFileSystem $imageRootDevice
+if [ "$FSTYPE" = "luks" ];then
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
+ imageRODevice=$imageRootDevice
+ probeFileSystem $imageRootDevice
+ export haveLuks=yes
+fi
+if [ "$FSTYPE" = "unknown" ];then
+ systemException \
+ "Couldn't determine filesystem type... abort" \
+ "reboot"
+fi
+
+#======================================
+# 11) Check filesystem
+#--------------------------------------
+Echo "Filesystem of VMX system is: $FSTYPE -> $imageRootDevice"
+if isFSTypeReadOnly;then
+ setupUnionFS $imageRWDevice $imageRODevice $unionFST
+fi
+
+#======================================
+# 12) Mount VM (boot)
+#--------------------------------------
+if ! mountSystem $imageRootDevice;then
+ systemException "Failed to mount root filesystem" "reboot"
+fi
+validateRootTree
+
+#======================================
+# 13) Get kernel list for local boot
+#--------------------------------------
+if [ "$LOCAL_BOOT" = "no" ];then
+ kernelList /mnt
+fi
+
+#======================================
+# 14) setup ird/kernel links for union
+#--------------------------------------
+if [ "$LOCAL_BOOT" = "no" ];then
+ setupKernelLinks
+fi
+
+#======================================
+# 15) Create system dependant files
+#--------------------------------------
+if [ "$LOCAL_BOOT" = "no" ];then
+ setupDefaultFstab /config
+ updateRootDeviceFstab /config $imageRootDevice
+ if [ "$haveLVM" = "yes" ];then
+ updateLVMBootDeviceFstab /config $imageBootDevice
+ elif [ "$haveClicFS" = "yes" ];then
+ updateClicBootDeviceFstab /config $imageBootDevice
+ elif [ "$haveBtrFS" = "yes" ];then
+ updateBtrBootDeviceFstab /config $imageBootDevice
+ elif [ "$haveXFS" = "yes" ];then
+ updateXfsBootDeviceFstab /config $imageBootDevice
+ elif [ "$loader" = "syslinux" ] || [ "$loader" = "extlinux" ];then
+ updateSyslinuxBootDeviceFstab /config $imageBootDevice
+ elif [ "$haveLuks" = "yes" ];then
+ updateLuksBootDeviceFstab /config $imageBootDevice
+ fi
+ if [ ! -z "$UNIONFS_CONFIG" ]; then
+ export KIWI_INITRD_PARAMS="UNIONFS_CONFIG=yes"
+ fi
+ if [ ! -z "$COMBINED_IMAGE" ]; then
+ export KIWI_INITRD_PARAMS="COMBINED_IMAGE=local"
+ fi
+ setupBootLoader /mnt /config $(($bootid - 1)) $imageRootDevice VMX
+ # FIXME: 'setupKernelModules /config' does not work on RHEL
+fi
+
+#======================================
+# 16) copy system dependant files
+#--------------------------------------
+if [ "$LOCAL_BOOT" = "no" ];then
+ setupConfigFiles
+fi
+
+#======================================
+# 17) update system dependant files
+#--------------------------------------
+setupInittab /mnt
+
+#======================================
+# 18) setup real root device
+#--------------------------------------
+echo 256 > /proc/sys/kernel/real-root-dev
+
+#======================================
+# 19) umount system filesystems
+#--------------------------------------
+umountSystemFilesystems
+
+#======================================
+# 20) copy initrd files to image
+#--------------------------------------
+if [ "$LOCAL_BOOT" = "no" ];then
+ importBranding
+fi
+cp /preinit /mnt
+cp /include /mnt
+
+#======================================
+# 21) kill boot shell
+#--------------------------------------
+killShell
+killBlogD
+
+#======================================
+# 22) Activate new root
+#--------------------------------------
+activateImage
+
+#======================================
+# 23) Unmount initrd / system init
+#--------------------------------------
+bootImage $@
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/ix86/vmxboot/rhel-preinit
^
|
@@ -0,0 +1,84 @@
+#!/bin/bash
+#================
+# FILE : preinit
+#----------------
+# PROJECT : OpenSuSE KIWI Image System
+# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
+# :
+# AUTHOR : Marcus Schaefer <ms@suse.de>
+# :
+# BELONGS TO : Operating System images
+# :
+# DESCRIPTION : This file is called after the image root
+# : has changed by the linuxrc script
+# :
+# STATUS : BETA
+#----------------
+#======================================
+# Functions...
+#--------------------------------------
+. /include
+
+#======================================
+# 1) start error log
+#--------------------------------------
+errorLogStart
+Echo "Calling pre-init stage in system image"
+
+#======================================
+# 2) check for LOCAL_BOOT
+#--------------------------------------
+if [ "$LOCAL_BOOT" = "yes" ];then
+ exit 0
+fi
+
+#======================================
+# 3) start udev
+#--------------------------------------
+mountSystemFilesystems
+
+#======================================
+# 4) create /etc/ImagePackages
+#--------------------------------------
+if [ -x /bin/rpm ];then
+ Echo "Creating initial image package info file"
+ rpm -qa --last > /etc/ImagePackages
+fi
+
+#======================================
+# 5) create initrd on diskful
+#--------------------------------------
+if [ -z "$UNIONFS_CONFIG" ] && [ -z "$COMBINED_IMAGE" ]; then
+ #======================================
+ # use distro initrd via mkinitrd
+ #--------------------------------------
+ setupRHELInitrd
+else
+ #======================================
+ # use kiwi initrd from RW partition
+ #--------------------------------------
+ bootLoaderOK=1
+fi
+
+#======================================
+# 6) Install boot loader if ok
+#--------------------------------------
+if [ $bootLoaderOK = 1 ];then
+ installBootLoader
+fi
+
+#======================================
+# 7) setup console
+#--------------------------------------
+setupConsole
+
+#======================================
+# 8) update auth config
+#--------------------------------------
+authconfig --updateall
+
+#======================================
+# 9) kill udev
+#--------------------------------------
+killall udevd
+umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-11.3/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-11.3">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-11.3">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -83,7 +83,7 @@
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
</packages>
- <packages type="bootstrap" profiles="desktop">
+ <packages type="image" profiles="desktop">
<package name="kernel-desktop"/>
</packages>
<packages type="image">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-11.4/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-11.4">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-11.4">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -86,7 +86,7 @@
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
</packages>
- <packages type="bootstrap" profiles="desktop">
+ <packages type="image" profiles="desktop">
<package name="kernel-desktop"/>
</packages>
<packages type="image">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-12.1/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-12.1">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-12.1">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -81,12 +81,13 @@
</packages>
<packages type="image" profiles="xenk">
<package name="kernel-xen"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
</packages>
- <packages type="bootstrap" profiles="desktop">
+ <packages type="image" profiles="desktop">
<package name="kernel-desktop"/>
</packages>
<packages type="image">
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-SLED10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-SLED10">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-SLED10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -52,7 +52,7 @@
<source path="/mounts/machcd2/dists/full-sle10-sp2-%arch"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-SLED11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-SLED11">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-SLED11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -61,7 +61,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -78,12 +78,14 @@
<packages type="image" profiles="xenk">
<package name="kernel-xen"/>
<package name="kernel-xen-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
<package name="kernel-ec2-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image">
<package name="psmisc"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-SLES10/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-SLES10">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-SLES10">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -52,7 +52,7 @@
<source path="/mounts/machcd2/dists/full-sle10-sp2-%arch"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap" profiles="std">
<package name="kernel-default"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -61,7 +61,7 @@
<source path="/image/CDs/full-i386"/>
</repository>
<repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle11/SLE_11_SP1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -78,12 +78,14 @@
<packages type="image" profiles="xenk">
<package name="kernel-xen"/>
<package name="kernel-xen-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="ec2">
<package name="kernel-ec2"/>
<package name="kernel-ec2-base"/>
- <package name="xen"/>
+<!-- xen dom0 support only on x86_64 -->
+ <package name="xen" arch="x86_64"/>
</packages>
<packages type="image">
<package name="psmisc"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-linuxrc
^
|
@@ -132,6 +132,7 @@
fi
export imageDiskDevice=$biosBootDevice
else
+ waitForStorageDevice $disk
export imageDiskDevice=$(dn $disk)
fi
Echo "Found boot device: $imageDiskDevice"
@@ -170,7 +171,8 @@
#--------------------------------------
probeFileSystem $imageRootDevice
if [ "$FSTYPE" = "luks" ];then
- imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
imageRODevice=$imageRootDevice
probeFileSystem $imageRootDevice
export haveLuks=yes
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ix86/vmxboot/suse-preinit
^
|
@@ -84,7 +84,12 @@
setupConsole
#======================================
-# 10) kill udev
+# 10) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 11) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/netboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-netboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-netboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -31,6 +31,7 @@
<file name="usb/storage/usb-storage.ko"/>
</drivers>
<drivers type="drivers" profiles="default,xen,ppc64">
+ <file name="crypto/*"/>
<file name="drivers/usb/*"/>
<file name="drivers/block/loop.ko"/>
<file name="net/packet/*"/>
@@ -126,10 +127,10 @@
<file name="drivers/net/yellowfin.ko"/>
</drivers>
<repository type="yast2" status="replaceable">
- <source path="/image/CDs/full-ppc64"/>
+ <source path="http://download.suse.de/install/SLP/SLES-11-SP1-GM/%arch/DVD1/"/>
</repository>
- <repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <repository type="yast2" status="fixed">
+ <source path="http://download.suse.de/install/SLP/SLE-11-SP2-SDK-LATEST/%arch/DVD1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -155,6 +156,7 @@
<package name="kernel-ppc64-base"/>
</packages>
<packages type="image" profiles="default,xen,ppc64">
+ <package name="cryptsetup"/>
<package name="bc"/>
<package name="adaptec-firmware"/>
<package name="curl"/>
@@ -227,7 +229,6 @@
<package name="diffutils"/>
<package name="expat"/>
<package name="fillup"/>
- <package name="gawk"/>
<package name="gdbm"/>
<package name="glib2"/>
<package name="glibc-locale"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/netboot/suse-linuxrc
^
|
@@ -93,7 +93,7 @@
# 4) Include proc/cmdline information
#--------------------------------------
includeKernelParameters
-if [ ! -z $IMAGE ];then
+if [ ! -z "$IMAGE" ];then
# /.../
# if the image information is already in place at this stage
# it comes from the cmdline data which means we are not booting
@@ -259,7 +259,12 @@
runHook postprobe
#======================================
-# 11) Check for diskful station
+# 11) Select language if not in cmdline
+#--------------------------------------
+selectLanguage
+
+#======================================
+# 12) Check for diskful station
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
checkDevice=$DISK
@@ -282,7 +287,7 @@
fi
#======================================
-# 12) Check for installed system
+# 13) Check for installed system
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $haveDisk = "1" ];then
if [ ! -z "$RAID" ];then
@@ -302,6 +307,17 @@
done
updateNeeded initialize
if linuxPartition $imageDiskDevice;then
+ probeFileSystem $imageDevice
+ if [ "$FSTYPE" = "luks" ];then
+ luks_open_can_fail=yes
+ if luksOpen $imageDevice ; then
+ imageDevice=$luksDeviceOpened
+ imageRODevice=$imageDevice
+ probeFileSystem $imageRootDevice
+ export haveLuks=yes
+ fi
+ unset luks_open_can_fail
+ fi
if mountSystem $imageDevice;then
updateNeeded
umountSystem
@@ -316,6 +332,9 @@
RELOAD_IMAGE="yes"
systemIntegrity="clean"
fi
+ if [ -n "$haveLuks" ]; then
+ luksClose $imageDevice
+ fi
else
systemIntegrity="clean"
fi
@@ -323,10 +342,10 @@
fi
#======================================
-# 13) Create ptable on diskful system
+# 14) Create ptable on diskful system
#--------------------------------------
+runHook prepartition
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
- runHook prepartition
#======================================
# Create partition table
#--------------------------------------
@@ -392,11 +411,13 @@
else
export imageSwapDevice=$(pxeRaidSwapDevice)
fi
+ runHook preswap
if [ ! -z "$imageSwapDevice" ];then
if ! mkswap $imageSwapDevice 1>&2;then
systemException "Failed to create swap signature" "reboot"
fi
fi
+ runHook postswap
#======================================
# Setup boot space if requested
#--------------------------------------
@@ -406,11 +427,11 @@
createFilesystem $imageBootDevice
fi
fi
- runHook postpartition
fi
+runHook postpartition
#======================================
-# 14) Setup root device environment
+# 15) Setup root device environment
#--------------------------------------
runHook predownload
if \
@@ -418,7 +439,7 @@
([ $haveDisk = "1" ] || [ $haveRamDisk = "1" ])
then
#======================================
- # 14.1) Download network client image
+ # 15.1) Download network client image
#--------------------------------------
count=0
IFS="," ; for i in $IMAGE;do
@@ -439,9 +460,6 @@
imageRootDevice=$imageDevice
imageRootName=$imageName
fi
- if [ $count = 2 ];then
- imageNextRootDevice=$imageDevice
- fi
# /.../
# start download only if installed system is different
# from the image on the pxe boot server
@@ -505,15 +523,18 @@
eval $dump 2>/progress |\
head --bytes=$verifyBytes | md5sum - > /etc/ireal.md5
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
errorLogContinue
else
@@ -541,28 +562,29 @@
Echo -b " within the appropriate .md5 file for this image"
echo
if [ -z "$DISK" ];then
- Echo -b "4) ramdisk size is too small for the image:"
- Echo -b " check the ramdisk_size parameter of the PXE"
- Echo -b " configuration file on the TFTP server"
+ Echo -b "4) ramdisk size is too small for the image:"
+ Echo -b " check the ramdisk_size parameter of the PXE"
+ Echo -b " configuration file on the TFTP server"
else
- Echo -b "4) partition size is too small for the image:"
- Echo -b " check the PART line in the image config file on the"
- Echo -b " TFTP server"
+ Echo -b "4) partition size is too small for the image:"
+ Echo -b " check the PART line in the image config file on the"
+ Echo -b " TFTP server"
fi
echo
Echo "Retry to load image..."
sleep 15
done
- if [ ! -z "$DISK" ];then
- probeFileSystem $imageDevice
- resizeFilesystem $imageDevice
+ imageRootDevice=$imageDevice
+ if [ ! -z "$UNIONFS_CONFIG" ];then
+ imageRWDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`
+ imageRODevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`
fi
rm -f /etc/ireal.md5
rm -f /etc/image.md5
done
else
#======================================
- # 14.2) Check for local boot
+ # 15.2) Check for local boot
#--------------------------------------
if [ $LOCAL_BOOT = "yes" ];then
imageDisk=$(dn $root)
@@ -571,14 +593,12 @@
imageRootName="Local-System"
if [ ! -z "$UNIONFS_CONFIG" ];then
unionFST=$UNIONFS_CONFIG
- setupUnionFS $(ddn $imageDisk 3) $(ddn $imageDisk 2) $unionFST
- fi
- if [ ! -z "$COMBINED_IMAGE" ];then
- imageNextRootDevice=$(ddn $imageDisk 3)
+ imageRWDevice=$(ddn $imageDisk 3)
+ imageRODevice=$(ddn $imageDisk 2)
fi
fi
#======================================
- # 14.3) Check for NFS root
+ # 15.3) Check for NFS root
#--------------------------------------
if [ ! -z "$NFSROOT" ];then
IFS="," ; for i in $NFSROOT;do
@@ -602,18 +622,20 @@
if [ ! -z "$COMBINED_IMAGE" ] || [ ! -z "$UNIONFS_CONFIG" ];then
imageRootDevice="-o vers=3,ro $nfsRootServer:$nfsRootDevice"
fi
+ imageRootName="NFSRoot-System"
+ systemIntegrity="clean"
+ export FSTYPE=nfs
if [ ! -z "$UNIONFS_CONFIG" ];then
+ imageRWDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`
+ imageRODevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`
unionFST=`echo $UNIONFS_CONFIG | cut -d , -f 3`
if [ "$unionFST" = "clicfs" ];then
systemException "clicfs over NFSROOT is not supported" "reboot"
fi
fi
- imageRootName="NFSRoot-System"
- systemIntegrity="clean"
- export FSTYPE=nfs
fi
#======================================
- # 14.4) Check for NBD root
+ # 15.4) Check for NBD root
#--------------------------------------
if [ ! -z "$NBDROOT" ];then
if ! modprobe nbd;then
@@ -708,18 +730,15 @@
# setup union if basic root filesystem is read-only
# ----
imageRootDevice=$nbdDevice
- probeFileSystem $imageRootDevice
- Echo "Filesystem of remote root system is: $FSTYPE"
- if [ -z "$COMBINED_IMAGE" ];then
- if isFSTypeReadOnly;then
- setupUnionFS "$nbdwriteDevice" "$imageRootDevice" $unionFST
- fi
- fi
imageRootName="NBDRoot-System"
systemIntegrity="clean"
+ if [ -z "$COMBINED_IMAGE" ];then
+ imageRWDevice=$nbdwriteDevice
+ imageRODevice=$imageRootDevice
+ fi
fi
#======================================
- # 14.5) Check for AOE root
+ # 15.5) Check for AOE root
#--------------------------------------
if [ ! -z "$AOEROOT" ];then
aoeRODevice=`echo $AOEROOT | cut -d , -f 1`
@@ -746,50 +765,81 @@
fi
Echo "Mounting AoE root system: $aoeRODevice..."
imageRootDevice=$aoeRODevice
- probeFileSystem $imageRootDevice
- Echo "Filesystem of remote root system is: $FSTYPE"
- if [ -z "$COMBINED_IMAGE" ];then
- if isFSTypeReadOnly;then
- setupUnionFS "$aoeRWDevice" "$imageRootDevice" $unionFST
- fi
- fi
imageRootName="AOERoot-System"
systemIntegrity="clean"
+ if [ -z "$COMBINED_IMAGE" ];then
+ imageRWDevice=$aoeRWDevice
+ imageRODevice=$imageRootDevice
+ fi
fi
fi
runHook postdownload
#======================================
-# 15) Mount OS image to /mnt
+# 16) Get filesystem type
#--------------------------------------
-runHook premount
-if ! mountSystem;then
- systemException "Failed to mount root filesystem" "reboot"
+if [ -b $imageRootDevice ];then
+ probeFileSystem $imageRootDevice
+ if [ "$FSTYPE" = "luks" ];then
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
+ imageRODevice=$imageRootDevice
+ probeFileSystem $imageRootDevice
+ export haveLuks=yes
+ fi
+ if [ "$FSTYPE" = "unknown" ];then
+ systemException \
+ "Couldn't determine filesystem type... abort" \
+ "reboot"
+ fi
+fi
+
+#======================================
+# 17) resize fs on diskful client
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
+ if [ $haveDisk = "1" ] || [ $haveRamDisk = "1" ];then
+ resizeFilesystem $imageRootDevice
+ fi
fi
-validateRootTree
-runHook postmount
#======================================
-# 16) Setup boot device contents
+# 18) Check filesystem
+#--------------------------------------
+Echo "Filesystem of PXE system is: $FSTYPE -> $imageRootDevice"
+if isFSTypeReadOnly;then
+ if [ ! -z "$imageRWDevice" ] && [ ! -z "$imageRODevice" ];then
+ setupUnionFS $imageRWDevice $imageRODevice $unionFST
+ fi
+fi
+
+#======================================
+# 19) Setup bootid for this table
#--------------------------------------
if [ ! -z "$imageBootDevice" ];then
+ # bootid is boot partition
export bootid=$(nd $imageBootDevice)
- cd /mnt/boot && tar -czf /tmp/boot.tgz .
- rm -rf /mnt/boot/* && mount $imageBootDevice /mnt/boot
- cd /mnt/boot && tar -xf /tmp/boot.tgz
- rm -f /tmp/boot.tgz
else
+ # bootid is root partition
export bootid=$(nd $imageRootDevice)
fi
if [ ! -z "$RAID" ];then
# raid md devices start with 0 but partition id's start with 1
bootid=$((bootid + 1))
- # make mdadm.conf available in system image
- cp /mdadm.conf /mnt/etc
fi
#======================================
-# 17) Import fixed configuration files
+# 20) Mount OS image to /mnt
+#--------------------------------------
+runHook premount
+if ! mountSystem;then
+ systemException "Failed to mount root filesystem" "reboot"
+fi
+validateRootTree
+runHook postmount
+
+#======================================
+# 21) Import fixed configuration files
#--------------------------------------
runHook preconfig
if [ $LOCAL_BOOT = "no" ] || [ ! -z "$RELOAD_CONFIG" ];then
@@ -797,13 +847,19 @@
Echo "Configuration files reload forced via RELOAD_CONFIG..."
fi
#=======================================
- # 17.0) Import NFS root files
+ # 21.0) Import NFS root files
#---------------------------------------
if [ ! -z "$NFSROOT" ];then
test -f /etc/resolv.conf && cp /etc/resolv.conf /mnt/etc
fi
#=======================================
- # 17.1) Import files from backup
+ # 21.1) Import RAID config file
+ #---------------------------------------
+ if [ ! -z "$RAID" ];then
+ cp /mdadm.conf /mnt/etc
+ fi
+ #=======================================
+ # 21.2) Import files from backup
#---------------------------------------
BCFG_BASE='etc/KIWI'
BCFG_NAME='InstalledConfigFiles'
@@ -813,7 +869,7 @@
ALL_CCONF=`condenseConfigData "$CONF,$VENDOR_CONF"`
ALL_CBK_CONF=`condenseConfigData "$BK_CONF,$BK_VENDOR_CONF"`
#=======================================
- # 17.2) Store new configuration
+ # 21.3) Store new configuration
#---------------------------------------
mkdir /config
mkdir -p /config/$BCFG_BASE
@@ -821,7 +877,7 @@
echo "CONF=$CONF" > "/config/$BCFG_BASE/$BCFG_NAME"
echo "VENDOR_CONF=$VENDOR_CONF" >> "/config/$BCFG_BASE/$BCFG_NAME"
#=======================================
- # 17.3) Get files from CONF, VENDOR_CONF
+ # 21.4) Get files from CONF, VENDOR_CONF
#---------------------------------------
IFS="," ; for i in $ALL_CCONF;do
unset configHash
@@ -862,7 +918,7 @@
fi
done
#=======================================
- # 17.4) check config files to be deleted
+ # 21.5) check config files to be deleted
#---------------------------------------
IFS="," ; for i in $ALL_CBK_CONF;do
BKconfigDest=`echo "$i" | cut -d ';' -f 2`
@@ -881,7 +937,7 @@
done
IFS=$IFS_ORIG
#=======================================
- # 17.5) Check for KIWI_INITRD
+ # 21.6) Check for KIWI_INITRD
#---------------------------------------
if [ $haveDisk = "1" ] && [ $systemIntegrity = "clean" ];then
if [ ! -z "$KIWI_INITRD" ] && [ ! -z "$KIWI_KERNEL" ];then
@@ -908,7 +964,7 @@
runHook postconfig
#======================================
-# 18) check filesystem and kernels
+# 22) check filesystem and kernels
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
if [ "$FSTYPE" != "nfs" ];then
@@ -918,14 +974,14 @@
fi
#======================================
-# 19) setup ird/kernel links for union
+# 23) setup ird/kernel links for union
#--------------------------------------
if [ "$LOCAL_BOOT" = "no" ] && [ $systemIntegrity = "clean" ];then
setupKernelLinks
fi
#======================================
-# 20) Create system dependant files
+# 24) Create system dependant files
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
mkdir -p /config
@@ -942,7 +998,7 @@
fi
#======================================
-# 21) send DHCP_RELEASE, reset cache
+# 25) send DHCP_RELEASE, reset cache
#--------------------------------------
runHook preNetworkRelease
if [ $LOCAL_BOOT = "no" ];then
@@ -950,25 +1006,25 @@
fi
#======================================
-# 22) copy system dependant files
+# 26) copy system dependant files
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
setupConfigFiles
fi
#======================================
-# 23) update system dependant files
+# 27) update system dependant files
#--------------------------------------
setupInittab /mnt
echo 256 > /proc/sys/kernel/real-root-dev
#======================================
-# 24) umount system filesystems
+# 28) umount system filesystems
#--------------------------------------
umountSystemFilesystems
#======================================
-# 25) copy initrd files to image
+# 29) copy initrd files to image
#--------------------------------------
if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
if canWrite /mnt;then
@@ -979,18 +1035,18 @@
fi
#======================================
-# 26) kill boot shell
+# 30) kill boot shell
#--------------------------------------
killShell
killBlogD
#======================================
-# 27) Activate new root
+# 31) Activate new root
#--------------------------------------
runHook preactivate
activateImage
#======================================
-# 28) Unmount initrd / system init
+# 32) Unmount initrd / system init
#--------------------------------------
bootImage $@
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/netboot/suse-preinit
^
|
@@ -132,7 +132,12 @@
kernelCheck
#======================================
-# 13) kill udev
+# 13) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 14) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/oemboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-oemboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -23,8 +23,10 @@
<profile name="ppc64" description="KERNEL: ppc64 kernel"/>
</profiles>
<drivers type="drivers">
+ <file name="crypto/*"/>
<file name="drivers/usb/*"/>
<file name="drivers/block/loop.ko"/>
+ <file name="drivers/block/brd.ko"/>
<file name="net/packet/*"/>
<file name="lib/zlib_deflate/zlib_deflate.ko"/>
<file name="lib/libcrc32c.ko"/>
@@ -61,10 +63,10 @@
<file name="drivers/xen/*"/>
</drivers>
<repository type="yast2" status="replaceable">
- <source path="/image/CDs/full-i386"/>
+ <source path="http://download.suse.de/install/SLP/SLES-11-SP1-GM/%arch/DVD1/"/>
</repository>
- <repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <repository type="yast2" status="fixed">
+ <source path="http://download.suse.de/install/SLP/SLE-11-SP2-SDK-LATEST/%arch/DVD1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -128,6 +130,7 @@
<package name="gettext-runtime"/>
<package name="kexec-tools"/>
<package name="kpartx"/>
+ <package name="iputils"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/oemboot/suse-dump
^
|
@@ -153,16 +153,19 @@
#======================================
# Search CD/DVD/USB stick and mount it
#--------------------------------------
+ waitForIdleEventQueue
if [ -z "$pxe" ];then
USBStickDevice install
if [ $stickFound = 0 ];then
Echo "Search for USB stick failed, checking CD/DVD drive"
- CDMount
+ CDMount install
export OEMInstallType=CD
+ export imageDiskDevice=$biosBootDevice
else
Echo "Found Stick: $stickRoot -> $stickSerial"
mkdir -p /cdrom && mount $(ddn $stickRoot 2) /cdrom
export OEMInstallType=USB
+ export imageDiskDevice=$stickRoot
unset stickSerial
fi
else
@@ -176,15 +179,18 @@
Echo "Searching harddrive for $OEMInstallType installation"
hwinfo=/usr/sbin/hwinfo
if [ ! -z "$imageDiskDevice" ];then
- deviceDisks=`$hwinfo --disk |\
+ deviceDisks=`$hwinfo --disk --listmd |\
grep "Device File:" | cut -f2 -d: |\
cut -f1 -d"(" | sed -e s"@$imageDiskDevice@@"`
else
- deviceDisks=`$hwinfo --disk |\
+ deviceDisks=`$hwinfo --disk --listmd |\
grep "Device File:" | cut -f2 -d: |\
cut -f1 -d"("`
fi
export deviceDisks=`echo $deviceDisks`
+ if [ ! -z "$ramdisk" ];then
+ deviceDisks="$deviceDisks /dev/ram1"
+ fi
if [ -z "$deviceDisks" ];then
systemException \
"No device(s) for installation found... abort" \
@@ -193,11 +199,12 @@
Echo "Found following disk device(s)"
count=0
for i in $deviceDisks;do
- dsize=`partitionSize $i`
+ dbyid=$(getDiskID $i)
+ dsize=`partitionSize $dbyid`
dsizeMB=`expr $dsize / 1024`
if [ "$dsizeMB" -gt 0 ];then
Echo -b "Disk $count -> $i [ $dsizeMB MB ]"
- deviceArray[$count]=$i
+ deviceArray[$count]=$dbyid
deviceDSize[$count]=$dsize
count=`expr $count + 1`
fi
@@ -219,16 +226,15 @@
hd="\"$TEXT_SELECT\""
count=0
for i in $deviceDisks;do
- dsize=`partitionSize $i`
+ dbyid=$(getDiskID $i)
+ dsize=`partitionSize $dbyid`
dsizeMB=`expr $dsize / 1024`
if [ "$dsizeMB" -gt 0 ];then
- dname=`getDiskID $i`
- dname=`basename $dname | cut -c1-20`"..."
if [ $count = 0 ];then
- dpara="$i \"$dname [ $dsizeMB MB ]\" on"
+ dpara="$dbyid \"[ $dsizeMB MB ]\" on"
count=1
else
- dpara="$dpara $i \"$dname [ $dsizeMB MB ]\" off"
+ dpara="$dpara $dbyid \"[ $dsizeMB MB ]\" off"
fi
fi
done
@@ -283,6 +289,15 @@
info=/tmp/partinfo
wmrc=/wmrc
loop=$(losetup -s -f $imageName)
+ if [ $? != 0 ];then
+ # /.../
+ # old version of losetup doesn't know about
+ # the --find option therefore we set a fixed
+ # loop device name and setup this
+ # ----
+ loop=/dev/loop1
+ losetup $loop $imageName
+ fi
loop=$(echo $loop | sed -e s@^/dev/@@)
if ! kpartx -a /dev/$loop;then
systemException \
@@ -369,7 +384,6 @@
usr/bin/dialog \
usr/bin/xinit \
usr/bin/xterm \
- usr/bin/dialog \
usr/bin/icewm
do
if [ ! -e $OEMRootSystem/$i ];then
@@ -428,7 +442,8 @@
pname=`echo $partitions | cut -f1 -d:`
imageDevice=$pname
rID=$(nd $pname)
- instItems[0]=$imageName:$imageDevice
+ instItems[0]=$imageName
+ instPaths[0]=$imageDevice
else
#======================================
# There is a choice, let the user do it
@@ -482,19 +497,26 @@
if [ $p = /dev/mapper/${loop}p1 ];then
imageDevice=$selectedPart
bID=$(nd $selectedPart)
- instItems[0]=/dev/mapper/${loop}p1:$imageDevice
+ instItems[0]=/dev/mapper/${loop}p1
+ instPaths[0]=$imageDevice
elif [ $p = /dev/mapper/${loop}p2 ];then
rID=$(nd $selectedPart)
- instItems[1]=/dev/mapper/${loop}p2:$selectedPart
+ instItems[1]=/dev/mapper/${loop}p2
+ instPaths[1]=$selectedPart
fi
done
# /.../
- # reverse order of instItems because
- # root partition must be first entry
+ # reverse order of instItems and instPaths because
+ # the root partition must be the first entry
# ----
+ # instItems
instItems_tmp=${instItems[0]}
instItems[0]=${instItems[1]}
instItems[1]=$instItems_tmp
+ # instPaths
+ instPaths_tmp=${instPaths[0]}
+ instPaths[0]=${instPaths[1]}
+ instPaths[1]=$instPaths_tmp
fi
#======================================
# Search for a swap space
@@ -523,7 +545,8 @@
setupDeviceNames $rID $sID no $bID no
fi
else
- instItems[0]=$imageName:$imageDevice
+ instItems[0]=$imageName
+ instPaths[0]=$imageDevice
fi
#======================================
# Checks and MD5 sums...
@@ -555,13 +578,13 @@
#--------------------------------------
if [ ! -z "$pxe" ];then
multicast="disable"
- fetchFile $imageMD5 /image.md5 uncompressed $imageServer
+ fetchFile $imageMD5 /etc/image.md5 uncompressed $imageServer
if test $loadCode != 0 || ! loadOK "$loadStatus";then
systemException \
"Download of $imageMD5 failed: $loadStatus" \
"reboot"
fi
- imageMD5=/image.md5
+ imageMD5=/etc/image.md5
fi
fi
#======================================
@@ -571,16 +594,15 @@
#======================================
# Warn me before performing the install
#--------------------------------------
- for i in ${instItems[*]}; do
- Target=$(echo $i | cut -f2 -d:)
- items="$items,$Target"
+ for i in ${instPaths[*]}; do
+ items="$items,$i"
done
items=$(echo $items | sed -e s@^,@@)
Echo "Entering installation mode for disk: $items"
if [ -z "$kiwi_oemunattended" ];then
TEXT_INST=$(
getText "Destroying ALL data on %1, continue ?" $items)
- Dialog --yesno "\"$TEXT_INST\"" 5 70
+ Dialog --yesno "\"$TEXT_INST\"" 5 80
if [ ! $? = 0 ];then
systemException \
"System installation canceled" \
@@ -588,14 +610,19 @@
fi
fi
clear
- for i in ${instItems[*]};do
+ instIndex=0
+ while [ $instIndex -lt ${#instItems[*]} ];do
#======================================
# Setup source and target data
#--------------------------------------
- Source=$(echo $i | cut -f1 -d:)
- Target=$(echo $i | cut -f2 -d:)
+ Source=${instItems[$instIndex]}
+ Target=${instPaths[$instIndex]}
if [ -z "$OEM_PARTITION_INSTALL" ];then
- read sum1 blocks blocksize zblocks zblocksize < $imageMD5
+ if ! read sum1 blocks blocksize zblocks zblocksize < $imageMD5;then
+ systemException \
+ "Reading of $imageMD5 failed" \
+ "reboot"
+ fi
else
blocksize=4096
partKB=$(partitionSize $Source)
@@ -652,15 +679,18 @@
"reboot"
fi
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
else
if ! eval $dump | dd bs=32k of=$Target &>/dev/null; then
@@ -682,6 +712,7 @@
"reboot"
fi
fi
+ instIndex=$((instIndex + 1))
done
#======================================
# Clear loops if required
@@ -708,15 +739,18 @@
eval $dump 2>/progress |\
head --bytes=$verifyBytes | md5sum - > /etc/ireal.md5
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
errorLogContinue
else
@@ -749,6 +783,9 @@
#--------------------------------------
if [ -z "$OEM_PARTITION_INSTALL" ];then
blockdev --rereadpt $imageDevice
+ if echo $imageDevice | grep -q "^\/dev\/ram";then
+ kpartx -a $imageDevice
+ fi
deviceTest=$(ddn $imageDevice 1)
if ! waitForStorageDevice $deviceTest;then
systemException \
@@ -806,15 +843,18 @@
dPID=$(pidof mst)
kill $dPID
)&
+ dump_pid=$!
echo "mst -f /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 50
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
popd &>/dev/null
clear
else
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/oemboot/suse-linuxrc
^
|
@@ -119,7 +119,8 @@
# Check for LUKS extension on root fs
#--------------------------------------
if [ "$FSTYPE" = "luks" ];then
- imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
probeFileSystem $imageRootDevice
export haveLuks=yes
fi
@@ -214,19 +215,26 @@
# 9) Search boot device...
#--------------------------------------
if [ -z "$pxe" ];then
- Echo "Searching for boot device..."
- if [ "$LOCAL_BOOT" = "no" ];then
- if ! searchOFBootDevice;then
- systemException "$biosBootDevice" "reboot"
- fi
- export imageDiskDevice=$biosBootDevice
+ if [ ! -z "$cdinst" ];then
+ biosBootDevice=/dev/cdrom
else
- export imageDiskDevice=$(dn $disk)
- if [ ! -z "$KIWI_RECOVERY" ];then
- export imageRecoveryDevice=$(ddn $imageDiskDevice $KIWI_RECOVERY)
+ Echo "Searching for boot device..."
+ if [ "$LOCAL_BOOT" = "no" ];then
+ if ! searchOFBootDevice;then
+ systemException "$biosBootDevice" "reboot"
+ fi
+ export imageDiskDevice=$biosBootDevice
+ else
+ waitForStorageDevice $disk
+ export imageDiskDevice=$(dn $disk)
+ if [ ! -z "$KIWI_RECOVERY" ];then
+ export imageRecoveryDevice=$(
+ ddn $imageDiskDevice $KIWI_RECOVERY
+ )
+ fi
fi
+ Echo "Found boot device: $imageDiskDevice"
fi
- Echo "Found boot device: $imageDiskDevice"
fi
#======================================
@@ -274,6 +282,9 @@
probeFileSystem $deviceResize
export KIWI_INITRD_PARAMS
fi
+ if [ "$haveLVM" = "yes" ] && [ ! -z "$allFreeVolume" ];then
+ deviceResize=/dev/$VGROUP/$allFreeVolume
+ fi
if [ ! -z "$deviceResize" ] && partitionSize $deviceResize &>/dev/null;then
if [ ! -z "$OEM_RECOVERY" ];then
KIWI_INITRD_PARAMS="$KIWI_INITRD_PARAMS LOCAL_BOOT=yes"
@@ -461,15 +472,18 @@
dPID=$(pidof mst)
kill $dPID
)&
+ dump_pid=$!
echo "mst -f /progress | dialog \
--backtitle \"$TEXT_RECOVERYTITLE\" \
--progressbox 3 50
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
#======================================
# 16.4) restore temporary stored files
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/oemboot/suse-preinit
^
|
@@ -124,12 +124,17 @@
setupConsole
#======================================
-# 11) Run user script
+# 11) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 12) Run user script
#--------------------------------------
runHook preCallInit
#======================================
-# 12) kill udev
+# 13) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/oemboot/suse-repart
^
|
@@ -377,6 +377,13 @@
recoParam=no
swapParam=no
#======================================
+ # setup all free volume name
+ #--------------------------------------
+ allFreeVolume=LVRoot
+ if [ ! -z "$kiwi_allFreeVolume" ];then
+ allFreeVolume=$kiwi_allFreeVolume
+ fi
+ #======================================
# close open device mappings
#--------------------------------------
if [ "$haveLuks" = "yes" ];then
@@ -428,12 +435,12 @@
swapParam=yes
fi
#======================================
- # Extend LVRoot...
+ # Extend all free volume...
#--------------------------------------
if [ -z "$OEM_SYSTEMSIZE" ];then
- lvextend -l +100%FREE /dev/$VGROUP/LVRoot
+ lvextend -l +100%FREE /dev/$VGROUP/$allFreeVolume
else
- lvextend --size $OEM_SYSTEMSIZE"M" /dev/$VGROUP/LVRoot
+ lvextend --size $OEM_SYSTEMSIZE"M" /dev/$VGROUP/$allFreeVolume
fi
#======================================
# setup new device names
@@ -791,9 +798,11 @@
# createLuksMaps
#--------------------------------------
function createLuksMaps {
- export imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ export imageRootDevice=$luksDeviceOpened
if isFSTypeReadOnly;then
- export imageIOWRDevice=$(luksOpen $imageIOWRDevice luksReadWrite)
+ luksOpen $imageIOWRDevice luksReadWrite
+ export imageIOWRDevice=$luksDeviceOpened
export imageRWDevice=$imageIOWRDevice
export imageRODevice=$imageRootDevice
fi
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/vmxboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -17,6 +17,7 @@
<profile name="ppc64" description="KERNEL: ppc64 kernel"/>
</profiles>
<drivers type="drivers">
+ <file name="crypto/*"/>
<file name="drivers/usb/*"/>
<file name="drivers/block/loop.ko"/>
<file name="net/packet/*"/>
@@ -54,8 +55,8 @@
<repository type="yast2" status="replaceable">
<source path="http://download.suse.de/install/SLP/SLES-11-SP1-GM/%arch/DVD1/"/>
</repository>
- <repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <repository type="yast2" status="fixed">
+ <source path="http://download.suse.de/install/SLP/SLE-11-SP2-SDK-LATEST/%arch/DVD1"/>
</repository>
<packages type="image" profiles="default">
<package name="kernel-default"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/vmxboot/suse-linuxrc
^
|
@@ -133,6 +133,7 @@
fi
export imageDiskDevice=$biosBootDevice
else
+ waitForStorageDevice $disk
export imageDiskDevice=$(dn $disk)
fi
Echo "Found boot device: $imageDiskDevice"
@@ -171,7 +172,8 @@
#--------------------------------------
probeFileSystem $imageRootDevice
if [ "$FSTYPE" = "luks" ];then
- imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
imageRODevice=$imageRootDevice
probeFileSystem $imageRootDevice
export haveLuks=yes
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/ppc/vmxboot/suse-preinit
^
|
@@ -84,7 +84,12 @@
setupConsole
#======================================
-# 10) kill udev
+# 10) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 11) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/README
^
|
@@ -0,0 +1,9 @@
+#/.../
+# kiwi netboot descriptions
+# The boot images here are used for deploying a system image over
+# the network using the PXE protocol. Access to the image is gained
+# by various methods like:
+# * installation on system disk
+# * installation to system main memory
+# * nbd root mount of the system (network block device)
+# * nfs root mount of the system
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/config.sh
^
|
@@ -0,0 +1,46 @@
+#!/bin/bash
+#================
+# FILE : config.sh
+#----------------
+# PROJECT : OpenSuSE KIWI Image System
+# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
+# :
+# AUTHOR : Marcus Schaefer <ms@suse.de>
+# :
+# BELONGS TO : Operating System images
+# :
+# DESCRIPTION : configuration script for SUSE based
+# : operating systems
+# :
+# :
+# STATUS : BETA
+#----------------
+#======================================
+# Functions...
+#--------------------------------------
+test -f /.kconfig && . /.kconfig
+test -f /.profile && . /.profile
+
+#======================================
+# Greeting...
+#--------------------------------------
+echo "Configure image: [$kiwi_iname]..."
+
+#======================================
+# SuSEconfig
+#--------------------------------------
+suseConfig
+
+#======================================
+# Keep UTF-8 locale
+#--------------------------------------
+baseStripLocales \
+ $(for i in $(echo $kiwi_language | tr "," " ");do echo -n "$i.utf8 ";done)
+baseStripTranslations kiwi.mo
+
+#======================================
+# Umount kernel filesystems
+#--------------------------------------
+baseCleanMount
+
+exit 0
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/config.xml
^
|
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<image schemaversion="5.3" name="initrd-netboot-suse-SLES11">
+ <description type="boot">
+ <author>Marcus Schaefer</author>
+ <contact>ms@novell.com</contact>
+ <specification>boot/initrd image used for PXE</specification>
+ </description>
+ <preferences>
+ <type image="cpio" bootprofile="default" bootkernel="std"/>
+ <version>2.1.1</version>
+ <packagemanager>zypper</packagemanager>
+ <rpm-check-signatures>false</rpm-check-signatures>
+ </preferences>
+ <profiles>
+ <profile name="default" description="Boot with default kernel"/>
+ <profile name="std" description="KERNEL: Default"/>
+ </profiles>
+ <drivers type="drivers">
+ <file name="crypto/*"/>
+ <file name="drivers/gpu/drm/i915/i915.ko"/>
+ <file name="drivers/char/agp/intel-agp.ko"/>
+ <file name="drivers/md/*"/>
+ <file name="drivers/hid/*"/>
+ <file name="drivers/ide/*"/>
+ <file name="drivers/s390/*"/>
+ <file name="drivers/block/loop.ko"/>
+ <file name="drivers/block/brd.ko"/>
+ <file name="net/packet/*"/>
+ <file name="fs/ext3/*"/>
+ <file name="fs/ext2/*"/>
+ <file name="fs/binfmt_aout.ko"/>
+ <file name="fs/binfmt_misc.ko"/>
+ <file name="fs/mbcache.ko"/>
+ <file name="fs/quota_v1.ko"/>
+ <file name="fs/quota_v2.ko"/>
+ <file name="fs/jbd/*"/>
+ <file name="fs/fat/*"/>
+ <file name="fs/vfat/*"/>
+ <file name="fs/hfs/*"/>
+ <file name="fs/exportfs/*"/>
+ <file name="fs/squashfs/*"/>
+ <file name="fs/reiserfs/*"/>
+ <file name="fs/nfs/*"/>
+ <file name="fs/fuse/*"/>
+ <file name="net/sunrpc/*"/>
+ <file name="fs/lockd/*"/>
+ <file name="fs/nfs_common/*"/>
+ <file name="net/ipv6/*"/>
+ <file name="drivers/ata/*"/>
+ <file name="drivers/scsi/*"/>
+ <file name="drivers/message/fusion/*"/>
+ <file name="drivers/net/*"/>
+ <file name="drivers/block/nbd.ko"/>
+ <file name="drivers/block/aoe/aoe.ko"/>
+ <file name="drivers/parport/*"/>
+ <file name="drivers/char/lp.ko"/>
+ <file name="drivers/acpi/dock.ko"/>
+ </drivers>
+ <repository type="yast2" status="replaceable">
+ <source path="http://download.suse.de/install/SLP/SLES-11-SP1-GM/%arch/DVD1/"/>
+ </repository>
+ <repository type="yast2" status="fixed">
+ <source path="http://download.suse.de/install/SLP/SLE-11-SP2-SDK-LATEST/%arch/DVD1"/>
+ </repository>
+ <packages type="image" profiles="std">
+ <package name="kernel-default"/>
+ <package name="kernel-default-base"/>
+ </packages>
+ <packages type="image">
+ <package name="cryptsetup"/>
+ <package name="bc"/>
+ <package name="curl"/>
+ <package name="psmisc"/>
+ <package name="iputils"/>
+ <package name="atftp"/>
+ <package name="busybox"/>
+ <package name="bind-libs"/>
+ <package name="bind-utils"/>
+ <package name="dhcpcd"/>
+ <package name="e2fsprogs"/>
+ <package name="file"/>
+ <package name="hwinfo"/>
+ <package name="module-init-tools"/>
+ <package name="net-tools"/>
+ <package name="netcfg"/>
+ <package name="parted"/>
+ <package name="util-linux"/>
+ <package name="s390-tools"/>
+ <package name="diffutils"/>
+ <package name="procps"/>
+ <package name="lvm2"/>
+ <package name="fribidi"/>
+ <package name="make"/>
+ <package name="nfs-client"/>
+ <package name="tar"/>
+ <package name="kiwi-tools"/>
+ <package name="cyrus-sasl"/>
+ <package name="mdadm"/>
+ <package name="dmraid"/>
+ </packages>
+ <packages type="bootstrap">
+ <package name="filesystem"/>
+ <package name="glibc"/>
+ <package name="glibc-locale"/>
+ <package name="openssl-certs"/>
+ <package name="dialog"/>
+ <package name="fbiterm"/>
+ <package name="gettext-runtime"/>
+ </packages>
+ <packages type="delete">
+ <package name="cracklib-dict-small"/>
+ <package name="cracklib-dict-full"/>
+ <package name="PolicyKit"/>
+ <package name="audit-libs"/>
+ <package name="blocxx"/>
+ <package name="cpio"/>
+ <package name="db"/>
+ <package name="diffutils"/>
+ <package name="expat"/>
+ <package name="fillup"/>
+ <package name="gdbm"/>
+ <package name="glib2"/>
+ <package name="glibc-locale"/>
+ <package name="gpg"/>
+ <package name="info"/>
+ <package name="insserv"/>
+ <package name="iproute2"/>
+ <package name="irqbalance"/>
+ <package name="libxcrypt"/>
+ <package name="libxml2"/>
+ <package name="libzio"/>
+ <package name="limal"/>
+ <package name="limal-perl"/>
+ <package name="logrotate"/>
+ <package name="mingetty"/>
+ <package name="openldap2-client"/>
+ <package name="openslp"/>
+ <package name="pam"/>
+ <package name="pam-modules"/>
+ <package name="pcre"/>
+ <package name="perl"/>
+ <package name="perl-Bootloader"/>
+ <package name="perl-gettext"/>
+ <package name="permissions"/>
+ <package name="pm-utils"/>
+ <package name="pmtools"/>
+ <package name="suse-build-key"/>
+ <package name="fribidi"/>
+ <package name="make"/>
+ </packages>
+</image>
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/images.sh
^
|
@@ -0,0 +1,43 @@
+#!/bin/sh
+test -f /.kconfig && . /.kconfig
+test -f /.profile && . /.profile
+
+echo "Configure image: [$kiwi_iname]..."
+
+#==========================================
+# pack boot includes
+#------------------------------------------
+basePackBootIncludes
+
+#==========================================
+# remove unneded kernel files
+#------------------------------------------
+suseStripKernel
+
+#==========================================
+# setup gfxboot
+#------------------------------------------
+suseGFXBoot SLES grub
+
+#==========================================
+# remove unneeded packages
+#------------------------------------------
+rpm -e --nodeps --noscripts \
+ $(rpm -q `baseGetPackagesForDeletion` | grep -v "is not installed")
+
+#==========================================
+# remove unneeded files
+#------------------------------------------
+suseStripInitrd
+
+#==========================================
+# unpack boot includes
+#------------------------------------------
+baseUnpackBootIncludes
+
+#==========================================
+# umount /proc
+#------------------------------------------
+umount /proc &>/dev/null
+
+exit 0
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/root
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/root/etc
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/root/etc/modprobe.conf.local
^
|
@@ -0,0 +1 @@
+options brd rd_size=512000
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/root/include
^
|
+(symlink to /usr/share/kiwi/modules/KIWILinuxRC.sh)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/root/linuxrc
^
|
+(symlink to ../../suse-linuxrc)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-SLES11/root/preinit
^
|
+(symlink to ../../suse-preinit)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-linuxrc
^
|
@@ -0,0 +1,1060 @@
+#!/bin/bash
+#================
+# FILE : linuxrc
+#----------------
+# PROJECT : OpenSuSE KIWI Image System
+# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
+# :
+# AUTHOR : Marcus Schaefer <ms@suse.de>
+# :
+# BELONGS TO : Operating System images
+# :
+# DESCRIPTION : This file is changed to become the real
+# : linuxrc script which is used to prepare the
+# : operating system for the main image
+# :
+# :
+# STATUS : BETA
+#----------------
+#======================================
+# Exports (General)
+#--------------------------------------
+export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
+export IFS_ORIG=$IFS
+export input=/part.input
+export ARCH=`arch`
+export DEBUG=0
+
+#======================================
+# Exports (Booting)
+#--------------------------------------
+export INITRD_MODULES=""
+export LOCAL_BOOT="no"
+export KERNEL_LIST
+
+#======================================
+# Exports (Alias)
+#--------------------------------------
+export SYSALIAS="undefined"
+export NAME=0
+
+#======================================
+# Exports (Status)
+#--------------------------------------
+export SYSTEM_INTEGRITY
+export SYSTEM_MD5STATUS
+export systemIntegrity="unknown"
+export haveDisk=0
+export haveRamDisk=0
+
+#======================================
+# Exports (clicfs usage)
+#--------------------------------------
+export kiwi_hybrid=yes
+export kiwi_hybridpersistent=yes
+
+#======================================
+# Functions
+#--------------------------------------
+. /include
+initialize
+
+#======================================
+# recreateVTOCTable
+#--------------------------------------
+function recreateVTOCTable {
+ # /.../
+ # re-create VTOC re-using existing partition sizes
+ # ----
+ Echo "Recreate VTOC table [ $imageDiskDevice ]"
+ createPartitionerInput u y w
+ callPartitioner $input
+ rm -f $input
+}
+
+#======================================
+# Beautify Startup
+#--------------------------------------
+echo "Loading KIWI PXE Boot-System..."
+echo "-------------------------------"
+
+#======================================
+# Update library path
+#--------------------------------------
+ldconfig
+
+#======================================
+# 1) Mounting local file systems
+#--------------------------------------
+mountSystemFilesystems &>/dev/null
+closeKernelConsole
+
+#======================================
+# 2) Prepare module load support
+#--------------------------------------
+touch /etc/modules.conf
+touch /lib/modules/*/modules.dep
+runHook init
+
+#======================================
+# 3) run udevd
+#--------------------------------------
+udevStart
+
+#======================================
+# 4) Include proc/cmdline information
+#--------------------------------------
+includeKernelParametersLowerCase
+if [ ! -z "$IMAGE" ];then
+ # /.../
+ # if the image information is already in place at this stage
+ # it comes from the cmdline data which means we are not booting
+ # from the network but want to boot the local system
+ # ----
+ LOCAL_BOOT="yes"
+fi
+
+#======================================
+# 5) start boot shell
+#--------------------------------------
+startBlogD
+startShell
+errorLogStart
+openKernelConsole
+
+#======================================
+# 6) probe/load network module
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ];then
+ loadNetworkCard
+ setupNetworkInterfaceS390
+fi
+
+#======================================
+# 7) Setup network interface and DNS
+#--------------------------------------
+runHook prenetwork
+if [ $LOCAL_BOOT = "no" ];then
+ setupNetworkStatic 1
+fi
+runHook postnetwork
+
+#======================================
+# 8) get TFTP Server IP/name
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ];then
+ pxeSetupDownloadServer
+fi
+
+#======================================
+# 9) Load configuration
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ];then
+ CONFIG=/etc/config.netclient
+ #======================================
+ # Store possible values set by cmdline
+ #--------------------------------------
+ unset ALLOW_CMDLINE_OVERWRITE
+ if [ ! -z "$NBDROOT" ];then
+ KLIST[0]="NBDROOT=$NBDROOT"
+ fi
+ if [ ! -z "$NFSROOT" ];then
+ KLIST[1]="NFSROOT=$NFSROOT"
+ fi
+ if [ ! -z "$AOEROOT" ];then
+ KLIST[2]="AOEROOT=$AOEROOT"
+ fi
+ Echo "Checking for config file..."
+ #======================================
+ # hook: preLoadConfiguration
+ #--------------------------------------
+ runHook preLoadConfiguration
+ #======================================
+ # Load config.<MAC>
+ #--------------------------------------
+ if [ ! -s $CONFIG ] ; then
+ fetchFile KIWI/config.$DHCPCHADDR $CONFIG
+ fi
+ #======================================
+ # Check alternative config names
+ #--------------------------------------
+ if [ ! -s $CONFIG ] ; then
+ searchGroupConfig
+ fi
+ #======================================
+ # Check alternative config names
+ #--------------------------------------
+ if [ ! -s $CONFIG ];then
+ searchAlternativeConfig
+ fi
+ #======================================
+ # try to import configuration
+ #--------------------------------------
+ IMPORTED=0
+ if [ -s $CONFIG ] ;then
+ importFile < $CONFIG
+ #======================================
+ # Check and import Hardware Maps if set
+ #--------------------------------------
+ searchHardwareMapConfig
+ IMPORTED=1
+ fi
+ #======================================
+ # No config found register new client
+ #--------------------------------------
+ if [ ! -s $CONFIG ];then
+ #======================================
+ # Register new network client
+ #--------------------------------------
+ Echo "Registering new network client..."
+ pxeSetupSystemAliasName
+ pxeSetupSystemHWInfoFile
+ pxeSetupSystemHWTypeFile
+ #======================================
+ # Put files on the boot server
+ #--------------------------------------
+ putFile hwtype.$DHCPCHADDR upload/client.$DHCPCHADDR
+ echo
+ Echo "Registered as: $DHCPCHADDR"
+ Echo "Waiting for configuration..."
+ sleep 60
+ #======================================
+ # Wait for configuration (reload)
+ #--------------------------------------
+ while test ! -s $CONFIG;do
+ Echo "Lookup network client config file again..."
+ Echo "Checking for config file: config.$DHCPCHADDR"
+ dhcpcd -n $PXE_IFACE
+ fetchFile KIWI/config.$DHCPCHADDR $CONFIG
+ if [ ! -s $CONFIG ] ; then
+ searchGroupConfig
+ fi
+ if test ! -s $CONFIG;then
+ searchAlternativeConfig
+ fi
+ test -s $CONFIG || {
+ Echo "Couldn't get image configuration"
+ Echo "sleeping [60 sec]..."
+ sleep 60
+ }
+ done
+ fi
+ #======================================
+ # import latest configuration
+ #--------------------------------------
+ if [ $IMPORTED -eq 0 ];then
+ importFile < $CONFIG
+ #======================================
+ # Check and import Hardware Maps if set
+ #--------------------------------------
+ searchHardwareMapConfig
+ IMPORTED=1
+ fi
+ #======================================
+ # restore values from cmdline
+ #--------------------------------------
+ if [ ! -z "$ALLOW_CMDLINE_OVERWRITE" ];then
+ for i in ${KLIST[@]};do
+ eval export \"$i\"
+ done
+ fi
+ #======================================
+ # hook: postLoadConfiguration
+ #--------------------------------------
+ runHook postLoadConfiguration
+fi
+
+#======================================
+# 10) Load Device modules
+#--------------------------------------
+runHook preprobe
+probeDevices "skipUSB"
+runHook postprobe
+
+#======================================
+# 11) Select language if not in cmdline
+#--------------------------------------
+selectLanguage
+
+#======================================
+# 12) Check for diskful station
+#--------------------------------------
+searchBusIDBootDevice
+if [ $LOCAL_BOOT = "no" ];then
+ checkDevice=$DISK
+ if [ -z "$checkDevice" ];then
+ checkDevice=$(echo $IMAGE | cut -f1 -d\;)
+ fi
+ if [ ! -z "$checkDevice" ];then
+ if ! waitForStorageDevice $checkDevice;then
+ systemException \
+ "Block device $checkDevice doesn't appear... fatal !" \
+ "reboot"
+ fi
+ if echo $checkDevice | grep -q dev\/ram;then
+ export haveRamDisk=1
+ else
+ export haveDisk=1
+ export imageDiskDevice=$checkDevice
+ fi
+ fi
+fi
+
+#======================================
+# 13) Check for installed system
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ] && [ $haveDisk = "1" ];then
+ if [ ! -z "$RAID" ];then
+ pxeRaidAssemble
+ else
+ pxeRaidZeroSuperBlock
+ fi
+ IMAGE_FIRST=$(echo $IMAGE | cut -f1 -d,)
+ for i in $IMAGE_FIRST;do
+ field=0
+ IFS=";" ; for n in $i;do
+ case $field in
+ 0) imageDevice=$n ; field=1 ;;
+ 1) imageName=$n ; field=2 ;;
+ 2) imageVersion=$n; field=3
+ esac
+ done
+ updateNeeded initialize
+ if linuxPartition $imageDiskDevice;then
+ probeFileSystem $imageDevice
+ if [ "$FSTYPE" = "luks" ];then
+ luks_open_can_fail=yes
+ if luksOpen $imageDevice ; then
+ imageDevice=$luksDeviceOpened
+ imageRODevice=$imageDevice
+ probeFileSystem $imageRootDevice
+ export haveLuks=yes
+ fi
+ unset luks_open_can_fail
+ fi
+ if mountSystem $imageDevice;then
+ updateNeeded
+ umountSystem
+ systemIntegrity=`getSystemIntegrity 1`
+ if [ $systemIntegrity = "fine" ];then
+ Echo "Base system is up to date, activating disk system..."
+ fi
+ else
+ Echo -b "On-disk Image mount attempt failed,"
+ Echo -b "Image Update for image [ $imageName ] needed"
+ umountSystem
+ RELOAD_IMAGE="yes"
+ systemIntegrity="clean"
+ fi
+ if [ -n "$haveLuks" ]; then
+ luksClose $imageDevice
+ fi
+ else
+ systemIntegrity="clean"
+ fi
+ done
+fi
+
+#======================================
+# 14) Create ptable on diskful system
+#--------------------------------------
+runHook prepartition
+if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
+ #======================================
+ # Create partition table
+ #--------------------------------------
+ Echo "Creating partition table..."
+ if [ -z "$RAID" ];then
+ #======================================
+ # Standard table
+ #--------------------------------------
+ cleanPartitionTable
+ recreateVTOCTable
+ createPartitionerInput $(pxePartitionInput)
+ callPartitioner $input
+ else
+ #======================================
+ # Raid1 table
+ #--------------------------------------
+ field=0
+ IFS=";" ; for n in $RAID;do
+ case $field in
+ 0) raidLevel=$n ; field=1 ;;
+ 1) raidDiskFirst=$n ; field=2 ;;
+ 2) raidDiskSecond=$n; field=3
+ esac
+ done
+ IFS=$IFS_ORIG
+ #======================================
+ # wait for raid disks to appear
+ #--------------------------------------
+ if ! waitForStorageDevice $raidDiskFirst;then
+ systemException \
+ "Disk $raidDiskFirst doesn't appear... fatal !" \
+ "reboot"
+ fi
+ if ! waitForStorageDevice $raidDiskSecond;then
+ systemException \
+ "Disk $raidDiskSecond doesn't appear... fatal !" \
+ "reboot"
+ fi
+ #======================================
+ # stop eventually assembled raid
+ #--------------------------------------
+ pxeRaidStop
+ #======================================
+ # call partitioner on each raid disk
+ #--------------------------------------
+ for raid_dev in $raidDiskFirst $raidDiskSecond;do
+ imageDiskDevice=$raid_dev
+ rm -f $input
+ cleanPartitionTable
+ recreateVTOCTable
+ createPartitionerInput $(pxeRaidPartitionInput)
+ callPartitioner $input
+ done
+ imageDiskDevice=$DISK
+ #======================================
+ # Create raid array
+ #--------------------------------------
+ pxeRaidCreate
+ fi
+ #======================================
+ # Setup swap space if requested
+ #--------------------------------------
+ if [ -z "$RAID" ];then
+ export imageSwapDevice=$(pxeSwapDevice)
+ else
+ export imageSwapDevice=$(pxeRaidSwapDevice)
+ fi
+ runHook preswap
+ if [ ! -z "$imageSwapDevice" ];then
+ if ! mkswap $imageSwapDevice 1>&2;then
+ systemException "Failed to create swap signature" "reboot"
+ fi
+ fi
+ runHook postswap
+ #======================================
+ # Setup boot space if requested
+ #--------------------------------------
+ if [ -z "$RAID" ];then
+ export imageBootDevice=$(pxeBootDevice)
+ if [ ! -z "$imageBootDevice" ];then
+ createFilesystem $imageBootDevice
+ fi
+ fi
+fi
+runHook postpartition
+
+#======================================
+# 15) Setup root device environment
+#--------------------------------------
+runHook predownload
+if \
+ [ $LOCAL_BOOT = "no" ] && \
+ ([ $haveDisk = "1" ] || [ $haveRamDisk = "1" ])
+then
+ #======================================
+ # 15.1) Download network client image
+ #--------------------------------------
+ count=0
+ IFS="," ; for i in $IMAGE;do
+ imageZipped="uncompressed"
+ count=$(($count + 1))
+ field=0
+ IFS=";" ; for n in $i;do
+ case $field in
+ 0) imageDevice=$n ; field=1 ;;
+ 1) imageName=$n ; field=2 ;;
+ 2) imageVersion=$n; field=3 ;;
+ 3) imageServer=$n ; field=4 ;;
+ 4) imageBlkSize=$n; field=5 ;;
+ 5) imageZipped=$n ;
+ esac
+ done
+ if [ $count = 1 ];then
+ imageRootDevice=$imageDevice
+ imageRootName=$imageName
+ fi
+ # /.../
+ # start download only if installed system is different
+ # from the image on the pxe boot server
+ # ---
+ if test `getSystemIntegrity $count` = "fine";then
+ continue
+ fi
+ imageName="image/$imageName-$imageVersion"
+ imageMD5s="$imageName.md5"
+ [ -z "$imageServer" ] && imageServer=$SERVER
+ [ -z "$imageBlkSize" ] && imageBlkSize=8192
+ while true;do
+ # /.../
+ # get image md5sum to be able to check for the size
+ # requirements if we are loading into RAM
+ # ---
+ IFS=$IFS_ORIG
+ fetchFile $imageMD5s /etc/image.md5 uncomp $imageServer
+ if test $loadCode != 0 || ! loadOK "$loadStatus"; then
+ systemException \
+ "Download of $imageMD5s failed: $loadStatus" \
+ "reboot"
+ fi
+ read sum1 blocks blocksize zblocks zblocksize < /etc/image.md5
+ if ! validateSize;then
+ systemException \
+ "Not enough space available for this image" \
+ "reboot"
+ fi
+ # /.../
+ # now load the image into the imageDevice
+ # ---
+ multicast_old=$multicast
+ multicast="enable"
+ if test "$imageZipped" = "compressed"; then
+ Echo "Compressed image found: Disable multicast download"
+ multicast="disable"
+ fi
+ Echo "Loading $imageName [$imageDevice BS:$imageBlkSize Byte]..."
+ fetchFile $imageName $imageDevice $imageZipped $imageServer
+ multicast=$multicast_old
+ if test $loadCode != 0 || ! loadOK "$loadStatus";then
+ systemException \
+ "Download of $imageName failed: $loadStatus" \
+ "reboot"
+ fi
+ # /.../
+ # check the md5sum of the downloaded data records
+ # ----
+ Echo "Download complete, checking data..."
+ verifyBytes=$((blocks * blocksize))
+ verifyMByte=$((verifyBytes / 1048576))
+ if [ -x /usr/bin/dcounter ];then
+ test -e /progress || mkfifo /progress
+ TEXT_VERIFY=$(getText "Verifying %1" $imageDevice)
+ echo "$TEXT_VERIFY ( 0% )" > /progress &
+ dump="cat $imageDevice"
+ dump="$dump | dcounter -s $verifyMByte -l \"$TEXT_VERIFY \""
+ errorLogStop
+ (
+ eval $dump 2>/progress |\
+ head --bytes=$verifyBytes | md5sum - > /etc/ireal.md5
+ )&
+ dump_pid=$!
+ echo "cat /progress | dialog \
+ --backtitle \"$TEXT_INSTALLTITLE\" \
+ --progressbox 3 65
+ " > /tmp/progress.sh
+ if [ -e /dev/fb0 ];then
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
+ else
+ bash -e /tmp/progress.sh
+ fi
+ wait $dump_pid
+ clear
+ errorLogContinue
+ else
+ dd if=$imageDevice bs=1024 |\
+ head --bytes=$verifyBytes |\
+ md5sum - > /etc/ireal.md5
+ fi
+ read sum2 dumy < /etc/ireal.md5
+ if test $sum1 = $sum2;then
+ Echo "Image checksum test: fine :-)"
+ break
+ fi
+ Echo "Image checksum test failed:"
+ Echo "Possible reasons:"
+ echo
+ Echo -b "1) Physical ethernet connection lost:"
+ Echo -b " please check cable"
+ echo
+ Echo -b "2) Data corruption while loading the image:"
+ Echo -b " will give it a new try..."
+ echo
+ Echo -b "3) wrong checksum file created for the image:"
+ Echo -b " check with the md5sum command if the image on the"
+ Echo -b " TFTP server provides the same md5 sum as included"
+ Echo -b " within the appropriate .md5 file for this image"
+ echo
+ if [ -z "$DISK" ];then
+ Echo -b "4) ramdisk size is too small for the image:"
+ Echo -b " check the ramdisk_size parameter of the PXE"
+ Echo -b " configuration file on the TFTP server"
+ else
+ Echo -b "4) partition size is too small for the image:"
+ Echo -b " check the PART line in the image config file on the"
+ Echo -b " TFTP server"
+ fi
+ echo
+ Echo "Retry to load image..."
+ sleep 15
+ done
+ imageRootDevice=$imageDevice
+ if [ ! -z "$UNIONFS_CONFIG" ];then
+ imageRWDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`
+ imageRODevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`
+ fi
+ rm -f /etc/ireal.md5
+ rm -f /etc/image.md5
+ done
+else
+ #======================================
+ # 15.2) Check for local boot
+ #--------------------------------------
+ if [ $LOCAL_BOOT = "yes" ];then
+ imageDisk=$(dn $root)
+ imageDevice=$(ddn $imageDisk 2)
+ imageRootDevice=$imageDevice
+ imageRootName="Local-System"
+ if [ ! -z "$UNIONFS_CONFIG" ];then
+ unionFST=$UNIONFS_CONFIG
+ imageRWDevice=$(ddn $imageDisk 3)
+ imageRODevice=$(ddn $imageDisk 2)
+ fi
+ fi
+ #======================================
+ # 15.3) Check for NFS root
+ #--------------------------------------
+ if [ ! -z "$NFSROOT" ];then
+ IFS="," ; for i in $NFSROOT;do
+ field=0
+ IFS=";" ; for n in $i;do
+ case $field in
+ 0) nfsRootServer=$n ; field=1 ;;
+ 1) nfsRootDevice=$n ; field=2
+ esac
+ done
+ done
+ for m in nfs lockd sunrpc;do
+ modprobe -i $m
+ done
+ if [ -z "$nfsRootServer" ];then
+ nfsRootServer=$SERVER
+ fi
+ setupNFSServices
+ Echo "Mounting NFS root system: $nfsRootServer:$nfsRootDevice..."
+ imageRootDevice="-o vers=3,rw $nfsRootServer:$nfsRootDevice"
+ if [ ! -z "$COMBINED_IMAGE" ] || [ ! -z "$UNIONFS_CONFIG" ];then
+ imageRootDevice="-o vers=3,ro $nfsRootServer:$nfsRootDevice"
+ fi
+ imageRootName="NFSRoot-System"
+ systemIntegrity="clean"
+ export FSTYPE=nfs
+ if [ ! -z "$UNIONFS_CONFIG" ];then
+ imageRWDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`
+ imageRODevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`
+ unionFST=`echo $UNIONFS_CONFIG | cut -d , -f 3`
+ if [ "$unionFST" = "clicfs" ];then
+ systemException "clicfs over NFSROOT is not supported" "reboot"
+ fi
+ fi
+ fi
+ #======================================
+ # 15.4) Check for NBD root
+ #--------------------------------------
+ if [ ! -z "$NBDROOT" ];then
+ if ! modprobe nbd;then
+ systemException "Failed to load network blk device module" "reboot"
+ fi
+ IFS="," ; for i in $NBDROOT;do
+ field=0
+ IFS=";" ; for n in $i;do
+ case $field in
+ 0) nbdServer=$n ; field=1 ;;
+ 1) nbdPort=$n ; field=2 ;;
+ 2) nbdDevice=$n ; field=3 ;;
+ 3) nbdswapPort=$n ; field=4 ;;
+ 4) nbdswapDevice=$n ; field=5 ;;
+ 5) nbdwritePort=$n ; field=6 ;;
+ 6) nbdwriteDevice=$n; field=7
+ esac
+ done
+ done
+ if [ -z "$nbdServer" ];then
+ nbdServer=$SERVER
+ fi
+ if [ -z "$nbdDevice" ];then
+ nbdDevice="/dev/nbd0"
+ fi
+ if [ -z "$nbdswapDevice" ];then
+ nbdswapDevice="/dev/nbd1"
+ fi
+ if [ -z "$nbdPort" ];then
+ nbdPort="2000"
+ fi
+ if [ -z "$nbdwriteDevice" ];then
+ nbdwriteDevice="/dev/ram1"
+ fi
+ waitForBlockDevice $nbdDevice
+ if [ ! -b $nbdDevice ];then
+ systemException "Device $nbdDevice doesn't appear" "reboot"
+ fi
+ if [ ! -z "$nbdwritePort" ];then
+ waitForBlockDevice $nbdwriteDevice
+ if [ ! -b $nbdwriteDevice ];then
+ systemException "Device $nbdwriteDevice doesn't appear" "reboot"
+ fi
+ fi
+ if [ ! -z "$nbdswapPort" ];then
+ waitForBlockDevice $nbdswapPort
+ if [ ! -b $nbdswapDevice ];then
+ systemException "Device $nbdswapDevice doesn't appear" "reboot"
+ fi
+ fi
+ # /.../
+ # try to get swap from the server if we dont have
+ # enough ram (less than 62MB)
+ # ----
+ if [ ! -z "$nbdswapPort" ];then
+ min_ram=63488
+ real_ram=$(cat /proc/meminfo |grep MemTotal|tr -d " [a-z][A-Z]:")
+ if [ ${real_ram} -lt ${min_ram} ];then
+ Echo "NBD: memory is below required 62M"
+ Echo "NBD: swap: $nbdServer $nbdswapPort [$nbdswapDevice]"
+ if ! nbd-client $nbdServer $nbdswapPort $nbdswapDevice -persist
+ then
+ systemException \
+ "Failed to setup $nbdswapDevice device" \
+ "reboot"
+ fi
+ Echo "NBD: Waiting for server to create swap space..."; sleep 3
+ swapon $nbdswapDevice || true
+ fi
+ fi
+ # /.../
+ # try to mount a remote read/write location based on NBD
+ # this is then overlayed via $unionFST
+ # ----
+ if [ ! -z "$nbdwritePort" ];then
+ Echo "NBD: read/write $nbdServer $nbdwritePort [$nbdwriteDevice]..."
+ if ! nbd-client $nbdServer $nbdwritePort $nbdwriteDevice -persist
+ then
+ systemException \
+ "Failed to setup $nbdwriteDevice device" \
+ "reboot"
+ fi
+ fi
+ # /.../
+ # mount basic root filesystem exported via NBD
+ # ----
+ Echo "Mounting NBD root system: $nbdServer $nbdPort [$nbdDevice]..."
+ if ! nbd-client $nbdServer $nbdPort $nbdDevice -persist;then
+ systemException "Failed to setup $nbdDevice device" "reboot"
+ fi
+ # /.../
+ # setup union if basic root filesystem is read-only
+ # ----
+ imageRootDevice=$nbdDevice
+ imageRootName="NBDRoot-System"
+ systemIntegrity="clean"
+ if [ -z "$COMBINED_IMAGE" ];then
+ imageRWDevice=$nbdwriteDevice
+ imageRODevice=$imageRootDevice
+ fi
+ fi
+ #======================================
+ # 15.5) Check for AOE root
+ #--------------------------------------
+ if [ ! -z "$AOEROOT" ];then
+ aoeRODevice=`echo $AOEROOT | cut -d , -f 1`
+ aoeRWDevice=`echo $AOEROOT | cut -d , -f 2`
+ if [ -z "$aoeRWDevice" ] || [ "$aoeRODevice" = "$aoeRWDevice" ];then
+ aoeRWDevice=/dev/ram1
+ fi
+ if ! modprobe aoe;then
+ systemException "Failed to load AoE module" "reboot"
+ fi
+ waitForBlockDevice $aoeRODevice
+ if [ ! -b $aoeRODevice ];then
+ systemException "Device $aoeRODevice doesn't appear" "reboot"
+ fi
+ # /.../
+ # check ram space, if we don't have more than 62MB
+ # we can't use Ata over Ethernet and reboot
+ # ----
+ min_ram=63488
+ real_ram=$(cat /proc/meminfo |grep MemTotal|tr -d " [a-z][A-Z]:")
+ if [ ${real_ram} -lt ${min_ram} ];then
+ Echo "AoE: memory is below required 62M"
+ systemException "Not enough ram" "reboot"
+ fi
+ Echo "Mounting AoE root system: $aoeRODevice..."
+ imageRootDevice=$aoeRODevice
+ imageRootName="AOERoot-System"
+ systemIntegrity="clean"
+ if [ -z "$COMBINED_IMAGE" ];then
+ imageRWDevice=$aoeRWDevice
+ imageRODevice=$imageRootDevice
+ fi
+ fi
+fi
+runHook postdownload
+
+#======================================
+# 16) Get filesystem type
+#--------------------------------------
+if [ -b $imageRootDevice ];then
+ probeFileSystem $imageRootDevice
+ if [ "$FSTYPE" = "luks" ];then
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
+ imageRODevice=$imageRootDevice
+ probeFileSystem $imageRootDevice
+ export haveLuks=yes
+ fi
+ if [ "$FSTYPE" = "unknown" ];then
+ systemException \
+ "Couldn't determine filesystem type... abort" \
+ "reboot"
+ fi
+fi
+
+#======================================
+# 17) resize fs on diskful client
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
+ if [ $haveDisk = "1" ] || [ $haveRamDisk = "1" ];then
+ resizeFilesystem $imageRootDevice
+ fi
+fi
+
+#======================================
+# 18) Check filesystem
+#--------------------------------------
+Echo "Filesystem of PXE system is: $FSTYPE -> $imageRootDevice"
+if isFSTypeReadOnly;then
+ if [ ! -z "$imageRWDevice" ] && [ ! -z "$imageRODevice" ];then
+ setupUnionFS $imageRWDevice $imageRODevice $unionFST
+ fi
+fi
+
+#======================================
+# 19) Setup bootid for this table
+#--------------------------------------
+if [ ! -z "$imageBootDevice" ];then
+ # bootid is boot partition
+ export bootid=$(nd $imageBootDevice)
+else
+ # bootid is root partition
+ export bootid=$(nd $imageRootDevice)
+fi
+if [ ! -z "$RAID" ];then
+ # raid md devices start with 0 but partition id's start with 1
+ bootid=$((bootid + 1))
+fi
+
+#======================================
+# 20) Mount OS image to /mnt
+#--------------------------------------
+runHook premount
+if ! mountSystem;then
+ systemException "Failed to mount root filesystem" "reboot"
+fi
+validateRootTree
+runHook postmount
+
+#======================================
+# 21) Import fixed configuration files
+#--------------------------------------
+runHook preconfig
+if [ $LOCAL_BOOT = "no" ] || [ ! -z "$RELOAD_CONFIG" ];then
+ if [ ! -z "$RELOAD_CONFIG" ];then
+ Echo "Configuration files reload forced via RELOAD_CONFIG..."
+ fi
+ #=======================================
+ # 21.0) Import NFS root files
+ #---------------------------------------
+ if [ ! -z "$NFSROOT" ];then
+ test -f /etc/resolv.conf && cp /etc/resolv.conf /mnt/etc
+ fi
+ #=======================================
+ # 21.1) Import RAID config file
+ #---------------------------------------
+ if [ ! -z "$RAID" ];then
+ cp /mdadm.conf /mnt/etc
+ fi
+ #=======================================
+ # 21.2) Import files from backup
+ #---------------------------------------
+ BCFG_BASE='etc/KIWI'
+ BCFG_NAME='InstalledConfigFiles'
+ if [ -s "/mnt/$BCFG_BASE/$BCFG_NAME" ] ;then
+ importFile 'BK_' </mnt/$BCFG_BASE/$BCFG_NAME
+ fi
+ ALL_CCONF=`condenseConfigData "$CONF,$VENDOR_CONF"`
+ ALL_CBK_CONF=`condenseConfigData "$BK_CONF,$BK_VENDOR_CONF"`
+ #=======================================
+ # 21.3) Store new configuration
+ #---------------------------------------
+ mkdir /config
+ mkdir -p /config/$BCFG_BASE
+ cp "$CONFIG" "/config/$BCFG_BASE/config.$DHCPCHADDR"
+ echo "CONF=$CONF" > "/config/$BCFG_BASE/$BCFG_NAME"
+ echo "VENDOR_CONF=$VENDOR_CONF" >> "/config/$BCFG_BASE/$BCFG_NAME"
+ #=======================================
+ # 21.4) Get files from CONF, VENDOR_CONF
+ #---------------------------------------
+ IFS="," ; for i in $ALL_CCONF;do
+ unset configHash
+ field=0
+ IFS=";"; for n in $i;do
+ case $field in
+ 0) configSource=$n ; field=1 ;;
+ 1) configDest=$n ; field=2 ;;
+ 2) configServer=$n ; field=3 ;;
+ 3) configBlkSize=$n; field=4 ;;
+ 4) configHash=$n ; field=5
+ esac
+ done
+ # /.../
+ # compare new config data to backup config data
+ # ----
+ cfg_copy=1
+ cfgmsg_why='(forced)'
+ if [ -z "$RELOAD_CONFIG" ];then
+ cfgmsg_why='(missing)'
+ IFS=","; for j in $ALL_CBK_CONF;do
+ BKconfigDest=`echo "$j" | cut -d ';' -f 2`
+ BKconfigHash=`echo "$j" | cut -d ';' -f 5`
+ if [ "$BKconfigDest" = "$configDest" ];then
+ cfgmsg_why='(changed)'
+ if [ "$configHash" = "$BKconfigHash" ];then
+ cfg_copy=0
+ fi
+ break
+ fi
+ done
+ fi
+ if [ $cfg_copy -eq '1' ];then
+ Echo "Importing $cfgmsg_why configuration file: $configDest"
+ dirs=`dirname $configDest`
+ mkdir -p /config/$dirs
+ fetchFile $configSource /config/$configDest uncomp $configServer
+ fi
+ done
+ #=======================================
+ # 21.5) check config files to be deleted
+ #---------------------------------------
+ IFS="," ; for i in $ALL_CBK_CONF;do
+ BKconfigDest=`echo "$i" | cut -d ';' -f 2`
+ deletethis=1
+ IFS=","; for j in $ALL_CCONF;do
+ configDest=`echo "$j" | cut -d ';' -f 2`
+ if [ "$BKconfigDest" = "$configDest" ];then
+ deletethis=0
+ break
+ fi
+ done
+ if [ "$deletethis" -eq '1' ];then
+ Echo "Deleting obsolete configuration file: $BKconfigDest"
+ rm /mnt/$BKconfigDest
+ fi
+ done
+ IFS=$IFS_ORIG
+ #=======================================
+ # 21.6) Check for KIWI_INITRD
+ #---------------------------------------
+ if [ $haveDisk = "1" ] && [ $systemIntegrity = "clean" ];then
+ if [ ! -z "$KIWI_INITRD" ] && [ ! -z "$KIWI_KERNEL" ];then
+ Echo "Import KIWI initrd/kernel file: $KIWI_INITRD/$KIWI_KERNEL"
+ rm -f /mnt/boot/initrd* && mkdir -p /mnt/boot >/dev/null 2>&1
+ fetchFile $KIWI_INITRD /mnt/boot/initrd.kiwi
+ Echo "Import KIWI kernel file: $KIWI_KERNEL"
+ rm -f /mnt/boot/linux*
+ fetchFile $KIWI_KERNEL /mnt/boot/linux.kiwi
+ KIWI_INITRD_PARAMS="IMAGE=local"
+ if [ ! -z "$COMBINED_IMAGE" ]; then
+ SPLIT="COMBINED_IMAGE=$COMBINED_IMAGE"
+ KIWI_INITRD_PARAMS="$KIWI_INITRD_PARAMS $SPLIT"
+ fi
+ export PXE_KIWI_INITRD=yes
+ fi
+ if [ ! -z "$UNIONFS_CONFIG" ]; then
+ unionFST=`echo $UNIONFS_CONFIG | cut -d , -f 3`
+ UNIONED="UNIONFS_CONFIG=$unionFST"
+ KIWI_INITRD_PARAMS="$KIWI_INITRD_PARAMS $UNIONED"
+ fi
+ fi
+fi
+runHook postconfig
+
+#======================================
+# 22) check filesystem and kernels
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
+ if [ "$FSTYPE" != "nfs" ];then
+ probeFileSystem $imageRootDevice
+ fi
+ kernelList /mnt
+fi
+
+#======================================
+# 23) setup ird/kernel links for union
+#--------------------------------------
+if [ "$LOCAL_BOOT" = "no" ] && [ $systemIntegrity = "clean" ];then
+ setupKernelLinks
+fi
+
+#======================================
+# 24) Create system dependant files
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
+ mkdir -p /config
+ setupDefaultPXENetwork /config
+ setupDefaultFstab /config
+ updateRootDeviceFstab /config "$imageRootDevice"
+ if [ ! -z "$DISK" ];then
+ updateSwapDeviceFstab /config $imageSwapDevice
+ updateOtherDeviceFstab /config
+ setupBootLoader /mnt /config $(($bootid - 1)) \
+ $imageRootDevice NET $imageSwapDevice
+ setupKernelModules /config
+ fi
+fi
+
+#======================================
+# 25) copy system dependant files
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ];then
+ setupConfigFiles
+fi
+
+#======================================
+# 26) update system dependant files
+#--------------------------------------
+setupInittab /mnt
+
+echo 256 > /proc/sys/kernel/real-root-dev
+#======================================
+# 27) umount system filesystems
+#--------------------------------------
+umountSystemFilesystems
+
+#======================================
+# 28) copy initrd files to image
+#--------------------------------------
+if [ $LOCAL_BOOT = "no" ] && [ $systemIntegrity = "clean" ];then
+ if canWrite /mnt;then
+ importBranding
+ cp /preinit /mnt
+ cp /include /mnt
+ fi
+fi
+
+#======================================
+# 29) kill boot shell
+#--------------------------------------
+killShell
+killBlogD
+
+#======================================
+# 30) Activate new root
+#--------------------------------------
+runHook preactivate
+activateImage
+
+#======================================
+# 31) Unmount initrd / system init
+#--------------------------------------
+bootImage $@
|
[-]
[+]
|
Added |
kiwi.tar.bz2/system/boot/s390/netboot/suse-preinit
^
|
@@ -0,0 +1,158 @@
+#!/bin/bash
+#================
+# FILE : preinit
+#----------------
+# PROJECT : OpenSuSE KIWI Image System
+# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
+# :
+# AUTHOR : Marcus Schaefer <ms@suse.de>
+# :
+# BELONGS TO : Operating System images
+# :
+# DESCRIPTION : This file is called after the image root
+# : has changed by the linuxrc script
+# :
+# STATUS : BETA
+#----------------
+#======================================
+# Functions
+#--------------------------------------
+. /include
+
+#======================================
+# 1) start error log
+#--------------------------------------
+errorLogStart
+Echo "Calling pre-init stage in system image"
+
+#======================================
+# 2) check for LOCAL_BOOT
+#--------------------------------------
+if [ $LOCAL_BOOT = "yes" ];then
+ exit 0
+fi
+
+#======================================
+# 3) start udev
+#--------------------------------------
+mountSystemFilesystems
+udevSystemStart
+
+#======================================
+# 5) update mount table
+#--------------------------------------
+updateMTAB
+
+#======================================
+# 6) check preinit services
+#--------------------------------------
+if isVirtioDevice;then
+ runPreinitServices virtio
+fi
+if isDASDDevice;then
+ runPreinitServices dasd
+fi
+if isZFCPDevice;then
+ runPreinitServices zfcp
+fi
+
+#======================================
+# 7) create initrd on diskful
+#--------------------------------------
+if [ ! -z "$imageDiskDevice" ] && [ "$systemIntegrity" = "clean" ]; then
+ if [ -z "$UNIONFS_CONFIG" ] && [ -z "$COMBINED_IMAGE" ]; then
+ #======================================
+ # use distro initrd via mkinitrd
+ #--------------------------------------
+ setupSUSEInitrd
+ else
+ #======================================
+ # use kiwi initrd downloaded before
+ #--------------------------------------
+ bootLoaderOK=1
+ fi
+fi
+
+#======================================
+# 8) Install boot loader on diskful
+#--------------------------------------
+if [ "$bootLoaderOK" = 1 ];then
+ installBootLoader
+fi
+
+#======================================
+# 9) create /etc/ImagePackages
+#--------------------------------------
+if [ "$systemIntegrity" = "clean" ];then
+ if [ -x /bin/rpm ];then
+ Echo "Creating initial image package info file"
+ rpm -qa --last > /etc/ImagePackages
+ fi
+fi
+
+#======================================
+# 10) check for valid mount points
+#--------------------------------------
+if [ ! -z "$imageDiskDevice" ] && [ "$systemIntegrity" = "clean" ];then
+ IFS=":" ; for i in $PART_MOUNT;do
+ if [ ! -z "$i" ] && [ ! -e "$i" ] && [ ! "$i" = "x" ];then
+ mkdir -p $i
+ fi
+ done
+fi
+
+#======================================
+# 11) Update /etc/ImageVersion files
+#--------------------------------------
+if [ ! -z "$imageDiskDevice" ] && [ "$systemIntegrity" = "clean" ];then
+ count=0
+ IFS="," ; for i in $IMAGE;do
+ count=$(($count + 1))
+ field=0
+ IFS=";" ; for n in $i;do
+ case $field in
+ 0) field=1 ;;
+ 1) imageName=$n ; field=2 ;;
+ 2) imageVersion=$n; field=3
+ esac
+ done
+ atversion="$imageName-$imageVersion"
+ versionFile="/etc/ImageVersion-$atversion"
+ md5sum=`getSystemMD5Status $count`
+ if test `getSystemIntegrity $count` = "clean";then
+ echo "$atversion $md5sum" > $versionFile
+ fi
+ done
+fi
+
+#======================================
+# 12) setup console
+#--------------------------------------
+if [ "$systemIntegrity" = "clean" ];then
+ setupConsole
+fi
+
+#======================================
+# 13) setup static network
+#--------------------------------------
+if [ "$systemIntegrity" = "clean" ];then
+ setupNetworkInterfaceS390
+ udevPending
+ setupNetworkStatic 0
+fi
+
+#======================================
+# 14) kernelCheck
+#--------------------------------------
+kernelCheck
+
+#======================================
+# 15) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 16) kill udev
+#--------------------------------------
+udevSystemStop
+umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/oemboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-oemboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-oemboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -21,6 +21,7 @@
<file name="net/packet/*"/>
<file name="drivers/s390/*"/>
<file name="drivers/virtio/*"/>
+ <file name="drivers/block/brd.ko"/>
<file name="drivers/net/*"/>
<file name="drivers/md/*"/>
<file name="drivers/block/*"/>
@@ -49,8 +50,8 @@
<repository type="yast2" status="replaceable">
<source path="http://download.suse.de/install/SLP/SLES-11-SP1-GM/%arch/DVD1/"/>
</repository>
- <repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <repository type="yast2" status="fixed">
+ <source path="http://download.suse.de/install/SLP/SLE-11-SP2-SDK-LATEST/%arch/DVD1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
@@ -90,6 +91,7 @@
<package name="gettext-runtime"/>
<package name="kexec-tools"/>
<package name="kpartx"/>
+ <package name="iputils"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/oemboot/suse-dump
^
|
@@ -153,16 +153,19 @@
#======================================
# Search CD/DVD/USB stick and mount it
#--------------------------------------
+ waitForIdleEventQueue
if [ -z "$pxe" ];then
USBStickDevice install
if [ $stickFound = 0 ];then
Echo "Search for USB stick failed, checking CD/DVD drive"
- CDMount
+ CDMount install
export OEMInstallType=CD
+ export imageDiskDevice=$biosBootDevice
else
Echo "Found Stick: $stickRoot -> $stickSerial"
mkdir -p /cdrom && mount $(ddn $stickRoot 2) /cdrom
export OEMInstallType=USB
+ export imageDiskDevice=$stickRoot
unset stickSerial
fi
else
@@ -176,15 +179,18 @@
Echo "Searching harddrive for $OEMInstallType installation"
hwinfo=/usr/sbin/hwinfo
if [ ! -z "$imageDiskDevice" ];then
- deviceDisks=`$hwinfo --disk |\
+ deviceDisks=`$hwinfo --disk --listmd |\
grep "Device File:" | cut -f2 -d: |\
cut -f1 -d"(" | sed -e s"@$imageDiskDevice@@"`
else
- deviceDisks=`$hwinfo --disk |\
+ deviceDisks=`$hwinfo --disk --listmd |\
grep "Device File:" | cut -f2 -d: |\
cut -f1 -d"("`
fi
export deviceDisks=`echo $deviceDisks`
+ if [ ! -z "$ramdisk" ];then
+ deviceDisks="$deviceDisks /dev/ram1"
+ fi
if [ -z "$deviceDisks" ];then
systemException \
"No device(s) for installation found... abort" \
@@ -193,11 +199,12 @@
Echo "Found following disk device(s)"
count=0
for i in $deviceDisks;do
- dsize=`partitionSize $i`
+ dbyid=$(getDiskID $i)
+ dsize=`partitionSize $dbyid`
dsizeMB=`expr $dsize / 1024`
if [ "$dsizeMB" -gt 0 ];then
Echo -b "Disk $count -> $i [ $dsizeMB MB ]"
- deviceArray[$count]=$i
+ deviceArray[$count]=$dbyid
deviceDSize[$count]=$dsize
count=`expr $count + 1`
fi
@@ -219,16 +226,15 @@
hd="\"$TEXT_SELECT\""
count=0
for i in $deviceDisks;do
- dsize=`partitionSize $i`
+ dbyid=$(getDiskID $i)
+ dsize=`partitionSize $dbyid`
dsizeMB=`expr $dsize / 1024`
if [ "$dsizeMB" -gt 0 ];then
- dname=`getDiskID $i`
- dname=`basename $dname | cut -c1-20`"..."
if [ $count = 0 ];then
- dpara="$i \"$dname [ $dsizeMB MB ]\" on"
+ dpara="$dbyid \"[ $dsizeMB MB ]\" on"
count=1
else
- dpara="$dpara $i \"$dname [ $dsizeMB MB ]\" off"
+ dpara="$dpara $dbyid \"[ $dsizeMB MB ]\" off"
fi
fi
done
@@ -283,6 +289,15 @@
info=/tmp/partinfo
wmrc=/wmrc
loop=$(losetup -s -f $imageName)
+ if [ $? != 0 ];then
+ # /.../
+ # old version of losetup doesn't know about
+ # the --find option therefore we set a fixed
+ # loop device name and setup this
+ # ----
+ loop=/dev/loop1
+ losetup $loop $imageName
+ fi
loop=$(echo $loop | sed -e s@^/dev/@@)
if ! kpartx -a /dev/$loop;then
systemException \
@@ -369,7 +384,6 @@
usr/bin/dialog \
usr/bin/xinit \
usr/bin/xterm \
- usr/bin/dialog \
usr/bin/icewm
do
if [ ! -e $OEMRootSystem/$i ];then
@@ -428,7 +442,8 @@
pname=`echo $partitions | cut -f1 -d:`
imageDevice=$pname
rID=$(nd $pname)
- instItems[0]=$imageName:$imageDevice
+ instItems[0]=$imageName
+ instPaths[0]=$imageDevice
else
#======================================
# There is a choice, let the user do it
@@ -482,19 +497,26 @@
if [ $p = /dev/mapper/${loop}p1 ];then
imageDevice=$selectedPart
bID=$(nd $selectedPart)
- instItems[0]=/dev/mapper/${loop}p1:$imageDevice
+ instItems[0]=/dev/mapper/${loop}p1
+ instPaths[0]=$imageDevice
elif [ $p = /dev/mapper/${loop}p2 ];then
rID=$(nd $selectedPart)
- instItems[1]=/dev/mapper/${loop}p2:$selectedPart
+ instItems[1]=/dev/mapper/${loop}p2
+ instPaths[1]=$selectedPart
fi
done
# /.../
- # reverse order of instItems because
- # root partition must be first entry
+ # reverse order of instItems and instPaths because
+ # the root partition must be the first entry
# ----
+ # instItems
instItems_tmp=${instItems[0]}
instItems[0]=${instItems[1]}
instItems[1]=$instItems_tmp
+ # instPaths
+ instPaths_tmp=${instPaths[0]}
+ instPaths[0]=${instPaths[1]}
+ instPaths[1]=$instPaths_tmp
fi
#======================================
# Search for a swap space
@@ -523,7 +545,8 @@
setupDeviceNames $rID $sID no $bID no
fi
else
- instItems[0]=$imageName:$imageDevice
+ instItems[0]=$imageName
+ instPaths[0]=$imageDevice
fi
#======================================
# Checks and MD5 sums...
@@ -555,13 +578,13 @@
#--------------------------------------
if [ ! -z "$pxe" ];then
multicast="disable"
- fetchFile $imageMD5 /image.md5 uncompressed $imageServer
+ fetchFile $imageMD5 /etc/image.md5 uncompressed $imageServer
if test $loadCode != 0 || ! loadOK "$loadStatus";then
systemException \
"Download of $imageMD5 failed: $loadStatus" \
"reboot"
fi
- imageMD5=/image.md5
+ imageMD5=/etc/image.md5
fi
fi
#======================================
@@ -571,16 +594,15 @@
#======================================
# Warn me before performing the install
#--------------------------------------
- for i in ${instItems[*]}; do
- Target=$(echo $i | cut -f2 -d:)
- items="$items,$Target"
+ for i in ${instPaths[*]}; do
+ items="$items,$i"
done
items=$(echo $items | sed -e s@^,@@)
Echo "Entering installation mode for disk: $items"
if [ -z "$kiwi_oemunattended" ];then
TEXT_INST=$(
getText "Destroying ALL data on %1, continue ?" $items)
- Dialog --yesno "\"$TEXT_INST\"" 5 70
+ Dialog --yesno "\"$TEXT_INST\"" 5 80
if [ ! $? = 0 ];then
systemException \
"System installation canceled" \
@@ -588,14 +610,19 @@
fi
fi
clear
- for i in ${instItems[*]};do
+ instIndex=0
+ while [ $instIndex -lt ${#instItems[*]} ];do
#======================================
# Setup source and target data
#--------------------------------------
- Source=$(echo $i | cut -f1 -d:)
- Target=$(echo $i | cut -f2 -d:)
+ Source=${instItems[$instIndex]}
+ Target=${instPaths[$instIndex]}
if [ -z "$OEM_PARTITION_INSTALL" ];then
- read sum1 blocks blocksize zblocks zblocksize < $imageMD5
+ if ! read sum1 blocks blocksize zblocks zblocksize < $imageMD5;then
+ systemException \
+ "Reading of $imageMD5 failed" \
+ "reboot"
+ fi
else
blocksize=4096
partKB=$(partitionSize $Source)
@@ -652,15 +679,18 @@
"reboot"
fi
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
else
if ! eval $dump | dd bs=32k of=$Target &>/dev/null; then
@@ -682,6 +712,7 @@
"reboot"
fi
fi
+ instIndex=$((instIndex + 1))
done
#======================================
# Clear loops if required
@@ -708,15 +739,18 @@
eval $dump 2>/progress |\
head --bytes=$verifyBytes | md5sum - > /etc/ireal.md5
)&
+ dump_pid=$!
echo "cat /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 65
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
errorLogContinue
else
@@ -749,6 +783,9 @@
#--------------------------------------
if [ -z "$OEM_PARTITION_INSTALL" ];then
blockdev --rereadpt $imageDevice
+ if echo $imageDevice | grep -q "^\/dev\/ram";then
+ kpartx -a $imageDevice
+ fi
deviceTest=$(ddn $imageDevice 1)
if ! waitForStorageDevice $deviceTest;then
systemException \
@@ -806,15 +843,18 @@
dPID=$(pidof mst)
kill $dPID
)&
+ dump_pid=$!
echo "mst -f /progress | dialog \
--backtitle \"$TEXT_INSTALLTITLE\" \
--progressbox 3 50
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
popd &>/dev/null
clear
else
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/oemboot/suse-linuxrc
^
|
@@ -119,7 +119,8 @@
# Check for LUKS extension on root fs
#--------------------------------------
if [ "$FSTYPE" = "luks" ];then
- imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
probeFileSystem $imageRootDevice
export haveLuks=yes
fi
@@ -214,23 +215,30 @@
# 9) Search boot device...
#--------------------------------------
if [ -z "$pxe" ];then
- Echo "Searching for boot device..."
- if [ "$LOCAL_BOOT" = "no" ];then
- searchBIOSBootDevice
- if [ ! -e "$biosBootDevice" ];then
- searchBusIDBootDevice
- fi
- if [ ! -e "$biosBootDevice" ];then
- systemException "$biosBootDevice" "reboot"
- fi
- export imageDiskDevice=$biosBootDevice
+ if [ ! -z "$cdinst" ];then
+ biosBootDevice=/dev/cdrom
else
- export imageDiskDevice=$(dn $disk)
- if [ ! -z "$KIWI_RECOVERY" ];then
- export imageRecoveryDevice=$(ddn $imageDiskDevice $KIWI_RECOVERY)
+ Echo "Searching for boot device..."
+ if [ "$LOCAL_BOOT" = "no" ];then
+ searchBIOSBootDevice
+ if [ ! -e "$biosBootDevice" ];then
+ searchBusIDBootDevice
+ fi
+ if [ ! -e "$biosBootDevice" ];then
+ systemException "$biosBootDevice" "reboot"
+ fi
+ export imageDiskDevice=$biosBootDevice
+ else
+ waitForStorageDevice $disk
+ export imageDiskDevice=$(dn $disk)
+ if [ ! -z "$KIWI_RECOVERY" ];then
+ export imageRecoveryDevice=$(
+ ddn $imageDiskDevice $KIWI_RECOVERY
+ )
+ fi
fi
+ Echo "Found boot device: $imageDiskDevice"
fi
- Echo "Found boot device: $imageDiskDevice"
fi
#======================================
@@ -278,6 +286,9 @@
probeFileSystem $deviceResize
export KIWI_INITRD_PARAMS
fi
+ if [ "$haveLVM" = "yes" ] && [ ! -z "$allFreeVolume" ];then
+ deviceResize=/dev/$VGROUP/$allFreeVolume
+ fi
if [ ! -z "$deviceResize" ] && partitionSize $deviceResize &>/dev/null;then
if [ ! -z "$OEM_RECOVERY" ];then
KIWI_INITRD_PARAMS="$KIWI_INITRD_PARAMS LOCAL_BOOT=yes"
@@ -465,15 +476,18 @@
dPID=$(pidof mst)
kill $dPID
)&
+ dump_pid=$!
echo "mst -f /progress | dialog \
--backtitle \"$TEXT_RECOVERYTITLE\" \
--progressbox 3 50
" > /tmp/progress.sh
if [ -e /dev/fb0 ];then
- fbiterm -m $UFONT -- bash -e /tmp/progress.sh
+ fbiterm -m $UFONT -- bash -e /tmp/progress.sh || \
+ bash -e /tmp/progress.sh
else
bash -e /tmp/progress.sh
fi
+ wait $dump_pid
clear
#======================================
# 16.4) restore temporary stored files
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/oemboot/suse-preinit
^
|
@@ -137,12 +137,17 @@
setupConsole
#======================================
-# 12) Run user script
+# 12) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 13) Run user script
#--------------------------------------
runHook preCallInit
#======================================
-# 13) kill udev
+# 14) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/oemboot/suse-repart
^
|
@@ -374,6 +374,13 @@
recoParam=no
swapParam=no
#======================================
+ # setup all free volume name
+ #--------------------------------------
+ allFreeVolume=LVRoot
+ if [ ! -z "$kiwi_allFreeVolume" ];then
+ allFreeVolume=$kiwi_allFreeVolume
+ fi
+ #======================================
# close open device mappings
#--------------------------------------
if [ "$haveLuks" = "yes" ];then
@@ -424,12 +431,12 @@
swapParam=yes
fi
#======================================
- # Extend LVRoot...
+ # Extend all free volume...
#--------------------------------------
if [ -z "$OEM_SYSTEMSIZE" ];then
- lvextend -l +100%FREE /dev/$VGROUP/LVRoot
+ lvextend -l +100%FREE /dev/$VGROUP/$allFreeVolume
else
- lvextend --size $OEM_SYSTEMSIZE"M" /dev/$VGROUP/LVRoot
+ lvextend --size $OEM_SYSTEMSIZE"M" /dev/$VGROUP/$allFreeVolume
fi
#======================================
# setup new device names
@@ -801,9 +808,11 @@
# createLuksMaps
#--------------------------------------
function createLuksMaps {
- export imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ export imageRootDevice=$luksDeviceOpened
if isFSTypeReadOnly;then
- export imageIOWRDevice=$(luksOpen $imageIOWRDevice luksReadWrite)
+ luksOpen $imageIOWRDevice luksReadWrite
+ export imageIOWRDevice=$luksDeviceOpened
export imageRWDevice=$imageIOWRDevice
export imageRODevice=$imageRootDevice
fi
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/vmxboot/suse-SLES11/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="initrd-vmxboot-suse-SLES11">
+<image schemaversion="5.3" name="initrd-vmxboot-suse-SLES11">
<description type="boot">
<author>Marcus Schaefer</author>
<contact>ms@novell.com</contact>
@@ -46,8 +46,8 @@
<repository type="yast2" status="replaceable">
<source path="http://download.suse.de/install/SLP/SLES-11-SP1-GM/%arch/DVD1/"/>
</repository>
- <repository type="rpm-md" status="fixed">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle11-repo"/>
+ <repository type="yast2" status="fixed">
+ <source path="http://download.suse.de/install/SLP/SLE-11-SP2-SDK-LATEST/%arch/DVD1"/>
</repository>
<packages type="image" profiles="std">
<package name="kernel-default"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/vmxboot/suse-linuxrc
^
|
@@ -136,6 +136,7 @@
fi
export imageDiskDevice=$biosBootDevice
else
+ waitForStorageDevice $disk
export imageDiskDevice=$(dn $disk)
fi
Echo "Found boot device: $imageDiskDevice"
@@ -174,7 +175,8 @@
#--------------------------------------
probeFileSystem $imageRootDevice
if [ "$FSTYPE" = "luks" ];then
- imageRootDevice=$(luksOpen $imageRootDevice)
+ luksOpen $imageRootDevice
+ imageRootDevice=$luksDeviceOpened
imageRODevice=$imageRootDevice
probeFileSystem $imageRootDevice
export haveLuks=yes
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/system/boot/s390/vmxboot/suse-preinit
^
|
@@ -97,7 +97,12 @@
setupConsole
#======================================
-# 11) kill udev
+# 11) create origin snapshot if possible
+#--------------------------------------
+createOriginSnapshot
+
+#======================================
+# 12) kill udev
#--------------------------------------
udevSystemStop
umountSystemFilesystems
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-RHEL-05.4">
+<image schemaversion="5.3" name="LimeJeOS-RHEL-05.4">
<description type="system">
<author>Marcus Schäfer</author>
<contact>ms@novell.com</contact>
@@ -15,7 +15,16 @@
<timezone>Europe/Berlin</timezone>
<hwclock>utc</hwclock>
<rpm-check-signatures>false</rpm-check-signatures>
- <type image="iso" boot="isoboot/rhel-05.4" flags="clic"/>
+ <type image="iso" primary="true" boot="isoboot/rhel-05.4" flags="clic"/>
+ <type image="vmx" boot="vmxboot/rhel-05.4" filesystem="ext3" format="vmdk" kernelcmdline="rhgb">
+ <machine memory="1024" guestOS="rhel5">
+ <vmdisk controller="scsi" id="0"/>
+ <vmnic driver="e1000" interface="0" mode="bridged"/>
+ </machine>
+ <systemdisk name="Vgroup1">
+ <volume name="home" freespace="200M"/>
+ </systemdisk>
+ </type>
</preferences>
<users group="root">
<user pwd="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root"/>
@@ -24,7 +33,7 @@
<source path="iso:///image/CDs/RHEL-5.4-%arch-DVD.iso/Server"/>
</repository>
<repository type="rpm-md">
- <source path="/usr/share/kiwi/repo/rhel-repo/rhel-054-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/rhel-054/RedHat_RHEL-5"/>
</repository>
<packages type="image">
<package name="grub"/>
@@ -36,9 +45,13 @@
<package name="selinux-policy-devel"/>
<package name="libselinux-utils"/>
<package name="dhclient"/>
+ <package name="parted"/>
+ <package name="lvm2"/>
+ <package name="kernel"/>
<rhelGroup name="System Tools"/>
<rhelGroup name="Text-based Internet"/>
<package name="gfxboot-branding-upstream" bootinclude="true" bootdelete="true"/>
+ <package name="redhat-logos" bootinclude="true" bootdelete="true"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
|
[-]
[+]
|
Added |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/root/etc/login.defs
^
|
@@ -0,0 +1,59 @@
+# *REQUIRED*
+# Directory where mailboxes reside, _or_ name of file, relative to the
+# home directory. If you _do_ define both, MAIL_DIR takes precedence.
+# QMAIL_DIR is for Qmail
+#
+#QMAIL_DIR Maildir
+MAIL_DIR /var/spool/mail
+#MAIL_FILE .mail
+
+# Password aging controls:
+#
+# PASS_MAX_DAYS Maximum number of days a password may be used.
+# PASS_MIN_DAYS Minimum number of days allowed between password changes.
+# PASS_MIN_LEN Minimum acceptable password length.
+# PASS_WARN_AGE Number of days warning given before a password expires.
+#
+PASS_MAX_DAYS 99999
+PASS_MIN_DAYS 0
+PASS_MIN_LEN 5
+PASS_WARN_AGE 7
+
+#
+# Min/max values for automatic uid selection in useradd
+#
+UID_MIN 500
+UID_MAX 60000
+
+#
+# Min/max values for automatic gid selection in groupadd
+#
+GID_MIN 500
+GID_MAX 60000
+
+#
+# If defined, this command is run when removing a user.
+# It should remove any at/cron/print jobs etc. owned by
+# the user to be removed (passed as the first argument).
+#
+#USERDEL_CMD /usr/sbin/userdel_local
+
+#
+# If useradd should create home directories for users by default
+# On RH systems, we do. This option is overridden with the -m flag on
+# useradd command line.
+#
+CREATE_HOME yes
+
+# The permission mask is initialized to this value. If not specified,
+# the permission mask will be initialized to 022.
+UMASK 077
+
+# This enables userdel to remove user groups if no members exist.
+#
+USERGROUPS_ENAB yes
+
+# Use MD5 or DES to encrypt password? Red Hat use MD5 by default.
+MD5_CRYPT_ENAB yes
+
+ENCRYPT_METHOD MD5
|
[-]
[+]
|
Added |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/root/etc/selinux
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/root/etc/selinux/config
^
|
@@ -0,0 +1,16 @@
+
+# This file controls the state of SELinux on the system.
+# SELINUX= can take one of these three values:
+# enforcing - SELinux security policy is enforced.
+# permissive - SELinux prints warnings instead of enforcing.
+# disabled - No SELinux policy is loaded.
+SELINUX=permissive
+# SELINUXTYPE= can take one of these two values:
+# targeted - Only targeted network daemons are protected.
+# strict - Full SELinux protection.
+# mls - Multi Level Security protection.
+SELINUXTYPE=targeted
+# SETLOCALDEFS= Check local definition changes
+SETLOCALDEFS=0
+
+
|
[-]
[+]
|
Added |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/root/etc/sysconfig
^
|
+(directory)
|
[-]
[+]
|
Added |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/root/etc/sysconfig/authconfig
^
|
@@ -0,0 +1,19 @@
+USEWINBINDAUTH=no
+USEHESIOD=no
+USESYSNETAUTH=no
+USEPAMACCESS=no
+USEKERBEROS=no
+FORCESMARTCARD=no
+USESMBAUTH=no
+USESMARTCARD=no
+USELDAPAUTH=no
+PASSWDALGORITHM=md5
+USEWINBIND=no
+USESHADOW=yes
+USEDB=no
+USEPASSWDQC=no
+USELOCAUTHORIZE=yes
+USEMKHOMEDIR=no
+USELDAP=no
+USECRACKLIB=yes
+USENIS=no
|
[-]
[+]
|
Added |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/root/etc/sysconfig/network
^
|
@@ -0,0 +1,3 @@
+NETWORKING=yes
+NETWORKING_IPV6=no
+HOSTNAME=localhost.localdomain
|
|
Changed |
kiwi.tar.bz2/template/ix86/rhel-05.4-JeOS/root/fastboot
^
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/ix86/suse-11.3-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-openSUSE-11.3">
+<image schemaversion="5.3" name="LimeJeOS-openSUSE-11.3">
<description type="system">
<author>Marcus Schäfer</author>
<contact>ms@novell.com</contact>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/ix86/suse-11.4-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-openSUSE-11.4">
+<image schemaversion="5.3" name="LimeJeOS-openSUSE-11.4">
<description type="system">
<author>Marcus Schäfer</author>
<contact>ms@novell.com</contact>
@@ -62,6 +62,9 @@
<repository type="yast2">
<source path="opensuse://11.4/repo/oss"/>
</repository>
+ <repository type="rpm-md">
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-11.4/openSUSE_11.4"/>
+ </repository>
<packages type="image">
<package name="bootsplash-branding-openSUSE" bootinclude="true" bootdelete="true"/>
<package name="gfxboot-branding-openSUSE" bootinclude="true" bootdelete="true"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/ix86/suse-12.1-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-openSUSE-12.1">
+<image schemaversion="5.3" name="LimeJeOS-openSUSE-12.1">
<description type="system">
<author>Marcus Schäfer</author>
<contact>ms@novell.com</contact>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/ix86/suse-SLE10-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-SLE10">
+<image schemaversion="5.3" name="LimeJeOS-SLE10">
<description type="system">
<author>Christoph Thiel</author>
<contact>cthiel@novell.com</contact>
@@ -68,7 +68,7 @@
<source path="obs:///SUSE:SLE-10-SP2:GA/standard"/>
</repository>
<repository type="rpm-md">
- <source path="/usr/share/kiwi/repo/suse-repo/suse-sle10-repo"/>
+ <source path="http://download.opensuse.org/repositories/Virtualization:/Appliances:/suse-sle10/SLE_10_SDK"/>
</repository>
<packages type="bootstrap">
<package name="aaa_base"/>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/ix86/suse-SLE11-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-SLE11">
+<image schemaversion="5.3" name="LimeJeOS-SLE11">
<description type="system">
<author>Christoph Thiel</author>
<contact>cthiel@novell.com</contact>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/ppc/suse-SLE11-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-SLE11">
+<image schemaversion="5.3" name="LimeJeOS-SLE11">
<description type="system">
<author>Marcus Schaefer</author>
<contact>cthiel@novell.com</contact>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/template/s390/suse-SLE11-JeOS/config.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<image schemaversion="5.2" name="LimeJeOS-SLE11">
+<image schemaversion="5.3" name="LimeJeOS-SLE11">
<description type="system">
<author>Marcus Schaefer</author>
<contact>cthiel@novell.com</contact>
@@ -16,6 +16,7 @@
<timezone>Europe/Berlin</timezone>
<hwclock>utc</hwclock>
<type image="vmx" filesystem="ext3" boot="vmxboot/suse-SLES11" bootloader="zipl" primary="true"/>
+ <type image="pxe" filesystem="ext3" boot="netboot/suse-SLES11" bootloader="zipl"/>
</preferences>
<users group="root">
<user pwd="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root"/>
|
[-]
[+]
|
Deleted |
kiwi.tar.bz2/template/s390/suse-SLE11-JeOS/root/etc/init.d/kiwi/virtio
^
|
-(directory)
|
[-]
[+]
|
Deleted |
kiwi.tar.bz2/template/s390/suse-SLE11-JeOS/root/etc/init.d/kiwi/virtio/01-console.sh
^
|
@@ -1,5 +0,0 @@
-#!/bin/bash
-# hvc console setup for KVM guest
-# ----
-cp /etc/init.d/kiwi/virtio/inittab /etc
-cp /etc/init.d/kiwi/virtio/securetty /etc
|
[-]
[+]
|
Deleted |
kiwi.tar.bz2/template/s390/suse-SLE11-JeOS/root/etc/init.d/kiwi/virtio/inittab
^
|
@@ -1,66 +0,0 @@
-#
-# /etc/inittab
-#
-# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany. All rights reserved.
-#
-# Author: Florian La Roche, 1996
-# Please send feedback to http://www.suse.de/feedback
-#
-# This is the main configuration file of /sbin/init, which
-# is executed by the kernel on startup. It describes what
-# scripts are used for the different run-levels.
-#
-# All scripts for runlevel changes are in /etc/init.d/.
-#
-# This file may be modified by SuSEconfig unless CHECK_INITTAB
-# in /etc/sysconfig/suseconfig is set to "no"
-#
-
-# The default runlevel is defined here
-id:3:initdefault:
-
-# First script to be executed, if not booting in emergency (-b) mode
-si::bootwait:/etc/init.d/boot
-
-# /etc/init.d/rc takes care of runlevel handling
-#
-# runlevel 0 is System halt (Do not use this for initdefault!)
-# runlevel 1 is Single user mode
-# runlevel 2 is Local multiuser without remote network (e.g. NFS)
-# runlevel 3 is Full multiuser with network
-# runlevel 4 is Not used
-# runlevel 5 is Full multiuser with network and xdm
-# runlevel 6 is System reboot (Do not use this for initdefault!)
-#
-l0:0:wait:/etc/init.d/rc 0
-l1:1:wait:/etc/init.d/rc 1
-l2:2:wait:/etc/init.d/rc 2
-l3:3:wait:/etc/init.d/rc 3
-#l4:4:wait:/etc/init.d/rc 4
-l5:5:wait:/etc/init.d/rc 5
-l6:6:wait:/etc/init.d/rc 6
-
-# what to do in single-user mode
-ls:S:wait:/etc/init.d/rc S
-~~:S:respawn:/sbin/sulogin
-
-# Default HMC/3215/3270 console:
-#1:2345:respawn:/sbin/mingetty --noclear /dev/ttyS0 dumb
-# VT220(Linux) console:
-#2:2345:respawn:/sbin/mingetty --noclear /dev/ttyS1 xterm
-# additional 3270 terminals:
-#3:2345:respawn:/sbin/mingetty --noclear /dev/3270/ttycons dumb
-# KVM hypervisor console:
-1:2345:respawn:/sbin/mingetty --noclear /dev/hvc0 linux
-
-# what to do when CTRL-ALT-DEL is pressed
-ca::ctrlaltdel:/sbin/shutdown -r -t 4 now
-
-# not used for now:
-pf::powerwait:/etc/init.d/powerfail start
-pn::powerfailnow:/etc/init.d/powerfail now
-#pn::powerfail:/etc/init.d/powerfail now
-po::powerokwait:/etc/init.d/powerfail stop
-sh:12345:powerfail:/sbin/shutdown -h now THE POWER IS FAILING
-
-# end of /etc/inittab
|
[-]
[+]
|
Deleted |
kiwi.tar.bz2/template/s390/suse-SLE11-JeOS/root/etc/init.d/kiwi/virtio/securetty
^
|
@@ -1,13 +0,0 @@
-#
-# This file contains the device names of tty lines (one per line,
-# without leading /dev/) on which root is allowed to login.
-#
-tty1
-tty2
-tty3
-tty4
-tty5
-tty6
-ttyS0
-ttyS1
-hvc0
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/tests/unit/KIWILocator.t
^
|
@@ -4,7 +4,7 @@
# PROJECT : OpenSUSE Build-Service
# COPYRIGHT : (c) 2011 Novell Inc.
# :
-# AUTHOR : Robert Schweikert <rschweikert@novell.com>
+# AUTHOR : Robert Schweikert <rjschwei@suse.com>
# :
# BELONGS TO : Operating System images
# :
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/tests/unit/lib/Common/ktLog.pm
^
|
@@ -4,7 +4,7 @@
# PROJECT : OpenSUSE Build-Service
# COPYRIGHT : (c) 2011 Novell Inc.
# :
-# AUTHOR : Robert Schweikert <rschweikert@novell.com>
+# AUTHOR : Robert Schweikert <rjschwei@suse.com>
# :
# BELONGS TO : Operating System images
# :
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/tests/unit/lib/Test/kiwiLocator.pm
^
|
@@ -4,7 +4,7 @@
# PROJECT : OpenSUSE Build-Service
# COPYRIGHT : (c) 2011 Novell Inc.
# :
-# AUTHOR : Robert Schweikert <rschweikert@novell.com>
+# AUTHOR : Robert Schweikert <rjschwei@suse.com>
# :
# BELONGS TO : Operating System images
# :
@@ -21,6 +21,7 @@
use Common::ktTestCase;
use base qw /Common::ktTestCase/;
+use KIWICommandLine;
use KIWILocator;
#==========================================
@@ -59,6 +60,129 @@
}
#==========================================
+# test_createTmpDirInTmp
+#------------------------------------------
+sub test_createTmpDirInTmp {
+ # ...
+ # Test the createTmpDirectory method for the most simplistic case
+ # where a temporary directory is created in /tmp, i.e. there is
+ # no preset root directory.
+ # ---
+ my $this = shift;
+ my $kiwi = $this -> {kiwi};
+ my $locator = $this -> __getLocator();
+ my $cmdL = $this -> __getCommandLine();
+ $cmdL -> setForceNewRoot(0);
+ my $newTmpDir = $locator -> createTmpDirectory( undef, undef, $cmdL);
+ my $msg = $kiwi -> getMessage();
+ $this -> assert_str_equals('No messages set', $msg);
+ my $msgT = $kiwi -> getMessageType();
+ $this -> assert_str_equals('none', $msgT);
+ my $state = $kiwi -> getState();
+ $this -> assert_str_equals('No state set', $state);
+ if (! -d $newTmpDir) {
+ my $err = 'Temp dir "' . $newTmpDir . '" was reported to be created,';
+ $err .= ' but does not exists';
+ $this -> assert_null($err);
+ }
+ rmdir $newTmpDir;
+}
+
+#==========================================
+# test_createTmpDirSpecifiedDir
+#------------------------------------------
+sub test_createTmpDirSpecifiedDir {
+ # ...
+ # Test the createTmpDirectory method using a specified directory
+ # ---
+ my $this = shift;
+ my $kiwi = $this -> {kiwi};
+ my $locator = $this -> __getLocator();
+ my $cmdL = $this -> __getCommandLine();
+ $cmdL -> setForceNewRoot(0);
+ my $tmpDir = $this -> createTestTmpDir();
+ my $newTmpDir = $locator -> createTmpDirectory( undef, $tmpDir, $cmdL);
+ my $msg = $kiwi -> getMessage();
+ $this -> assert_str_equals('No messages set', $msg);
+ my $msgT = $kiwi -> getMessageType();
+ $this -> assert_str_equals('none', $msgT);
+ my $state = $kiwi -> getState();
+ $this -> assert_str_equals('No state set', $state);
+ $this -> assert_str_equals($tmpDir, $newTmpDir);
+ if (! -d $tmpDir) {
+ my $err = 'Temp dir "' . $tmpDir . '" was reported to be created,';
+ $err .= ' but does not exists';
+ $this -> assert_null($err);
+ }
+ $this -> removeTestTmpDir();
+}
+
+#==========================================
+# test_createTmpDirSpecifiedDirForceOK
+#------------------------------------------
+sub test_createTmpDirSpecifiedDirOK {
+ # ...
+ # Test the createTmpDirectory method using a specified directory
+ # that is not empty but is OK to be removed
+ # ---
+ my $this = shift;
+ my $kiwi = $this -> {kiwi};
+ my $locator = $this -> __getLocator();
+ my $cmdL = $this -> __getCommandLine();
+ $cmdL -> setForceNewRoot(1);
+ my $tmpDir = $this -> createTestTmpDir();
+ mkdir "$tmpDir/kiwi";
+ my $newTmpDir = $locator -> createTmpDirectory( undef, $tmpDir, $cmdL);
+ my $msg = $kiwi -> getMessage();
+ my $expected = "Removing old root directory '$tmpDir'";
+ $this -> assert_str_equals($expected, $msg);
+ my $msgT = $kiwi -> getMessageType();
+ $this -> assert_str_equals('info', $msgT);
+ my $state = $kiwi -> getState();
+ $this -> assert_str_equals('completed', $state);
+ $this -> assert_str_equals($tmpDir, $newTmpDir);
+ if (! -d $tmpDir) {
+ my $err = 'Temp dir "' . $tmpDir . '" was reported to be created,';
+ $err .= ' but does not exists';
+ $this -> assert_null($err);
+ }
+ rmdir "$tmpDir/kiwi";
+ $this -> removeTestTmpDir();
+}
+
+#==========================================
+# test_createTmpDirSpecifiedDirForceNotOK
+#------------------------------------------
+sub test_createTmpDirSpecifiedDirNotOK {
+ # ...
+ # Test the createTmpDirectory method using a specified directory
+ # that is not empty and is not OK to be removed, i.e. it contains
+ # base-system sub directory
+ # ---
+ my $this = shift;
+ my $kiwi = $this -> {kiwi};
+ my $locator = $this -> __getLocator();
+ my $cmdL = $this -> __getCommandLine();
+ $cmdL -> setForceNewRoot(1);
+ my $tmpDir = $this -> createTestTmpDir();
+ mkdir "$tmpDir/base-system";
+ my $newTmpDir = $locator -> createTmpDirectory( undef, $tmpDir, $cmdL);
+ my $infoMsg = $kiwi -> getInfoMessage();
+ my $expected = "Removing old root directory '$tmpDir'";
+ $this -> assert_str_equals($expected, $infoMsg);
+ my $errMsg = $kiwi -> getErrorMessage();
+ $expected = "Mount point '$tmpDir/base-system' exists";
+ $this -> assert_str_equals($expected, $errMsg);
+ my $msgT = $kiwi -> getMessageType();
+ $this -> assert_str_equals('error', $msgT);
+ my $state = $kiwi -> getState();
+ $this -> assert_str_equals('failed', $state);
+ $this -> assert_null($newTmpDir);
+ rmdir "$tmpDir/base-system";
+ $this -> removeTestTmpDir();
+}
+
+#==========================================
# test_getControlFileMultiConfig
#------------------------------------------
sub test_getControlFileMultiConfig {
@@ -256,6 +380,18 @@
#==========================================
# __getLocator
#------------------------------------------
+sub __getCommandLine {
+ # ...
+ # Helper method to create a KIWICommandLine object
+ # ---
+ my $this = shift;
+ my $cmdL = new KIWICommandLine ( $this -> {kiwi} );
+ return $cmdL;
+}
+
+#==========================================
+# __getLocator
+#------------------------------------------
sub __getLocator {
# ...
# Helper method to create a KIWILocator object
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/tests/unit/lib/Test/kiwiRuntimeChecker.pm
^
|
@@ -123,8 +123,10 @@
my $kiwi = $this -> {kiwi};
my @profiles = ('my-first','my-second');
my $cmd = $this -> __getCommandLineObj();
+ my $configDir = $this -> {dataDir} . '/haveDefaultPkgs';
+ $cmd -> setConfigDir ($configDir);
$cmd -> setBuildProfiles(\@profiles);
- my $xml = $this -> __getXMLObj( $this -> {dataDir} . '/haveDefaultPkgs' );
+ my $xml = $this -> __getXMLObj( $configDir );
my $checker = new KIWIRuntimeChecker($kiwi, $cmd, $xml);
my $res = $checker -> prepareChecks();
my $msg = $kiwi -> getMessage();
@@ -393,7 +395,9 @@
my $this = shift;
my $kiwi = $this -> {kiwi};
my $cmd = $this -> __getCommandLineObj();
- my $xml = $this -> __getXMLObj( $this -> {dataDir} );
+ my $configDir = $this -> {dataDir} . '/liveIsoImg/clic';
+ $cmd -> setConfigDir ($configDir);
+ my $xml = $this -> __getXMLObj( $configDir );
my $checker = new KIWIRuntimeChecker($kiwi, $cmd, $xml);
my $res = $checker -> prepareChecks();
my $msg = $kiwi -> getMessage();
@@ -437,7 +441,7 @@
}
#==========================================
-# test_packageManagerCheck
+# test_packageManagerCheck_ens
#------------------------------------------
sub test_packageManagerCheck_ens {
# ...
@@ -447,10 +451,12 @@
my $this = shift;
my $kiwi = $this -> {kiwi};
my $cmd = $this -> __getCommandLineObj();
+ my $configDir = $this -> {dataDir} . '/liveIsoImg/clic';
+ $cmd -> setConfigDir ($configDir);
# Select manager least likely to be present we want this part of
# the test to simulate a failure condition
$cmd -> setPackageManager('ensconce');
- my $xml = $this -> __getXMLObj( $this -> {dataDir} );
+ my $xml = $this -> __getXMLObj( $configDir );
$xml -> setPackageManager('ensconce');
my $checker = new KIWIRuntimeChecker($kiwi, $cmd, $xml);
my $res = $checker -> prepareChecks();
@@ -481,7 +487,7 @@
}
#==========================================
-# test_packageManagerCheck_ens
+# test_packageManagerCheck_zypp
#------------------------------------------
sub test_packageManagerCheck_zypp {
# ...
@@ -491,9 +497,11 @@
my $this = shift;
my $kiwi = $this -> {kiwi};
my $cmd = $this -> __getCommandLineObj();
+ my $configDir = $this -> {dataDir} . '/liveIsoImg/clic';
+ $cmd -> setConfigDir ($configDir);
# Test the most likely use case, zypper set as package manager in
# config.xml, this test should succeed
- my $xml = $this -> __getXMLObj( $this -> {dataDir} );
+ my $xml = $this -> __getXMLObj( $configDir );
my $checker = new KIWIRuntimeChecker($kiwi, $cmd, $xml);
my $res = $checker -> prepareChecks();
@@ -538,8 +546,10 @@
my $kiwi = $this -> {kiwi};
my @profiles = ('my-first');
my $cmd = $this -> __getCommandLineObj();
+ my $configDir = $this -> {dataDir} . '/liveIsoImg/clic';
+ $cmd -> setConfigDir ($configDir);
$cmd -> setBuildProfiles(\@profiles);
- my $xml = $this -> __getXMLObj( $this -> {dataDir} );
+ my $xml = $this -> __getXMLObj( $configDir );
my $checker = new KIWIRuntimeChecker($kiwi, $cmd, $xml);
my $res = $checker -> prepareChecks();
my $msg = $kiwi -> getMessage();
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/tests/unit/lib/Test/kiwiXMLInfo.pm
^
|
@@ -145,6 +145,8 @@
$this -> assert_str_equals($expectedMsg, $errMsg);
my $msg = $kiwi -> getMessage();
$expectedMsg = "Choose between the following:\n"
+ . "--> archives :List of tar archives to be installed\n"
+ . "--> overlay-files :List of files in root overlay\n"
. "--> packages :List of packages to be installed\n"
. "--> patterns :List configured patterns\n"
. "--> profiles :List profiles\n"
@@ -211,7 +213,7 @@
my $info = $this -> __getInfoObj($cmd);
my @requests = ('packages');
my $tree = $info -> getXMLInfoTree(\@requests);
- my $expectedMsg = '<imagescan><package name="kiwi-test-dummy" '
+ my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><package name="kiwi-test-dummy" '
. 'arch="noarch" version="0.0.1-1"/></imagescan>';
$this -> assert_str_equals($expectedMsg, $tree -> toString());
$this -> assert_not_null($tree);
@@ -274,6 +276,8 @@
$this -> assert_str_equals($expectedMsg, $errMsg);
my $msg = $kiwi -> getMessage();
$expectedMsg = "Choose between the following:\n"
+ . "--> archives :List of tar archives to be installed\n"
+ . "--> overlay-files :List of files in root overlay\n"
. "--> packages :List of packages to be installed\n"
. "--> patterns :List configured patterns\n"
. "--> profiles :List profiles\n"
@@ -326,7 +330,7 @@
my $info = $this -> __getInfoObj($cmd);
my @requests = ('profiles');
my $tree = $info -> getXMLInfoTree(\@requests);
- my $expectedMsg = '<imagescan><profile name="first" description="a '
+ my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><profile name="first" description="a '
. 'profile"/><profile name="second" description="another profile"/>'
. '</imagescan>';
$this -> assert_not_null($tree);
@@ -353,7 +357,7 @@
my $info = $this -> __getInfoObj($cmd);
my @requests = ('types');
my $tree = $info -> getXMLInfoTree(\@requests);
- my $expectedMsg = '<imagescan><type name="iso" primary="true" '
+ my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><type name="iso" primary="true" '
. 'boot="isoboot/suse-11.4"/><type name="oem" primary="false" '
. 'boot="oemboot/suse-11.4"/><type name="xfs" primary="false"/>'
. '</imagescan>';
@@ -395,7 +399,7 @@
my $info = $this -> __getInfoObj($cmd);
my @requests = ('size');
my $tree = $info -> getXMLInfoTree(\@requests);
- my $expectedMsg = '<imagescan><size rootsizeKB="1"/></imagescan>';
+ my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><size rootsizeKB="1"/></imagescan>';
$this -> assert_str_equals($expectedMsg, $tree -> toString());
$this -> assert_not_null($tree);
# Setting up SaT generates a number of meesges that are not useful
@@ -419,7 +423,7 @@
my $info = $this -> __getInfoObj($cmd);
my @requests = ('sources');
my $tree = $info -> getXMLInfoTree(\@requests);
- my $expectedMsg = '<imagescan><source path="/tmp" type="rpm-dir"/>'
+ my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><source path="/tmp" type="rpm-dir"/>'
. '</imagescan>';
$this -> assert_not_null($tree);
$this -> assert_str_equals($expectedMsg, $tree -> toString());
@@ -445,7 +449,7 @@
my $info = $this -> __getInfoObj($cmd);
my @requests = ('version');
my $tree = $info -> getXMLInfoTree(\@requests);
- my $expectedMsg = '<imagescan><image version="1.0.0" '
+ my $expectedMsg = '<imagescan description="'.$cmd->getConfigDir().'"><image version="1.0.0" '
. 'name="test-xml-infod"/></imagescan>';
$this -> assert_not_null($tree);
$this -> assert_str_equals($expectedMsg, $tree -> toString());
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/tests/unit/lib/Test/kiwiXMLValidator.pm
^
|
@@ -346,7 +346,8 @@
my $kiwi = $this -> {kiwi};
my $msg = $kiwi -> getMessage();
my $expectedMsg;
- my @supportedRegions=qw /AP-Japan AP-Singapore EU-West US-East US-West/;
+ my @supportedRegions=
+ qw /AP-Northeast AP-Southeast EU-West US-East US-West/;
if ( $iConfFile =~ 'ec2RegionInvalid_1.xml' ) {
$expectedMsg = 'Specified region EU-West not unique';
} else {
|
[-]
[+]
|
Added |
kiwi.tar.bz2/xsl/convert52to53.xsl
^
|
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="xml"
+ indent="yes" omit-xml-declaration="no" encoding="utf-8"/>
+
+<!-- default rule -->
+<xsl:template match="*|processing-instruction()|comment()" mode="conv52to53">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates mode="conv52to53"/>
+ </xsl:copy>
+</xsl:template>
+
+<!-- version update -->
+<!-- remove inherit attribute from image -->
+<para xmlns="http://docbook.org/ns/docbook">
+ Changed attribute <tag class="attribute">schemaversion</tag>
+ to <tag class="attribute">schemaversion</tag> from
+ <literal>5.2</literal> to <literal>5.2</literal>.
+</para>
+<xsl:template match="image" mode="conv52to53">
+ <xsl:choose>
+ <!-- nothing to do if already at 5.3-->
+ <xsl:when test="@schemaversion > 5.2">
+ <xsl:copy-of select="/"/>
+ </xsl:when>
+ <!-- otherwise apply templates -->
+ <xsl:otherwise>
+ <image schemaversion="5.3">
+ <xsl:copy-of select="@*[local-name() != 'schemaversion' and local-name() != 'inherit']"/>
+ <xsl:apply-templates mode="conv52to53"/>
+ </image>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- convert ec2region names -->
+<xsl:template match="ec2region" mode="conv52to53">
+ <xsl:variable name="regionval" select="text()"/>
+ <xsl:choose>
+ <xsl:when test="$regionval='AP-Japan'">
+ <ec2region>AP-Northeast</ec2region>
+ </xsl:when>
+ <xsl:when test="$regionval='AP-Singapore'">
+ <ec2region>AP-Southeast</ec2region>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
|
[-]
[+]
|
Changed |
kiwi.tar.bz2/xsl/master.xsl
^
|
@@ -23,6 +23,7 @@
<xsl:import href="convert49to50.xsl"/>
<xsl:import href="convert50to51.xsl"/>
<xsl:import href="convert51to52.xsl"/>
+<xsl:import href="convert52to53.xsl"/>
<xsl:import href="pretty.xsl"/>
@@ -100,9 +101,12 @@
<xsl:variable name="v52">
<xsl:apply-templates select="exslt:node-set($v51)" mode="conv51to52"/>
</xsl:variable>
+ <xsl:variable name="v53">
+ <xsl:apply-templates select="exslt:node-set($v52)" mode="conv52to53"/>
+ </xsl:variable>
<xsl:apply-templates
- select="exslt:node-set($v52)" mode="pretty"
+ select="exslt:node-set($v53)" mode="pretty"
/>
</xsl:template>
|