Hello community,
here is the log from the commit of package kiwi
checked in at Fri May 11 15:36:18 CEST 2007.
--------
--- arch/i386/kiwi/kiwi.changes 2007-05-08 10:29:06.000000000 +0200
+++ /mounts/work_src_done/STABLE/kiwi/kiwi.changes 2007-05-11 11:54:23.793884000 +0200
@@ -1,0 +2,23 @@
+Tue May 8 17:27:19 CEST 2007 - ms@suse.de
+
+- v1.33
+- kiwi-pxeboot: install files to /srv/tftpboot (#248008)
+- added patch for netboot and xennetboot linuxrc to allow
+ alternative config files. The same search order like PXE
+ implements it was used (#272337)
+- print version information in help output
+- scheme version upgrade from 1.2 to 1.3. The type specification
+ within the preferences section has changed.
+- added --set-repo and --set-repotype options. This allows a
+ temporary overwrite of the first repository entry within the
+ config.xml file.
+- added possibility to include multiple type sections into
+ the preferences section of the config.xml file. There should
+ be one primary type which is used if no other type was selected
+ with the option --type. If there is no primary attribute the
+ first type specified is the primary type
+- replace readFileSystem with probeFileSystem in all
+ linuxrc files. Removed readFileSystem function from
+ KIWILinuxRC.sh
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.J15241/_old 2007-05-11 15:36:05.000000000 +0200
+++ /var/tmp/diff_new_pack.J15241/_new 2007-05-11 15:36:05.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package kiwi (Version 1.32)
+# spec file for package kiwi (Version 1.33)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -15,7 +15,7 @@
BuildRequires: module-init-tools perl perl-XML-LibXML perl-libwww-perl screen smart syslinux
Requires: perl perl-XML-LibXML perl-libwww-perl screen
Summary: OpenSuSE - KIWI Image System
-Version: 1.32
+Version: 1.33
Release: 1
Group: System/Management
License: GNU General Public License (GPL)
@@ -145,8 +145,8 @@
make buildroot=$RPM_BUILD_ROOT CFLAGS="$RPM_OPT_FLAGS"
if [ $UID = $USER ];then
# prepare and create boot images...
- mkdir -p $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/pxelinux.cfg
- mkdir -p $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/boot
+ mkdir -p $RPM_BUILD_ROOT/srv/tftpboot/pxelinux.cfg
+ mkdir -p $RPM_BUILD_ROOT/srv/tftpboot/boot
mkdir -p /usr/share/kiwi/modules
rm -f /usr/share/kiwi/modules/KIWIScheme.xsd
cp -f modules/KIWIScheme.xsd /usr/share/kiwi/modules
@@ -157,7 +157,7 @@
rm -f $i && cp -a tools/timed $i
done
cd modules
- pxedefault=$RPM_BUILD_ROOT/%{_var}/lib/tftpboot/pxelinux.cfg/default
+ pxedefault=$RPM_BUILD_ROOT/srv/tftpboot/pxelinux.cfg/default
echo "# /.../" > $pxedefault
echo "# KIWI boot image setup" >> $pxedefault
echo "# select boot label according to your system image" >> $pxedefault
@@ -180,12 +180,12 @@
rootName=`echo $i | tr / -`
../kiwi.pl --root $RPM_BUILD_ROOT/root-$rootName --prepare ../system/boot/$i
../kiwi.pl --create $RPM_BUILD_ROOT/root-$rootName \
- -d $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/boot
+ -d $RPM_BUILD_ROOT/srv/tftpboot/boot
rm -rf $RPM_BUILD_ROOT/root-$rootName
echo >> $pxedefault
echo "LABEL $rootName" >> $pxedefault
(
- cd $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/boot
+ cd $RPM_BUILD_ROOT/srv/tftpboot/boot
xenkernel=""
xenloader=""
initrd=""
@@ -207,7 +207,7 @@
fi
)
done
- rm -f $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/boot/*.md5
+ rm -f $RPM_BUILD_ROOT/srv/tftpboot/boot/*.md5
else
echo "cannot build prebuild images without root privileges"
true
@@ -215,7 +215,7 @@
%install
mkdir -p $RPM_BUILD_ROOT/etc/permissions.d
-echo "/var/lib/tftpboot/upload root:root 0777" \
+echo "/srv/tftpboot/upload root:root 0777" \
> $RPM_BUILD_ROOT/etc/permissions.d/kiwi
make buildroot=$RPM_BUILD_ROOT \
doc_prefix=$RPM_BUILD_ROOT/%{_defaultdocdir} \
@@ -224,12 +224,12 @@
touch kiwi.loader
if [ ! $UID = $USER ];then
install -m 755 pxeboot/pxelinux.0.config \
- $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/pxelinux.cfg/default
+ $RPM_BUILD_ROOT/srv/tftpboot/pxelinux.cfg/default
fi
-test -L $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/pxelinux.0 && \
- echo %{_var}/lib/tftpboot/pxelinux.0 > kiwi.loader
-test -L $RPM_BUILD_ROOT/%{_var}/lib/tftpboot/mboot.c32 && \
- echo %{_var}/lib/tftpboot/mboot.c32 >> kiwi.loader
+test -L $RPM_BUILD_ROOT/srv/tftpboot/pxelinux.0 && \
+ echo /srv/tftpboot/pxelinux.0 > kiwi.loader
+test -L $RPM_BUILD_ROOT/srv/tftpboot/mboot.c32 && \
+ echo /srv/tftpboot/mboot.c32 >> kiwi.loader
cat kiwi.loader
#=================================================
# KIWI files...
@@ -251,13 +251,13 @@
%files -n kiwi-pxeboot -f kiwi.loader
%defattr(-, root, root)
/etc/permissions.d/kiwi
-%dir %{_var}/lib/tftpboot
-%dir %{_var}/lib/tftpboot/KIWI
-%dir %{_var}/lib/tftpboot/pxelinux.cfg
-%dir %{_var}/lib/tftpboot/image
-%dir %{_var}/lib/tftpboot/upload
-%{_var}/lib/tftpboot/boot
-%{_var}/lib/tftpboot/pxelinux.cfg/default
+%dir /srv/tftpboot
+%dir /srv/tftpboot/KIWI
+%dir /srv/tftpboot/pxelinux.cfg
+%dir /srv/tftpboot/image
+%dir /srv/tftpboot/upload
+/srv/tftpboot/boot
+/srv/tftpboot/pxelinux.cfg/default
#=================================================
# KIWI-images...
# ------------------------------------------------
@@ -288,6 +288,26 @@
%{_datadir}/kiwi/image/xenboot
%changelog
+* Tue May 08 2007 - ms@suse.de
+- v1.33
+- kiwi-pxeboot: install files to /srv/tftpboot (#248008)
+- added patch for netboot and xennetboot linuxrc to allow
+ alternative config files. The same search order like PXE
+ implements it was used (#272337)
+- print version information in help output
+- scheme version upgrade from 1.2 to 1.3. The type specification
+ within the preferences section has changed.
+- added --set-repo and --set-repotype options. This allows a
+ temporary overwrite of the first repository entry within the
+ config.xml file.
+- added possibility to include multiple type sections into
+ the preferences section of the config.xml file. There should
+ be one primary type which is used if no other type was selected
+ with the option --type. If there is no primary attribute the
+ first type specified is the primary type
+- replace readFileSystem with probeFileSystem in all
+ linuxrc files. Removed readFileSystem function from
+ KIWILinuxRC.sh
* Mon May 07 2007 - ms@suse.de
- v1.32
- use unionfs to implement read-only mounts. If unionfs mount
++++++ kiwi.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/doc/deploy.tex new/kiwi/doc/deploy.tex
--- old/kiwi/doc/deploy.tex 2007-04-25 12:38:19.000000000 +0200
+++ new/kiwi/doc/deploy.tex 2007-05-11 11:51:09.000000000 +0200
@@ -58,9 +58,9 @@
can let kiwi do the job by setting up the \textbf{pxe} type in your
system image config.xml file. For example:
-\begin{Command}{12cm}
+\begin{Command}{15cm}
<preferences>\\
-\hspace*{1cm}<type>pxe:ext3:netboot/suse-10.2</type>\\
+\hspace*{1cm}<type filesystem=ext3 boot=netboot/suse-10.2>pxe</type>\\
\hspace*{1cm}...\\
</preferences>
\end{Command}
@@ -173,9 +173,9 @@
must be adapted. This information is part of the \textbf{config.xml}
file and could be changed like the following example shows:
-\begin{Command}{9cm}
+\begin{Command}{12cm}
<preferences>\\
-\hspace*{1cm}<type>split:ext3,cramfs</type>\\
+\hspace*{1cm}<type filesystem=ext3,cramfs>split</type>\\
\hspace*{1cm}...\\
</preferences>
\end{Command}
@@ -255,9 +255,9 @@
To use your system image on a boot stick setup the system's config.xml
as follows:
-\begin{Command}{14cm}
+\begin{Command}{15cm}
<preferences>\\
-\hspace*{1cm}<type>usb:ext3:usbboot/suse-10.2</type>\\
+\hspace*{1cm}<type filesystem=ext3 boot=usbboot/suse-10.2>usb</type>\\
\hspace*{1cm}...\\
</preferences>
\end{Command}
@@ -290,9 +290,9 @@
be created. This can be done by specifying the following type in the
system's image config.xml:
-\begin{Command}{14cm}
+\begin{Command}{16cm}
<preferences>\\
-\hspace*{1cm}<type>vmx:ext3:vmxboot/suse-10.2</type>\\
+\hspace*{1cm}<type filesystem=ext3 boot=vmxboot/suse-10.2>vmx</type>\\
\hspace*{1cm}...\\
</preferences>
\end{Command}
@@ -320,9 +320,9 @@
needs to be created. This can be done by specifying the following type in the
system's image config.xml:
-\begin{Command}{14cm}
+\begin{Command}{16cm}
<preferences>\\
-\hspace*{1cm}<type>xen:ext3:xenboot/suse-10.2</type>\\
+\hspace*{1cm}<type filesystem=ext3 boot=xenboot/suse-10.2>xen</type>\\
\hspace*{1cm}...\\
</preferences>
\end{Command}
@@ -368,14 +368,14 @@
This is done by setting the \textbf{type} of the image in the
\textbf{config.xml} file as follows:
-\begin{Command}{9cm}
+\begin{Command}{12cm}
<preferences>\\
-\hspace*{1cm}<type>iso:name</type>\\
+\hspace*{1cm}<type boot="isoboot/suse-10.3">iso</type>\\
\hspace*{1cm}...\\
</preferences>
\end{Command}
-The parameter \textbf{name} refers to the CD boot image which
+The attribute \textbf{boot} refers to the CD boot image which
must exist in \textit{/usr/share/kiwi/image/isoboot}. Like for all boot
images the most important point is that the boot image has to
match the operating system image. This means the kernel of the boot-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/doc/image.tex new/kiwi/doc/image.tex
--- old/kiwi/doc/image.tex 2007-04-19 14:10:16.000000000 +0200
+++ new/kiwi/doc/image.tex 2007-05-11 11:51:09.000000000 +0200
@@ -87,7 +87,9 @@
\hspace*{2cm}<specification>some text</specification>\\
\hspace*{1cm}</description>\\
\hspace*{1cm}<preferences>\\
- \hspace*{2cm}<type>Type</type>\\
+ \hspace*{2cm}Type</type>\\
\hspace*{2cm}<version>1.2.3</version>\\
\hspace*{2cm}<size unit="Unit">Size</size>\\
\hspace*{2cm}<packagemanager>name</packagemanager>\\
@@ -151,45 +153,87 @@
configure additional space, for example, if custom scripts
are run.
\item \textbf{type}\\
- The image type of the logical extend:
+ The image type of the logical extend: Multiple type entries
+ are possible whereas one primary type should be specified by
+ an attribute named \textbf{primary}. Without setting a
+ primary type the first entry of the type list is the primary
+ type. The value for type can be set to one of the following:
+ \begin{enumerate}
+ \item ext2, ext3, reiserfs, squashfs, cpio
+ \item iso, split, usb vmx, xen, pxe
+ \end{enumerate}
+ The second group of types requires additional paramaters
+ which are given by the following attributes
\begin{itemize}
- \item ext2,ext3 or reiserfs\\
- can be used as system image filesystem
- \item cpio\\
- for boot images only
- \item iso:filename[,compressed]\\
+ \item primary\\
+ attribute to specify the primary type. The kiwi
+ option --type allows to select between the types
+ \item boot\\
+ attribute to specify the boot image (initrd)
+ which should be used and created for this system
+ image description. The boot images for kiwi are
+ stored below the path
+ \textit{/usr/share/kiwi/image} and are grouped
+ according to their capabilities into the following
+ directories: \textbf{isoboot, netboot, xennetboot,
+ usbboot, vmxboot and xenboot}. Setting the name
+ of a boot image is done relatively to the
+ /usr/share/kiwi/image path. For example:
+ \textbf{isoboot/suse-10.3}. This will create
+ the boot (initrd) image from the suse-10.3
+ description which exists in
+ /usr/share/kiwi/image/isoboot/suse-10.3
+ \item flags\\
+ attribute to specify flags for the image type.
+ Currently only the \textbf{compressed} flag
+ for the \textbf{iso} type exists. This flag
+ causes the live media to be based on a
+ squashfs compressed file system
+ \item filesystem\\
+ attribute to specify the filesystem. Could be
+ set to ext2, ext3, reiserfs, squashfs or cpio.
+ \end{itemize}
+ The following list gives you an overview about the
+ different boot image (initrd) types and what they are
+ good for:
+ \begin{itemize}
+ \item iso boot=isoboot/... flags=compressed\\
to create an .iso image whereas filename
must be the name of an appropriate isoboot
boot image from. Optional one can activate
squashfs compression for the read-only part
of the iso.
\textit{/usr/share/kiwi/image/isoboot}
- \item usb:type:filename\\
+ \item usb boot=usbboot/... filesystem=...\\
to create a system and boot image suitable
to run on an USB stick deployed with the kiwi
- --bootstick option. type specifies one of
- ext2,ext3 or reiserfs and filename must be
+ --bootstick option. filesystem specifies one of
+ ext2,ext3 or reiserfs and boot must be
the name of an appropriate usbboot boot image
- \item vmx:type:filename\\
+ \item vmx boot=vmxboot/... filesystem=...\\
to create virtual disk images for qemu and
- VMware. type specifies one of ext2,ext3 or
- reiserfs and filename must be the name of an
+ VMware. filesystem specifies one of ext2,ext3 or
+ reiserfs and boot must be the name of an
appropriate vmxboot boot image
- \item xen:type:filename\\
+ \item xen boot=xenboot/... filesystem=...\\
to create Xen boot and system image as well
- as the xen configuration file. type specifies
- one of ext2,ext3 or reiserfs and filename must
- be the name of an appropriate xenboot boot image
- \item pxe:type:filename\\
- to create PXE boot and system image. type
+ as the xen configuration file. filesystem
+ specifies one of ext2,ext3 or reiserfs and
+ boot must be the name of an appropriate
+ xenboot boot image
+ \item pxe boot=netboot/... filesystem=...\\
+ to create PXE boot and system image. filesystem
specifies one of ext2,ext3 or reiserfs and
- filename must be the name of an appropriate
+ boot must be the name of an appropriate
netboot or xennetboot boot image
- \item split:type-rw,type-ro\\
+ \item split filesystem=type-rw,type-ro\\
to create a splitted image into a read-only
and a read-write part. type-rw specifies one of
ext2,ext3 or reiserfs type-ro specifies one
- of ext2,ext3,reiserfs or cramfs
+ of ext2,ext3,reiserfs,cramfs or squashfs.
+ Booting split images is only supported by the
+ netboot and xennetboot boot images which needs
+ to be created in a separate kiwi run
\end{itemize}
\item \textbf{timezone}\\
The time zone. The possible time zones are located in the
Files old/kiwi/doc/kiwi.pdf and new/kiwi/doc/kiwi.pdf differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/doc/Revision.txt new/kiwi/doc/Revision.txt
--- old/kiwi/doc/Revision.txt 2007-05-07 11:40:25.000000000 +0200
+++ new/kiwi/doc/Revision.txt 2007-05-11 11:51:09.000000000 +0200
@@ -1 +1 @@
-3.7
+3.8
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/kiwi.pl new/kiwi/kiwi.pl
--- old/kiwi/kiwi.pl 2007-05-07 11:40:25.000000000 +0200
+++ new/kiwi/kiwi.pl 2007-05-11 11:51:09.000000000 +0200
@@ -30,8 +30,8 @@
#============================================
# Globals (Version)
#--------------------------------------------
-our $Version = "1.30";
-our $SchemeVersion = "1.2";
+our $Version = "1.33";
+our $SchemeVersion = "1.3";
#============================================
# Globals
#--------------------------------------------
@@ -41,28 +41,31 @@
#============================================
# Globals
#--------------------------------------------
-our $Prepare; # control XML file for building chroot extend
-our $Create; # image description for building image extend
-our $CreateInstSource;# create installation source from meta packages
-our $Upgrade; # upgrade physical extend
-our $Destination; # destination directory for logical extends
-our $LogFile; # optional file name for logging
-our $RootTree; # optional root tree destination
-our $Survive; # if set to "yes" don't exit kiwi
-our $BootStick; # deploy initrd booting from USB stick
-our $BootStickSystem; # system image to be copied on an USB stick
-our $BootVMSystem; # system image to be copied on a VM disk
-our $BootVMDisk; # deploy initrd booting from a VM
-our $BootVMSize; # size of virtual disk
-our $BootCD; # deploy initrd booting from CD
-our $InstallCD; # deploy initrd installing from cD
-our $InstallCDSystem; # system image to be deployed via CD
-our $StripImage; # strip shared objects and binaries
-our $CreatePassword; # create crypt password string
-our $ImageName; # filename of current image, used in Modules
-our %ForeignRepo; # may contain XML::LibXML::Element objects
-our $AddRepository; # add repository for building physical extend
+our $Prepare; # control XML file for building chroot extend
+our $Create; # image description for building image extend
+our $CreateInstSource; # create installation source from meta packages
+our $Upgrade; # upgrade physical extend
+our $Destination; # destination directory for logical extends
+our $LogFile; # optional file name for logging
+our $RootTree; # optional root tree destination
+our $Survive; # if set to "yes" don't exit kiwi
+our $BootStick; # deploy initrd booting from USB stick
+our $BootStickSystem; # system image to be copied on an USB stick
+our $BootVMSystem; # system image to be copied on a VM disk
+our $BootVMDisk; # deploy initrd booting from a VM
+our $BootVMSize; # size of virtual disk
+our $BootCD; # deploy initrd booting from CD
+our $InstallCD; # deploy initrd installing from cD
+our $InstallCDSystem; # system image to be deployed via CD
+our $StripImage; # strip shared objects and binaries
+our $CreatePassword; # create crypt password string
+our $ImageName; # filename of current image, used in Modules
+our %ForeignRepo; # may contain XML::LibXML::Element objects
+our $AddRepository; # add repository for building physical extend
our $AddRepositoryType; # add repository type
+our $SetRepository; # set first repository for building physical extend
+our $SetRepositoryType; # set firt repository type
+our $SetImageType; # set image type to use, default is primary type
#============================================
# Globals
@@ -148,6 +151,12 @@
}
$kiwi -> done();
#==========================================
+ # Check for set-repo option
+ #------------------------------------------
+ if (defined $SetRepository) {
+ $xml -> setRepository ($SetRepositoryType,$SetRepository);
+ }
+ #==========================================
# Check for add-repo option
#------------------------------------------
if (defined $AddRepository) {
@@ -200,7 +209,7 @@
#------------------------------------------
if (defined $Create) {
$kiwi -> info ("Reading image description...");
- my $xml = new KIWIXML ( $kiwi,"$Create/image" );
+ my $xml = new KIWIXML ( $kiwi,"$Create/image",undef,$SetImageType );
if (! defined $xml) {
my $code = kiwiExit (1); return $code;
}
@@ -212,54 +221,58 @@
$kiwi,$xml,$Create,$Destination,$StripImage,
"/base-system"
);
- my $type = $xml->getImageType();
+ my %type = %{$xml->getImageTypeAndAttributes()};
+ my $para = checkType ( \%type );
+ if (! defined $para) {
+ my $code = kiwiExit (1); return $code;
+ }
my $ok;
- SWITCH: for ($type) {
- /^ext2/ && do {
+ SWITCH: for ($type{type}) {
+ /^ext2/ && do {
$ok = $image -> createImageEXT2 ();
last SWITCH;
};
- /^ext3/ && do {
+ /^ext3/ && do {
$ok = $image -> createImageEXT3 ();
last SWITCH;
};
- /^reiserfs/ && do {
+ /^reiserfs/ && do {
$ok = $image -> createImageReiserFS ();
last SWITCH;
};
- /^squashfs/ && do {
+ /^squashfs/ && do {
$ok = $image -> createImageSquashFS ();
last SWITCH;
};
- /^cpio/ && do {
+ /^cpio/ && do {
$ok = $image -> createImageCPIO ();
last SWITCH;
};
- /^iso:(.*)/ && do {
- $ok = $image -> createImageLiveCD ( $1 );
+ /^iso/ && do {
+ $ok = $image -> createImageLiveCD ( $para );
last SWITCH;
};
- /^split:(.*)/ && do {
- $ok = $image -> createImageSplit ( $1 );
+ /^split/ && do {
+ $ok = $image -> createImageSplit ( $para );
last SWITCH;
};
- /^usb:(.*)/ && do {
- $ok = $image -> createImageUSB ( $1 );
+ /^usb/ && do {
+ $ok = $image -> createImageUSB ( $para );
last SWITCH;
};
- /^vmx:(.*)/ && do {
- $ok = $image -> createImageVMX ( $1 );
+ /^vmx/ && do {
+ $ok = $image -> createImageVMX ( $para );
last SWITCH;
};
- /^xen:(.*)/ && do {
- $ok = $image -> createImageXen ( $1 );
+ /^xen/ && do {
+ $ok = $image -> createImageXen ( $para );
last SWITCH;
};
- /^pxe:(.*)/ && do {
- $ok = $image -> createImagePXE ( $1 );
+ /^pxe/ && do {
+ $ok = $image -> createImagePXE ( $para );
last SWITCH;
};
- $kiwi -> error ("Unsupported type: $type");
+ $kiwi -> error ("Unsupported type: $type{type}");
$kiwi -> failed ();
my $code = kiwiExit (1); return $code;
}
@@ -281,6 +294,12 @@
}
$kiwi -> done();
#==========================================
+ # Check for set-repo option
+ #------------------------------------------
+ if (defined $SetRepository) {
+ $xml -> setRepository ($SetRepositoryType,$SetRepository);
+ }
+ #==========================================
# Check for add-repo option
#------------------------------------------
if (defined $AddRepository) {
@@ -450,6 +469,9 @@
"create-instsource=s" => \$CreateInstSource,
"add-repo=s" => \$AddRepository,
"add-repotype=s" => \$AddRepositoryType,
+ "set-repo=s" => \$SetRepository,
+ "set-repotype=s" => \$SetRepositoryType,
+ "type|t=s" => \$SetImageType,
"upgrade|u=s" => \$Upgrade,
"destdir|d=s" => \$Destination,
"root|r=s" => \$RootTree,
@@ -535,6 +557,14 @@
print " storing the logical extends. By default the current\n";
print " directory is used\n";
print "\n";
+ print " [ -t | --type <image-type> ]\n";
+ print " Specify the output image type to use for this image\n";
+ print " The type must exist in the config.xml description\n";
+ print " By the default the primary type will be used. If there is\n";
+ print " no primary attribute set the first type entry of the\n";
+ print " preferences section is the primary type\n";
+ print " makes only sense in combination with --create\n";
+ print "\n";
print " [ -r | --root <root-path> ]\n";
print " Setup the physical extend, chroot system below the\n";
print " given root-path path. By default a mktmp directory\n";
@@ -546,13 +576,20 @@
print "\n";
print " [ --add-repo <repo-path> --add-repotype <type> ]\n";
print " Add the given repository and type for this run of an\n";
+ print " image prepare or upgrade process. The change will not\n";
+ print " be written to the config.xml file\n";
+ print "\n";
+ print " [ --set-repo <repo-path> [ --set-repotype <type> ]]\n";
+ print " set the given repository and optional type for the first\n";
+ print " repository entry within the config.xml. The change will not\n";
+ print " be written to the xml file and is valid for this run of\n";
print " image prepare or upgrade process.\n";
print "\n";
print " [ --logfile <filename> | terminal ]\n";
print " Write to the log file \`<filename>' instead of\n";
print " the terminal.\n";
print "--\n";
- exit 1;
+ version();
}
#==========================================
@@ -653,4 +690,50 @@
exit 0;
}
+#==========================================
+# checkType
+#------------------------------------------
+sub checkType {
+ my (%type) = %{$_[0]};
+ my $para = "ok";
+ SWITCH: for ($type{type}) {
+ /^iso/ && do {
+ if (! defined $type{boot}) {
+ $kiwi -> error ("$type{type}: No boot image specified");
+ $kiwi -> failed ();
+ return undef;
+ }
+ $para = $type{boot};
+ if (defined $type{flags}) {
+ $para .= ",$type{flags}";
+ }
+ last SWITCH;
+ };
+ /^split/ && do {
+ if (! defined $type{filesystem}) {
+ $kiwi -> error ("$type{type}: No filesystem pair specified");
+ $kiwi -> failed ();
+ return undef;
+ }
+ $para = $type{filesystem};
+ last SWITCH;
+ };
+ /^usb|vmx|xen|pxe/ && do {
+ if (! defined $type{filesystem}) {
+ $kiwi -> error ("$type{type}: No filesystem specified");
+ $kiwi -> failed ();
+ return undef;
+ }
+ if (! defined $type{boot}) {
+ $kiwi -> error ("$type{type}: No boot image specified");
+ $kiwi -> failed ();
+ return undef;
+ }
+ $para = $type{filesystem}.":".$type{boot};
+ last SWITCH;
+ };
+ }
+ return $para;
+}
+
main();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/Makefile new/kiwi/Makefile
--- old/kiwi/Makefile 2007-04-04 12:11:46.000000000 +0200
+++ new/kiwi/Makefile 2007-05-09 10:15:14.000000000 +0200
@@ -13,7 +13,7 @@
# Prefixs...
#--------------------------------------------
kiwi_prefix = ${buildroot}/usr/share/kiwi
-tftp_prefix = ${buildroot}/var/lib/tftpboot
+tftp_prefix = ${buildroot}/srv/tftpboot
doc_prefix = ${buildroot}/usr/share/doc/packages
man_prefix = ${buildroot}/usr/share/man
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIImage.pm new/kiwi/modules/KIWIImage.pm
--- old/kiwi/modules/KIWIImage.pm 2007-05-03 13:46:07.000000000 +0200
+++ new/kiwi/modules/KIWIImage.pm 2007-05-11 11:51:09.000000000 +0200
@@ -349,6 +349,7 @@
$main::Create = $main::RootTree;
$main::ForeignRepo{xmlnode} = $xml -> getForeignNodeList();
$main::ForeignRepo{prepare} = $main::Prepare;
+ undef $main::SetImageType;
if (! defined main::main()) {
$main::Survive = "default";
if (! -d $main::RootTree.$baseSystem) {
@@ -659,6 +660,7 @@
$main::Create = $main::RootTree;
$main::ForeignRepo{xmlnode} = $xml -> getForeignNodeList();
$main::ForeignRepo{prepare} = $main::Prepare;
+ undef $main::SetImageType;
if (! defined main::main()) {
$main::Survive = "default";
if (! -d $main::RootTree.$baseSystem) {
@@ -956,6 +958,7 @@
};
/ext3/ && do {
qx (/sbin/fsck.ext3 -f -y $imageDest/$name 2>&1);
+ qx (/sbin/tune2fs -j $imageDest/$name 2>&1);
$kiwi -> done();
last SWITCH;
};
@@ -1153,7 +1156,8 @@
#==========================================
# COMBINED_IMAGE information
#------------------------------------------
- if ($xml -> getImageType () =~ /^split:(.*)/) {
+ my %type = %{$xml -> getImageTypeAndAttributes()};
+ if ("$type{type}" eq "split") {
print FD "COMBINED_IMAGE=yes\n";
}
#==========================================
@@ -1205,14 +1209,16 @@
#==========================================
# Check image file system
#------------------------------------------
- $kiwi -> info ("Checking file system...");
- my $type = $xml->getImageType();
- SWITCH: for ($type) {
+ my %type = %{$xml->getImageTypeAndAttributes()};
+ my $para = $type{type}.":".$type{filesystem};
+ $kiwi -> info ("Checking file system: $type{filesystem}...");
+ SWITCH: for ($para) {
#==========================================
# Check EXT3 file system
#------------------------------------------
/ext3/i && do {
qx (/sbin/fsck.ext3 -f -y $imageDest/$name 2>&1);
+ qx (/sbin/tune2fs -j $imageDest/$name 2>&1);
$kiwi -> done();
last SWITCH;
};
@@ -1236,7 +1242,7 @@
# Unknown filesystem type
#------------------------------------------
$kiwi -> failed();
- $kiwi -> error ("Unsupported filesystem type: $type");
+ $kiwi -> error ("Unsupported filesystem type: $type{filesystem}");
$kiwi -> failed();
return undef;
}
@@ -1446,8 +1452,9 @@
# These files are created from the kernel package
# script which exists for boot images only
# ---
- my $type = $xml->getImageType();
- SWITCH: for ($type) {
+ my %type = %{$xml->getImageTypeAndAttributes()};
+ my $para = $type{type}.":".$type{filesystem};
+ SWITCH: for ($para) {
/ext3/i && do {
return $name;
last SWITCH;
@@ -1456,7 +1463,7 @@
return $name;
last SWITCH;
};
- /iso:(.*)/i && do {
+ /iso/i && do {
return $name;
last SWITCH;
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWILinuxRC.sh new/kiwi/modules/KIWILinuxRC.sh
--- old/kiwi/modules/KIWILinuxRC.sh 2007-04-05 16:01:52.000000000 +0200
+++ new/kiwi/modules/KIWILinuxRC.sh 2007-05-11 11:51:09.000000000 +0200
@@ -157,31 +157,6 @@
esac
}
#======================================
-# readFileSystem
-#--------------------------------------
-function readFileSystem {
- # /.../
- # read the image type information from the image itself
- # and return the appropriate filesystem type.
- # ----
- imageConfig=$1
- if [ ! -f $imageConfig ];then
- FSTYPE=auto
- return
- fi
- data=`cat $imageConfig | grep "<type>" | cut -f2 -d ">" | cut -f1 -d "<"`
- case $data in
- *ext3*) FSTYPE=ext3 ;;
- *ext2*) FSTYPE=ext2 ;;
- *reiserfs*) FSTYPE=reiserfs ;;
- *cramfs*) FSTYPE=cramfs ;;
- *squashfs*) FSTYPE=squashfs ;;
- *)
- FSTYPE=auto
- ;;
- esac
-}
-#======================================
# getSystemIntegrity
#--------------------------------------
function getSystemIntegrity {
@@ -892,3 +867,33 @@
mv $tmpdir/* $directory
rm -rf $tmpdir
}
+
+#======================================
+# searchAlternativeConfig
+#--------------------------------------
+function searchAlternativeConfig () {
+ # Check config.IP in Hex (pxelinux style)
+ localip=$IPADDR
+ hexip1=`echo $localip | cut -f1 -d'.'`
+ hexip2=`echo $localip | cut -f2 -d'.'`
+ hexip3=`echo $localip | cut -f3 -d'.'`
+ hexip4=`echo $localip | cut -f4 -d'.'`
+ hexip=`printf "%02X" $hexip1 $hexip2 $hexip3 $hexip4`
+ STEP=8
+ while [ $STEP -gt 0 ]; do
+ hexippart=`echo $hexip | cut -b -$STEP`
+ Echo "Checking for config file: config.$hexippart"
+ result=`atftp -g \
+ -r KIWI/config.$hexippart -l $CONFIG $TSERVER 2>&1 | head -n 1`
+ if test -s $CONFIG;then
+ break
+ fi
+ let STEP=STEP-1
+ done
+ # Check config.default if no hex config was found
+ if test ! -s $CONFIG;then
+ Echo "Checking for config file: config.default"
+ result=`atftp -g \
+ -r KIWI/config.default -l $CONFIG $TSERVER 2>&1 | head -n 1`
+ fi
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIRoot.pm new/kiwi/modules/KIWIRoot.pm
--- old/kiwi/modules/KIWIRoot.pm 2007-05-08 10:28:33.000000000 +0200
+++ new/kiwi/modules/KIWIRoot.pm 2007-05-11 11:51:09.000000000 +0200
@@ -141,6 +141,11 @@
$sourceChannel{public}{$channel} = \@public_options;
$count++;
}
+ if ($count == 1) {
+ $kiwi -> error ("No Channels left");
+ $kiwi -> failed ();
+ return undef;
+ }
#==========================================
# Create root directory
#------------------------------------------
@@ -343,8 +348,8 @@
#==========================================
# Get Xen package if type is appropriate
#------------------------------------------
- my $type = $xml -> getImageType();
- if ($type =~ /^xen/) {
+ my %type = %{$xml -> getImageTypeAndAttributes()};
+ if ("$type{type}" eq "xen") {
$kiwi -> info ("Creating Xen package list");
my @xenList = $xml -> getXenList();
if (! @xenList) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIScheme.xsd new/kiwi/modules/KIWIScheme.xsd
--- old/kiwi/modules/KIWIScheme.xsd 2007-05-07 11:40:25.000000000 +0200
+++ new/kiwi/modules/KIWIScheme.xsd 2007-05-11 11:51:09.000000000 +0200
@@ -3,7 +3,7 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
- version="1.2">
+ version="1.3">
xs:annotation
xs:documentation
This schema specifies the format of the config.xml image
@@ -201,20 +201,31 @@
xs:complexType
- xs:all
-
+ xs:sequence
+
+
-
-
+
+
+
+
+ xs:complexType
+ xs:simpleContent
+
+
+
+
+
+
+
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/modules/KIWIXML.pm new/kiwi/modules/KIWIXML.pm
--- old/kiwi/modules/KIWIXML.pm 2007-05-07 11:40:25.000000000 +0200
+++ new/kiwi/modules/KIWIXML.pm 2007-05-11 11:51:09.000000000 +0200
@@ -28,6 +28,7 @@
#------------------------------------------
my $kiwi;
my $imageDesc;
+my $imageWhat;
my $optionsNodeList;
my $driversNodeList;
my $usrdataNodeList;
@@ -62,6 +63,7 @@
$kiwi = shift;
$imageDesc = shift;
my $otherRepo = shift;
+ $imageWhat = shift;
my %foreignRepo;
if (defined $otherRepo) {
%foreignRepo = %{$otherRepo};
@@ -147,6 +149,15 @@
return undef;
}
#==========================================
+ # Check type information from xml input
+ #------------------------------------------
+ if (! $this -> getImageTypeAndAttributes()) {
+ $kiwi -> failed ();
+ $kiwi -> error ("Boot type: $imageWhat not specified in config.xml");
+ $kiwi -> failed ();
+ return undef;
+ }
+ #==========================================
# setup foreign repository sections
#------------------------------------------
if ( defined $foreignRepo{xmlnode} ) {
@@ -223,21 +234,50 @@
my $node = $optionsNodeList -> get_node(1);
my $size = $node -> getElementsByTagName ("size");
my $unit = $node -> getElementsByTagName ("size")
- -> get_node(1) ->getAttribute("unit");
+ -> get_node(1) -> getAttribute("unit");
return $size.$unit;
}
#==========================================
-# getImageType
+# getImageTypeAndAttributes
#------------------------------------------
-sub getImageType {
+sub getImageTypeAndAttributes {
# ...
- # Get the filesystem type of the logical extend
+ # Get the image type and its attributes for beeing
+ # able to create the appropriate logical extend
# ---
- my $this = shift;
- my $node = $optionsNodeList -> get_node(1);
- my $type = $node -> getElementsByTagName ("type");
- return $type;
+ my $this = shift;
+ my %result = ();
+ my $count = 0;
+ my $first = "";
+ my @node = $optionsNodeList -> get_node(1)
+ -> getElementsByTagName ("type");
+ foreach my $node (@node) {
+ my %record = ();
+ my $prim = $node -> getAttribute("primary");
+ if ((! defined $prim) || ($prim eq "false") || ($prim eq "0")) {
+ $prim = $node -> string_value();
+ } else {
+ $prim = "primary";
+ }
+ if ($count == 0) {
+ $first = $prim;
+ }
+ $record{type} = $node -> string_value();
+ $record{boot} = $node -> getAttribute("boot");
+ $record{flags}= $node -> getAttribute("flags");
+ $record{filesystem} = $node -> getAttribute("filesystem");
+ $result{$prim} = \%record;
+ $count++;
+ }
+ if (! defined $imageWhat) {
+ if (defined $result{primary}) {
+ return $result{primary};
+ } else {
+ return $result{$first};
+ }
+ }
+ return $result{$imageWhat};
}
#==========================================
@@ -386,8 +426,8 @@
# otherwise false.
# ---
my $this = shift;
- my $type = getImageType();
- if ($type =~ /^vmx:/) {
+ my %type = %{getImageTypeAndAttributes()};
+ if ("$type{type}" eq "vmx") {
$kiwi -> info ("Virtual machine type: ignoring compressed flag");
$kiwi -> done ();
return 0;
@@ -542,9 +582,39 @@
}
#==========================================
+# setRepository
+#------------------------------------------
+sub setRepository {
+ # ...
+ # Overwerite the repository path and type of the first
+ # repository node with the given data
+ # ---
+ my $this = shift;
+ my $type = shift;
+ my $path = shift;
+ my $element = $repositNodeList -> get_node(1);
+ if (defined $type) {
+ $element -> setAttribute ("type",$type);
+ }
+ if (defined $path) {
+ $element -> getElementsByTagName ("source")
+ -> get_node (1) -> setAttribute ("path",$path);
+ }
+ return $this;
+}
+
+#==========================================
# addRepository
#------------------------------------------
sub addRepository {
+ # ...
+ # Add a repository node to the current list of repos
+ # this is done by reading the config.xml 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
+ # ---
my $this = shift;
my $type = shift;
my $path = shift;
@@ -580,12 +650,12 @@
if (getCompressed ($this)) {
$result{compressed} = "yes";
}
- my $type = getImageType ($this);
+ my %type = %{getImageTypeAndAttributes()};
my $iver = getImageVersion ($this);
my $size = getImageSize ($this);
my $name = getImageName ($this);
- if ($type) {
- $result{type} = $type;
+ if (%type) {
+ $result{type} = $type{type};
}
if ($size) {
$result{size} = $size;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/isoinstboot/suse-linuxrc new/kiwi/system/boot/isoinstboot/suse-linuxrc
--- old/kiwi/system/boot/isoinstboot/suse-linuxrc 2007-04-04 11:39:41.000000000 +0200
+++ new/kiwi/system/boot/isoinstboot/suse-linuxrc 2007-05-11 11:51:08.000000000 +0200
@@ -257,9 +257,7 @@
done
mkdir -p /mnt
- mount $imageRootDevice /mnt
- readFileSystem /mnt/image/config.xml
- umount /mnt
+ probeFileSystem $imageRootDevice
Echo "Resize filesystem to full partition space..."
if test "$FSTYPE" = "reiserfs";then
resize_reiserfs $imageDevice
@@ -302,7 +300,7 @@
# 10) check filesystem and kernels
#--------------------------------------
if test $systemIntegrity = "clean";then
- readFileSystem /mnt/image/config.xml
+ probeFileSystem $imageRootDevice
kernelList /mnt
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/netboot/suse-linuxrc new/kiwi/system/boot/netboot/suse-linuxrc
--- old/kiwi/system/boot/netboot/suse-linuxrc 2007-04-25 10:50:24.000000000 +0200
+++ new/kiwi/system/boot/netboot/suse-linuxrc 2007-05-11 11:51:08.000000000 +0200
@@ -147,7 +147,11 @@
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
CONFIG=/etc/config.netclient
+ #======================================
+ # Connection/access check for TSERVER
+ #--------------------------------------
while true;do
+ Echo "Checking for config file: config.$DHCPCHADDR"
result=`atftp -g \
-r KIWI/config.$DHCPCHADDR -l $CONFIG $TSERVER 2>&1 | head -n 1`
status1=`echo $result | cut -f2 -d" "`
@@ -163,7 +167,16 @@
TSERVER=$DHCPSIADDR
fi
done
- if test $? != 0 -o ! -s $CONFIG;then
+ #======================================
+ # Check alternative config names
+ #--------------------------------------
+ if test ! -s $CONFIG;then
+ searchAlternativeConfig
+ fi
+ #======================================
+ # No config found register new client
+ #--------------------------------------
+ if test ! -s $CONFIG;then
#======================================
# Register new network client
#--------------------------------------
@@ -194,10 +207,14 @@
#--------------------------------------
while test ! -s $CONFIG;do
Echo "Lookup network client config file again..."
+ Echo "Checking for config file: config.$DHCPCHADDR"
dhcpcd -n
atftp -g -r KIWI/config.$DHCPCHADDR \
-l $CONFIG $TSERVER \
>/dev/null 2>&1
+ if test ! -s $CONFIG;then
+ searchAlternativeConfig
+ fi
test -s $CONFIG || {
Echo "Couldn't get image configuration"
Echo "sleeping [60 sec]..."
@@ -404,9 +421,7 @@
echo $imageDevice | grep -q ram
haveDataInRam=$?
if test ! -z $DISK && test $haveDataInRam != 0;then
- mountSystem $imageRootDevice
- readFileSystem /mnt/image/config.xml
- umountSystem
+ probeFileSystem $imageRootDevice
if test "$FSTYPE" = "reiserfs";then
Echo "Resize Reiser filesystem to full partition space..."
resize_reiserfs $imageDevice
@@ -426,8 +441,6 @@
e2fsck -f $imageDevice -y
Echo "Resize EXT3 filesystem to full partition space..."
resize2fs -F -p $imageDevice
- Echo "Adding EXT3 journal..."
- tune2fs -j $imageDevice
Echo "Checking EXT3 filesystem..."
e2fsck -f $imageDevice -y
INITRD_MODULES="$INITRD_MODULES ext3"
@@ -556,7 +569,7 @@
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
if test $systemIntegrity = "clean";then
- readFileSystem /mnt/image/config.xml
+ probeFileSystem $imageRootDevice
kernelList /mnt
fi
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/vmxboot/suse-linuxrc new/kiwi/system/boot/vmxboot/suse-linuxrc
--- old/kiwi/system/boot/vmxboot/suse-linuxrc 2007-04-04 11:39:41.000000000 +0200
+++ new/kiwi/system/boot/vmxboot/suse-linuxrc 2007-05-11 11:51:08.000000000 +0200
@@ -110,7 +110,7 @@
#======================================
# 5) Get filesystem type
#--------------------------------------
-readFileSystem /mnt/image/config.xml
+probeFileSystem $imageRootDevice
kernelList /mnt
#======================================
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/xenboot/suse-linuxrc new/kiwi/system/boot/xenboot/suse-linuxrc
--- old/kiwi/system/boot/xenboot/suse-linuxrc 2007-03-29 11:12:23.000000000 +0200
+++ new/kiwi/system/boot/xenboot/suse-linuxrc 2007-05-11 11:51:08.000000000 +0200
@@ -80,7 +80,7 @@
#======================================
# 5) Get filesystem type
#--------------------------------------
-readFileSystem /mnt/image/config.xml
+probeFileSystem $imageRootDevice
#======================================
# 6) Create system dependant files
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/xennetboot/suse-linuxrc new/kiwi/system/boot/xennetboot/suse-linuxrc
--- old/kiwi/system/boot/xennetboot/suse-linuxrc 2007-04-05 16:01:50.000000000 +0200
+++ new/kiwi/system/boot/xennetboot/suse-linuxrc 2007-05-11 11:51:08.000000000 +0200
@@ -147,7 +147,11 @@
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
CONFIG=/etc/config.netclient
+ #======================================
+ # Connection/access check for TSERVER
+ #--------------------------------------
while true;do
+ Echo "Checking for config file: config.$DHCPCHADDR"
result=`atftp -g \
-r KIWI/config.$DHCPCHADDR -l $CONFIG $TSERVER 2>&1 | head -n 1`
status1=`echo $result | cut -f2 -d" "`
@@ -163,7 +167,16 @@
TSERVER=$DHCPSIADDR
fi
done
- if test $? != 0 -o ! -s $CONFIG;then
+ #======================================
+ # Check alternative config names
+ #--------------------------------------
+ if test ! -s $CONFIG;then
+ searchAlternativeConfig
+ fi
+ #======================================
+ # No config found register new client
+ #--------------------------------------
+ if test ! -s $CONFIG;then
#======================================
# Register new network client
#--------------------------------------
@@ -194,10 +207,14 @@
#--------------------------------------
while test ! -s $CONFIG;do
Echo "Lookup network client config file again..."
+ Echo "Checking for config file: config.$DHCPCHADDR"
dhcpcd -n
atftp -g -r KIWI/config.$DHCPCHADDR \
-l $CONFIG $TSERVER \
>/dev/null 2>&1
+ if test ! -s $CONFIG;then
+ searchAlternativeConfig
+ fi
test -s $CONFIG || {
Echo "Couldn't get image configuration"
Echo "sleeping [60 sec]..."
@@ -218,7 +235,7 @@
# 9) Is this a diskful station
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
-if [ ! -z $PART ];then
+if [ ! -z "$PART" ] && [ -z "$NFSROOT" ];then
#======================================
# Check for installed system
#--------------------------------------
@@ -276,174 +293,186 @@
#======================================
# 10) 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
- if [ $count = 2 ];then
- imageNextRootDevice=$imageDevice
- fi
- if [ $LOCAL_BOOT = "yes" ];then
- continue
- fi
- if test `getSystemIntegrity $count` = "fine";then
- continue
- fi
- imageName="image/$imageName-$imageVersion"
- imageMD5s="$imageName.md5"
- [ -z "$imageServer" ] && imageServer=$TSERVER
- [ -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
- # ---
- loadStatus=`atftp -g \
- -r $imageMD5s -l /etc/image.md5 $imageServer 2>&1`
- if ! loadOK "$loadStatus";then
- systemException \
- "Failed to load image MD5: $imageName -> no such image MD5" \
- "reboot"
- fi
- IFS=" "
- read sum1 blocks blocksize < /etc/image.md5
- if test -z $DISK;then
- if ! validateRAM;then
+if [ -z "$NFSROOT" ];then
+ 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
+ if [ $count = 2 ];then
+ imageNextRootDevice=$imageDevice
+ fi
+ if [ $LOCAL_BOOT = "yes" ];then
+ continue
+ fi
+ if test `getSystemIntegrity $count` = "fine";then
+ continue
+ fi
+ imageName="image/$imageName-$imageVersion"
+ imageMD5s="$imageName.md5"
+ [ -z "$imageServer" ] && imageServer=$TSERVER
+ [ -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
+ # ---
+ loadStatus=`atftp -g \
+ -r $imageMD5s -l /etc/image.md5 $imageServer 2>&1`
+ if ! loadOK "$loadStatus";then
systemException \
- "Not enough RAM available for this image" \
+ "Failed to load image MD5: $imageName -> no such image MD5" \
"reboot"
fi
- else
- if ! validateSize;then
+ IFS=" "
+ read sum1 blocks blocksize < /etc/image.md5
+ if test -z $DISK;then
+ if ! validateRAM;then
+ systemException \
+ "Not enough RAM available for this image" \
+ "reboot"
+ fi
+ else
+ if ! validateSize;then
+ systemException \
+ "Not enough space available for this image" \
+ "reboot"
+ fi
+ fi
+ validateBlockSize
+ # /.../
+ # now load the image into the imageDevice
+ # ---
+ multicast="-m"
+ if test "$imageZipped" = "compressed"; then
+ Echo "Compressed image found: Disable multicast download"
+ multicast=""
+ test ! -p /dev/compressed_image && mkfifo /dev/compressed_image
+ cat /dev/compressed_image | gzip -d > $imageDevice 2>/dev/null &
+ imageDevice_orig=$imageDevice
+ imageName_orig=$imageName
+ imageDevice="/dev/compressed_image"
+ imageName="$imageName.gz"
+ fi
+ Echo "Loading $imageName [$imageDevice BS:$imageBlkSize Byte]..."
+ loadStatus=`atftp $multicast --option "blksize $imageBlkSize" -g \
+ -r $imageName -l $imageDevice $imageServer 2>&1`
+ if ! loadOK "$loadStatus";then
systemException \
- "Not enough space available for this image" \
+ "Failed to load image: $imageName -> no such image" \
"reboot"
fi
+ if test "$imageZipped" = "compressed"; then
+ imageDevice=$imageDevice_orig
+ imageName=$imageName_orig
+ fi
+ # /.../
+ # check the md5sum of the downloaded data records
+ # ----
+ Echo "Download complete, checking data..."
+ dd if=$imageDevice count=$blocks bs=$blocksize 2>/dev/null |\
+ md5sum - > /etc/ireal.md5
+ 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 test -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
+ echo $imageDevice | grep -q ram
+ haveDataInRam=$?
+ if test ! -z $DISK && test $haveDataInRam != 0;then
+ probeFileSystem $imageRootDevice
+ if test "$FSTYPE" = "reiserfs";then
+ Echo "Resize Reiser filesystem to full partition space..."
+ resize_reiserfs $imageDevice
+ INITRD_MODULES="$INITRD_MODULES reiserfs"
+ fi
+ if test "$FSTYPE" = "ext2";then
+ Echo "Checking EXT2 filesystem..."
+ e2fsck -f $imageDevice -y
+ Echo "Resize EXT2 filesystem to full partition space..."
+ resize2fs -F -p $imageDevice
+ Echo "Checking EXT2 filesystem..."
+ e2fsck -f $imageDevice -y
+ INITRD_MODULES="$INITRD_MODULES ext2"
+ fi
+ if test "$FSTYPE" = "ext3";then
+ Echo "Checking EXT3 filesystem..."
+ e2fsck -f $imageDevice -y
+ Echo "Resize EXT3 filesystem to full partition space..."
+ resize2fs -F -p $imageDevice
+ Echo "Checking EXT3 filesystem..."
+ e2fsck -f $imageDevice -y
+ INITRD_MODULES="$INITRD_MODULES ext3"
+ fi
fi
- validateBlockSize
- # /.../
- # now load the image into the imageDevice
- # ---
- multicast="-m"
- if test "$imageZipped" = "compressed"; then
- Echo "Compressed image found: Disable multicast download"
- multicast=""
- test ! -p /dev/compressed_image && mkfifo /dev/compressed_image
- cat /dev/compressed_image | gzip -d > $imageDevice 2>/dev/null &
- imageDevice_orig=$imageDevice
- imageName_orig=$imageName
- imageDevice="/dev/compressed_image"
- imageName="$imageName.gz"
- fi
- Echo "Loading $imageName [$imageDevice BS:$imageBlkSize Byte]..."
- loadStatus=`atftp $multicast --option "blksize $imageBlkSize" -g \
- -r $imageName -l $imageDevice $imageServer 2>&1`
- if ! loadOK "$loadStatus";then
- systemException \
- "Failed to load image: $imageName -> no such image" \
- "reboot"
- fi
- if test "$imageZipped" = "compressed"; then
- imageDevice=$imageDevice_orig
- imageName=$imageName_orig
- fi
- # /.../
- # check the md5sum of the downloaded data records
- # ----
- Echo "Download complete, checking data..."
- dd if=$imageDevice count=$blocks bs=$blocksize 2>/dev/null |\
- md5sum - > /etc/ireal.md5
- 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 test -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"
+ if test ! -z $DISK && test $haveDataInRam = 0;then
+ Echo "Including RAM device data to disk..."
+ RELOAD_CONFIG="yes"
+ mkdir -p /config
+ mountSystem
+ rm -rf /mnt/lost+found
+ cp -a /mnt/* /config && rm -f /mnt/*
+ umountSystem
fi
- echo
- Echo "Retry to load image..."
- sleep 15
+ rm -f /etc/ireal.md5
+ rm -f /etc/image.md5
done
- echo $imageDevice | grep -q ram
- haveDataInRam=$?
- if test ! -z $DISK && test $haveDataInRam != 0;then
- mountSystem $imageRootDevice
- readFileSystem /mnt/image/config.xml
- umountSystem
- if test "$FSTYPE" = "reiserfs";then
- Echo "Resize Reiser filesystem to full partition space..."
- resize_reiserfs $imageDevice
- INITRD_MODULES="$INITRD_MODULES reiserfs"
- fi
- if test "$FSTYPE" = "ext2";then
- Echo "Checking EXT2 filesystem..."
- e2fsck -f $imageDevice -y
- Echo "Resize EXT2 filesystem to full partition space..."
- resize2fs -F -p $imageDevice
- Echo "Checking EXT2 filesystem..."
- e2fsck -f $imageDevice -y
- INITRD_MODULES="$INITRD_MODULES ext2"
- fi
- if test "$FSTYPE" = "ext3";then
- Echo "Checking EXT3 filesystem..."
- e2fsck -f $imageDevice -y
- Echo "Resize EXT3 filesystem to full partition space..."
- resize2fs -F -p $imageDevice
- Echo "Adding EXT3 journal..."
- tune2fs -j $imageDevice
- Echo "Checking EXT3 filesystem..."
- e2fsck -f $imageDevice -y
- INITRD_MODULES="$INITRD_MODULES ext3"
- fi
- fi
- if test ! -z $DISK && test $haveDataInRam = 0;then
- Echo "Including RAM device data to disk..."
- RELOAD_CONFIG="yes"
- mkdir -p /config
- mountSystem
- rm -rf /mnt/lost+found
- cp -a /mnt/* /config && rm -f /mnt/*
- umountSystem
- fi
- rm -f /etc/ireal.md5
- rm -f /etc/image.md5
-done
+else
+ 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
+ Echo "Mounting NFS root system: $nfsRootServer:$nfsRootDevice..."
+ imageRootDevice="-o nolock,rw $nfsRootServer:$nfsRootDevice"
+ imageRootName="NFSRoot-System"
+ systemIntegrity="clean"
+ done
+fi
#======================================
# 11) Check for RELOAD_CONFIG
@@ -515,7 +544,7 @@
#======================================
# 14) send DHCP_RELEASE, reset cache
#--------------------------------------
-if [ $LOCAL_BOOT = "no" ];then
+if [ $LOCAL_BOOT = "no" ] && [ -z "$NFSROOT" ];then
if test $systemIntegrity = "clean";then
dhcpcd -k
fi
@@ -524,7 +553,7 @@
#======================================
# 15) Check if this is a split image
#--------------------------------------
-if test ! -z $COMBINED_IMAGE; then
+if [ ! -z "$COMBINED_IMAGE" ] && [ -z "$NFSROOT" ]; then
READ_ONLY_SYSTEM=system
mkdir -p /mnt/$READ_ONLY_SYSTEM && \
mount $imageNextRootDevice /mnt/$READ_ONLY_SYSTEM
@@ -540,13 +569,13 @@
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
if test $systemIntegrity = "clean";then
- readFileSystem /mnt/image/config.xml
+ probeFileSystem $imageRootDevice
kernelList /mnt
fi
fi
#======================================
-# 17) make kernel/initrd available on unionfs
+# 17) make initrd available on unionfs
#--------------------------------------
if [ $LOCAL_BOOT = "no" ];then
if test ! -z "$UNIONFS_CONFIG" && test $systemIntegrity = "clean";then
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kiwi/system/boot/xennetboot/suse-preinit new/kiwi/system/boot/xennetboot/suse-preinit
--- old/kiwi/system/boot/xennetboot/suse-preinit 2007-03-21 16:34:02.000000000 +0100
+++ new/kiwi/system/boot/xennetboot/suse-preinit 2007-05-11 11:51:08.000000000 +0200
@@ -109,3 +109,13 @@
fi
done
fi
+
+#======================================
+# 7) setup network for nfs boot
+#--------------------------------------
+if test ! -z $NFSROOT;then
+ mount -o nolock -t proc proc /proc
+ mount -o nolock -t sysfs sysfs /sys
+ mount -o nolock -t devpts devpts /dev/pts
+ /etc/init.d/portmap start
+fi
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org