arch/x86/boot/genimage.sh
Source file repositories/reference/linux-study-clean/arch/x86/boot/genimage.sh
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/boot/genimage.sh- Extension
.sh- Size
- 6713 bytes
- Lines
- 276
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: arch/x86
- Status
- atlas-only
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/bin/bash
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 2017 by Changbin Du <changbin.du@intel.com>
#
# Adapted from code in arch/x86/boot/Makefile by H. Peter Anvin and others
#
# "make fdimage/fdimage144/fdimage288/hdimage/isoimage"
# script for x86 architecture
#
# Arguments:
# $1 - fdimage format
# $2 - target image file
# $3 - kernel bzImage file
# $4 - mtools configuration file
# $5 - kernel cmdline
# $6+ - initrd image file(s)
#
# This script requires:
# bash
# syslinux
# genisoimage
# mtools (for fdimage* and hdimage)
# edk2/OVMF (for hdimage)
#
# Otherwise try to stick to POSIX shell commands...
#
# Use "make V=1" to debug this script
case "${KBUILD_VERBOSE}" in
*1*)
set -x
;;
esac
# Exit the top-level shell with an error
topshell=$$
trap 'exit 1' USR1
die() {
echo "" 1>&2
echo " *** $*" 1>&2
echo "" 1>&2
kill -USR1 $topshell
}
# Verify the existence and readability of a file
verify() {
if [ ! -f "$1" -o ! -r "$1" ]; then
die "Missing file: $1"
fi
}
diskfmt="$1"
FIMAGE="$2"
FBZIMAGE="$3"
MTOOLSRC="$4"
KCMDLINE="$5"
shift 5 # Remaining arguments = initrd files
export MTOOLSRC
# common options for dd
dd='dd iflag=fullblock'
# Make sure the files actually exist
verify "$FBZIMAGE"
Annotation
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.