[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Boot Anaconda with Grub rpm package

I usually do upgrades via Anaconda by copying the vmlinuz and initrd.img
from the isolinux dir on the install media to my /boot and then adding
an entry to /etc/grub.conf to boot into Anaconda and do the Upgrade. 

Today I decided that replacing this manual process by a rpm file
containing the files with the necessary scriplet shebang for the grub
stuff would be a better idea. Attached is my .spec so far. 

This works for me, as in install/uninstall add/removes the grub entry
and the right files. Rebooting and selecting the "Install/Upgrade Fedora
6.93" entry in the grub boot menu actually boots Anaconda and asks for
the install method. 

Some questions though:

Is this usable for anyone but me? 

Can this be distributed in Fedora, can it be distributed by me? Am I
doing something wrong by repackaging the binary initrd.img and vmlinuz

Multi-arch: My initial idea was to just create one tarball per arch and
have them in the spec as Source0, Source1 and so forth and use arch
macros in the spec to determine which tarball to use on which arch. Does
anyone have a better idea?

SRPM here:
http://folk.ntnu.no/sindrb/packages/fedora-bootanaconda-6.93-1.fc7.src.rpm (7.3 MB)

SPEC here: http://folk.ntnu.no/packages/fedora-bootanaconda.spec
(spec is also attached)

Sindre Pedersen Bjørdal <foolish guezz net>
- http://www.fedoraproject.org/wiki/SindrePedersenBjordal

#version mirrors the version of Fedora it will install

Name:           fedora-bootanaconda
Version:        6.93
Release:        1%{?dist}
Summary:        Start the Fedora installer with the existing boot loader

Group:          System Environment/Kernel
License:        GPL
URL:            http://www.fedoraproject.org/wiki/SindrePedersenBjordal/FedoraBootAnaconda
#source is binary
Source0:        %{name}-%{version}-i386.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExclusiveArch:  i386

Requires:       mkinitrd

Fedora-bootanaconda provides the files necessary to boot into the Fedora
installer, called Anaconda, from an existing Fedora installation without
the use of external media. This allows the user to simply reboot and select
"Install Fedora" from the bootloader menu to start the installation/upgrade
of Fedora.

%setup -qn %{name}-%{version}-%{_arch}

#no build needed

install -m 0644 -D vmlinuz $RPM_BUILD_ROOT/boot/vmlinuz-bootanaconda-%{version}
install -m 0600 -D initrd.img $RPM_BUILD_ROOT/boot/initrd-bootanaconda-%{version}.img

#use grubby to add entry to grub
grubby --add-kernel=/boot/vmlinuz-bootanaconda-%{version} --args=askmethod --initrd=/boot/initrd-bootanaconda-%{version}.img --title="Install/Upgrade Fedora %{version}"

#remove grub entry
grubby --remove-kernel=/boot/vmlinuz-bootanaconda-%{version}



* Thu May 26 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 6.93-1
- Initial build

Attachment: signature.asc
Description: Dette er en digitalt signert meldingsdel

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]