代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
---
util/s390x/zipl2grub.pl.in | 41 ++++++++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 13 deletions(-)
Index: grub-2.06/util/s390x/zipl2grub.pl.in
===================================================================
--- grub-2.06.orig/util/s390x/zipl2grub.pl.in
+++ grub-2.06/util/s390x/zipl2grub.pl.in
@@ -101,20 +101,22 @@ sub ManagePrev($$$){
}
return $ret;
}
-sub BootCopy($$$) {
- my( $file, $dir, $tgt) = @_;
+sub BootCopy($$$$) {
+ my( $src, $file, $dir, $tgt) = @_;
my $curr = "$dir/$tgt";
- Info(4, "Copy /boot/$file $dir $tgt\n");
+ $src = "/boot/$src" unless ( -r $src );
+ Info(4, "Copy $src $dir $tgt\n");
if ( $tgt eq "image" && ManagePrev( $file, $dir, $tgt)) {
ManagePrev( $file, $dir, "initrd")
}
- cp( "/boot/$file", "$dir/$file");
+ cp( $src, "$dir/$file");
ln( $file, $curr);
}
sub MkInitrd($$$) {
my( $initrd, $dir, $version) = @_;
my @C = ( "dracut", "--hostonly", "--force");
my $uuid;
+ push @C, "--quiet" unless ($verbose > 1);
if ( exists( $fsdev{"/boot"}) ) {
chomp( $uuid = qx{grub2-probe --target=fs_uuid /boot});
my ($dev, $type) = ($fsdev{"/boot"}, $fstype{"/boot"});
@@ -429,18 +431,31 @@ if ( ! -r $Image ) {
}
Panic( 1, "$C: kernel '$Image' not readable!?\n") unless (-r $Image);
-if ( -l $Image ) {
- $Image = readlink( $Image);
-}
-my ($image, $version) = ($Image =~ m{^(?:/boot/)?([^-]+-(.+))$});
-if ( !defined($image) || !defined($version) || ! -r "/boot/$image" ) {
- Panic( 1, "$C: weird $Image. This should never happen!\n");
+my ($image, $version) = ($Image, undef);
+while ( !defined( $version) ) {
+ my ($i, $vr, $f) = ($image =~ m{^(?:/boot/)?([^-/]+)-([^/]+)-([^-/]+)$});
+ Info( 4, "image='$image': ");
+ if ( defined($i) && defined($vr) && defined( $f) && -r "/boot/$i-$vr-$f" ) {
+ Info( 4, "matches pattern ('$vr'-'$f')\n");
+ $version = "$vr-$f";
+ last;
+ }
+ if ( -l $image ) {
+ Info( 4, "readlink...\n");
+ $image = readlink( $image);
+ next;
+ }
+ Info( 4, "last resort: get_kernel_version from original '$Image'...\n");
+ chomp( $version = qx{get_kernel_version $Image});
+ Panic( 1, "$C: failed to get kernel version for '$Image'!\n")
+ unless ( defined( $version) && $version );
}
my $initrd = "initrd-$version";
+$image = "image-$version";
if ( ! -r $ziplimage || ! -r $ziplinitrd || $refresh ) {
- BootCopy( $image, $zipldir, "image");
- BootCopy( $initrd, $zipldir, "initrd")
+ BootCopy( $Image, $image, $zipldir, "image");
+ BootCopy( $initrd, $initrd, $zipldir, "initrd")
if (-r "/boot/$initrd" && ! exists( $fsdev{"/boot"}));
}
if ( $refresh || ChkInitrd( $zipldir, "initrd") <= 0 ) {
@@ -463,7 +478,7 @@ if ( ! $debug ) {
}
# now: go for it!
-my @C = ( "/sbin/zipl", (($verbose) ? "-Vnc" : "-nc"), "$ziplconf" );
+my @C = ( "/sbin/zipl", (($verbose > 1) ? "-Vnc" : "-nc"), "$ziplconf" );
System( @C);
exit( $miss);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。