OBS User unknown 2007-09-21 17:32:18 +00:00 committed by Git OBS Bridge
parent 3f07f13c13
commit 0abf55cef8
4 changed files with 101 additions and 54 deletions

View File

@ -73,58 +73,77 @@ function add_entry()
{
echo "bootloader_entry: This is function add_entry()" >> $logname
# Set up the new kernel
if [ -f /etc/sysconfig/bootloader ] &&
[ -f /boot/grub/menu.lst -o \
-f /etc/lilo.conf -o \
-f /etc/elilo.conf -o \
-f /etc/zipl.conf ]; then
case $flavor in
(kdump|um)
;;
(xen*)
opt_xen_kernel=
set -- $flavor
set -- ${1#xen}
opt_xen_kernel=--xen-kernel=/boot/xen${1:+-$1}.gz
# If running in instsys, write command(s) to be executed in a file
# which will be executed by yast2-bootloader after installation of
# packages is finished.
#
# This is to prevent inconsistencies triggered by libata migration.
# Add the new bootloader entry (xen kernel)
update_bootloader --image /boot/$image \
--initrd /boot/$initrd \
--default \
--add \
--force $opt_xen_kernel \
--name "$release"
if [ "$YAST_IS_RUNNING" == instsys -a "$DELAYED_RUN_UPDATE_BOOTLOADER" != yes ]; then
cat - >> $delayed_exec_file <<-EOF
#!/bin/sh
# Run the bootloader (e.g., lilo).
update_bootloader --refresh
;;
(debug)
# Add the new bootloader entry (debug kernel)
update_bootloader --image /boot/$image \
--initrd /boot/$initrd \
--add \
--force \
--name "$release"
export DELAYED_RUN_UPDATE_BOOTLOADER=yes
# Run the bootloader (e.g., lilo).
update_bootloader --refresh
;;
/usr/lib/bootloader/bootloader_entry $@
(*)
# Add the new bootloader entry
update_bootloader --image /boot/$image \
--initrd /boot/$initrd \
--default \
--add \
--force \
--name "$release"
EOF
# Run the bootloader (e.g., lilo).
update_bootloader --refresh
;;
esac
chmod 755 $delayed_exec_file
else
# Set up the new kernel
if [ -f /etc/sysconfig/bootloader ] &&
[ -f /boot/grub/menu.lst -o \
-f /etc/lilo.conf -o \
-f /etc/elilo.conf -o \
-f /etc/zipl.conf ]; then
case $flavor in
(kdump|um)
;;
(xen*)
opt_xen_kernel=
set -- $flavor
set -- ${1#xen}
opt_xen_kernel=--xen-kernel=/boot/xen${1:+-$1}.gz
# Add the new bootloader entry (xen kernel)
update_bootloader --image /boot/$image \
--initrd /boot/$initrd \
--default \
--add \
--force $opt_xen_kernel \
--name "$release"
# Run the bootloader (e.g., lilo).
update_bootloader --refresh
;;
(debug)
# Add the new bootloader entry (debug kernel)
update_bootloader --image /boot/$image \
--initrd /boot/$initrd \
--add \
--force \
--name "$release"
# Run the bootloader (e.g., lilo).
update_bootloader --refresh
;;
(*)
# Add the new bootloader entry
update_bootloader --image /boot/$image \
--initrd /boot/$initrd \
--default \
--add \
--force \
--name "$release"
# Run the bootloader (e.g., lilo).
update_bootloader --refresh
;;
esac
fi
fi
}
@ -140,11 +159,9 @@ function remove_entry()
# which will be executed by yast2-bootloader after installation of
# packages is finished.
#
# This is to prevent inconsistencies triggered by libata merge.
# This is to prevent inconsistencies triggered by libata migration.
if [ "$YAST_IS_RUNNING" == instsys -a "$DELAYED_RUN_UPDATE_BOOTLOADER" != yes ]; then
delayed_exec_file="/boot/perl-BL_delayed_exec"
cat - >> $delayed_exec_file <<-EOF
#!/bin/sh
@ -206,17 +223,34 @@ echo "bootloader_entry was called as: $*" >> $logname
(
echo "/proc/mounts:"
cat /proc/mounts
echo
echo "/sys:"
ls -l /sys
echo
fstab="/etc/fstab"
if [ -e $fstab ] ; then
echo "fstab:"
cat $fstab
echo
fi
echo "excerpts of /dev:"
ls -l /dev/{[hs]d[ab]?,md[0-3],.udev}
echo
device_map="/boot/grub/device.map"
if [ -e $device_map ] ; then
echo "device.map:"
cat $device_map
echo
fi
) >> $logname
# File containing commands for later execution
delayed_exec_file="/boot/perl-BL_delayed_exec"
# Checks if correct amount of arguments is given
if [ "$#" -ne "4" -a "$#" -ne "5" ] ; then
usage
@ -229,7 +263,7 @@ getargs $@
case $action in
add)
# Add a new bootloader entry
add_entry
add_entry "$@"
;;
remove)
# Remove an existing bootloader entry

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4292b09e730694e3c976a6abe68678dd328c52f50bb390462423ed9bd2c7ebf6
size 49168
oid sha256:54577253768998fa4a8d4e6b3b8fbfd092e4a404f4b9576c19a16f65a25d43d8
size 49206

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Sep 21 19:12:35 CEST 2007 - aosthof@suse.de
- Save command for adding new section(s) (also multiple kernels) in
/boot/perl-BL_delayed_exec for delayed execution in the target
system. This script will be run by yast2-bootloader after the
installation of packages is finished (#309837)
-------------------------------------------------------------------
Fri Sep 21 15:13:09 CEST 2007 - aosthof@suse.de

View File

@ -12,7 +12,7 @@
Name: perl-Bootloader
Version: 0.4.30
Release: 1
Release: 3
Requires: perl >= %{perl_version}
Requires: perl-gettext
Requires: e2fsprogs
@ -66,6 +66,11 @@ install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/bootloader
/usr/lib/bootloader
%changelog
* Fri Sep 21 2007 - aosthof@suse.de
- Save command for adding new section(s) (also multiple kernels) in
/boot/perl-BL_delayed_exec for delayed execution in the target
system. This script will be run by yast2-bootloader after the
installation of packages is finished (#309837)
* Fri Sep 21 2007 - aosthof@suse.de
- Save command for removal of old sections in
/boot/perl-BL_delayed_exec for delayed execution in the target
system, script will be run by yast2-bootloader after installation