Hmm, tried to send this a few hours ago, but the list says my post is
too long and is awaiting apporval from the moderator. I've shortened
the attachment this time. I hope it gets through.
I've been meaning to test my fixes on other platforms here and then post
individual bug reports, but I got pulled off onto other things these
last 2 weeks. I'm attaching my full debugging notes. I came up with
something like 12 bugs and fixes, and then rebuilt custom rpms.
On Fri, Dec 02, 2005 at 10:30:08AM -0800, Bernard Li wrote:
> Hey Ashley:
>
> FYI, this is already fixed in trunk:
>
> http://svn.sisuite.org/diff.php?repname=systemimager&path=%2Ftrunk%2Flib
> %2FSystemImager%2FUseYourOwnKernel.pm&rev=0&sc=0
>
> Do you have any other related patches?
>
> Thanks,
>
> Bernard
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf
> > Of Ashley Gould
> > Sent: Friday, December 02, 2005 9:46
> > To: [email protected]
> > Subject: Re: [Sisuite-users] Having issues with 3.5.3 in prepareclient
> >
> > I found a bunch of issues running 3.5.3 on an rpm system
> > (SLES9). This one
> > is because the perl code which created the initrd does not
> > provide enough
> > space in the loopback file. Here is extract from my notes:
> >
> > ______
> > BUG 3: UseYourOwnKernel.pm: sub _create_initrd_ext2: 534-539
> > incorrect sizing when creating loopback file.
> >
> > FIX: increase $breathing_room to 2000
> >
> > NOTE: this would be better controlled by making
> > $breathing_room
> > some value relative to total size of $staging_dir or
> > perhaps the
> > number of blocks mke2fs wants to create. It's beyond me.
> >
> >
> >
> > There is not enough space on the loopback device to
> > accomodate the entire
> > initrd. The loopback file is too small.
> >
> > # Source of initrd: 18MG
> > osiris:~ # du -ks /tmp/.systemimager.1
> > 17971 /tmp/.systemimager.1
> >
> > # loopback file: 18MG
> > osiris:~ # du -ks /etc/systemimager/boot/initrd
> > 18090 /etc/systemimager/boot/initrd
> >
> > # loopback file mounted: 16MB
> > osiris:~ # df |grep systemimager
> > /etc/systemimager/boot/initrd
> > 16185 16185 0 100%
> > /tmp/.systemimager.2
> >
> > The loopback file needs to be 2000 blocks larger. The available space
> > in the mounted ext2 filesystem is much less than the size of
> > the loopback file.
> > Perhaps we loose a lot of blocks to administrative space.
> > Does this vary
> > proportionally to fs size?
> >
> >
> >
> >
> >
> > Here's the code
> >
> > sub _create_initrd_ext2($$) {
> >
> > my $staging_dir = shift;
> > my $boot_dir = shift;
> > my $new_initrd = $boot_dir . "/initrd";
> > my $new_initrd_mount_dir = _mk_tmp_dir();
> > print ">>> New initrd mount point:
> > $new_initrd_mount_dir\n" if($verbose);
> > eval { mkpath($new_initrd_mount_dir, 0, 0755) };
> > if ($@) {
> > die "Couldn't mkpath $new_initrd_mount_dir $@";
> > }
> >
> > my $cmd;
> >
> > # loopback file
> > chomp(my $size = `du -ks $staging_dir`);
> > $size =~ s/\s+.*$//;
> > #my $breathing_room = 100;
> > my $breathing_room = 2000;
> > $size = $size + $breathing_room;
> > run_cmd("dd if=/dev/zero of=$new_initrd bs=1024
> > count=$size", $verbose, 1);
> >
> >
> >
> > The patch:
> >
> > gemini0:~ # diff -Naur UseYourOwnKernel.pm.orig
> > UseYourOwnKernel.pm.ash-fix
> > ---
> > /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm.or
> > ig 2005-10-25 15:16:41.000000000 -0700
> > +++
> > /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm.as
> > h-fix 2005-11-16 15:08:37.251119171 -0800
> > @@ -534,7 +534,7 @@
> > # loopback file
> > chomp(my $size = `du -ks $staging_dir`);
> > $size =~ s/\s+.*$//;
> > - my $breathing_room = 100;
> > + my $breathing_room = 2000;
> > $size = $size + $breathing_room;
> > run_cmd("dd if=/dev/zero of=$new_initrd bs=1024
> > count=$size", $verbose, 1);
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Wed, Nov 30, 2005 at 02:48:19AM -0800, Jeremy Hansen wrote:
> > > I'm attempting to do a prepareclient on a Red Hat EL4
> > client. This is the
> > > result:
> > >
> > > Using "sfdisk" to gather information about disk:
> > > /dev/hda
> > >
> > > Use of uninitialized value in hash element at
> > > /usr/lib/systemimager/perl/SystemImager/Common.pm line
> > 1036, <FH_IN> line
> > > 10.
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/jbd/jbd.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/ext3/ext3.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/net/mii.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/net/e100.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/net/e1
> > 000/e1000.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/pci/ho
> > tplug/shpchp.k
> > > o
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/usb/ho
> > st/uhci-hcd.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/acpi/ac.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/acpi/b
> > attery.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/acpi/button.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/md/dm-mod.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/md/dm-
> > mirror.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/net/sunrpc/sunrpc.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lockd/lockd.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/nfs/nfs.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/i2c/i2
> > c-core.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/i2c/i2c-dev.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/autofs4/autofs4.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/parpor
> > t/parport.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/char/lp.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/parpor
> > t/parport_pc.k
> > > o
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/net/ipv6/ipv6.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/crypto/md5.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/net/lustre/libcfs.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/net/lustre/portals.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/net/lustre/ksocknal.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lustre/lvfs.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lustre/obdclass.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lustre/ptlrpc.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lustre/osc.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lustre/lov.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lustre/mdc.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/fs/lustre/llite.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/block/loop.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/char/ppdev.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/net/tun.ko
> > > Adding:
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/net/slhc.ko
> > > Adding:
> > >
> > /lib/modules/2.6.9-22.0.1.EL_SFS2.0_2smp/kernel/drivers/net/pp
> > p_generic.ko
> > > >>> Filesystem for new initrd: ext2
> > > >>> Creating new initrd from: /tmp/.systemimager.6
> > > >>> find /tmp/.systemimager.6 -depth -exec touch -t
> > 196912311900 '{}' ';'
> > > >>> New initrd mount point: /tmp/.systemimager.7
> > > >>> dd if=/dev/zero of=/etc/systemimager/boot/initrd
> > bs=1024 count=38152
> > > 38152+0 records in
> > > 38152+0 records out
> > >
> > > >>> mke2fs -m 0 -N 378 -F /etc/systemimager/boot/initrd
> > > mke2fs 1.35 (28-Feb-2004)
> > > /etc/systemimager/boot/initrd is mounted; mke2fs forced
> > anyway. Hope
> > > /etc/mtab is incorrect.
> > > Filesystem label=
> > > OS type: Linux
> > > Block size=1024 (log=0)
> > > Fragment size=1024 (log=0)
> > > 400 inodes, 38152 blocks
> > > 0 blocks (0.00%) reserved for the super user
> > > First data block=1
> > > Maximum filesystem blocks=39321600
> > > 5 block groups
> > > 8192 blocks per group, 8192 fragments per group
> > > 80 inodes per group
> > > Superblock backups stored on blocks:
> > > 8193, 24577
> > >
> > > Writing inode tables: done
> > > Writing superblocks and filesystem accounting information: done
> > >
> > > This filesystem will be automatically checked every 32 mounts or
> > > 180 days, whichever comes first. Use tune2fs -c or -i to override.
> > >
> > > >>> mount /etc/systemimager/boot/initrd
> > /tmp/.systemimager.7 -o loop -t ext2
> > >
> > > >>> tar -C /tmp/.systemimager.6 -cf - . | tar -C
> > /tmp/.systemimager.7 -xf -
> > > tar: ./dev/log: socket ignored
> > > tar: ./usr/sbin/chroot: Cannot write: No space left on device
> > > tar: Unexpected EOF in archive
> > > tar: Error is not recoverable: exiting now
> > > FAILED: tar -C /tmp/.systemimager.6 -cf - . | tar -C
> > /tmp/.systemimager.7
> > > -xf - at
> > /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm line
> > > 649.
> > >
> > > I'm seeing recommendation on the list to use 3.5.3 with a
> > 2.6 kernel but I'm
> > > also seeing a lot of issues related to 3.5.3. Is there
> > something I'm doing
> > > wrong here? The packages I'm using are from oscar-4.2.
> > >
> > > Also, it seems it was necessary to install:
> > >
> > > systemimager-i386boot-standard-3.5.3-3oscar
> > > systemimager-server-3.5.3-3oscar
> > >
> > > On the client to get this far, which seemed strange.
> > >
> > > Thanks
> > > -jeremy
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Splunk Inc. Do you grep
> > through log files
> > > for problems? Stop! Download the new AJAX search engine that makes
> > > searching your log files as easy as surfing the web.
> > DOWNLOAD SPLUNK!
> > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > > _______________________________________________
> > > Sisuite-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/sisuite-users
> >
> > --
> >
> > -ashley
> >
> > Did you try poking at it with a stick?
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep
> > through log files
> > for problems? Stop! Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the web.
> > DOWNLOAD SPLUNK!
> > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > _______________________________________________
> > Sisuite-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/sisuite-users
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op?ick
> _______________________________________________
> Sisuite-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sisuite-users
>
--
-ashley
Did you try poking at it with a stick?
systemimager 3.5.3
________________________________________________________________________________
________________________________________________________________________________
11/14/2005
I'm now trying to modify the si_prepareclient and UseYourOwnKernel.pm so
I can build my bug fixes into an rpm. I should also try the 3.5.3 rpms put
out by whosits.
______
BUG 1: in UseYourOwnKernel.pm: line 445
si_prepareclient crashes after trying to run find command:
run_cmd("find $staging_dir -depth -exec touch -t 196912311900 '{}'
';'");
Fix: comment out line 445
Perhaps the syntax is wrong for my flavor of linux (SLES9), but the find
command would run for 5 minutes, exit with errors, si_prepareclient exits
with errors...
... and then the client system reboots itself!
go figure. perhaps it was looping on device files. I don't know.
My question: how does adjusting timestamp of all files in the staging_dir
reduce the size of the resulting initrd? I don't see any date comparisons
anywhere else in the pm.
The Patch:
gemini0:/usr/lib/systemimager/perl/SystemImager # diff -Naur
UseYourOwnKernel.pm.orig UseYourOwnKernel.pm.ash-fix
--- UseYourOwnKernel.pm.orig 2005-10-25 15:16:41.000000000 -0700
+++ UseYourOwnKernel.pm.ash-fix 2005-11-16 15:08:37.251119171 -0800
@@ -442,7 +442,7 @@
print ">>> Creating new initrd from: $staging_dir\n" if( $verbose );
# Sean Dague's little jewel that helps keep the size down. -BEF-
- run_cmd("find $staging_dir -depth -exec touch -t 196912311900 '{}'
';'");
+ #run_cmd("find $staging_dir -depth -exec touch -t 196912311900 '{}'
';'");
switch ($fs) { # Sizes
from a sample run with the same data
case 'cramfs' { _create_initrd_cramfs( $staging_dir,
$boot_dir) } # 1107131 bytes
______
BUG 2: si_prepareclient quietly exits at first user screen when systax
is wrong. No hints as to why. Need better error checking command
line user input in si_prepareclient.
FIX: none made
osiris:~ # si_prepareclient --no-rsyncd -e /dist /windows/ --server
penny.ucop.edu
Welcome to the SystemImager si_prepareclient command. This command may modify
the following files to prepare your golden client for having it's image
retrieved by the imageserver. It will also create the /etc/systemimager
directory and fill it with information about your golden client. All modified
[cut]
See "si_prepareclient --help" for command line options.
Use of uninitialized value in pattern match (m//) at /usr/sbin/si_prepareclient
line 264.
Continue? (y/[n]): Client prepartion cancelled. No files modified.
osiris:~ #
A Ha! I supplied bad command line imput. I forgot the "-e" in front of
second excluded dir. recommend error checking command line user input.
______
BUG 3: UseYourOwnKernel.pm: sub _create_initrd_ext2: 534-539
incorrect sizing when creating loopback file.
FIX: increase $breathing_room to 2000
NOTE: this would be better controlled by making $breathing_room
some value relative to total size of $staging_dir or perhaps the
number of blocks mke2fs wants to create. It's beyond me.
There is not enough space on the loopback device to accomodate the entire
initrd. The loopback file is too small.
# Source of initrd: 18MG
osiris:~ # du -ks /tmp/.systemimager.1
17971 /tmp/.systemimager.1
# loopback file: 18MG
osiris:~ # du -ks /etc/systemimager/boot/initrd
18090 /etc/systemimager/boot/initrd
# loopback file mounted: 16MB
osiris:~ # df |grep systemimager
/etc/systemimager/boot/initrd
16185 16185 0 100% /tmp/.systemimager.2
The loopback file needs to be 2000 blocks larger. The available space
in the mounted ext2 filesystem is much less than the size of the loopback file.
Perhaps we loose a lot of blocks to administrative space. Does this vary
proportionally to fs size?
Here's the code
sub _create_initrd_ext2($$) {
my $staging_dir = shift;
my $boot_dir = shift;
my $new_initrd = $boot_dir . "/initrd";
my $new_initrd_mount_dir = _mk_tmp_dir();
print ">>> New initrd mount point: $new_initrd_mount_dir\n"
if($verbose);
eval { mkpath($new_initrd_mount_dir, 0, 0755) };
if ($@) {
die "Couldn't mkpath $new_initrd_mount_dir $@";
}
my $cmd;
# loopback file
chomp(my $size = `du -ks $staging_dir`);
$size =~ s/\s+.*$//;
#my $breathing_room = 100;
my $breathing_room = 2000;
$size = $size + $breathing_room;
run_cmd("dd if=/dev/zero of=$new_initrd bs=1024 count=$size", $verbose,
1);
The patch:
gemini0:~ # diff -Naur UseYourOwnKernel.pm.orig UseYourOwnKernel.pm.ash-fix
--- /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm.orig
2005-10-25 15:16:41.000000000 -0700
+++ /usr/lib/systemimager/perl/SystemImager/UseYourOwnKernel.pm.ash-fix
2005-11-16 15:08:37.251119171 -0800
@@ -534,7 +534,7 @@
# loopback file
chomp(my $size = `du -ks $staging_dir`);
$size =~ s/\s+.*$//;
- my $breathing_room = 100;
+ my $breathing_room = 2000;
$size = $size + $breathing_room;
run_cmd("dd if=/dev/zero of=$new_initrd bs=1024 count=$size",
$verbose, 1);
________________________________________________________________________________
11/16/2005
The next set of bugs occur in the init scripts during initial boot. These
come from the initrd_template:
/usr/share/systemimager/boot/i386/standard/initrd_template/etc/init.d/rcS
/usr/share/systemimager/boot/i386/standard/initrd_template/etc/init.d/functions
______
BUG 4: etc/init.d/functions: mount_proc()
syntax error in mount command. mkdir call does not create
correct mount point, because only relative path to proc is
specified:
FIX: set full pathname in mkdir call
mount_proc() {
logmsg
logmsg mount_proc
#mkdir -p proc || shellout
mkdir -p /proc || shellout
mount proc /proc -t proc || shellout
}
The Patch:
diff -Naur functions.orig functions.ash-fix
--- functions.orig 2005-11-16 12:15:20.782705036 -0800
+++ functions.ash-fix 2005-11-16 14:48:47.734006263 -0800
@@ -606,7 +618,7 @@
mount_proc() {
logmsg
logmsg mount_proc
- mkdir -p proc || shellout
+ mkdir -p /proc || shellout
mount proc /proc -t proc || shellout
}
#
NOTE: this may only be a bug when called from switch_root_to_tmpfs()
the subsequent call is made after pivot_root is run. It may be
ok to use relative path at that point. I need to confirm this.
______
BUG 5: etc/init.d/functions: mount_dev_on_devfs()
Assumes boot kernel has devfs support. This fails when initrd.img
was created with UseYourOwnKernel.pm on non-devfs systems.
FIX: test for devfs support before rsync of / into /new-root
and again before attempting to mount /dev on devfs
diff -Naur functions.orig functions.ash-fix
--- functions.orig 2005-11-16 12:15:20.782705036 -0800
+++ functions.ash-fix 2005-11-16 14:48:47.734006263 -0800
@@ -531,7 +531,6 @@
tmpfs_nr_blocks=$(tr ' ' '\n' < /proc/cmdline | grep tmpfs_nr_blocks\= |
sed 's/.*=//')
tmpfs_nr_inodes=$(tr ' ' '\n' < /proc/cmdline | grep tmpfs_nr_inodes\= |
sed 's/.*=//')
tmpfs_mode=$(tr ' ' '\n' < /proc/cmdline | grep tmpfs_mode\= | sed
's/.*=//')
- umount /proc
if [ "$tmpfs_size" != "" ]; then
tmpfs_opts="size=$tmpfs_size"
@@ -570,7 +569,15 @@
mkdir -p /new_root || shellout
mount tmpfs /new_root -t tmpfs $tmpfs_opts || shellout
cd / || shellout
- rsync -a --exclude='/proc' --exclude='/dev' * /new_root/ || shellout
+
+ # Check devfs in enabled in the kernel
+ if `grep "\<devfs\>" /proc/filesystems > /dev/null 2>&1`; then
+ rsync -a --exclude='/proc' --exclude='/dev' * /new_root/ || shellout
+ else
+ rsync -a --exclude='/proc' * /new_root/ || shellout
+ fi
+
+ umount /proc
cd /new_root || shellout
mkdir -p old_root || shellout
pivot_root . old_root || shellout
@@ -591,12 +598,17 @@
logmsg
logmsg mount_dev_on_devfs
# Re-mount /dev on devfs. -BEF-
- mkdir -p /dev || shellout
- mount devfs /dev -t devfs || shellout
-
- # Crank up devfsd
- echo -n '>>> '
- /sbin/devfsd /dev || shellout
+ # but only if devfs is enabled -AG-
+ if `grep "\<devfs\>" /proc/filesystems > /dev/null 2>&1`; then
+ mkdir -p /dev || shellout
+ mount devfs /dev -t devfs || shellout
+
+ # Crank up devfsd
+ echo -n '>>> '
+ /sbin/devfsd /dev || shellout
+ else
+ logmsg "devfs not available, using standard /dev"
+ fi
}
#
Also:
To insure /proc is mounted before running the test for devfs, run mount_proc()
before mount_dev_on_devfs:
diff -Naur rcS.orig rcS.ash-fix
--- rcS.orig 2005-11-16 14:19:49.761690511 -0800
+++ rcS.ash-fix 2005-11-16 14:50:48.846704311 -0800
@@ -40,10 +40,10 @@
#
switch_root_to_tmpfs
-mount_dev_on_devfs
-
mount_proc
+mount_dev_on_devfs
+
# this must be here to avoid read only fs errors, or other ugly stuff. -BEF-
check_version
______
BUG 6: etc/init.d/functions: check_version():
fails under UYOK as it compares the running kernel with
the version of systemimager. This works only if we use the boel
kernel that comes with systemimager:
the code:
# Variables
#
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/tmp
SCRIPTS=scripts
SCRIPTS_DIR=/scripts
FLAMETHROWER_DIRECTORY_DIR=/var/lib/systemimager/flamethrower
BOEL_BINARIES_DIR=/tmp/boel_binaries
VERSION="3.5.3"
[cut]
# check_version
#
# Usage: check_version
check_version() {
logmsg
logmsg check_version
INITRD_VERSION=$VERSION
KERNEL_VERSION=`uname -r | sed -e s/.*boel_v//`
if [ "$INITRD_VERSION" != "$KERNEL_VERSION" ] ; then
logmsg "FATAL: Kernel version ($KERNEL_VERSION) doesn't match initrd
version ($INITRD_VERSION)!"
shellout
fi
}
FIX: I modified UseYourOwnKernel.pm.orig to create a version file in
the root of the uyok initrd and test against it in check_version():
gemini0:/usr/lib/systemimager/perl/SystemImager # diff -Naur
UseYourOwnKernel.pm.orig UseYourOwnKernel.pm.ash-fix
--- UseYourOwnKernel.pm.orig 2005-10-25 15:16:41.000000000 -0700
+++ UseYourOwnKernel.pm.ash-fix 2005-11-16 16:06:32.738077417 -0800
@@ -57,6 +57,16 @@
$cmd = qq(rsync -a
/usr/share/systemimager/boot/$arch/standard/initrd_template/ $staging_dir/);
!system( $cmd ) or die( "Couldn't $cmd." );
+
+ #
+ # Create UYOK initrd.img version file
+ #
+ my $verion_file = "$staging_dir/initrd_version.uyok";
+ open( FILE,">>$version_file" ) or die( "Couldn't open $version_file for
appending" );
+ my $uname_r = get_uname_r();
+ print FILE "$uname_r\n";
+ close(FILE);
+
#
# add modules and insmod commands
#
diff -Naur functions.orig functions.ash-fix
--- functions.orig 2005-11-16 12:15:20.782705036 -0800
+++ functions.ash-fix 2005-11-16 16:26:22.995944715 -0800
@@ -97,7 +97,12 @@
check_version() {
logmsg
logmsg check_version
- INITRD_VERSION=$VERSION
+ # check if using UYOK initrd
+ if [ -f /initrd_version.uyok ]; then
+ INITRD_VERSION=`cat /initrd_version.uyok`
+ else
+ INITRD_VERSION=$VERSION
+ fi
KERNEL_VERSION=`uname -r | sed -e s/.*boel_v//`
if [ "$INITRD_VERSION" != "$KERNEL_VERSION" ] ; then
logmsg "FATAL: Kernel version ($KERNEL_VERSION) doesn't match initrd
version ($INITRD_VERSION)!"
______
BUG 7: sbin/insmod is dynamically compiled against libs not in initrd.
Loading of modules fails during init.
FIX: Edit make rules to install statically compiled version of insmod
Building of insmod is controlled by:
initrd_source/src/module-init-tools-3.2-pre7/Makefile.am
initrd_source/src/module-init-tools-3.2-pre7/Makefile.in
these setup compile flags to build both an insmod (dynamically linked)
and insmod_static which is statically compiled. The changes I made
are to the install rules only. Both binaries get compiled, but the
insmod_static gets placed into the initrd_template as sbin/insmod
I edited 2 .rul files to achieve this:
initrd_source/make.d/module-init-tools.rul
initrd_source/initrd.rul
[EMAIL PROTECTED]:~/build/systemimager-3.5.3.ashfix/initrd_source/make.d> diff
-Naur module-init-tools.rul.orig module-init-tools.rul
--- module-init-tools.rul.orig 2005-11-16 23:55:21.000000000 -0800
+++ module-init-tools.rul 2005-11-16 23:55:39.000000000 -0800
@@ -14,7 +14,7 @@
ifeq ($(MODULE_UTILS),module-init-tools)
ALL_SOURCE += $(INITRD_SRC_DIR)/$(MODULE_INIT_TOOLS_TARBALL)
-INSMOD_BINARY = $(INITRD_SRC_DIR)/$(MODULE_INIT_TOOLS_DIR)/insmod
+INSMOD_BINARY = $(INITRD_SRC_DIR)/$(MODULE_INIT_TOOLS_DIR)/insmod_static
MODPROBE_BINARY = $(INITRD_SRC_DIR)/$(MODULE_INIT_TOOLS_DIR)/modprobe
DEPMOD_BINARY = $(INITRD_SRC_DIR)/$(MODULE_INIT_TOOLS_DIR)/depmod
[EMAIL PROTECTED]:~/build/systemimager-3.5.3.ashfix/initrd_source> diff -Naur
initrd.rul.orig initrd.rul
--- initrd.rul.orig 2005-11-16 23:45:39.000000000 -0800
+++ initrd.rul 2005-11-17 23:37:40.000000000 -0800
@@ -139,7 +139,7 @@
ifdef INSMOD_BINARY
( [ ! -e $(INITRD_BUILD_DIR)/sbin/$(INSMOD_BINARY) ] && \
- cp -a $(INSMOD_BINARY) $(INITRD_BUILD_DIR)/sbin ) || \
+ cp -a $(INSMOD_BINARY) $(INITRD_BUILD_DIR)/sbin/insmod ) || \
( echo "$(INITRD_BUILD_DIR)/sbin/$(INSMOD_BINARY) already exists." &&\
echo "Is insmod maybe already provided by busybox?" && exit 1 )
endif
BTW: the existance test [ ! -e $(INITRD_BUILD_DIR)/sbin/$(INSMOD_BINARY) ]
will always be false, because the expression
$(INITRD_BUILD_DIR)/sbin/$(INSMOD_BINARY) is not correct. Expands to:
/usr/src/packages/BUILD/systemimager-3.5.3.ashfix/initrd_source/build_dir/sbin//usr/src/packages/BUILD/systemimager-3.5.3.ashfix/initrd_source/src/module-init-tools-3.2-pre7/insmod
______
BUG 8: dhclient fails is CONFIG_PACKET not enabled in kernel.
SuSE builds CONFIG_PACKET as module (af_packet).
FIX: modify UseYourOwnKernel.pm to test for && load module af_packet
before gathering mudules list into my_modules/INSMOD_COMMANDS.
NOTE: this is a hack and my not port well.
gemini0:/usr/lib/systemimager/perl/SystemImager # diff -Naur
UseYourOwnKernel.pm.orig UseYourOwnKernel.pm.ash-fix
--- UseYourOwnKernel.pm.orig 2005-10-25 15:16:41.000000000 -0700
+++ UseYourOwnKernel.pm.ash-fix 2005-11-17 01:03:44.154427572 -0800
@@ -67,6 +67,14 @@
my $uname_r = get_uname_r();
my $module_paths = `find /lib/modules/$uname_r`;
+ # test for af_packet. needed for dhclient during install -AG-
+ my $af_packet_mod = `find /lib/modules/$uname_r -name af_packet*`;
+ chomp $af_packet_mod;
+ if (-f "$af_packet_mod") {
+ my $cmd = "/sbin/modprobe af_packet >/dev/null 2>&1";
+ !system($cmd) or die("Couldn't $cmd");
+ }
+
my @modules = get_load_ordered_list_of_running_modules();
foreach( @modules ) {
______
BUG 9: Creation of LVM volume groups fail during autinstall because
device mapper cannot create /dev/mapper/<vg_name> files - they
already exist in initrd.
FIX: Remove device mapper names from /dev during setup of initrd.img
When si_prepareclient compiles files for the UYOK initrd.img, it
copies all of dev, including files previously created by LVM device mapper
(e.g. /dev/system). Trouble is when autoinstall scripts attempt to
create the 'system' volume group, it fails because the /dev/system
directory already exists.
penny:/tftpboot/tmp/mnt/dev # ll system/
total 117
dr-x------ 2 root root 1024 Oct 25 04:35 .
drwxr-xr-x 35 root root 117760 Oct 25 11:37 ..
lrwxrwxrwx 1 root root 23 Oct 25 15:52 home -> /dev/mapper/system-home
lrwxrwxrwx 1 root root 22 Oct 25 15:52 tmp -> /dev/mapper/system-tmp
lrwxrwxrwx 1 root root 22 Oct 25 15:52 usr -> /dev/mapper/system-usr
lrwxrwxrwx 1 root root 22 Oct 25 15:52 var -> /dev/mapper/system-var
# bash version:
for vg in $(vgs --noheadings --options vg_name); do find dev -name $vg*
| xargs -r rm -rf; done
The Patch:
gemini0:/usr/lib/systemimager/perl/SystemImager # diff -Naur
UseYourOwnKernel.pm.orig UseYourOwnKernel.pm.ash-fix
--- UseYourOwnKernel.pm.orig 2005-10-25 15:16:41.000000000 -0700
+++ UseYourOwnKernel.pm.ash-fix 2005-11-18 01:46:39.850542810 -0800
@@ -96,6 +104,27 @@
#
$cmd = qq(rsync -a /dev/ $staging_dir/dev/);
!system( $cmd ) or die( "Couldn't $cmd." );
+
+ #
+ # Remove LVM device mapper files from $staging_dir/dev
+ #
+ $cmd = qq(vgs --noheadings --separator S --options vg_name 2>/dev/null);
+ open(VG, "$cmd|");
+ foreach my $vg_name (<VG>) {
+ chomp $vg_name;
+ $vg_name =~ s/^\s+//;
+ my $find_cmd = qq(find $staging_dir/dev/ -name $vg_name* |
xargs rm -rf);
+ !system( $find_cmd ) or die( "Couldn't $find_cmd" );
+ }
+ close(VG);
[cut]
______
BUG 10: Incorrect sizing of logical volumes in Common.pm: save_lvm_information()
The lvdisplay command reports size of LVs in 512 byte units instead
of kilobytes when using "-c" flag. This is a bug in lvm tools.
Fix: replace lvdisplay with command lvs
gemini0:/usr/lib/systemimager/perl/SystemImager # diff -Naur Common.pm.orig
Common.pm.ash-fix
--- Common.pm.orig 2005-11-17 15:49:25.510700890 -0800
+++ Common.pm.ash-fix 2005-11-17 22:44:31.654449022 -0800
@@ -797,19 +797,15 @@
print OUT "\t<lvm_group name=\"$vg_name\"
max_log_vols=\"$vg_max_log_vols\" max_phys_vols=\"$vg_max_phys_vols\"
phys_exent_size=\"${vg_phys_extent_size}K\">\n";
# Print logical volumes informations for this group -AR-
- $cmd = "lvdisplay -c 2>/dev/null";
+ $cmd = "lvs --noheadings --nosuffix --units k --options
lv_name,vg_name,lv_size 2>/dev/null";
open(LV, "$cmd|");
- foreach my $lv_line (<LV>) {
- $lv_line =~ s/^ //;
- my @lv_data = split(/:/, $lv_line);
-
- my $lv_group_name = $lv_data[1];
+ while (<LV>) {
+ my ($lv_dev, $lv_group_name, $lv_size) = split;
+ $lv_size =~ s/\.\d+//; # strip mantisa from lv_size
+
unless ($lv_group_name eq $vg_name) {
next;
}
- my $lv_dev = $lv_data[0];
- $lv_dev =~ s/^.*\///;
- my $lv_size = $lv_data[6];
print OUT "\t\t<lv name=\"$lv_dev\" size=\"${lv_size}K\" />\n";
}
______
BUG 11: rpm build of systemimager-client does not include the initrd_template.
FIX: edit systemimager.spec to include initrd_template in %files def
for systemimager-client.
[EMAIL PROTECTED]:~/build/systemimager-3.5.3.ashfix> diff -Naru
systemimager.spec.orig systemimager.spec
--- systemimager.spec.orig 2005-11-16 17:13:51.000000000 -0800
+++ systemimager.spec 2005-11-17 03:01:30.000000000 -0800
@@ -1,5 +1,5 @@
%define name systemimager
-%define ver 3.5.3
+%define ver 3.5.3.ashfix
%define rel 1
%define prefix /usr
%define _build_all 1
@@ -191,6 +191,10 @@
process.
%changelog
+* Wed Nov 16 2005 Ashley Gould <[EMAIL PROTECTED]>
+- lots of bug fixes for use on SLES9
+- see
isis:/home/agould/ucop/projects/sis/debugging_systemimager-3.5.3-1_sources
+
* Mon Aug 08 2005 Bernard Li <[EMAIL PROTECTED]>
- Changed requirement of perl-XML-Simple to perl(XML::Simple)
- Changed requirement of perl-TermReadKey to perl(Term::ReadKey)
@@ -553,6 +557,8 @@
%prefix/share/man/man8/si_updateclient*
%prefix/share/man/man8/si_prepareclient*
%prefix/lib/systemimager/perl/SystemImager/Client.pm
+%dir
%prefix/share/systemimager/boot/%{_build_arch}/%{_boot_flavor}/initrd_template/
+%prefix/share/systemimager/boot/%{_build_arch}/%{_boot_flavor}/initrd_template/*
%files flamethrower
%defattr(-, root, root)
________________________________________________________________________________
________________________________________________________________________________
11/18/2005
building my changes into rpms
I named my custom systemimager distro systemimager-3.5.3.ashfix.
Here is the full list of files I modified:
systemimager-3.5.3.ashfix/systemimager.spec
systemimager-3.5.3.ashfix/lib/SystemImager/Common.pm
systemimager-3.5.3.ashfix/lib/SystemImager/UseYourOwnKernel.pm
systemimager-3.5.3.ashfix/initrd_source/skel/etc/init.d/functions
systemimager-3.5.3.ashfix/initrd_source/skel/etc/init.d/rcS
systemimager-3.5.3.ashfix/initrd_source/make.d/module-init-tools.rul
systemimager-3.5.3.ashfix/initrd_source/initrd.rul
To build rpms:
NOTE: I must have /sbin, /usr/sbin in my path when building with sudo.
[EMAIL PROTECTED]:~/build> tar jcvf systemimager-3.5.3.ashfix.tar.bz2
systemimager-3.5.3.ashfix
[EMAIL PROTECTED]:~/build> sudo cp systemimager-3.5.3.ashfix.tar.bz2
/usr/src/packages/SOURCES/
Password:
[EMAIL PROTECTED]:~/build> cd systemimager-3.5.3.ashfix/
[EMAIL PROTECTED]:~/build/systemimager-3.5.3.ashfix> sudo rpmbuild -ba
systemimager.spec |tee /tmp/si_rpmbuild.out.20051118
Wrote: /usr/src/packages/SRPMS/systemimager-3.5.3.ashfix-1.src.rpm
Wrote:
/usr/src/packages/RPMS/noarch/systemimager-server-3.5.3.ashfix-1.noarch.rpm
Wrote:
/usr/src/packages/RPMS/noarch/systemimager-flamethrower-3.5.3.ashfix-1.noarch.rpm
Wrote:
/usr/src/packages/RPMS/noarch/systemimager-common-3.5.3.ashfix-1.noarch.rpm
Wrote:
/usr/src/packages/RPMS/noarch/systemimager-client-3.5.3.ashfix-1.noarch.rpm
Wrote:
/usr/src/packages/RPMS/noarch/systemimager-i386boot-standard-3.5.3.ashfix-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.38871
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd systemimager-3.5.3.ashfix
+ exit 0
________________________________________________________________________________
________________________________________________________________________________
11/18/2005
only one of my fixes needed help. In BUG 9 the vgs command allowed
trailing space, which screwed up the find. I cleaned it up.
[EMAIL PROTECTED]:~/build/systemimager-3.5.3.ashfix/lib/SystemImager> diff
-Naur UseYourOwnKernel.pm-ashfix.0 UseYourOwnKernel.pm
--- UseYourOwnKernel.pm-ashfix.0 2005-11-18 21:52:07.000000000 -0800
+++ UseYourOwnKernel.pm 2005-11-18 21:52:56.000000000 -0800
@@ -108,10 +108,11 @@
#
# Remove LVM device mapper files from $staging_dir/dev
#
- $cmd = qq(vgs --noheadings --options vg_name 2>/dev/null);
+ $cmd = qq(vgs --noheadings --separator S --options vg_name 2>/dev/null);
open(VG, "$cmd|");
foreach my $vg_name (<VG>) {
chomp $vg_name;
+ $vg_name =~ s/^\s+//;
my $find_cmd = qq(find $staging_dir/dev/ -name $vg_name* | xargs rm
-rf);
!system( $find_cmd ) or die( "Couldn't $find_cmd" );
}