
P A R T I
C O N N E C T I N G T H E B O A R D
72
It’s highly unlikely that you’ll ever need to boot a Pi using the emergency kernel, but it’s
worth learning how to do so just in case. This is especially important if you’re upgrading your
kernel or are using a new and potentially poorly tested distribution. Sometimes, newly
released software can have
bugs
which aren’t spotted before its release. When encountering
strange errors after upgrading, the emergency kernel can be used to narrow down the prob-
lem to the new kernel version.
The Linux kernel is a single file located in the
/boot
directory called
kernel.img
. When
the Pi is first switched on and begins to load the operating system, it looks for this file, and if
the file is missing, the Pi won’t work. The emergency kernel is a second file, again in the
/
boot
directory, called
kernel_emergency.img
.
The emergency kernel is, in most cases, almost identical to the standard kernel. When
changes are made to the standard kernel, to boost performance or add new features for
example, the emergency kernel is left unaltered. This way, if the changes to the standard
kernel cause stability problems, a user can simply tell the Pi to load the emergency kernel
instead.
There are two ways to boot into the emergency kernel, and both require the use of a PC and
an SD card reader if the Pi can’t boot. Otherwise, the following steps can be carried out on
the Pi itself.
The easiest way to boot the emergency kernel is to rename the existing
kernel.img
file to
kernel.img.bak
, and then rename the
kernel_emergency.img
file to
kernel.img
.
When the Pi loads, it will now load the emergency kernel by default. To go back to the stan-
dard kernel, simply reverse the process: rename
kernel.img
to
kernel_emergency.img
and
kernel.img.bak
to
kernel.img
.
An alternative method to load the emergency kernel is to edit the
cmdline.xt
file (located
in the
/boot
directory) by adding the following entry at the end of the existing command
line:
kernel=kernel_emergency.img
This tells the Pi that it should load the kernel named
kernel_emergency.img
instead of
the usual
kernel.img
. Reversing the process is as simple as opening
cmdline.txt
again
and removing the entry.
You’ll learn more about
cmdline.txt
and how it affects the operation of the Raspberry Pi
in Chapter 7, “Advanced Raspberry Pi Configuration”.
Содержание A
Страница 1: ......
Страница 2: ......
Страница 3: ...Raspberry Pi User Guide 2nd Edition...
Страница 4: ......
Страница 5: ...Raspberry Pi User Guide 2nd Edition Eben Upton and Gareth Halfacree...
Страница 10: ......
Страница 26: ...R A S P B E R R Y P I U S E R G U I D E S E C O N D E D I T I O N 10...
Страница 28: ......
Страница 29: ...Chapter 1 Meet the Raspberry Pi...
Страница 37: ...Chapter 2 Getting Started with the Raspberry Pi...
Страница 56: ......
Страница 57: ...Chapter 3 Linux System Administration...
Страница 79: ...Chapter 4 Troubleshooting...
Страница 89: ...Chapter 5 Network Configuration...
Страница 109: ...Chapter 6 The Raspberry Pi Software Configuration Tool...
Страница 122: ......
Страница 123: ...Chapter 7 Advanced Raspberry Pi Configuration...
Страница 140: ......
Страница 141: ...Chapter 8 The Pi as a Home Theatre PC...
Страница 151: ...Chapter 9 The Pi as a Productivity Machine...
Страница 159: ...C H A P T E R 9 T H E P I A S A P R O D U C T I V I T Y M A C H I N E 143 Figure 9 4 Exporting a file from The Gimp...
Страница 160: ......
Страница 161: ...Chapter 10 The Pi as a Web Server...
Страница 171: ...Part III Programming with the Raspberry Pi Chapter 11 An Introduction to Scratch Chapter 12 An Introduction to Python...
Страница 172: ......
Страница 173: ...Chapter 11 An Introduction to Scratch...
Страница 189: ...Chapter 12 An Introduction to Python...
Страница 216: ......
Страница 218: ......
Страница 219: ...Chapter 13 Learning to Hack Hardware...
Страница 234: ......
Страница 235: ...Chapter 14 The GPIO Port...
Страница 249: ...Chapter 15 The Raspberry Pi Camera Module...
Страница 265: ...Chapter 16 Add on Boards...
Страница 279: ...Part V Appendixes Appendix A Python Recipes Appendix B Camera Module Quick Reference Appendix C HDMI Display Modes...
Страница 280: ......
Страница 281: ...Appendix A Python Recipes...
Страница 287: ...Appendix B Raspberry Pi Camera Module Quick Reference...
Страница 293: ...Appendix C HDMI Display Modes...