Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37810522
en ru br
Репозитории ALT
S:0.5.4-alt1
5.1: 0.4.4-alt1
4.1: 0.3.3-alt1
4.0: 0.3.3-alt1
3.0: 0.3.1-alt1
www.altlinux.org/Changes

Группа :: Система/Основа
Пакет: bootloader-utils

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

pax_global_header00006660000000000000000000000064122436421520014513gustar00rootroot0000000000000052 comment=fd804542e86da8dd919e82f45983b7f3aa7ad992
bootloader-utils-0.4.23.1-alt1/000075500000000000000000000000001224364215200160655ustar00rootroot00000000000000bootloader-utils-0.4.23.1-alt1/.gear-rules000064400000000000000000000000611224364215200201310ustar00rootroot00000000000000tar: . name=bootloader-utils-@version@-@release@
bootloader-utils-0.4.23.1-alt1/FILES000064400000000000000000000002351224364215200166520ustar00rootroot00000000000000bootloader_utils.pm
bootloader-utils.spec
convertdev.sh
detectliloboot.sh
detectloader.sh
FILES
grub
installkernel
lilo
Makefile
rebootin
rebootin.8
test.pl
bootloader-utils-0.4.23.1-alt1/Makefile000064400000000000000000000020331224364215200175230ustar00rootroot00000000000000NAME = bootloader-utils
FILES = $(shell cat FILES)

root = $(RPM_BUILD_ROOT)
prefix = $(root)/usr
sbindir = $(prefix)/sbin
datadir = $(prefix)/share
mandir = $(prefix)/share/man
perl_libdir = $(root)$(shell eval `perl -V:installsitelib`; echo $$installsitelib)

INSTALL = install -p

all: build

test:
perl test.pl

install:
$(INSTALL) -d $(sbindir) $(datadir) $(mandir)/man8 $(perl_libdir) $(root)/sbin $(datadir)/loader
$(INSTALL) -m644 *.pm $(perl_libdir)
$(INSTALL) -m644 *.8 $(mandir)/man8
$(INSTALL) -m755 lilo grub $(datadir)/loader
$(INSTALL) -m755 convertdev.sh $(sbindir)
$(INSTALL) -m755 detectloader.sh $(sbindir)
$(INSTALL) -m755 detectliloboot.sh $(sbindir)
$(INSTALL) -m755 rebootin $(sbindir)
$(INSTALL) -m755 installkernel $(root)/sbin

tar $(NAME).tar.gz: $(FILES)
mkdir $(NAME) ; \
tar cf - `cat FILES` | ( cd $(NAME) ; tar xfBp - ) ; \
tar cf $(NAME).tar $(NAME) ; \
rm -rf $(NAME) ; \
gzip -9f $(NAME).tar

rpm: $(NAME).tar.gz
rpm -ta $(NAME).tar.gz

clean:
rm -fv *[~-]

.PHONY: all build install tar rpm clean
bootloader-utils-0.4.23.1-alt1/bootloader-utils.spec000064400000000000000000000245521224364215200222410ustar00rootroot00000000000000Name: bootloader-utils
Version: 0.4.23.1
Release: alt1

Summary: Bootloader utilities
License: GPL
Group: System/Base
BuildArch: noarch

Source: %name-%version-%release.tar

PreReq: getopt, make-initrd >= 0.4.3-alt2
Conflicts: grub2 < 1.98-alt13
Conflicts: lilo < 22.7.3-alt7

%ifarch %arm
PreReq: uboot-tools >= 2013.07
%endif

# Automatically added by buildreq on Thu Feb 22 2007
BuildRequires: perl-devel

%description
This package contains utilities used to manipulate bootloaders.

%prep
%setup -n %name-%version-%release

%build
%make_build

%install
%makeinstall perl_libdir=%buildroot%perl_vendor_privlib
ln -s `relative %perl_vendor_privlib/bootloader_utils.pm %_datadir/loader/bootloader_utils.pm` \
%buildroot%_datadir/loader/bootloader_utils.pm
mkdir -p %buildroot/%_rpmlibdir
install -pD -m755 kernel.filetrigger %buildroot/%_rpmlibdir/boot_kernel.filetrigger

mkdir -p %buildroot/%_sysconfdir/sysconfig

cat > %buildroot/%_sysconfdir/sysconfig/installkernel <<-EOF
INITRD_GENERATOR=make-initrd
MKINITRD=%_sbindir/mkinitrd-make-initrd
#INITRD_AUTOUPDATE=all
EOF

%check
make test

%pre
[ $1 -gt 1 ] || exit 0
f=/etc/sysconfig/installkernel
rm -f $f.install
[ ! -f $f ] || exit 0
if [ -f $f.rpmsave ]; then
cp -a $f.rpmsave $f.install
else
cat >&2 <<EOF
Neither $f nor $f.rpmsave
exits, no way to find out whether this system was configured to use make-initrd
or mkinitrd by default. This update implements the first scenario. If this is
not the case, please edit $f after update.
EOF
fi

%post
[ $1 -gt 1 ] || exit 0
f=/etc/sysconfig/installkernel
[ -f $f.install ] || exit 0
cp -a $f $f.rpmnew 2> /dev/null ||:
mv $f.install $f

%files
%config(noreplace) %_sysconfdir/sysconfig/installkernel
/sbin/installkernel
%_sbindir/detectloader.sh
%_sbindir/detectliloboot.sh
%_sbindir/convertdev.sh
%_sbindir/rebootin
%_datadir/loader/
%perl_vendor_privlib/*.pm
%_man8dir/*.*
%_rpmlibdir/*.filetrigger

%changelog
* Fri Nov 22 2013 Gleb F-Malinovskiy <glebfm@altlinux.org> 0.4.23.1-alt1
- installkernel: use trap for temp files (tnx ldv@).
- UBOOT_INITRD_LOAD_ADDRESS is optional.

* Wed Nov 20 2013 Gleb F-Malinovskiy <glebfm@altlinux.org> 0.4.23-alt1
- installkernel: append dtb to multiplatform kernels.

* Tue Jul 09 2013 Gleb F-Malinovskiy <glebfm@altlinux.org> 0.4.22-alt1
- Add support of uboot.

* Sun Apr 07 2013 Dmitry V. Levin <ldv@altlinux.org> 0.4.21-alt1
- kernel.filetrigger: fixed handling of uninstalled kernels
(by Roman Savochenko; closes: #28647).

* Wed Mar 13 2013 Anton V. Boyarshinov <boyarsh@altlinux.ru> 0.4.20-alt1
- installkernel: stop if initrd creation failed

* Thu Jan 31 2013 Michael Shigorin <mike@altlinux.org> 0.4.19-alt1
- installkernel: don't install memtest* in EFI mode (won't boot)

* Thu Dec 13 2012 Gleb F-Malinovskiy <glebfm@altlinux.org> 0.4.18-alt1
- lilo: fix regression introdused by 0.4.15-alt1

* Thu Dec 06 2012 Dmitry V. Levin <ldv@altlinux.org> 0.4.17-alt1
- kernel.filetrigger: added handling of kernel modules,
obsoletes %%post_kernel_modules and %%postun_kernel_modules.

* Wed Dec 05 2012 Dmitry V. Levin <ldv@altlinux.org> 0.4.16-alt1
- installkernel: run depmod only when installing a kernel.

* Sun Nov 04 2012 Led <led@altlinux.ru> 0.4.15-alt1
- lilo: don't strip label
- conflicts lilo < 22.7.3-alt7

* Thu Oct 20 2011 Anton Protopopov <aspsk@altlinux.org> 0.4.14-alt1
- installkernel: run depmod before creating initrd

* Wed Jul 27 2011 Anton V. Boyarshinov <boyarsh@altlinux.ru> 0.4.13-alt1
- support for 3.x kernels added

* Sun Dec 12 2010 Dmitry V. Levin <ldv@altlinux.org> 0.4.12-alt1
- %%pre: when neither /etc/sysconfig/installkernel nor
/etc/sysconfig/installkernel.rpmsave exists, assume that
system was configured to use make-initrd (closes: #24739),
and issue a warning for mkinitrd users.

* Fri Dec 10 2010 Dmitry V. Levin <ldv@altlinux.org> 0.4.11-alt1
- boot_kernel.filetrigger: cleanup,
do nothing when either /proc or /sys is not mounted.

* Wed Dec 08 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.10-alt3
- fix options handling bug in installkernel introduced in 0.4.10-alt1
- implement INITRD_AUTOUPDATE={all,default,none} option for automatic
ramdisks update on kernel install/removal
- set default INITRD_AUTOUPDATE value to 'none'

* Tue Dec 07 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.10-alt2
- Fixed /etc/sysconfig/installkernel migration issues (ALT #24709):
+ do not switch from mkinitrd to make-initrd if
make-initrd was not enabled before the update;
+ inherit locally modified config left after make-initrd update

* Tue Dec 07 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.10-alt1
- introduce NODEFAULT,NOFLAVOUR and KEEPINITRD options for installkernel
- add make-initrd dependency
- add /etc/sysconfig/installkernel from make-initrd

* Mon Nov 29 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.9-alt2
- ldv@: minor filetrigger patch

* Thu Nov 25 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.9-alt1
- implement filetrigger for kernel update

* Mon Nov 08 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.8-alt4
- rider@: add grub2 support to detectloader.sh

* Thu Sep 30 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.8-alt3
- Remove redundant vmlinuz-smp,vmlinuz-up,initrd-smp.img,initrd-up.img
links creation
- raorn@: add EXTLINUX support (ALT #24154)
- zerg@: create /boot/vmlinuz-{kflavour} links (ALT #24145)

* Fri Jun 04 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 0.4.8-alt2
- Remove grub-mkconfig call from installkernel (moved to filetrigger)
- (ALT #23333)

* Wed Feb 24 2010 Alexey Gladkov <legion@altlinux.ru> 0.4.8-alt1
- Add make-initrd support.

* Mon Jan 18 2010 Anton V. Boyarshinov <boyarsh@altlinux.ru> 0.4.7-alt1
- grub2 support

* Sat Jan 09 2010 Vladislav Zavjalov <slazav@altlinux.org> 0.4.6-alt1
- lilo:
- protect quotes in lilo.conf values (closes: #22705);
- remove spaces from labels
- bootloader_utils.pm: cleanup code of getroot()

* Fri Dec 11 2009 Vladislav Zavjalov <slazav@altlinux.org> 0.4.5-alt1
- detectliloboot.sh: return real boot device when raid-extra-boot
is set to mbr-only

* Tue Oct 13 2009 Vladislav Zavjalov <slazav@altlinux.org> 0.4.4-alt1
- installkernel: improve error messages (closes: #21914)

* Mon Oct 05 2009 Vladislav Zavjalov <slazav@altlinux.org> 0.4.3-alt1
- add convertdev.sh script to convert UUID=.. or LABEL=.. to device names
use it in detectliloboot.sh and grub scripts (closes #18127)
- bootloader_utils.pm: mnt2dev(): don't use mtab to convert device names

* Mon Sep 21 2009 Vladislav Zavjalov <slazav@altlinux.org> 0.4.2-alt1
- add --label option to installkernel, lilo and grub scripts

* Wed Sep 16 2009 Vladislav Zavjalov <slazav@altlinux.org> 0.4.1-alt1
- installkernel:
- change lilo restarting logic (closes #1014, #1015, #20695):
old behaviour: restart lilo if first bootloader found in
devices from /proc/partitions is lilo
new one: restart lilo when lilo bootloader is found in
device from boot= setting in lilo.conf
- when detectliloboot.sh fails to find device, there are no
need to run detectloader.sh (thx Dmitry V. Levin)
(closes: #21106)
- suppress unwanted output from cd -
- detectloader: replace by two shell scripts:
detectliloboot.sh -- to get boot device from lilo.conf
detectloader.sh -- to get bootloader type on the given device or file
- bootloader_utils.pm:
- (getroot): recognize UUID and LABEL
(thx Dmitry V. Levin) (closes: #2194, #18127)
- remove unused functions (partitions, typeOfMBR) used in
removed detectloader program
- rebootin
- remove GRUB support
- fix working with quoted labels in lilo.conf (closes: #11446).
- cleanup code, improve error and help messages
- add long options, add -l option for listing available labels.
- update manpage
- remove URL and Packager tags (thx Dmitry V. Levin).

* Fri Mar 07 2008 Dmitry V. Levin <ldv@altlinux.org> 0.3.3-alt1
- grub: Fixed memtest removal (Alexey Tourbin).
- installkernel:
+ Do not discard /sbin/lilo stdout (Alexey Tourbin).
+ Do not run detectloader in nolaunch mode.
+ Do not invoke "cp" by absolute pathname.
+ Do not touch files in DURING_INSTALL mode,
thus reverting the change made in 0.3.1-alt2.
+ Replaced non-portable "realpath" with "readlink -e".
+ Fixed xen kernels install (Aleksey Avdeev, #13672).

* Thu Feb 22 2007 Alexey Tourbin <at@altlinux.ru> 0.3.2-alt1
- fixed accidental Windows(tm) removal from lilo.conf (#6102)
- fixed lilo.conf quoting issues (#10903)

* Mon Feb 12 2007 Alexey Gladkov <legion@altlinux.ru> 0.3.1-alt2
- Update symlinks in /boot if DURING_INSTALL specified.

* Fri Feb 09 2007 Alexey Gladkov <legion@altlinux.ru> 0.3.1-alt1.1.1
- NMU:
- quote lilo parameters.

* Thu Feb 09 2006 Anton Farygin <rider@altlinux.ru> 0.3.1-alt1.1
- NMU:
- fstab parser fixes (#3318, #8615)
- installkernel fixes (#4811, #7386)

* Tue Aug 17 2004 Alexey Tourbin <at@altlinux.ru> 0.3.1-alt1
- fixed skiplist processing (Sergey Vlasov, #4254)
- create backup (.old) copies of lilo.conf and grub/menu.lst (#4395)
- installkernel: run mkinitrd(8) without --ifneeded (should hopefully fix #4234 and #4643)

* Fri Jun 11 2004 Alexey Tourbin <at@altlinux.ru> 0.3-alt1
- added support for LABEL and UUID volumes (via /etc/mtab)
- installkernel: save entry for /boot/vmlinuz before upgrade
- installkernel: added support for memtest86
- grub: fix for separate /boot partition, by Sergey Vlasov (#4234)
- started test suite (test.pl)

* Fri May 07 2004 Alexey Tourbin <at@altlinux.ru> 0.2-alt1
- here goes my first major revision; highlights:
+ common.pm -> bootloader_utils.pm, reworked
+ detectloader(1) reworked
+ helpers for lilo(1) and grub(1) configuration files reworked
+ installkernel reworked, /etc/sysconfig/installkernel disappeared

* Wed Mar 19 2003 Peter Novodvorsky <nidd@altlinux.com> 0.1-alt7
- Updated label shorten algorithm in lilo installer script.

* Mon Dec 09 2002 Dmitry V. Levin <ldv@altlinux.org> 0.1-alt6
- Fixed perl dependencies (#0001679).

* Fri Nov 15 2002 Stanislav Ievlev <inger@altlinux.ru> 0.1-alt5
- rebuild
- more features:
+ skiplist for mhz (#0001015)
+ advanced skiping of cdroms (#0001014)

* Fri Mar 15 2002 Dmitry V. Levin <ldv@alt-linux.org> 0.1-alt4
- Fixed configuration options parsing (imz, #0000507).

* Thu Feb 14 2002 Stanislav Ievlev <inger@altlinux.ru> 0.1-alt3
- added new signature for the GRUB

* Fri Nov 23 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.1-alt2
- Added %%build section, autogenerated buildrequires.

* Wed Nov 14 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.1-alt1
- Imported MDK code (to be rewritten).
bootloader-utils-0.4.23.1-alt1/bootloader_utils.pm000064400000000000000000000027751224364215200220100ustar00rootroot00000000000000package bootloader_utils;
# $Id: bootloader_utils.pm,v 1.4 2004/06/11 11:09:45 at Exp $
#--------------------------------------------------------------------
# Copyright (C) 2000, 2001, 2002 by MandrakeSoft.
# Chmouel Boudjnah <chmouel@mandrakesoft.com>.
#
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
#--------------------------------------------------------------------
# Copyright (C) 2003 by ALT Linux Team,
# Alexey Tourbin <at@altlinux.org>.
#--------------------------------------------------------------------

require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(mnt2dev getroot);

use strict;

sub gettab ($) {
my $fname = shift;
open my $fh, $fname or do {
warn "$0: $fname: $!";
return;
};
my @tab;
local $_;
local $/ = "\n";
while (<$fh>) {
next unless /\S/;
next if /^\s*#/;
my @ent = split;
push @tab, \@ent;
}
return @tab;
}

sub mnt2dev ($;$) {
my $mnt = shift;
my $fstab_file = shift || "/etc/fstab";
my @fstab = gettab $fstab_file;
foreach my $fsent (@fstab) {
return $$fsent[0] if $$fsent[1] eq $mnt;
}
return;
}

sub getroot {
my $root;

# 1. try to get root device from /proc/cmdline
my $fh;
if ((open $fh, "/proc/cmdline") &&
(<$fh> =~ /root=((UUID=|LABEL=|\/)\S+)/)){
$root=$1;
}

# 2. try to get root device from /etc/fstab
$root = mnt2dev("/") unless $root;

# 3. try to get root device from /usr/sbin/rdev
$root=$& if !$root && (`/usr/sbin/rdev` =~ /\/\S+/);

return $root;
}

1;
bootloader-utils-0.4.23.1-alt1/convertdev.sh000075500000000000000000000010661224364215200206060ustar00rootroot00000000000000#!/bin/sh -efu

. shell-args

show_help()
{
cat <<-EOF
convertdev.sh - convert UUID=... or LABEL=... or /dev/disk/by-...
device representations into device names.

Usage: $PROG <device>

EOF
exit
}

[ "$#" = 1 ] && [ "$1" != '-h' ] || show_help

dev="$1"

if [ "${dev#UUID=}" != "$dev" -o "${dev#LABEL=}" != "$dev" ]; then
/sbin/blkid -t "$dev" | cut -f1 -d: |
while read dev; do
[ -b "$dev" ] || continue
printf "%s\n" "$dev"
break
done
else
dev="$(readlink -e -- "$dev")"
[ -b "$dev" ] && printf '%s\n' "$dev" ||:
fi
bootloader-utils-0.4.23.1-alt1/detectliloboot.sh000075500000000000000000000016621224364215200214450ustar00rootroot00000000000000#!/bin/sh -efu
# get boot device from lilo.conf

liloconf="${1-/etc/lilo.conf}"

get_global(){
sed -n -e "
0,/^[[:space:]]*other\|^[[:space:]]*image/{
s/^[[:space:]]*$1=[\"[:space:]]*\([^\"]\+\)[\"[:space:]]*/\1/p
T; q # get only first line
}
" "$liloconf"
}

dev="$(get_global boot)"

# If raid-extra-boot=mbr-only then bootloader is installed
# in the MBR and not in the md device.
if [ "$(get_global raid-extra-boot)" = "mbr-only"\
-a -z "${dev##/dev/md*}" ]; then

# let's find disk on which one of the raid elements resides
d="$(find /sys/block/${dev#/dev/}/slaves -type l -printf "%p\n" | head -n1)"
# something like /sys/block/md0/slave/sda1
d="$(readlink -e -- "$d")"
# /sys/block/sda/sda1 on old kernels (2.6.18)
# or /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1

d="${d##*/block/}"
d="${d%%/*}"

[ -z "$d" ] || dev="/dev/$d"
fi

convertdev.sh "$dev"
bootloader-utils-0.4.23.1-alt1/detectloader.sh000075500000000000000000000061421224364215200210660ustar00rootroot00000000000000#!/bin/bash -efu
# bash is here for \xFF symbols

. shell-args

show_help()
{
cat <<EOF
detectloader - detects bootloader on the given device

Usage: $PROG [options] <filename>

<filename> must specify seekable regular file or device.

Options:
-q, --quiet try to be more quiet;
-v, --verbose print a message for each action;
-V, --version print program version and exit;
-h, --help show this text and exit.

Report bugs to http://bugs.altlinux.ru/

EOF
exit
}

print_version()
{
echo $PROG version
exit
}

TEMP=`getopt -n $PROG -o $getopt_common_opts -l $getopt_common_longopts -- "$@"` ||
show_usage
eval set -- "$TEMP"

while :; do
case "$1" in
--) shift; break
;;
*) parse_common_option "$1"
;;
esac
shift
done

[ "$#" -ge 1 ] || show_usage 'Insufficient arguments.'
[ "$#" -le 1 ] || show_usage 'Too many arguments.'

f="${1}"
[ -s "$f" -o -b "$f" ] || fatal "$f: not a file or block device"
[ -r "$f" ] || fatal "$f: permission denied for reading"

test_magic()
{
# Use decimal (123), octal (0123), or hex (0x123) digits for an offset.
# Use any string for a value.
# Use any number of <offset> <value> pairs in parameters.
# example: test_magic /dev/sda 0x2 LILO

while [ -n "${1-}" ]; do
local off="${1-}"
local val="$(printf "${2-}" |
od --address-radix=n --format=x1 |
tr -d '\n')"
shift 2
[ -n "$off" -a -n "$val" ] ||
fatal "test_magic: error in parameters"
off="$(($off))"

local len=${#val}
len="$(($len/3))" # od gives 3 chars per byte
local out="$(od --address-radix=n --format=x1 \
--skip-bytes="$off" --read-bytes="$len" "$f" |
tr -d '\n')"
verbose "comparing <$out> at offset $off with <$val>"
[ "$out" = "$val" ] || return 2
done
return 0
}

T()
{
name="$1"; shift
verbose "* test for $name bootloader:"
if test_magic "$@"; then
printf '%s\n' "$name"
exit 0
fi
}

T empty 0 "\000\000\000\000"
T grub 0 "\xEBG" 0x17d "stage1 \000"
T grub 0 "\xEBH" 0x17e "stage1 \000"
T grub 0 "\xEBH" 0x18a "stage1 \000"
T grub 0 "\xEBH" 0x181 "GRUB \000"
T grub 0x188 "GRUB \000"
T grub 0x180 "GRUB \000"
T lilo 2 "LILO"
T lilo 6 "LILO"
T grub 6 "GRUB"
T osbs 2 "OSBS" #- http://www.prz.tu-berlin.de/~wolf/os-bs.html
T pqmagic 0xEF "PQV"
T BootStar 0x130 "BootStar:"
T DocsBoot 0x148 "DocsBoot"
T system_commander 0x1ad "SYSCMNDRSYS"
T BeOs 0x24 "Boot Manager"
T os2 0 "\xFA\xB8\x30\x00" 0xfa "OS/2"
T TimO 0 "IBM Thinkpad hibernation partition"
T dos 0xa0 "\x25\x03\x4E\x02\xCD\x13"
T dos 0xa0 "\x00\xB4\x08\xCD\x13\x72" #- nt2k's
T dos 0x60 "\xBB\x00\x7C\xB8\x01\x02\x57\xCD\x13\x5F\x73\x0C\x33\xC0\xCD\x13" #- nt's
T dos 0x70 "\x0C\x33\xC0\xCD\x13\x4F\x75\xED\xBE\xA3"
T freebsd 0xC0 "\x00\x30\xE4\xCD\x16\xCD\x19\xBB\x07\x00\xB4"
T freebsd 0x160 "\x6A\x10\x89\xE6\x48\x80\xCC\x40\xCD\x13"
T dummy 0xAC "\x0E\xB3\x07\x56\xCD\x10\x5E\xEB" #- caldera?
T ranish 0x100 "\x6A\x10\xB4\x42\x8B\xF4\xCD\x13\x8B\xE5\x73"
T extlinux 0 "\xFA\x31\xC0\x8E\xD8\x8E\xD0\xBC\x00\x7C\x89\xE6\x06\x57\x8E\xC0\xFB" #- mbr.bin, altmbr.bin, gptmbr.bin
T os2 0x1c2 "\x0A"
T Acronis 0 "\xE8\x12\x01"
bootloader-utils-0.4.23.1-alt1/grub000064400000000000000000000061751224364215200167600ustar00rootroot00000000000000#!/usr/bin/perl
# $Id: grub,v 1.7 2004/08/17 02:03:39 at Exp $
#--------------------------------------------------------------------
# Copyright (C) 2000, 2001, 2002 by MandrakeSoft.
# Chmouel Boudjnah <chmouel@mandrakesoft.com>.
#
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
#--------------------------------------------------------------------
# Copyright (C) 2003 by ALT Linux Team,
# Alexey Tourbin <at@altlinux.org>.
#--------------------------------------------------------------------
# description: Add/remove entry for grub bootloader.

use strict;
use bootloader_utils qw(getroot mnt2dev);

use Getopt::Long qw(GetOptions);
GetOptions "r|R|remove" => \my $remove, "m|memtest" => \my $memtest,
"l|label=s" => \my $label
and (my $version = shift) and (@ARGV == 0)
or die "usage: $0 [-r|-R|--remove] [-m|--memtest] [-l|--label <label>] version\n";

sub dev2grub {
my $dev = shift;
$dev=`convertdev.sh $dev`;
my ($disk, $part) = $dev =~ /([^\d\s]+)(\d+)/
or return;
# Sample device.map entry:
# (hd0) /dev/hda
# Sample convertion:
# /dev/hda5 => (hd0,4)
$part--;
my $map = $ENV{GRUB_DEVICE_MAP} || "/boot/grub/device.map";
open my $fh, $map
or return;
my $grub_part;
while (<$fh>) {
if (/\((\w+d\d+)\)\s+\Q$disk\E$/) {
$grub_part = "($1,$part)";
last;
}
}
return $grub_part;
}

my $bootdev = mnt2dev("/boot");
my $boot = $bootdev ? "" : "/boot";
my $root = getroot;
my $grub_part = dev2grub($bootdev ? $bootdev : $root);
die "Can't convert grub partition\n" unless $grub_part;

sub add_memtest {
local $_ = shift;
my $l=($label eq '')? "memtest86-$version":$label;
/\/memtest-\Q$version.bin\E\b/
or $_ .= <<EOF;

title $l
kernel $grub_part$boot/memtest-$version.bin
EOF
return $_;
}

sub remove_memtest {
local $_ = shift;
my @sections = split /^(?=[ \t]*title\s)/m;
@sections = grep { !/\/memtest-\Q$version.bin\E\b/ } @sections;
return join "" => @sections;
}

sub add_kernel {
local $_ = shift;
my $l=($label eq '')? $version:$label;
/\/vmlinuz-\Q$version\E\s/
or $_ .= <<EOF;

title $l
kernel $grub_part$boot/vmlinuz-$version root=$root
initrd $grub_part$boot/initrd-$version.img
EOF
return $_;
}

sub remove_kernel {
local $_ = shift;
my @sections = split /^(?=[ \t]*title\s)/m;
@sections = grep { !/\/vmlinuz-\Q$version\E\s/ } @sections;
return join "" => @sections;
}

{
# open menu.lst for update
my $menu_lst = $ENV{GRUB_MENU_LST} || "/boot/grub/menu.lst";

# don't use label if it is already used
if ($label ne ''){
open ML, $menu_lst;
foreach (<ML>){
if (/^\s*title\s+$label$/){
$label=''; last;
}
}
close ML;
}

open my $fh, "+<", $menu_lst
or die "Cannot open $menu_lst\n";
my $content = do { local $/ = undef; <$fh> };

# modify the content
if ($memtest && $remove) {
$content = remove_memtest($content);
} elsif ($memtest) {
$content = add_memtest($content);
} elsif ($remove) {
$content = remove_kernel($content);
} else {
$content = add_kernel($content);
}
# neat
$content =~ s/\n{3,}/\n\n/g;

# debug
# print $content;
# exit 0;

# do the update
seek $fh, 0, 0;
print $fh $content;
truncate $fh, tell $fh;
# autoclosed
}
bootloader-utils-0.4.23.1-alt1/installkernel000064400000000000000000000154251224364215200206660ustar00rootroot00000000000000#!/bin/sh
# $Id: installkernel,v 1.7 2004/08/17 02:08:27 at Exp $
#--------------------------------------------------------------------
# Copyright (C) 2000, 2002 by MandrakeSoft,
# Chmouel Boudjnah <chmouel@mandrakesoft.com>,
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
#--------------------------------------------------------------------
# Copyright (C) 2003, 2004 by ALT Linux Team,
# Alexey Tourbin <at@altlinux.org>.
#--------------------------------------------------------------------
# description: Install a kernel to /boot and add an entry for grub and lilo

NOLAUNCH=
REMOVE=
MEMTEST=
LABEL=
NODEFAULT=
NOFLAVOUR=
KEEPINITRD=

: ${INSTALLKERNEL_CONFIG:=/etc/sysconfig/installkernel}
if [ -f "$INSTALLKERNEL_CONFIG" ]; then
. "$INSTALLKERNEL_CONFIG"
fi

usage()
{
cat <<EOF >&2
Usage: $0 [options] KERNEL_VERSION

-r, -R, --remove remove bootloader entry and prepare to remove kernel;
-m, --memtest it's all about memtest86, not Linux kernel;
--label <label> use <label> if it is not already used;
-n, --nolaunch don't launch lilo;
--nodefault do not change default kernel (/boot/vmlinuz) link;
--noflavour do not change flavour kernel (/boot/vmlinuz-flavour) link;
--keep-initrd do not overwrite existing initrd;
-u, --uboot create packed images for uboot;
-h, --help this help.
EOF
[ -n "$1" ] && exit "$1" || exit 2
}

LEGACY=algyNdsSCiLc
ARGV=`getopt -n "$0" -o nrRmuh$LEGACY -l nolaunch,remove,memtest,help,nodefault,noflavour,keep-initrd,label:,uboot -- "$@"` || usage
eval set -- "$ARGV"

while :; do
case "$1" in
-n|--nolaunch) NOLAUNCH=$1; shift
;;
-r|-R|--remove) REMOVE=$1; shift
;;
-m|--memtest) MEMTEST=$1; shift
;;
--label) LABEL="$1 $2"; shift 2
;;
--nodefault) NODEFAULT=$1; shift
;;
--noflavour) NOFLAVOUR=$1; shift
;;
--keep-initrd) KEEPINITRD=$1; shift
;;
-u|--uboot)
[ -x /usr/bin/mkimage ] && UMKIMAGE=/usr/bin/mkimage; shift
: ${UBOOT_ARCH:=arm}
: ${UBOOT_KERNEL_LOAD_ADDRESS:?}
: ${UBOOT_INITRD_LOAD_ADDRESS:=0}
: ${UBOOT_KERNEL_ENTRY_POINT:=$UBOOT_KERNEL_LOAD_ADDRESS}
: ${UBOOT_INITRD_ENTRY_POINT:=$UBOOT_INITRD_LOAD_ADDRESS}
: ${UBOOT_KERNEL_COMPRESSION:=none}
: ${UBOOT_INITRD_COMPRESSION:=none}
: ${UBOOT_DTB:=}
: ${DTB_DIR:=/lib/devicetree}
;;
-h|--help) shift; usage 0
;;
--) shift; break
;;
-[$LEGACY]) echo "$0: legacy option $1 ignored (probably harmless)" >&2; shift
;;
*) echo "$0: unrecognized option: $1" >&2; exit 1
;;
esac
done

[ -z "${0##*memtest*}" ] && MEMTEST=--memtest

VERSION="$1"
[ -n "$VERSION" ] || usage

if [ -n "$DURING_INSTALL" ]; then
echo "$0: DURING_INSTALL=$DURING_INSTALL; supposed to run later" >&2
exit 0
fi

if [ -n "$MEMTEST" -a -d /sys/firmware/efi ]; then
echo "$0: booted in EFI mode, skipping" >&2
exit 0
fi

: ${INITRD_GENERATOR:=mkinitrd}
: ${BOOTDIR:=/boot}
: ${MKINITRD:=/sbin/mkinitrd}
: ${MAKE_INITRD:=/usr/sbin/make-initrd}

if ! [ -w "$BOOTDIR" ]; then
echo "$0: $BOOTDIR: Permission denied"
exit 1
fi

if OLD_KERNEL=`readlink -e -- "$BOOTDIR/vmlinuz"`; then
OLD_VERSION="${OLD_KERNEL##*/vmlinuz-}"
fi

cd "$BOOTDIR"
if [ -z "$REMOVE" -a -z "$MEMTEST" ]; then
if [ -f "System.map-$VERSION" ]; then
/sbin/depmod -a -F "System.map-$VERSION" "$VERSION"
fi

if [ -z "$KEEPINITRD" ] || [ ! -f "$BOOTDIR/initrd-$VERSION.img" ]; then
case "$INITRD_GENERATOR" in
mkinitrd)
"$MKINITRD" $MKINITRD_OPTIONS -f "$BOOTDIR/initrd-$VERSION.img" "$VERSION" || exit 1
;;
make-initrd)
"$MAKE_INITRD" -b "$BOOTDIR" -k "$VERSION" || exit 1
;;
*)
echo "$0: $INITRD_GENERATOR: Unrecognized initrd generator"
exit 1
;;
esac
if [ -n "$UMKIMAGE" ]; then
kimage="vmlinuz-$VERSION"
if [ -n "$UBOOT_DTB" -a -d "$DTB_DIR/$VERSION" ]; then
ls "$DTB_DIR/$VERSION/$UBOOT_DTB" > /dev/null || exit 1
trap 'rm -f -- "$tmpkimage"; exit $?' EXIT
trap 'exit 143' HUP INT QUIT TERM
tmpkimage="`mktemp --tmpdir intallkernel.XXXXXXXXXX`"
cat "$kimage" "$DTB_DIR/$VERSION/$UBOOT_DTB" > "$tmpkimage" || exit 1
kimage="$tmpkimage"
fi
$UMKIMAGE -A "$UBOOT_ARCH" -O linux -T kernel -C "$UBOOT_KERNEL_COMPRESSION" -a "$UBOOT_KERNEL_ENTRY_POINT" \
-e "$UBOOT_KERNEL_ENTRY_POINT" -n "linux-$VERSION" -d "$kimage" "uimage-$VERSION" || exit 1
$UMKIMAGE -A "$UBOOT_ARCH" -O linux -T ramdisk -C "$UBOOT_INITRD_COMPRESSION" -a "$UBOOT_INITRD_ENTRY_POINT" \
-e "$UBOOT_INITRD_ENTRY_POINT" -n "initrd-$VERSION" -d "initrd-$VERSION.img" "uinitrd-$VERSION" || exit 1
fi
fi

if [ -z "${VERSION##*-xen-*}" ] && [ -z "$NOFLAVOUR" ]; then
ln -snf "vmlinuz-$VERSION" vmlinuz-xen
ln -snf "initrd-$VERSION.img" initrd-xen.img
else
if [ -z "$NODEFAULT" ]; then
ln -snf "vmlinuz-$VERSION" vmlinuz
ln -snf "initrd-$VERSION.img" initrd.img
if [ -n "$UMKIMAGE" ]; then
ln -snf "uimage-$VERSION" uimage
ln -snf "uinitrd-$VERSION" uinitrd
fi
fi
if [ -z "$NOFLAVOUR" ]; then
KFLAVOUR=${VERSION#*-}; KFLAVOUR=${KFLAVOUR%-*}
ln -snf "vmlinuz-$VERSION" vmlinuz-$KFLAVOUR
ln -snf "initrd-$VERSION.img" initrd-$KFLAVOUR.img
if [ -n "$UMKIMAGE" ]; then
ln -snf "uimage-$VERSION" uimage-$KFLAVOUR
ln -snf "uinitrd-$VERSION" uinitrd-$KFLAVOUR
fi
fi
fi
elif [ -z "$MEMTEST" ]; then
rm -f "initrd-$VERSION.img"
rm -f /boot/initrd-"$VERSION".img
if [ -n "$UMKIMAGE" ]; then
rm -f /boot/uimage-"$VERSION"
rm -f /boot/uinitrd-"$VERSION"
fi

fi
cd - > /dev/null

: ${LILO_CONF:=/etc/lilo.conf}
: ${GRUB_MENU_LST:=$BOOTDIR/grub/menu.lst}
: ${GRUB_DEVICE_MAP:=$BOOTDIR/grub/device.map}
: ${PERL:=/usr/bin/perl}
: ${LILO:=/sbin/lilo}
: ${DETECTLOADER:=/usr/sbin/detectloader.sh}
: ${DETECTLILOBOOT:=/usr/sbin/detectliloboot.sh}
: ${SHARFILE:=/usr/share/loader}

# check perl
if [ ! -x "$PERL" ] && ! type "$PERL" >/dev/null 2>&1; then
echo "$0: warning: PERL=$PERL not available; supposed to run manually..."
PERL="echo $PERL"
fi

# modify lilo config
if [ -w "$LILO_CONF" -a -x "$SHARFILE/lilo" ]; then
cp -pf "$LILO_CONF" "$LILO_CONF.old"
if [ -z "$REMOVE" -a -z "$MEMTEST" -a -n "$OLD_VERSION" ]; then
$PERL "$SHARFILE/lilo" "$OLD_VERSION"
fi
$PERL "$SHARFILE/lilo" $LABEL $MEMTEST $REMOVE "$VERSION"
fi

# modify grub config
if [ -w "$GRUB_MENU_LST" -a -f "$GRUB_DEVICE_MAP" -a -x "$SHARFILE/grub" ]; then
cp -pf "$GRUB_MENU_LST" "$GRUB_MENU_LST.old"
if [ -z "$REMOVE" -a -z "$MEMTEST" -a -n "$OLD_VERSION" ]; then
$PERL "$SHARFILE/grub" "$OLD_VERSION"
fi
$PERL "$SHARFILE/grub" $LABEL $MEMTEST $REMOVE "$VERSION"
fi

# launch lilo
if [ -z "$NOLAUNCH" ]; then
if [ -z "$LOADER" -a -r "$LILO_CONF" -a\
-x "$DETECTLOADER" -a -x "$DETECTLILOBOOT" ]; then
LILO_DEVICE="$($DETECTLILOBOOT "$LILO_CONF")"
[ -z "$LILO_DEVICE" ] ||
LOADER="$($DETECTLOADER "$LILO_DEVICE")"
fi
if [ "$LOADER" = "lilo" -o "$LOADER" = "LILO" ]; then
"$LILO" ||:
fi
fi

exit 0
bootloader-utils-0.4.23.1-alt1/kernel.filetrigger000075500000000000000000000067121224364215200216030ustar00rootroot00000000000000#!/bin/sh -f
#
# RPM filetrigger for kernel install.

# nothing to do if either /proc or /sys is not mounted
[ -d /proc/sys -a -d /sys/class ] ||
exit 0

BOOTDIR=/boot
VMLINUZ_PREFIX=/boot/vmlinuz
MODULES_PREFIX=/lib/modules
INITRD_AUTOUPDATE=

. /etc/sysconfig/installkernel

INSTALLKERNEL_ARGS=
KEEP_INITRD=
if [ -z "$INITRD_AUTOUPDATE" -o "$INITRD_AUTOUPDATE" = none ]; then
KEEP_INITRD=--keep-initrd
fi

if [ -n "$UBOOT_KERNEL_LOAD_ADDRESS" ]; then
WITH_UBOOT=--uboot
INSTALLKERNEL_ARGS="$INSTALLKERNEL_ARGS ${WITH_UBOOT}"
fi

update_default_kernel()
{
local SUFFIX LINK PATTERN DEFAULT INITRD NEW VERSION
SUFFIX="$1"; shift
LINK="$VMLINUZ_PREFIX$SUFFIX"
PATTERN="$VMLINUZ_PREFIX-$1"; shift

DEFAULT=$(readlink -e "$LINK")
# default kernel still exists -> nothing to do
[ -z "$DEFAULT" ] || return 0

# remove stale files
INITRD="/boot/initrd${LINK#$VMLINUZ_PREFIX}.img"
rm -f "$LINK" "$INITRD"
if [ -n "$WITH_UBOOT" ]; then
UIMAGE="/boot/uimage${LINK#$VMLINUZ_PREFIX}"
UINITRD="/boot/uinitrd${LINK#$VMLINUZ_PREFIX}"
rm -f $UIMAGE $UINITRD
fi

NEW=$(set +f; ls -c $PATTERN 2> /dev/null | head -1)
# no candidates found -> nothing to do
[ -f "$NEW" ] || return 0

VERSION=${NEW#$VMLINUZ_PREFIX-}
if [ -n "$SUFFIX" ]; then
# non-empty suffix -> changing the flavour:
# avoid changing default (/boot/vmlinuz) symlink,
# keep already generated initrd image unchanged
/sbin/installkernel $INSTALLKERNEL_ARGS --keep-initrd --nodefault "$VERSION"
else
# change default (/boot/vmlinuz) symlink
/sbin/installkernel $INSTALLKERNEL_ARGS "$KEEP_INITRD" "$VERSION"
fi
}

kernel_versions_handled=
handle_kernel()
{
local f VERSION KFLAVOUR
f="$1"; shift
# filename format: $VMLINUZ_PREFIX-<kversion>-<kflavour>-<krelease>
VERSION=${f#$VMLINUZ_PREFIX-}
KFLAVOUR=${VERSION#*-}; KFLAVOUR=${KFLAVOUR%-*}
kernel_versions_handled="$kernel_versions_handled $VERSION"
if [ -f "$f" ]; then
# file exists -> install kernel
/sbin/installkernel $INSTALLKERNEL_ARGS "$VERSION"
else
# file does not exist -> uninstall kernel
/sbin/installkernel $INSTALLKERNEL_ARGS -r "$VERSION"

# update default kernel if necessary
update_default_kernel "" "[23].*-alt*"

# update per-flavour default kernel if necessary
update_default_kernel "-$KFLAVOUR" "[23].*-$KFLAVOUR-*"
fi
}

module_versions_handled=
last_added=
handle_module()
{
local f VERSION
f="$1"; shift
# filename format: $MODULES_PREFIX/<version>/*
VERSION=${f#$MODULES_PREFIX/}
VERSION=${VERSION%%/*}
[ "$last_added" = "$VERSION" ] ||
module_versions_handled="$module_versions_handled
$VERSION"
last_added="$VERSION"
}

while read f; do
case "$f" in
$VMLINUZ_PREFIX-[23].*-*-*)
handle_kernel "$f"
;;
$MODULES_PREFIX/*-*-*/*/*.ko*)
handle_module "$f"
;;
esac
done

if [ -n "$kernel_versions_handled" -a "$INITRD_AUTOUPDATE" = all ]; then
set +f
ls -c $VMLINUZ_PREFIX-[23].*-*-* 2> /dev/null | while read f; do
[ "$f" != "$(readlink -e /boot/vmlinuz)" ] ||
continue
VERSION=${f#$VMLINUZ_PREFIX-}
# regenerate initrd image without updating symlinks
/sbin/installkernel $INSTALLKERNEL_ARGS --nodefault --noflavour "$VERSION"
done
elif [ -n "$module_versions_handled" ]; then
module_versions_handled="$(printf '%s\n' "$module_versions_handled" |sort -u)"
for m in $module_versions_handled; do
for k in $kernel_versions_handled; do
if [ "$m" = "$k" ]; then
continue 2
fi
done
if [ -f "$BOOTDIR/System.map-$m" ]; then
/sbin/depmod -a -F "$BOOTDIR/System.map-$m" "$m"
fi
done
fi
bootloader-utils-0.4.23.1-alt1/lilo000064400000000000000000000054431224364215200167550ustar00rootroot00000000000000#!/usr/bin/perl
# $Id: lilo,v 1.4 2004/08/17 02:03:39 at Exp $
#--------------------------------------------------------------------
# Copyright (C) 2000, 2001 by MandrakeSoft.
# Chmouel Boudjnah <chmouel@mandrakesoft.com>.
#
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
#--------------------------------------------------------------------
# Copyright (C) 2003 by ALT Linux Team,
# Alexey Tourbin <at@altlinux.org>.
#--------------------------------------------------------------------
# description: Add/remove entry for lilo bootloader.

use strict;
use bootloader_utils qw(getroot);
use Getopt::Long qw(GetOptions);
# --nolaunch is legacy option
GetOptions "n|nolaunch" => \my $nolaunch, "r|R|remove" => \my $remove, "m|memtest" => \my $memtest,
"l|label=s" => \my $label
and (my $version = shift) and (@ARGV == 0)
or die "usage: $0 [-n|--nolaunch] [-r|-R|--remove] [-m|--memtest] [-l|--label <label>] version\n";


sub add_memtest {
local $_ = shift;
my $l=($label eq '')? "memtest86-$version":$label;

$l=~tr/ /_/;
$l=~s/\"/\\\"/g;

/\/memtest-\Q$version.bin\E\b/
or $_ .= <<EOF;
image="/boot/memtest-$version.bin"
label="$l"
EOF
return $_;
}

sub remove_memtest {
local $_ = shift;
my @sections = split /^(?=[ \t]*(?:image|other)[ \t]*=)/m;
@sections = grep { !/\/memtest-\Q$version.bin\E\b/ } @sections;
return join "" => @sections;
}

sub kernel_label {
local $_ = shift;
return "$_";
}

sub add_kernel {
local $_ = shift;
my $l=($label eq '')? kernel_label($version):$label;
my $root = getroot();

$l=~tr/ /_/;
$l=~s/\"/\\\"/g;
$root=~s/\"/\\\"/g;

/\/vmlinuz-\Q$version\E[\s"]/
or $_ .= <<EOF;
image="/boot/vmlinuz-$version"
initrd="/boot/initrd-$version.img"
label="$l"
root="$root"
read-only
optional
EOF
return $_;
}

sub remove_kernel {
local $_ = shift;
my @sections = split /^(?=[ \t]*(?:image|other)[ \t]*=)/m;
@sections = grep { !/\/vmlinuz-\Q$version\E[\s"]/ } @sections;
return join "" => @sections;
}

{
# open lilo.conf for update
my $lilo_conf = $ENV{LILO_CONF} || "/etc/lilo.conf";

# don't use label if it is already used
if ($label ne ''){
open LC, $lilo_conf;
foreach (<LC>){
if (/^\s*label\s*=\s*($label|\"$label\")$/){
$label=''; last;
}
}
close LC;
}

open my $fh, "+<", $lilo_conf
or die "Cannot open $lilo_conf\n";
my $content = do { local $/ = undef; <$fh> };

# modify the content
if ($memtest && $remove) {
$content = remove_memtest($content);
} elsif ($memtest) {
$content = add_memtest($content);
} elsif ($remove) {
$content = remove_kernel($content);
} else {
$content = add_kernel($content);
}
# neat
$content =~ s/\n{3,}/\n\n/g;

# debug
# print $content;
# exit 0;

# do the update
seek $fh, 0, 0;
print $fh $content;
truncate $fh, tell $fh;
# autoclosed
}
bootloader-utils-0.4.23.1-alt1/rebootin000064400000000000000000000046051224364215200176360ustar00rootroot00000000000000#!/usr/bin/perl
#--------------------------------------------------------------------
# Copyright (C) 2000, 2001 by MandrakeSoft,
# Pixel <pixel@mandrakesoft.com>,
# Chmouel Boudjnah <chmouel@mandrakesoft.com>,
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
#--------------------------------------------------------------------
# $Id: rebootin,v 1.1.1.1 2003/11/26 19:11:38 at Exp $
#--------------------------------------------------------------------
## description:
# Reboot once on a specified image

use strict;

my ($fastboot, $noreboot, $listlabels);

while ( $ARGV[0] =~ /^-/ ) {
$_ = shift;
if (/^(-f)|(--fastboot)$/) {
$fastboot++;
} elsif (/^(-n)|(--noreboot)$/) {
$noreboot++;
} elsif (/^(-l)|(--list)$/) {
$listlabels++;
} elsif (/^(-h)|(--help)$/) {
show_help();
} else {
die "Unknow switch $_\n";
}
}
die "Insufficient arguments" unless $ARGV[0] || $listlabels;

my $lilo_conf = "/etc/lilo.conf";

my @entries;

my $lilo_boot = `/usr/sbin/detectliloboot.sh`
or die "Can't get boot device from lilo.conf\n";
chomp $lilo_boot;

my $bootloader = `/usr/sbin/detectloader.sh $lilo_boot`
or die "Can't detect your bootloader\n";
chomp $bootloader;

die "Lilo is not installed in $lilo_boot\n"
if $bootloader != "lilo";


open F, $lilo_conf
or die "lilo is not installed ($lilo_conf is missing)\n";

@entries = map { /=\"([^\s\"][^\"]*)\"/ } grep { /\s*label=\S*/ } <F>;
@entries > 0 or die "Bad lilo.conf (no entry found)\n";

list_labels() if $listlabels;

grep /^$ARGV[0]$/, @entries
or die "Unknown label \"$ARGV[0]\"\n";

write_fast_boot() if $fastboot;

system("lilo -R @ARGV");
die "error while wanting to reboot on $ARGV[0]\n" if $?;

exec "reboot" unless $noreboot;

sub show_help {
die <<EOF
rebootin - reboots the machine using a particular Boot Loader entry

usage: rebootin [options] <label>
<filename> must specify seekable regular file or device.

Options:
-f, --fastboot reboot in fastboot mode.
-n, --noreboot don't reboot immediately.
-l, --list list available labels.
-h, --help show this text and exit.

Rebootin currently works only with LILO.

Report bugs to http://bugs.altlinux.ru/

EOF
}

sub list_labels {
die join("\n", @entries) . "\n";
}

sub write_fast_boot {
local *F; open F, ">/fastboot"; close F;
}
bootloader-utils-0.4.23.1-alt1/rebootin.8000064400000000000000000000021651224364215200200030ustar00rootroot00000000000000.TH rebootin 8 "03 Mar 2001" "Mandrakesoft" "Linux-Mandrake"
.IX rebootin
.SH NAME
rebootin \- Reboots the machine using a particular Boot Loader entry
.SH SYNOPSIS
.B rebootin [\fIOPTIONS\fR] <\fIlabel\fP>
.SH DESCRIPTION
\fBrebootin\fP reboots the machine it is launched on. While with a
simple \fBreboot\fP you need to manually select the boot entry to use
at startup, \fBrebootin\fP allows to specify the boot entry on the
command line.
.PP
<\fIlabel\fP> is the name of the entry as named in the boot loader
configuration file.
.PP
\fBrebootin\fP currently works only with \fBLILO\fP.
.SH OPTIONS
.TP
.I -f, --fastboot
Create a /fastboot file to reboot in fastboot mode (eg: no \fBfsck(8)\fP).
.TP
.I -n, --noreboot
Don't reboot immediately just set the flags for next reboot.
.TP
.I -l, --list
Display the list of available boot entries.
.TP
.I -h, --help
Show help.
.SH FILES
/etc/lilo.conf
/boot/grub/menu.lst
.br
The \fBrebootin\fP executable (perl script)
.PP
.SH "SEE ALSO"
grub(8),
lilo(8),
fsck(8)
.SH AUTHORS
Pascal Rigaux, Mandrakesoft
.br
pixel@mandrakesoft.com
.PP
Chmouel Boudjnah, Mandrakesoft
.br
chmouel@mandrakesoft.com
bootloader-utils-0.4.23.1-alt1/test.pl000064400000000000000000000011341224364215200174000ustar00rootroot00000000000000use strict;
use Test;
BEGIN { plan tests => 5 };
use lib ".";
use bootloader_utils qw(mnt2dev);
ok(1);

use File::Temp qw(tempdir);
use sigtrap qw(die normal-signals);

my $dir = tempdir("bootloader.XXXXXXXXXX", CLEANUP => 1, TMPDIR => 1);
ok($dir);

{
open my $fh, ">", "$dir/fstab";
print $fh <<EOF;
LABEL=ROOT / ext3 defaults 1 1
LABEL=BOOT /boot ext3 defaults 1 2
/dev/hde5 /home ext3 defaults 1 2
/dev/hde1 /usr ext3 defaults 1 2
EOF
}

ok(mnt2dev("/", "$dir/fstab") eq "LABEL=ROOT");
ok(mnt2dev("/boot", "$dir/fstab") eq "LABEL=BOOT");
ok(mnt2dev("/home", "$dir/fstab") eq "/dev/hde5");

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin