Worksheets4. 201.2 Compiling a Linux kernel
Total questions: 48
Worksheet time: 33mins
What's the common location to store and unpack kernel sources?
/boot/
/boot/efi/
/usr/src/kernel/
/usr/src/linux/
/usr/src/
The following file is an example of source code for Linux:
linux-3.18.43.tar.xz
Which two commands allow you to decompress and unpack that file according to the LPIC-2 book:
unxz
zip
tar
gzip
cpio
"It's a kernel-cleaning command to delete most generated files, but leaves enough to build external modules".
What command is referred to above?
make mrproper
make distclean
make clean
menuconfig
"It's a kernel-cleaning command to delete the current configuration and all generated files. It deletes the main configuration file too".
(a)
"It's a kernel-cleaning command to remove editor backup files, patch leftover files and the like".
(a)
What's the file containing configuration information and it has different support options to be compiled into the Kernel?
/usr/src/kernel.config
/boot/vmlinuz/
/boot/kernel.copnfig
.config
Where is located the file containing kernel configuration information and it has different support options to be compiled into the Kernel?
/usr/src/kernel.config
/boot/vmlinuz/
/boot/kernel.copnfig
/usr/src/linux/.config
"This command is used to configure your kernel config file and it's recommended for systems with very limited display capabilities. You are forced to redo everything if you make a mistake".
(a)
"It's an alternative to make config . It creates a text-mode windowed environment based on the ncurses libraries.
You can switch back and forth between options while configuring your kernel".
(a)
"This command presents a GUI menu to configure the kernel.
It requires a working X Window System and the QT development libraries to work.".
Type the correct command:
(a)
"This command presents a GUI menu to configure the kernel.
It uses Gnome to work.".
Type the correct command:
(a)
"This command can be used to preserve options you choose during an earlier kernel build. changes the names of the file .config to .config.old, and it creates a new one .config file, all this in the path /usr/src/linux/".
Type the correct command:
(a)
This command is used to compress and decompress the Linux Kernel.
make zImage/bzImage
make modules
make modules_install
make oldconfig
This command builds the modules, the device drivers, and other items that were configured as modules.
make zImage/bzImage
make modules
make build_modules
make oldconfig
This command installs the modules you just compiled under /lib/modules/ kernel-version. The kernel-version directory will be created if nonexistent.
make modules_install
make modules
make build_modules
make oldconfig
__________ is a chunk of memory that the kernel sees as if it were a disk. It can be mounted like any other disk.
Fill in the blank space.
RAM disk
initrd
init ram file system
mkinitird
It's a temporal file system that is loaded into the RAM disk and mounted by the kernel as its root filesystem. Once mounted as the root filesystem, programs can be run from it, and kernel modules loaded from it.
RAM disk
initrd
kernel module
vmlinuz
Which three ways can be used to create your own initrd file?
mkinitird script (RedHat)
DKMS
apt
mkinitramfs script (Debian)
Built the file by hand
It contains archives that contain the files of a minimal root filesystem. This root filesystem normally contains modules, scripts, and some additional binaries required to allow the kernel to properly continue its boot
RAM disk
initrd
kernel module
vmlinuz
Choose all the possible steps to build the initrd file by hand:
Create a root file system.
Populate it with modules and files.
Create a tar or cpio archive (depends on the distro)
Gzip it
Create a RAM disk
What of the following requirements is needed to be able to work with the initrd images?
A loopback device
The number of RAM disks that is available
The kernel has to be compiled with support for the RAM disk
Patching the kernel
Which two steps are needed to create a RAM disk image?
Create a filesystem on a block device
Compile the kernel
Patch the kernel
Copy the files to the filesystem you've created as needed
Partition the disk intended to be a RAM disk
Which are two suitable devices to use to create a RAM disk image?
HDD device
SDD device
RAM Memory device
Loopback device
Rom device
"Linux indeed has a "ramdisk" driver that could provide /dev/ram# devices, and it might be available on your system, but it is usually not loaded by default and those device nodes will not exist unless you load that driver first."
Which command loads that kernel module?
(a)
The number of RAM disks that is available by default on a system is which option in the kernel configuration?
CONFIG_BLK_DEV_RAM=
CONFIG_BLK_DEV_RAM_COUNT=
CONFIG_BLK_DEV_RAM_SIZE=
CONFIG_BLK_DEV_RSXX=
Type the command to create an empty filesystem on /dev/ram0 with 300MB and without reserve blocks.
(a)
Which of the following commands creates the device node that will be used when the initrd is active?
mke2fs -m0 /dev/ram0 300
mknod -m0 /dev/ram0 300
mknod /mnt/dev/tty1 c 4 1
mke2fs /mnt/dev/tty1 c 4 1
Which command is used to reclaim the memory space that was allocated to the RAM disk?
freeramdisk /dev/ram0
freerinit /dev/ram0
free/dev/ram0
freeinitrd /dev/ram0
Which command is used to patch a Linux kernel?
patch -p1<patchfile
patch patchfile
patch-kernel patchfile
patch -k patchfile
"If the patch utility is unable to apply a part of a kernel's patch, it puts that part in a reject file".
How would that file be shown?
Name of the output file + .rej
Name of the output file + .kern
Name of the output file + .patch
Name of the output file + # in case .rej would generate a filename that is too long.
Name of the output file + .patch + #
What does DKMS stand for?
(a)
"It's a framework, capable of automatically compiling and/or installing kernel modules for every kernel version available on the system. It was developed by Dell".
DKMS
DMKS
initrd
Dracut
What is a uniform requirement across all distributions for the kernel when using DKMS?
Install kernel header files
Install the newest kernel
Patch the kernel
Install the dracut package
Type the command to install the kernel header files on Red Had based Linux distributions:
(a)
Type the command to install the kernel header files on Debian based Linux distributions:
(a)
After the installation of DKMS packages, where are they placed?
/usr/src/module-version
/usr/module-version
/boot/grub/module-version
/usr/bin/module-version
Choose all the options contained in a dkms.conf?
BUILT_MODULE_NAME
BUILT_KERNEL_NAME
DEST_MODULE_LOCATION
BUILT_MODULE_LOCATION
PACKAGE_NAME
Choose all the options contained in a dkms.conf?
PACKAGE_VERSION
DKMS_VERSION
AUTOINSTALL
MODULE_VERSION
REMAKE_INITRD
Which option of the dkms.conf determines the name of the compiled module?
BUILT_MODULE_NAME
BUILT_KERNEL_NAME
DEST_MODULE_LOCATION
BUILT_MODULE_LOCATION
PACKAGE_NAME
Which option of the dkms.conf determines the location of the compiled module?
BUILT_MODULE_NAME
BUILT_KERNEL_NAME
DEST_MODULE_LOCATION
BUILT_MODULE_LOCATION
PACKAGE_NAME
Which option of the dkms.conf determines the name associated with the entire package of modules?
BUILT_MODULE_NAME
BUILT_KERNEL_NAME
DEST_MODULE_LOCATION
BUILT_MODULE_LOCATION
PACKAGE_NAME
Which option of the dkms.conf determines the version associated with the entire package of modules and is mandatory?
PACKAGE_VERSION
MODULE_VERSION
AUTOINSTALL
DEST_MODULE_LOCATION
REMAKE_INITRD
Which option of the dkms.conf determines whether or not the dkms_autoinstaller service will try to install the module for every kernel the system boots in to?
DEST_MODULE_LOCATION
PACKAGE_VERSION
AUTOINSTALL
MODULE_VERSION
REMAKE_INITRD
Which option of the dkms.conf determines whether the initrd image should be generated again after this module is installed. The value of this directive defaults to "no"?
PACKAGE_VERSION
DEST_MODULE_LOCATION
AUTOINSTALL
MODULE_VERSION
REMAKE_INITRD
Which is the full path of the folder which holds example configuration files of the dkms on Debian-based Linux distributions?
(a)
Which is the full path of the folder which holds example configuration files of the dkms on Red Hat-based Linux distributions?
(a)
"It can take care of generating a new initramfs image whenever there seems a need to do so".
DKMS
Dracut
RAM disk
mrproper
"It's the process of deleting the full or a part of the files, objects, and configuration created by a kernel when it was compiled, in case you need to recompile it in the future with new modules and objects".
Compile a kernel
Clean a kernel
Recompile a kernel
Build a kernel
Build kernel modules
