diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-03-24 15:47:36 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-03-24 15:47:36 +0000 |
commit | 35071ff423f91abc633e9683c4987d2d72878f1b (patch) | |
tree | 2df816baa5249c6ba656e6c88d0a03217a9ed07c | |
parent | 711352667588abfacc456b63653e6be29092422c (diff) | |
download | drakx-35071ff423f91abc633e9683c4987d2d72878f1b.tar drakx-35071ff423f91abc633e9683c4987d2d72878f1b.tar.gz drakx-35071ff423f91abc633e9683c4987d2d72878f1b.tar.bz2 drakx-35071ff423f91abc633e9683c4987d2d72878f1b.tar.xz drakx-35071ff423f91abc633e9683c4987d2d72878f1b.zip |
(boot_img_i386): nice reporting when not enough space on .img
(initrd): help silly emacs-21
-rwxr-xr-x | make_boot_img | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/make_boot_img b/make_boot_img index 0900801b4..104e37fe7 100755 --- a/make_boot_img +++ b/make_boot_img @@ -46,7 +46,7 @@ $install = $ {{ $img =~ /rdz$/ ? initrd($mnt, $img) : $::{"boot_img_$arch"}->($mnt, $img); -sub install_s { _ "strip $_[0]"; _ "$sudo install $_[0] $_[1]" } +sub install_stripped { _ "strip $_[0]"; _ "$sudo install $_[0] $_[1]" } sub initrd { my ($mnt, $img) = @_; @@ -60,8 +60,8 @@ sub initrd { _ "$sudo mount -t ext2 $tmp $mnt -o loop"; _ "$sudo tar xjC $mnt -f $tar"; - install_s("$instdir/init", "$mnt/sbin"); - install_s("$instdir/$install", "$mnt/sbin/stage1"); + install_stripped("$instdir/init", "$mnt/sbin"); + install_stripped("$instdir/$install", "$mnt/sbin/stage1"); my $ftype = $type =~ /^(all)$/ ? "pcmcia" : $type; if ($ftype eq "pcmcia") { @@ -99,7 +99,14 @@ sub boot_img_i386 { _ "$sudo mount -t vfat -o umask=0 $img $mnt -o loop"; _ "cat vmlinuz > $mnt/vmlinuz" if $type !~ /blank/; - -f "$type.rdz" ? _ "cp -f $type.rdz $mnt" : initrd("${mnt}2", "$mnt/$type.rdz"); + initrd("${mnt}2", "$type.rdz") if !-f "$type.rdz"; + eval { _ "cp -f $type.rdz $mnt" }; + if ($@) { + unlink "$mnt/$type.rdz"; + my $avail = (split ' ', `df $mnt`)[-3]; + my $s = int((-s "$type.rdz") / 1024); + die sprintf("not enough room for $type.rdz: need %dKB (available %dKB < needed %dKB)\n", $s - $avail, $avail, $s); + } # my $ftype = $type =~ /^(other|all)$/ ? "cdrom" : $type; my $timeout = 72; |