Certification

RPM, Boot Loaders, and Kickstart UNIT 7

RPM, Boot Loaders, and Kickstart

1

Rev RH133-9.0-1 Copyright © 2003 , Inc. UNIT 7: Objectives

Upon completion of this unit the student should be able to: · Use RPM to install, remove, update, and query packages · Describe how to configure a multi-boot system · Configure the GRUB and LILO boot loaders · Configure Kickstart and perform automated installations

2

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. UNIT 7: Agenda

· Using RPM · Installing Red Hat on a multi-boot system · Configuring a boot loader · Deploying an installation server · Installation using Kickstart

3

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. The RPM Way

? Package installation is never interactive

? Applies to all sw (core OS and add-ons)

? No such thing as a to a

4

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. RPM · RPM Components · local database · rpm and related executables · package files · rpmfind and metadirectories · Primary Functions · install/remove · query · verify · build

5

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Installing and Removing Software

· Installing and Removing Software · Install: rpm -i, --install · Upgrade: rpm -U, --upgrade · Freshen: rpm -F, --freshen · Erase: rpm -e, --erase · Common Options · Output options: -v, -h · Preconditions: --nodeps, --replacefiles, --force · Relocating: --excludepath, --prefix, --relocate, --badreloc, --root · URL support: ftp (with globbing), http

6

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Updating a Kernel RPM

? Make sure to install kernel updates

? Do not use rpm -U ! – rpm -ivh kernel-version.arch.rpm – Boot new kernel to test – Revert to old kernel if a problem arises – rpm -e kernel-oldversion if no problems

7

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. rpm Queries

· Syntax: rpm -q what_packages what_information · Package Options: · -a · package_name · -f filename · -p package_file_name · Information Options: · Default: package name · -i: general information · -l: file list

8

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. rpm Queries and Verification

· Additional query examples · File Verification: · rpm -V package_name · rpm -Va · Signature verification: · gpg --import gpg_key rpm –-import gpg_key · At package install: · rpm -–checksig package_file_name

9

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Other RPM Utilities and Features · rpm2cpio: file extraction · rpmdb-redhat: distribution database · rpm –-redhatprovides filename · rpm –-redhatprovides capability · redhat-config-packages

1 0

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. (RHN)

· RHN Components · RHN account · System identity · /usr/sbin/ · rhnsd daemon and queued actions · Advantages · Errata concurrency · collective and remote administration

1 1

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Automatic Dependency Resolution

? automatic installation of dependent packages

? invoked with "--aid" option.

? use in conjunction with rpmdb-redhat

? macro can indicate where package files found

1 2

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. RHN in the Enterprise

?Workgroup Service

? System grouping

? Multiple administrators

?Proxy Server

? Updates cached locally

? Private channels

? Server

? Client profiles stored locally

? Custom channel management 1 3

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. RHN Registration

· /usr/sbin/up2date · username, password, system name · Remote Information · Hardware Profile · Software Profile (RPM list) · Subscribed Channel · Local Digital Certificate · /etc/sysconfig/rhn/systemid

1 4

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. The up2date utility

· Interactive or batch invocations · Functions · Freshen with published errata/updates · Install new packages · Resolve package dependencies · /usr/sbin/up2date-config · install or download only · cache dir: /var/spool/up2date

1 5

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Remote Administration

· Web based administration · https://rhn.redhat.com · Multiple subscribed systems · Queued actions · Local polling: rhnsd · Every 2 hours by default · /usr/sbin/rhn_check does the hard work

1 6

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Boot Loader Components

· Boot Loader · 1st Stage - small, resides in MBR or boot sector · 2nd Stage - loaded from boot partition · Minimal specifications for Linux: · kernel location, root partition, label · Minimal specification for other OS: · boot device, label

1 7

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. LILO and lilo.conf

· LILO was standard boot loader in older versions of · Configuration file is /etc/lilo.conf · /sbin/lilo must be run for lilo.conf changes to take effect · /sbin/lilo -t to test configuration before installing · /sbin/lilo -v to install LILO or update configuration · /sbin/lilo -u to restore the MBR backup

1 8

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. GRUB and grub.conf · GRUB is an advanced replacement for LILO · Command-line interface available at boot prompt · Boot from ext2/ext3, ReiserFS, JFS, FAT, minix, or FFS filesystems · Supports MD5 password protection · /boot/grub/grub.conf · Changes to grub.conf take effect immediately · unlike LILO, don't need to reinstall when configuration is modified · if MBR on /dev/hda is corrupted, reinstall GRUB with /sbin/grub-install /dev/hda

1 9

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Starting the Boot Process: LILO

· LILO boot: · forced with , · Image selection ( lists) · Linux kernels · Partition boot sectors (other OSes) · Argument passing · LILO parameters · kernel parameters · init arguments or environment

2 0

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Starting the Boot Process: GRUB

· Image selection · select with up/down arrows on the boot splash screen · Argument passing · change an existing stanza in menu editing mode · issue boot commands interactively on the GRUB command line

2 1

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Multiboot Systems · Linux can coexist with other operating systems, including the following: · Windows NT/2000 · DOS, Windows 3.x/9x/ME/XP · NetBSD, FreeBSD, and other open systems · Two major issues arise when implementing multiboot systems: · Partitioning and the boot process

2 2

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Red Hat Linux Network Installation Server · Necessary for network-based installs · Often faster than CDROM-based installation methods · Provides an easy distribution platform for the enterprise · Shares the RedHat directory via NFS, FTP and/or HTTP

2 3

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Using Kickstart to automate installation

? Kickstart is a component of the installer that automates installation

? Kickstart supports all installation methods

? The installer reads information from an ASCII file rather than prompting for it

2 4

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Kickstart: Commands Section

? Constructs arguments that are passed to configuration utilities (“commands”)

? The absence of required specifications (e.g., keyboard) will raise the appropriate utility

? Commands section must come first

2 5

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Kickstart: %packages

? %packages specifies components groups and RPMs to install

? Component groups in the comps.xml file are specified with @ component-group

? Third-party RPMs cannot be specified without modifying hdlist

? Package names only (not version)

2 6

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. Kickstart: %pre, %post

?%pre gives you the first word

? executes as a bash shell script

? executes after Kickstart file is parsed ?%post gives you the final word

? Can specify interpreter (bash is default) ? ’ed by default, but may be run without chroot

2 7

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc. End of Unit 7

· Questions and answers · Summary · In what files are GRUB and LILO configured, respectively? · What LILO command installs the first stage loader? What GRUB command does this? · Where can the Kickstart configuration file be stored?

2 8

Rev RH133-9.0-1 Copyright © 2003 Red Hat, Inc.