SDT-INITRD(1) SUSE Driver Tools

Scott Bahling

19-03-2019

NAME

sdt initrd - tool for working with SUSE installer initrd images

SYNOPSIS

sdt initrd unpack [options] INITRD PATH

sdt initrd pack [options] PATH INITRD_FILE

sdt initrd update [options] (–base=BASEMEDIA | INITRDFILE) DEST

sdt initrd update [options] [–modspec=MODSPEC] (–base=BASEMEDIA | INITRDFILE) DEST

sdt initrd compare [options] INITRD1 INITRD2

DESCRIPTION

INITRD

The sdt initrd tool provides the following commands:

unpack: Unpack an initrd to a specified location pack: Pack an unpacked initrd filesystem into an initrd image update: Update an initrd images based on update files provided compare: Create a report showing the difference between two initrd imagse

PACK AND UNPACK

To unpack an initrd image use the ‘unpack’ command as follows:

sdt initrd unpack /path/to/initrd unpackdir

This will unpack the initrd images located at ‘/path/to/initrd’ into the directory ‘unpackdir’ in the current path. ‘unpackdir’ must exist and be empty.

To re-packing an initrd image is just as simple using the ‘pack’ command as follows:

sdt initrd pack unpackdir /path/to/new/initrd-image

This creats a new initrd image located at ‘/path/to/new/initrd-image’ containing all files under ‘unpackdir’

UPDATE

The following examples updates an existing initrd image ‘initrd’ and write the new image to ‘newinitrd’

sdt initrd update -u updates -b ./distro/sles11sp1-x86_64 newinitrd

The -b/--base option to points to the distro installation media and required when adding kernel module package updates to the initrd.

The -u/--updatedir option specifies a directory where the sdt tool will find the files to be added to the Update Medium. Any KMPs, kernel packages, or other files found in the directory will be added to the initrd appropriately, and the 'linux file exported will be based on any default flavor kernel package provided. If no updated kernel package is provided, the linux kernel image will be exported from the base media. If the --updatedir option is not specified, the updates subdirectory in the current working directory will be used by default.

UPDATE OPTIONS

-b BASE_MEDIA, –base BASE_MEDIA
Points to the contents of the initial installation media of the SUSE Linux Enterprise Product that the driver kit is designed to work with. Option can point to either a directory containing the contents of the installation media, or the media ISO image itself.
-u UPDATEDIR, –updatedir=UPDATEDIR
Directory to be scanned for update files to be added to driver kit. Directory will be scanned for kernel packages, KMP packages, YaST2 modules (.ybc), and tar files (.tgz). (Default: ./updates)
-w WORKDIR, –workdir WORKDIR
Work directory. Created if non-existent and remains after completion. If this option is not specified, temporary directory is created and deleted on exit.
-m MODSPEC, –modspec MODSPEC

Additional module to add to module.config such that it’s added to initrd and linuxrc considers it while probing hardware. MODSPEC is of the following format:

SECTION:MODULE,DESCR,PARAM,PRE_INST,POST_INST,INITRD,AUTO

If the kernel doesn’t contain any new driver which should be loaded for installation compared to the kernel contained in the base ISO, this option isn’t necessary.

–no-initrd-mod-updates
Do not update the kernel modules in the initrd. When updating the initrd, the kernel modules and related files will be copied as-is from the base media to the installation kit initrd.
–threads MAX_THREADS
Max number of threads to use for certain processes. Currently passed to the xz command when compressing the initrd. [default: 1]

COMPARE

The compare command compares two initrd images and creates a report to stdout listing any differences

sdt initrd compare initrd1 initrd2

The command compares the mode, UID, GID and hash (md5sum) of each file. If the files differ, the will be listed along with the compared data as follows:

- initrd1: lib/modules/3.12.28-4-default/initrd/igb.ko: MODE: 0600 UID 10651 GID 0 hash: 43a37a2f9e2d6d669f0704cf6673a025e8df40a6
+ initrd1: lib/modules/3.12.28-4-default/initrd/igb.ko: MODE: 0600 UID 10651 GID 0 hash: da39a3ee5e6b4b0d3255bfef95601890afd80709

This shows that the igb.ko file has changed (different hash) between the two initrd images.

If a file exists in one image and not the other, the file data will be shown for the existing file, and “NOT FOUND” for the initrd that does not contain the file. For example:

- initrd1: lib/modules/3.12.28-4-default/initrd/igb.ko: MODE: 0600 UID 10651 GID 0 hash: 43a37a2f9e2d6d669f0704cf6673a025e8df40a6
+ initrd1: lib/modules/3.12.28-4-default/initrd/igb.ko: NOT FOUND

COMPARE OPTIONS

-w WORKDIR, –workdir WORKDIR
Work directory. Created if non-existent and remains after completion. If this option is not specified, temporary directory is created and deleted on exit.

FILES DETECTED IN UPDATEDIR

When scanning the UPDATEDIR for files to be added to the driver kit, certain files will be automatically detected and specific actions taken. See sdt-file-detection (7) for more information on how files are detected.

SEE ALSO

sdt(1), sdt-file-detection(7)