This commit is contained in:
parent
e3677479f9
commit
26f1b9d19c
@ -78,9 +78,10 @@ function add_entry()
|
|||||||
set -- ${1#xen}
|
set -- ${1#xen}
|
||||||
opt_xen_kernel=--xen-kernel=/boot/xen${1:+-$1}.gz
|
opt_xen_kernel=--xen-kernel=/boot/xen${1:+-$1}.gz
|
||||||
|
|
||||||
# Add the new bootloader entry
|
# Add the new bootloader entry (xen kernel)
|
||||||
update_bootloader --image /boot/$image \
|
update_bootloader --image /boot/$image \
|
||||||
--initrd /boot/$initrd \
|
--initrd /boot/$initrd \
|
||||||
|
--default \
|
||||||
--add \
|
--add \
|
||||||
--force $opt_xen_kernel \
|
--force $opt_xen_kernel \
|
||||||
--name "Kernel-$release"
|
--name "Kernel-$release"
|
||||||
@ -88,6 +89,19 @@ function add_entry()
|
|||||||
# Run the bootloader (e.g., lilo).
|
# Run the bootloader (e.g., lilo).
|
||||||
update_bootloader --refresh
|
update_bootloader --refresh
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(debug)
|
||||||
|
# Add the new bootloader entry (debug kernel)
|
||||||
|
update_bootloader --image /boot/$image \
|
||||||
|
--initrd /boot/$initrd \
|
||||||
|
--add \
|
||||||
|
--force \
|
||||||
|
--name "Kernel-$release"
|
||||||
|
|
||||||
|
# Run the bootloader (e.g., lilo).
|
||||||
|
update_bootloader --refresh
|
||||||
|
;;
|
||||||
|
|
||||||
(*)
|
(*)
|
||||||
# Add the new bootloader entry
|
# Add the new bootloader entry
|
||||||
update_bootloader --image /boot/$image \
|
update_bootloader --image /boot/$image \
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:0b11d10d8f06011998f82bbf419ec08533dde1754d51edea924024623dba95d2
|
|
||||||
size 40142
|
|
3
perl-Bootloader-0.4.13.tar.bz2
Normal file
3
perl-Bootloader-0.4.13.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:3d39033d1ed4cb2d41cf78ea0c574e984c05a959932c4d417d7cab781b84fee5
|
||||||
|
size 43280
|
@ -1,3 +1,76 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 26 19:06:17 CEST 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Corrected mechanism for removal of sections in Tools.pm - part 2
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 26 17:54:54 CEST 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Corrected mechanism for removal of sections in Tools.pm
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 26 13:57:04 CEST 2007 - sf@suse.de
|
||||||
|
|
||||||
|
- fixed typo
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 26 11:23:35 CEST 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Corrected mechanism for adapting default value in Tools.pm
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Mar 23 19:25:14 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Commented out wrong code in update-bootloader and Tools.pm
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Mar 23 14:26:58 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Removed function AddNewImageSection() because it's obsolete
|
||||||
|
- Corrected resolution of symlinks in Tools.pm
|
||||||
|
- Corrected deletion of obsolete entries in Tools.pm
|
||||||
|
- Removed commented out code sections
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 22 17:11:47 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Added mechanism to name boot entries in a unique way
|
||||||
|
- Added mechanism to resolve symlinks in boot entries to be able to
|
||||||
|
remove them properly if needed
|
||||||
|
- Corrected naming scheme appropriate to corresponding bootloader
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 20 12:41:23 CET 2007 - sf@suse.de
|
||||||
|
|
||||||
|
- implemented DM RAID functionality, using devicemapper instead
|
||||||
|
of udev (to "emulate" yast2-storage)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 19 18:59:06 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Added mechanism to create failsafe boot entries appropriately
|
||||||
|
- Corrected handling for default boot entries
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Mar 14 09:47:40 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- New kernels will now be put on top of menu.lst
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 13 16:16:56 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Display labels of boot entries correctly, e.g. "openSUSE 10.2 --
|
||||||
|
Kernel-2.6.20-9-default" (#252911)
|
||||||
|
- Fixed handling concerning which kernel will be the default entry
|
||||||
|
in bootloader menu (#252911)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 13 13:09:18 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
- Following changes merged from branch SLES10-SP1 to trunk:
|
||||||
|
- Fixed removal of obsolete entries in /boot/grub/menu.lst
|
||||||
|
- Exluded kernel-debug from getting default (#241370)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Feb 28 11:46:53 CET 2007 - aosthof@suse.de
|
Wed Feb 28 11:46:53 CET 2007 - aosthof@suse.de
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package perl-Bootloader (Version 0.4.11)
|
# spec file for package perl-Bootloader (Version 0.4.13)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
@ -11,8 +11,8 @@
|
|||||||
# norootforbuild
|
# norootforbuild
|
||||||
|
|
||||||
Name: perl-Bootloader
|
Name: perl-Bootloader
|
||||||
Version: 0.4.11
|
Version: 0.4.13
|
||||||
Release: 3
|
Release: 1
|
||||||
Requires: perl >= %{perl_version}
|
Requires: perl >= %{perl_version}
|
||||||
Requires: perl-gettext
|
Requires: perl-gettext
|
||||||
Requires: mdadm e2fsprogs
|
Requires: mdadm e2fsprogs
|
||||||
@ -63,6 +63,43 @@ install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/bootloader
|
|||||||
/usr/lib/bootloader
|
/usr/lib/bootloader
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Mar 26 2007 - aosthof@suse.de
|
||||||
|
- Corrected mechanism for removal of sections in Tools.pm - part 2
|
||||||
|
* Mon Mar 26 2007 - aosthof@suse.de
|
||||||
|
- Corrected mechanism for removal of sections in Tools.pm
|
||||||
|
* Mon Mar 26 2007 - sf@suse.de
|
||||||
|
- fixed typo
|
||||||
|
* Mon Mar 26 2007 - aosthof@suse.de
|
||||||
|
- Corrected mechanism for adapting default value in Tools.pm
|
||||||
|
* Fri Mar 23 2007 - aosthof@suse.de
|
||||||
|
- Commented out wrong code in update-bootloader and Tools.pm
|
||||||
|
* Fri Mar 23 2007 - aosthof@suse.de
|
||||||
|
- Removed function AddNewImageSection() because it's obsolete
|
||||||
|
- Corrected resolution of symlinks in Tools.pm
|
||||||
|
- Corrected deletion of obsolete entries in Tools.pm
|
||||||
|
- Removed commented out code sections
|
||||||
|
* Thu Mar 22 2007 - aosthof@suse.de
|
||||||
|
- Added mechanism to name boot entries in a unique way
|
||||||
|
- Added mechanism to resolve symlinks in boot entries to be able to
|
||||||
|
remove them properly if needed
|
||||||
|
- Corrected naming scheme appropriate to corresponding bootloader
|
||||||
|
* Tue Mar 20 2007 - sf@suse.de
|
||||||
|
- implemented DM RAID functionality, using devicemapper instead
|
||||||
|
of udev (to "emulate" yast2-storage)
|
||||||
|
* Mon Mar 19 2007 - aosthof@suse.de
|
||||||
|
- Added mechanism to create failsafe boot entries appropriately
|
||||||
|
- Corrected handling for default boot entries
|
||||||
|
* Wed Mar 14 2007 - aosthof@suse.de
|
||||||
|
- New kernels will now be put on top of menu.lst
|
||||||
|
* Tue Mar 13 2007 - aosthof@suse.de
|
||||||
|
- Display labels of boot entries correctly, e.g. "openSUSE 10.2 --
|
||||||
|
Kernel-2.6.20-9-default" (#252911)
|
||||||
|
- Fixed handling concerning which kernel will be the default entry
|
||||||
|
in bootloader menu (#252911)
|
||||||
|
* Tue Mar 13 2007 - aosthof@suse.de
|
||||||
|
- Following changes merged from branch SLES10-SP1 to trunk:
|
||||||
|
- Fixed removal of obsolete entries in /boot/grub/menu.lst
|
||||||
|
- Exluded kernel-debug from getting default (#241370)
|
||||||
* Wed Feb 28 2007 - aosthof@suse.de
|
* Wed Feb 28 2007 - aosthof@suse.de
|
||||||
- Fixed a perl warning bug in Core/GRUB.pm (#248211)
|
- Fixed a perl warning bug in Core/GRUB.pm (#248211)
|
||||||
* Wed Feb 21 2007 - aosthof@suse.de
|
* Wed Feb 21 2007 - aosthof@suse.de
|
||||||
|
@ -10,7 +10,8 @@ use strict;
|
|||||||
my %oper;
|
my %oper;
|
||||||
my ($opt_default, $opt_force, $opt_help, $opt_man, $opt_previous, $opt_xen)
|
my ($opt_default, $opt_force, $opt_help, $opt_man, $opt_previous, $opt_xen)
|
||||||
= (0,0,0,0,0,0);
|
= (0,0,0,0,0,0);
|
||||||
my ($opt_image, $opt_initrd, $opt_name, $opt_xen_kernel) = ('','','',undef);
|
my ($opt_image, $opt_initrd, $opt_name, $opt_xen_name, $opt_failsafe, $opt_xen_kernel)
|
||||||
|
= ('','','','','',undef);
|
||||||
my $add_product = 0;
|
my $add_product = 0;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
@ -75,8 +76,8 @@ Implies --xen option.
|
|||||||
|
|
||||||
=item B<--default>
|
=item B<--default>
|
||||||
|
|
||||||
let the new section to be added be the default section. Only allowed together
|
let the new section to be added be the default section if appropriate. Only
|
||||||
with --add operation
|
allowed together with --add operation
|
||||||
|
|
||||||
=item B<--previous>
|
=item B<--previous>
|
||||||
|
|
||||||
@ -111,19 +112,32 @@ sub GetProduct {
|
|||||||
# First try: Does yast work these days?
|
# First try: Does yast work these days?
|
||||||
$namever = `yast2 print-product 2>&1`;
|
$namever = `yast2 print-product 2>&1`;
|
||||||
chomp $namever;
|
chomp $namever;
|
||||||
return "$namever" if $namever != '' and $namever !~ /\n/;
|
|
||||||
|
# Determine the bootloader type, because long product names may only
|
||||||
|
# be used in case of grub
|
||||||
|
my $loader = Bootloader::Tools::GetBootloader();
|
||||||
|
|
||||||
|
# Substitude whitespaces with an underscore
|
||||||
|
if ($loader ne "grub") {
|
||||||
|
$namever =~ s/\s/_/;
|
||||||
|
}
|
||||||
|
return "$namever" if $namever ne '' and $namever !~ /\n/;
|
||||||
|
|
||||||
# Second try: Is there a usable /etc/SuSE-release?
|
# Second try: Is there a usable /etc/SuSE-release?
|
||||||
if (open(RELEASE, "</etc/SuSE-release")) {
|
if (open(RELEASE, "</etc/SuSE-release") && $loader eq "grub") {
|
||||||
# first line is sufficient
|
# first line is sufficient
|
||||||
$namever = <RELEASE>;
|
$namever = <RELEASE>;
|
||||||
$namever =~ s/\s*\(.*//; # delete everything starting with the first parenthesis
|
|
||||||
|
# delete everything starting with the first parenthesis
|
||||||
|
$namever =~ s/\s*\(.*//;
|
||||||
|
|
||||||
close(RELEASE);
|
close(RELEASE);
|
||||||
|
chomp $namever;
|
||||||
return "$namever";
|
return "$namever";
|
||||||
}
|
}
|
||||||
|
|
||||||
# the last line of defense ...
|
# the last line of defense ...
|
||||||
return "SUSE Code10";
|
return "Linux";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -231,8 +245,42 @@ if (defined $oper{add}) {
|
|||||||
$opt_name = $opt_trans;
|
$opt_name = $opt_trans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Naming scheme for default, smp and bigsmp kernels
|
||||||
|
if (($opt_name =~ /.*-default$/) ||
|
||||||
|
($opt_name =~ /.*-smp$/) ||
|
||||||
|
($opt_name =~ /.*-bigsmp$/)) {
|
||||||
|
|
||||||
|
if ($loader eq "grub") {
|
||||||
|
$opt_name =~ s/-[^-]*$//;
|
||||||
|
$opt_failsafe = "Failsafe -- " . $opt_name;
|
||||||
|
$opt_name = GetProduct() . " -- " . $opt_name;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$opt_failsafe = "Failsafe";
|
||||||
|
$opt_name = GetProduct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Naming scheme for all xen kernels, thus xen and xenpae
|
||||||
|
elsif ($opt_xen) {
|
||||||
|
if ($loader eq "grub") {
|
||||||
|
$opt_name =~ s/-xen.*$//;
|
||||||
|
$opt_xen_name = "Xen -- " . GetProduct() . " - " . $opt_name;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$opt_name = "Xen";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Naming scheme for all other kernels
|
||||||
|
else {
|
||||||
|
if ($loader eq "grub") {
|
||||||
|
$opt_name = GetProduct() if $add_product;
|
||||||
|
}
|
||||||
|
else {
|
||||||
$opt_name .= " -- " . GetProduct() if $add_product;
|
$opt_name .= " -- " . GetProduct() if $add_product;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# execute selected operation
|
# execute selected operation
|
||||||
@ -245,18 +293,41 @@ if (defined $oper{add}) {
|
|||||||
type => $type,
|
type => $type,
|
||||||
image => $opt_image,
|
image => $opt_image,
|
||||||
);
|
);
|
||||||
if (CountSections(@params) != 0)
|
if (CountSections(@params) != 0) {
|
||||||
{
|
|
||||||
if (not $opt_force) {
|
if (not $opt_force) {
|
||||||
pod2usage("There are already sections with image '$opt_image'");
|
pod2usage("There are already sections with image '$opt_image'");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
push @params, default => $opt_default;
|
# FIXME: Subject of change (depending on how the weather is)
|
||||||
|
# only add default if "appropriate"
|
||||||
|
# meaning now flavor of current default matches new one
|
||||||
|
#my $flavor = GetDefaultImage();
|
||||||
|
#$flavor =~ s/^.*-//;
|
||||||
|
#
|
||||||
|
#if ($opt_image =~ m/.*-${flavor}$/) {
|
||||||
|
# push @params, default => $opt_default;
|
||||||
|
#}
|
||||||
push @params, xen => $opt_xen_kernel if $type eq "xen";
|
push @params, xen => $opt_xen_kernel if $type eq "xen";
|
||||||
push @params, initrd => $opt_initrd if $opt_initrd;
|
push @params, initrd => $opt_initrd if $opt_initrd;
|
||||||
|
|
||||||
|
if ($opt_xen) {
|
||||||
|
# Add "xen" section
|
||||||
|
AddSection($opt_xen_name, @params);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Add "normal" sections
|
||||||
AddSection($opt_name, @params);
|
AddSection($opt_name, @params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $arch = `uname --machine`;
|
||||||
|
chomp ($arch);
|
||||||
|
|
||||||
|
# Add a "Failsafe" section
|
||||||
|
if ((($arch eq "i386") || ($arch eq "x86_64") || ($arch eq "ia64"))
|
||||||
|
&& $opt_xen != 1) {
|
||||||
|
AddSection($opt_failsafe, @params);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $oper{remove}) {
|
if (defined $oper{remove}) {
|
||||||
@ -269,6 +340,7 @@ if (defined $oper{remove}) {
|
|||||||
push @params, name => $opt_name if $opt_name;
|
push @params, name => $opt_name if $opt_name;
|
||||||
|
|
||||||
my $num = CountSections(@params);
|
my $num = CountSections(@params);
|
||||||
|
|
||||||
if ($num > 0) {
|
if ($num > 0) {
|
||||||
if ($num > 1 and not $opt_force) {
|
if ($num > 1 and not $opt_force) {
|
||||||
pod2usage("There is more than one section with image '$opt_image'");
|
pod2usage("There is more than one section with image '$opt_image'");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user