diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/AUTHORS b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/AUTHORS new file mode 100644 index 0000000..416082b --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/AUTHORS @@ -0,0 +1,319 @@ +Harald Hoyer +Victor Lowther +Jóhann B. Guðmundsson +Amadeusz Żołnowski +Daniel Molkentin +Hannes Reinecke +Kairui Song +Will Woods +Philippe Seewer +Warren Togami +Dave Young +Jeremy Katz +Lukas Nykryn +David Dillow +Lubomir Rintel +Michal Soltys +Colin Guthrie +Amerigo Wang +Thomas Renninger +Alexander Tsoy +Martin Wilck +Frederick Grose +WANG Chao +Yu Watanabe +Andrey Borzenkov +Hans de Goede +Jonathan Lebon +Peter Jones +Peter Robinson +Andreas Thienemann +Frantisek Sumsal +Fabian Vogt +Nicolas Chauvet +Tomasz Paweł Gajc +Zoltán Böszörményi +Beniamino Galvani +Colin Walters +John Reiser +Luca Berra +Xunlei Pang +Brian C. Lane +Daniel Drake +Renaud Métrich +Angelo "pallotron" Failla +Thomas Blume +Ville Skyttä +Böszörményi Zoltán +Cristian Rodríguez +Dan Horák +Javier Martinez Canillas +Ondrej Mosnacek +Baoquan He +Brendan Germain +David Tardon +Dusty Mabe +Jonas Witschel +Leho Kraav +Marcos Mello +Mikhail Novosyolov +Moritz Maxeiner +Nathan Rini +Radek Vykydal +Đoàn Trần Công Danh +Fabian Deutsch +Kamil Rytarowski +Lidong Zhong +Marc Grimme +Mike Gilbert +NeilBrown +Peter Rajnoha +Thorsten Behrens +Zbigniew Jędrzejewski-Szmek +q66 +Adam Williamson +Chao Wang +Frederic Crozat +James Lee +Jesse Keating +Milan Broz +Mimi Zohar +Norbert Lange +Roberto Sassu +Stefan Reimer +Takashi Iwai +Anton Blanchard +Bill Nottingham +Chapman Flack +Chris Leech +David Cantrell +Dennis Gilmore +Doan Tran Cong Danh +Gaël PORTAY +Jan Synacek +Jiri Konecny +Jon Ander Hernandez +Juan RP +Lance Albertson +Marian Ganisin +Matthias Gerstner +Max Resch +Michael Ploujnikov +Pratyush Anand +Silvio Fricke +Steven Brudenell +Stig Telfer +Thomas Backlund +Topi Miettinen +Vasiliy Tolstov +Wim Muskee +Alan Jenkins +Alan Pevec +Alex Harpin +Alexey Shabalin +Ankit Kumar +Antony Messerli +Chao Fan +Daniel Cordero +Daniel Kahn Gillmor +Daniel Schaal +Denis Silakov +Dimitri John Ledkov +Erwan Velu +Evgeny Vereshchagin +Guido Trentalancia +Hari Bathini +Ian Dall +Imran Haider +James Buren +Jan Macku +Joey Boggs +Julian Wolf +Koen Kooi +Konrad Rzeszutek Wilk +Kyle McMartin +Luiz Angelo Daros de Luca +Lukas Wunner +Mariusz Tkaczyk +Marko Myllynen +Matthew Thode +Michal Koutný +Mike Snitzer +Minfei Huang +Nikoli +Patrick Talbert +Pedro Monreal +Petr Pavlu +Pingfan Liu +Przemysław Rudy +Robert LeBlanc +Robert Scheck +Stefan Berger +Stefan Berger +Thomas Lange +Till Maas +Tony Asleson +Vivek Goyal +Vladislav Bogdanov +Érico Rolim +наб +A. Wilcox +Adam Alves +Alexander Kurtz +Alexander Miroshnichenko +Alexander Sosedkin +Alexander Todorov +Alexey Kodanev +Andreas Schwab +Andreas Stieger +Andrew J. Hesford +Andy Lutomirski +Anjali Kulkarni +Anssi Hannula +Antz +Arnaud Rebillout +Artem Savkov +Attila Bruncsak +B. Wilson +Ben Howard +Benjamin Marzinski +Brandon Philips +Bruno E. O. Meneguele +Bryn M. Reeves +Canek Peláez Valdés +Carlo Caione +Chad Dupuis +Christian Heinz +Cong Wang +Dan Fuhry +Dave Jones +David Disseldorp +David Hildenbrand +David Michael +Denis Volkov +Dennis Schridde +Derek Hageman +Derek Higgins +Donovan Tremura +Duane Griffin +Elan Ruusamäe +Enno Boland +Enzo Matsumiya +Eugene S. Sobolev +Eugene Syromiatnikov +Evgeni Golov +Fabian Vogt +Florian Albrechtskirchinger +Florian Gamböck +Frank Deng +François Cami +Gerd von Egidy +Glen Gray +GuoChuang +HATAYAMA Daisuke +Hendrik Brueckner +Hermann Gausterer +Hiroaki Mizuguchi +Hongxu Jia +Hui Wang +Ignaz Forster +Jacob Wen +James Laska +Jan Stodola +Jaroslav Jindrak +Jason Dana +Jens Heise <46450477+heisej@users.noreply.github.com> +Jeremy Linton +Jiri Pirko +Joe Lawrence +Johannes Thumshirn +Jonas Jelten +Jonas Jonsson +Jonas Witschel +Kevin Yung +Lars R. Damerow +Lars Wendler +Lee Duncan +Lennart Poettering +Lennert Buytenhek +Lev Veyde +Lianbo Jiang +Lucas C. Villa Real +Major Hayden +Marc-Antoine Perennou +Marek Marczykowski-Górecki +Marian Csontos +Mark Fasheh +Matt +Matt Smith +Mei Liu +Michael Chapman +Michael McCracken +Michal Schmidt +Michal Sekletar +Mike Gorse +Moritz 'Morty' Strübe +Munehiro Matsuda +Nicolas Porcel +Nicolas Saenz Julienne +Olivier Blin +Ondrej Dubaj +P J P +Paolo Bonzini +Paul Robins +Pavel Zhukov +Pawel Wieczorkiewicz +Pekka Wallendahl +Peter Georg +Peter Levine +Petr Tesarik +Petr Vorel +Prarit Bhargava +Praveen_Paladugu@Dell.com +Pádraig Brady +Quentin Armitage +Robert Buchholz +Ruben Kerkhof +Rumbaut Thomas +Rusty Bird +Sebastian Mitterle +Sergei Iudin +Sergey Fionov +Shawn W Dunn +Srinivasa T N +Stijn Hoop +Sullivan (CTR), Austin +Thierry Vignaud +Thilo Bangert +Thomas Abraham +Tobias Geerinckx +Tobias Klauser +Tom Gundersen +Tomasz Torcz +Tong Li +Vadim Kuznetsov +Vaughan Cao +Vladius25 +Vratislav Podzimek +Yang Liu <50459973+ly4096x@users.noreply.github.com> +Yanko Kaneti +Zhiguo Deng +Ziyue Yang +foopub <45460217+foopub@users.noreply.github.com> +gaoyi +honza801 +jbash aka John Bashinski +jloeser +johannes +jonathan-teh <30538043+jonathan-teh@users.noreply.github.com> +leo-lb +logan +masem +maximilian attems +mulhern +mwberry +nabijaczleweli +privb0x23 +realtime-neil +xtraeme +Дамјан Георгиевски diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/COPYING b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/COPYING new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/Makefile b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/Makefile new file mode 100644 index 0000000..0dfa1cd --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/Makefile @@ -0,0 +1,328 @@ +-include dracut-version.sh + +DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :) +ifeq ($(DRACUT_MAIN_VERSION),) +DRACUT_MAIN_VERSION = $(DRACUT_VERSION) +endif +DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :) +ifeq ($(DRACUT_FULL_VERSION),) +DRACUT_FULL_VERSION = $(DRACUT_VERSION) +endif + +HAVE_SHELLCHECK ?= $(shell which shellcheck >/dev/null 2>&1 && echo yes) +HAVE_SHFMT ?= $(shell which shfmt >/dev/null 2>&1 && echo yes) +HAVE_RPMBUILD ?= $(shell which rpmbuild >/dev/null 2>&1 && echo yes) + +-include Makefile.inc + +KVERSION ?= $(shell uname -r) + +prefix ?= /usr +libdir ?= ${prefix}/lib +datadir ?= ${prefix}/share +pkglibdir ?= ${libdir}/dracut +sysconfdir ?= ${prefix}/etc +bindir ?= ${prefix}/bin +mandir ?= ${prefix}/share/man +CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 +bashcompletiondir ?= ${datadir}/bash-completion/completions +pkgconfigdatadir ?= $(datadir)/pkgconfig + +man1pages = man/lsinitrd.1 + +man5pages = man/dracut.conf.5 + +man7pages = man/dracut.cmdline.7 \ + man/dracut.bootup.7 \ + man/dracut.modules.7 + +man8pages = man/dracut.8 \ + man/dracut-catimages.8 \ + modules.d/98dracut-systemd/dracut-cmdline.service.8 \ + modules.d/98dracut-systemd/dracut-initqueue.service.8 \ + modules.d/98dracut-systemd/dracut-mount.service.8 \ + modules.d/98dracut-systemd/dracut-shutdown.service.8 \ + modules.d/98dracut-systemd/dracut-pre-mount.service.8 \ + modules.d/98dracut-systemd/dracut-pre-pivot.service.8 \ + modules.d/98dracut-systemd/dracut-pre-trigger.service.8 \ + modules.d/98dracut-systemd/dracut-pre-udev.service.8 + +manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages) + +.PHONY: install clean archive rpm srpm testimage test all check AUTHORS CONTRIBUTORS doc dracut-version.sh + +all: dracut-version.sh dracut.pc dracut-install src/skipcpio/skipcpio dracut-util + +%.o : %.c + $(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@ + +DRACUT_INSTALL_OBJECTS = \ + src/install/dracut-install.o \ + src/install/hashmap.o\ + src/install/log.o \ + src/install/strv.o \ + src/install/util.o + +# deps generated with gcc -MM +src/install/dracut-install.o: src/install/dracut-install.c src/install/log.h src/install/macro.h \ + src/install/hashmap.h src/install/util.h +src/install/hashmap.o: src/install/hashmap.c src/install/util.h src/install/macro.h src/install/log.h \ + src/install/hashmap.h +src/install/log.o: src/install/log.c src/install/log.h src/install/macro.h src/install/util.h +src/install/util.o: src/install/util.c src/install/util.h src/install/macro.h src/install/log.h +src/install/strv.o: src/install/strv.c src/install/strv.h src/install/util.h src/install/macro.h src/install/log.h + +src/install/dracut-install: $(DRACUT_INSTALL_OBJECTS) + $(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS) + +logtee: src/logtee/logtee.c + $(CC) $(LDFLAGS) -o $@ $< + +dracut-install: src/install/dracut-install + ln -fs $< $@ + +SKIPCPIO_OBJECTS = src/skipcpio/skipcpio.o +skipcpio/skipcpio.o: src/skipcpio/skipcpio.c +skipcpio/skipcpio: $(SKIPCPIO_OBJECTS) + +UTIL_OBJECTS = src/util/util.o +util/util.o: src/util/util.c +util/util: $(UTIL_OBJECTS) + +dracut-util: src/util/util + cp -a $< $@ + +.PHONY: indent-c +indent-c: + astyle -n --quiet --options=.astylerc $(wildcard *.[ch] */*.[ch] src/*/*.[ch]) + +.PHONY: indent +indent: indent-c +ifeq ($(HAVE_SHFMT),yes) + shfmt -w -s . +endif + +doc: $(manpages) dracut.html + +ifneq ($(enable_documentation),no) +all: doc +endif + +%: %.xml + @rm -f -- "$@" + xsltproc -o "$@" -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< + +%.xml: %.asc + @rm -f -- "$@" + asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $< + +dracut.8: man/dracut.8.asc \ + man/dracut.usage.asc + +dracut.html: man/dracut.asc $(manpages) docs/dracut.css man/dracut.usage.asc + @rm -f -- dracut.xml + asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \ + -a "version=$(DRACUT_FULL_VERSION)" \ + -a numbered \ + -d book -b docbook -o dracut.xml man/dracut.asc + @rm -f -- dracut.html + xsltproc -o dracut.html --xinclude -nonet \ + --stringparam custom.css.source docs/dracut.css \ + --stringparam generate.css.header 1 \ + http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml + @rm -f -- dracut.xml + +dracut.pc: Makefile.inc Makefile + @echo "Name: dracut" > dracut.pc + @echo "Description: dracut" >> dracut.pc + @echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc + @echo "dracutdir=$(pkglibdir)" >> dracut.pc + @echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc + @echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc + +install: all + mkdir -p $(DESTDIR)$(pkglibdir) + mkdir -p $(DESTDIR)$(bindir) + mkdir -p $(DESTDIR)$(sysconfdir) + mkdir -p $(DESTDIR)$(pkglibdir)/modules.d + mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8 + install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut + install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages + install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd + install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf + mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d + mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d + install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh + install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh + install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh + ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions + install -m 0755 dracut-logger.sh $(DESTDIR)$(pkglibdir)/dracut-logger.sh + install -m 0755 dracut-initramfs-restore.sh $(DESTDIR)$(pkglibdir)/dracut-initramfs-restore + cp -arx modules.d $(DESTDIR)$(pkglibdir) +ifneq ($(enable_documentation),no) + for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done + for i in $(man5pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man5/$${i##*/}; done + for i in $(man7pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man7/$${i##*/}; done + for i in $(man8pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man8/$${i##*/}; done + ln -fs dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7 +endif + if [ -n "$(systemdsystemunitdir)" ]; then \ + mkdir -p $(DESTDIR)$(systemdsystemunitdir); \ + ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \ + mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \ + ln -s ../dracut-shutdown.service \ + $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \ + mkdir -p $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants; \ + for i in \ + dracut-cmdline.service \ + dracut-initqueue.service \ + dracut-mount.service \ + dracut-pre-mount.service \ + dracut-pre-pivot.service \ + dracut-pre-trigger.service \ + dracut-pre-udev.service \ + ; do \ + [ -e $(DESTDIR)$(systemdsystemunitdir) ] && continue; \ + ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \ + ln -s ../$$i \ + $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \ + done \ + fi + if [ -f src/install/dracut-install ]; then \ + install -m 0755 src/install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \ + fi + if [ -f src/skipcpio/skipcpio ]; then \ + install -m 0755 src/skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \ + fi + if [ -f dracut-util ]; then \ + install -m 0755 dracut-util $(DESTDIR)$(pkglibdir)/dracut-util; \ + fi + mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d + install -m 0755 install.d/50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install + install -m 0755 install.d/51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install + mkdir -p $(DESTDIR)${bashcompletiondir} + install -m 0644 shell-completion/bash/dracut $(DESTDIR)${bashcompletiondir}/dracut + install -m 0644 shell-completion/bash/lsinitrd $(DESTDIR)${bashcompletiondir}/lsinitrd + mkdir -p $(DESTDIR)${pkgconfigdatadir} + install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc + +dracut-version.sh: + @rm -f dracut-version.sh + @printf "#!/bin/sh\n# shellcheck disable=SC2034\nDRACUT_VERSION=%s\n" "$(DRACUT_FULL_VERSION)" > dracut-version.sh + +clean: + $(RM) *~ + $(RM) */*~ + $(RM) */*/*~ + $(RM) $(manpages:%=%.xml) dracut.xml + $(RM) test-*.img + $(RM) dracut-*.rpm dracut-*.tar.bz2 dracut-*.tar.xz + $(RM) dracut-version.sh + $(RM) dracut-install src/install/dracut-install $(DRACUT_INSTALL_OBJECTS) + $(RM) skipcpio/skipcpio $(SKIPCPIO_OBJECTS) + $(RM) dracut-util util/util $(UTIL_OBJECTS) + $(RM) $(manpages) dracut.html + $(RM) dracut.pc + $(MAKE) -C test clean + +dist: dracut-$(DRACUT_MAIN_VERSION).tar.xz + +dracut-$(DRACUT_MAIN_VERSION).tar.xz: doc syncheck + @echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)" > dracut-version.sh + git archive --format=tar $(DRACUT_MAIN_VERSION) --prefix=dracut-$(DRACUT_MAIN_VERSION)/ > dracut-$(DRACUT_MAIN_VERSION).tar + mkdir -p dracut-$(DRACUT_MAIN_VERSION) + for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(DRACUT_MAIN_VERSION)/$${i%/*}"; cp "$$i" "dracut-$(DRACUT_MAIN_VERSION)/$$i"; done + tar --owner=root --group=root -rf dracut-$(DRACUT_MAIN_VERSION).tar $$(find dracut-$(DRACUT_MAIN_VERSION) -type f) + rm -fr -- dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION) + xz -9 dracut-$(DRACUT_MAIN_VERSION).tar + rm -f -- dracut-$(DRACUT_MAIN_VERSION).tar + +ifeq ($(HAVE_RPMBUILD),yes) +rpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck + rpmbuild=$$(mktemp -d -p /var/tmp rpmbuild-dracut.XXXXXX); src=$$(pwd); \ + cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \ + LC_MESSAGES=C $$src/tools/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < pkgbuild/dracut.spec > $$rpmbuild/dracut.spec; \ + (cd "$$rpmbuild"; \ + wget https://www.gnu.org/licenses/lgpl-2.1.txt; \ + rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \ + --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \ + --define "_rpmdir $$PWD" -ba dracut.spec; ) && \ + ( mv "$$rpmbuild"/{,$$(uname -m)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm ) + +srpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck + rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \ + cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \ + LC_MESSAGES=C $$src/tools/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < pkgbuild/dracut.spec > $$rpmbuild/dracut.spec; \ + (cd "$$rpmbuild"; \ + [ -f $$src/lgpl-2.1.txt ] && cp $$src/lgpl-2.1.txt . || wget https://www.gnu.org/licenses/lgpl-2.1.txt; \ + rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \ + --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \ + --define "_rpmdir $$PWD" -bs dracut.spec; ) && \ + ( mv "$$rpmbuild"/*.src.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm ) +else +.PHONY: rpm srpm +rpm: syncheck +srpm: syncheck +endif + +syncheck: + @ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \ + [ "$${i##*/}" = "module-setup.sh" ] && continue; \ + read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \ + [ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \ + [ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \ + [ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \ + done;exit $$ret + @ret=0;for i in *.sh modules.d/*/*.sh modules.d/*/module-setup.sh; do \ + [ $$V ] && echo "bash syntax check: $$i"; bash -n "$$i" ; ret=$$(($$ret+$$?)); \ + done;exit $$ret +ifeq ($(HAVE_SHELLCHECK),yes) +ifeq ($(HAVE_SHFMT),yes) + shellcheck $$(shfmt -f .) +else + find . -name '*.sh' -print0 | xargs -0 shellcheck +endif +endif + +check: all syncheck rpm + @[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; } + @$(MAKE) -C test check + +testimage: all + ./dracut.sh -N -l -a debug -f test-$(KVERSION).img $(KVERSION) + @echo wrote test-$(KVERSION).img + +debugtestimage: all + ./dracut.sh --debug -l -a debug -f test-$(KVERSION).img $(KVERSION) + @echo wrote test-$(KVERSION).img + +testimages: all + ./dracut.sh -l -a debug --kernel-only -f test-kernel-$(KVERSION).img $(KVERSION) + @echo wrote test-$(KVERSION).img + ./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(KVERSION) + @echo wrote test-dracut.img + +debughostimage: all + ./dracut.sh --debug -H -l -f test-$(KVERSION).img $(KVERSION) + @echo wrote test-$(KVERSION).img + +hostimage: all + ./dracut.sh -H -l -f test-$(KVERSION).img $(KVERSION) + @echo wrote test-$(KVERSION).img + +efi: all + ./dracut.sh --uefi -H -l -f linux-$(KVERSION).efi $(KVERSION) + @echo wrote linux-$(KVERSION).efi + +AUTHORS: + git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS + +CONTRIBUTORS: + @git shortlog $(DRACUT_MAIN_VERSION).. --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo "- $$rest";done + +dracut.html.sign: dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html + gpg-sign-all dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html + +upload: dracut.html.sign + kup put dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION).tar.sign /pub/linux/utils/boot/dracut/ + kup put dracut.html dracut.html.sign /pub/linux/utils/boot/dracut/ diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/Makefile.inc b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/Makefile.inc new file mode 100644 index 0000000..e59869b --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/Makefile.inc @@ -0,0 +1,11 @@ +prefix ?= /usr/local +libdir ?= /usr/local/lib +datadir ?= /usr/local/share +sysconfdir ?= /usr/local/etc +sbindir ?= /usr/local/sbin +mandir ?= /usr/local/share/man +enable_documentation ?= yes +bindir ?= /usr/local/bin +KMOD_CFLAGS ?= +KMOD_LIBS ?= -lkmod +FTS_LIBS ?= -lc diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/NEWS.md b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/NEWS.md new file mode 100644 index 0000000..5b2b70d --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/NEWS.md @@ -0,0 +1,2304 @@ +[Rendered view](https://github.com/dracutdevs/dracut/blob/master/NEWS.md) + +dracut-055 +========== + +#### Bug Fixes + +* **base:** + * add missing `str_replace` to `dracut-dev-lib.sh` ([148e420b](https://github.com/dracutdevs/dracut/commit/148e420be5b5809aa8d5033f47477573bbbf3e60)) + * split out `dracut-dev-lib.sh` ([c08bc810](https://github.com/dracutdevs/dracut/commit/c08bc8109d4c43beacfa4bcdc20a356102da6d02)) +* **bash:** minor cleanups ([9355cb8e](https://github.com/dracutdevs/dracut/commit/9355cb8ea5024533210067373657dc337d63ecb9)) +* **dash:** minor cleanups ([f4ea5f87](https://github.com/dracutdevs/dracut/commit/f4ea5f8734c4636f7d6db78da76e9525beb9a0ac)) +* **dracut:** pipe hardlink output to `dinfo` ([0a6007bf](https://github.com/dracutdevs/dracut/commit/0a6007bf4f472565d2c0c205a56edea7ba3e3bc3)) +* **dracut-functions:** get_maj_min without get_maj_min_cache_file set ([a277a5fc](https://github.com/dracutdevs/dracut/commit/a277a5fc7acc0a9e8d853f09671495f9d27645c1)) +* **dracut-util:** print error message with trailing newline ([b9b6f0ee](https://github.com/dracutdevs/dracut/commit/b9b6f0ee5b859a562e46a8c4e0dee0261fabf74d)) +* **fs-lib:** install fsck utilities ([12beeac7](https://github.com/dracutdevs/dracut/commit/12beeac741e4429146a674ef4ea9aa0bac10364b)) +* **install:** + * configure logging earlier ([5eb24aa2](https://github.com/dracutdevs/dracut/commit/5eb24aa21d3ee639f869c2e363b3fb0b98be552b)) + * sane default --kerneldir ([c1ab3613](https://github.com/dracutdevs/dracut/commit/c1ab36139d416e580e768c29f2addf7ccbc2c612), closes [#1505](https://github.com/dracutdevs/dracut/issues/1505)) +* **integrity:** require ALLOW_METADATA_WRITES to come from EVM config file ([b12d91c4](https://github.com/dracutdevs/dracut/commit/b12d91c431220488fecf7b4be82427e3560560cb)) +* **mksh:** minor cleanups ([6c673298](https://github.com/dracutdevs/dracut/commit/6c673298f36990665467564e6114c9ca2530f584)) +* **squash:** don't mount the mount points if already mounted ([636d6df3](https://github.com/dracutdevs/dracut/commit/636d6df3134dde1dac72241937724bc59deb9303)) +* **warpclock:** minor cleanups ([7d205598](https://github.com/dracutdevs/dracut/commit/7d205598c6a500b58b4d328e824d0446276f7ced)) + +#### Features + +* **dracut.sh:** detect running in a container ([7275c6f6](https://github.com/dracutdevs/dracut/commit/7275c6f6a0f6808cd939ea5bdf1244c7bd13ba44)) +* **install:** add default value for --firmwaredirs ([4cb086fa](https://github.com/dracutdevs/dracut/commit/4cb086fa2995799b95c0b25bc9a0cf72ba3868ea)) + +#### Contributors + +- Harald Hoyer +- Jóhann B. Guðmundsson +- Marcos Mello +- Kairui Song +- Lars Wendler +- Stefan Berger +- Tomasz Paweł Gajc + +dracut-054 +========== + +With this release dracut has undergone a major overhaul. + +A lot of systemd related modules have been added. + +The integration test suite has finally ironed out the flaky behaviour due to the parallel device probing of the kernel, +which bit sometimes in the non-kvm github CI. So, if you see any `/dev/sda` in a setup script with more than two hard drives, +chances are, that the script works on the wrong disk. Same goes for network interfaces. + +This release is also fully `shellcheck`'ed with `ShellCheck-0.7.2` and indented with `shfmt` and `astyle`. + +The dracut project builds test containers every day for: +* `opensuse/tumbleweed-dnf:latest` +* `archlinux:latest` +* `fedora:rawhide` +* `fedora:latest` +* `fedora:33` + +These containers can easily be used to run the integration tests locally without root permissions via `podman`. +We hope this serves as a blueprint for your distribution's CI process. + +More information can be found in [docs/HACKING.md](https://github.com/dracutdevs/dracut/blob/master/HACKING.md). + +#### Bug Fixes + +* make testsuite pass on OpenSuse and Arch ([8b2afb08](https://github.com/dracutdevs/dracut/commit/8b2afb08baea7fc6e15ece94e287dcc4a008bcc4)) +* cope with distributions with `/usr/etc` files ([3ad3b3a4](https://github.com/dracutdevs/dracut/commit/3ad3b3a40d419c4386b2924f6ac25ab0c355d131)) +* deprecate gummiboot ([5c94cf41](https://github.com/dracutdevs/dracut/commit/5c94cf41e8937b6fbb72c96bc54c84fdf224c711)) +* set vimrc and emacs indention according to .editorconfig ([9012f399](https://github.com/dracutdevs/dracut/commit/9012f3996b1e5f0788f8e80dfdd5c9ab0636c355)) +* correctly handle kernel parameters ([501d82f7](https://github.com/dracutdevs/dracut/commit/501d82f79675a6bf9b37e8250152515863a80236)) +* remove dracut.pc on `make clean` ([d643156d](https://github.com/dracutdevs/dracut/commit/d643156d561d3aca816d75e403149db073617292)) +* honor KVERSION environment in the Makefile ([d8a454a5](https://github.com/dracutdevs/dracut/commit/d8a454a537c6de95033dec7d83c622fdc46c2a4f)) +* always use mkdir -p ([9cf7b1c5](https://github.com/dracutdevs/dracut/commit/9cf7b1c529442d5abd6eaec4399d4ee77b95145e)) +* **dracut.sh:** + * prevent symbolic links containing `//` ([de0c0872](https://github.com/dracutdevs/dracut/commit/de0c0872fc858fa9ca952f79ea9f00be17c37a4c)) + * adding missing globalvars for udev ([f35d479d](https://github.com/dracutdevs/dracut/commit/f35d479d2b718da54886a66d3b7af2132215f80a)) + * sysctl global variables ([3ca9aa1d](https://github.com/dracutdevs/dracut/commit/3ca9aa1d7b24b82e01d16613b86ec3be97c8a1bb)) + * add global vars for modules-load ([ec4539c6](https://github.com/dracutdevs/dracut/commit/ec4539c6066edf25e52ed8e2d35c4be7ef39f729)) + * omission is an addition to other omissions in conf files ([96c31333](https://github.com/dracutdevs/dracut/commit/96c313333d1a4f5e2c524a3a11c5b3aab24afc20)) + * harden dracut against GZIP environment variable ([d8e47e20](https://github.com/dracutdevs/dracut/commit/d8e47e201af4646e2a82e11220ea9c993bd2ed48)) + * add a missing tmpfilesconfdir global variable ([8849dd8d](https://github.com/dracutdevs/dracut/commit/8849dd8d1a74a46cb761c4d8041e4582d4686724)) + * include `modules.builtin.alias` in the initramfs ([7f633747](https://github.com/dracutdevs/dracut/commit/7f6337471312486934f9592c1c7c05ed68694454)) + * install all depmod relevant configuration files ([50a01dd4](https://github.com/dracutdevs/dracut/commit/50a01dd4b28471c0dfa810a705e219963bd5ec3c)) + * add `modules.builtin.modinfo` to the initramfs ([87c4c178](https://github.com/dracutdevs/dracut/commit/87c4c17850e8bb982f6c07a6d3f58124bb2875de)) + * search for btrfs devices from actual mount poiont ([3fdc734a](https://github.com/dracutdevs/dracut/commit/3fdc734a5cc8c0b94c1da49439181d540c8a5c43)) +* **dracut-functions.sh:** + * implement a cache for get_maj_min ([c3bb9d18](https://github.com/dracutdevs/dracut/commit/c3bb9d18dceed7db6d16f9c2a7f682c5934099d7)) + * word splitting issue for sed in get_ucode_file ([122657b2](https://github.com/dracutdevs/dracut/commit/122657b2fedf13991597830cca4d4ddbc8038233)) +* **dracut-logger.sh:** double dash trigger unknown logger warnings during run ([4fbccde5](https://github.com/dracutdevs/dracut/commit/4fbccde50456f513d388cdfd858018cd889890dc)) +* **dracut-install:** + * handle $LIB in ldd output parsing ([d1a36d3d](https://github.com/dracutdevs/dracut/commit/d1a36d3d80b0ed71ee814659e18a020c53cee05e)) + * handle builtin modules ([2536a9ea](https://github.com/dracutdevs/dracut/commit/2536a9eaffbc9cc14c85579a2f537d3f3a1d5659)) +* **base:** + * suppress calls to getarg in build phase ([6feaaabc](https://github.com/dracutdevs/dracut/commit/6feaaabc221ffbf79f652cbee3eea58f02449c50)) + * source hooks without exec ([8059bcb2](https://github.com/dracutdevs/dracut/commit/8059bcb2c8df4d60cc2f548d3c53db25d815a7be)) + * wait_for_dev quote shell variables ([b800edd6](https://github.com/dracutdevs/dracut/commit/b800edd69817b5e46d5f240b96d3b3648267ea21)) + * adding crc32c for ext3 ([61f45643](https://github.com/dracutdevs/dracut/commit/61f456435879f084a1bf2c8885eaf37070035abf)) +* **crypt:** + * install all crypto modules in the generic initrd ([10f9e569](https://github.com/dracutdevs/dracut/commit/10f9e569c52654ff54678a626a0f5dd14233716d)) + * include cryptsetups tmpfile ([a4cc1964](https://github.com/dracutdevs/dracut/commit/a4cc196467e45f093fab7876c1c6b40798058920)) +* **crypt-gpg:** + * cope with different scdaemon location ([44fd1c13](https://github.com/dracutdevs/dracut/commit/44fd1c13555f2e12bb566c246948629ada27d14d)) +* **dbus-broker:** + * enable the service ([df1e5f06](https://github.com/dracutdevs/dracut/commit/df1e5f06a5449dcec6749baf742eac6eb1f0aa53)) +* **dbus-daemon:** + * only error out in install() ([ae4fbb3d](https://github.com/dracutdevs/dracut/commit/ae4fbb3db4136e6e03a1c74d05ecc2a73b916401)) +* **dracut-systemd:** + * don't refuse root=tmpfs when systemd is used ([a96900a8](https://github.com/dracutdevs/dracut/commit/a96900a82c3a8ec1ed2c6b2cc8862f912093fa0c)) +* **examples:** remove the examples directory and reference to it ([b37c90c8](https://github.com/dracutdevs/dracut/commit/b37c90c8e00155a1f31237ae6cf91a81677c4df5)) +* **fips:** + * add dh and ecdh ciphers ([543b8014](https://github.com/dracutdevs/dracut/commit/543b8014fc10fc6a92ba83db0dfc994fc1d2129b)) + * remove old udev version requirements ([be30d987](https://github.com/dracutdevs/dracut/commit/be30d98751cff4ace660215305e2468943a45754)) +* **i18n:** + * skip if data is missing ([651fe01e](https://github.com/dracutdevs/dracut/commit/651fe01e7937d86bbd471d9621581bed44f23dfa)) +* **img-lib:** + * ignored null byte in input ([85eb9680](https://github.com/dracutdevs/dracut/commit/85eb96802cb82ec179bd3bc429b0dad2518946c5)) +* **integrity:** + * properly set up EVM when using an x509 cert ([4bdd7eb2](https://github.com/dracutdevs/dracut/commit/4bdd7eb23a8187c3f19797e47eee8c672cea33ae)) +* **iscsi:** + * replace sed call with bash internals ([66b920c6](https://github.com/dracutdevs/dracut/commit/66b920c65143f4cac80385a51704ae9483305569)) + * add iscsid.service requirements ([bb6770f1](https://github.com/dracutdevs/dracut/commit/bb6770f1a413bdc7fd570b260ee28ace1255a195)) + * only rely on socket activiation ([0eb87d78](https://github.com/dracutdevs/dracut/commit/0eb87d78108aae9aa4692f1edfb33ded50e26409)) +* **kernel-modules:** + * optionally add /usr/lib/modules.d to initramfs ([92e6a8f8](https://github.com/dracutdevs/dracut/commit/92e6a8f87914322994387e559cf2a00b1760b301)) + * add watchdog drivers for generic initrd ([3a60c036](https://github.com/dracutdevs/dracut/commit/3a60c036db7caccda95475d33c8d4ce1f615d2c8)) +* **mdraid:** + * remove dependency statements ([86b75634](https://github.com/dracutdevs/dracut/commit/86b756346a6b7c5cb5f6fda4d12e2a58b6144e40)) +* **memstrack:** + * correct dependencies ([c2ecc4d1](https://github.com/dracutdevs/dracut/commit/c2ecc4d131876383b47820a2e8d1a6f8a11716d9)) +* **multipath:** + * stop multipath before udev db cleanup ([3c244c7c](https://github.com/dracutdevs/dracut/commit/3c244c7ca3555b526883dc20104c469b39085cbe)) + * revise multipathd-stop ([7b8c78ff](https://github.com/dracutdevs/dracut/commit/7b8c78ff43a1f8e3690969e980d3d9d1dcb00c87)) +* **nbd:** + * assume nbd version >= 3.8 ([6209edeb](https://github.com/dracutdevs/dracut/commit/6209edeb5c7783d94867829bf052aa53c78a1efe)) + * remove old udev version requirements ([fd15dbad](https://github.com/dracutdevs/dracut/commit/fd15dbad6ebad86a3753a03f98706010f3e36cf7)) + * make nbd work again with systemd ([77906443](https://github.com/dracutdevs/dracut/commit/7790644362622097aa69107920fd26b688c855d3)) +* **network:** + * use wicked unit instead of find_binary ([57eefcf7](https://github.com/dracutdevs/dracut/commit/57eefcf70587f06b8874a3b3cf31e9ab70c03227)) + * user variable for sdnetworkd instead of path ([4982e16d](https://github.com/dracutdevs/dracut/commit/4982e16dd53dcbbcfbd3a6b59013a0d6f893f840)) + * correct regression in iface_has_carrier ([36af0518](https://github.com/dracutdevs/dracut/commit/36af0518b3fe59442de206c24bbe03be6fc17095)) +* **network-legacy:** + * add missing options to dhclient.conf ([abfd547a](https://github.com/dracutdevs/dracut/commit/abfd547a85230a4520df65280aaf195f319df464)) + * silence getargs ([60a34d8b](https://github.com/dracutdevs/dracut/commit/60a34d8b11dd50b2cd4e0e2208bd7c5e0fc48b71)) +* **network-manager:** + * cope with distributions not using `libexec` ([22d6863e](https://github.com/dracutdevs/dracut/commit/22d6863ef1b2eb2a22264f2bfdb2b9329ab5dfdb)) + * set timeout via command line option ([8a51ee1f](https://github.com/dracutdevs/dracut/commit/8a51ee1fa61bd3da342be53e35730837afd2caad)) + * run after dracut-cmdline ([4d03404f](https://github.com/dracutdevs/dracut/commit/4d03404f499064b354a58223895cc47dbb461da5)) + * create /run directories ([49b61496](https://github.com/dracutdevs/dracut/commit/49b614961dc8684f8512febbf80da489909e4b7f)) + * use /run/NetworkManager/initrd/neednet in initqueue ([6a37c6f6](https://github.com/dracutdevs/dracut/commit/6a37c6f6302f950df608db3fd45acf9342ee3de2)) + * only run NetworkManager if rd.neednet=1 ([ac0e8f7d](https://github.com/dracutdevs/dracut/commit/ac0e8f7dcc81432311906c3fca0d4211f6a2f68c)) + * nm-run.service: don't kill forked processes ([1f21fac6](https://github.com/dracutdevs/dracut/commit/1f21fac646daa46cbe184ef8ff7705842f06ba15)) + * no default deps for nm-run.service ([ba4bcf5f](https://github.com/dracutdevs/dracut/commit/ba4bcf5f4f11ad624c647ddf4f566997186135e7)) + * nm-lib.sh does not require bash ([3402142e](https://github.com/dracutdevs/dracut/commit/3402142e344298c8f20fc52a2b064344788f1668)) +* **squash:** + * post install should be the last step before stripping ([8c8aecdc](https://github.com/dracutdevs/dracut/commit/8c8aecdc63c9389038e78ee712d4809e49add5e1)) +* **systemd:** + * include all nss libraries ([b3bbf5fb](https://github.com/dracutdevs/dracut/commit/b3bbf5fb6a95cfb69272da0711b5c5e0c6621de9)) + * include hosts and nsswitch.conf in hostonly mode ([5912f4fb](https://github.com/dracutdevs/dracut/commit/5912f4fbc036cc36b9507c16dddef1ded1556572)) + * remove old systemd version requirements ([fc53987b](https://github.com/dracutdevs/dracut/commit/fc53987bec1bc71b054d99072f62c1770a44bcca)) +* **systemd-hostnamed:** extra quote ([2aa65234](https://github.com/dracutdevs/dracut/commit/2aa652349ca83198581cccb516a241a8d0e1b4d9)) +* **systemd-modules:** remove dependency on systemd meta module ([afef4557](https://github.com/dracutdevs/dracut/commit/afef455718db69cff3797ca1a6d8bfebd2e86ab3)) +* **systemd-modules-load:** + * misc repairs ([782ac8f1](https://github.com/dracutdevs/dracut/commit/782ac8f1f6b68edfe59630e9e4ac1673636f3a5e)) +* **systemd-networkd:** + * make systemd-networkd a proper network provider ([ea779750](https://github.com/dracutdevs/dracut/commit/ea779750c371102c04252b48f1b7d9c7ece7cf93), closes [#737](https://github.com/dracutdevs/dracut/issues/737)) +* **systemd-resolved:** remove nss libraries ([12bef83c](https://github.com/dracutdevs/dracut/commit/12bef83cdaf329e3ee2cc1f282bd9c128ec0fc56)) +* **systemd-sysctl:** + * sysctl global variables ([02acedd0](https://github.com/dracutdevs/dracut/commit/02acedd09eb7222eaaf0f5256f3ddec26d658360)) +* **systemd-sysusers:** + * misc fixes and cleanup ([7359ba8a](https://github.com/dracutdevs/dracut/commit/7359ba8acab2652cfff6b845f84a936cdec30f9d)) +* **systemd-udev:** use global vars instead of fixed path ([fd883a58](https://github.com/dracutdevs/dracut/commit/fd883a58d1360f0c6c32f64462fafdd7a54af1ee)) +* **systemd-udevd:** add udev id program files ([562cb77b](https://github.com/dracutdevs/dracut/commit/562cb77b5a28e3f31bc6d327c7712fba661e9a27)) +* **systemd-verity:** + * incorrect reference to cryptsetup target ([ba92d1fc](https://github.com/dracutdevs/dracut/commit/ba92d1fcad68758004d7b1102fe1905c0f25e63e)) + * re-naming module to veritysetup ([0267f3c3](https://github.com/dracutdevs/dracut/commit/0267f3c3554efd8f027afaf462347167402f5d6c)) +* **tpm2-tss:** add tpm2 requirement ([8f99fada](https://github.com/dracutdevs/dracut/commit/8f99fadabea8f279a9fe28473dba424eb38f8d60)) +* **udev-rules:** + * remove sourcing of network link files ([69f4e7cd](https://github.com/dracutdevs/dracut/commit/69f4e7cdc3f7da24e40496b0b2f0f5022cc3376d)) + * add btrfs udev rules by default ([567c4557](https://github.com/dracutdevs/dracut/commit/567c4557537fe7f477f0f54237df00ebc79e56be)) +* **url-lib:** + * fix passing args ([5f6be515](https://github.com/dracutdevs/dracut/commit/5f6be51595eab878314d031d9bfebe844b639302)) +* **zipl:** + * don't depend on grub2 ([6b499ec1](https://github.com/dracutdevs/dracut/commit/6b499ec14b3ff35d5298617b436b64563a2d8c2f)) + +#### Performance + +* disable initrd compression when squash module is enabled ([7c0bc0b2](https://github.com/dracutdevs/dracut/commit/7c0bc0b2fd167da42035020dae49af94844f053c)) + +#### Features + +* support ZSTD-compressed kernel modules ([ce9af251](https://github.com/dracutdevs/dracut/commit/ce9af251af5fca08ea206ef980005853a4dac36e)) +* also restore the initramfs from /lib/modules ([33e27fab](https://github.com/dracutdevs/dracut/commit/33e27fab59db60b1ca05a0c5b8a51fccb98578e5)) +* extend Makefile indent target ([e0a0fa61](https://github.com/dracutdevs/dracut/commit/e0a0fa61749152fd5bc837770a02cf22d7e02d40)) +* customize .editorconfig according to shfmt ([1f621aba](https://github.com/dracutdevs/dracut/commit/1f621aba3728a621b83b3b697eae6caadae9d287)) +* squash module follow --compress option ([5d05ffbd](https://github.com/dracutdevs/dracut/commit/5d05ffbd87bc27e27f517ebc3454d50729c687e6)) +* **bluetooth:** implement bluetooth support in initrd ([64ee2a53](https://github.com/dracutdevs/dracut/commit/64ee2a53864576fbedabe6b18fb9aae01b999199)) +* **btrfs:** add 64-btrfs-dm.rules rules ([d4caa86a](https://github.com/dracutdevs/dracut/commit/d4caa86aba35b51dc1adda3ee3a5bae677420082)) +* **mkinitrd:** remove mkinitrd ([43df4ee2](https://github.com/dracutdevs/dracut/commit/43df4ee274e7135aff87868bf3bf2fbab47aa8b4)) +* **nbd:** support ipv6 link local nbds ([b12f8188](https://github.com/dracutdevs/dracut/commit/b12f8188a4ffac312694ebd48a5c99ba885e6467)) +* **network-manager:** run as daemon with D-Bus ([112f03f9](https://github.com/dracutdevs/dracut/commit/112f03f9e225a790cbc6378c70773c6af5e7ee34)) +* **qemu:** include the virtio_mem kernel module ([f3dcb606](https://github.com/dracutdevs/dracut/commit/f3dcb60619671f2d353caaa42d38207172c8b3ba)) +* **skipcpio:** speed up and harden skipcpio ([63033495](https://github.com/dracutdevs/dracut/commit/630334950c9a7a714fdf31b6ff545d804b5df2f2)) +* **squash:** + * use busybox for early setup if available ([90f269f6](https://github.com/dracutdevs/dracut/commit/90f269f6afe409925bad86f0bd7e9322ad9b4fb0)) + * install and depmod modules seperately ([5a18b24a](https://github.com/dracutdevs/dracut/commit/5a18b24a8b9c20c98f711963ce5407ceb2f3d57b)) +* **systemd-ac-power:** introducing the systemd-ac-power module ([e7407230](https://github.com/dracutdevs/dracut/commit/e74072306958262f22a9ecf10b928647ebdacf8f)) +* **systemd-hostnamed:** introducing the systemd-hostnamed module ([bf273e3e](https://github.com/dracutdevs/dracut/commit/bf273e3e8632faff68fe19f9d7d7cc42e5a7c480)) +* **systemd-initrd:** add initrd-usr-fs.target ([5eb73610](https://github.com/dracutdevs/dracut/commit/5eb736103d06197f37283bc27815c050adec81ea)) +* **systemd-journald:** introducing the systemd-journald module ([3697891b](https://github.com/dracutdevs/dracut/commit/3697891b754493ecd6b19dbf279701bad3460fcd)) +* **systemd-ldconfig:** introducing the systemd-ldconfig module ([563c434e](https://github.com/dracutdevs/dracut/commit/563c434ecba68c628344c1a684f656cdd8f9f214)) +* **systemd-network-management:** introducing systemd-network-management module ([e942d86c](https://github.com/dracutdevs/dracut/commit/e942d86c9ddad19f9307d58cb2d99169f6e94edb)) +* **systemd-resolved:** introducing the systemd-resolved module ([b7d3caef](https://github.com/dracutdevs/dracut/commit/b7d3caef6780305c553851169ca30b0b05b6ff31)) +* **systemd-rfkill:** introducing the systemd-rfkill module ([21536544](https://github.com/dracutdevs/dracut/commit/215365441e1042793d62c4c9e146be5916ed5aeb)) +* **systemd-sysext:** introducing the systemd-sysext module ([fc88af54](https://github.com/dracutdevs/dracut/commit/fc88af54134ec021be58465b52d1271453c30c55)) +* **systemd-timedated:** introducing the systemd-timedated module ([1c41cc90](https://github.com/dracutdevs/dracut/commit/1c41cc90c52636e03abdf6d0c4fa0f557b7eb449)) +* **systemd-timesyncd:** introducing the systemd-timesyncd module ([2257d545](https://github.com/dracutdevs/dracut/commit/2257d54583d24ca69d10b5e600b986d412a21714)) +* **systemd-tmpfiles:** introducing the systemd-tmpfiles module ([2b61be32](https://github.com/dracutdevs/dracut/commit/2b61be32b890e70b1fce45d984327c27302da9bc)) +* **systemd-udevd:** introducing the systemd-udevd module ([3534789c](https://github.com/dracutdevs/dracut/commit/3534789cc42331bc22cf44d26a1d04db4e010ad9)) +* **systemd-verity:** introducing the systemd-verity module ([3d4dea58](https://github.com/dracutdevs/dracut/commit/3d4dea58f9821e58841d5c738b9935193c680181)) +* **tpm2-tss:** introducing the tpm2-tss module ([8743b073](https://github.com/dracutdevs/dracut/commit/8743b0735692ab3f333815ba311cecdc29d45ecd)) + +#### Contributors + +- Harald Hoyer +- Jóhann B. Guðmundsson +- Kairui Song +- Dusty Mabe +- Beniamino Galvani +- Mikhail Novosyolov +- Renaud Métrich +- Adam Alves +- Daniel Molkentin +- David Hildenbrand +- David Tardon +- Jaroslav Jindrak +- Jonas Jelten +- Lennart Poettering +- Lev Veyde +- Peter Robinson +- Stefan Berger +- Đoàn Trần Công Danh + +dracut-053 +========== + +#### Bug Fixes + +* **dracut.sh:** + * unfreeze /boot on exit ([d87ae137](https://github.com/dracutdevs/dracut/commit/d87ae13721d04a8a2192d896af224ac6965caf70)) + * proper return code for inst_multiple in dracut-init.sh ([d437970c](https://github.com/dracutdevs/dracut/commit/d437970c013e3287de263a1e60a117b15239896c)) +* **fcoe:** + * rename rd.nofcoe to rd.fcoe ([6f7823bc](https://github.com/dracutdevs/dracut/commit/6f7823bce65dd4b52497dbb94892b637fd06471a)) + * rd.nofcoe=0 should disable fcoe ([805b46c2](https://github.com/dracutdevs/dracut/commit/805b46c2a81e04d69fc3af912942568516d05ee7)) +* **i18n:** + * get rid of `eval` calls ([5387ed24](https://github.com/dracutdevs/dracut/commit/5387ed24c8b33da1214232d57ab1831e117aaba0)) + * create the keyboard symlinks again ([9e1c7f3d](https://github.com/dracutdevs/dracut/commit/9e1c7f3deadd387adaa97b189593b4ba3d7c6d5a)) +* **network-manager:** + * run as a service if systemd module is present ([c17c5b76](https://github.com/dracutdevs/dracut/commit/c17c5b7604c8d61dd1c00ee22d44c3a5d7d6dfee)) + * rework how NM is started in debug mode ([34c73b33](https://github.com/dracutdevs/dracut/commit/34c73b339baa025dfd8916379c4d191be34a8af5)) +* **drm:** skip empty modalias files in drm module setup ([c3f24184](https://github.com/dracutdevs/dracut/commit/c3f241849de6434d063ef92e6880f6b0335c1800)) + + +dracut-052 +========== + +#### Features + +- **dracut:** + - allow overriding the systemctl command for sysroot with `$SYSTEMCTL` for cross compilation + - add additional global variables + + Variables like `dbusconfdir` or `systemdnetwork` are now exported + to the individual modules as global variables. If they are not set + in the distribution dracut config files, they are set via `pkg-config` + + - A `--no-uefi` option as been added to the CLI options to disable a default `uefi=yes` + set by a configuration file. + +- **kernel-modules:** add modules from `drivers/memory` for arm +- **network-legacy:** send dhcp in parallel on all devices via the `single-dhcp` option +- **dbus:** introduce a meta module for dbus +- **dbus-broker:** introduce the dbus-broker module +- **dbus-daemon:** introduce the dbus-daemon module +- **systemd-ask-password:** introduce the systemd-ask-password module +- **systemd-coredump:** introduce the systemd-coredump module +- **systemd-modules-load:** introduce the systemd-modules-load module +- **systemd-repart:** introduce the systemd-repart module +- **systemd-sysctl:** introduce the systemd-sysctl module +- **systemd-sysusers:** introduce the systemd-sysuser module + +#### Bug Fixes + +- first round of shellcheck for all shell scripts +- revise all module checks to not error out about missing dependencies +- use the top-level `/efi` path to address the EFI partition +- correct the squash quirk +- use `find_binary` instead of other methods, because `find_binary` honors `dracutsysrootdir` +- quote globbing in module-setup.sh for `inst_multiple` +- move ldconfig after library workaround +- do not set cmdline for uefi images unless asked +- **dracut:** don't override `PATH`, if `dracutsysrootdir` is set +- **dracut-functions.sh:** check kernel config from `dracutsysrootdir` +- **dracut-init.sh:** make inst_libdir_file work with `dracutsysrootdir` set +- **dracut-install:** allow globbing for multiple sources +- **06dbus:** + - do not hardcode path to dbus utils + - do not hardcode path to systemd unit +- **uefi** use efivars fs over the deprecated sysfs entries +- **keyring** adding shared keyring mode to systemd unit `dracut-pre-pivot.service` +- **35network-manager:** avoid restarting NetworkManager +- **90kernel-modules:** install generic crypto modules with hostonly unset +- **99squash:** use kernel config instead of modprobe to check modules +- **dbus-daemon:** use uid/gid from sysroot if `dracutsysrootdir` is set +- **kernel-modules:** add reset controllers for arm +- **kernel-network-modules:** also install modules from mdio subdirectory +- **mdraid:** + - remove the `offroot` option (long deprecated) + - add the grow continue service `mdadm-grow-continue` +- **network-legacy:** silent the check for dhcp leaseinfo +- **network-manager:** allow override network manager version +- **plymouth:** install binaries with dependencies +- **shutdown:** add timeout to umount calls +- **watchdog:** fix dependencies in `module-setup.sh` + +#### Contributors + +- Harald Hoyer +- Jóhann B. Guðmundsson +- Zoltán Böszörményi +- Alexey Shabalin +- Daniel Molkentin +- Luiz Angelo Daros de Luca +- Mariusz Tkaczyk +- Alexander Tsoy +- Anjali Kulkarni +- Beniamino Galvani +- David Tardon +- Javier Martinez Canillas +- Kairui Song +- Lukas Nykryn +- Matthew Thode +- Nicolas Chauvet +- Nicolas Saenz Julienne +- Ondrej Mosnacek +- Peter Levine +- Petr Pavlu +- Vladius25 +- Yang Liu <50459973+ly4096x@users.noreply.github.com> +- foopub <45460217+foopub@users.noreply.github.com> +- realtime-neil + + +dracut-051 +========== + +dracut: +- allow running on a cross-compiled rootfs + + dracutsysrootdir is the root directory, file existence checks use it. + + DRACUT_LDCONFIG can override ldconfig with a different one that works + on the sysroot with foreign binaries. + + DRACUT_LDD can override ldd with a different one that works + with foreign binaries. + + DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot + may use symlinks that are valid only when running on the target + so a real file must be provided that exist in the sysroot. + + DRACUT_INSTALL now supports debugging dracut-install in itself + when run by dracut but without debugging the dracut scripts. + E.g. DRACUT_INSTALL="valgrind dracut-install or + DRACUT_INSTALL="dracut-install --debug". + + DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, + DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, + DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, + DRACUT_COMPRESS_CAT: All of the compression utilities may be + overridden, to support the native binaries in non-standard places. + + DRACUT_ARCH overrides "uname -m". + + SYSTEMD_VERSION overrides "systemd --version". + + The dracut-install utility was overhauled to support sysroot via + a new option -r and fixes for clang-analyze. It supports + cross-compiler-ldd from + https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f + + DRACUT_INSTALL_PATH was introduced so dracut-install can work with + a different PATH. In a cross-compiled environment (e.g. Yocto), PATH + points to natively built binaries that are not in the host's /bin, + /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin + that are relative to the cross-compiled sysroot. + + DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were + introduced so dracut-install can use different settings from + DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. + +- don't call fsfreeze on subvol of root file system +- Use TMPDIR (typically /run/user/$UID) if available +- dracut.sh: add check for invalid configuration files + Emit a warning about possible misconfigured configuration files, where + the spaces around values are missing for +="" +- dracut-functions: fix find_binary() to return full path +- dracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL +- dracut.sh: fix early microcode detection logic +- dracut.sh: fix ia32 detection for uefi executables +- dracut.sh: Add --version +- dracut.sh: Add --hostonly-nics option +- EFI Mode: only write kernel cmdline to UEFI binary +- Allow $DRACUT_INSTALL to be not an absolute path +- Don't print when a module is explicitly omitted (by default) +- Remove uses of bash (and bash specific syntax) in runtime scripts +- dracut-init.sh: Add a helper for detect device kernel modules +- dracut-functions.sh: Fix check_block_and_slaves_all +- dracut-functions.sh: add a helper to check if kernel module is available + +Documentation +- dracut.cmdline.7.asc: clarify usage of `rd.lvm.vg` and `rd.lvm.lv` +- dracut.conf.5.asc: document how to config --no-compress in the config +- fix CI badges in README.md and fix dracut description +- dracut.modules.7.asc: fix typos +- dracut.modules.7.asc: fix reference to insmodpost module +- Add --version to man page +- Adding code of conduct +- Document initqueue/online hook + + +dracut-install: +- install: also install post weak dependencies of kernel modules +- install: Globbing support for resolving "firmware:" + +mkinitrd: +- use vmlinux regex for ppc*, vmlinuz for i686 + +mkinitrd-suse: +- fix i586 platform detection + +modules: + +00systemd: +- skip dependency add for non-existent units +- add missing cryptsetup-related targets + +05busybox: +- simplify listing of supported utilities + +06rngd: +- install dependant libs too +- Do not start inside container + +10i18n: +- i18n: Always install /etc/vconsole.conf + +35network-legacy: +- dhclient-script: Fix typo in output of BOUND & BOUND6 cases +- simplify fallback dhcp setup + +35network-manager: +- ensure that nm-run.sh is executed when needed +- install libnss DNS and mDNS plugins +- always pull in machinery to read ifcfg files +- set kernel hostname from the command line +- move connection generation to a lib file + +40network: +- fix glob matching ipv6 addresses +- net-lib.sh: support infiniband network mac addresses + +45url-lib: +- drop NSS if it's not in curl --version + +80cms: +- regenerate NetworkManager connections + +90btrfs: +- force preload btrfs module +- Install crypto modules in 90kernel-modules + +90crypt: +- cryptroot-ask: no warn if /run/cryptsetup exist +- install crypto modules in 90kernel-modules +- try to catch kernel config changes +- fix force on multiple lines +- pull in remote-cryptsetup.target enablement +- cryptroot-ask: unify /etc/crypttab and rd.luks.key + +90dmsquash-live: +- iso-scan.sh: Provide an easy reference to iso-scan device + +90kernel-modules: +- remove nfit from static module list (see nvdimm module) +- install crypto modules in 90kernel-modules +- add sg kernel module +- add pci_hyperv +- install block drivers more strictly +- install less modules for hostonly mode +- arm: add drivers/hwmon for arm/arm64 + +90kernel-network-modules +- on't install iscsi related module (use 95iscsi) + +90lvm: +- remove unnecessary ${initdir} from lvm_scan.sh +- fix removal of pvscan from udev rules +- do not add newline to cmdline + +90multipath: +- add automatic configuration for multipath + (adds 'rd.multipath=default' to use the default config) +- install kpartx's 11-dm-parts.rules + +90nvdimm: +- new module for NVDIMM support + +90ppcmac: +- respect DRACUT_ARCH, don't exclude ppcle + +90qemu-net: +- in hostonly mode, only install if network is needed +- install less module for strict hostonly mode + +91zipl: +- parse-zipl.sh: honor SYSTEMD_READY + +95cifs: +- pass rootflags to mount +- install new softdeps (sha512, gcm, ccm, aead2) + +95dasd: +- only install /etc/dasd.conf if present + +95dcssblk: +- fix script permissions + +95fcoe: +- fix pre-trigger stage by replacing exit with return in lldpad.sh +- default rd.nofcoe to false +- don't install if there is no FCoE hostonly devices + +95iscsi: +- fix missing space when compiling cmdline args +- fix ipv6 target discovery + +95nfs: +- only install rpc services for NFS < 4 when hostonly is strict +- Change the order of NFS servers during the boot + (next-server option has higher priority than DHCP-server itself) +- install less module if hostonly mode is strict + +95nvmf: +- add module for NVMe-oF +- add NVMe over TCP support + +95resume: +- do not resume on iSCSI, FCoE or NBD + +95rootfs-block: +- mount-root.sh: fix writing fstab file with missing fsck flag +- only write root argument for block device + +95zfcp: +- match simplified rd.zfcp format too + +95zfcp_rules: +- parse-zfcp.sh: remove rule existence check + +95znet: +- add a rd.znet_ifname= option + +98dracut-systemd: +- remove memtrace-ko and rd.memdebug=4 support in dracut +- remove cleanup_trace_mem calls +- dracut-initqueue: Print more useful info in case of timeout +- as of v246 of systemd "syslog" and "syslog-console" switches have been deprecated +- don't wait for root device if remote cryptsetup active + +99base: +- dracut-lib.sh: quote variables in parameter expansion patterns +- remove memtrace-ko and rd.memdebug=4 support in dracut +- remove cleanup_trace_mem calls +- see new module 99memstrack +- prevent creating unexpected files on the host when running dracut + +99memstrack: +- memstrack is a new tool to track the overall memory usage and + allocation, which can help off load the improve the builtin module + memory tracing function in dracut. + +99squash: +- don't hardcode the squash sub directories +- improve pre-requirements check +- check require module earlier, and properly + +new modules: +- nvmf +- watchdog-modules +- dbus +- network-wicked + +removed modules: +- stratis + +test suite: +- use dd from /dev/zero, instead of creating files with a hole +- TEST-03-USR-MOUNT/test.sh: increase loglevel +- TEST-12-RAID-DEG/create-root.sh: more udevadm settle +- TEST-35-ISCSI-MULTI: bump disk space +- TEST-41-NBD-NM/Makefile: should be based on TEST-40-NBD not TEST-20-NFS +- TEST-99: exclude /etc/dnf/* from check + +dracut-050 +========== + +dracut: +- support for running on a cross-compiled rootfs, see README.cross +- add support for creating secureboot signed UEFI images +- use microcode found in packed cpio images +- `-k/--kmodir` must now contain "lib/modules/$KERNEL_VERSION" + use DRACUT_KMODDIR_OVERRIDE=1 to ignore this check +- support the EFI Stub loader's splash image feature. + `--uefi-splash-image ` + +dracut modules: +- remove bashism in various boot scripts +- emergency mode: use sulogin + +fcoe: +- add rd.nofcoe option to disable the FCoE module from the command line + +10i18n: +- fix keymaps not getting included sometimes +- use eurlatgr as default console font + +iscsi: +- add option `rd.iscsi.testroute` + +multipath: +- fix udev rules detection of multipath devices + +network: +- support NetworkManager + +network-legacy: +- fix classless static route parsing +- ifup: fix typo when calling dhclient --timeout +- ifup: nuke pid and lease files if dhclient failed +- fix ip=dhcp,dhcp6 +- use $name instead of $env{INTERFACE} (systemd-udevd regression) + +shutdown: +- fix for non-systemd reboot/halt/shutdown commands +- set selinux labels +- fix shutdown with console=null + +lsinitrd: +- list squash content as well +- handle UEFI created with dracut --uefi +- make lsinitrd usable for images made with Debian mkinitramfs + +dracut-install: +- fixed ldd parsing +- install kernel module dependencies of dependencies +- fixed segfault for hashing NULL pointers +- add support for compressed firmware files +- dracut_mkdir(): create parent directories as needed. + +configure: +- Find FTS library with --as-needed + +test suite: +- lots of cleanups +- add github actions + +new modules: +- rngd +- network-manager +- ppcmac - thermal/fan control modules on PowerPC based Macs + +dracut-049 +========== +lsinitrd: +- record loaded kernel modules when hostonly mode is enabled + lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt +- allow to only unpack certain files + +kernel-modules: +- add gpio and pinctrl drivers for arm*/aarch64 +- add nfit + +kernel-network-modules: +- add vlan kernel modules + +ifcfg/write-ifcfg.sh: +- aggregate resolv.conf + +livenet: +- Enable OverlayFS overlay in sysroot.mount generator. + +dmsquash-live: +- Support a flattened squashfs.img +- Remove obsolete osmin.img processing + +dracut-systemd: +- Start systemd-vconsole-setup before dracut-cmdline-ask + +iscsi: +- do not install all of /etc/iscsi unless hostonly +- start iscsid even w/o systemd + +multipath: +- fixed shutdown + +network: +- configure NetworkManager to use dhclient + +mdraid: +- fixed uuid handling ":" versus "-" + +stratis: +- Add additional binaries + +new modules: +- 00warpclock +- 99squash + Adds support for building a squashed initramfs +- 35network-legacy + the old 40network +- 35network-manager + alternative to 35network-legacy +- 90kernel-modules-extra + adds out-of-tree kernel modules + +testsuite: +- now runs on travis +- support new qemu device options +- even runs without kvm now + +dracut-048 +========== + +dracut.sh: +- fixed finding of btrfs devices +- harden dracut against BASH_ENV environment variable +- no more prelinking +- scan and install "external" kernel modules +- fixed instmods with zero input +- rdsosreport: best effort to strip out passwords +- introduce tri-state hostonly mode + + Add a new option --hostonly-mode which accept an parameter, so we have a tri-state hostonly mode: + + * generic: by passing "--no-hostonly" or not passing anything. + "--hostonly-mode" has no effect in such case. + * sloppy: by passing "--hostonly --hostonly-mode sloppy". This + is also the default mode when only "--hostonly" is given. + * strict: by passing "--hostonly --hostonly-mode strict". + + Sloppy mode is the original hostonly mode, the new introduced strict + mode will allow modules to ignore more drivers or do some extra job to + save memory and disk space, while making the image less portable. + + Also introduced a helper function "optional_hostonly" to make it + easier for modules to leverage new hostonly mode. + + To force install modules only in sloppy hostonly mode, use the form: + + hostonly="$(optional_hostonly)" instmods + +dracut-install: +- don't error out, if no modules were installed +- support modules.softdep + +lsinitrd.sh: +- fixed zstd file signature + +kernel: +- include all pci/host modules +- add mmc/core for arm +- Include Intel Volume Management Device support + +plymouth: +- fix detection of plymouth directory + +drm: +- make failing installation of drm modules nonfatal +- include virtio DRM drivers in hostonly initramfs + +stratis: +- initial Stratis support + +crypt: +- correct s390 arch to include arch-specific crypto modules +- add cmdline rd.luks.partuuid +- add timeout option rd.luks.timeout + +shutdown: +- sleep a little, if a process was killed + +network: +- introduce ip=either6 option + +iscsi: +- replace iscsistart with iscsid + +qeth_rules: +- new module to copy qeth rules + +multipath-hostonly: +- merged back into multipath + +mdraid: +- fixed case if rd.md.uuid is in ID_FS_UUID format + +dracut-047 +========== +dracut.sh: +- sync initramfs to filesystem with fsfreeze +- introduce "--no-hostonly-default-device" +- disable lsinitrd logging when quiet +- add support for Zstandard compression +- fixed relative paths in --kerneldir +- if /boot/vmlinuz-$version exists use /boot/ as default output dir +- make qemu and qemu-net a default module in non-hostonly mode +- fixed relative symlinks +- support microcode updates for all AMD CPU families +- install all modules-load.d regardless of hostonly +- fixed parsing of "-i" and "--include" +- bump kmod version to >= 23 +- enable 'early_microcode' by default +- fixed check_block_and_slaves() for nvme + +lsinitrd.sh: +- dismiss "cat" error messages + +systemd-bootchart: +- removed + +i18n: +- install all keymaps for a given locale +- add correct fontmaps + +dmsquash-live: +- fixed systemd unit escape + +systemd: +- enable core dumps with systemd from initrd +- fixed setting of timeouts for device units +- emergency.service: use Type=idle and fixed task limit + +multipath: +- include files from /etc/multipath/conf.d +- do not fail startup on missing configuration +- start daemon after udev settle +- add shutdown script +- parse kernel commandline option 'multipath=off' +- start before local-fs-pre.target + +dracut-emergency: +- optionally print filesystem help + +network: +- fixed MTU for bond master +- fixed race condition when wait for networks + +fcoe: +- handle CNAs with DCB firmware support +- allow to specify the FCoE mode via the fcoe= parameter +- always set AUTO_VLAN for fcoemon +- add shutdown script +- fixup fcoe-genrules.sh for VN2VN mode +- switch back to using fipvlan for bnx2fc +- add timeout mechanism + +crypt: +- add basic LUKS detached header support +- escape backslashes for systemd unit names correctly +- put block_uuid.map into initramfs + +dmraid: +- do not delete partitions + +dasd_mod: +- do not set module parameters if dasd_cio_free is not present + +nfs: +- fix mount if IPv4 address is used in /etc/fstab +- support host being a DNS ALIAS + +fips: +- fixed creating path to .hmac of kernel based on BOOT_IMAGE +- turn info calls into fips_info calls +- modprobe failures during manual module loading is not fatal + + +lunmask: +- add module to handle LUN masking + +s390: +- add rd.cio_accept + +dcssblk: +- add new module for DCSS block devices + +zipl: +- add new module to update s390x configuration + +iscsi: +- no more iscsid, either iscsistart or iscsid + +integrity: +- support loading x509 into the trusted/builtin .evm keyring +- support X.509-only EVM configuration + +plymouth: +- improve distro compatibility + +dracut-046 +========== + +dracut.sh: +- bail out if module directory does not exist + if people want to build the initramfs without kernel modules, + then --no-kernel should be specified +- add early microcode support for AMD family 16h +- collect also all modaliases modules from sysfs for hostonly modules +- sync initramfs after creation + +network: +- wait for IPv6 RA if using none/static IPv6 assignment +- ipv6 improvements +- Handle curl using libnssckbi for TLS +- fix dhcp classless_static_routes +- dhclient: send client-identifier matching hardware address +- don't arping for point-to-point connections +- only bring up wired network interfaces (no wlan and wwan) + +mraid: +- mdraid: wait for rd.md.uuid specified devices to be assembled + +crypt: +- handle rd.luks.name + +crypt-gpg: +- For GnuPG >= 2.1 support OpenPGP smartcards + +kernel-install: +- Skip to create initrd if /etc/machine-id is missing or empty + +nfs: +- handle rpcbind /run/rpcbind directory + +s390: +- various fixes + +dmsquash-live: +- add NTFS support + +multipath: +- split out multipath-hostonly module + +lvmmerge: +- new module, see README.md in the module directory + +dracut-systemd: +- fixed dependencies + + +dracut-045 +========== + +Important: dracut now requires libkmod for the dracut-install binary helper, + which nows handles kernel module installing and filtering. + +dracut.sh: +- restorecon final image file +- fail hard, if we find modules and modules.dep is missing +- support --tmpdir as a relative path +- add default path for --uefi + +dracut-functions.sh: +- fix check_vol_slaves() volume group name stripping + +dracut-install: +- catch ldd message "cannot execute binary file" +- added kernel module handling with libkmod + Added parameters: + --module,-m + --mod-filter-path, -p + --mod-filter-nopath, -P + --mod-filter-symbol, -s + --mod-filter-nosymbol, -S + --mod-filter-noname, -N + --silent + --kerneldir + --firmwaredirs +- fallback to non-hostonly mode if lsmod fails + +lsinitrd: +- new option "--unpack" +- new option "--unpackearly" +- and "--verbose" + +general initramfs fixes: +- don't remove 99-cmdline-ask on 'hostonly' cleanup +- call dracut-cmdline-ask.service, if /etc/cmdline.d/*.conf exists +- break at switch_root only for bare rd.break +- add rd.emergency=[reboot|poweroff|halt] + specifies what action to execute in case of a critical failure +- rd.memdebug=4 gives information, about kernel module memory consumption + during loading + +dmsquash-live: +- fixed livenet-generator execution flag + and include only, if systemd is used +- fixed dmsquash-live-root.sh for cases where the fstype of the liveimage is squashfs +- fixed typo for rootfs.img +- enable the use of the OverlayFS for the LiveOS root filesystem + Patch notes: + Integrate the option to use an OverlayFS as the root filesystem + into the 90dmsquash-live module for testing purposes. + + The rd.live.overlay.overlayfs option allows one to request an + OverlayFS overlay. If a persistent overlay is detected at the + standard LiveOS path, the overlay & type detected will be used. + + Tested primarily with transient, in-RAM overlay boots on vfat- + formatted Live USB devices, with persistent overlay directories + on ext4-formatted Live USB devices, and with embedded, persistent + overlay directories on vfat-formatted devices. (Persistent overlay + directories on a vfat-formatted device must be in an embedded + filesystem that supports the creation of trusted.* extended + attributes, and must provide valid d_type in readdir responses.) + + The rd.live.overlay.readonly option, which allows a persistent + overlayfs to be mounted read only through a higher level transient + overlay directory, has been implemented through the multiple lower + layers feature of OverlayFS. + + The default transient DM overlay size has been adjusted up to 32 GiB. + This change supports comparison of transient Device-mapper vs. + transient OverlayFS overlay performance. A transient DM overlay + is a sparse file in memory, so this setting does not consume more + RAM for legacy applications. It does permit a user to use all of + the available root filesystem storage, and fails gently when it is + consumed, as the available free root filesystem storage on a typical + LiveOS build is only a few GiB. Thus, when booted on other- + than-small RAM systems, the transient DM overlay should not overflow. + + OverlayFS offers the potential to use all of the available free RAM + or all of the available free disc storage (on non-vfat-devices) + in its overlay, even beyond the root filesystem available space, + because the OverlayFS root filesystem is a union of directories on + two different partitions. + + This patch also cleans up some message spew at shutdown, shortens + the execution path in a couple of places, and uses persistent + DM targets where required. + +dmraid: +- added "nowatch" option in udev rule, otherwise udev would reread partitions for raid members +- allow booting from degraded MD RAID arrays + +shutdown: +- handle readonly /run on shutdown + +kernel-modules: +- add all HID drivers, regardless of hostonly mode + people swap keyboards sometimes and should be able to enter their disk password +- add usb-storage + To save the rdsosreport.txt to a USB stick, the usb-storage module is needed. +- add xennet +- add nvme + +systemd: +- add /etc/machine-info +- fixed systemd-escape call for names beginning with "-" +- install missing drop-in configuration files for + /etc/systemd/{journal.conf,system.conf} + +filesystems: +- add support to F2FS filesystem (fsck and modules) + +network: +- fix carrier detection +- correctly set mac address for ip=...:: +- fixed vlan, bonding, bridging, team logic + call ifup for the slaves and assemble afterwards +- add mtu to list of variables to store in override +- for rd.neednet=0 a bootdev is not needed anymore +- dhclient-script.sh: add classless-static-routes support +- support for iBFT IPv6 +- support macaddr in brackets [] (commit 740c46c0224a187d6b5a42b4aa56e173238884cc) +- use arping2, if available +- support multiple default gateways from DHCP server +- fixup VLAN handling +- enhance team support +- differ between ipv6 local and global tentative +- ipv6: wait for a router advertised route +- add 'mtu' parameter for bond options +- use 'ip' instead of 'brctl' + +nbd: +- add systemd generator +- use export names instead of port numbers, because port number based + exports are deprecated and were removed. + +fcoe: +- no more /dev/shm state copying + +multipath: +- check all /dev/mapper devices if they are multipath devices, not only mpath* + +fips: +- fixed .hmac installation in FIPS mode + +plymouth: +- also trigger the acpi subsystem + +syslog: +- add imjournal.so to read systemd journal +- move start from udev to initqueue/online + +caps: +- make it a non default module + +livenet: +- support nfs:// urls in livenet-generator + +nfs: +- install all nfs modules non-hostonly + +crypt: +- support keyfiles embedded in the initramfs + +testsuite: +- add TEST-70-BONDBRIDGETEAMVLAN +- make "-cpu host" the default + +dracut-044 +========== +creation: +- better udev & systemd dir detection +- split dracut-functions.sh in dracut-init.sh and dracut-functions.sh + dracut-functions.sh can now be sourced by external tools +- detect all btrfs devices needed +- added flag file if initqueue is needed +- don't overwrite anything, if initramfs image file creation failed +- if no compressor is specified, try to find a suitable one +- drop scanning kernel config for CONFIG_MICROCODE_*_EARLY +- remove "_EARLY" from CONFIG_MICROCODE_* checks +- dracut.sh: add command line option for install_i18_all + --no-hostonly-i18n -> install_i18n_all=yes + --hostonly-i18n -> install_i18n_all=no +- --no-reproducible to turn off reproducible mode +- dracut-function.sh can now be sourced from outside of dracut +- dracut-init.sh contains all functions, which only can be used from + within the dracut infrastructure +- support --mount with just mountpoint as a parameter +- removed action_on_fail support +- removed host_modalias concept +- do not create microcode, if no firmware is available +- skip gpg files in microcode generation + +initramfs: +- ensure pre-mount (and resume) run before root fsck +- add --online option to initqueue + +qemu: +- fixed virtual machine detection + +lvm: +- remove all quirk arguments for lvm >= 2.2.221 + +dmsquash: +- fixup for checkisomd5 +- increase timeout for checkisomd5 +- use non-persistent metadata snapshots for transient overlays. +- overflow support for persistent snapshot. +- use non-persistent metadata snapshots. +- avoid an overlay for persistent, uncompressed, read-write live installations. + +multipath: +- multipath.conf included in hostonly mode +- install all multipath path selector kernel modules + +iSCSI: +- use the iBFT initiator name, if found and set +- iscsid now present in the initramfs +- iscsistart is done with systemd-run asynchrone to do things in + paralllel. Also restarted for every new interface which shows up. +- If rd.iscsi.waitnet (default) is set, iscsistart is done only + after all interfaces are up. +- If not all interfaces are up and rd.iscsi.testroute (default) is set, + the route to a iscsi target IP is checked and skipped, if there is none. +- If all things fail, we issue a "dummy" interface iscsiroot to retry + everything in the initqueue/timeout. + +network: +- added DHCP RENEW/REBIND +- IPv4 DHCP lease time now optional (bootp) +- IPv6 nfs parsing +- fixed IPv6 route parsing +- rd.peerdns=0 parameter to disable DHCP nameserver setting +- detect duplicate IPv4 addresses for static addresses +- if interfaces are specified with its enx* name, bind the correspondent MAC to the interface name +- if multiple "ip=" are present on the kernel command line "rd.neednet=1" is assumed +- add options to tweak timeouts + rd.net.dhcp.retry= + If this option is set, dracut will try to connect via dhcp + times before failing. Default is 1. + + rd.net.timeout.dhcp= + If this option is set, dhclient is called with "-timeout ". + + rd.net.timeout.iflink= + Wait until link shows up. Default is 60 seconds. + + rd.net.timeout.ifup= + Wait until link has state "UP". Default is 20 seconds. + + rd.net.timeout.route= + Wait until route shows up. Default is 20 seconds. + + rd.net.timeout.ipv6dad= + Wait until IPv6 DAD is finished. Default is 50 seconds. + + rd.net.timeout.ipv6auto= + Wait until IPv6 automatic addresses are assigned. + Default is 40 seconds. + + rd.net.timeout.carrier= + Wait until carrier is recognized. Default is 5 seconds. + +IMA: +- load signed certificates in the IMA keyring, see modules.d/98integrity/README +- load EVM public key in the kernel _evm keyring + +FCoE: + fcoe: start with fcoemon instead of fipvlan + +dracut-043 +========== +- add missing dmsquash-generator + +dracut-042 +========== +- fixed dmsetup shutdown +- new kernel command line option "rd.live.overlay.thin" + This option changes the underlying mechanism for the overlay in the + dmsquash module. + Instead of a plain dm snapshot a dm thin snapshot is used. The advantage + of the thin snapshot is, that the TRIM command is recognized, which + means that at runtime, only the occupied blocks will be claimed from + memory, and freed blocks will really be freed in ram. +- dmsquash: Add squashfs support to rd.live.fsimg + Previously rd.live.fsimg only supported filesystems residing in + (compressed) archives. + Now rd.live.fsimg can also be used when a squashfs image is used. + This is achieved by extracting the rootfs image from the squashfs and + then continue with the default routines for rd.live.fsimg. +- lvm: add support for LVM system id +- split up the systemd dracut module + Basic systemd functionality is in 00systemd now. + Switching root and the initrd.target is in 00systemd-initrd. + Dracut additions to the systemd initrd are in 98dracut-systemd. +- support for creating a UEFI boot executable via argument "--uefi" + With an EFI stub, the kernel, the initramfs and a kernel cmdline can be + glued together to a single UEFI executable, which can be booted by a + UEFI BIOS. +- network: split out kernel-network-modules, now in 90kernel-network-modules +- support for ethernet point-to-point connections configured via DHCP +- kernel-modules: install all HID drivers +- dracut.pc pkg-config file +- mount /dev, /dev/shm and /run noexec + +dracut-041 +========== +- fixed the shutdown loop +- fixed gzip compression for versions, which do not have --rsyncable +- fixed ifcfg generation for persistent interface names +- multipath: + * new option to turn off multipath "rd.multipath=0" completly + * preload scsi dh modules + * start multipathd via systemd service +- do not fail, if user pressed ESC during media check +- fixed systemd-journal by symlinking /var/log to /run/initramfs/log +- initrd-release moved to /usr/lib +- lots of iSCSI fixes +- new "rd.timeout" to specify the systemd JobTimeoutSec for devices +- if $initrd/etc/cmdline.d/* has a "root=" and the kernel cmdline does not, + generate a mount unit for it +- increased the initqueue timeout for non systemd initramfs to 180s +- $initrd/etc/cmdline.d/ hostonly files are now generated for NFS +- make use of systemd-hibernate-resume, if available +- fixed ldconfig parsing for hwcap output +- network: add support for comma separated autoconf options like ip=eth0:auto6,dhcp +- new parameter "rd.live.overlay.size" to specify the overlay for live images +- changed the test suite for the new sfdisk syntax +- added cache tools for dm-cache setups + +dracut-040 +========== +- fixed dracut module dependency checks +- fixed test suite + +dracut-039 +========== +- DRACUT_PATH can now be used to specify the PATH used by dracut + to search for binaries instead of the default + /usr/sbin:/sbin:/usr/bin:/bin + This should be set in the distribution config file + /usr/lib/dracut/dracut.conf.d/01-dist.conf +- add "--loginstall " and loginstall="" options + to record all files, which are installed from the host fs +- "rd.writable.fsimg" - support for read/write filesystem images +- "rd.route" kernel command line parameter added +- "--install-optional" and install_optional_items added +- find plymouth pkglibdir on debian +- torrent support for live images + root=live:torrent://example.com/liveboot.img.torrent + and generally added as a download handler +- disable microcode, if the kernel does not support it +- speed up ldconfig_paths() +- more ARM modules +- fixed inst*() functions and "-H" handling +- fixed bridge setup +- added --force-drivers parameter and force_drivers=+ config option + to enforce driver loading at early boot time +- documented "iso-scan/filename" usage in grub +- various bugfixes + +dracut-038 +========== +- "rd.cmdline=ask" will ask the user on the console to enter additional + kernel command line parameters +- "rd.hostonly=0" removes all "hostonly" added custom files, + which is useful in combination with "rd.auto" or other specific parameters, + if you want to boot on the same hardware, but the compiled in configuration + does not match your setup anymore +- inst* functions and dracut-install now accept the "-H" flag, which logs all + installed files to /lib/dracut/hostonly-files. This is used to remove those + files, if rd.hostonly is given on the kernel command line +- strstr now only does literal string match, + please use strglob and strglobin for globs +- fixed unpacking of the microcode image on shutdown +- added systemd-gpt-auto-generator +- fcoe: wait for lldpad to be ready +- network: handle "ip=dhcp6" +- network: DCHPv6: set valid_lft and preferred_lft +- dm: support dm-cache +- fstab: do not mount and fsck from fstab if using systemd +- break at switch_root only for bare rd.break and not for any rd.break=... +- nbd: make use of "--systemd-mark", otherwise it gets killed on switch_root +- fcoe-uefi: fixed cmdline parameter generation +- iscsi: deprecate "ip=ibft", use "rd.iscsi.ibft[=1]" from now on +- "lsinitrd -m" now only lists the dracut modules of the image +- a lot of small bugfixes + +dracut-037 +========== +- dracut: hostonly_cmdline variable and command line switch + Toggle hostonly cmdline storing in the initramfs + --hostonly-cmdline: + Store kernel command line arguments needed in the initramfs + --no-hostonly-cmdline: + Do not store kernel command line arguments needed in the initramfs +- dracut: --mount now understands full fstab lines +- dracut now also includes drivers from the /lib/modules//updates directory +- dracut: only set the owner of files to 0:0, if generated as non-root +- dracut now directly writes to the initramfs file +- dracut: call lz4 with the legacy flag (linux kernel does not support the new format) +- systemd: rootfs-generator generates JobTimeout=0 units for the root device +- systemd: added the systemd-sysctl service +- systemd: add 80-net-setup-link.rules and .link files for persistent interface renaming +- systemd: make dracut-shutdown.service failure non-fatal +- network: various IPv6 fixes +- network: DCHCP for IPv6 +- network: understand ip=.....:: +- network: parse ibft nameserver settings +- shutdown: if kexec fails, just reboot +- lvm: handle one LV at a time with lvchange +- module-setup.sh: + New functions require_binaries() and require_any_binary() to be used + in the check() section of module-setup.sh. +- a lot of small bugfixes + +Contributions from: +Harald Hoyer +Alexander Tsoy +Till Maas +Amadeusz Żołnowski +Brian C. Lane +Colin Guthrie +Dave Young +WANG Chao +Shawn W Dunn + +dracut-036 +========== +- fixed skipcpio signature checking + +dracut-035 +========== +- changed dracut tarball compression to xz +- new argument "--rebuild" +- add lzo, lz4 compression +- install: install all binaries with found in PATH +- lsinitrd can now handle initramfs images with an early cpio prepended + (microcode, ACPI tables) +- mkinitrd-suse added as a compat stub for dracut +- lvm: install thin utils for non-hostonly +- resume: fix swap detection in hostonly +- avoid loading unnecessary 32-bit libraries for 64-bit initrds +- crypt: wait for systemd password agents +- crypt: skip crypt swaps with password files +- network: before doing dhcp, dracut now checks, if the link has a carrier +- network: dhclient-script.sh now sets the lease time +- network: include usbnet drivers +- network: include all ethernet drivers +- network: add rd.bootif=0 to ignore BOOTIF +- i18n: introduce i18n_install_all, to install everything i18n related +- support SuSE DASD configurations +- support SuSE zfcp configurations +- support SuSE compressed KEYMAP= setting +- usrmount: always install the module, + so always mount /usr from within the initramfs +- test/TEST-17-LVM-THIN: new test case for lvm thin pools +- "halt" the machine in systemd mode for die() + +dracut-034 +========== +- do not run dhcp on parts of assembled network interfaces (bond, bridge) +- add option to turn on/off prelinking + --prelink, --noprelink + do_prelink=[yes|no] +- add ACPI table overriding +- do not log to syslog/kmsg/journal for UID != 0 +- lvm/mdraid: Fix LVM on MD activation +- bcache module removed (now in bcache-tools upstream) +- mdadm: also install configs from /etc/mdadm.conf.d +- fixes for mdadm-3.2.6+ +- mkinitrd: better compat support for SUSE +- fcoe: add FCoE UEFI boot device support +- rootfs-block: add support for the rootfallback= kernel cmdline option + +Contributions from: +Thomas Renninger +Alexander Tsoy +Peter Rajnoha +WANG Chao +Harald Hoyer + + +dracut-033 +========== +- improved hostonly device recognition +- improved hostonly module recognition +- add dracut.css for dracut.html +- do not install udev rules from /etc in generic mode +- fixed LABEL= parsing for swap devices +- fixed iBFT network setup +- url-lib.sh: handle 0-size files with curl +- dracut.asc: document debugging dracut on shutdown +- if rd.md=0, use dmraid for imsm and ddf +- skip empty dracut modules +- removed caching of kernel cmdline +- fixed iso-scan, if the loop device driver is a kernel module +- bcache: support new blkid +- fixed ifup udev rules +- ifup with dhcp, if no "ip=" specified for the interface + +Contributions from: +WANG Chao +Colin Walters +Harald Hoyer + + +dracut-032 +========== +- add parameter --print-cmdline + This prints the kernel command line parameters for the current disk + layout. + $ dracut --print-cmdline + rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471 + rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root + rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered + rootfstype=ext4 +- dracut.sh: add --persistent-policy option and persistent_policy conf option + --persistent-policy : + Use to address disks and partitions. + can be any directory name found in /dev/disk. + E.g. "by-uuid", "by-label" +- dracut now creates the initramfs without udevadm + that means the udev database does not have to populated + and the initramfs can be built in a chroot with + /sys /dev /proc mounted +- renamed dracut_install() to inst_multiple() for consistent naming +- if $libdirs is unset, fall back to ld.so.cache paths +- always assemble /usr device in initramfs +- bash module added (disable it, if you really want dash) +- continue to boot, if the main loop times out, in systemd mode +- removed inst*() shell pure versions, dracut-install binary is in charge now +- fixed ifcfg file generation for vlan +- do not include adjtime and localtime anymore +- fixed generation of zfcp.conf of CMS setups +- install vt102 terminfo + dracut_install() is still there for backwards compat +- do not strip files in FIPS mode +- fixed iBFT interface configuration +- fs-lib: install fsck and fsck.ext* +- shutdown: fixed killall_proc_mountpoint() +- network: also wait for ethernet interfaces to setup +- fixed checking for FIPS mode + +Contributions from: +Harald Hoyer +WANG Chao +Baoquan He +Daniel Schaal +Dave Young +James Lee +Radek Vykydal + + +dracut-031 +========== +- do not include the resume dracut module in hostonly mode, + if no swap is present +- don't warn twice about omitted modules +- use systemd-cat for logging on systemd systems, if logfile is unset +- fixed PARTUUID parsing +- support kernel module signing keys +- do not install the usrmount dracut module in hostonly mode, + if /sbin/init does not live in /usr +- add debian udev rule files +- add support for bcache +- network: handle bootif style interfaces + e.g. ip=77-77-6f-6f-64-73:dhcp +- add support for kmod static devnodes +- add vlan support for iBFT + +Contributions from: +Harald Hoyer +Amadeusz Żołnowski +Brandon Philips +Colin Walters +James Lee +Kyle McMartin +Peter Jones + +dracut-030 +========== +- support new persistent network interface names +- fix findmnt calls, prevents hang on stale NFS mounts +- add systemd.slice and slice.target units +- major shell cleanup +- support root=PARTLABEL= and root=PARTUUID= +- terminfo: only install l/linux v/vt100 and v/vt220 +- unset all LC_* and LANG, 10% faster +- fixed dependency loop for dracut-cmdline.service +- do not wait_for_dev for the root devices +- do not wait_for_dev for devices, if dracut-initqueue is not needed +- support early microcode loading with --early-microcode +- dmraid, let dmraid setup its own partitions +- sosreport renamed to rdsosreport + +Contributions from: +Harald Hoyer +Konrad Rzeszutek Wilk +WANG Chao + +dracut-029 +========== +- wait for IPv6 autoconfiguration +- i18n: make the default font configurable + To set the default font for your distribution, add + i18n_default_font="latarcyrheb-sun16" + to your /lib/dracut/dracut.conf.d/01-dist.conf distribution config. +- proper handle "rd.break" in systemd mode before switch-root +- systemd: make unit files symlinks +- build without dash requirement +- add dracut-shutdown.service.8 manpage +- handle MACs for "ip=" + "ip=77-77-6f-6f-64-73:dhcp" +- don't explode when mixing BOOTIF and ip= +- 90lvm/module-setup.sh: redirect error message of lvs to /dev/null + +Contributions from: +Harald Hoyer +Will Woods +Baoquan He + +dracut-028 +========== +- full integration of crypto devs in systemd logic +- support for bridge over team and vlan tagged team +- support multiple bonding interfaces +- new kernel command line param "rd.action_on_fail" + to control the emergency action +- support for bridge over a vlan tagged interface +- support for "iso-scan/filename" kernel parameter +- lsinitrd got some love and does not use "file" anymore +- fixed issue with noexec mounted tmp dirs +- FIPS mode fixed +- dracut_install got some love +- fixed some /usr mounting problems +- ifcfg dracut module got some love and fixes +- default installed font is now latarcyrheb-sun16 +- new parameters rd.live.dir and rd.live.squashimg +- lvm: add tools for thin provisioning +- also install non-hwcap libs +- setup correct system time and time zone in initrd +- s390: fixed cms setup +- add systemd-udevd persistent network interface naming + +Contributions from: +Harald Hoyer +Kamil Rytarowski +WANG Chao +Baoquan He +Adam Williamson +Colin Guthrie +Dan Horák +Dave Young +Dennis Gilmore +Dennis Schridde + +dracut-027 +========== +- dracut now has bash-completion +- require bash version 4 +- systemd module now requires systemd >= 199 +- dracut makes use of native systemd initrd units +- added hooks for new-kernel-pkg and kernel-install +- hostonly is now default for fedora +- comply with the BootLoaderSpec paths + http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec +- added rescue module +- host_fs_types is now a hashmap +- new dracut argument "--regenerate-all" +- new dracut argument "--noimageifnotneeded" +- new man page dracut.bootup +- install all host filesystem drivers +- use -D_FILE_OFFSET_BITS=64 to build dracut-install + +dracut-026 +========== +- introduce /usr/lib/dracut/dracut.conf.d/ drop-in directory + + /usr/lib/dracut/dracut.conf.d/*.conf can be overwritten by the same + filenames in /etc/dracut.conf.d. + + Packages should use /usr/lib/dracut/dracut.conf.d rather than + /etc/dracut.conf.d for drop-in configuration files. + + /etc/dracut.conf and /etc/dracut.conf.d belong to the system administrator. + +- uses systemd-198 native initrd units +- totally rely on the fstab-generator in systemd mode for block devices +- dracut systemd now uses dracut.target rather than basic.target +- dracut systemd services optimize themselves away +- fixed hostonly parameter generation +- turn off curl globbing (fixes IPv6) +- modify the udev rules on install and not runtime time +- enable initramfs building without kernel modules (fixed regression) +- in the initqueue/timeout, + reset the main loop counter, as we see new udev events or initqueue/work +- fixed udev rule installation + +dracut-025 +========== +- do not strip signed kernel modules +- add sosreport script and generate /run/initramfs/sosreport.txt +- make short uuid specification for allow-discards work +- turn off RateLimit for the systemd journal +- fixed MAC address assignment +- add systemd checkisomd5 service +- splitout drm kernel modules from plymouth module +- add 'swapoff' to initramfs to fix shutdown/reboot +- add team device support +- add pre-shutdown hook +- kill all processes in shutdown and report remaining ones +- "--device" changed to "--add-device" and "add_device=" added for conf files +- add memory usage trace to different hook points +- cope with optional field #7 in /proc/self/mountinfo +- lots of small bugfixes + +dracut-024 +========== +- new dracut option "--device" +- new dracut kernel command line options "rd.auto" +- new dracut kernel command line options "rd.noverifyssl" +- new dracut option "--kernel-cmdline" and "kernel_cmdline" option for default parameters +- fixes for systemd and crypto +- fix for kexec in shutdown, if not included in initramfs +- create the initramfs non-world readable +- prelink/preunlink in the initramfs +- strip binaries in the initramfs by default now +- various FIPS fixes +- various dracut-install fixes + +dracut-023 +========== +- resume from hibernate fixes +- -N option for --no-hostonly +- support for systemd crypto handling +- new dracut module "crypt-loop" +- deprecate the old kernel command line options +- more documentation +- honor CFLAGS for dracut-install build +- multipath fixes +- / is mounted according to rootflags parameter but forced ro at first. + Later it is remounted according to /etc/fstab + rootflags parameter + and "ro"/"rw". +- support for xfs / reiserfs separate journal device +- new "ro_mnt" option to force ro mount of / and /usr +- root on cifs support +- dracut-install: fixed issue for /var/tmp containing a symlink +- only lazy resolve with ldd, if the /var/tmp partition is not mounted with "noexec" +- i18n: fixed inclusion of "include" keymaps + +dracut-022 +========== +- fixed host-only kernel module bug + +dracut-021 +========== +- fixed systemd in the initramfs (requires systemd >= 187) +- dracut-install: massive speedup with /var on the same filesystem with COW copy +- dracut-install: moved to /usr/lib/dracut until it becomes a general purpose tool +- new options: "rd.usrmount.ro" and "rd.skipfsck" +- less mount/umount +- apply "ro" on the kernel command line also to /usr +- mount according to fstab, if neither "ro" or "rw" is specified +- skip fsck for xfs and btrfs. remount is enough +- give emergency_shell if /usr mount failed +- dracut now uses getopt: + * options can be position independent now!! + * we can now use --option= +- added option "--kver=", and the image location can be omitted + # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64 +- dracut.sh: for --include copy also the symbolic links +- man pages: lsinitrd and mkinitrd added +- network: We do not support renaming in the kernel namespace anymore (as udev does + that not anymore). So, if a user wants to use ifname, he has to rename + to a custom namespace. "eth[0-9]+" is not allowed anymore. !!!!! +- resume: moved the resume process to the initqueue. + This should prevent accidently mounting the root file system. +- testsuite: add support for: make V=1 TESTS="01 20 40" check + $ sudo make V=1 clean check + now runs the testsuite in verbose mode + + $ sudo make TESTS="01 20 40" clean check + now only runs the 01, 20 and 40 tests. + +dracut-020 +========== +- changed rd.dasd kernel parameter +- arm kernel modules added to kernel-modules +- make udevdir systemdutildir systemdsystemunitdir global vars + your distribution should ship those settings in + /etc/dracut.conf.d/01-distro.conf + see dracut.conf.d/fedora.conf.example +- kernel modules are now only handled with /sys/modules and modules.dep +- systemd fixups +- mdraid: wait for md devices to be clean, before shutdown +- ifup fixed for ipv6 +- add PARTUUID as root=PARTUUID= parameter +- fixed instmods() return code and set pipefail globally +- add 04watchdog dracut module +- dracut-shutdown.service: fixed ordering to be before shutdown.target +- make use of "ln -r" instead of shell functions, if new coreutils is installed +- network: support vlan tagged bonding +- new dracut module qemu and qemu-net to install all kernel driver +- fs-lib/fs-lib.sh: removed test mounting of btrfs and xfs +- no more "mknod" in the initramfs!! +- replaced all "tr" calls with "sed" +- speedup with lazy kernel module dependency resolving +- lots of speedup optimizations and last but not least +- dracut-install: + - new binary to significanlty speedup the installation process + - dracut-functions.sh makes use of it, if installed + + +dracut-019 +========== +- initqueue/online hook +- fixes for ifcfg write out +- rootfs-block: avoid remount when options don't change +- Debian multiarch support +- virtfs root filesystem support +- cope with systemd-udevd +- mount tmpfs with strictatime +- include all kernel/drivers/net/phy drivers +- add debug_on() and debug_off() functions +- add arguments for source_hook() and source_all() +- cleanup hook +- plymouth: get consoledev from /sys/class/tty/console/active +- experimental systemd dracut module for systemd in the initramfs +- install xhci-hcd kernel module +- dracut: new "--mount" option +- lsinitrd: new option --printsize +- ARM storage kernel modules added +- s390 cms conf file support +- /etc/initrd-release in the initrd +- vlan support +- full bonding and bridge support +- removed scsi_wait_scan kernel module from standard install +- support rd.luks.allow-discards and honor options in crypttab +- lots of bugfixes + +dracut-018 +========== +- lvm: ignore lvm mirrors +- lsinitrd: handle LZMA images +- iscsi: add rd.iscsi.param +- iscsi: add iscsi interface binding +- new module cms to read and handle z-Series cms config files +- fixed fstab.sys handling +- new dracut option "--tmpdir" +- new dracut option "--no-hostonly" +- nbd: name based nbd connects +- converted manpage and documentation source to asciidoc +- write-ifcfg fixes and cleanups +- ifup is now done in the initqueue +- netroot cleanup +- initqueue/online is now for hooks, which require network +- no more /tmp/root.info +- 98pollcdrom: factored out the ugly cdrom polling in the main loop +- simplified rd.luks.uuid testing +- removed "egrep" and "ls" calls +- speedup kernel module installation +- make bzip2 optional +- lots of bugfixes + +dracut-017 +========== +- a _lot_ faster than dracut-016 in image creation +- systemd service dracut-shutdown.service +- livenet fixes +- ssh-client module install fix +- root=iscsi:... fixed +- lots of restructuring and optimizing in dracut-functions.sh +- usrmount: honor fs_passno in /etc/fstab +- renamed all shell scripts to .sh +- new option "--omit-drivers" and config option "omit_drivers" +- hostonly mode fixups + +dracut-016 +========== +- fixed lsinitrd +- honor binaries in sbin first +- fixed usrmount module +- added systemd service for shutdown +- fixed terminfo on distros with /usr/share/terminfo +- reload udev rules after "pre-trigger" hook +- improved test suite +- new parameter "--omit-drivers" and new conf param omit_drivers +- "--offroot" support for mdraid +- new libs: net-lib.sh, nfs-lib.sh, url-lib.sh, img-lib.sh + full of functions to use in your dracut module + +dracut-015 +========== +- hostonly mode automatically adds command line options for root and /usr +- --add-fstab --mount parameters +- ssh-client module +- --ctty option: add job control +- cleanup /run/initramfs +- convertfs module +- /sbin/ifup can be called directly +- support kernel modules compressed with xz +- s390 iscsi modules added +- terminfo module +- lsinitrd can handle concatened images +- lsinitrd can sort by size + +dracut-014 +========== +- new dracut arguments: + --lvmconf + --nolvmconf + --fscks [LIST] + --nofscks +- new .conf options: + install_items + fscks + nofscks +- new kernel options: + rd.md.ddf + rd.md.waitclean + plymouth.enable +- dracut move from /sbin to /usr/bin +- dracut modules dir moved from /usr/share/dracut to /usr/lib/dracut +- profiling with "dracut --profile" +- new TEST-16-DMSQUASH, test for Fedora LiveCDs +- speedup of initramfs creation +- ask_for_password fallback to CLI +- mdraid completely switched to incremental assembly +- no more cdrom polling +- "switch_root" breakpoint is now very late +- /dev/live is gone +- /dev/root is gone +- fs-lib dracut module for fscks added +- xen dracut module removed +- usb mass storage kernel drivers now included +- usrmount dracut module added: + mount /usr if found in /sysroot/etc/fstab +- only include fsck helper needed for hostonly +- fcoe: support for bnx2fc +- support iSCSI drivers: qla4xxx, cxgb3i, cxgb4i, bnx2i, be2iscsi +- fips-aesni dracut module added +- add install_items to dracut.conf + install_items+=" [ ...] " +- speedup internal testsuite +- internal testsuite: store temporary data in a temporary dir + +dracut-013 +========== +- speedup of initramfs creation +- fixed inst_dir for symbolic links +- add unix kernel module + +dracut-012 +========== +- better fsck handling +- fixed wait condition for LVM volumes +- fix for hardlinks (welcome Debian! :-) +- shutdown bugfixes +- automatic busybox symlink creation +- try to mount /usr, if init points to a path in /usr +- btrfs with multiple devices +- "--force-add" option for dracut, to force-add dracut modules, + without hostonly checks +- lsinitrd also display the initramfs size in human readable form +- livenet module, to mount live-isos over http +- masterkey,ecryptfs,integrity security modules +- initqueue/timeout queue e.g. for starting degraded raids +- "make rpm" creates an rpm with an increasing release number from any + git checkout +- support lvm mirrors +- start degraded lvm mirrors after a timeout +- start degraded md raids after a timeout +- getarg() now returns wildcards without file matching to the current fs +- lots of bugfixes + +dracut-011 +========== +- use udev-168 features for shutting down udev +- introduce "--prefix" to put all initramfs files in e.g "/run/initramfs" +- new shutdown script (called by systemd >= 030) to disassemble the root device +- lots of bugfixes +- new module for gpg-encrypted keys - 91crypt-gpg + +dracut-010 +========== +- lots of bugfixes +- plymouth: use /run/plymouth/pid instead of /run/initramfs/plymouth +- add "/lib/firmware/updates" to default firmware path + +dracut-009 +========== +- dracut generator + - dracut-logger + - xz compression + - better argument handling + +- initramfs + - hooks moved to /lib/dracut/hooks in initramfs + - rd.driver.{blacklist|pre|post} accept comma separated driver list + - iSCSI: iSCSI Boot Firmware Table (iBFT) support + - support for /run + - live image: support for generic rootfs.img (instead of ext3fs.img) + - caps module + - FCoE: EDD support + +dracut-008 +========== +- removed --ignore-kernel-modules option (no longer necessary) +- renamed kernel command line arguments to follow the rd. naming scheme +- merged check, install, installkernel to module-setup.sh +- support for bzip2 and xz compressed initramfs images. +- source code beautification +- lots of documentation +- lsinitrd: "catinitrd" functionality +- dracut: --list-modules +- lvm: support for dynamic LVM SNAPSHOT root volume +- 95fstab-sys: mount all /etc/fstab.sys volumes before switch_root +- 96insmodpost dracut module +- rd.shell=1 per default +- rootfs-block:mount-root.sh add fsck +- busybox shell replacements module +- honor old "real_init=" +- 97biosdevname dracut module + +dracut-007 +========== +- module i18n is no longer fedora/red hat specific (Amadeusz Żołnowski) +- distribution specific conf file +- bootchartd support +- debug module now has fsck +- use "hardlink", if available, to save some space +- /etc/dracut.conf can be overwritten by settings in /etc/dracut.conf.d/*.conf +- gentoo splash module +- --ignore-kernel-modules option +- crypto keys on external devices support +- bugfixes + +dracut-006 +========== +- fixed mdraid with IMSM +- fixed dracut manpages +- dmraid parse different error messages +- add cdrom polling mechanism for slow cdroms +- add module btrfs +- add btrfsctl scan for btrfs multi-devices (raid) +- teach dmsquash live-root to use rootflags +- trigger udev with action=add +- fixed add_drivers handling +- add sr_mod +- use pigz instead of gzip, if available +- boot from LVM mirrors and snapshots +- iscsi: add support for multiple netroot=iscsi: +- Support old version of module-init-tools +- got rid of rdnetdebug +- fixed "ip=auto6" +- dracut.conf: use "+=" as default for config variables +- bugfixes + +dracut-005 +========== +- dcb support to dracut's FCoE support +- add readonly overlay support for dmsquash +- add keyboard kernel modules +- dracut.conf: added add_dracutmodules +- add /etc/dracut.conf.d +- add preliminary IPv6 support +- bugfixes + +dracut-004 +========== +- dracut-lib: read multiple lines from $init/etc/cmdline +- lsinitrd and mkinitrd +- dmsquash: add support for loopmounted *.iso files +- lvm: add rd_LVM_LV and "--poll n" +- user suspend support +- add additional drivers in host-only mode, too +- improved emergency shell +- support for compressed kernel modules +- support for loading Xen modules +- rdloaddriver kernel command line parameter +- man pages for dracut-catimages and dracut-gencmdline +- bugfixes + +dracut-003 +========== +- add debian package modules +- add dracut.conf manpage +- add module 90multipath +- add module 01fips +- crypt: ignore devices in /etc/crypttab (root is not in there) + unless rd_NO_CRYPTTAB is specified +- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc +- add multinic support +- add s390 zfcp support +- add s390 dasd support +- add s390 network support +- fixed dracut-gencmdline for root=UUID or LABEL +- do not destroy assembled raid arrays if mdadm.conf present +- mount /dev/shm +- let udevd not resolve group and user names +- moved network from udev to initqueue +- improved debug output: specifying "rdinitdebug" now logs + to dmesg, console and /init.log +- strip kernel modules which have no x bit set +- redirect stdin, stdout, stderr all RW to /dev/console + so the user can use "less" to view /init.log and dmesg +- add new device mapper udev rules and dmeventd +- fixed dracut-gencmdline for root=UUID or LABEL +- do not destroy assembled raid arrays if mdadm.conf present +- mount /dev/shm +- let udevd not resolve group and user names +- preserve timestamps of tools on initramfs generation +- generate symlinks for binaries correctly +- moved network from udev to initqueue +- mount nfs3 with nfsvers=3 option and retry with nfsvers=2 +- fixed nbd initqueue-finished +- improved debug output: specifying "rdinitdebug" now logs + to dmesg, console and /init.log +- strip kernel modules which have no x bit set +- redirect stdin, stdout, stderr all RW to /dev/console + so the user can use "less" to view /init.log and dmesg +- make install of new dm/lvm udev rules optionally +- add new device mapper udev rules and dmeventd +- Fix LiveCD boot regression +- bail out if selinux policy could not be loaded and + selinux=0 not specified on kernel command line +- do not cleanup dmraids +- copy over lvm.conf + +dracut-002 +========== +- add ifname= argument for persistent netdev names +- new /initqueue-finished to check if the main loop can be left +- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf +- plymouth: use plymouth-populate-initrd +- add add_drivers for dracut and dracut.conf +- add modprobe scsi_wait_scan to be sure everything was scanned +- fix for several problems with md raid containers +- fix for selinux policy loading +- fix for mdraid for IMSM +- fix for bug, which prevents installing 61-persistent-storage.rules (bug #520109) +- fix for missing grep for md + +dracut-001 +========== +- better --hostonly checks +- better lvm/mdraid/dmraid handling +- fcoe booting support + Supported cmdline formats: + fcoe=: + fcoe=: + + Note currently only nodcb is supported, the dcb option is reserved for + future use. + + Note letters in the macaddress must be lowercase! + + Examples: + fcoe=eth0:nodcb + fcoe=4A:3F:4C:04:F8:D7:nodcb + +- Syslog support for dracut + This module provides syslog functionality in the initrd. + This is especially interesting when complex configuration being + used to provide access to the device the rootfs resides on. + + +dracut-0.9 +========== +- let plymouth attach to the terminal (nice text output now) +- new kernel command line parameter "rdinfo" show dracut output, even when + "quiet" is specified +- rd_LUKS_UUID is now handled correctly +- dracut-gencmdline: rd_LUKS_UUID and rd_MD_UUID is now correctly generated +- now generates initrd-generic with around 15MB +- smaller bugfixes + +dracut-0.8 +========== +- iSCSI with username and password +- support for live images (dmsquashed live images) +- iscsi_firmware fixes +- smaller images +- bugfixes + +dracut-0.7 +========== +- dracut: strip binaries in initramfs + + --strip + strip binaries in the initramfs (default) + + --nostrip + do not strip binaries in the initramfs +- dracut-catimages + + Usage: ./dracut-catimages [OPTION]... + [...] + Creates initial ramdisk image by concatenating several images from the + command + line and /boot/dracut/ + + -f, --force Overwrite existing initramfs file. + -i, --imagedir Directory with additional images to add + (default: /boot/dracut/) + -o, --overlaydir Overlay directory, which contains files that + will be used to create an additional image + --nooverlay Do not use the overlay directory + --noimagedir Do not use the additional image directory + -h, --help This message + --debug Output debug information of the build process + -v, --verbose Verbose output during the build process + +- s390 dasd support + +dracut-0.6 +========== +- dracut: add --kernel-only and --no-kernel arguments + + --kernel-only + only install kernel drivers and firmware files + + --no-kernel + do not install kernel drivers and firmware files + + All kernel module related install commands moved from "install" + to "installkernel". + + For "--kernel-only" all installkernel scripts of the specified + modules are used, regardless of any checks, so that all modules + which might be needed by any dracut generic image are in. + + The basic idea is to create two images. One image with the kernel + modules and one without. So if the kernel changes, you only have + to replace one image. + + Grub and the kernel can handle multiple images, so grub entry can + look like this: + + title Fedora (2.6.29.5-191.fc11.i586) + root (hd0,0) + kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet + initrd /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img + + initrd-20090722.img + the image provided by the initrd rpm + one old backup version is kept like with the kernel + + initrd-kernel-2.6.29.5-191.fc11.i586.img + the image provided by the kernel rpm + + initrd-config.img + optional image with local configuration files + +- dracut: add --kmoddir directory, where to look for kernel modules + + -k, --kmoddir [DIR] + specify the directory, where to look for kernel modules + + + +dracut-0.5 +========== +- more generic (all plymouth modules, all keyboards, all console fonts) +- more kernel command line parameters (see also man dracut(8)) +- a helper tool, which generates the kernel command line (dracut-gencmdline) +- bridged network boot +- a lot of new command line parameter + +dracut-0.4 +========== +- bugfixes +- firmware loading support +- new internal queue (initqueue) + initqueue now loops until /dev/root exists or root is mounted + + init now has the following points to inject scripts: + + /cmdline/*.sh + scripts for command line parsing + + /pre-udev/*.sh + scripts to run before udev is started + + /pre-trigger/*.sh + scripts to run before the main udev trigger is pulled + + /initqueue/*.sh + runs in parallel to the udev trigger + Udev events can add scripts here with /sbin/initqueue. + If /sbin/initqueue is called with the "--onetime" option, the script + will be removed after it was run. + If /initqueue/work is created and udev >= 143 then this loop can + process the jobs in parallel to the udevtrigger. + If the udev queue is empty and no root device is found or no root + filesystem was mounted, the user will be dropped to a shell after + a timeout. + Scripts can remove themselves from the initqueue by "rm $job". + + /pre-mount/*.sh + scripts to run before the root filesystem is mounted + NFS is an exception, because it has no device node to be created + and mounts in the udev events + + /mount/*.sh + scripts to mount the root filesystem + NFS is an exception, because it has no device node to be created + and mounts in the udev events + If the udev queue is empty and no root device is found or no root + filesystem was mounted, the user will be dropped to a shell after + a timeout. + + /pre-pivot/*.sh + scripts to run before the real init is executed and the initramfs + disappears + All processes started before should be killed here. + + The behaviour of the dmraid module demonstrates how to use the new + mechanism. If it detects a device which is part of a raidmember from a + udev rule, it installs a job to scan for dmraid devices, if the udev + queue is empty. After a scan, it removes itsself from the queue. + + + +dracut-0.3 +========== + +- first public version + diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/README.md b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/README.md new file mode 100644 index 0000000..6347ef6 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/README.md @@ -0,0 +1,55 @@ +dracut +==== + +dracut is an event driven initramfs infrastructure. + +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](.github/CODE_OF_CONDUCT.md) +[![Fedora-32](https://github.com/dracutdevs/dracut/workflows/Fedora-32/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-32) +[![Fedora-33](https://github.com/dracutdevs/dracut/workflows/Fedora-33/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-33) +[![Fedora-latest](https://github.com/dracutdevs/dracut/workflows/Fedora-latest/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-latest) + +dracut (the tool) is used to create an initramfs image by copying tools +and files from an installed system and combining it with the +dracut framework, usually found in /usr/lib/dracut/modules.d. + +Unlike other implementations, dracut hard-codes as little +as possible into the initramfs. The initramfs has +(basically) one purpose in life -- getting the rootfs mounted so that +we can transition to the real rootfs. This is all driven off of +device availability. Therefore, instead of scripts hard-coded to do +various things, we depend on udev to create device nodes for us and +then when we have the rootfs's device node, we mount and carry on. +This helps to keep the time required in the initramfs as little as +possible so that things like a 5 second boot aren't made impossible as +a result of the very existence of an initramfs. + +Most of the initramfs generation functionality in dracut is provided by a bunch +of generator modules that are sourced by the main dracut script to install +specific functionality into the initramfs. They live in the modules.d +subdirectory, and use functionality provided by dracut-functions to do their +work. + +Currently dracut lives on github.com and kernel.org. + +The tarballs can be found here: + http://www.kernel.org/pub/linux/utils/boot/dracut/ + ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/ + +Git: + https://github.com/dracutdevs/dracut.git + http://git.kernel.org/?p=boot/dracut/dracut.git + +Project Documentation: + http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html + +Project Wiki: + http://dracut.wiki.kernel.org + +See the github issue tracker for things which still need to be done and HACKING.md +for some instructions on how to get started. There is also a mailing list +that is being used for the discussion -- initramfs@vger.kernel.org. +It is a typical vger list, send mail to majordomo@vger.kernel.org with body +of 'subscribe initramfs email@host.com' + + +Licensed under the GPLv2 diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/configure b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/configure new file mode 100755 index 0000000..3010cec --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/configure @@ -0,0 +1,131 @@ +#!/bin/bash + +# We don't support srcdir != builddir +echo \#buildapi-variable-no-builddir > /dev/null + +prefix=/usr + +enable_documentation=yes + +CC="${CC:-cc}" +PKG_CONFIG="${PKG_CONFIG:-pkg-config}" + +# Little helper function for reading args from the commandline. +# it automatically handles -a b and -a=b variants, and returns 1 if +# we need to shift $3. +read_arg() { + # $1 = arg name + # $2 = arg value + # $3 = arg parameter + local rematch='^[^=]*=(.*)$' + if [[ $2 =~ $rematch ]]; then + read -r "$1" <<< "${BASH_REMATCH[1]}" + else + read -r "$1" <<< "$3" + # There is no way to shift our callers args, so + # return 1 to indicate they should do it instead. + return 1 + fi + return 0 +} + +while (($# > 0)); do + case "${1%%=*}" in + --prefix) read_arg prefix "$@" || shift ;; + --libdir) read_arg libdir "$@" || shift ;; + --datadir) read_arg datadir "$@" || shift ;; + --sysconfdir) read_arg sysconfdir "$@" || shift ;; + --sbindir) read_arg sbindir "$@" || shift ;; + --mandir) read_arg mandir "$@" || shift ;; + --disable-documentation) enable_documentation=no ;; + --program-prefix) read_arg programprefix "$@" || shift ;; + --exec-prefix) read_arg execprefix "$@" || shift ;; + --bindir) read_arg bindir "$@" || shift ;; + --includedir) read_arg includedir "$@" || shift ;; + --libexecdir) read_arg libexecdir "$@" || shift ;; + --localstatedir) read_arg localstatedir "$@" || shift ;; + --sharedstatedir) read_arg sharedstatedir "$@" || shift ;; + --infodir) read_arg infodir "$@" || shift ;; + --systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift ;; + --bashcompletiondir) read_arg bashcompletiondir "$@" || shift ;; + *) echo "Ignoring unknown option '$1'" ;; + esac + shift +done + +if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then + echo "dracut needs pkg-config and libkmod >= 23." >&2 + exit 1 +fi + +cat << EOF > conftest.c +#include +int main() { + return 0; +} +EOF + +# shellcheck disable=SC2086 +${CC} $CFLAGS $LDFLAGS conftest.c > /dev/null 2>&1 +ret=$? +rm -f conftest.c a.out + +# musl doesn't have fts.h included +if test $ret -ne 0; then + echo "dracut needs fts development files." >&2 + exit 1 +fi + +cat << EOF > conftest.c +#include +int main(void) { + fts_open(0, 0, 0); + return 0; +} +EOF + +found=no +for lib in "-lc" "-lfts"; do + # shellcheck disable=SC2086 + ${CC} $CFLAGS $LDFLAGS conftest.c -Wl,$lib > /dev/null 2>&1 + ret=$? + if test $ret -eq 0; then + FTS_LIBS="$lib" + found=yes + break + fi +done +rm -f conftest.c a.out + +if test $found = no; then + echo "dracut couldn't find usable fts library" >&2 + exit 1 +fi + +cat > Makefile.inc.$$ << EOF +prefix ?= ${prefix} +libdir ?= ${libdir:-${prefix}/lib} +datadir ?= ${datadir:-${prefix}/share} +sysconfdir ?= ${sysconfdir:-${prefix}/etc} +sbindir ?= ${sbindir:-${prefix}/sbin} +mandir ?= ${mandir:-${prefix}/share/man} +enable_documentation ?= ${enable_documentation:-yes} +bindir ?= ${bindir:-${prefix}/bin} +KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ") +KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ") +FTS_LIBS ?= ${FTS_LIBS} +EOF + +{ + [[ $programprefix ]] && echo "programprefix ?= ${programprefix}" + [[ $execprefix ]] && echo "execprefix ?= ${execprefix}" + [[ $includedir ]] && echo "includedir ?= ${includedir}" + [[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}" + [[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}" + [[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}" + [[ $infodir ]] && echo "infodir ?= ${infodir}" + [[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}" + [[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}" +} >> Makefile.inc.$$ + +mv Makefile.inc.$$ Makefile.inc diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/BASH.md b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/BASH.md new file mode 100644 index 0000000..941754e --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/BASH.md @@ -0,0 +1,213 @@ +# BASH Notes + +## basename +Don't use `basename`, use: +```shell + file=${path##*/} +``` + +## dirname +Don't use `dirname`, use: +```shell + dir=${path%/*} +``` + +## shopt +If you set `shopt` in a function, reset to its default state with `trap`: +```shell +func() { + trap "$(shopt -p nullglob globstar)" RETURN + shopt -q -s nullglob globstar +} +``` + +## find, grep, print0, -0, -z + +Don't use `find` in `for` loops, because filenames can contain spaces. +Try to use `globstar` and `nullglob` or null byte terminated strings. + +Instead of: +```shell +func() { + for file in $(find /usr/lib* -type f -name 'lib*.a' -print0 ); do + echo $file + done +} +``` + +use: +```shell +func() { + trap "$(shopt -p nullglob globstar)" RETURN + shopt -q -s nullglob globstar + + for file in /usr/lib*/**/lib*.a; do + [[ -f $file ]] || continue + echo "$file" + done +} +``` + +Or collect the filenames in an array, if you need them more than once: +```shell +func() { + trap "$(shopt -p nullglob globstar)" RETURN + shopt -q -s nullglob globstar + + filenames=( /usr/lib*/**/lib*.a ) + + for file in "${filenames[@]}"; do + [[ -f $file ]] || continue + echo "$file" + done +} +``` + +Or, if you really want to use `find`, use `-print0` and an array: +```shell +func() { + mapfile -t -d '' filenames < <(find /usr/lib* -type f -name 'lib*.a' -print0) + for file in "${filenames[@]}"; do + echo "$file" + done +} +``` + +Note: `-d ''` is the same as `-d $'\0'` and sets the null byte as the delimiter. + +or: +```shell +func() { + find /usr/lib* -type f -name 'lib*.a' -print0 | while read -r -d '' file; do + echo "$file" + done +} +``` + +or +```shell +func() { + while read -r -d '' file; do + echo "$file" + done < <(find /usr/lib* -type f -name 'lib*.a' -print0) +} +``` + +Use the tool options for null terminated strings, like `-print0`, `-0`, `-z`, etc. + +## prefix or suffix array elements + +Instead of: +```shell +func() { + other-cmd $(for k in "$@"; do echo "prefix-$k"; done) +} +``` +do +```shell +func() { + other-cmd "${@/#/prefix-}" +} +``` + +or suffix: +```shell +func() { + other-cmd "${@/%/-suffix}" +} +``` + +## Join array elements with a separator char + +Here we have an associate array `_drivers`, where we want to print the keys separated by ',': +```shell + if [[ ${!_drivers[*]} ]]; then + echo "rd.driver.pre=$(IFS=, ;echo "${!_drivers[*]}")" > "${initdir}"/etc/cmdline.d/00-watchdog.conf + fi +``` + +## Optional parameters to commands + +If you want to call a command `cmd` with an option, if a variable is set, rather than doing: + +```shell +func() { + local param="$1" + + if [[ $param ]]; then + param="--this-special-option $param" + fi + + cmd $param +} +``` + +do it like this: + +```shell +func() { + local param="$1" + + cmd ${param:+--this-special-option "$param"} +} + +# cmd --this-special-option 'abc' +func 'abc' + +# cmd +func '' + +# cmd +func +``` + +If you want to specify the option even with an empty string do this: + +```shell +func() { + local -a special_params + + if [[ ${1+_} ]]; then + # only declare `param` if $1 is set (even as null string) + local param="$1" + fi + + # check if `param` is set (even as null string) + if [[ ${param+_} ]]; then + special_params=( --this-special-option "${param}" ) + fi + + cmd ${param+"${special_params[@]}"} +} + +# cmd --this-special-option 'abc' +func 'abc' + +# cmd --this-special-option '' +func '' + +# cmd +func +``` + +Or more simple, if you only have to set an option: +```shell +func() { + if [[ ${1+_} ]]; then + # only declare `param` if $1 is set (even as null string) + local param="$1" + fi + + cmd ${param+--this-special-option} +} + +# cmd --this-special-option +func 'abc' + +# cmd --this-special-option +func '' + +# cmd +func +``` + diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/CODE_OF_CONDUCT.md b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..50ed173 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,56 @@ +# Dracut Code of Conduct + +This code of conduct outlines our expectations for participants within the Dracut community, as well as steps for reporting unacceptable behavior. +We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. +Anyone who violates this code of conduct may be banned from the community. + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others’ private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement Harald Hoyer . +All complaints will be reviewed and investigated promptly and fairly and will result in a response that is deemed necessary and appropriate to the circumstances. +Project maintainers are obligated to respect the privacy and security of the reporter of any incident. +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. +Translations are available at https://www.contributor-covenant.org/translations. diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/HACKING.md b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/HACKING.md new file mode 100644 index 0000000..d6279a0 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/HACKING.md @@ -0,0 +1,278 @@ +# Dracut Developer Guidelines + +## git + +Currently dracut lives on github.com and kernel.org. + +* https://github.com/dracutdevs/dracut.git +* https://git.kernel.org/pub/scm/boot/dracut/dracut.git + +Pull requests should be filed preferably on github nowadays. + +### Code Format + +It is recommended, that you install a plugin for your editor, which reads in `.editorconfig`. +Additionally `emacs` and `vim` config files are provided for convenience. + +To reformat C files use `astyle`: +```console +$ astyle --options=.astylerc +``` + +For convenience there is also a Makefile `indent-c` target `make indent-c`. + +To reformat shell files use `shfmt`: + +```console +$ shfmt_version=3.2.4 +$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt +$ chmod u+x shfmt +$ ./shfmt -w -s . +``` + +or + +```console +$ GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt +$ $GOPATH/bin/shfmt -w -s . +``` + +or if `shfmt` is already in your `PATH`, use `make indent`. + +Some IDEs already have support for shfmt. + +For convenience the `make indent` Makefile target also calls shfmt, if it is in `$PATH`. + +### Commit Messages + +Commit messages should answer these questions: + +* What?: a short summary of what you changed in the subject line. +* Why?: what the intended outcome of the change is (arguably the most important piece of information that should go into a message). +* How?: if multiple approaches for achieving your goal were available, you also want to explain why you chose the used implementation strategy. + Note that you should not explain how your change achieves your goal in your commit message. + That should be obvious from the code itself. + If you cannot achieve that clarity with the used programming language, use comments within the code instead. + +The commit message is primarily the place for documenting the why. + +Commit message titles should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + +Format is `[optional scope]: `, where `type` is one of: + +* fix: A bug fix +* feat: A new feature +* perf: A code change that improves performance +* refactor: A code change that neither fixes a bug nor adds a feature +* style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) +* test: Adding missing tests or correcting existing tests +* docs: Documentation only changes +* revert: Reverts a previous commit +* chore: Other changes that don't modify src or test files +* build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) +* ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) + +`scope` should be the module name (without numbers) or: + +* cli: for the dracut command line interface +* rt: for the dracut initramfs runtime logic +* functions: for general purpose dracut functions + +Commit messages are checked with [Commisery](https://github.com/tomtom-international/commisery). + +## Writing modules + +Some general rules for writing modules: + +* Use one of the inst family of functions to actually install files + on to the initramfs. They handle mangling the pathnames and (for binaries, + scripts, and kernel modules) installing dependencies as appropriate so + you do not have to. +* Scripts that end up on the initramfs should be POSIX compliant. dracut + will try to use /bin/dash as /bin/sh for the initramfs if it is available, + so you should install it on your system -- dash aims for strict POSIX + compliance to the extent possible. +* Hooks MUST be POSIX compliant -- they are sourced by the init script, + and having a bashism break your user's ability to boot really sucks. +* Generator modules should have a two digit numeric prefix -- they run in + ascending sort order. Anything in the 90-99 range is stuff that dracut + relies on, so try not to break those hooks. +* Hooks must have a .sh extension. +* Generator modules are described in more detail later on. +* We have some breakpoints for debugging your hooks. If you pass 'rdbreak' + as a kernel parameter, the initramfs will drop to a shell just before + switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs + will break just before hooks in that hookpoint run. + +Also, there is an attempt to keep things as distribution-agnostic as +possible. Every distribution has their own tool here and it's not +something which is really interesting to have separate across them. +So contributions to help decrease the distro-dependencies are welcome. + +Most of the functionality that dracut implements are actually implemented +by dracut modules. dracut modules live in modules.d, and have the following +structure: + +``` +dracut_install_dir/modules.d/ + 00modname/ + module-setup.sh + check + +``` + +`00modname`: The name of the module prefixed by a two-digit numeric sort code. + The numeric code must be present and in the range of 00 - 99. + Modules with lower numbers are installed first. This is important + because the dracut install functions (which install files onto + the initrd) refuse to overwrite already installed files. This makes + it easy for an earlier module to override the functionality of a + later module, so that you can have a distro or system specific + module override or modify the functionality of a generic module + without having to patch the more generic module. + +`module-setup.sh`: + dracut sources this script to install the functionality that a + module implements onto the initrd. For the most part, this amounts + to copying files from the host system onto the initrd in a controlled + manner. + +`install()`: + This function of module-setup.sh is called to install all + non-kernel files. dracut supplies several install functions that are + specialized for different file types. Browse through dracut-functions + fore more details. dracut also provides a $moddir variable if you + need to install a file from the module directory, such as an initrd + hook, a udev rule, or a specialized executable. + +`installkernel()`: + This function of module-setup.sh is called to install all + kernel related files. + + +`check()`: + dracut calls this function to check and see if a module can be installed + on the initrd. + + When called without options, check should check to make sure that + any files it needs to install into the initrd from the host system + are present. It should exit with a 0 if they are, and a 1 if they are + not. + + When called with $hostonly set, it should perform the same check + that it would without it set, and it should also check to see if the + functionality the module implements is being used on the host system. + For example, if this module handles installing support for LUKS + encrypted volumes, it should return 0 if all the tools to handle + encrpted volumes are available and the host system has the root + partition on an encrypted volume, 1 otherwise. + +`depends()`: + This function should output a list of dracut modules + that it relies upon. An example would be the nfs and iscsi modules, + which rely on the network module to detect and configure network + interfaces. + +Any other files in the module will not be touched by dracut directly. + +You are encouraged to provide a README that describes what the module is for. + + +### Hooks + +init has the following hook points to inject scripts: + +`/lib/dracut/hooks/cmdline/*.sh` + scripts for command line parsing + +`/lib/dracut/hooks/pre-udev/*.sh` + scripts to run before udev is started + +`/lib/dracut/hooks/pre-trigger/*.sh` + scripts to run before the main udev trigger is pulled + +`/lib/dracut/hooks/initqueue/*.sh` + runs in parallel to the udev trigger + Udev events can add scripts here with /sbin/initqueue. + If /sbin/initqueue is called with the "--onetime" option, the script + will be removed after it was run. + If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then + this loop can process the jobs in parallel to the udevtrigger. + If the udev queue is empty and no root device is found or no root + filesystem was mounted, the user will be dropped to a shell after + a timeout. + Scripts can remove themselves from the initqueue by "rm $job". + +`/lib/dracut/hooks/pre-mount/*.sh` + scripts to run before the root filesystem is mounted + Network filesystems like NFS that do not use device files are an + exception. Root can be mounted already at this point. + +`/lib/dracut/hooks/mount/*.sh` + scripts to mount the root filesystem + If the udev queue is empty and no root device is found or no root + filesystem was mounted, the user will be dropped to a shell after + a timeout. + +`/lib/dracut/hooks/pre-pivot/*.sh` + scripts to run before latter initramfs cleanups + +`/lib/dracut/hooks/cleanup/*.sh` + scripts to run before the real init is executed and the initramfs + disappears + All processes started before should be killed here. + + +## Testsuite + +### Rootless in a container with podman + +```console +$ cd +$ podman pull [CONTAINER] +$ podman run --rm -it \ + --cap-add=SYS_PTRACE --user 0 \ + -v /dev:/dev -v ./:/dracut:z \ + [CONTAINER] \ + bash -l +# cd /dracut +# ./configure +# make -j $(getconf _NPROCESSORS_ONLN) +# cd test +# make V=1 SKIP="16 60 61" clean check +``` + +with `[CONTAINER]` being one of the +[github `dracutdevs` containers](https://github.com/orgs/dracutdevs/packages), +e.g. `ghcr.io/dracutdevs/fedora:latest`. + +### On bare metal + +For the testsuite to pass, you will have to install at least the software packages +mentioned in the `test/container` Dockerfiles. + +``` +$ sudo make clean check +``` + +in verbose mode: +``` +$ sudo make V=1 clean check +``` + +only specific test: +``` +$ sudo make TESTS="01 20 40" clean check +``` +only runs the 01, 20 and 40 tests. + +debug a specific test case: +``` +$ cd TEST-01-BASIC +$ sudo make clean setup run +``` +... change some kernel parameters in `test.sh` ... +``` +$ sudo make run +``` +to run the test without doing the setup. diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.cross b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.cross new file mode 100644 index 0000000..91aa5d0 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.cross @@ -0,0 +1,48 @@ +Dracut supports running against a sysroot directory that is different +from the actual root (/) directory of the running system. It is most +useful for creating/bootstrapping a new system that may or may not be +using the same CPU architecture as the host system, i.e. building a +whole Linux system with a cross-compiler framework like Yocto. + +The user-visible frontend change is the introduction of a new option +called "-r" or "--sysroot". It expects a directory that contains the +complete Linux system that has all the files (kernel drivers, firmware, +executables, libraries and others) necessary to construct the initramfs. + +E.g: dracut --sysroot /path/to/sysroot initramfs.img kernelversion + +To support this, a new global variable was introduced inside dracut. +This variable is called "dracutsysrootdir" and all the files installed +into the initramfs image is searched relative to the sysroot directory. +This variable can also be set externally to dracut without using option +-r/--sysroot. + +There are other details that are necessary to tweak to be able to +run on cross-compiled (a.k.a. foreign) binaries. + +dracut uses these crucial utilities during its operation: + +ldd +=== +It lists dynamic library dependencies for executables or libraries + +ldconfig +======== +It creates /etc/ld.so.cache, i.e. the cached information about libraries +known to the system. + +These utilities the way they exist on the host system only work on +the host system. + +To support cross-compiled binaries, a different ldd variant is needed that +works on those binaries. One such ldd script is found at +https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f + +ldconfig in GLIBC as is does support a sysroot with its -r option. + +Extra environment variables needed to run dracut on the sysroot are +documented in the dracut(8) man page. + +For the Plymouth boot splash to be added to the initramfs image, +this gitlab PR is needed for Plymouth: +https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/72 diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.generic b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.generic new file mode 100644 index 0000000..58889ac --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.generic @@ -0,0 +1,13 @@ +To build a generic initramfs, you have to install the following software packages: + * device-mapper + * cryptsetup-luks + * rpcbind nfs-utils + * lvm2 + * iscsi-initiator-utils + * nbd + * mdadm + * net-tools iproute + +Generic initramfs'es are huge (usually over 10 megs in size uncompressed), but +should be able to automatically boot any bootable configuration with appropriate +boot flags (root device, network configuration information, etc.) \ No newline at end of file diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.kernel b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.kernel new file mode 100644 index 0000000..69751eb --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/README.kernel @@ -0,0 +1,3 @@ +"dracut --kernel-only" is to build an initrd with only kernel modules and firmware files. +"dracut --kernel-only" only executes "installkernel" in the modules subdirectories. + diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/RELEASE.md b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/RELEASE.md new file mode 100644 index 0000000..2e1a73f --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/RELEASE.md @@ -0,0 +1,70 @@ +# Conducting A Successful Release + +This documents contains the necessary steps to conduct a successful release. + +1. Add all items to `NEWS.md` + + Get a first template with [`clog`](https://github.com/clog-tool/clog-cli) + ```console + $ clog -F -r https://github.com/dracutdevs/dracut + ``` + +2. Update the contributors list in NEWS.md + + Produce the list with: + ```console + $ make CONTRIBUTORS + ``` + + Append the list to the section in `NEWS.md` + +3. Update AUTHORS + + ```console + $ make AUTHORS + ``` + +4. Check in AUTHORS and NEWS.md + + ```console + $ git ci -m "docs: update NEWS.md and AUTHORS" NEWS.md AUTHORS + ``` + +5. Tag the release and push + + ```console + $ VERSION=052 + $ git tag -s "$VERSION" + $ git push --tags + ``` + + Add the section from `NEWS.md` to the git tag message. + +6. Push git to kernel.org + + With: + ```console + $ git remote add kernelorg ssh://gitolite@ra.kernel.org/pub/scm/boot/dracut/dracut.git + ``` + + Push to kernel.org git: + ```console + $ git push --atomic kernelorg master "$VERSION" + ``` + + +7. Sign and upload tarballs to kernel.org + + ```console + $ make upload + ``` + + This requires `kup` and a kernel.org account. + Wait until the tarballs are synced to http://www.kernel.org/pub/linux/utils/boot/dracut/ . + +8. Create a new release on github (https://github.com/dracutdevs/dracut/releases/new) + - Add the section from `NEWS.md` to the release. + - Attach the tarballs and signature file from http://www.kernel.org/pub/linux/utils/boot/dracut/ to the github release. + +9. Close the github milestone and open a new one (https://github.com/dracutdevs/dracut/milestones) +10. Ensure that announcement was sent and reached the linux-initramfs mailinglist (https://www.spinics.net/lists/linux-initramfs/) diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/SECURITY.md b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/SECURITY.md new file mode 100644 index 0000000..ea909b5 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/SECURITY.md @@ -0,0 +1,3 @@ +Security is very important to us. If you discover any issue regarding security, we'd appreciate a non-public disclosure of +the information, so please disclose the information responsibly by sending an email to Harald Hoyer harald@redhat.com and not by creating a GitHub issue. +We will respond swiftly to fix verifiable security issues with the disclosure being coordinated with distributions and relevant security teams. diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.css b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.css new file mode 100644 index 0000000..357ede1 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.css @@ -0,0 +1,1120 @@ + + \ No newline at end of file diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.png b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.png new file mode 100644 index 0000000..0d9265e Binary files /dev/null and b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.png differ diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.svg b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.svg new file mode 100644 index 0000000..8025d49 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/docs/dracut.svg @@ -0,0 +1,1701 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-catimages.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-catimages.sh new file mode 100755 index 0000000..b87e000 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-catimages.sh @@ -0,0 +1,150 @@ +#!/bin/bash --norc +# +# Copyright 2009 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +dwarning() { + echo "Warning: $*" >&2 +} + +dinfo() { + [[ $beverbose ]] && echo "$@" >&2 +} + +derror() { + echo "Error: $*" >&2 +} + +usage() { + # 80x25 linebreak here ^ + cat << EOF +Usage: $0 [OPTION]... [...] +Creates initial ramdisk image by concatenating several images from the command +line and /boot/dracut/ + + -f, --force Overwrite existing initramfs file. + -i, --imagedir Directory with additional images to add + (default: /boot/dracut/) + -o, --overlaydir Overlay directory, which contains files that + will be used to create an additional image + --nooverlay Do not use the overlay directory + --noimagedir Do not use the additional image directory + -h, --help This message + --debug Output debug information of the build process + -v, --verbose Verbose output during the build process +EOF +} + +imagedir=/boot/dracut/ +overlay=/var/lib/dracut/overlay + +while (($# > 0)); do + case $1 in + -f | --force) force=yes ;; + -i | --imagedir) + imagedir=$2 + shift + ;; + -o | --overlaydir) + overlay=$2 + shift + ;; + --nooverlay) + no_overlay=yes + shift + ;; + --noimagedir) + no_imagedir=yes + shift + ;; + -h | --help) + usage + exit 1 + ;; + --debug) export debug="yes" ;; + -v | --verbose) beverbose="yes" ;; + -*) + printf "\nUnknown option: %s\n\n" "$1" >&2 + usage + exit 1 + ;; + *) break ;; + esac + shift +done + +outfile=$1 +shift + +if [[ -z $outfile ]]; then + derror "No output file specified." + usage + exit 1 +fi + +baseimage=$1 +shift + +if [[ -z $baseimage ]]; then + derror "No base image specified." + usage + exit 1 +fi + +if [[ -f $outfile && ! $force ]]; then + derror "Will not override existing initramfs ($outfile) without --force" + exit 1 +fi + +if [[ ! $no_imagedir && ! -d $imagedir ]]; then + derror "Image directory $overlay is not a directory" + exit 1 +fi + +if [[ ! $no_overlay && ! -d $overlay ]]; then + derror "Overlay $overlay is not a directory" + exit 1 +fi + +if [[ ! $no_overlay ]]; then + ofile="$imagedir/90-overlay.img" + dinfo "Creating image $ofile from directory $overlay" + type pigz &> /dev/null && gzip=pigz || gzip=gzip + ( + cd "$overlay" || return 1 + find . | cpio --quiet -H newc -o | $gzip -9 > "$ofile" + ) +fi + +if [[ ! $no_imagedir ]]; then + for i in "$imagedir/"*.img; do + [[ -f $i ]] && images+=("$i") + done +fi + +images+=("$@") + +dinfo "Using base image $baseimage" +cat -- "$baseimage" > "$outfile" + +for i in "${images[@]}"; do + dinfo "Appending $i" + cat -- "$i" >> "$outfile" +done + +dinfo "Created $outfile" + +exit 0 diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-functions.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-functions.sh new file mode 100755 index 0000000..5206bd2 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-functions.sh @@ -0,0 +1,928 @@ +#!/bin/bash +# +# functions used by dracut and other tools. +# +# Copyright 2005-2009 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +export LC_MESSAGES=C + +# is_func +# Check whether $1 is a function. +is_func() { + [[ "$(type -t "$1")" == "function" ]] +} + +# Generic substring function. If $2 is in $1, return 0. +strstr() { [[ $1 == *"$2"* ]]; } +# Generic glob matching function. If glob pattern $2 matches anywhere in $1, OK +strglobin() { [[ $1 == *$2* ]]; } +# Generic glob matching function. If glob pattern $2 matches all of $1, OK +# shellcheck disable=SC2053 +strglob() { [[ $1 == $2 ]]; } +# returns OK if $1 contains literal string $2 at the beginning, and isn't empty +str_starts() { [ "${1#"$2"*}" != "$1" ]; } +# returns OK if $1 contains literal string $2 at the end, and isn't empty +str_ends() { [ "${1%*"$2"}" != "$1" ]; } + +# find a binary. If we were not passed the full path directly, +# search in the usual places to find the binary. +find_binary() { + local _delim + local _path + local l + local p + [[ -z ${1##/*} ]] || _delim="/" + + if [[ $1 == *.so* ]]; then + # shellcheck disable=SC2154 + for l in $libdirs; do + _path="${l}${_delim}${1}" + if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &> /dev/null; }; then + printf "%s\n" "${_path}" + return 0 + fi + done + _path="${_delim}${1}" + if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &> /dev/null; }; then + printf "%s\n" "${_path}" + return 0 + fi + fi + if [[ $1 == */* ]]; then + _path="${_delim}${1}" + if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then + printf "%s\n" "${_path}" + return 0 + fi + fi + for p in $DRACUT_PATH; do + _path="${p}${_delim}${1}" + if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then + printf "%s\n" "${_path}" + return 0 + fi + done + + [[ -n $dracutsysrootdir ]] && return 1 + type -P "${1##*/}" +} + +ldconfig_paths() { + $DRACUT_LDCONFIG ${dracutsysrootdir:+-r ${dracutsysrootdir} -f /etc/ld.so.conf} -pN 2> /dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq +} + +# Version comparision function. Assumes Linux style version scheme. +# $1 = version a +# $2 = comparision op (gt, ge, eq, le, lt, ne) +# $3 = version b +vercmp() { + local _n1 + read -r -a _n1 <<< "${1//./ }" + local _op=$2 + local _n2 + read -r -a _n2 <<< "${3//./ }" + local _i _res + + for ((_i = 0; ; _i++)); do + if [[ ! ${_n1[_i]}${_n2[_i]} ]]; then + _res=0 + elif ((${_n1[_i]:-0} > ${_n2[_i]:-0})); then + _res=1 + elif ((${_n1[_i]:-0} < ${_n2[_i]:-0})); then + _res=2 + else + continue + fi + break + done + + case $_op in + gt) ((_res == 1)) ;; + ge) ((_res != 2)) ;; + eq) ((_res == 0)) ;; + le) ((_res != 1)) ;; + lt) ((_res == 2)) ;; + ne) ((_res != 0)) ;; + esac +} + +# Create all subdirectories for given path without creating the last element. +# $1 = path +mksubdirs() { + # shellcheck disable=SC2174 + [[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}" +} + +# Function prints global variables in format name=value line by line. +# $@ = list of global variables' name +print_vars() { + local _var _value + + for _var in "$@"; do + eval printf -v _value "%s" \""\$$_var"\" + [[ ${_value} ]] && printf '%s="%s"\n' "$_var" "$_value" + done +} + +# normalize_path +# Prints the normalized path, where it removes any duplicated +# and trailing slashes. +# Example: +# $ normalize_path ///test/test// +# /test/test +normalize_path() { + # shellcheck disable=SC2064 + trap "$(shopt -p extglob)" RETURN + shopt -q -s extglob + local p=${1//+(\/)//} + printf "%s\n" "${p%/}" +} + +# convert_abs_rel +# Prints the relative path, when creating a symlink to from . +# Example: +# $ convert_abs_rel /usr/bin/test /bin/test-2 +# ../../bin/test-2 +# $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test +convert_abs_rel() { + local __current __absolute __abssize __cursize __newpath + local -i __i __level + + set -- "$(normalize_path "$1")" "$(normalize_path "$2")" + + # corner case #1 - self looping link + [[ $1 == "$2" ]] && { + printf "%s\n" "${1##*/}" + return + } + + # corner case #2 - own dir link + [[ ${1%/*} == "$2" ]] && { + printf ".\n" + return + } + + IFS=/ read -r -a __current <<< "$1" + IFS=/ read -r -a __absolute <<< "$2" + + __abssize=${#__absolute[@]} + __cursize=${#__current[@]} + + while [[ ${__absolute[__level]} == "${__current[__level]}" ]]; do + ((__level++)) + if ((__level > __abssize || __level > __cursize)); then + break + fi + done + + for ((__i = __level; __i < __cursize - 1; __i++)); do + if ((__i > __level)); then + __newpath=$__newpath"/" + fi + __newpath=$__newpath".." + done + + for ((__i = __level; __i < __abssize; __i++)); do + if [[ -n $__newpath ]]; then + __newpath=$__newpath"/" + fi + __newpath=$__newpath${__absolute[__i]} + done + + printf -- "%s\n" "$__newpath" +} + +# get_fs_env +# Get and the ID_FS_TYPE variable from udev for a device. +# Example: +# $ get_fs_env /dev/sda2 +# ext4 +get_fs_env() { + [[ $1 ]] || return + unset ID_FS_TYPE + ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \ + | while read -r line || [ -n "$line" ]; do + if [[ $line == "TYPE="* ]]; then + printf "%s" "${line#TYPE=}" + exit 0 + fi + done) + if [[ $ID_FS_TYPE ]]; then + printf "%s" "$ID_FS_TYPE" + return 0 + fi + return 1 +} + +# get_maj_min +# Prints the major and minor of a device node. +# Example: +# $ get_maj_min /dev/sda2 +# 8:2 +get_maj_min() { + local _majmin + local _out + + if [[ $get_maj_min_cache_file ]]; then + _out="$(grep -m1 -oP "^$1 \K\S+$" "$get_maj_min_cache_file")" + fi + + if ! [[ "$_out" ]]; then + _majmin="$(stat -L -c '%t:%T' "$1" 2> /dev/null)" + _out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")" + if [[ $get_maj_min_cache_file ]]; then + echo "$1 $_out" >> "$get_maj_min_cache_file" + fi + fi + echo -n "$_out" +} + +# get_devpath_block +# get the DEVPATH in /sys of a block device +get_devpath_block() { + local _majmin _i + _majmin=$(get_maj_min "$1") + + for _i in /sys/block/*/dev /sys/block/*/*/dev; do + [[ -e $_i ]] || continue + if [[ $_majmin == "$(< "$_i")" ]]; then + printf "%s" "${_i%/dev}" + return 0 + fi + done + return 1 +} + +# get a persistent path from a device +get_persistent_dev() { + local i _tmp _dev _pol + + _dev=$(get_maj_min "$1") + [ -z "$_dev" ] && return + + if [[ -n $persistent_policy ]]; then + _pol="/dev/disk/${persistent_policy}/*" + else + _pol= + fi + + for i in \ + $_pol \ + /dev/mapper/* \ + /dev/disk/by-uuid/* \ + /dev/disk/by-label/* \ + /dev/disk/by-partuuid/* \ + /dev/disk/by-partlabel/* \ + /dev/disk/by-id/* \ + /dev/disk/by-path/*; do + [[ -e $i ]] || continue + [[ $i == /dev/mapper/control ]] && continue + [[ $i == /dev/mapper/mpath* ]] && continue + _tmp=$(get_maj_min "$i") + if [ "$_tmp" = "$_dev" ]; then + printf -- "%s" "$i" + return + fi + done + printf -- "%s" "$1" +} + +expand_persistent_dev() { + local _dev=$1 + + case "$_dev" in + LABEL=*) + _dev="/dev/disk/by-label/${_dev#LABEL=}" + ;; + UUID=*) + _dev="${_dev#UUID=}" + _dev="${_dev,,}" + _dev="/dev/disk/by-uuid/${_dev}" + ;; + PARTUUID=*) + _dev="${_dev#PARTUUID=}" + _dev="${_dev,,}" + _dev="/dev/disk/by-partuuid/${_dev}" + ;; + PARTLABEL=*) + _dev="/dev/disk/by-partlabel/${_dev#PARTLABEL=}" + ;; + esac + printf "%s" "$_dev" +} + +shorten_persistent_dev() { + local _dev="$1" + case "$_dev" in + /dev/disk/by-uuid/*) + printf "%s" "UUID=${_dev##*/}" + ;; + /dev/disk/by-label/*) + printf "%s" "LABEL=${_dev##*/}" + ;; + /dev/disk/by-partuuid/*) + printf "%s" "PARTUUID=${_dev##*/}" + ;; + /dev/disk/by-partlabel/*) + printf "%s" "PARTLABEL=${_dev##*/}" + ;; + *) + printf "%s" "$_dev" + ;; + esac +} + +# find_block_device +# Prints the major and minor number of the block device +# for a given mountpoint. +# Unless $use_fstab is set to "yes" the functions +# uses /proc/self/mountinfo as the primary source of the +# information and only falls back to /etc/fstab, if the mountpoint +# is not found there. +# Example: +# $ find_block_device /usr +# 8:4 +find_block_device() { + local _dev _majmin _find_mpt + _find_mpt="$1" + + if [[ $use_fstab != yes ]]; then + [[ -d $_find_mpt/. ]] + findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { + while read -r _majmin _dev || [ -n "$_dev" ]; do + if [[ -b $_dev ]]; then + if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then + _majmin=$(get_maj_min "$_dev") + fi + if [[ $_majmin ]]; then + printf "%s\n" "$_majmin" + else + printf "%s\n" "$_dev" + fi + return 0 + fi + if [[ $_dev == *:* ]]; then + printf "%s\n" "$_dev" + return 0 + fi + done + return 1 + } && return 0 + fi + # fall back to /etc/fstab + + findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { + while read -r _majmin _dev || [ -n "$_dev" ]; do + if ! [[ $_dev ]]; then + _dev="$_majmin" + unset _majmin + fi + if [[ -b $_dev ]]; then + [[ $_majmin ]] || _majmin=$(get_maj_min "$_dev") + if [[ $_majmin ]]; then + printf "%s\n" "$_majmin" + else + printf "%s\n" "$_dev" + fi + return 0 + fi + if [[ $_dev == *:* ]]; then + printf "%s\n" "$_dev" + return 0 + fi + done + return 1 + } && return 0 + + return 1 +} + +# find_mp_fstype +# Echo the filesystem type for a given mountpoint. +# /proc/self/mountinfo is taken as the primary source of information +# and /etc/fstab is used as a fallback. +# No newline is appended! +# Example: +# $ find_mp_fstype /;echo +# ext4 +find_mp_fstype() { + local _fs + + if [[ $use_fstab != yes ]]; then + findmnt -e -v -n -o 'FSTYPE' --target "$1" | { + while read -r _fs || [ -n "$_fs" ]; do + [[ $_fs ]] || continue + [[ $_fs == "autofs" ]] && continue + printf "%s" "$_fs" + return 0 + done + return 1 + } && return 0 + fi + + findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { + while read -r _fs || [ -n "$_fs" ]; do + [[ $_fs ]] || continue + [[ $_fs == "autofs" ]] && continue + printf "%s" "$_fs" + return 0 + done + return 1 + } && return 0 + + return 1 +} + +# find_dev_fstype +# Echo the filesystem type for a given device. +# /proc/self/mountinfo is taken as the primary source of information +# and /etc/fstab is used as a fallback. +# No newline is appended! +# Example: +# $ find_dev_fstype /dev/sda2;echo +# ext4 +find_dev_fstype() { + local _find_dev _fs + _find_dev="$1" + if ! [[ $_find_dev == /dev* ]]; then + [[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev" + fi + + if [[ $use_fstab != yes ]]; then + findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { + while read -r _fs || [ -n "$_fs" ]; do + [[ $_fs ]] || continue + [[ $_fs == "autofs" ]] && continue + printf "%s" "$_fs" + return 0 + done + return 1 + } && return 0 + fi + + findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { + while read -r _fs || [ -n "$_fs" ]; do + [[ $_fs ]] || continue + [[ $_fs == "autofs" ]] && continue + printf "%s" "$_fs" + return 0 + done + return 1 + } && return 0 + + return 1 +} + +# find_mp_fsopts +# Echo the filesystem options for a given mountpoint. +# /proc/self/mountinfo is taken as the primary source of information +# and /etc/fstab is used as a fallback. +# No newline is appended! +# Example: +# $ find_mp_fsopts /;echo +# rw,relatime,discard,data=ordered +find_mp_fsopts() { + if [[ $use_fstab != yes ]]; then + findmnt -e -v -n -o 'OPTIONS' --target "$1" 2> /dev/null && return 0 + fi + + findmnt --fstab -e -v -n -o 'OPTIONS' --target "$1" +} + +# find_dev_fsopts +# Echo the filesystem options for a given device. +# /proc/self/mountinfo is taken as the primary source of information +# and /etc/fstab is used as a fallback. +# if `use_fstab == yes`, then only `/etc/fstab` is used. +# +# Example: +# $ find_dev_fsopts /dev/sda2 +# rw,relatime,discard,data=ordered +find_dev_fsopts() { + local _find_dev + _find_dev="$1" + if ! [[ $_find_dev == /dev* ]]; then + [[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev" + fi + + if [[ $use_fstab != yes ]]; then + findmnt -e -v -n -o 'OPTIONS' --source "$_find_dev" 2> /dev/null && return 0 + fi + + findmnt --fstab -e -v -n -o 'OPTIONS' --source "$_find_dev" +} + +# finds the major:minor of the block device backing the root filesystem. +find_root_block_device() { find_block_device /; } + +# for_each_host_dev_fs +# Execute " " for every " " pair found +# in ${host_fs_types[@]} +for_each_host_dev_fs() { + local _func="$1" + local _dev + local _ret=1 + + [[ "${#host_fs_types[@]}" ]] || return 2 + + for _dev in "${!host_fs_types[@]}"; do + $_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0 + done + return $_ret +} + +host_fs_all() { + printf "%s\n" "${host_fs_types[@]}" +} + +# Walk all the slave relationships for a given block device. +# Stop when our helper function returns success +# $1 = function to call on every found block device +# $2 = block device in major:minor format +check_block_and_slaves() { + local _x + [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. + if ! lvm_internal_dev "$2"; then "$1" "$2" && return; fi + check_vol_slaves "$@" && return 0 + if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then + check_block_and_slaves "$1" "$(< "/sys/dev/block/$2/../dev")" && return 0 + fi + for _x in /sys/dev/block/"$2"/slaves/*; do + [[ -f $_x/dev ]] || continue + [[ $_x/subsystem -ef /sys/class/block ]] || continue + check_block_and_slaves "$1" "$(< "$_x/dev")" && return 0 + done + return 1 +} + +check_block_and_slaves_all() { + local _x _ret=1 + [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. + if ! lvm_internal_dev "$2" && "$1" "$2"; then + _ret=0 + fi + check_vol_slaves_all "$@" && return 0 + if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then + check_block_and_slaves_all "$1" "$(< "/sys/dev/block/$2/../dev")" && _ret=0 + fi + for _x in /sys/dev/block/"$2"/slaves/*; do + [[ -f $_x/dev ]] || continue + [[ $_x/subsystem -ef /sys/class/block ]] || continue + check_block_and_slaves_all "$1" "$(< "$_x/dev")" && _ret=0 + done + return $_ret +} +# for_each_host_dev_and_slaves +# Execute " " for every "" found +# in ${host_devs[@]} and their slaves +for_each_host_dev_and_slaves_all() { + local _func="$1" + local _dev + local _ret=1 + + [[ "${host_devs[*]}" ]] || return 2 + + for _dev in "${host_devs[@]}"; do + [[ -b $_dev ]] || continue + if check_block_and_slaves_all "$_func" "$(get_maj_min "$_dev")"; then + _ret=0 + fi + done + return $_ret +} + +for_each_host_dev_and_slaves() { + local _func="$1" + local _dev + + [[ "${host_devs[*]}" ]] || return 2 + + for _dev in "${host_devs[@]}"; do + [[ -b $_dev ]] || continue + check_block_and_slaves "$_func" "$(get_maj_min "$_dev")" && return 0 + done + return 1 +} + +# ugly workaround for the lvm design +# There is no volume group device, +# so, there are no slave devices for volume groups. +# Logical volumes only have the slave devices they really live on, +# but you cannot create the logical volume without the volume group. +# And the volume group might be bigger than the devices the LV needs. +check_vol_slaves() { + local _vg _pv _dm _majmin + _majmin="$2" + _dm=/sys/dev/block/$_majmin/dm + [[ -f $_dm/uuid && $(< "$_dm"/uuid) =~ LVM-* ]] || return 1 + _vg=$(dmsetup splitname --noheadings -o vg_name "$(< "$_dm/name")") + # strip space + _vg="${_vg//[[:space:]]/}" + if [[ $_vg ]]; then + for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2> /dev/null); do + check_block_and_slaves "$1" "$(get_maj_min "$_pv")" && return 0 + done + fi + return 1 +} + +check_vol_slaves_all() { + local _vg _pv _majmin + _majmin="$2" + _dm="/sys/dev/block/$_majmin/dm" + [[ -f $_dm/uuid && $(< "$_dm"/uuid) =~ LVM-* ]] || return 1 + _vg=$(dmsetup splitname --noheadings -o vg_name "$(< "$_dm/name")") + # strip space + _vg="${_vg//[[:space:]]/}" + if [[ $_vg ]]; then + # when filter/global_filter is set, lvm may be failed + if ! lvm lvs --noheadings -o vg_name "$_vg" 2> /dev/null 1> /dev/null; then + return 1 + fi + + for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2> /dev/null); do + check_block_and_slaves_all "$1" "$(get_maj_min "$_pv")" + done + return 0 + fi + return 1 +} + +# fs_get_option +# search for a specific option in a bunch of filesystem options +# and return the value +fs_get_option() { + local _fsopts=$1 + local _option=$2 + local OLDIFS="$IFS" + IFS=, + # shellcheck disable=SC2086 + set -- $_fsopts + IFS="$OLDIFS" + while [ $# -gt 0 ]; do + case $1 in + $_option=*) + echo "${1#${_option}=}" + break + ;; + esac + shift + done +} + +check_kernel_config() { + local _config_opt="$1" + local _config_file + [[ -f $dracutsysrootdir/boot/config-$kernel ]] \ + && _config_file="/boot/config-$kernel" + [[ -f $dracutsysrootdir/lib/modules/$kernel/config ]] \ + && _config_file="/lib/modules/$kernel/config" + + # no kernel config file, so return true + [[ $_config_file ]] || return 0 + + grep -q -F "${_config_opt}=" "$dracutsysrootdir$_config_file" && return 0 + return 1 +} + +# 0 if the kernel module is either built-in or available +# 1 if the kernel module is not enabled +check_kernel_module() { + modprobe -S "$kernel" --dry-run "$1" &> /dev/null || return 1 +} + +# get_cpu_vendor +# Only two values are returned: AMD or Intel +get_cpu_vendor() { + if grep -qE AMD /proc/cpuinfo; then + printf "AMD" + fi + if grep -qE Intel /proc/cpuinfo; then + printf "Intel" + fi +} + +# get_host_ucode +# Get the hosts' ucode file based on the /proc/cpuinfo +get_ucode_file() { + local family + local model + local stepping + family=$(grep -E "cpu family" /proc/cpuinfo | head -1 | sed "s/.*:\ //") + model=$(grep -E "model" /proc/cpuinfo | grep -v name | head -1 | sed "s/.*:\ //") + stepping=$(grep -E "stepping" /proc/cpuinfo | head -1 | sed "s/.*:\ //") + + if [[ "$(get_cpu_vendor)" == "AMD" ]]; then + if [[ $family -ge 21 ]]; then + printf "microcode_amd_fam%xh.bin" "$family" + else + printf "microcode_amd.bin" + fi + fi + if [[ "$(get_cpu_vendor)" == "Intel" ]]; then + # The /proc/cpuinfo are in decimal. + printf "%02x-%02x-%02x" "${family}" "${model}" "${stepping}" + fi +} + +# Not every device in /dev/mapper should be examined. +# If it is an LVM device, touch only devices which have /dev/VG/LV symlink. +lvm_internal_dev() { + local dev_dm_dir=/sys/dev/block/$1/dm + [[ ! -f $dev_dm_dir/uuid || $(< "$dev_dm_dir"/uuid) != LVM-* ]] && return 1 # Not an LVM device + local DM_VG_NAME DM_LV_NAME DM_LV_LAYER + eval "$(dmsetup splitname --nameprefixes --noheadings --rows "$(< "$dev_dm_dir"/name)" 2> /dev/null)" + [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 0 # Better skip this! + [[ ${DM_LV_LAYER} ]] || [[ ! -L /dev/${DM_VG_NAME}/${DM_LV_NAME} ]] +} + +btrfs_devs() { + local _mp="$1" + btrfs device usage "$_mp" \ + | while read -r _dev _; do + str_starts "$_dev" "/" || continue + _dev=${_dev%,} + printf -- "%s\n" "$_dev" + done +} + +iface_for_remote_addr() { + # shellcheck disable=SC2046 + set -- $(ip -o route get to "$1") + echo "$3" +} + +local_addr_for_remote_addr() { + # shellcheck disable=SC2046 + set -- $(ip -o route get to "$1") + echo "$5" +} + +peer_for_addr() { + local addr=$1 + local qtd + + # quote periods in IPv4 address + qtd=${addr//./\\.} + ip -o addr show \ + | sed -n 's%^.* '"$qtd"' peer \([0-9a-f.:]\{1,\}\(/[0-9]*\)\?\).*$%\1%p' +} + +netmask_for_addr() { + local addr=$1 + local qtd + + # quote periods in IPv4 address + qtd=${addr//./\\.} + ip -o addr show | sed -n 's,^.* '"$qtd"'/\([0-9]*\) .*$,\1,p' +} + +gateway_for_iface() { + local ifname=$1 addr=$2 + + case $addr in + *.*) proto=4 ;; + *:*) proto=6 ;; + *) return ;; + esac + ip -o -$proto route show \ + | sed -n "s/^default via \([0-9a-z.:]\{1,\}\) dev $ifname .*\$/\1/p" +} + +# This works only for ifcfg-style network configuration! +bootproto_for_iface() { + local ifname=$1 + local dir + + # follow ifcfg settings for boot protocol + for dir in network-scripts network; do + [ -f "/etc/sysconfig/$dir/ifcfg-$ifname" ] && { + sed -n "s/BOOTPROTO=[\"']\?\([[:alnum:]]\{1,\}\)[\"']\?.*\$/\1/p" \ + "/etc/sysconfig/$dir/ifcfg-$ifname" + return + } + done +} + +is_unbracketed_ipv6_address() { + strglob "$1" '*:*' && ! strglob "$1" '\[*:*\]' +} + +# Create an ip= string to set up networking such that the given +# remote address can be reached +ip_params_for_remote_addr() { + local remote_addr=$1 + local ifname local_addr peer netmask gateway ifmac + + [[ $remote_addr ]] || return 1 + ifname=$(iface_for_remote_addr "$remote_addr") + [[ $ifname ]] || { + berror "failed to determine interface to connect to $remote_addr" + return 1 + } + + # ifname clause to bind the interface name to a MAC address + if [ -d "/sys/class/net/$ifname/bonding" ]; then + dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline." + elif [ -e "/sys/class/net/$ifname/address" ]; then + ifmac=$(cat "/sys/class/net/$ifname/address") + [[ $ifmac ]] && printf 'ifname=%s:%s ' "${ifname}" "${ifmac}" + fi + + bootproto=$(bootproto_for_iface "$ifname") + case $bootproto in + dhcp | dhcp6 | auto6) ;; + dhcp4) + bootproto=dhcp + ;; + static* | "") + bootproto= + ;; + *) + derror "bootproto \"$bootproto\" is unsupported by dracut, trying static configuration" + bootproto= + ;; + esac + if [[ $bootproto ]]; then + printf 'ip=%s:%s ' "${ifname}" "${bootproto}" + else + local_addr=$(local_addr_for_remote_addr "$remote_addr") + [[ $local_addr ]] || { + berror "failed to determine local address to connect to $remote_addr" + return 1 + } + peer=$(peer_for_addr "$local_addr") + # Set peer or netmask, but not both + [[ $peer ]] || netmask=$(netmask_for_addr "$local_addr") + gateway=$(gateway_for_iface "$ifname" "$local_addr") + # Quote IPv6 addresses with brackets + is_unbracketed_ipv6_address "$local_addr" && local_addr="[$local_addr]" + is_unbracketed_ipv6_address "$peer" && peer="[$peer]" + is_unbracketed_ipv6_address "$gateway" && gateway="[$gateway]" + printf 'ip=%s:%s:%s:%s::%s:none ' \ + "${local_addr}" "${peer}" "${gateway}" "${netmask}" "${ifname}" + fi + +} + +# block_is_nbd +# Check whether $1 is an nbd device +block_is_nbd() { + [[ -b /dev/block/$1 && $1 == 43:* ]] +} + +# block_is_iscsi +# Check whether $1 is an nbd device +block_is_iscsi() { + local _dir + local _dev=$1 + [[ -L "/sys/dev/block/$_dev" ]] || return + _dir="$(readlink -f "/sys/dev/block/$_dev")" || return + until [[ -d "$_dir/sys" || -d "$_dir/iscsi_session" ]]; do + _dir="$_dir/.." + done + [[ -d "$_dir/iscsi_session" ]] +} + +# block_is_fcoe +# Check whether $1 is an FCoE device +# Will not work for HBAs that hide the ethernet aspect +# completely and present a pure FC device +block_is_fcoe() { + local _dir + local _dev=$1 + [[ -L "/sys/dev/block/$_dev" ]] || return + _dir="$(readlink -f "/sys/dev/block/$_dev")" + until [[ -d "$_dir/sys" ]]; do + _dir="$_dir/.." + if [[ -d "$_dir/subsystem" ]]; then + subsystem=$(basename "$(readlink "$_dir"/subsystem)") + [[ $subsystem == "fcoe" ]] && return 0 + fi + done + return 1 +} + +# block_is_netdevice +# Check whether $1 is a net device +block_is_netdevice() { + block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1" +} + +# get the corresponding kernel modules of a /sys/class/*/* or/dev/* device +get_dev_module() { + udevadm info -a "$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p' +} diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-init.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-init.sh new file mode 100644 index 0000000..b6e3714 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-init.sh @@ -0,0 +1,1110 @@ +#!/bin/bash +# +# functions used only by dracut and dracut modules +# +# Copyright 2005-2009 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +export LC_MESSAGES=C + +if [[ $EUID == "0" ]] && ! [[ $DRACUT_NO_XATTR ]]; then + export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr" +else + export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,links -dfr" +fi + +# is_func +# Check whether $1 is a function. +is_func() { + [[ "$(type -t "$1")" == "function" ]] +} + +if ! [[ $dracutbasedir ]]; then + dracutbasedir=${BASH_SOURCE[0]%/*} + [[ $dracutbasedir == dracut-functions* ]] && dracutbasedir="." + [[ $dracutbasedir ]] || dracutbasedir="." + dracutbasedir="$(readlink -f $dracutbasedir)" +fi + +if ! is_func dinfo > /dev/null 2>&1; then + # shellcheck source=./dracut-logger.sh + . "$dracutbasedir/dracut-logger.sh" + dlog_init +fi + +# shellcheck disable=SC2154 +if ! [[ $initdir ]]; then + dfatal "initdir not set" + exit 1 +fi + +if ! [[ -d $initdir ]]; then + mkdir -p "$initdir" +fi + +if ! [[ $kernel ]]; then + kernel=$(uname -r) + export kernel +fi + +# shellcheck disable=SC2154 +srcmods="$dracutsysrootdir/lib/modules/$kernel/" + +# shellcheck disable=SC2154 +[[ $drivers_dir ]] && { + if ! command -v kmod &> /dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then + dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.' + exit 1 + fi + srcmods="$drivers_dir" +} +export srcmods + +[[ $DRACUT_FIRMWARE_PATH ]] || export DRACUT_FIRMWARE_PATH="/lib/firmware/updates:/lib/firmware:/lib/firmware/$kernel" + +# export standard hookdirs +[[ $hookdirs ]] || { + hookdirs="cmdline pre-udev pre-trigger netroot " + hookdirs+="initqueue initqueue/settled initqueue/online initqueue/finished initqueue/timeout " + hookdirs+="pre-mount pre-pivot cleanup mount " + hookdirs+="emergency shutdown-emergency pre-shutdown shutdown " + export hookdirs +} + +DRACUT_LDD=${DRACUT_LDD:-ldd} +DRACUT_TESTBIN=${DRACUT_TESTBIN:-/bin/sh} +DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig} + +# shellcheck source=./dracut-functions.sh +. "$dracutbasedir"/dracut-functions.sh + +# Detect lib paths +if ! [[ $libdirs ]]; then + if [[ $("$DRACUT_LDD" "$dracutsysrootdir$DRACUT_TESTBIN") == */lib64/* ]] &> /dev/null \ + && [[ -d $dracutsysrootdir/lib64 ]]; then + libdirs+=" /lib64" + [[ -d $dracutsysrootdir/usr/lib64 ]] && libdirs+=" /usr/lib64" + else + libdirs+=" /lib" + [[ -d $dracutsysrootdir/usr/lib ]] && libdirs+=" /usr/lib" + fi + + libdirs+=" $(ldconfig_paths)" + + export libdirs +fi + +# helper function for check() in module-setup.sh +# to check for required installed binaries +# issues a standardized warning message +require_binaries() { + # shellcheck disable=SC2154 + local _module_name="${moddir##*/}" + local _ret=0 + + if [[ $1 == "-m" ]]; then + _module_name="$2" + shift 2 + fi + + for cmd in "$@"; do + if ! find_binary "$cmd" &> /dev/null; then + dinfo "dracut module '${_module_name#[0-9][0-9]}' will not be installed, because command '$cmd' could not be found!" + ((_ret++)) + fi + done + return "$_ret" +} + +require_any_binary() { + local _module_name="${moddir##*/}" + local _ret=1 + + if [[ $1 == "-m" ]]; then + _module_name="$2" + shift 2 + fi + + for cmd in "$@"; do + if find_binary "$cmd" &> /dev/null; then + _ret=0 + break + fi + done + + if ((_ret != 0)); then + dinfo "$_module_name: Could not find any command of '$*'!" + return 1 + fi + + return 0 +} + +dracut_need_initqueue() { + : > "$initdir/lib/dracut/need-initqueue" +} + +dracut_module_included() { + # shellcheck disable=SC2154 + [[ " $mods_to_load $modules_loaded " == *\ $*\ * ]] +} + +dracut_no_switch_root() { + : > "$initdir/lib/dracut/no-switch-root" +} + +dracut_module_path() { + local _dir + + # shellcheck disable=SC2231 + for _dir in "${dracutbasedir}"/modules.d/??${1}; do + echo "$_dir" + return 0 + done + return 1 +} + +if ! [[ $DRACUT_INSTALL ]]; then + DRACUT_INSTALL=$(find_binary dracut-install) +fi + +if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then + DRACUT_INSTALL=$dracutbasedir/dracut-install +elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then + DRACUT_INSTALL=$dracutbasedir/install/dracut-install +fi + +# Test if dracut-install is a standalone executable with no options. +# E.g. DRACUT_INSTALL may be set externally as: +# DRACUT_INSTALL="valgrind dracut-install" +# or +# DRACUT_INSTALL="dracut-install --debug" +# in which case the string cannot be tested for being executable. +DRINSTALLPARTS=0 +for i in $DRACUT_INSTALL; do + DRINSTALLPARTS=$((DRINSTALLPARTS + 1)) +done + +if [[ $DRINSTALLPARTS == 1 ]] && ! command -v "$DRACUT_INSTALL" > /dev/null 2>&1; then + dfatal "dracut-install not found!" + exit 10 +fi + +if [[ $hostonly == "-h" ]]; then + if ! [[ $DRACUT_KERNEL_MODALIASES ]] || ! [[ -f $DRACUT_KERNEL_MODALIASES ]]; then + export DRACUT_KERNEL_MODALIASES="${DRACUT_TMPDIR}/modaliases" + "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_MODALIASES" + fi +fi + +[[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1 +inst_dir() { + [[ -e ${initdir}/"$1" ]] && return 0 # already there + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"; then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@" + fi +} + +inst() { + local _hostonly_install + if [[ $1 == "-H" ]]; then + _hostonly_install="-H" + shift + fi + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + # shellcheck disable=SC2154 + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" + fi +} + +inst_simple() { + local _hostonly_install + if [[ $1 == "-H" ]]; then + _hostonly_install="-H" + shift + fi + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + [[ -e $1 ]] || return 1 # no source + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"; then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || : + fi +} + +inst_symlink() { + local _hostonly_install + if [[ $1 == "-H" ]]; then + _hostonly_install="-H" + shift + fi + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + [[ -L $1 ]] || return 1 + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || : + fi +} + +inst_multiple() { + local _ret + if "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then + return 0 + else + _ret=$? + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || : + return $_ret + fi +} + +dracut_install() { + inst_multiple "$@" +} + +dracut_instmods() { + local _silent=0 + local i + # shellcheck disable=SC2154 + [[ $no_kernel == yes ]] && return + for i in "$@"; do + [[ $i == "--silent" ]] && _silent=1 + done + + # shellcheck disable=SC2154 + if ! "$DRACUT_INSTALL" \ + ${dracutsysrootdir:+-r "$dracutsysrootdir"} \ + ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@"; then + if ((_silent == 0)); then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || : + fi + fi +} + +inst_library() { + local _hostonly_install + if [[ $1 == "-H" ]]; then + _hostonly_install="-H" + shift + fi + [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there + [[ -e $1 ]] || return 1 # no source + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || : + fi +} + +inst_binary() { + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || : + fi +} + +inst_script() { + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || : + fi +} + +inst_fsck_help() { + local _helper="/run/dracut/fsck/fsck_help_$1.txt" + if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper"; then + derror "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper" || : + fi +} + +# Use with form hostonly="$(optional_hostonly)" inst_xxxx +# If hosotnly mode is set to "strict", hostonly restrictions will still +# be applied, else will ignore hostonly mode and try to install all +# given modules. +optional_hostonly() { + # shellcheck disable=SC2154 + if [[ $hostonly_mode == "strict" ]]; then + printf -- "%s" "$hostonly" + else + printf "" + fi +} + +mark_hostonly() { + for i in "$@"; do + echo "$i" >> "$initdir/lib/dracut/hostonly-files" + done +} + +# find symlinks linked to given library file +# $1 = library file +# Function searches for symlinks by stripping version numbers appended to +# library filename, checks if it points to the same target and finally +# prints the list of symlinks to stdout. +# +# Example: +# rev_lib_symlinks libfoo.so.8.1 +# output: libfoo.so.8 libfoo.so +# (Only if libfoo.so.8 and libfoo.so exists on host system.) +rev_lib_symlinks() { + local _fn + local _orig + local _links + + [[ ! $1 ]] && return 0 + + _fn="$1" + _orig="$(readlink -f "$1")" + _links=() + + [[ ${_fn} == *.so.* ]] || return 1 + + until [[ ${_fn##*.} == so ]]; do + _fn="${_fn%.*}" + [[ -L ${_fn} ]] && [[ $(readlink -f "${_fn}") == "${_orig}" ]] && _links+=("${_fn}") + done + + echo "${_links[*]}}" +} + +# attempt to install any programs specified in a udev rule +inst_rule_programs() { + local _prog _bin + + # shellcheck disable=SC2013 + for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p' "$1"); do + _bin="" + # shellcheck disable=SC2154 + if [[ -x ${udevdir}/$_prog ]]; then + _bin="${udevdir}"/$_prog + elif [[ ${_prog/\$env\{/} == "$_prog" ]]; then + _bin=$(find_binary "$_prog") || { + dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found" + continue + } + fi + + [[ $_bin ]] && inst_binary "$_bin" + done + + # shellcheck disable=SC2013 + for _prog in $(sed -nr 's/.*RUN[+=]=?"([^ "]+).*/\1/p' "$1"); do + _bin="" + if [[ -x ${udevdir}/$_prog ]]; then + _bin=${udevdir}/$_prog + elif [[ ${_prog/\$env\{/} == "$_prog" ]] && [[ ${_prog} != "/sbin/initqueue" ]]; then + _bin=$(find_binary "$_prog") || { + dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found" + continue + } + fi + + [[ $_bin ]] && inst_binary "$_bin" + done + + # shellcheck disable=SC2013 + for _prog in $(sed -nr 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/p' "$1"); do + _bin="" + if [[ -x ${udevdir}/$_prog ]]; then + _bin=${udevdir}/$_prog + elif [[ ${_prog/\$env\{/} == "$_prog" ]]; then + _bin=$(find_binary "$_prog") || { + dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found" + continue + } + fi + + [[ $_bin ]] && dracut_install "$_bin" + done +} + +# attempt to install any programs specified in a udev rule +inst_rule_group_owner() { + local i + + # shellcheck disable=SC2013 + for i in $(sed -nr 's/.*OWNER=?"([^ "]+).*/\1/p' "$1"); do + if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2> /dev/null; then + grep -E "^$i:" "$dracutsysrootdir"/etc/passwd 2> /dev/null >> "$initdir/etc/passwd" + fi + done + + # shellcheck disable=SC2013 + for i in $(sed -nr 's/.*GROUP=?"([^ "]+).*/\1/p' "$1"); do + if ! grep -Eq "^$i:" "$initdir/etc/group" 2> /dev/null; then + grep -E "^$i:" "$dracutsysrootdir"/etc/group 2> /dev/null >> "$initdir/etc/group" + fi + done +} + +inst_rule_initqueue() { + if grep -q -F initqueue "$1"; then + dracut_need_initqueue + fi +} + +# udev rules always get installed in the same place, so +# create a function to install them to make life simpler. +inst_rules() { + local _target=/etc/udev/rules.d _rule _found + + inst_dir "${udevdir}/rules.d" + inst_dir "$_target" + for _rule in "$@"; do + if [ "${_rule#/}" = "$_rule" ]; then + for r in "$dracutsysrootdir${udevdir}/rules.d" ${hostonly:+"$dracutsysrootdir"/etc/udev/rules.d}; do + [[ -e $r/$_rule ]] || continue + _found="$r/$_rule" + inst_rule_programs "$_found" + inst_rule_group_owner "$_found" + inst_rule_initqueue "$_found" + inst_simple "$_found" + done + fi + for r in '' "$dracutsysrootdir$dracutbasedir/rules.d/"; do + # skip rules without an absolute path + [[ "${r}$_rule" != /* ]] && continue + [[ -f ${r}$_rule ]] || continue + _found="${r}$_rule" + inst_rule_programs "$_found" + inst_rule_group_owner "$_found" + inst_rule_initqueue "$_found" + inst_simple "$_found" "$_target/${_found##*/}" + done + [[ $_found ]] || dinfo "Skipping udev rule: $_rule" + done +} + +inst_rules_wildcard() { + local _target=/etc/udev/rules.d _rule _found + + inst_dir "${udevdir}/rules.d" + inst_dir "$_target" + for _rule in ${udevdir}/rules.d/$1 ${dracutbasedir}/rules.d/$1; do + [[ -e $_rule ]] || continue + inst_rule_programs "$_rule" + inst_rule_group_owner "$_rule" + inst_rule_initqueue "$_rule" + inst_simple "$_rule" + _found=$_rule + done + if [[ -n ${hostonly} ]]; then + for _rule in ${_target}/$1; do + [[ -f $_rule ]] || continue + inst_rule_programs "$_rule" + inst_rule_group_owner "$_rule" + inst_rule_initqueue "$_rule" + inst_simple "$_rule" + _found=$_rule + done + fi + [[ $_found ]] || dinfo "Skipping udev rule: $_rule" +} + +prepare_udev_rules() { + if [ -z "$UDEVVERSION" ]; then + UDEVVERSION=$(udevadm --version) + export UDEVVERSION + fi + + if [ -z "$UDEVVERSION" ]; then + derror "Failed to detect udev version!" + return 1 + fi + if [ -z "${UDEVVERSION##*[!0-9]*}" ]; then + derror "udevadm --version did not report an integer, udev version cannot be determined!" + return 1 + fi + + for f in "$@"; do + f="${initdir}/etc/udev/rules.d/$f" + [ -e "$f" ] || continue + while read -r line || [ -n "$line" ]; do + if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then + if ((UDEVVERSION >= 174)); then + printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}" + else + printf '%sIMPORT{program}="path_id %%p"\n' "${line%%IMPORT PATH_ID}" + fi + elif [ "${line%%IMPORT BLKID}" != "$line" ]; then + if ((UDEVVERSION >= 176)); then + printf '%sIMPORT{builtin}="blkid"\n' "${line%%IMPORT BLKID}" + else + # shellcheck disable=SC2016 + printf '%sIMPORT{program}="/sbin/blkid -o udev -p $tempnode"\n' "${line%%IMPORT BLKID}" + fi + else + echo "$line" + fi + done < "${f}" > "${f}.new" + mv "${f}.new" "$f" + done +} + +# install function specialized for hooks +# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook +# All hooks should be POSIX/SuS compliant, they will be sourced by init. +inst_hook() { + local hook + if ! [[ -f $3 ]]; then + dfatal "Cannot install a hook ($3) that does not exist." + dfatal "Aborting initrd creation." + exit 1 + elif ! [[ $hookdirs == *$1* ]]; then + dfatal "No such hook type $1. Aborting initrd creation." + exit 1 + fi + hook="/lib/dracut/hooks/${1}/${2}-${3##*/}" + inst_simple "$3" "$hook" + chmod u+x "$initdir/$hook" +} + +# install any of listed files +# +# If first argument is '-d' and second some destination path, first accessible +# source is installed into this path, otherwise it will installed in the same +# path as source. If none of listed files was installed, function return 1. +# On first successful installation it returns with 0 status. +# +# Example: +# +# inst_any -d /bin/foo /bin/bar /bin/baz +# +# Lets assume that /bin/baz exists, so it will be installed as /bin/foo in +# initramfs. +inst_any() { + local to f + + [[ $1 == '-d' ]] && to="$2" && shift 2 + + for f in "$@"; do + [[ -e $f ]] || continue + [[ $to ]] && inst "$f" "$to" && return 0 + inst "$f" && return 0 + done + + return 1 +} + +# inst_libdir_file [-n ] [...] +# Install a located on a lib directory to the initramfs image +# -n install matching files +inst_libdir_file() { + local -a _files + if [[ $1 == "-n" ]]; then + local _pattern=$2 + shift 2 + for _dir in $libdirs; do + for _i in "$@"; do + for _f in "$dracutsysrootdir$_dir"/$_i; do + [[ ${_f#$dracutsysrootdir} =~ $_pattern ]] || continue + [[ -e $_f ]] && _files+=("${_f#$dracutsysrootdir}") + done + done + done + else + for _dir in $libdirs; do + for _i in "$@"; do + for _f in "$dracutsysrootdir$_dir"/$_i; do + [[ -e $_f ]] && _files+=("${_f#$dracutsysrootdir}") + done + done + done + fi + [[ ${#_files[@]} -gt 0 ]] && inst_multiple "${_files[@]}" +} + +# get a command to decompress the given file +get_decompress_cmd() { + case "$1" in + *.gz) echo 'gzip -f -d' ;; + *.bz2) echo 'bzip2 -d' ;; + *.xz) echo 'xz -f -d' ;; + *.zst) echo 'zstd -f -d ' ;; + esac +} + +# install function decompressing the target and handling symlinks +# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files +# +# Function install targets in the same paths inside overlay but decompressed +# and without extensions (.gz, .bz2). +inst_decompress() { + local _src _cmd + + for _src in "$@"; do + _cmd=$(get_decompress_cmd "${_src}") + [[ -z ${_cmd} ]] && return 1 + inst_simple "${_src}" + # Decompress with chosen tool. We assume that tool changes name e.g. + # from 'name.gz' to 'name'. + ${_cmd} "${initdir}${_src}" + done +} + +# It's similar to above, but if file is not compressed, performs standard +# install. +# $@ = list of files +inst_opt_decompress() { + local _src + + for _src in "$@"; do + inst_decompress "${_src}" || inst "${_src}" + done +} + +# module_check [] [] +# execute the check() function of module-setup.sh of +# or the "check" script, if module-setup.sh is not found +# "check $hostonly" is called +module_check() { + local _moddir=$3 + local _ret + local _forced=0 + local _hostonly=$hostonly + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + [ $# -eq 2 ] && _forced=$2 + [[ -d $_moddir ]] || return 1 + if [[ ! -f $_moddir/module-setup.sh ]]; then + # if we do not have a check script, we are unconditionally included + [[ -x $_moddir/check ]] || return 0 + [[ $_forced != 0 ]] && unset hostonly + # don't quote $hostonly to leave argument empty + # shellcheck disable=SC2086 + "$_moddir"/check $hostonly + _ret=$? + else + unset check depends cmdline install installkernel + check() { true; } + # shellcheck disable=SC1090 + . "$_moddir"/module-setup.sh + is_func check || return 0 + [[ $_forced != 0 ]] && unset hostonly + # don't quote $hostonly to leave argument empty + # shellcheck disable=SC2086 + moddir="$_moddir" check $hostonly + _ret=$? + unset check depends cmdline install installkernel + fi + hostonly=$_hostonly + return $_ret +} + +# module_check_mount [] +# execute the check() function of module-setup.sh of +# or the "check" script, if module-setup.sh is not found +# "mount_needs=1 check 0" is called +module_check_mount() { + local _moddir=$2 + local _ret + export mount_needs=1 + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + [[ -d $_moddir ]] || return 1 + if [[ ! -f $_moddir/module-setup.sh ]]; then + # if we do not have a check script, we are unconditionally included + [[ -x $_moddir/check ]] || return 0 + mount_needs=1 "$_moddir"/check 0 + _ret=$? + else + unset check depends cmdline install installkernel + check() { false; } + # shellcheck disable=SC1090 + . "$_moddir"/module-setup.sh + moddir=$_moddir check 0 + _ret=$? + unset check depends cmdline install installkernel + fi + unset mount_needs + return "$_ret" +} + +# module_depends [] +# execute the depends() function of module-setup.sh of +# or the "depends" script, if module-setup.sh is not found +module_depends() { + local _moddir=$2 + local _ret + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + [[ -d $_moddir ]] || return 1 + if [[ ! -f $_moddir/module-setup.sh ]]; then + # if we do not have a check script, we have no deps + [[ -x $_moddir/check ]] || return 0 + "$_moddir"/check -d + return $? + else + unset check depends cmdline install installkernel + depends() { true; } + # shellcheck disable=SC1090 + . "$_moddir"/module-setup.sh + moddir=$_moddir depends + _ret=$? + unset check depends cmdline install installkernel + return $_ret + fi +} + +# module_cmdline [] +# execute the cmdline() function of module-setup.sh of +# or the "cmdline" script, if module-setup.sh is not found +module_cmdline() { + local _moddir=$2 + local _ret + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + [[ -d $_moddir ]] || return 1 + if [[ ! -f $_moddir/module-setup.sh ]]; then + # shellcheck disable=SC1090 + [[ -x $_moddir/cmdline ]] && . "$_moddir/cmdline" + return $? + else + unset check depends cmdline install installkernel + cmdline() { true; } + # shellcheck disable=SC1090 + . "$_moddir"/module-setup.sh + moddir="$_moddir" cmdline + _ret=$? + unset check depends cmdline install installkernel + return $_ret + fi +} + +# module_install [] +# execute the install() function of module-setup.sh of +# or the "install" script, if module-setup.sh is not found +module_install() { + local _moddir=$2 + local _ret + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + [[ -d $_moddir ]] || return 1 + if [[ ! -f $_moddir/module-setup.sh ]]; then + # shellcheck disable=SC1090 + [[ -x $_moddir/install ]] && . "$_moddir/install" + return $? + else + unset check depends cmdline install installkernel + install() { true; } + # shellcheck disable=SC1090 + . "$_moddir"/module-setup.sh + moddir="$_moddir" install + _ret=$? + unset check depends cmdline install installkernel + return $_ret + fi +} + +# module_installkernel [] +# execute the installkernel() function of module-setup.sh of +# or the "installkernel" script, if module-setup.sh is not found +module_installkernel() { + local _moddir=$2 + local _ret + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + [[ -d $_moddir ]] || return 1 + if [[ ! -f $_moddir/module-setup.sh ]]; then + # shellcheck disable=SC1090 + [[ -x $_moddir/installkernel ]] && . "$_moddir/installkernel" + return $? + else + unset check depends cmdline install installkernel + installkernel() { true; } + # shellcheck disable=SC1090 + . "$_moddir"/module-setup.sh + moddir="$_moddir" installkernel + _ret=$? + unset check depends cmdline install installkernel + return $_ret + fi +} + +# check_mount [] [] +# check_mount checks, if a dracut module is needed for the given +# device and filesystem types in "${host_fs_types[@]}" +check_mount() { + local _mod=$1 + local _moddir=$3 + local _ret + local _moddep + + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + # shellcheck disable=SC2154 + [ "${#host_fs_types[@]}" -le 0 ] && return 1 + + # If we are already scheduled to be loaded, no need to check again. + [[ " $mods_to_load " == *\ $_mod\ * ]] && return 0 + [[ " $mods_checked_as_dep " == *\ $_mod\ * ]] && return 1 + + # This should never happen, but... + [[ -d $_moddir ]] || return 1 + + [[ $2 ]] || mods_checked_as_dep+=" $_mod " + + # shellcheck disable=SC2154 + if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then + return 1 + fi + + if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then + module_check_mount "$_mod" "$_moddir" + ret=$? + + # explicit module, so also accept ret=255 + [[ $ret == 0 || $ret == 255 ]] || return 1 + else + # module not in our list + if [[ $dracutmodules == all ]]; then + # check, if we can and should install this module + module_check_mount "$_mod" "$_moddir" || return 1 + else + # skip this module + return 1 + fi + fi + + for _moddep in $(module_depends "$_mod" "$_moddir"); do + # handle deps as if they were manually added + [[ " $dracutmodules " == *\ $_mod\ * ]] \ + && [[ " $dracutmodules " != *\ $_moddep\ * ]] \ + && dracutmodules+=" $_moddep " + [[ " $add_dracutmodules " == *\ $_mod\ * ]] \ + && [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \ + && add_dracutmodules+=" $_moddep " + [[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \ + && [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \ + && force_add_dracutmodules+=" $_moddep " + # if a module we depend on fail, fail also + if ! check_module "$_moddep"; then + derror "dracut module '$_mod' depends on '$_moddep', which can't be installed" + return 1 + fi + done + + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + + return 0 +} + +# check_module [] [] +# check if a dracut module is to be used in the initramfs process +# if is set, then the process also keeps track +# that the modules were checked for the dependency tracking process +check_module() { + local _mod=$1 + local _moddir=$3 + local _ret + local _moddep + + [[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1") + # If we are already scheduled to be loaded, no need to check again. + [[ " $mods_to_load " == *\ $_mod\ * ]] && return 0 + [[ " $mods_checked_as_dep " == *\ $_mod\ * ]] && return 1 + + # This should never happen, but... + [[ -d $_moddir ]] || return 1 + + [[ $2 ]] || mods_checked_as_dep+=" $_mod " + + if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then + ddebug "dracut module '$_mod' will not be installed, because it's in the list to be omitted!" + return 1 + fi + + if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then + if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then + module_check "$_mod" 1 "$_moddir" + ret=$? + else + module_check "$_mod" 0 "$_moddir" + ret=$? + fi + # explicit module, so also accept ret=255 + [[ $ret == 0 || $ret == 255 ]] || return 1 + else + # module not in our list + if [[ $dracutmodules == all ]]; then + # check, if we can and should install this module + module_check "$_mod" 0 "$_moddir" + ret=$? + if [[ $ret != 0 ]]; then + [[ $2 ]] && return 1 + [[ $ret != 255 ]] && return 1 + fi + else + # skip this module + return 1 + fi + fi + + for _moddep in $(module_depends "$_mod" "$_moddir"); do + # handle deps as if they were manually added + [[ " $dracutmodules " == *\ $_mod\ * ]] \ + && [[ " $dracutmodules " != *\ $_moddep\ * ]] \ + && dracutmodules+=" $_moddep " + [[ " $add_dracutmodules " == *\ $_mod\ * ]] \ + && [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \ + && add_dracutmodules+=" $_moddep " + [[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \ + && [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \ + && force_add_dracutmodules+=" $_moddep " + # if a module we depend on fail, fail also + if ! check_module "$_moddep"; then + derror "dracut module '$_mod' depends on '$_moddep', which can't be installed" + return 1 + fi + done + + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + + return 0 +} + +# for_each_module_dir +# execute " 1 " +for_each_module_dir() { + local _modcheck + local _mod + local _moddir + local _func + _func=$1 + for _moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do + [[ -d $_moddir ]] || continue + [[ -e $_moddir/install || -e $_moddir/installkernel || -e \ + $_moddir/module-setup.sh ]] || continue + _mod=${_moddir##*/} + _mod=${_mod#[0-9][0-9]} + $_func "$_mod" 1 "$_moddir" + done + + # Report any missing dracut modules, the user has specified + _modcheck="$add_dracutmodules $force_add_dracutmodules" + [[ $dracutmodules != all ]] && _modcheck="$_modcheck $dracutmodules" + for _mod in $_modcheck; do + [[ " $mods_to_load " == *\ $_mod\ * ]] && continue + + [[ " $force_add_dracutmodules " != *\ $_mod\ * ]] \ + && [[ " $dracutmodules " != *\ $_mod\ * ]] \ + && [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \ + && continue + + derror "dracut module '$_mod' cannot be found or installed." + [[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1 + [[ " $dracutmodules " == *\ $_mod\ * ]] && exit 1 + [[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1 + done +} + +dracut_kernel_post() { + for _f in modules.builtin modules.builtin.alias modules.builtin.modinfo modules.order; do + [[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" + done + + # generate module dependencies for the initrd + if [[ -d $initdir/lib/modules/$kernel ]] \ + && ! depmod -a -b "$initdir" "$kernel"; then + dfatal "\"depmod -a $kernel\" failed." + exit 1 + fi + +} + +instmods() { + # instmods [-c [-s]] [ ... ] + # instmods [-c [-s]] + # install kernel modules along with all their dependencies. + # can be e.g. "=block" or "=drivers/usb/storage" + # -c check + # -s silent + local _optional="-o" + local _silent + local _ret + + [[ $no_kernel == yes ]] && return + + if [[ $1 == '-c' ]]; then + unset _optional + shift + fi + if [[ $1 == '-s' ]]; then + _silent=1 + shift + fi + + if (($# == 0)); then + read -r -d '' -a args + set -- "${args[@]}" + fi + + if (($# == 0)); then + return 0 + fi + + "$DRACUT_INSTALL" \ + ${initdir:+-D "$initdir"} \ + ${dracutsysrootdir:+-r "$dracutsysrootdir"} \ + ${loginstall:+-L "$loginstall"} \ + ${hostonly:+-H} \ + ${omit_drivers:+-N "$omit_drivers"} \ + ${srcmods:+--kerneldir "$srcmods"} \ + ${_optional:+-o} \ + ${_silent:+--silent} \ + -m "$@" + _ret=$? + + if ((_ret != 0)) && [[ -z $_silent ]]; then + derror "FAILED: " \ + "$DRACUT_INSTALL" \ + ${initdir:+-D "$initdir"} \ + ${dracutsysrootdir:+-r "$dracutsysrootdir"} \ + ${loginstall:+-L "$loginstall"} \ + ${hostonly:+-H} \ + ${omit_drivers:+-N "$omit_drivers"} \ + ${srcmods:+--kerneldir "$srcmods"} \ + ${_optional:+-o} \ + ${_silent:+--silent} \ + -m "$@" + fi + + [[ "$optional" ]] && return 0 + return $_ret +} + +if [[ "$(ln --help)" == *--relative* ]]; then + ln_r() { + ln -sfnr "${initdir}/$1" "${initdir}/$2" + } +else + ln_r() { + local _source=$1 + local _dest=$2 + [[ -d ${_dest%/*} ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} + ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}" + } +fi + +is_qemu_virtualized() { + # 0 if a virt environment was detected + # 1 if a virt environment could not be detected + # 255 if any error was encountered + if type -P systemd-detect-virt > /dev/null 2>&1; then + if ! vm=$(systemd-detect-virt --vm > /dev/null 2>&1); then + return 255 + fi + [[ $vm == "qemu" ]] && return 0 + [[ $vm == "kvm" ]] && return 0 + [[ $vm == "bochs" ]] && return 0 + fi + + for i in /sys/class/dmi/id/*_vendor; do + [[ -f $i ]] || continue + read -r vendor < "$i" + [[ $vendor == "QEMU" ]] && return 0 + [[ $vendor == "Red Hat" ]] && return 0 + [[ $vendor == "Bochs" ]] && return 0 + done + return 1 +} diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-initramfs-restore.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-initramfs-restore.sh new file mode 100644 index 0000000..abe6b1e --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-initramfs-restore.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +set -e + +# do some sanity checks first +[ -e /run/initramfs/bin/sh ] && exit 0 +[ -e /run/initramfs/.need_shutdown ] || exit 0 + +KERNEL_VERSION="$(uname -r)" + +[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut +SKIP="$dracutbasedir/skipcpio" +[[ -x $SKIP ]] || SKIP="cat" + +[[ -f /etc/machine-id ]] && read -r MACHINE_ID < /etc/machine-id + +mount -o ro /boot &> /dev/null || true + +if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \ + && [[ $MACHINE_ID ]] \ + && [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]]; then + IMG="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd" +elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \ + && [[ $MACHINE_ID ]] \ + && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]]; then + IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" +elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then + IMG="/boot/initramfs-${KERNEL_VERSION}.img" +elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then + IMG="/lib/modules/${KERNEL_VERSION}/initrd" +else + echo "No initramfs image found to restore!" + exit 1 +fi + +cd /run/initramfs + +if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet > /dev/null; then + rm -f -- .need_shutdown +elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet > /dev/null; then + rm -f -- .need_shutdown +elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null; then + rm -f -- .need_shutdown +elif $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null; then + rm -f -- .need_shutdown +else + # something failed, so we clean up + echo "Unpacking of $IMG to /run/initramfs failed" >&2 + rm -f -- /run/initramfs/shutdown + exit 1 +fi + +if [[ -d squash ]]; then + if ! unsquashfs -no-xattrs -f -d . squash-root.img > /dev/null; then + echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2 + rm -f -- /run/initramfs/shutdown + exit 1 + fi +fi + +if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ]; then + . /etc/selinux/config + /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null +fi + +exit 0 diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-install b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-install new file mode 120000 index 0000000..51dc305 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-install @@ -0,0 +1 @@ +src/install/dracut-install \ No newline at end of file diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-logger.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-logger.sh new file mode 100755 index 0000000..0738928 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-logger.sh @@ -0,0 +1,455 @@ +#!/bin/bash +# +# logging faciality module for dracut both at build- and boot-time +# +# Copyright 2010 Amadeusz Żołnowski +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +export __DRACUT_LOGGER__=1 + +## @brief Logging facility module for dracut both at build- and boot-time. +# +# @section intro Introduction +# +# The logger takes a bit from Log4j philosophy. There are defined 6 logging +# levels: +# - TRACE (6) +# The TRACE Level designates finer-grained informational events than the +# DEBUG. +# - DEBUG (5) +# The DEBUG Level designates fine-grained informational events that are most +# useful to debug an application. +# - INFO (4) +# The INFO level designates informational messages that highlight the +# progress of the application at coarse-grained level. +# - WARN (3) +# The WARN level designates potentially harmful situations. +# - ERROR (2) +# The ERROR level designates error events that might still allow the +# application to continue running. +# - FATAL (1) +# The FATAL level designates very severe error events that will presumably +# lead the application to abort. +# Descriptions are borrowed from Log4j documentation: +# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html +# +# @section usage Usage +# +# First of all you have to start with dlog_init() function which initializes +# required variables. Don't call any other logging function before that one! +# If you're ready with this, you can use following functions which corresponds +# clearly to levels listed in @ref intro Introduction. Here they are: +# - dtrace() +# - ddebug() +# - dinfo() +# - dwarn() +# - derror() +# - dfatal() +# They take all arguments given as a single message to be logged. See dlog() +# function for details how it works. Note that you shouldn't use dlog() by +# yourself. It's wrapped with above functions. +# +# @see dlog_init() dlog() +# +# @section conf Configuration +# +# Logging is controlled by following global variables: +# - @var stdloglvl - logging level to standard error (console output) +# - @var sysloglvl - logging level to syslog (by logger command) +# - @var fileloglvl - logging level to file +# - @var kmsgloglvl - logging level to /dev/kmsg (only for boot-time) +# - @var logfile - log file which is used when @var fileloglvl is higher +# than 0 +# and two global variables: @var maxloglvl and @var syslogfacility which must +# not be overwritten. Both are set by dlog_init(). @var maxloglvl holds +# maximum logging level of those three and indicates that dlog_init() was run. +# @var syslogfacility is set either to 'user' (when building initramfs) or +# 'daemon' (when booting). +# +# Logging level set by the variable means that messages from this logging level +# and above (FATAL is the highest) will be shown. Logging levels may be set +# independently for each destination (stderr, syslog, file, kmsg). +# +# @see dlog_init() + +## @brief Initializes dracut Logger. +# +# @retval 1 if something has gone wrong +# @retval 0 on success. +# +# @note This function need to be called before any other from this file. +# +# If any of the variables is not set, this function set it to default: +# - @var stdloglvl = 4 (info) +# - @var sysloglvl = 0 (no logging) +# - @var fileloglvl is set to 4 when @var logfile is set too, otherwise it's +# - @var kmsgloglvl = 0 (no logging) +# set to 0 +# +# @warning Function sets global variables @var maxloglvl and @syslogfacility. +# See file doc comment for details. +dlog_init() { + local __oldumask + local ret=0 + local errmsg + [ -z "$stdloglvl" ] && stdloglvl=4 + [ -z "$sysloglvl" ] && sysloglvl=0 + [ -z "$kmsgloglvl" ] && kmsgloglvl=0 + # Skip initialization if it's already done. + [ -n "$maxloglvl" ] && return 0 + + if [ -z "$fileloglvl" ]; then + [ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0 + elif ((fileloglvl > 0)); then + if [[ $logfile ]]; then + __oldumask=$(umask) + umask 0377 + ! [ -e "$logfile" ] && : > "$logfile" + umask "$__oldumask" + if [[ -w $logfile ]] && [[ -f $logfile ]]; then + # Mark new run in the log file + echo >> "$logfile" + if command -v date > /dev/null; then + echo "=== $(date) ===" >> "$logfile" + else + echo "===============================================" >> "$logfile" + fi + echo >> "$logfile" + else + # We cannot log to file, so turn this facility off. + fileloglvl=0 + ret=1 + errmsg="'$logfile' is not a writable file" + fi + fi + fi + + if ((UID != 0)); then + kmsgloglvl=0 + sysloglvl=0 + fi + + if ((sysloglvl > 0)); then + if [[ -d /run/systemd/journal ]] \ + && type -P systemd-cat &> /dev/null \ + && systemctl --quiet is-active systemd-journald.socket &> /dev/null \ + && { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &> /dev/null; }; then + readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat" + mkfifo "$_systemdcatfile" + readonly _dlogfd=15 + systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" & + exec 15> "$_systemdcatfile" + elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then + # We cannot log to syslog, so turn this facility off. + kmsgloglvl=$sysloglvl + sysloglvl=0 + ret=1 + errmsg="No '/dev/log' or 'logger' included for syslog logging" + fi + fi + + if ((sysloglvl > 0)) || ((kmsgloglvl > 0)); then + if [ -n "$dracutbasedir" ]; then + readonly syslogfacility=user + else + readonly syslogfacility=daemon + fi + export syslogfacility + fi + + local lvl + local maxloglvl_l=0 + for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do + ((lvl > maxloglvl_l)) && maxloglvl_l=$lvl + done + readonly maxloglvl=$maxloglvl_l + export maxloglvl + + if ((stdloglvl < 6)) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then + unset dtrace + dtrace() { :; } + fi + + if ((stdloglvl < 5)) && ((kmsgloglvl < 5)) && ((fileloglvl < 5)) && ((sysloglvl < 5)); then + unset ddebug + ddebug() { :; } + fi + + if ((stdloglvl < 4)) && ((kmsgloglvl < 4)) && ((fileloglvl < 4)) && ((sysloglvl < 4)); then + unset dinfo + dinfo() { :; } + fi + + if ((stdloglvl < 3)) && ((kmsgloglvl < 3)) && ((fileloglvl < 3)) && ((sysloglvl < 3)); then + unset dwarn + dwarn() { :; } + unset dwarning + dwarning() { :; } + fi + + if ((stdloglvl < 2)) && ((kmsgloglvl < 2)) && ((fileloglvl < 2)) && ((sysloglvl < 2)); then + unset derror + derror() { :; } + fi + + if ((stdloglvl < 1)) && ((kmsgloglvl < 1)) && ((fileloglvl < 1)) && ((sysloglvl < 1)); then + unset dfatal + dfatal() { :; } + fi + + [ -n "$errmsg" ] && derror "$errmsg" + + return $ret +} + +## @brief Converts numeric logging level to the first letter of level name. +# +# @param lvl Numeric logging level in range from 1 to 6. +# @retval 1 if @a lvl is out of range. +# @retval 0 if @a lvl is correct. +# @result Echoes first letter of level name. +_lvl2char() { + case "$1" in + 1) echo F ;; + 2) echo E ;; + 3) echo W ;; + 4) echo I ;; + 5) echo D ;; + 6) echo T ;; + *) return 1 ;; + esac +} + +## @brief Converts numeric level to logger priority defined by POSIX.2. +# +# @param lvl Numeric logging level in range from 1 to 6. +# @retval 1 if @a lvl is out of range. +# @retval 0 if @a lvl is correct. +# @result Echoes logger priority. +_lvl2syspri() { + printf -- "%s" "$syslogfacility." + case "$1" in + 1) echo crit ;; + 2) echo error ;; + 3) echo warning ;; + 4) echo info ;; + 5) echo debug ;; + 6) echo debug ;; + *) return 1 ;; + esac +} + +## @brief Converts dracut-logger numeric level to syslog log level +# +# @param lvl Numeric logging level in range from 1 to 6. +# @retval 1 if @a lvl is out of range. +# @retval 0 if @a lvl is correct. +# @result Echoes kernel console numeric log level +# +# Conversion is done as follows: +# +# +# none -> LOG_EMERG (0) +# none -> LOG_ALERT (1) +# FATAL(1) -> LOG_CRIT (2) +# ERROR(2) -> LOG_ERR (3) +# WARN(3) -> LOG_WARNING (4) +# none -> LOG_NOTICE (5) +# INFO(4) -> LOG_INFO (6) +# DEBUG(5) -> LOG_DEBUG (7) +# TRACE(6) / +# +# +# @see /usr/include/sys/syslog.h +_dlvl2syslvl() { + local lvl + + case "$1" in + 1) lvl=2 ;; + 2) lvl=3 ;; + 3) lvl=4 ;; + 4) lvl=6 ;; + 5) lvl=7 ;; + 6) lvl=7 ;; + *) return 1 ;; + esac + + [ "$syslogfacility" = user ] && echo $((8 + lvl)) || echo $((24 + lvl)) +} + +## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg +# given message with given level (priority). +# +# @param lvl Numeric logging level. +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +# +# @note This function is not supposed to be called manually. Please use +# dtrace(), ddebug(), or others instead which wrap this one. +# +# This is core logging function which logs given message to standard error, file +# and/or syslog (with POSIX shell command logger) and/or to /dev/kmsg. +# The format is following: +# +# X: some message +# +# where @c X is the first letter of logging level. See module description for +# details on that. +# +# Message to syslog is sent with tag @c dracut. Priorities are mapped as +# following: +# - @c FATAL to @c crit +# - @c ERROR to @c error +# - @c WARN to @c warning +# - @c INFO to @c info +# - @c DEBUG and @c TRACE both to @c debug +_do_dlog() { + local lvlc + local lvl="$1" + shift + lvlc=$(_lvl2char "$lvl") || return 0 + local msg="$*" + local lmsg="$lvlc: $*" + + ((lvl <= stdloglvl)) && printf -- 'dracut: %s\n' "$msg" >&2 + + if ((lvl <= sysloglvl)); then + if [[ "$_dlogfd" ]]; then + printf -- "<%s>%s\n" "$(($(_dlvl2syslvl "$lvl") & 7))" "$msg" >&$_dlogfd + else + logger -t "dracut[$$]" -p "$(_lvl2syspri "$lvl")" -- "$msg" + fi + fi + + if ((lvl <= fileloglvl)) && [[ -w $logfile ]] && [[ -f $logfile ]]; then + echo "$lmsg" >> "$logfile" + fi + + ((lvl <= kmsgloglvl)) \ + && echo "<$(_dlvl2syslvl "$lvl")>dracut[$$] $msg" > /dev/kmsg +} + +## @brief Internal helper function for _do_dlog() +# +# @param lvl Numeric logging level. +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +# +# @note This function is not supposed to be called manually. Please use +# dtrace(), ddebug(), or others instead which wrap this one. +# +# This function calls _do_dlog() either with parameter msg, or if +# none is given, it will read standard input and will use every line as +# a message. +# +# This enables: +# dwarn "This is a warning" +# echo "This is a warning" | dwarn +dlog() { + [ -z "$maxloglvl" ] && return 0 + (($1 <= maxloglvl)) || return 0 + + if (($# > 1)); then + _do_dlog "$@" + else + while read -r line || [ -n "$line" ]; do + _do_dlog "$1" "$line" + done + fi +} + +## @brief Logs message at TRACE level (6) +# +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +dtrace() { + set +x + dlog 6 "$@" + if [ -n "$debug" ]; then + set -x + fi +} + +## @brief Logs message at DEBUG level (5) +# +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +ddebug() { + set +x + dlog 5 "$@" + if [ -n "$debug" ]; then + set -x + fi +} + +## @brief Logs message at INFO level (4) +# +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +dinfo() { + set +x + dlog 4 "$@" + if [ -n "$debug" ]; then + set -x + fi +} + +## @brief Logs message at WARN level (3) +# +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +dwarn() { + set +x + dlog 3 "$@" + if [ -n "$debug" ]; then + set -x + fi +} + +## @brief It's an alias to dwarn() function. +# +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +dwarning() { + set +x + dwarn "$@" + if [ -n "$debug" ]; then + set -x + fi +} + +## @brief Logs message at ERROR level (2) +# +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +derror() { + set +x + dlog 2 "$@" + if [ -n "$debug" ]; then + set -x + fi +} + +## @brief Logs message at FATAL level (1) +# +# @param msg Message. +# @retval 0 It's always returned, even if logging failed. +dfatal() { + set +x + dlog 1 "$@" + if [ -n "$debug" ]; then + set -x + fi +} diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-util b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-util new file mode 100755 index 0000000..a293fc0 Binary files /dev/null and b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-util differ diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-version.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-version.sh new file mode 100644 index 0000000..1830a77 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut-version.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# shellcheck disable=SC2034 +DRACUT_VERSION=055 diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf new file mode 100644 index 0000000..d6317a0 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf @@ -0,0 +1,3 @@ +# PUT YOUR CONFIG IN separate files +# in /etc/dracut.conf.d named ".conf" +# SEE man dracut.conf(5) for options diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/fedora.conf.example b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/fedora.conf.example new file mode 100644 index 0000000..5fc1bfc --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/fedora.conf.example @@ -0,0 +1,46 @@ +# dracut config file customized for RedHat/Fedora. + +# i18n +i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP" +i18n_default_font="eurlatgr" +i18n_install_all="yes" + + +stdloglvl=3 +sysloglvl=5 +install_optional_items+=" vi /etc/virc ps grep cat rm " +prefix="/" +environment=/usr/lib/environment.d +environmentconfdir=/etc/environment.d +dbus=/usr/share/dbus-1 +dbusinterfaces=/usr/share/dbus-1/interfaces +dbusservices=/usr/share/dbus-1/services +dbussession=/usr/share/dbus-1/session.d +dbussystem=/usr/share/dbus-1/system.d +dbussystemservices=/usr/share/dbus-1/system-services +dbusconfdir=/etc/dbus-1 +dbusinterfacesconfdir=/etc/dbus-1/interfaces +dbusservicesconfdir=/etc/dbus-1/services +dbussessionconfdir=/etc/dbus-1/session.d +dbussystem=confdir/etc/dbus-1/system.d +dbussystemservicesconfdir=/etc/dbus-1/system-services +sysctld=/usr/lib/sysctl.d +sysctlconfdir=/etc/sysctl.d +systemdutildir=/usr/lib/systemd +systemdutilconfdir=/etc/systemd +systemdcatalog=/usr/lib/systemd/catalog +systemdntpunits=/usr/lib/systemd/ntp-units.d +systemdntpunitsconfdir=/etc/systemd/ntp-units.d +systemdportable=/usr/lib/systemd/portable +systemdportableconfdir=/etc/systemd/portable +systemdsystemunitdir=/usr/lib/systemd/system +systemdsystemconfdir=/etc/systemd/system +systemduser=/usr/lib/systemd/user +systemduserconfdir=/etc/systemd/user +sysusers=/usr/lib/sysusers.d +sysusersconfdir=/etc/sysusers.d +udevdir=/usr/lib/udev +hostonly="yes" +hostonly_cmdline="no" +early_microcode="yes" +reproducible="yes" diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/fips.conf.example b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/fips.conf.example new file mode 100644 index 0000000..ccf56c7 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/fips.conf.example @@ -0,0 +1,3 @@ +# turn on fips module + +add_dracutmodules+=" fips " diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/gentoo-systemd.conf.example b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/gentoo-systemd.conf.example new file mode 100644 index 0000000..00af70b --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/gentoo-systemd.conf.example @@ -0,0 +1,5 @@ +# /etc/dracut.conf.d/gentoo-systemd.conf + +# Paths of systemd dirs on Gentoo +systemdutildir=/usr/lib/systemd +systemdsystemunitdir=/usr/lib/systemd/system diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/gentoo.conf.example b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/gentoo.conf.example new file mode 100644 index 0000000..df102e0 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/gentoo.conf.example @@ -0,0 +1,15 @@ +# /etc/dracut.conf.d/gentoo.conf +# dracut config file customized for Gentoo Base System release 2 + +udevdir=/lib/udev +ro_mnt=yes + +# +# Modules +# + +# i18n +i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE" +i18n_default_font="LatArCyrHeb-16" + +omit_drivers+=" i2o_scsi " diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/suse.conf.example b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/suse.conf.example new file mode 100644 index 0000000..06573d5 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.conf.d/suse.conf.example @@ -0,0 +1,24 @@ +# SUSE specific dracut settings +# +# SUSE by default always builds as small as possible initrd for performance +# and resource reasons. +# If you like to build a generic initrd which works on other platforms than +# on the one dracut/mkinitrd got called comment out below setting(s). +hostonly="yes" +hostonly_cmdline="yes" + +compress="xz -0 --check=crc32 --memlimit-compress=50%" + +i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP" +omit_drivers+=" i2o_scsi " + +# Below adds additional tools to the initrd which are not urgently necessary to +# bring up the system, but help to debug problems. +# See /usr/lib/dracut/modules.d/95debug/module-setup.sh which additional tools +# are installed and add more if you need them. This specifically helps if you +# use: +# rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount| +# mount|pre-pivot|cleanup] +# boot parameter or if you are forced to enter the dracut emergency shell. + +# add_dracutmodules+=debug diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.html b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.html new file mode 100644 index 0000000..98f3275 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.html @@ -0,0 +1,3880 @@ + +dracut 054

dracut 054

Harald Hoyer


Part I. Introduction

This section is a modified version of +http://en.wikipedia.org/wiki/Initrd which is licensed under the +Creative Commons Attribution/Share-Alike License.

Chapter 1. Definition

An initial ramdisk is a temporary file system used in the boot process of the +Linux kernel. initrd and initramfs refer to slightly different schemes for +loading this file system into memory. Both are commonly used to make +preparations before the real root file system can be mounted.

Chapter 2. Rationale

Many Linux distributions ship a single, generic kernel image that is intended to +boot as wide a variety of hardware as possible. The device drivers for this +generic kernel image are included as loadable modules, as it is not possible to +statically compile them all into the one kernel without making it too large to +boot from computers with limited memory or from lower-capacity media like floppy +disks.

This then raises the problem of detecting and loading the modules necessary to +mount the root file system at boot time (or, for that matter, deducing where or +what the root file system is).

To further complicate matters, the root file system may be on a software RAID +volume, LVM, NFS (on diskless workstations), or on an encrypted partition. All +of these require special preparations to mount.

Another complication is kernel support for hibernation, which suspends the +computer to disk by dumping an image of the entire system to a swap partition or +a regular file, then powering off. On next boot, this image has to be made +accessible before it can be loaded back into memory.

To avoid having to hardcode handling for so many special cases into the kernel, +an initial boot stage with a temporary root file system +—now dubbed early user space— is used. This root file system would contain +user-space helpers that would do the hardware detection, module loading and +device discovery necessary to get the real root file system mounted.

Chapter 3. Implementation

An image of this initial root file system (along with the kernel image) must be +stored somewhere accessible by the Linux bootloader or the boot firmware of the +computer. This can be:

  • +The root file system itself +
  • +A boot image on an optical disc +
  • +A small ext2/ext3 or FAT-formatted partition on a local disk + (a boot partition) +
  • +A TFTP server (on systems that can boot from Ethernet) +

The bootloader will load the kernel and initial root file system image into +memory and then start the kernel, passing in the memory address of the image.

Depending on which algorithms were compiled statically into it, the kernel can +currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA.

Chapter 4. Mount preparations

dracut can generate a customized initramfs image which contains only whatever is +necessary to boot some particular computer, such as ATA, SCSI and filesystem +kernel modules (host-only mode).

dracut can also generate a more generic initramfs image (default mode).

dracut’s initramfs starts only with the device name of the root file system (or +its UUID) and must discover everything else at boot time. A complex cascade of +tasks must be performed to get the root file system mounted:

  • +Any hardware drivers that the boot process depends on must be loaded. All +kernel modules for common storage devices are packed onto the initramfs and then +udev pulls in modules matching the computer’s detected hardware. +
  • +On systems which display a boot rd.splash screen, the video hardware must be +initialized and a user-space helper started to paint animations onto the display +in lockstep with the boot process. +
  • +If the root file system is on NFS, dracut does then: +

    • +Bring up the primary network interface. +
    • +Invoke a DHCP client, with which it can obtain a DHCP lease. +
    • +Extract the name of the NFS share and the address of the NFS server from the +lease. +
    • +Mount the NFS share. +
  • +If the root file system appears to be on a software RAID device, there is no +way of knowing which devices the RAID volume spans; the standard MD utilities +must be invoked to scan all available block devices with a raid signature and +bring the required ones online. +
  • +If the root file system appears to be on a logical volume, the LVM utilities +must be invoked to scan for and activate the volume group containing it. +
  • +If the root file system is on an encrypted block device: +

    • +Invoke a helper script to prompt the user to type in a passphrase and/or +insert a hardware token (such as a smart card or a USB security dongle). +
  • +Create a decryption target with the device mapper. +

dracut uses udev, an event-driven hotplug agent, which invokes helper programs +as hardware devices, disk partitions and storage volumes matching certain rules +come online. This allows discovery to run in parallel, and to progressively +cascade into arbitrary nestings of LVM, RAID or encryption to get at the root +file system.

When the root file system finally becomes visible:

  • +Any maintenance tasks which cannot run on a mounted root file system +are done. +
  • +The root file system is mounted read-only. +
  • +Any processes which must continue running (such as the rd.splash screen helper +and its command FIFO) are hoisted into the newly-mounted root file system. +

The final root file system cannot simply be mounted over /, since that would +make the scripts and tools on the initial root file system inaccessible for any +final cleanup tasks. On an initramfs, the initial root file system cannot be +rotated away. Instead, it is simply emptied and the final root file system +mounted over the top.

If the systemd module is used in the initramfs, the ordering of the services +started looks like Chapter 12, DRACUT.BOOTUP(7).

Chapter 5. Dracut on shutdown

On a systemd driven system, the dracut initramfs is also used for the shutdown +procedure.

The following steps are executed during a shutdown:

  • +systemd switches to the shutdown.target +
  • +systemd starts + $prefix/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service +
  • +dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore + which unpacks the initramfs to /run/initramfs +
  • +systemd finishes shutdown.target +
  • +systemd kills all processes +
  • +systemd tries to unmount everything and mounts the remaining read-only +
  • +systemd checks, if there is a /run/initramfs/shutdown executable +
  • +if yes, it does a pivot_root to /run/initramfs and executes ./shutdown. + The old root is then mounted on /oldroot. + /usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable. +
  • +shutdown will try to unmount every /oldroot mount and calls the various + shutdown hooks from the dracut modules +

This ensures, that all devices are disassembled and unmounted cleanly.

Part II. User Manual

Chapter 6. DRACUT(8)

NAME

dracut - low-level tool for generating an initramfs/initrd image

SYNOPSIS

dracut [OPTION…] [<image> [<kernel version>]]

DESCRIPTION

Create an initramfs <image> for the kernel with the version <kernel version>. +If <kernel version> is omitted, then the version of the actual running +kernel is used. If <image> is omitted or empty, then the default location +/boot/initramfs-<kernel version>.img is used.

dracut creates an initial image used by the kernel for preloading the block +device modules (such as IDE, SCSI or RAID) which are needed to access the root +filesystem, mounting the root filesystem and booting into the real system.

At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it +as initial root file system. All finding of the root device happens in this +early userspace.

Initramfs images are also called "initrd".

For a complete list of kernel command line options see dracut.cmdline(7).

If you are dropped to an emergency shell, while booting your initramfs, +the file /run/initramfs/rdsosreport.txt is created, which can be saved to a +(to be mounted by hand) partition (usually /boot) or a USB stick. +Additional debugging info can be produced by adding rd.debug to the kernel +command line. /run/initramfs/rdsosreport.txt contains all logs and the output +of some tools. It should be attached to any report about dracut problems.

USAGE

To create a initramfs image, the most simple command is:

# dracut

This will generate a general purpose initramfs image, with all possible +functionality resulting of the combination of the installed dracut modules and +system tools. The image is /boot/initramfs-<kernel version>.img and +contains the kernel modules of the currently active kernel with version +<kernel version>.

If the initramfs image already exists, dracut will display an error message, and +to overwrite the existing image, you have to use the --force option.

# dracut --force

If you want to specify another filename for the resulting image you would issue +a command like:

# dracut foobar.img

To generate an image for a specific kernel version, the command would be:

# dracut foobar.img 2.6.40-1.rc5.f20

A shortcut to generate the image at the default location for a specific kernel +version is:

# dracut --kver 2.6.40-1.rc5.f20

If you want to create lighter, smaller initramfs images, you may want to specify +the --hostonly or -H option. Using this option, the resulting image will +contain only those dracut modules, kernel modules and filesystems, which are +needed to boot this specific machine. This has the drawback, that you can’t put +the disk on another controller or machine, and that you can’t switch to another +root filesystem, without recreating the initramfs image. The usage of the +--hostonly option is only for experts and you will have to keep the broken +pieces. At least keep a copy of a general purpose image (and corresponding +kernel) as a fallback to rescue your system.

Inspecting the Contents

To see the contents of the image created by dracut, you can use the lsinitrd +tool.

# lsinitrd | less

To display the contents of a file in the initramfs also use the lsinitrd tool:

# lsinitrd -f /etc/ld.so.conf
+include ld.so.conf.d/*.conf

Adding dracut Modules

Some dracut modules are turned off by default and have to be activated manually. +You can do this by adding the dracut modules to the configuration file +/etc/dracut.conf or /etc/dracut.conf.d/myconf.conf. See dracut.conf(5). +You can also add dracut modules on the command line +by using the -a or --add option:

# dracut --add module initramfs-module.img

To see a list of available dracut modules, use the --list-modules option:

# dracut --list-modules

Omitting dracut Modules

Sometimes you don’t want a dracut module to be included for reasons of speed, +size or functionality. To do this, either specify the omit_dracutmodules +variable in the dracut.conf or /etc/dracut.conf.d/myconf.conf configuration +file (see dracut.conf(5)), or use the -o or --omit option +on the command line:

# dracut -o "multipath lvm" no-multipath-lvm.img

Adding Kernel Modules

If you need a special kernel module in the initramfs, which is not +automatically picked up by dracut, you have the use the --add-drivers option +on the command line or the drivers variable in the /etc/dracut.conf +or /etc/dracut.conf.d/myconf.conf configuration file (see dracut.conf(5)):

# dracut --add-drivers mymod initramfs-with-mymod.img

Boot parameters

An initramfs generated without the "hostonly" mode, does not contain any system +configuration files (except for some special exceptions), so the configuration +has to be done on the kernel command line. With this flexibility, you can easily +boot from a changed root partition, without the need to recompile the initramfs +image. So, you could completely change your root partition (move it inside a md +raid with encryption and LVM on top), as long as you specify the correct +filesystem LABEL or UUID on the kernel command line for your root device, dracut +will find it and boot from it.

The kernel command line can also be provided by the dhcp server with the +root-path option. See the section called “Network Boot”.

For a full reference of all kernel command line parameters, +see dracut.cmdline(5).

To get a quick start for the suitable kernel command line on your system, +use the --print-cmdline option:

# dracut --print-cmdline
+ root=UUID=8b8b6f91-95c7-4da2-831b-171e12179081 rootflags=rw,relatime,discard,data=ordered rootfstype=ext4

Specifying the root Device

This is the only option dracut really needs to boot from your root partition. +Because your root partition can live in various environments, there are a lot of +formats for the root= option. The most basic one is root=<path to device +node>:

root=/dev/sda2

Because device node names can change, dependent on the drive ordering, you are +encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) +to specify your root partition:

root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331

or

root=LABEL=myrootpartitionlabel

To see all UUIDs or LABELs on your system, do:

# ls -l /dev/disk/by-uuid

or

# ls -l /dev/disk/by-label

If your root partition is on the network see the section called “Network Boot”.

Keyboard Settings

If you have to input passwords for encrypted disk volumes, you might want to set +the keyboard layout and specify a display font.

A typical german kernel command line would contain:

rd.vconsole.font=eurlatgr rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8

Setting these options can override the setting stored on your system, if you use +a modern init system, like systemd.

Blacklisting Kernel Modules

Sometimes it is required to prevent the automatic kernel module loading of a +specific kernel module. To do this, just add rd.blacklist=<kernel module +name>, with <kernel module name> not containing the .ko +suffix, to the kernel command line. For example:

rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau

The option can be specified multiple times on the kernel command line.

Speeding up the Boot Process

If you want to speed up the boot process, you can specify as much information +for dracut on the kernel command as possible. For example, you can tell dracut, +that you root partition is not on a LVM volume or not on a raid partition, or +that it lives inside a specific crypto LUKS encrypted volume. By default, dracut +searches everywhere. A typical dracut kernel command line for a plain primary or +logical partition would contain:

rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0

This turns off every automatic assembly of LVM, MD raids, DM raids and +crypto LUKS.

Of course, you could also omit the dracut modules in the initramfs creation +process, but then you would lose the possibility to turn it on on demand.

Injecting custom Files

To add your own files to the initramfs image, you have several possibilities.

The --include option let you specify a source path and a target path. +For example

# dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img

will create an initramfs image, where the file cmdline-preset will be copied +inside the initramfs to /etc/cmdline.d/mycmdline.conf. --include can only +be specified once.

# mkdir -p rd.live.overlay/etc/cmdline.d
+# mkdir -p rd.live.overlay/etc/conf.d
+# echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
+# echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
+# echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
+# tree rd.live.overlay/
+rd.live.overlay/
+`-- etc
+    |-- cmdline.d
+    |   `-- mycmdline.conf
+    `-- conf.d
+        `-- testvar.conf
+
+# dracut --include rd.live.overlay / initramfs-rd.live.overlay.img

This will put the contents of the rd.live.overlay directory into the root of the +initramfs image.

The --install option let you specify several files, which will get installed in +the initramfs image at the same location, as they are present on initramfs +creation time.

# dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img

This will create an initramfs with the strace, fsck.ext3 and ssh executables, +together with the libraries needed to start those. The --install option can be +specified multiple times.

Network Boot

If your root partition is on a network drive, you have to have the network +dracut modules installed to create a network aware initramfs image.

If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp +server about the ip address for the machine. The dhcp server can also serve an +additional root-path, which will set the root device for dracut. With this +mechanism, you have static configuration on your client machine and a +centralized boot configuration on your TFTP/DHCP server. If you can’t pass a +kernel command line, then you can inject /etc/cmdline.d/mycmdline.conf, with a +method described in the section called “Injecting custom Files”.

Reducing the Image Size

To reduce the size of the initramfs, you should create it with by omitting all +dracut modules, which you know, you don’t need to boot the machine.

You can also specify the exact dracut and kernel modules to produce a very tiny +initramfs image.

For example for a NFS image, you would do:

# dracut -m "nfs network base" initramfs-nfs-only.img

Then you would boot from this image with your target machine and reduce the size +once more by creating it on the target machine with the --host-only option:

# dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img

This will reduce the size of the initramfs image significantly.

Troubleshooting

If the boot process does not succeed, you have several options to debug the +situation. Some of the basic operations are covered here. For more information +you should also visit: +https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html

Identifying your problem area

  1. +Remove 'rhgb' and 'quiet' from the kernel command line +
  2. +Add 'rd.shell' to the kernel command line. This will present a shell should +dracut be unable to locate your root device +
  3. +Add 'rd.shell rd.debug log_buf_len=1M' to the kernel command line so that +dracut shell commands are printed as they are executed +
  4. +The file /run/initramfs/rdsosreport.txt is generated, +which contains all the logs and the output of all significant tools, which are +mentioned later. +

If you want to save that output, simply mount /boot by hand or insert an USB +stick and mount that. Then you can store the output for later inspection.

Information to include in your report

All bug reports

In all cases, the following should be mentioned and attached to your bug report:

  • +The exact kernel command-line used. Typically from the bootloader +configuration file (e.g. /boot/grub2/grub.cfg) or from /proc/cmdline. +
  • +A copy of your disk partition information from /etc/fstab, which might be +obtained booting an old working initramfs or a rescue medium. +
  • +Turn on dracut debugging (see the debugging dracut section), and attach +the file /run/initramfs/rdsosreport.txt. +
  • +If you use a dracut configuration file, please include /etc/dracut.conf and +all files in /etc/dracut.conf.d/*.conf +

Network root device related problems

This section details information to include when experiencing problems on a +system whose root device is located on a network attached volume (e.g. iSCSI, +NFS or NBD). As well as the information from the section called “All bug reports”, include the +following information:

  • +Please include the output of +

    # /sbin/ifup <interfacename>
    +# ip addr show

Debugging dracut

Configure a serial console

Successfully debugging dracut will require some form of console +logging during the system boot. This section documents configuring a +serial console connection to record boot messages.

  1. +First, enable serial console output for both the kernel and the bootloader. +
  2. +Open the file /boot/grub2/grub.cfg for editing. Below the line 'timeout=5', add +the following: +

    serial --unit=0 --speed=9600
    +terminal --timeout=5 serial console
  3. +Also in /boot/grub2/grub.cfg, add the following boot arguments to the 'kernel' +line: +

    console=tty0 console=ttyS0,9600
  4. +When finished, the /boot/grub2/grub.cfg file should look similar to the example +below. +

    default=0
    +timeout=5
    +serial --unit=0 --speed=9600
    +terminal --timeout=5 serial console
    +title Fedora (2.6.29.5-191.fc11.x86_64)
    +  root (hd0,0)
    +  kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
    +  initrd /dracut-2.6.29.5-191.fc11.x86_64.img
  5. +More detailed information on how to configure the kernel for console output +can be found at +http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL. +
  6. +Redirecting non-interactive output +

    Note

    You can redirect all non-interactive output to /dev/kmsg and the kernel +will put it out on the console when it reaches the kernel buffer by doing

    # exec >/dev/kmsg 2>&1 </dev/console

Using the dracut shell

dracut offers a shell for interactive debugging in the event dracut fails to +locate your root filesystem. To enable the shell:

  1. +Add the boot parameter 'rd.shell' to your bootloader configuration file +(e.g. /boot/grub2/grub.cfg) +
  2. +Remove the boot arguments 'rhgb' and 'quiet' +

    A sample /boot/grub2/grub.cfg bootloader configuration file is listed below.

    default=0
    +timeout=5
    +serial --unit=0 --speed=9600
    +terminal --timeout=5 serial console
    +title Fedora (2.6.29.5-191.fc11.x86_64)
    +  root (hd0,0)
    +  kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
    +  initrd /dracut-2.6.29.5-191.fc11.x86_64.img
  3. +If system boot fails, you will be dropped into a shell as seen in the example +below. +

    No root device found
    +Dropping to debug shell.
    +
    +#
  4. +Use this shell prompt to gather the information requested above +(see the section called “All bug reports”). +

Accessing the root volume from the dracut shell

From the dracut debug shell, you can manually perform the task of locating and +preparing your root volume for boot. The required steps will depend on how your +root volume is configured. Common scenarios include:

  • +A block device (e.g. /dev/sda7) +
  • +A LVM logical volume (e.g. /dev/VolGroup00/LogVol00) +
  • +An encrypted device + (e.g. /dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83) +
  • +A network attached device + (e.g. netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.example:for.all) +

The exact method for locating and preparing will vary. However, to continue with +a successful boot, the objective is to locate your root volume and create a +symlink /dev/root which points to the file system. For example, the following +example demonstrates accessing and booting a root volume that is an encrypted +LVM Logical volume.

  1. +Inspect your partitions using parted +

    # parted /dev/sda -s p
    +Model: ATA HTS541060G9AT00 (scsi)
    +Disk /dev/sda: 60.0GB
    +Sector size (logical/physical): 512B/512B
    +Partition Table: msdos
    +Number  Start   End     Size    Type      File system  Flags
    +1      32.3kB  10.8GB  107MB   primary   ext4         boot
    +2      10.8GB  55.6GB  44.7GB  logical                lvm
  2. +You recall that your root volume was a LVM logical volume. Scan and activate +any logical volumes. +

    # lvm vgscan
    +# lvm vgchange -ay
  3. +You should see any logical volumes now using the command blkid: +

    # blkid
    +/dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
    +/dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
    +/dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
    +/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"
    +/dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
  4. +From the output above, you recall that your root volume exists on an encrypted +block device. Following the guidance disk encryption guidance from the +Installation Guide, you unlock your encrypted root volume. +

    # UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
    +# cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
    +Enter passphrase for /dev/mapper/linux-root:
    +Key slot 0 unlocked.
  5. +Next, make a symbolic link to the unlocked root volume +

    # ln -s /dev/mapper/luks-$UUID /dev/root
  6. +With the root volume available, you may continue booting the system by exiting +the dracut shell +

    # exit

Additional dracut boot parameters

For more debugging options, see dracut.cmdline(7).

Debugging dracut on shutdown

To debug the shutdown sequence on systemd systems, you can rd.break +on pre-shutdown or shutdown.

To do this from an already booted system:

# mkdir -p /run/initramfs/etc/cmdline.d
+# echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
+# touch /run/initramfs/.need_shutdown

This will give you a dracut shell after the system pivot’ed back in the +initramfs.

OPTIONS

+--kver <kernel version> +
+ set the kernel version. This enables to specify the kernel version, without + specifying the location of the initramfs image. For example: +
# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
+-f, --force +
+ overwrite existing initramfs file. +
+-a, --add <list of dracut modules> +

+ add a space-separated list of dracut modules to the default set of modules. + This parameter can be specified multiple times. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --add "module1 module2"  ...
+--force-add <list of dracut modules> +

+ force to add a space-separated list of dracut modules to the default set of + modules, when -H is specified. This parameter can be specified multiple + times. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --force-add "module1 module2"  ...
+-o, --omit <list of dracut modules> +

+ omit a space-separated list of dracut modules. This parameter can be + specified multiple times. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --omit "module1 module2"  ...
+-m, --modules <list of dracut modules> +

+ specify a space-separated list of dracut modules to call when building the + initramfs. Modules are located in /usr/lib/dracut/modules.d. This + parameter can be specified multiple times. + This option forces dracut to only include the specified dracut modules. + In most cases the "--add" option is what you want to use. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --modules "module1 module2"  ...
+-d, --drivers <list of kernel modules> +

+ specify a space-separated list of kernel modules to exclusively include + in the initramfs. The kernel modules have to be specified without the ".ko" + suffix. This parameter can be specified multiple times. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --drivers "kmodule1 kmodule2"  ...
+--add-drivers <list of kernel modules> +

+ specify a space-separated list of kernel modules to add to the initramfs. + The kernel modules have to be specified without the ".ko" suffix. This + parameter can be specified multiple times. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --add-drivers "kmodule1 kmodule2"  ...
+--force-drivers <list of kernel modules> +

+ See add-drivers above. But in this case it is ensured that the drivers + are tried to be loaded early via modprobe. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --force-drivers "kmodule1 kmodule2"  ...
+--omit-drivers <list of kernel modules> +

+ specify a space-separated list of kernel modules not to add to the + initramfs. + The kernel modules have to be specified without the ".ko" suffix. This + parameter can be specified multiple times. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --omit-drivers "kmodule1 kmodule2"  ...
+--filesystems <list of filesystems> +

+ specify a space-separated list of kernel filesystem modules to exclusively + include in the generic initramfs. This parameter can be specified multiple + times. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --filesystems "filesystem1 filesystem2"  ...
+-k, --kmoddir <kernel directory> +
+ specify the directory, where to look for kernel modules +
+--fwdir <dir>[:<dir>…]++ +
+ specify additional directories, where to look for firmwares. This parameter + can be specified multiple times. +
+--kernel-cmdline <parameters> +
+ specify default kernel command line parameters +
+--kernel-only +
+ only install kernel drivers and firmware files +
+--no-kernel +
+ do not install kernel drivers and firmware files +
+--early-microcode +
+ Combine early microcode with ramdisk +
+--no-early-microcode +
+ Do not combine early microcode with ramdisk +
+--print-cmdline +
+ print the kernel command line for the current disk layout +
+--mdadmconf +
+ include local /etc/mdadm.conf +
+--nomdadmconf +
+ do not include local /etc/mdadm.conf +
+--lvmconf +
+ include local /etc/lvm/lvm.conf +
+--nolvmconf +
+ do not include local /etc/lvm/lvm.conf +
+--fscks [LIST] +

+ add a space-separated list of fsck tools, in addition to dracut.conf's + specification; the installation is opportunistic (non-existing tools are + ignored) +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --fscks "fsck.foo barfsck"  ...
+--nofscks +
+ inhibit installation of any fsck tools +
+--strip +
+ strip binaries in the initramfs (default) +
+--nostrip +
+ do not strip binaries in the initramfs +
+--hardlink +
+ hardlink files in the initramfs (default) +
+--nohardlink +
+ do not hardlink files in the initramfs +
+--prefix <dir> +
+ prefix initramfs files with the specified directory +
+--noprefix +
+ do not prefix initramfs files (default) +
+-h, --help +
+ display help text and exit. +
+--debug +
+ output debug information of the build process +
+-v, --verbose +
+ increase verbosity level (default is info(4)) +
+--version +
+ display version and exit +
+-q, --quiet +
+decrease verbosity level (default is info(4)) +
+-c, --conf <dracut configuration file> +

+ specify configuration file to use. +

Default: + /etc/dracut.conf

+--confdir <configuration directory> +

+ specify configuration directory to use. +

Default: + /etc/dracut.conf.d

+--tmpdir <temporary directory> +

+ specify temporary directory to use. +

Default: + /var/tmp

+-r, --sysroot <sysroot directory> +

+ specify the sysroot directory to collect files from. + This is useful to create the initramfs image from + a cross-compiled sysroot directory. For the extra helper + variables, see ENVIRONMENT below. +

Default: + empty

+--sshkey <sshkey file> +
+ssh key file used with ssh-client module. +
+--logfile <logfile> +

+logfile to use; overrides any setting from + the configuration files. +

Default: + /var/log/dracut.log

+-l, --local +
+ activates the local mode. dracut will use modules from the current working + directory instead of the system-wide installed modules in + /usr/lib/dracut/modules.d. + This is useful when running dracut from a git checkout. +
+-H, --hostonly +

+ Host-Only mode: Install only what is needed for booting the local host + instead of a generic host and generate host-specific configuration. +

Warning

If chrooted to another root other than the real root device, use "--fstab" and +provide a valid /etc/fstab.

+-N, --no-hostonly +
+ Disable Host-Only mode +

--hostonly-cmdline: + Store kernel command line arguments needed in the initramfs

--no-hostonly-cmdline: + Do not store kernel command line arguments needed in the initramfs

--no-hostonly-default-device: + Do not generate implicit host devices like root, swap, fstab, etc. + Use "--mount" or "--add-device" to explicitly add devices as needed.

--hostonly-i18n: + Install only needed keyboard and font files according to the host configuration (default).

--no-hostonly-i18n: + Install all keyboard and font files available.

+--persistent-policy <policy> +
+ Use <policy> to address disks and partitions. + <policy> can be any directory name found in /dev/disk. + E.g. "by-uuid", "by-label" +
+--fstab +
+ Use /etc/fstab instead of /proc/self/mountinfo. +
+--add-fstab <filename> +
+ Add entries of <filename> to the initramfs /etc/fstab. +
+--mount "<device> <mountpoint> <filesystem type> [<filesystem options> [<dump frequency> [<fsck order>]]]" +
+ Mount <device> on <mountpoint> with <filesystem type> in the + initramfs. <filesystem options>, <dump options> and <fsck order> can + be specified, see fstab manpage for the details. + The default <filesystem options> is "defaults". + The default <dump frequency> is "0". + the default <fsck order> is "2". +
+--mount "<mountpoint>" +
+ Like above, but <device>, <filesystem type> and <filesystem options> + are determined by looking at the current mounts. +
+--add-device <device> +
+ Bring up <device> in initramfs, <device> should be the device name. + This can be useful in hostonly mode for resume support when your swap is on + LVM or an encrypted partition. + [NB --device can be used for compatibility with earlier releases] +
+-i, --include <SOURCE> <TARGET> +
+ include the files in the SOURCE directory into the + TARGET directory in the final initramfs. If SOURCE is a file, it will be + installed to TARGET in the final initramfs. This parameter can be specified + multiple times. +
+-I, --install <file list> +

+ install the space separated list of files into the initramfs. +

Note

If [LIST] has multiple arguments, then you have to put these in quotes. For +example:

# dracut --install "/bin/foo /sbin/bar"  ...
+--install-optional <file list> +
+ install the space separated list of files into the initramfs, if they exist. +
+--gzip +
+ Compress the generated initramfs using gzip. This will be done by default, + unless another compression option or --no-compress is passed. Equivalent to + "--compress=gzip -9" +
+--bzip2 +

+ Compress the generated initramfs using bzip2. +

Warning

Make sure your kernel has bzip2 decompression support compiled in, otherwise you +will not be able to boot. Equivalent to "--compress=bzip2"

+--lzma +

+ Compress the generated initramfs using lzma. +

Warning

Make sure your kernel has lzma decompression support compiled in, otherwise you +will not be able to boot. Equivalent to "lzma --compress=lzma -9"

+--xz +

+ Compress the generated initramfs using xz. +

Warning

Make sure your kernel has xz decompression support compiled in, otherwise you +will not be able to boot. Equivalent to +"lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"

+--lzo +
+ Compress the generated initramfs using lzop. +

Warning

Make sure your kernel has lzo decompression support compiled in, otherwise you +will not be able to boot.

+--lz4 +
+ Compress the generated initramfs using lz4. +

Warning

Make sure your kernel has lz4 decompression support compiled in, otherwise you +will not be able to boot.

+--zstd +
+ Compress the generated initramfs using Zstandard. +

Warning

Make sure your kernel has zstd decompression support compiled in, otherwise you +will not be able to boot.

+--compress <compressor> +
+ Compress the generated initramfs using the passed compression program. If + you pass it just the name of a compression program, it will call that + program with known-working arguments. If you pass a quoted string with + arguments, it will be called with exactly those arguments. Depending on what + you pass, this may result in an initramfs that the kernel cannot decompress. + The default value can also be set via the INITRD_COMPRESS environment variable. +
+--no-compress +
+ Do not compress the generated initramfs. This will override any other + compression options. +
+--reproducible +
+ Create reproducible images. +
+--no-reproducible +
+ Do not create reproducible images. +
+--list-modules +
+ List all available dracut modules. +
+-M, --show-modules +
+ Print included module’s name to standard output during build. +
+--keep +
+ Keep the initramfs temporary directory for debugging purposes. +
+--printsize +
+ Print out the module install size +

--profile: + Output profile information of the build process

--ro-mnt: + Mount / and /usr read-only by default.

+-L, --stdlog <level> +
+ [0-6] Specify logging level (to standard error) +
          0 - suppress any messages
+          1 - only fatal errors
+          2 - all errors
+          3 - warnings
+          4 - info
+          5 - debug info (here starts lots of output)
+          6 - trace info (and even more)
+--regenerate-all +
+ Regenerate all initramfs images at the default location with the kernel + versions found on the system. Additional parameters are passed through. +
+--loginstall <DIR> +
+ Log all files installed from the host to <DIR>. +
+--uefi +
+ Instead of creating an initramfs image, dracut will create an UEFI executable, + which can be executed by an UEFI BIOS. The default output filename is + <EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi. <EFI> might be + /efi, /boot or /boot/efi depending on where the ESP partition is mounted. + The <BUILD_ID> is taken from BUILD_ID in /usr/lib/os-release or if it exists + /etc/os-release and is left out, if BUILD_ID is non-existant or empty. +
+--no-uefi +
+ Disables UEFI mode. +
+--no-machineid +
+ affects the default output filename of --uefi and will discard the <MACHINE_ID> + part. +
+--uefi-stub <FILE> +
+ Specifies the UEFI stub loader, which will load the attached kernel, initramfs and + kernel command line and boots the kernel. The default is + $prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub +
+--uefi-splash-image <FILE> +
+ Specifies the UEFI stub loader’s splash image. Requires bitmap (.bmp) image + format. +
+--kernel-image <FILE> +
+ Specifies the kernel image, which to include in the UEFI executable. The default is + /lib/modules/<KERNEL-VERSION>/vmlinuz or /boot/vmlinuz-<KERNEL-VERSION> +

ENVIRONMENT

+INITRD_COMPRESS +
+ sets the default compression program. See --compress. +
+DRACUT_LDCONFIG +

+ sets the ldconfig program path and options. Optional. + Used for --sysroot. +

Default: + ldconfig

+DRACUT_LDD +

+ sets the ldd program path and options. Optional. + Used for --sysroot. +

Default: + ldd

+DRACUT_TESTBIN +

+ sets the initially tested binary for detecting library paths. + Optional. Used for --sysroot. In the cross-compiled sysroot, + the default value (/bin/sh) is unusable, as it is an absolute + symlink and points outside the sysroot directory. +

Default: + /bin/sh

+DRACUT_INSTALL +

+ overrides path and options for executing dracut-install internally. + Optional. Can be used to debug dracut-install while running the + main dracut script. +

Default: + dracut-install

Example: + DRACUT_INSTALL="valgrind dracut-install"

+DRACUT_COMPRESS_BZIP2 +, +DRACUT_COMPRESS_BZIP2 +, +DRACUT_COMPRESS_LBZIP2 +, +DRACUT_COMPRESS_LZMA +, +DRACUT_COMPRESS_XZ +, +DRACUT_COMPRESS_GZIP +, +DRACUT_COMPRESS_PIGZ +, +DRACUT_COMPRESS_LZOP +, +DRACUT_COMPRESS_ZSTD +, +DRACUT_COMPRESS_LZ4 +, +DRACUT_COMPRESS_CAT +

+ overrides for compression utilities to support using them from + non-standard paths. +

Default values are the default compression utility names to be found in PATH.

+DRACUT_ARCH +

+ overrides the value of uname -m. Used for --sysroot. +

Default: + empty (the value of uname -m on the host system)

+SYSTEMD_VERSION +
+ overrides systemd version. Used for --sysroot. +
+SYSTEMCTL +
+ overrides the systemctl binary. Used for --sysroot. +
+NM_VERSION +
+ overrides the NetworkManager version. Used for --sysroot. +
+DRACUT_INSTALL_PATH +

+ overrides PATH environment for dracut-install to look for + binaries relative to --sysroot. In a cross-compiled environment + (e.g. Yocto), PATH points to natively built binaries that are not + in the host’s /bin, /usr/bin, etc. dracut-install still needs plain + /bin and /usr/bin that are relative to the cross-compiled sysroot. +

Default: + PATH

+DRACUT_INSTALL_LOG_TARGET +

+ overrides DRACUT_LOG_TARGET for dracut-install. It allows + running dracut-install* to run with different log target that + dracut** runs with. +

Default: + DRACUT_LOG_TARGET

+DRACUT_INSTALL_LOG_LEVEL +

+ overrides DRACUT_LOG_LEVEL for dracut-install. It allows + running dracut-install* to run with different log level that + dracut** runs with. +

Default: + DRACUT_LOG_LEVEL

FILES

+/var/log/dracut.log +
+ logfile of initramfs image creation +
+/tmp/dracut.log +
+ logfile of initramfs image creation, if /var/log/dracut.log is not + writable +
+/etc/dracut.conf +
+ see dracut.conf5 +
+/etc/dracut.conf.d/*.conf +
+ see dracut.conf5 +
+/usr/lib/dracut/dracut.conf.d/*.conf +
+ see dracut.conf5 +

Configuration in the initramfs

+/etc/conf.d/ +
+ Any files found in /etc/conf.d/ will be sourced in the initramfs to + set initial values. Command line options will override these values + set in the configuration files. +
+/etc/cmdline +
+ Can contain additional command line options. Deprecated, better use + /etc/cmdline.d/*.conf. +
+/etc/cmdline.d/*.conf +
+ Can contain additional command line options. +

AVAILABILITY

The dracut command is part of the dracut package and is available from +https://dracut.wiki.kernel.org

AUTHORS

Harald Hoyer

Victor Lowther

Amadeusz Żołnowski

Hannes Reinecke

Daniel Molkentin

Will Woods

Philippe Seewer

Warren Togami

SEE ALSO

dracut.cmdline(7) dracut.conf(5) lsinitrd(1)

Chapter 7. DRACUT.CONF(5)

NAME

dracut.conf - configuration file(s) for dracut

SYNOPSIS

/etc/dracut.conf +/etc/dracut.conf.d/*.conf +/usr/lib/dracut/dracut.conf.d/*.conf

Description

dracut.conf is loaded during the initialisation phase of dracut. Command line +parameter will override any values set here.

*.conf files are read from /usr/lib/dracut/dracut.conf.d and +/etc/dracut.conf.d. Files with the same name in /etc/dracut.conf.d will replace +files in /usr/lib/dracut/dracut.conf.d. +The files are then read in alphanumerical order and will override parameters +set in /etc/dracut.conf. Each line specifies an attribute and a value. A # +indicates the beginning of a comment; following characters, up to the end of the +line are not interpreted.

dracut command line options will override any values set here.

Configuration files must have the extension .conf; other extensions are ignored.

+add_dracutmodules+=<dracut modules> " +
+ Add a space-separated list of dracut modules to call when building the + initramfs. Modules are located in /usr/lib/dracut/modules.d. +
+dracutmodules+=<dracut modules> " +
+ Specify a space-separated list of dracut modules to call when building the + initramfs. Modules are located in /usr/lib/dracut/modules.d. + This option forces dracut to only include the specified dracut modules. + In most cases the "add_dracutmodules" option is what you want to use. +
+omit_dracutmodules+=<dracut modules> " +
+ Omit a space-separated list of dracut modules to call when building the + initramfs. Modules are located in /usr/lib/dracut/modules.d. +
+drivers+=<kernel modules> " +
+ Specify a space-separated list of kernel modules to exclusively include in + the initramfs. The kernel modules have to be specified without the ".ko" + suffix. +
+add_drivers+=<kernel modules> " +
+ Specify a space-separated list of kernel modules to add to the initramfs. + The kernel modules have to be specified without the ".ko" suffix. +
+force_drivers+=<list of kernel modules> " +
+ See add_drivers above. But in this case it is ensured that the drivers + are tried to be loaded early via modprobe. +
+omit_drivers+=<kernel modules> " +
+ Specify a space-separated list of kernel modules not to add to the + initramfs. The kernel modules have to be specified without the ".ko" suffix. +
+filesystems+=<filesystem names> " +
+ Specify a space-separated list of kernel filesystem modules to exclusively + include in the generic initramfs. +
+drivers_dir="<kernel modules directory>" +
+ Specify the directory, where to look for kernel modules +
+fw_dir+=" :<dir>[:<dir> …] " +
+ Specify additional directories, where to look for firmwares, separated by : +
+install_items+=<file>[ <file> …] " +
+ Specify additional files to include in the initramfs, separated by spaces. +
+install_optional_items+=<file>[ <file> …] " +
+ Specify additional files to include in the initramfs, separated by spaces, + if they exist. +
+compress="{cat|bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args …]>}" +
+ Compress the generated initramfs using the passed compression program. If + you pass it just the name of a compression program, it will call that + program with known-working arguments. If you pass arguments, it will be called + with exactly those arguments. Depending on what you pass, this may result in + an initramfs that the kernel cannot decompress. + To disable compression, use "cat". +
+do_strip="{yes|no}" +
+ Strip binaries in the initramfs (default=yes) +
+hostonly="{yes|no}" +
+ Host-Only mode: Install only what is needed for booting the local host + instead of a generic host and generate host-specific configuration. +
+hostonly_cmdline="{yes|no}" +
+ If set to "yes", store the kernel command line arguments needed in the initramfs +
+persistent_policy="<policy>" +
+ Use <policy> to address disks and partitions. + <policy> can be any directory name found in /dev/disk. + E.g. "by-uuid", "by-label" +
+tmpdir="<temporary directory>" +
+ Specify temporary directory to use. +

Warning

If chrooted to another root other than the real root device, use --fstab and +provide a valid /etc/fstab.

+use_fstab="{yes|no}" +
+ Use /etc/fstab instead of /proc/self/mountinfo. +
+add_fstab+=<filename> " +
+ Add entries of <filename> to the initramfs /etc/fstab. +
+add_device+=<device> " +
+ Bring up <device> in initramfs, <device> should be the device name. + This can be useful in hostonly mode for resume support when your swap is on + LVM an encrypted partition. +
+mdadmconf="{yes|no}" +
+ Include local /etc/mdadm.conf (default=yes) +
+lvmconf="{yes|no}" +
+ Include local /etc/lvm/lvm.conf (default=yes) +
+fscks=<fsck tools> " +
+ Add a space-separated list of fsck tools. If nothing is specified, the + default is: "umount mount /sbin/fsck* xfs_db xfs_check xfs_repair e2fsck + jfs_fsck reiserfsck btrfsck". The installation is opportunistic + (non-existing tools are ignored). +
+nofscks="{yes|no}" +
+ If specified, inhibit installation of any fsck tools. +
+ro_mnt="{yes|no}" +
+ Mount / and /usr read-only by default. +
+kernel_cmdline="parameters" +
+ Specify default kernel command line parameters +
+kernel_only="{yes|no}" +
+ Only install kernel drivers and firmware files. (default=no) +
+no_kernel="{yes|no}" +
+ Do not install kernel drivers and firmware files (default=no) +
+acpi_override="{yes|no}" +
+ [WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! + Override BIOS provided ACPI tables. For further documentation read + Documentation/acpi/initrd_table_override.txt in the kernel sources. + Search for ACPI table files (must have .aml suffix) in acpi_table_dir= + directory (see below) and add them to a separate uncompressed cpio + archive. This cpio archive gets glued (concatenated, uncompressed one + must be the first one) to the compressed cpio archive. The first, + uncompressed cpio archive is for data which the kernel must be able + to access very early (and cannot make use of uncompress algorithms yet) + like microcode or ACPI tables (default=no). +
+acpi_table_dir="<dir>" +
+ Directory to search for ACPI tables if acpi_override= is set to yes. +
+early_microcode="{yes|no}" +
+ Combine early microcode with ramdisk (default=yes) +
+stdloglvl="{0-6}" +
+ Set logging to standard error level. +
+sysloglvl="{0-6}" +
+ Set logging to syslog level. +
+fileloglvl="{0-6}" +
+ Set logging to file level. +
+logfile="<file>" +
+ Path to log file. +
+show_modules="{yes|no}" +
+ Print the name of the included modules to standard output during build. +
+i18n_vars="<variable mapping>" +
+ Distribution specific variable mapping. + See dracut/modules.d/10i18n/README for a detailed description. +
+i18n_default_font="<fontname>" +
+ The font <fontname> to install, if not specified otherwise. + Default is "eurlatgr". +
+i18n_install_all="{yes|no}" +
+ Install everything regardless of generic or hostonly mode. +
+reproducible="{yes|no}" +
+ Create reproducible images. +
+loginstall="<DIR>" +
+ Log all files installed from the host to <DIR>. +
+uefi_stub="<FILE>" +
+ Specifies the UEFI stub loader, which will load the attached kernel, initramfs and + kernel command line and boots the kernel. The default is + /lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub +
+uefi_splash_image="<FILE>" +
+ Specifies the UEFI stub loader’s splash image. Requires bitmap (.bmp) image format. +
+uefi_secureboot_cert="<FILE>", uefi_secureboot_key="<FILE>" +
+ Specifies a certificate and corresponding key, which are used to sign the created UEFI executable. + Requires both certificate and key need to be specified and sbsign to be installed. +
+kernel_image="<FILE>" +
+ Specifies the kernel image, which to include in the UEFI executable. The default is + /lib/modules/<KERNEL-VERSION>/vmlinuz or /boot/vmlinuz-<KERNEL-VERSION> +

Files

+/etc/dracut.conf +
+ Old configuration file. You better use your own file in + /etc/dracut.conf.d/. +
+/etc/dracut.conf.d/ +
+ Any /etc/dracut.conf.d/*.conf file can override the values in + /etc/dracut.conf. The configuration files are read in alphanumerical + order. +

AUTHOR

Harald Hoyer

See Also

dracut(8) dracut.cmdline(7)

Chapter 8. DRACUT.CMDLINE(7)

NAME

dracut.cmdline - dracut kernel command line options

DESCRIPTION

The root device used by the kernel is specified in the boot configuration +file on the kernel command line, as always.

The traditional root=/dev/sda1 style device specification is allowed, but not +encouraged. The root device should better be identified by LABEL or UUID. If a +label is used, as in root=LABEL=<label_of_root> the initramfs will search all +available devices for a filesystem with the appropriate label, and mount that +device as the root filesystem. root=UUID=<uuidnumber> will mount the partition +with that UUID as the root filesystem.

In the following all kernel command line parameters, which are processed by +dracut, are described.

"rd.*" parameters mentioned without "=" are boolean parameters. They can be +turned on/off by setting them to {0|1}. If the assignment with "=" is missing +"=1" is implied. For example rd.info can be turned off with rd.info=0 or +turned on with rd.info=1 or rd.info. The last value in the kernel command +line is the value, which is honored.

Standard

+init=<path to real init> +
+ specify the path to the init program to be started after the initramfs has + finished +
+root=<path to blockdevice> +

+ specify the block device to use as the root filesystem. +

Example.  +

root=/dev/sda1
+root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
+root=/dev/disk/by-label/Root
+root=LABEL=Root
+root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
+root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7

+

+rootfstype=<filesystem type> +

+"auto" if not specified. +

Example.  +

rootfstype=ext3

+

+rootflags=<mount options> +
+ specify additional mount options for the root filesystem. If not set, + /etc/fstab of the real root will be parsed for special mount options and + mounted accordingly. +
+ro +
+ force mounting / and /usr (if it is a separate device) read-only. If + none of ro and rw is present, both are mounted according to /etc/fstab. +
+rw +
+ force mounting / and /usr (if it is a separate device) read-write. + See also ro option. +
+rootfallback=<path to blockdevice> +
+ specify the block device to use as the root filesystem, if the normal root + cannot be found. This can only be a simple block device with a simple file + system, for which the filesystem driver is either compiled in, or added + manually to the initramfs. This parameter can be specified multiple times. +
+rd.auto rd.auto=1 +
+ enable autoassembly of special devices like cryptoLUKS, dmraid, mdraid or + lvm. Default is off as of dracut version >= 024. +
+rd.hostonly=0 +
+ removes all compiled in configuration of the host system the initramfs image + was built on. This helps booting, if any disk layout changed, especially in + combination with rd.auto or other parameters specifying the layout. +
+rd.cmdline=ask +
+ prompts the user for additional kernel command line parameters +
+rd.fstab=0 +
+ do not honor special mount options for the root filesystem found in + /etc/fstab of the real root. +
+resume=<path to resume partition> +

+ resume from a swap partition +

Example.  +

resume=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
+resume=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7

+

+rd.skipfsck +
+ skip fsck for rootfs and /usr. If you’re mounting /usr read-only and + the init system performs fsck before remount, you might want to use this + option to avoid duplication. +

iso-scan/filename

Mount all mountable devices and search for ISO pointed by the argument. When +the ISO is found set it up as a loop device. Device containing this ISO +image will stay mounted at /run/initramfs/isoscandev. +Using iso-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work +by copying the original kernel cmdline parameters.

Example.  +

menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class os {
+    set isolabel=Fedora-Live-LXDE-x86_64-20-1
+    set isofile="/boot/iso/Fedora-Live-LXDE-x86_64-20-1.iso"
+    loopback loop $isofile
+    linux (loop)/isolinux/vmlinuz0 boot=isolinux iso-scan/filename=$isofile root=live:LABEL=$isolabel ro rd.live.image quiet rhgb
+    initrd (loop)/isolinux/initrd0.img
+}

+

Misc

+rd.emergency=[reboot|poweroff|halt] +
+ specify, what action to execute in case of a critical failure. rd.shell=0 also + be specified. +
+rd.driver.blacklist=<drivername>[,<drivername>,…] +
+ do not load kernel module <drivername>. This parameter can be specified + multiple times. +
+rd.driver.pre=<drivername>[,<drivername>,…] +
+ force loading kernel module <drivername>. This parameter can be specified + multiple times. +
+rd.driver.post=<drivername>[,<drivername>,…] +
+ force loading kernel module <drivername> after all automatic loading modules + have been loaded. This parameter can be specified multiple times. +
+rd.retry=<seconds> +
+ specify how long dracut should retry the initqueue to configure devices. + The default is 30 seconds. After 2/3 of the time, degraded raids are force + started. If you have hardware, which takes a very long time to announce its + drives, you might want to extend this value. +
+rd.timeout=<seconds> +
+ specify how long dracut should wait for devices to appear. The + default is 0, which means forever. Note that this timeout + should be longer than rd.retry to allow for proper configuration. +
+rd.noverifyssl +
+ accept self-signed certificates for ssl downloads. +
+rd.ctty=<terminal device> +
+ specify the controlling terminal for the console. + This is useful, if you have multiple "console=" arguments. +
+rd.shutdown.timeout.umount=<seconds> +
+ specify how long dracut should wait for an individual umount to finish + during shutdown. This avoids the system from blocking when unmounting a file + system cannot complete and waits indefinitely. Value 0 means to wait + forever. The default is 90 seconds. +

Debug

If you are dropped to an emergency shell, the file +/run/initramfs/rdsosreport.txt is created, which can be saved to a (to be +mounted by hand) partition (usually /boot) or a USB stick. Additional debugging +info can be produced by adding rd.debug to the kernel command line. +/run/initramfs/rdsosreport.txt contains all logs and the output of some tools. +It should be attached to any report about dracut problems.

+rd.info +
+ print informational output though "quiet" is set +
+rd.shell +
+ allow dropping to a shell, if root mounting fails +
+rd.debug +
+ set -x for the dracut shell. + If systemd is active in the initramfs, all output is logged to the systemd + journal, which you can inspect with "journalctl -ab". + If systemd is not active, the logs are written to dmesg and + /run/initramfs/init.log. + If "quiet" is set, it also logs to the console. +
+rd.memdebug=[0-5] +

+ Print memory usage info at various points, set the verbose level from 0 to 5. +

Higher level means more debugging output:
    0 - no output
+    1 - partial /proc/meminfo
+    2 - /proc/meminfo
+    3 - /proc/meminfo + /proc/slabinfo
+    4 - /proc/meminfo + /proc/slabinfo + memstrack summary
+        NOTE: memstrack is a memory tracing tool that tracks the total memory
+              consumption, and peak memory consumption of each kernel modules
+              and userspace progress during the whole initramfs runtime, report
+              is genereted and the end of initramsfs run.
+    5 - /proc/meminfo + /proc/slabinfo + memstrack (with top memory stacktrace)
+        NOTE: memstrack (with top memory stacktrace) will print top memory
+              allocation stack traces during the whole initramfs runtime.
+rd.break +
+ drop to a shell at the end +
+rd.break={cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup} +
+ drop to a shell on defined breakpoint +
+rd.udev.info +
+ set udev to loglevel info +
+rd.udev.debug +
+ set udev to loglevel debug +

I18N

+rd.vconsole.keymap=<keymap base file name> +

+ keyboard translation table loaded by loadkeys; taken from keymaps directory; + will be written as KEYMAP to /etc/vconsole.conf in the initramfs. +

Example.  +

rd.vconsole.keymap=de-latin1-nodeadkeys

+

+rd.vconsole.keymap.ext=<list of keymap base file names> +
+ list of extra keymaps to bo loaded (sep. by space); will be written as + EXT_KEYMAP to /etc/vconsole.conf in the initramfs +
+rd.vconsole.unicode +
+ boolean, indicating UTF-8 mode; will be written as UNICODE to + /etc/vconsole.conf in the initramfs +
+rd.vconsole.font=<font base file name> +

+ console font; taken from consolefonts directory; will be written as FONT to + /etc/vconsole.conf in the initramfs. +

Example.  +

rd.vconsole.font=eurlatgr

+

+rd.vconsole.font.map=<console map base file name> +
+ see description of -m parameter in setfont manual; taken from consoletrans + directory; will be written as FONT_MAP to /etc/vconsole.conf in the + initramfs +
+rd.vconsole.font.unimap=<unicode table base file name> +
+ see description of -u parameter in setfont manual; taken from unimaps + directory; will be written as FONT_UNIMAP to /etc/vconsole.conf in the + initramfs +
+rd.locale.LANG=<locale> +

+ taken from the environment; if no UNICODE is defined we set its value in + basis of LANG value (whether it ends with ".utf8" (or similar) or not); will + be written as LANG to /etc/locale.conf in the initramfs. +

Example.  +

rd.locale.LANG=pl_PL.utf8

+

+rd.locale.LC_ALL=<locale> +
+ taken from the environment; will be written as LC_ALL to /etc/locale.conf + in the initramfs +

LVM

+rd.lvm=0 +
+ disable LVM detection +
+rd.lvm.vg=<volume group name> +
+ only activate all logical volumes in the the volume groups with the given name. + rd.lvm.vg can be specified multiple times on the kernel command line. +
+rd.lvm.lv=<volume group name>/<logical volume name> +
+ only activate the logical volumes with the given name. + rd.lvm.lv can be specified multiple times on the kernel command line. +
+rd.lvm.conf=0 +
+ remove any /etc/lvm/lvm.conf, which may exist in the initramfs +

crypto LUKS

+rd.luks=0 +
+ disable crypto LUKS detection +
+rd.luks.uuid=<luks uuid> +
+ only activate the LUKS partitions with the given UUID. Any "luks-" of the + LUKS UUID is removed before comparing to <luks uuid>. + The comparisons also matches, if <luks uuid> is only the beginning of the + LUKS UUID, so you don’t have to specify the full UUID. + This parameter can be specified multiple times. + <luks uuid> may be prefixed by the keyword keysource:, see + rd.luks.key below. +
+rd.luks.allow-discards=<luks uuid> +
+ Allow using of discards (TRIM) requests for LUKS partitions with the given + UUID. Any "luks-" of the LUKS UUID is removed before comparing to + <luks uuid>. The comparisons also matches, if <luks uuid> is only the + beginning of the LUKS UUID, so you don’t have to specify the full UUID. + This parameter can be specified multiple times. +
+rd.luks.allow-discards +
+ Allow using of discards (TRIM) requests on all LUKS partitions. +
+rd.luks.crypttab=0 +
+ do not check, if LUKS partition is in /etc/crypttab +
+rd.luks.timeout=<seconds> +
+ specify how long dracut should wait when waiting for the user to enter the + password. This avoid blocking the boot if no password is entered. It does + not apply to luks key. The default is 0, which means forever. +

crypto LUKS - key on removable device support

NB: If systemd is included in the dracut initrd, dracut’s built in +removable device keying support won’t work. systemd will prompt for +a password from the console even if you’ve supplied rd.luks.key. +You may be able to use standard systemd fstab(5) syntax to +get the same effect. If you do need rd.luks.key to work, +you will have to exclude the "systemd" dracut module and any modules +that depend on it. See dracut.conf(5) and +https://bugzilla.redhat.com/show_bug.cgi?id=905683 for more +information.

+rd.luks.key=<keypath>[:<keydev>[:<luksdev>]] +

+ <keypath> is the pathname of a key file, relative to the root + of the filesystem on some device. It’s REQUIRED. When + <keypath> ends with .gpg it’s considered to be key encrypted + symmetrically with GPG. You will be prompted for the GPG password on + boot. GPG support comes with the crypt-gpg module, which needs to be + added explicitly. +

<keydev> identifies the device on which the key file resides. It may +be the kernel name of the device (should start with "/dev/"), a UUID +(prefixed with "UUID=") or a label (prefix with "LABEL="). You don’t +have to specify a full UUID. Just its beginning will suffice, even if +its ambiguous. All matching devices will be probed. This parameter is +recommended, but not required. If it’s not present, all block devices will +be probed, which may significantly increase boot time.

If <luksdev> is given, the specified key will only be used for +the specified LUKS device. Possible values are the same as for +<keydev>. Unless you have several LUKS devices, you don’t have to +specify this parameter. The simplest usage is:

Example.  +

rd.luks.key=/foo/bar.key

+

As you see, you can skip colons in such a case.

Note

Your LUKS partition must match your key file.

dracut provides keys to cryptsetup with -d (an older alias for +--key-file). This uses the entire binary +content of the key file as part of the secret. If +you pipe a password into cryptsetup without -d or --key-file, +it will be treated as text user input, and only characters before +the first newline will be used. Therefore, when you’re creating +an encrypted partition for dracut to mount, and you pipe a key into +cryptsetup luksFormat,you must use -d -.

Here is an example for a key encrypted with GPG (warning: +--batch-mode will overwrite the device without asking for +confirmation):

gpg --quiet --decrypt rootkey.gpg | \
+cryptsetup --batch-mode --key-file - \
+           luksFormat /dev/sda47

If you use unencrypted key files, just use the key file pathname +instead of the standard input. For a random key with 256 bits of +entropy, you might use:

head -32c /dev/urandom > rootkey.key
+cryptsetup --batch-mode --key-file rootkey.key \
+           luksFormat /dev/sda47

You can also use regular key files on an encrypted keydev.

Compared to using GPG encrypted keyfiles on an unencrypted +device this provides the following advantages:

  • +you can unlock your disk(s) using multiple passphrases +
  • +better security by not loosing the key stretching mechanism +

To use an encrypted keydev you must ensure that it becomes +available by using the keyword keysource, e.g. +rd.luks.uuid=keysource:aaaa +aaaa being the uuid of the encrypted keydev.

Example:

Lets assume you have three disks A, B and C with the uuids +aaaa, bbbb and cccc. +You want to unlock A and B using keyfile keyfile. +The unlocked volumes be A', B' and C' with the uuids +AAAA, BBBB and CCCC. +keyfile is saved on C' as /keyfile.

One luks keyslot of each A, B and C is setup with a +passphrase. +Another luks keyslot of each A and B is setup with keyfile.

To boot this configuration you could use:

rd.luks.uuid=aaaa
+rd.luks.uuid=bbbb
+rd.luks.uuid=keysource:cccc
+rd.luks.key=/keyfile:UUID=CCCC

Dracut asks for the passphrase for C and uses the +keyfile to unlock A and B. +If getting the passphrase for C fails it falls back to +asking for the passphrases for A and B.

If you want C' to stay unlocked, specify a luks name for +it, e.g. rd.luks.name=cccc=mykeys, otherwise it gets closed +when not needed anymore.

MD RAID

+rd.md=0 +
+ disable MD RAID detection +
+rd.md.imsm=0 +
+ disable MD RAID for imsm/isw raids, use DM RAID instead +
+rd.md.ddf=0 +
+ disable MD RAID for SNIA ddf raids, use DM RAID instead +
+rd.md.conf=0 +
+ ignore mdadm.conf included in initramfs +
+rd.md.waitclean=1 +
+ wait for any resync, recovery, or reshape activity to finish before + continuing +
+rd.md.uuid=<md raid uuid> +
+ only activate the raid sets with the given UUID. This parameter can be + specified multiple times. +

DM RAID

+rd.dm=0 +
+ disable DM RAID detection +
+rd.dm.uuid=<dm raid uuid> +
+ only activate the raid sets with the given UUID. This parameter can be + specified multiple times. +

MULTIPATH

+rd.multipath=0 +
+ disable multipath detection +
+rd.multipath=default +
+ use default multipath settings +

FIPS

+rd.fips +
+ enable FIPS +
+boot=<boot device> +

+ specify the device, where /boot is located. +

Example.  +

boot=/dev/sda1
+boot=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
+boot=UUID=<uuid>
+boot=LABEL=<label>

+

+rd.fips.skipkernel +
+ skip checksum check of the kernel image. Useful, if the kernel image is not + in a separate boot partition. +

Network

Important

It is recommended to either bind an interface to a MAC with the ifname +argument, or to use the systemd-udevd predictable network interface names.

Predictable network interface device names based on:

  • +firmware/bios-provided index numbers for on-board devices +
  • +firmware-provided pci-express hotplug slot index number +
  • +physical/geographical location of the hardware +
  • +the interface’s MAC address +

See: +http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames

Two character prefixes based on the type of interface:

+en +
+ethernet +
+wl +
+wlan +
+ww +
+wwan +

Type of names:

+o<index> +
+on-board device index number +
+s<slot>[f<function>][d<dev_id>] +
+hotplug slot index number +
+x<MAC> +
+MAC address +
+[P<domain>]p<bus>s<slot>[f<function>][d<dev_id>] +
+PCI geographical location +
+[P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>] +
+USB port number chain +

All multi-function PCI devices will carry the [f<function>] number in the +device name, including the function 0 device.

When using PCI geography, The PCI domain is only prepended when it is not 0.

For USB devices the full chain of port numbers of hubs is composed. If the +name gets longer than the maximum number of 15 characters, the name is not +exported. +The usual USB configuration == 1 and interface == 0 values are suppressed.

+PCI ethernet card with firmware index "1" +
  • +eno1 +
+PCI ethernet card in hotplug slot with firmware index number +
  • +ens1 +
+PCI ethernet multi-function card with 2 ports +
  • +enp2s0f0 +
  • +enp2s0f1 +
+PCI wlan card +
  • +wlp3s0 +
+USB built-in 3G modem +
  • +wwp0s29u1u4i6 +
+USB Android phone +
  • +enp0s29u1u2 +
+ip={dhcp|on|any|dhcp6|auto6|either6|link6|single-dhcp} +
+dhcp|on|any +
+get ip from dhcp server from all interfaces. If netroot=dhcp, + loop sequentially through all interfaces (eth0, eth1, …) and use the first + with a valid DHCP root-path. +
+single-dhcp +
+Send DHCP on all available interfaces in parallel, as + opposed to one after another. After the first DHCP response is received, + stop DHCP on all other interfaces. This gives the fastest boot time by + using the IP on interface for which DHCP succeeded first during early boot. + Caveat: Does not apply to Network Manager and to SUSE using wicked. +
+auto6 +
+IPv6 autoconfiguration +
+dhcp6 +
+IPv6 DHCP +
+either6 +
+if auto6 fails, then dhcp6 +
+link6 +
+bring up interface for IPv6 link-local addressing +
+ip=<interface>:{dhcp|on|any|dhcp6|auto6|link6}[:[<mtu>][:<macaddr>]] +

+ This parameter can be specified multiple times. +

+dhcp|on|any|dhcp6 +
+get ip from dhcp server on a specific interface +
+auto6 +
+do IPv6 autoconfiguration +
+link6 +
+bring up interface for IPv6 link local address +
+<macaddr> +
+optionally set <macaddr> on the <interface>. This +cannot be used in conjunction with the ifname argument for the +same <interface>. +
+ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<mtu>][:<macaddr>]] +

+ explicit network configuration. If you want do define a IPv6 address, put it + in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple + times. <peer> is optional and is the address of the remote endpoint + for pointopoint interfaces and it may be followed by a slash and a decimal + number, encoding the network prefix length. +

+<macaddr> +
+optionally set <macaddr> on the <interface>. This +cannot be used in conjunction with the ifname argument for the +same <interface>. +
+ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]] +
+ explicit network configuration. If you want do define a IPv6 address, put it + in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple + times. <peer> is optional and is the address of the remote endpoint + for pointopoint interfaces and it may be followed by a slash and a decimal + number, encoding the network prefix length. +
+ifname=<interface>:<MAC> +

+ Assign network device name <interface> (i.e. "bootnet") to the NIC with + MAC <MAC>. +

Warning

Do not use the default kernel naming scheme for the interface name, +as it can conflict with the kernel names. So, don’t use "eth[0-9]+" for the +interface name. Better name it "bootnet" or "bluesocket".

+rd.route=<net>/<netmask>:<gateway>[:<interface>] +

+ Add a static route with route options, which are separated by a colon. + IPv6 addresses have to be put in brackets. +

Example.  +

    rd.route=192.168.200.0/24:192.168.100.222:ens10
+    rd.route=192.168.200.0/24:192.168.100.222
+    rd.route=192.168.200.0/24::ens10
+    rd.route=[2001:DB8:3::/8]:[2001:DB8:2::1]:ens10

+

+bootdev=<interface> +
+ specify network interface to use routing and netroot information from. + Required if multiple ip= lines are used. +
+BOOTIF=<MAC> +
+ specify network interface to use routing and netroot information from. +
+rd.bootif=0 +
+ Disable BOOTIF parsing, which is provided by PXE +
+nameserver=<IP> [nameserver=<IP> …] +
+ specify nameserver(s) to use +
+rd.peerdns=0 +
+ Disable DNS setting of DHCP parameters. +
+biosdevname=0 +
+ boolean, turn off biosdevname network interface renaming +
+rd.neednet=1 +
+ boolean, bring up network even without netroot set +
+vlan=<vlanname>:<phydevice> +
+ Setup vlan device named <vlanname> on <phydevice>. + We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005), + VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), + DEV_PLUS_VID_NO_PAD (eth0.5) +
+bond=<bondname>[:<bondslaves>:[:<options>[:<mtu>]]] +
+ Setup bonding device <bondname> on top of <bondslaves>. + <bondslaves> is a comma-separated list of physical (ethernet) interfaces. + <options> is a comma-separated list on bonding options (modinfo bonding for + details) in format compatible with initscripts. If <options> includes + multi-valued arp_ip_target option, then its values should be separated by + semicolon. if the mtu is specified, it will be set on the bond master. + Bond without parameters assumes + bond=bond0:eth0,eth1:mode=balance-rr +
+team=<teammaster>:<teamslaves>[:<teamrunner>] +
+ Setup team device <teammaster> on top of <teamslaves>. + <teamslaves> is a comma-separated list of physical (ethernet) interfaces. + <teamrunner> is the runner type to be used (see teamd.conf(5)); defaults to + activebackup. + Team without parameters assumes + team=team0:eth0,eth1:activebackup +
+bridge=<bridgename>:<ethnames> +
+ Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated + list of physical (ethernet) interfaces. Bridge without parameters assumes + bridge=br0:eth0 +

NFS

+root=[<server-ip>:]<root-dir>[:<nfs-options>] +
+ mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given, use + dhcp next_server. If server-ip is an IPv6 address it has to be put in + brackets, e.g. [2001:DB8::1]. NFS options can be appended with the prefix + ":" or "," and are separated by ",". +
+root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>], root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>], root={dhcp|dhcp6} +

+ netroot=dhcp alone directs initrd to look at the DHCP root-path where NFS + options can be specified. +

Example.  +

    root-path=<server-ip>:<root-dir>[,<nfs-options>]
+    root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
+    root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]

+

+root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[:<nfs-options>] +
+ Deprecated! kernel Documentation_/filesystems/nfsroot.txt_ defines this + method. This is supported by dracut, but not recommended. +
+rd.nfs.domain=<NFSv4 domain name> +
+ Set the NFSv4 domain name. Will override the settings in /etc/idmap.conf. +
+rd.net.dhcp.retry=<cnt> +
+ If this option is set, dracut will try to connect via dhcp <cnt> times before failing. + Default is 1. +
+rd.net.timeout.dhcp=<arg> +
+ If this option is set, dhclient is called with "-timeout <arg>". +
+rd.net.timeout.iflink=<seconds> +
+ Wait <seconds> until link shows up. Default is 60 seconds. +
+rd.net.timeout.ifup=<seconds> +
+ Wait <seconds> until link has state "UP". Default is 20 seconds. +
+rd.net.timeout.route=<seconds> +
+ Wait <seconds> until route shows up. Default is 20 seconds. +
+rd.net.timeout.ipv6dad=<seconds> +
+ Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds. +
+rd.net.timeout.ipv6auto=<seconds> +
+ Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds. +
+rd.net.timeout.carrier=<seconds> +
+ Wait <seconds> until carrier is recognized. Default is 10 seconds. +

CIFS

+root=cifs://[<username>[:<password>]@]<server-ip>:<root-dir> +

+ mount cifs share from <server-ip>:/<root-dir>, if no server-ip is given, use + dhcp next_server. if server-ip is an IPv6 address it has to be put in + brackets, e.g. [2001:DB8::1]. If a username or password are not specified +as part of the root, then they must be passed on the command line through +cifsuser/cifspass. +

Warning

Passwords specified on the kernel command line are visible for all +users via the file /proc/cmdline and via dmesg or can be sniffed on the +network, when using DHCP with DHCP root-path.

+cifsuser=<username> +
+ Set the cifs username, if not specified as part of the root. +
+cifspass=<password> +

+ Set the cifs password, if not specified as part of the root. +

Warning

Passwords specified on the kernel command line are visible for all +users via the file /proc/cmdline and via dmesg or can be sniffed on the +network, when using DHCP with DHCP root-path.

iSCSI

+root=iscsi:[<username>:<password>[:<reverse>:<password>]@][<servername>]:[<protocol>]:[<port>][:[<iscsi_iface_name>]:[<netdev_name>]]:[<LUN>]:<targetname> +

+ protocol defaults to "6", LUN defaults to "0". If the "servername" field is + provided by BOOTP or DHCP, then that field is used in conjunction with other + associated fields to contact the boot server in the Boot stage. However, if + the "servername" field is not provided, then the "targetname" field is then + used in the Discovery Service stage in conjunction with other associated + fields. See + rfc4173. +

Warning

Passwords specified on the kernel command line are visible for all +users via the file /proc/cmdline and via dmesg or can be sniffed on the +network, when using DHCP with DHCP root-path.

Example.  +

root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0

+

If servername is an IPv6 address, it has to be put in brackets:

Example.  +

root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0

+

+root=??? netroot=iscsi:[<username>:<password>[:<reverse>:<password>]@][<servername>]:[<protocol>]:[<port>][:[<iscsi_iface_name>]:[<netdev_name>]]:[<LUN>]:<targetname> … +

+ multiple netroot options allow setting up multiple iscsi disks: +

Example.  +

root=UUID=12424547
+netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
+netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1

+

If servername is an IPv6 address, it has to be put in brackets:

Example.  +

netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0

+

Warning

Passwords specified on the kernel command line are visible for all +users via the file /proc/cmdline and via dmesg or can be sniffed on the +network, when using DHCP with DHCP root-path. +You may want to use rd.iscsi.firmware.

+root=??? rd.iscsi.initiator=<initiator> rd.iscsi.target.name=<target name> rd.iscsi.target.ip=<target ip> rd.iscsi.target.port=<target port> rd.iscsi.target.group=<target group> rd.iscsi.username=<username> rd.iscsi.password=<password> rd.iscsi.in.username=<in username> rd.iscsi.in.password=<in password> +

+ manually specify all iscsistart parameter (see iscsistart --help) +

Warning

Passwords specified on the kernel command line are visible for all +users via the file /proc/cmdline and via dmesg or can be sniffed on the +network, when using DHCP with DHCP root-path. +You may want to use rd.iscsi.firmware.

+root=??? netroot=iscsi rd.iscsi.firmware=1 +
+ will read the iscsi parameter from the BIOS firmware +
+rd.iscsi.login_retry_max=<num> +
+ maximum number of login retries +
+rd.iscsi.param=<param> +

+ <param> will be passed as "--param <param>" to iscsistart. + This parameter can be specified multiple times. +

Example.  +

"netroot=iscsi rd.iscsi.firmware=1 rd.iscsi.param=node.session.timeo.replacement_timeout=30"

+

will result in

iscsistart -b --param node.session.timeo.replacement_timeout=30

rd.iscsi.ibft rd.iscsi.ibft=1: + Turn on iBFT autoconfiguration for the interfaces

rd.iscsi.mp rd.iscsi.mp=1: + Configure all iBFT interfaces, not only used for booting (multipath)

rd.iscsi.waitnet=0: + Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.

rd.iscsi.testroute=0: + Turn off checking, if the route to the iSCSI target IP is possible before trying to login.

FCoE

+rd.fcoe=0 +
+ disable FCoE and lldpad +
+fcoe=<edd|interface|MAC>:{dcb|nodcb}:{fabric|vn2vn} +

+ Try to connect to a FCoE SAN through the NIC specified by <interface> or + <MAC> or EDD settings. The second argument specifies if DCB + should be used. The optional third argument specifies whether + fabric or VN2VN mode should be used. + This parameter can be specified multiple times. +

Note

letters in the MAC-address must be lowercase!

NVMf

+rd.nvmf.hostnqn=<hostNQN> +
+ NVMe host NQN to use +
+rd.nvmf.hostid=<hostID> +
+ NVMe host id to use +
+rd.nvmf.discover={rdma|fc|tcp},<traddr>,[<host_traddr>],[<trsvcid>] +
+ Discover and connect to a NVMe-over-Fabric controller specified by + <traddr> and the optionally <host_traddr> or <trsvcid>. + The first argument specifies the transport to use; currently only + rdma, fc, or tcp are supported. + The <traddr> parameter can be set to auto to select + autodiscovery; in that case all other parameters are ignored. + This parameter can be specified multiple times. +

NBD

+root=??? netroot=nbd:<server>:<port/exportname>[:<fstype>[:<mountopts>[:<nbdopts>]]] +

+ mount nbd share from <server>. +

NOTE: + If "exportname" instead of "port" is given the standard port is used. + Newer versions of nbd are only supported with "exportname".

+root=/dev/root netroot=dhcp with dhcp root-path=nbd:<server>:<port/exportname>[:<fstype>[:<mountopts>[:<nbdopts>]]] +

+ netroot=dhcp alone directs initrd to look at the DHCP root-path where NBD + options can be specified. This syntax is only usable in cases where you are + directly mounting the volume as the rootfs. +

NOTE: + If "exportname" instead of "port" is given the standard port is used. + Newer versions of nbd are only supported with "exportname".

DASD

+rd.dasd=…. +
+ same syntax as the kernel module parameter (s390 only) +

ZFCP

+rd.zfcp=<zfcp adaptor device bus ID>,<WWPN>,<FCPLUN> +
+ rd.zfcp can be specified multiple times on the kernel command + line. +
+rd.zfcp=<zfcp adaptor device bus ID> +

+ If NPIV is enabled and the allow_lun_scan parameter to the zfcp + module is set to Y then the zfcp adaptor will be initiating a + scan internally and the <WWPN> and <FCPLUN> parameters can be omitted. +

Example.  +

rd.zfcp=0.0.4000,0x5005076300C213e9,0x5022000000000000
+rd.zfcp=0.0.4000

+

+rd.zfcp.conf=0 +
+ ignore zfcp.conf included in the initramfs +

ZNET

+rd.znet=<nettype>,<subchannels>,<options> +
+ The whole parameter is appended to /etc/ccw.conf, which is used on + RHEL/Fedora with ccw_init, which is called from udev for certain + devices on z-series. + rd.znet can be specified multiple times on the kernel command line. +
+rd.znet_ifname=<ifname>:<subchannels> +

+ Assign network device name <interface> (i.e. "bootnet") to the NIC + corresponds to the subchannels. This is useful when dracut’s default + "ifname=" doesn’t work due to device having a changing MAC address. +

Example.  +

rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
+rd.znet=ctc,0.0.0600,0.0.0601,protocol=bar

+

Booting live images

Dracut offers multiple options for live booted images:

+SquashFS with read-only filesystem image +

+The system will boot with a +read-only filesystem from the SquashFS and apply a writable Device-mapper +snapshot or an OverlayFS overlay mount for the read-only base filesystem. This +method ensures a relatively fast boot and lower RAM usage. Users must be +careful to avoid writing too many blocks to a snapshot volume. Once the +blocks of the snapshot overlay are exhausted, the root filesystem becomes +read-only and may cause application failures. The snapshot overlay file is +marked Overflow, and a difficult recovery is required to repair and enlarge +the overlay offline. Non-persistent overlays are sparse files in RAM that only +consume content space as required blocks are allocated. They default to an +apparent size of 32 GiB in RAM. The size can be adjusted with the +rd.live.overlay.size= kernel command line option. +

The filesystem structure is traditionally expected to be:

squashfs.img          |  SquashFS from LiveCD .iso
+   !(mount)
+   /LiveOS
+       |- rootfs.img  |  Filesystem image to mount read-only
+            !(mount)
+            /bin      |  Live filesystem
+            /boot     |
+            /dev      |
+            ...       |

For OverlayFS mount overlays, the filesystem structure may also be a direct +compression of the root filesystem:

squashfs.img          |  SquashFS from LiveCD .iso
+   !(mount)
+   /bin               |  Live filesystem
+   /boot              |
+   /dev               |
+   ...                |

Dracut uses one of the overlay methods of live booting by default. No +additional command line options are required other than root=live:<URL> to +specify the location of your squashed filesystem.

  • +The compressed SquashFS image can be copied during boot to RAM at +/run/initramfs/squashed.img by using the rd.live.ram=1 option. +
  • +A device with a persistent overlay can be booted read-only by using the +rd.live.overlay.readonly option on the kernel command line. This will +either cause a temporary, writable overlay to be stacked over a read-only +snapshot of the root filesystem or the OverlayFS mount will use an additional +lower layer with the root filesystem. +
+Uncompressed live filesystem image +

+When the live system was installed with the --skipcompress option of the +livecd-iso-to-disk installation script for Live USB devices, the root +filesystem image, rootfs.img, is expanded on installation and no SquashFS +is involved during boot. +

  • +If rd.live.ram=1 is used in this situation, the full, uncompressed +root filesystem is copied during boot to /run/initramfs/rootfs.img in the +/run tmpfs. +
  • +If rd.live.overlay=none is provided as a kernel command line option, +a writable, linear Device-mapper target is created on boot with no overlay. +
+Writable filesystem image +

+The system will retrieve a compressed filesystem image, extract it to +/run/initramfs/fsimg/rootfs.img, connect it to a loop device, create a +writable, linear Device-mapper target at /dev/mapper/live-rw, and mount that +as a writable volume at /. More RAM is required during boot but the live +filesystem is easier to manage if it becomes full. Users can make a filesystem +image of any size and that size will be maintained when the system boots. There +is no persistence of root filesystem changes between boots with this option. +

The filesystem structure is expected to be:

rootfs.tgz            |  Compressed tarball containing filesystem image
+   !(unpack)
+   /rootfs.img        |  Filesystem image at /run/initramfs/fsimg/
+      !(mount)
+      /bin            |  Live filesystem
+      /boot           |
+      /dev            |
+      ...             |

To use this boot option, ensure that rd.writable.fsimg=1 is in your kernel +command line and add the root=live:<URL> to specify the location +of your compressed filesystem image tarball or SquashFS image.

+rd.writable.fsimg=1 +

+Enables writable filesystem support. The system will boot with a fully +writable (but non-persistent) filesystem without snapshots (see notes above +about available live boot options). You can use the rootflags option to +set mount options for the live filesystem as well (see documentation about +rootflags in the Standard section above). +This implies that the whole image is copied to RAM before the boot continues. +

Note

There must be enough free RAM available to hold the complete image.

This method is very suitable for diskless boots.

+root=live:<url> +

+Boots a live image retrieved from <url>. Requires the dracut livenet +module. Valid handlers: http, https, ftp, torrent, tftp. +

Examples.  +

root=live:http://example.com/liveboot.img
+root=live:ftp://ftp.example.com/liveboot.img
+root=live:torrent://example.com/liveboot.img.torrent

+

+rd.live.debug=1 +
+Enables debug output from the live boot process. +
+rd.live.dir=<path> +
+Specifies the directory within the boot device where the squashfs.img or +rootfs.img can be found. By default, this is /LiveOS. +
+rd.live.squashimg=<filename of SquashFS image> +
+Specifies the filename for a SquashFS image of the root filesystem. +By default, this is squashfs.img. +
+rd.live.ram=1 +
+Copy the complete image to RAM and use this for booting. This is useful +when the image resides on, e.g., a DVD which needs to be ejected later on. +
+rd.live.overlay={<devspec>[:{<pathspec>|auto}]|none} +

+Manage the usage of a permanent overlay. +

  • +<devspec> specifies the path to a device with a mountable filesystem. +
  • +<pathspec> is the path to a file within that filesystem, which shall be +used to persist the changes made to the device specified by the +root=live:<url> option. +

    The default pathspec, when auto or no :<pathspec> is given, is +/<rd.live.dir>/overlay-<label>-<uuid>, where <label> is the +device LABEL, and <uuid> is the device UUID. +* none (the word itself) specifies that no overlay will be used, such as when +an uncompressed, writable live root filesystem is available.

    If a persistent overlay is detected at the standard LiveOS path, the +overlay & overlay type detected, whether Device-mapper or OverlayFS, will be +used.

Examples.  +

rd.live.overlay=/dev/sdb1:persistent-overlay.img
+rd.live.overlay=UUID=99440c1f-8daa-41bf-b965-b7240a8996f4

+

+rd.live.overlay.size=<size_MiB> +
+Specifies a non-persistent Device-mapper overlay size in MiB. The default is +32768. +
+rd.live.overlay.readonly=1 +
+This is used to boot with a normally read-write persistent overlay in a +read-only mode. With this option, either an additional, non-persistent, +writable snapshot overlay will be stacked over a read-only snapshot, +/dev/mapper/live‑ro, of the base filesystem with the persistent overlay, or a +read-only loop device, in the case of a writable rootfs.img, or an OverlayFS +mount will use the persistent overlay directory linked at /run/overlayfs‑r as +an additional lower layer along with the base root filesystem and apply a +transient, writable upper directory overlay, in order to complete the booted +root filesystem. +
+rd.live.overlay.reset=1 +
+Specifies that a persistent overlay should be reset on boot. All previous root +filesystem changes are vacated by this action. +
+rd.live.overlay.thin=1 +
+Enables the usage of thin snapshots instead of classic dm snapshots. +The advantage of thin snapshots is that they support discards, and will free +blocks that are not claimed by the filesystem. In this use case, this means +that memory is given back to the kernel when the filesystem does not claim it +anymore. +
+rd.live.overlay.overlayfs=1 +

+Enables the use of the OverlayFS kernel module, if available, to provide a +copy-on-write union directory for the root filesystem. OverlayFS overlays are +directories of the files that have changed on the read-only base (lower) +filesystem. The root filesystem is provided through a special overlay type +mount that merges the lower and upper directories. If an OverlayFS upper +directory is not present on the boot device, a tmpfs directory will be created +at /run/overlayfs to provide temporary storage. Persistent storage can be +provided on vfat or msdos formatted devices by supplying the OverlayFS upper +directory within an embedded filesystem that supports the creation of trusted.* +extended attributes and provides a valid d_type in readdir responses, such as +with ext4 and xfs. On non-vfat-formatted devices, a persistent OverlayFS +overlay can extend the available root filesystem storage up to the capacity of +the LiveOS disk device. +

If a persistent overlay is detected at the standard LiveOS path, the overlay & +overlay type detected, whether OverlayFS or Device-mapper, will be used.

The rd.live.overlay.readonly option, which allows a persistent overlayfs to +be mounted read-only through a higher level transient overlay directory, has +been implemented through the multiple lower layers feature of OverlayFS.

ZIPL

+rd.zipl=<path to blockdevice> +

+ Update the dracut commandline with the values found in the + dracut-cmdline.conf file on the given device. + The values are merged into the existing commandline values + and the udev events are regenerated. +

Example.  +

rd.zipl=UUID=0fb28157-99e3-4395-adef-da3f7d44835a

+

CIO_IGNORE

+rd.cio_accept=<device-ids> +

+ Remove the devices listed in <device-ids> from the default + cio_ignore kernel command-line settings. + <device-ids> is a list of comma-separated CCW device ids. + The default for this value is taken from the + /boot/zipl/active_devices.txt file. +

Example.  +

rd.cio_accept=0.0.0180,0.0.0800,0.0.0801,0.0.0802

+

Plymouth Boot Splash

+plymouth.enable=0 +
+ disable the plymouth bootsplash completely. +
+rd.plymouth=0 +
+ disable the plymouth bootsplash only for the initramfs. +

Kernel keys

+masterkey=<kernel master key path name> +

+ Set the path name of the kernel master key. +

Example.  +

masterkey=/etc/keys/kmk-trusted.blob

+

+masterkeytype=<kernel master key type> +

+ Set the type of the kernel master key. +

Example.  +

masterkeytype=trusted

+

+evmkey=<EVM key path name> +

+ Set the path name of the EVM key. +

Example.  +

evmkey=/etc/keys/evm-trusted.blob

+

+ecryptfskey=<eCryptfs key path name> +

+ Set the path name of the eCryptfs key. +

Example.  +

ecryptfskey=/etc/keys/ecryptfs-trusted.blob

+

Deprecated, renamed Options

Here is a list of options, which were used in dracut prior to version 008, and +their new replacement.

+rdbreak +
+rd.break +
+rd.ccw +
+rd.znet +
+rd_CCW +
+rd.znet +
+rd_DASD_MOD +
+rd.dasd +
+rd_DASD +
+rd.dasd +
+rdinitdebug rdnetdebug +
+rd.debug +
+rd_NO_DM +
+rd.dm=0 +
+rd_DM_UUID +
+rd.dm.uuid +
+rdblacklist +
+rd.driver.blacklist +
+rdinsmodpost +
+rd.driver.post +
+rdloaddriver +
+rd.driver.pre +
+rd_NO_FSTAB +
+rd.fstab=0 +
+rdinfo +
+rd.info +
+check +
+rd.live.check +
+rdlivedebug +
+rd.live.debug +
+live_dir +
+rd.live.dir +
+liveimg +
+rd.live.image +
+overlay +
+rd.live.overlay +
+readonly_overlay +
+rd.live.overlay.readonly +
+reset_overlay +
+rd.live.overlay.reset +
+live_ram +
+rd.live.ram +
+rd_NO_CRYPTTAB +
+rd.luks.crypttab=0 +
+rd_LUKS_KEYDEV_UUID +
+rd.luks.keydev.uuid +
+rd_LUKS_KEYPATH +
+rd.luks.keypath +
+rd_NO_LUKS +
+rd.luks=0 +
+rd_LUKS_UUID +
+rd.luks.uuid +
+rd_NO_LVMCONF +
+rd.lvm.conf +
+rd_LVM_LV +
+rd.lvm.lv +
+rd_NO_LVM +
+rd.lvm=0 +
+rd_LVM_SNAPSHOT +
+rd.lvm.snapshot +
+rd_LVM_SNAPSIZE +
+rd.lvm.snapsize +
+rd_LVM_VG +
+rd.lvm.vg +
+rd_NO_MDADMCONF +
+rd.md.conf=0 +
+rd_NO_MDIMSM +
+rd.md.imsm=0 +
+rd_NO_MD +
+rd.md=0 +
+rd_MD_UUID +
+rd.md.uuid +

rd_NO_MULTIPATH: rd.multipath=0

+rd_NFS_DOMAIN +
+rd.nfs.domain +
+iscsi_initiator +
+rd.iscsi.initiator +
+iscsi_target_name +
+rd.iscsi.target.name +
+iscsi_target_ip +
+rd.iscsi.target.ip +
+iscsi_target_port +
+rd.iscsi.target.port +
+iscsi_target_group +
+rd.iscsi.target.group +
+iscsi_username +
+rd.iscsi.username +
+iscsi_password +
+rd.iscsi.password +
+iscsi_in_username +
+rd.iscsi.in.username +
+iscsi_in_password +
+rd.iscsi.in.password +
+iscsi_firmware +
+rd.iscsi.firmware=0 +
+rd_NO_PLYMOUTH +
+rd.plymouth=0 +
+rd_retry +
+rd.retry +
+rdshell +
+rd.shell +
+rd_NO_SPLASH +
+rd.splash +
+rdudevdebug +
+rd.udev.debug +
+rdudevinfo +
+rd.udev.info +
+rd_NO_ZFCPCONF +
+rd.zfcp.conf=0 +
+rd_ZFCP +
+rd.zfcp +
+rd_ZNET +
+rd.znet +
+KEYMAP +
+vconsole.keymap +
+KEYTABLE +
+vconsole.keymap +
+SYSFONT +
+vconsole.font +
+CONTRANS +
+vconsole.font.map +
+UNIMAP +
+vconsole.font.unimap +
+UNICODE +
+vconsole.unicode +
+EXT_KEYMAP +
+vconsole.keymap.ext +

Configuration in the Initramfs

+/etc/conf.d/ +
+ Any files found in /etc/conf.d/ will be sourced in the initramfs to + set initial values. Command line options will override these values + set in the configuration files. +
+/etc/cmdline +
+ Can contain additional command line options. Deprecated, better use + /etc/cmdline.d/*.conf. +
+/etc/cmdline.d/*.conf +
+ Can contain additional command line options. +

AUTHOR

Harald Hoyer

SEE ALSO

dracut(8) dracut.conf(5)

Chapter 9. LSINITRD(1)

NAME

lsinitrd - tool to show the contents of an initramfs image

SYNOPSIS

lsinitrd [OPTION…] [<image> [<filename> [<filename> […] ]]]

lsinitrd [OPTION…] -k <kernel-version>

DESCRIPTION

lsinitrd shows the contents of an initramfs image. if <image> is omitted, then +lsinitrd uses the default image /boot/<machine-id>/<kernel-version>/initrd or +/boot/initramfs-<kernel-version>.img.

OPTIONS

+-h, --help +
+ print a help message and exit. +
+-s, --size +
+ sort the contents of the initramfs by size. +
+-f, --file <filename> +
+ print the contents of <filename>. +
+-k, --kver <kernel version> +
+ inspect the initramfs of <kernel version>. +
+-m, --mod +
+ list dracut modules included of the initramfs image. +
+--unpack +
+ unpack the initramfs to the current directory, instead of displaying the contents. + If optional filenames are given, will only unpack specified files, else the whole image will be unpacked. + Won’t unpack anything from early cpio part. +
+--unpackearly +
+ unpack the early microcode initramfs to the current directory, instead of displaying the contents. + Same as --unpack, but only unpack files from early cpio part. +
+-v, --verbose +
+ unpack verbosely +

AVAILABILITY

The lsinitrd command is part of the dracut package and is available from +https://dracut.wiki.kernel.org

AUTHORS

Harald Hoyer

Amerigo Wang

Nikoli

SEE ALSO

dracut(8)

Chapter 10. Developer Manual

Chapter 11. DRACUT.MODULES(7)

NAME

dracut.modules - dracut modules

DESCRIPTION

dracut uses a modular system to build and extend the initramfs image. All +modules are located in /usr/lib/dracut/modules.d or in <git-src>/modules.d. +The most basic dracut module is 99base. In 99base the initial shell script +init is defined, which gets run by the kernel after initramfs loading. Although +you can replace init with your own version of 99base, this is not encouraged. +Instead you should use, if possible, the hooks of dracut. All hooks, and the +point of time in which they are executed, are described in the section called “Boot Process Stages”.

The main script, which creates the initramfs is dracut itself. It parses all +arguments and sets up the directory, in which everything is installed. It then +executes all check, install, installkernel scripts found in the modules, which +are to be processed. After everything is installed, the install directory is +archived and compressed to the final initramfs image. All helper functions used +by check, install and installkernel are found in in the file dracut-functions. +These shell functions are available to all module installer (install, +installkernel) scripts, without the need to source dracut-functions.

A module can check the preconditions for install and installkernel with the +check script. Also dependencies can be expressed with check. If a module passed +check, install and installkernel will be called to install all of the necessary +files for the module. To split between kernel and non-kernel parts of the +installation, all kernel module related parts have to be in installkernel. All +other files found in a module directory are module specific and mostly are hook +scripts and udev rules.

Boot Process Stages

dracut modules can insert custom script at various points, to control the boot +process. +These hooks are plain directories containing shell scripts ending with ".sh", +which are sourced by init. +Common used functions are in dracut-lib.sh, which can be sourced by any script.

Hook: cmdline

The cmdline hook is a place to insert scripts to parse the kernel command line +and prepare the later actions, like setting up udev rules and configuration +files.

In this hook the most important environment variable is defined: root. The +second one is rootok, which indicates, that a module claimed to be able to parse +the root defined. So for example, root=iscsi:…. will be claimed by the +iscsi dracut module, which then sets rootok.

Hook: pre-udev

This hook is executed right after the cmdline hook and a check if root and +rootok were set. Here modules can take action with the final root, and before +udev has been run.

Start Udev

Now udev is started and the logging for udev is setup.

Hook: pre-trigger

In this hook, you can set udev environment variables with udevadm control +--property=KEY=value or control the further execution of udev with +udevadm.

Trigger Udev

udev is triggered by calling udevadm trigger, which sends add events for all +devices and subsystems.

Main Loop

In the main loop of dracut loops until udev has settled and +all scripts in initqueue/finished returned true. +In this loop there are three hooks, where scripts can be inserted +by calling /sbin/initqueue.

Initqueue

This hook gets executed every time a script is inserted here, regardless of the +udev state.

Initqueue settled

This hook (initqueue/settled) gets executed every time udev has settled.

Initqueue timeout

This hook (initqueue/timeout) gets executed, when the main loop counter becomes +half of the rd.retry counter.

Initqueue online

This hook (initqueue/online) gets executed whenever a network interface comes online +(that is, once it is up and configured by the configured network module).

Initqueue finished

This hook (initqueue/finished) is called after udev has settled and +if all scripts herein return 0 the main loop will be ended. +Arbitrary scripts can be added here, to loop in the +initqueue until something happens, which a dracut module wants to wait for.

Hook: pre-mount

Before the root device is mounted all scripts in the hook pre-mount are +executed. In some cases (e.g. NFS) the real root device is already mounted, +though.

Hook: mount

This hook is mainly to mount the real root device.

Hook: pre-pivot

This hook is called before cleanup hook, This is a good place for +actions other than cleanups which need to be called before pivot.

Hook: cleanup

This hook is the last hook and is called before init finally switches root to +the real root device. This is a good place to clean up and kill processes not +needed anymore.

Cleanup and switch_root

Init (or systemd) kills all udev processes, cleans up the environment, +sets up the arguments for the real init process and finally calls switch_root. +switch_root removes the whole filesystem hierarchy of the initramfs, +chroot()s to the real root device and calls /sbin/init with the specified +arguments.

To ensure all files in the initramfs hierarchy can be removed, all processes +still running from the initramfs should not have any open file descriptors left.

Network Infrastructure

FIXME

Writing a Module

A simple example module is 90kernel-modules, which modprobes a kernel module +after udev has settled and the basic device drivers have been loaded.

All module installation information is in the file module-setup.sh.

First we create a check() function, which just exits with 0 indicating that this +module should be included by default.

check():

return 0

Then we create the install() function, which installs a cmdline hook with +priority number 20 called parse-insmodpost.sh. It also installs the +insmodpost.sh script in /sbin.

install():

inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
+inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh

The parse-instmodpost.sh parses the kernel command line for a argument +rd.driver.post, blacklists the module from being autoloaded and installs the +hook insmodpost.sh in the initqueue/settled.

parse-insmodpost.sh:

for p in $(getargs rd.driver.post=); do
+    echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
+    _do_insmodpost=1
+done
+
+[ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh
+unset _do_insmodpost

insmodpost.sh, which is called in the initqueue/settled hook will just +modprobe the kernel modules specified in all rd.driver.post kernel command line +parameters. It runs after udev has settled and is only called once (--onetime).

insmodpost.sh:

. /lib/dracut-lib.sh
+
+for p in $(getargs rd.driver.post=); do
+    modprobe $p
+done

module-setup.sh: check()

check() is called by dracut to evaluate the inclusion of a dracut module in +the initramfs.

+$hostonly +
+If the $hostonly variable is set, then the module check() function +should be in "hostonly" mode, which means, that the check() should only return +0, if the module is really needed to boot this specific host. +

check() should return with:

+0 +
+Include the dracut module in the initramfs. +
+1 +
+Do not include the dracut module. The requirements are not fulfilled +(missing tools, etc.) +
+255 +
+Only include the dracut module, if another module requires it or if +explicitly specified in the config file or on the argument list. +

module-setup.sh: depends()

The function depends() should echo all other dracut module names the module +depends on.

module-setup.sh: cmdline()

This function should print the kernel command line options needed to boot the +current machine setup. It should start with a space and should not print a +newline.

module-setup.sh: install()

The install() function is called to install everything non-kernel related. +To install binaries, scripts, and other files, you can use the functions +mentioned in [creation].

To address a file in the current module directory, use the variable "$moddir".

module-setup.sh: installkernel()

In installkernel() all kernel related files should be installed. You can use all +of the functions mentioned in [creation] to install files.

Creation Functions

inst_multiple [-o] <file> [ <file> …]

installs multiple binaries and files. If executables are specified without a +path, dracut will search the path PATH=/usr/sbin:/sbin:/usr/bin:/bin for the +binary. If the option "-o" is given as the first parameter, a missing file does +not lead to an error.

inst <src> [<dst>]

installs one file <src> either to the same place in the initramfs or to an +optional <dst>. inst with more than two arguments is treated the same as +inst_multiple, all arguments are treated as files to install and none as +install destinations.

inst_hook <hookdir> <prio> <src>

installs an executable/script <src> in the dracut hook <hookdir> with priority +<prio>.

inst_rules <udevrule> [ <udevrule> …]

installs one or more udev rules. Non-existant udev rules are reported, but do +not let dracut fail.

instmods <kernelmodule> [ <kernelmodule> … ]

instmods should be used only in the installkernel() function.

instmods installs one or more kernel modules in the initramfs. <kernelmodule> +can also be a whole subsystem, if prefixed with a "=", like "=drivers/net/team".

instmods will not install the kernel module, if $hostonly is set and the kernel +module is not currently needed by any /sys//uevent MODALIAS. +To install a kernel module regardless of the hostonly mode use the form:

hostonly='' instmods <kernelmodule>

Initramfs Functions

FIXME

Network Modules

FIXME

AUTHOR

Harald Hoyer

SEE ALSO

dracut(8)

Chapter 12. DRACUT.BOOTUP(7)

NAME

dracut.bootup - boot ordering in the initramfs

DESCRIPTION

This flow chart illustrates the ordering of the services, if systemd is used in +the dracut initramfs.

                                    systemd-journal.socket
+                                               |
+                                               v
+                                    dracut-cmdline.service
+                                               |
+                                               v
+                                    dracut-pre-udev.service
+                                               |
+                                               v
+                                     systemd-udevd.service
+                                               |
+                                               v
+local-fs-pre.target                dracut-pre-trigger.service
+         |                                     |
+         v                                     v
+ (various mounts)  (various swap  systemd-udev-trigger.service
+         |           devices...)               |             (various low-level   (various low-level
+         |               |                     |             services: seed,       API VFS mounts:
+         v               v                     v             tmpfiles, random     mqueue, configfs,
+  local-fs.target   swap.target     dracut-initqueue.service    sysctl, ...)        debugfs, ...)
+         |               |                     |                    |                    |
+         \_______________|____________________ | ___________________|____________________/
+                                              \|/
+                                               v
+                                        sysinit.target
+                                               |
+                             _________________/|\___________________
+                            /                  |                    \
+                            |                  |                    |
+                            v                  |                    v
+                        (various               |              rescue.service
+                       sockets...)             |                    |
+                            |                  |                    v
+                            v                  |              rescue.target
+                     sockets.target            |
+                            |                  |
+                            \_________________ |                                 emergency.service
+                                              \|                                         |
+                                               v                                         v
+                                         basic.target                             emergency.target
+                                               |
+                        ______________________/|
+                       /                       |
+                       |                       v
+                       |            dracut-pre-mount.service
+                       |                       |
+                       |                       v
+                       |                  sysroot.mount
+                       |                       |
+                       |                       v
+                       |             initrd-root-fs.target
+           (custom initrd services)            |
+                       |                       v
+                       |             dracut-mount.service
+                       |                       |
+                       |                       v
+                       |            initrd-parse-etc.service
+                       |                       |
+                       |                       v
+                       |            (sysroot-usr.mount and
+                       |             various mounts marked
+                       |               with fstab option
+                       |                x-initrd.mount)
+                       |                       |
+                       |                       v
+                       |                initrd-fs.target
+                       \______________________ |
+                                              \|
+                                               v
+                                          initrd.target
+                                               |
+                                               v
+                                    dracut-pre-pivot.service
+                                               |
+                                               v
+                                     initrd-cleanup.service
+                                          isolates to
+                                    initrd-switch-root.target
+                                               |
+                                               v
+                        ______________________/|
+                       /                       |
+                       |        initrd-udevadm-cleanup-db.service
+                       |                       |
+           (custom initrd services)            |
+                       |                       |
+                       \______________________ |
+                                              \|
+                                               v
+                                   initrd-switch-root.target
+                                               |
+                                               v
+                                   initrd-switch-root.service
+                                               |
+                                               v
+                                          switch-root

AUTHOR

Harald Hoyer

SEE ALSO

dracut(8) bootup(7)

Appendix A. License

This work is licensed under the Creative Commons Attribution/Share-Alike +License. To view a copy of this license, visit +http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative +Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

\ No newline at end of file diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.pc b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.pc new file mode 100644 index 0000000..d19789e --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.pc @@ -0,0 +1,6 @@ +Name: dracut +Description: dracut +Version: 055 +dracutdir=/usr/local/lib/dracut +dracutmodulesdir=/usr/local/lib/dracut/modules.d +dracutconfdir=/usr/local/lib/dracut/dracut.conf.d diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.sh new file mode 100755 index 0000000..6c1aeed --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/dracut.sh @@ -0,0 +1,2539 @@ +#!/bin/bash -p +# +# Generator script for a dracut initramfs + +# Copyright 2005-2013 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# store for logging + +unset BASH_ENV +unset GZIP + +# Verify bash version, current minimum is 4 +if ((BASH_VERSINFO[0] < 4)); then + printf -- 'You need at least Bash 4 to use dracut, sorry.' >&2 + exit 1 +fi + +dracut_args=("$@") +# shellcheck disable=SC2155 +readonly dracut_cmd=$(readlink -f "$0") + +set -o pipefail + +usage() { + [[ $sysroot_l ]] && dracutsysrootdir="$sysroot_l" + [[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/local/lib/dracut + if [[ -f $dracutbasedir/dracut-version.sh ]]; then + # shellcheck source=./dracut-version.sh + . "$dracutbasedir"/dracut-version.sh + fi + + # 80x25 linebreak here ^ + cat << EOF +Usage: $dracut_cmd [OPTION]... [ []] + +Version: $DRACUT_VERSION + +Creates initial ramdisk images for preloading modules + + -h, --help Display all options + +If a [LIST] has multiple arguments, then you have to put these in quotes. + +For example: + + # dracut --add-drivers "module1 module2" ... + +EOF +} + +long_usage() { + [[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/local/lib/dracut + if [[ -f $dracutbasedir/dracut-version.sh ]]; then + # shellcheck source=./dracut-version.sh + . "$dracutbasedir"/dracut-version.sh + fi + + # 80x25 linebreak here ^ + cat << EOF +Usage: $dracut_cmd [OPTION]... [ []] + +Version: $DRACUT_VERSION + +Creates initial ramdisk images for preloading modules + + --kver [VERSION] Set kernel version to [VERSION]. + -f, --force Overwrite existing initramfs file. + -a, --add [LIST] Add a space-separated list of dracut modules. + --rebuild Append arguments to those of existing image and rebuild + -m, --modules [LIST] Specify a space-separated list of dracut modules to + call when building the initramfs. Modules are located + in /lib/dracut/modules.d. + -o, --omit [LIST] Omit a space-separated list of dracut modules. + --force-add [LIST] Force to add a space-separated list of dracut modules + to the default set of modules, when -H is specified. + -d, --drivers [LIST] Specify a space-separated list of kernel modules to + exclusively include in the initramfs. + --add-drivers [LIST] Specify a space-separated list of kernel + modules to add to the initramfs. + --force-drivers [LIST] Specify a space-separated list of kernel + modules to add to the initramfs and make sure they + are tried to be loaded via modprobe same as passing + rd.driver.pre=DRIVER kernel parameter. + --omit-drivers [LIST] Specify a space-separated list of kernel + modules not to add to the initramfs. + --filesystems [LIST] Specify a space-separated list of kernel filesystem + modules to exclusively include in the generic + initramfs. + -k, --kmoddir [DIR] Specify the directory, where to look for kernel + modules + --fwdir [DIR] Specify additional directories, where to look for + firmwares, separated by : + --kernel-only Only install kernel drivers and firmware files + --no-kernel Do not install kernel drivers and firmware files + --print-cmdline Print the kernel command line for the given disk layout + --early-microcode Combine early microcode with ramdisk + --no-early-microcode Do not combine early microcode with ramdisk + --kernel-cmdline [PARAMETERS] Specify default kernel command line parameters + --strip Strip binaries in the initramfs + --nostrip Do not strip binaries in the initramfs + --hardlink Hardlink files in the initramfs + --nohardlink Do not hardlink files in the initramfs + --prefix [DIR] Prefix initramfs files with [DIR] + --noprefix Do not prefix initramfs files + --mdadmconf Include local /etc/mdadm.conf + --nomdadmconf Do not include local /etc/mdadm.conf + --lvmconf Include local /etc/lvm/lvm.conf + --nolvmconf Do not include local /etc/lvm/lvm.conf + --fscks [LIST] Add a space-separated list of fsck helpers. + --nofscks Inhibit installation of any fsck helpers. + --ro-mnt Mount / and /usr read-only by default. + -h, --help This message + --debug Output debug information of the build process + --profile Output profile information of the build process + -L, --stdlog [0-6] Specify logging level (to standard error) + 0 - suppress any messages + 1 - only fatal errors + 2 - all errors + 3 - warnings + 4 - info + 5 - debug info (here starts lots of output) + 6 - trace info (and even more) + -v, --verbose Increase verbosity level + -q, --quiet Decrease verbosity level + -c, --conf [FILE] Specify configuration file to use. + Default: /etc/dracut.conf + --confdir [DIR] Specify configuration directory to use *.conf files + from. Default: /etc/dracut.conf.d + --tmpdir [DIR] Temporary directory to be used instead of default + ${TMPDIR:-/var/tmp}. + -r, --sysroot [DIR] Specify sysroot directory to collect files from. + -l, --local Local mode. Use modules from the current working + directory instead of the system-wide installed in + /usr/local/lib/dracut/modules.d. + Useful when running dracut from a git checkout. + -H, --hostonly Host-Only mode: Install only what is needed for + booting the local host instead of a generic host. + -N, --no-hostonly Disables Host-Only mode + --hostonly-mode + Specify the hostonly mode to use. could be + one of "sloppy" or "strict". "sloppy" mode is used + by default. + In "sloppy" hostonly mode, extra drivers and modules + will be installed, so minor hardware change won't make + the image unbootable (eg. changed keyboard), and the + image is still portable among similar hosts. + With "strict" mode enabled, anything not necessary + for booting the local host in its current state will + not be included, and modules may do some extra job + to save more space. Minor change of hardware or + environment could make the image unbootable. + DO NOT use "strict" mode unless you know what you + are doing. + --hostonly-cmdline Store kernel command line arguments needed + in the initramfs + --no-hostonly-cmdline Do not store kernel command line arguments needed + in the initramfs + --no-hostonly-default-device + Do not generate implicit host devices like root, + swap, fstab, etc. Use "--mount" or "--add-device" + to explicitly add devices as needed. + --hostonly-i18n Install only needed keyboard and font files according + to the host configuration (default). + --no-hostonly-i18n Install all keyboard and font files available. + --hostonly-nics [LIST] + Only enable listed NICs in the initramfs. + --persistent-policy [POLICY] + Use [POLICY] to address disks and partitions. + POLICY can be any directory name found in /dev/disk. + E.g. "by-uuid", "by-label" + --fstab Use /etc/fstab to determine the root device. + --add-fstab [FILE] Add file to the initramfs fstab + --mount "[DEV] [MP] [FSTYPE] [FSOPTS]" + Mount device [DEV] on mountpoint [MP] with filesystem + [FSTYPE] and options [FSOPTS] in the initramfs + --mount "[MP]" Same as above, but [DEV], [FSTYPE] and [FSOPTS] are + determined by looking at the current mounts. + --add-device "[DEV]" Bring up [DEV] in initramfs + -i, --include [SOURCE] [TARGET] + Include the files in the SOURCE directory into the + Target directory in the final initramfs. + If SOURCE is a file, it will be installed to TARGET + in the final initramfs. + -I, --install [LIST] Install the space separated list of files into the + initramfs. + --install-optional [LIST] Install the space separated list of files into the + initramfs, if they exist. + --gzip Compress the generated initramfs using gzip. + This will be done by default, unless another + compression option or --no-compress is passed. + --bzip2 Compress the generated initramfs using bzip2. + Make sure your kernel has bzip2 decompression support + compiled in, otherwise you will not be able to boot. + --lzma Compress the generated initramfs using lzma. + Make sure your kernel has lzma support compiled in, + otherwise you will not be able to boot. + --xz Compress the generated initramfs using xz. + Make sure that your kernel has xz support compiled + in, otherwise you will not be able to boot. + --lzo Compress the generated initramfs using lzop. + Make sure that your kernel has lzo support compiled + in, otherwise you will not be able to boot. + --lz4 Compress the generated initramfs using lz4. + Make sure that your kernel has lz4 support compiled + in, otherwise you will not be able to boot. + --zstd Compress the generated initramfs using Zstandard. + Make sure that your kernel has zstd support compiled + in, otherwise you will not be able to boot. + --compress [COMPRESSION] Compress the generated initramfs with the + passed compression program. Make sure your kernel + knows how to decompress the generated initramfs, + otherwise you will not be able to boot. + --no-compress Do not compress the generated initramfs. This will + override any other compression options. + --list-modules List all available dracut modules. + -M, --show-modules Print included module's name to standard output during + build. + --keep Keep the temporary initramfs for debugging purposes + --printsize Print out the module install size + --sshkey [SSHKEY] Add ssh key to initramfs (use with ssh-client module) + --logfile [FILE] Logfile to use (overrides configuration setting) + --reproducible Create reproducible images + --no-reproducible Do not create reproducible images + --loginstall [DIR] Log all files installed from the host to [DIR] + --uefi Create an UEFI executable with the kernel cmdline and + kernel combined + --no-uefi Disables UEFI mode + --uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable + --uefi-splash-image [FILE] + Use [FILE] as a splash image when creating an UEFI + executable + --kernel-image [FILE] location of the kernel image + --regenerate-all Regenerate all initramfs images at the default location + for the kernel versions found on the system + --version Display version + +If [LIST] has multiple arguments, then you have to put these in quotes. + +For example: + + # dracut --add-drivers "module1 module2" ... + +EOF +} + +long_version() { + [[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/lib/dracut + if [[ -f $dracutbasedir/dracut-version.sh ]]; then + # shellcheck source=./dracut-version.sh + . "$dracutbasedir"/dracut-version.sh + fi + echo "dracut $DRACUT_VERSION" +} + +# Fills up host_devs stack variable and makes sure there are no duplicates +push_host_devs() { + local _dev + for _dev in "$@"; do + [[ " ${host_devs[*]} " == *" $_dev "* ]] && return + host_devs+=("$_dev") + done +} + +# Little helper function for reading args from the commandline. +# it automatically handles -a b and -a=b variants, and returns 1 if +# we need to shift $3. +read_arg() { + # $1 = arg name + # $2 = arg value + # $3 = arg parameter + local rematch='^[^=]*=(.*)$' + if [[ $2 =~ $rematch ]]; then + read -r "$1" <<< "${BASH_REMATCH[1]}" + else + read -r "$1" <<< "$3" + # There is no way to shift our callers args, so + # return 1 to indicate they should do it instead. + return 1 + fi +} + +check_conf_file() { + if grep -H -e '^[^#]*[+]=\("[^ ]\|.*[^ ]"\)' "$@"; then + printf '\ndracut: WARNING: +=" ": should have surrounding white spaces!\n' >&2 + printf 'dracut: WARNING: This will lead to unwanted side effects! Please fix the configuration file.\n\n' >&2 + fi +} + +dropindirs_sort() { + local suffix=$1 + shift + local -a files + local f d + + for d in "$@"; do + for i in "$d/"*"$suffix"; do + if [[ -e $i ]]; then + printf "%s\n" "${i##*/}" + fi + done + done | sort -Vu | { + readarray -t files + + for f in "${files[@]}"; do + for d in "$@"; do + if [[ -e "$d/$f" ]]; then + printf "%s\n" "$d/$f" + continue 2 + fi + done + done + } +} + +rearrange_params() { + # Workaround -i, --include taking 2 arguments + newat=() + for i in "$@"; do + if [[ $i == "-i" ]] || [[ $i == "--include" ]]; then + newat+=("++include") # Replace --include by ++include + else + newat+=("$i") + fi + done + set -- "${newat[@]}" # Set new $@ + + TEMP=$( + unset POSIXLY_CORRECT + getopt \ + -o "a:m:o:d:I:k:c:r:L:fvqlHhMN" \ + --long kver: \ + --long add: \ + --long force-add: \ + --long add-drivers: \ + --long force-drivers: \ + --long omit-drivers: \ + --long modules: \ + --long omit: \ + --long drivers: \ + --long filesystems: \ + --long install: \ + --long install-optional: \ + --long fwdir: \ + --long libdirs: \ + --long fscks: \ + --long add-fstab: \ + --long mount: \ + --long device: \ + --long add-device: \ + --long nofscks \ + --long ro-mnt \ + --long kmoddir: \ + --long conf: \ + --long confdir: \ + --long tmpdir: \ + --long sysroot: \ + --long stdlog: \ + --long compress: \ + --long prefix: \ + --long rebuild: \ + --long force \ + --long kernel-only \ + --long no-kernel \ + --long print-cmdline \ + --long kernel-cmdline: \ + --long strip \ + --long nostrip \ + --long hardlink \ + --long nohardlink \ + --long noprefix \ + --long mdadmconf \ + --long nomdadmconf \ + --long lvmconf \ + --long nolvmconf \ + --long debug \ + --long profile \ + --long sshkey: \ + --long logfile: \ + --long verbose \ + --long quiet \ + --long local \ + --long hostonly \ + --long host-only \ + --long no-hostonly \ + --long no-host-only \ + --long hostonly-mode: \ + --long hostonly-cmdline \ + --long no-hostonly-cmdline \ + --long no-hostonly-default-device \ + --long persistent-policy: \ + --long fstab \ + --long help \ + --long bzip2 \ + --long lzma \ + --long xz \ + --long lzo \ + --long lz4 \ + --long zstd \ + --long no-compress \ + --long gzip \ + --long list-modules \ + --long show-modules \ + --long keep \ + --long printsize \ + --long regenerate-all \ + --long noimageifnotneeded \ + --long early-microcode \ + --long no-early-microcode \ + --long reproducible \ + --long no-reproducible \ + --long loginstall: \ + --long uefi \ + --long no-uefi \ + --long uefi-stub: \ + --long uefi-splash-image: \ + --long kernel-image: \ + --long no-hostonly-i18n \ + --long hostonly-i18n \ + --long hostonly-nics: \ + --long no-machineid \ + --long version \ + -- "$@" + ) + + # shellcheck disable=SC2181 + if (($? != 0)); then + usage + exit 1 + fi +} + +verbosity_mod_l=0 +unset kernel +unset outfile + +rearrange_params "$@" +eval set -- "$TEMP" + +# parse command line args to check if '--rebuild' option is present +unset append_args_l +unset rebuild_file +while :; do + if [ "$1" == "--" ]; then + shift + break + fi + if [ "$1" == "--rebuild" ]; then + append_args_l="yes" + rebuild_file="$2" + if [ ! -e "$rebuild_file" ]; then + echo "Image file '$rebuild_file', for rebuild, does not exist!" + exit 1 + fi + abs_rebuild_file=$(readlink -f "$rebuild_file") && rebuild_file="$abs_rebuild_file" + shift + continue + fi + shift +done + +# get output file name and kernel version from command line arguments +while (($# > 0)); do + case ${1%%=*} in + ++include) + shift 2 + ;; + *) + if ! [[ ${outfile+x} ]]; then + outfile=$1 + elif ! [[ ${kernel+x} ]]; then + kernel=$1 + else + printf "\nUnknown arguments: %s\n\n" "$*" >&2 + usage + exit 1 + fi + ;; + esac + shift +done + +# extract input image file provided with rebuild option to get previous parameters, if any +if [[ $append_args_l == "yes" ]]; then + unset rebuild_param + + # determine resultant file + if ! [[ $outfile ]]; then + outfile=$rebuild_file + fi + + if ! rebuild_param=$(lsinitrd "$rebuild_file" '*lib/dracut/build-parameter.txt'); then + echo "Image '$rebuild_file' has no rebuild information stored" + exit 1 + fi + + # prepend previous parameters to current command line args + if [[ $rebuild_param ]]; then + TEMP="$rebuild_param $TEMP" + eval set -- "$TEMP" + rearrange_params "$@" + fi +fi + +unset PARMS_TO_STORE +PARMS_TO_STORE="" + +eval set -- "$TEMP" + +while :; do + if [[ $1 != "--" ]] && [[ $1 != "--rebuild" ]]; then + PARMS_TO_STORE+=" $1" + fi + case $1 in + --kver) + kernel="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + -a | --add) + add_dracutmodules_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --force-add) + force_add_dracutmodules_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --add-drivers) + add_drivers_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --force-drivers) + force_drivers_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --omit-drivers) + omit_drivers_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + -m | --modules) + dracutmodules_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + -o | --omit) + omit_dracutmodules_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + -d | --drivers) + drivers_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --filesystems) + filesystems_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + -I | --install) + install_items_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --install-optional) + install_optional_items_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --fwdir) + fw_dir_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --libdirs) + libdirs_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --fscks) + fscks_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --add-fstab) + add_fstab_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --mount) + fstab_lines+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --add-device | --device) + add_device_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --kernel-cmdline) + kernel_cmdline_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --nofscks) nofscks_l="yes" ;; + --ro-mnt) ro_mnt_l="yes" ;; + -k | --kmoddir) + drivers_dir_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + -c | --conf) + conffile="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --confdir) + confdir="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --tmpdir) + tmpdir_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + -r | --sysroot) + sysroot_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + -L | --stdlog) + stdloglvl_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --compress) + compress_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --prefix) + prefix_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --loginstall) + loginstall_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --rebuild) + if [[ $rebuild_file == "$outfile" ]]; then + force=yes + fi + shift + ;; + -f | --force) force=yes ;; + --kernel-only) + kernel_only="yes" + no_kernel="no" + ;; + --no-kernel) + kernel_only="no" + no_kernel="yes" + ;; + --print-cmdline) + print_cmdline="yes" + hostonly_l="yes" + kernel_only="yes" + no_kernel="yes" + ;; + --early-microcode) + early_microcode_l="yes" + ;; + --no-early-microcode) + early_microcode_l="no" + ;; + --strip) do_strip_l="yes" ;; + --nostrip) do_strip_l="no" ;; + --hardlink) do_hardlink_l="yes" ;; + --nohardlink) do_hardlink_l="no" ;; + --noprefix) prefix_l="/" ;; + --mdadmconf) mdadmconf_l="yes" ;; + --nomdadmconf) mdadmconf_l="no" ;; + --lvmconf) lvmconf_l="yes" ;; + --nolvmconf) lvmconf_l="no" ;; + --debug) debug="yes" ;; + --profile) profile="yes" ;; + --sshkey) + sshkey="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --logfile) + logfile_l="$2" + shift + ;; + -v | --verbose) ((verbosity_mod_l++)) ;; + -q | --quiet) ((verbosity_mod_l--)) ;; + -l | --local) + allowlocal="yes" + [[ -f "$(readlink -f "${0%/*}")/dracut-init.sh" ]] \ + && dracutbasedir="$(readlink -f "${0%/*}")" + ;; + -H | --hostonly | --host-only) + hostonly_l="yes" + ;; + -N | --no-hostonly | --no-host-only) + hostonly_l="no" + ;; + --hostonly-mode) + hostonly_mode_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --hostonly-cmdline) + hostonly_cmdline_l="yes" + ;; + --hostonly-i18n) + i18n_install_all_l="no" + ;; + --hostonly-nics) + hostonly_nics_l+=("$2") + PARMS_TO_STORE+=" '$2'" + shift + ;; + --no-hostonly-i18n) + i18n_install_all_l="yes" + ;; + --no-hostonly-cmdline) + hostonly_cmdline_l="no" + ;; + --no-hostonly-default-device) + hostonly_default_device="no" + ;; + --persistent-policy) + persistent_policy_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --fstab) use_fstab_l="yes" ;; + -h | --help) + long_usage + exit 1 + ;; + --bzip2) compress_l="bzip2" ;; + --lzma) compress_l="lzma" ;; + --xz) compress_l="xz" ;; + --lzo) compress_l="lzo" ;; + --lz4) compress_l="lz4" ;; + --zstd) compress_l="zstd" ;; + --no-compress) _no_compress_l="cat" ;; + --gzip) compress_l="gzip" ;; + --list-modules) do_list="yes" ;; + -M | --show-modules) + show_modules_l="yes" + ;; + --keep) keep="yes" ;; + --printsize) printsize="yes" ;; + --regenerate-all) regenerate_all="yes" ;; + --noimageifnotneeded) noimageifnotneeded="yes" ;; + --reproducible) reproducible_l="yes" ;; + --no-reproducible) reproducible_l="no" ;; + --uefi) uefi_l="yes" ;; + --no-uefi) uefi_l="no" ;; + --uefi-stub) + uefi_stub_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --uefi-splash-image) + uefi_splash_image_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --kernel-image) + kernel_image_l="$2" + PARMS_TO_STORE+=" '$2'" + shift + ;; + --no-machineid) + machine_id_l="no" + ;; + --version) + long_version + exit 1 + ;; + --) + shift + break + ;; + + *) # should not even reach this point + printf "\n!Unknown option: '%s'\n\n" "$1" >&2 + usage + exit 1 + ;; + esac + shift +done + +# getopt cannot handle multiple arguments, so just handle "-I,--include" +# the old fashioned way + +while (($# > 0)); do + if [ "${1%%=*}" == "++include" ]; then + include_src+=("$2") + include_target+=("$3") + PARMS_TO_STORE+=" --include '$2' '$3'" + shift 2 + fi + shift +done + +[[ $sysroot_l ]] && dracutsysrootdir="$sysroot_l" + +if [[ $regenerate_all == "yes" ]]; then + ret=0 + if [[ $kernel ]]; then + printf -- "--regenerate-all cannot be called with a kernel version\n" >&2 + exit 1 + fi + + if [[ $outfile ]]; then + printf -- "--regenerate-all cannot be called with a image file\n" >&2 + exit 1 + fi + + ((len = ${#dracut_args[@]})) + for ((i = 0; i < len; i++)); do + [[ ${dracut_args[$i]} == "--regenerate-all" ]] \ + && unset dracut_args["$i"] + done + + cd "$dracutsysrootdir"/lib/modules || exit 1 + for i in *; do + [[ -f $i/modules.dep ]] || [[ -f $i/modules.dep.bin ]] || continue + "$dracut_cmd" --kver="$i" "${dracut_args[@]}" + ((ret += $?)) + done + exit "$ret" +fi + +if ! [[ $kernel ]]; then + kernel=$(uname -r) +fi + +export LC_ALL=C +export LANG=C +unset LC_MESSAGES +unset LC_CTYPE +unset LD_LIBRARY_PATH +unset LD_PRELOAD +unset GREP_OPTIONS + +export DRACUT_LOG_LEVEL=warning +[[ $debug ]] && { + export DRACUT_LOG_LEVEL=debug + export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ' + set -x +} + +[[ $profile ]] && { + export PS4='+ $(date "+%s.%N") ${BASH_SOURCE}@${LINENO}: ' + set -x + debug=yes +} + +[[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/local/lib/dracut + +# if we were not passed a config file, try the default one +if [[ ! -f $conffile ]]; then + if [[ $allowlocal ]]; then + conffile="$dracutbasedir/dracut.conf" + else + conffile="$dracutsysrootdir/etc/dracut.conf" + fi +fi + +if [[ ! -d $confdir ]]; then + if [[ $allowlocal ]]; then + confdir="$dracutbasedir/dracut.conf.d" + else + confdir="$dracutsysrootdir/etc/dracut.conf.d" + fi +fi + +# source our config file +if [[ -f $conffile ]]; then + check_conf_file "$conffile" + # shellcheck disable=SC1090 + . "$conffile" +fi + +# source our config dir +for f in $(dropindirs_sort ".conf" "$confdir" "$dracutbasedir/dracut.conf.d"); do + check_conf_file "$f" + # shellcheck disable=SC1090 + [[ -e $f ]] && . "$f" +done + +DRACUT_PATH=${DRACUT_PATH:-/sbin /bin /usr/sbin /usr/bin} + +for i in $DRACUT_PATH; do + rl=$i + if [ -L "$dracutsysrootdir$i" ]; then + rl=$(readlink -f "$dracutsysrootdir$i") + fi + rl="${rl#$dracutsysrootdir}" + if [[ $NPATH != *:$rl* ]]; then + NPATH+=":$rl" + fi +done +[[ -z $dracutsysrootdir ]] && export PATH="${NPATH#:}" +unset NPATH + +export SYSTEMCTL=${SYSTEMCTL:-systemctl} + +# these options add to the stuff in the config file +((${#add_dracutmodules_l[@]})) && add_dracutmodules+=" ${add_dracutmodules_l[*]} " +((${#omit_dracutmodules_l[@]})) && omit_dracutmodules+=" ${omit_dracutmodules_l[*]} " +((${#force_add_dracutmodules_l[@]})) && force_add_dracutmodules+=" ${force_add_dracutmodules_l[*]} " +((${#fscks_l[@]})) && fscks+=" ${fscks_l[*]} " +((${#add_fstab_l[@]})) && add_fstab+=" ${add_fstab_l[*]} " +((${#install_items_l[@]})) && install_items+=" ${install_items_l[*]} " +((${#install_optional_items_l[@]})) && install_optional_items+=" ${install_optional_items_l[*]} " +((${#hostonly_nics_l[@]})) && hostonly_nics+=" ${hostonly_nics_l[*]} " + +# these options override the stuff in the config file +((${#dracutmodules_l[@]})) && dracutmodules="${dracutmodules_l[*]}" +((${#filesystems_l[@]})) && filesystems="${filesystems_l[*]}" +((${#fw_dir_l[@]})) && fw_dir="${fw_dir_l[*]}" +((${#libdirs_l[@]})) && libdirs="${libdirs_l[*]}" + +[[ $stdloglvl_l ]] && stdloglvl=$stdloglvl_l +[[ ! $stdloglvl ]] && stdloglvl=4 +stdloglvl=$((stdloglvl + verbosity_mod_l)) +((stdloglvl > 6)) && stdloglvl=6 +((stdloglvl < 0)) && stdloglvl=0 + +[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l +[[ $do_strip_l ]] && do_strip=$do_strip_l +[[ $do_strip ]] || do_strip=yes +[[ $do_hardlink_l ]] && do_hardlink=$do_hardlink_l +[[ $do_hardlink ]] || do_hardlink=yes +[[ $prefix_l ]] && prefix=$prefix_l +[[ $prefix == "/" ]] && unset prefix +[[ $hostonly_l ]] && hostonly=$hostonly_l +[[ $hostonly_cmdline_l ]] && hostonly_cmdline=$hostonly_cmdline_l +[[ $hostonly_mode_l ]] && hostonly_mode=$hostonly_mode_l +[[ $hostonly == "yes" ]] && ! [[ $hostonly_cmdline ]] && hostonly_cmdline="yes" +# shellcheck disable=SC2034 +[[ $i18n_install_all_l ]] && i18n_install_all=$i18n_install_all_l +# shellcheck disable=SC2034 +[[ $persistent_policy_l ]] && persistent_policy=$persistent_policy_l +[[ $use_fstab_l ]] && use_fstab=$use_fstab_l +[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l +[[ $lvmconf_l ]] && lvmconf=$lvmconf_l +[[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/local/lib/dracut +[[ $fw_dir ]] || fw_dir="$dracutsysrootdir/lib/firmware/updates:$dracutsysrootdir/lib/firmware:$dracutsysrootdir/lib/firmware/$kernel" +[[ $tmpdir_l ]] && tmpdir="$tmpdir_l" +[[ $tmpdir ]] || tmpdir="$TMPDIR" +[[ $tmpdir ]] || tmpdir="$dracutsysrootdir"/var/tmp +[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS +[[ $compress_l ]] && compress=$compress_l +[[ $show_modules_l ]] && show_modules=$show_modules_l +[[ $nofscks_l ]] && nofscks="yes" +[[ $ro_mnt_l ]] && ro_mnt="yes" +[[ $early_microcode_l ]] && early_microcode=$early_microcode_l +[[ $early_microcode ]] || early_microcode=yes +[[ $early_microcode_image_dir ]] || early_microcode_image_dir=('/boot') +[[ $early_microcode_image_name ]] \ + || early_microcode_image_name=('intel-uc.img' 'intel-ucode.img' 'amd-uc.img' 'amd-ucode.img' 'early_ucode.cpio' 'microcode.cpio') +[[ $logfile_l ]] && logfile="$logfile_l" +[[ $reproducible_l ]] && reproducible="$reproducible_l" +[[ $loginstall_l ]] && loginstall="$loginstall_l" +[[ $uefi_l ]] && uefi=$uefi_l +[[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l" +[[ $uefi_splash_image_l ]] && uefi_splash_image="$uefi_splash_image_l" +[[ $kernel_image_l ]] && kernel_image="$kernel_image_l" +[[ $machine_id_l ]] && machine_id="$machine_id_l" + +if ! [[ $outfile ]]; then + if [[ $machine_id != "no" ]]; then + [[ -f "$dracutsysrootdir"/etc/machine-id ]] && read -r MACHINE_ID < "$dracutsysrootdir"/etc/machine-id + fi + + if [[ $uefi == "yes" ]]; then + # shellcheck disable=SC2154 + if [[ -n $uefi_secureboot_key && -z $uefi_secureboot_cert ]] || [[ -z $uefi_secureboot_key && -n $uefi_secureboot_cert ]]; then + dfatal "Need 'uefi_secureboot_key' and 'uefi_secureboot_cert' both to be set." + exit 1 + fi + + if [[ -n $uefi_secureboot_key && -n $uefi_secureboot_cert ]] && ! command -v sbsign &> /dev/null; then + dfatal "Need 'sbsign' to create a signed UEFI executable" + exit 1 + fi + + BUILD_ID=$(cat "$dracutsysrootdir"/etc/os-release "$dracutsysrootdir"/usr/lib/os-release \ + | while read -r line || [[ $line ]]; do + [[ $line =~ BUILD_ID\=* ]] && eval "$line" && echo "$BUILD_ID" && break + done) + if [[ -z $dracutsysrootdir ]]; then + if [[ -d /efi ]] && mountpoint -q /efi; then + efidir=/efi/EFI + else + efidir=/boot/EFI + if [[ -d $dracutsysrootdir/boot/efi/EFI ]]; then + efidir=/boot/efi/EFI + fi + fi + else + efidir=/boot/EFI + if [[ -d $dracutsysrootdir/boot/efi/EFI ]]; then + efidir=/boot/efi/EFI + fi + fi + mkdir -p "$dracutsysrootdir$efidir/Linux" + outfile="$dracutsysrootdir$efidir/Linux/linux-$kernel${MACHINE_ID:+-${MACHINE_ID}}${BUILD_ID:+-${BUILD_ID}}.efi" + else + if [[ -e $dracutsysrootdir/boot/vmlinuz-$kernel ]]; then + outfile="/boot/initramfs-$kernel.img" + elif [[ $MACHINE_ID ]] && { [[ -d $dracutsysrootdir/boot/${MACHINE_ID} ]] || [[ -L $dracutsysrootdir/boot/${MACHINE_ID} ]]; }; then + outfile="$dracutsysrootdir/boot/${MACHINE_ID}/$kernel/initrd" + else + outfile="$dracutsysrootdir/boot/initramfs-$kernel.img" + fi + fi +fi + +# eliminate IFS hackery when messing with fw_dir +export DRACUT_FIRMWARE_PATH=${fw_dir// /:} +fw_dir=${fw_dir//:/ } + +# check for logfile and try to create one if it doesn't exist +if [[ -n $logfile ]]; then + if [[ ! -f $logfile ]]; then + if touch "$logfile"; then + printf "%s\n" "dracut: touch $logfile failed." >&2 + fi + fi +fi + +# handle compression options. +DRACUT_COMPRESS_BZIP2=${DRACUT_COMPRESS_BZIP2:-bzip2} +DRACUT_COMPRESS_LBZIP2=${DRACUT_COMPRESS_LBZIP2:-lbzip2} +DRACUT_COMPRESS_LZMA=${DRACUT_COMPRESS_LZMA:-lzma} +DRACUT_COMPRESS_XZ=${DRACUT_COMPRESS_XZ:-xz} +DRACUT_COMPRESS_GZIP=${DRACUT_COMPRESS_GZIP:-gzip} +DRACUT_COMPRESS_PIGZ=${DRACUT_COMPRESS_PIGZ:-pigz} +DRACUT_COMPRESS_LZOP=${DRACUT_COMPRESS_LZOP:-lzop} +DRACUT_COMPRESS_ZSTD=${DRACUT_COMPRESS_ZSTD:-zstd} +DRACUT_COMPRESS_LZ4=${DRACUT_COMPRESS_LZ4:-lz4} +DRACUT_COMPRESS_CAT=${DRACUT_COMPRESS_CAT:-cat} + +if [[ $_no_compress_l == "$DRACUT_COMPRESS_CAT" ]]; then + compress="$DRACUT_COMPRESS_CAT" +fi + +[[ $hostonly == yes ]] && hostonly="-h" +[[ $hostonly != "-h" ]] && unset hostonly + +case $hostonly_mode in + '') + [[ $hostonly ]] && hostonly_mode="sloppy" + ;; + sloppy | strict) + if [[ ! $hostonly ]]; then + unset hostonly_mode + fi + ;; + *) + printf "%s\n" "dracut: Invalid hostonly mode '$hostonly_mode'." >&2 + exit 1 + ;; +esac + +[[ $reproducible == yes ]] && DRACUT_REPRODUCIBLE=1 + +case "${drivers_dir}" in + '' | *lib/modules/${kernel} | *lib/modules/${kernel}/) ;; + *) + [[ "$DRACUT_KMODDIR_OVERRIDE" ]] || { + printf "%s\n" 'dracut: -k/--kmoddir path must contain "lib/modules" as a parent of your kernel module directory,' + printf "%s\n" "dracut: or modules may not be placed in the correct location inside the initramfs." + printf "%s\n" "dracut: was given: ${drivers_dir}" +#?? printf "%s\n" "dracut: expected: lib/modules/${kernel}" + printf "%s\n" "dracut: expected: $(dirname "${drivers_dir}")/lib/modules/${kernel}" + printf "%s\n" "dracut: Please move your modules into the correct directory structure and pass the new location," + printf "%s\n" "dracut: or set DRACUT_KMODDIR_OVERRIDE=1 to ignore this check." + exit 1 + } + ;; +esac + +# shellcheck disable=SC2155 +readonly TMPDIR="$(realpath -e "$tmpdir")" +[ -d "$TMPDIR" ] || { + printf "%s\n" "dracut: Invalid tmpdir '$tmpdir'." >&2 + exit 1 +} + +if findmnt --raw -n --target "$tmpdir" --output=options | grep -q noexec; then + [[ $debug == yes ]] && printf "%s\n" "dracut: Tmpdir '$tmpdir' is mounted with 'noexec'." + noexec=1 +fi + +# shellcheck disable=SC2155 +readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)" +[ -d "$DRACUT_TMPDIR" ] || { + printf "%s\n" "dracut: mktemp -p '$TMPDIR/' -d -t dracut.XXXXXX failed." >&2 + exit 1 +} + +# Cache file used to optimize get_maj_min() +declare -x -r get_maj_min_cache_file="${DRACUT_TMPDIR}/majmin_cache" +: > "$get_maj_min_cache_file" + +# clean up after ourselves no matter how we die. +trap ' + ret=$?; + [[ $keep ]] && echo "Not removing $DRACUT_TMPDIR." >&2 || { [[ $DRACUT_TMPDIR ]] && rm -rf -- "$DRACUT_TMPDIR"; }; + if [[ ${FSFROZEN} ]]; then + fsfreeze -u "${FSFROZEN}" + fi + exit $ret; + ' EXIT + +# clean up after ourselves no matter how we die. +trap 'exit 1;' SIGINT + +readonly initdir="${DRACUT_TMPDIR}/initramfs" +mkdir -p "$initdir" + +# shellcheck disable=SC2154 +if [[ $early_microcode == yes ]] || { [[ $acpi_override == yes ]] && [[ -d $acpi_table_dir ]]; }; then + readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio" + mkdir "$early_cpio_dir" +fi + +[[ "$dracutsysrootdir" ]] || [[ "$noexec" ]] || export DRACUT_RESOLVE_LAZY="1" + +if [[ $print_cmdline ]]; then + stdloglvl=0 + sysloglvl=0 + fileloglvl=0 + kmsgloglvl=0 +fi + +if [[ -f $dracutbasedir/dracut-version.sh ]]; then + # shellcheck source=./dracut-version.sh + . "$dracutbasedir"/dracut-version.sh +fi + +if systemd-detect-virt -c &> /dev/null; then + export DRACUT_NO_MKNOD=1 DRACUT_NO_XATTR=1 + if [[ $hostonly ]]; then + printf "%s\n" "dracut: WARNING: running in hostonly mode in a container!!" + fi +fi + +if [[ -f $dracutbasedir/dracut-init.sh ]]; then + # shellcheck source=./dracut-init.sh + . "$dracutbasedir"/dracut-init.sh +else + printf "%s\n" "dracut: Cannot find $dracutbasedir/dracut-init.sh." >&2 + printf "%s\n" "dracut: Are you running from a git checkout?" >&2 + printf "%s\n" "dracut: Try passing -l as an argument to $dracut_cmd" >&2 + exit 1 +fi + +# shellcheck disable=SC2154 +if [[ $no_kernel != yes ]] && ! [[ -d $srcmods ]]; then + printf "%s\n" "dracut: Cannot find module directory $srcmods" >&2 + printf "%s\n" "dracut: and --no-kernel was not specified" >&2 + exit 1 +fi + +if ! [[ $print_cmdline ]]; then + inst "$DRACUT_TESTBIN" + if ! $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${dracutsysrootdir:+-r "$dracutsysrootdir"} -R "$DRACUT_TESTBIN" &> /dev/null; then + unset DRACUT_RESOLVE_LAZY + export DRACUT_RESOLVE_DEPS=1 + fi + rm -fr -- "${initdir:?}"/* +fi + +dracutfunctions=$dracutbasedir/dracut-functions.sh +export dracutfunctions + +((${#drivers_l[@]})) && drivers="${drivers_l[*]}" +drivers=${drivers/-/_} + +((${#add_drivers_l[@]})) && add_drivers+=" ${add_drivers_l[*]} " +add_drivers=${add_drivers/-/_} + +((${#force_drivers_l[@]})) && force_drivers+=" ${force_drivers_l[*]} " +force_drivers=${force_drivers/-/_} + +((${#omit_drivers_l[@]})) && omit_drivers+=" ${omit_drivers_l[*]} " +omit_drivers=${omit_drivers/-/_} + +((${#kernel_cmdline_l[@]})) && kernel_cmdline+=" ${kernel_cmdline_l[*]} " + +omit_drivers_corrected="" +for d in $omit_drivers; do + [[ " $drivers $add_drivers " == *\ $d\ * ]] && continue + [[ " $drivers $force_drivers " == *\ $d\ * ]] && continue + omit_drivers_corrected+="$d|" +done +omit_drivers="${omit_drivers_corrected%|}" +unset omit_drivers_corrected + +# prepare args for logging +for ((i = 0; i < ${#dracut_args[@]}; i++)); do + [[ ${dracut_args[$i]} == *\ * ]] \ + && dracut_args[$i]="\"${dracut_args[$i]}\"" + #" keep vim happy +done + +dinfo "Executing: $dracut_cmd ${dracut_args[*]}" + +[[ $do_list == yes ]] && { + for mod in "$dracutbasedir"/modules.d/*; do + [[ -d $mod ]] || continue + [[ -e $mod/install || -e $mod/installkernel || -e \ + $mod/module-setup.sh ]] || continue + printf "%s\n" "${mod##*/??}" + done + exit 0 +} + +# This is kinda legacy -- eventually it should go away. +case $dracutmodules in + "" | auto) dracutmodules="all" ;; +esac + +abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile" + +[[ -d $dracutsysrootdir$systemdutildir ]] \ + || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2> /dev/null) + +if ! [[ -d $dracutsysrootdir$systemdutildir ]]; then + [[ -e $dracutsysrootdir/lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd + [[ -e $dracutsysrootdir/usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd +fi + +[[ -d $dracutsysrootdir$systemdutilconfdir ]] \ + || systemdutilconfdir=$(pkg-config systemd --variable=systemdutilconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdutilconfdir ]] || systemdutilconfdir=/etc/systemd + +if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then + if ! [[ -f $srcmods/modules.dep ]]; then + if [[ -n "$(find "$srcmods" -name '*.ko*')" ]]; then + dfatal "$srcmods/modules.dep is missing. Did you run depmod?" + exit 1 + else + dwarn "$srcmods/modules.dep is missing. Did you run depmod?" + fi + elif ! (command -v gzip &> /dev/null && command -v xz &> /dev/null); then + read -r _mod < "$srcmods"/modules.dep + _mod=${_mod%%:*} + if [[ -f $srcmods/"$_mod" ]]; then + # Check, if kernel modules are compressed, and if we can uncompress them + case "$_mod" in + *.ko.gz) kcompress=gzip ;; + *.ko.xz) kcompress=xz ;; + *.ko.zst) kcompress=zstd ;; + esac + if [[ $kcompress ]]; then + if ! command -v "$kcompress" &> /dev/null; then + dfatal "Kernel modules are compressed with $kcompress, but $kcompress is not available." + exit 1 + fi + fi + fi + fi +fi + +if [[ ! $print_cmdline ]]; then + if [[ -f $outfile && ! $force ]]; then + dfatal "Will not override existing initramfs ($outfile) without --force" + exit 1 + fi + + outdir=${outfile%/*} + [[ $outdir ]] || outdir="/" + + if [[ ! -d $outdir ]]; then + dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible." + exit 1 + elif [[ ! -w $outdir ]]; then + dfatal "No permission to write to $outdir." + exit 1 + elif [[ -f $outfile && ! -w $outfile ]]; then + dfatal "No permission to write $outfile." + exit 1 + fi + + if [[ $loginstall ]]; then + if ! mkdir -p "$loginstall"; then + dfatal "Could not create directory to log installed files to '$loginstall'." + exit 1 + fi + loginstall=$(readlink -f "$loginstall") + fi + + if [[ $uefi == yes ]]; then + if ! command -v objcopy &> /dev/null; then + dfatal "Need 'objcopy' to create a UEFI executable" + exit 1 + fi + unset EFI_MACHINE_TYPE_NAME + case $(uname -m) in + x86_64) + EFI_MACHINE_TYPE_NAME=x64 + ;; + i?86) + EFI_MACHINE_TYPE_NAME=ia32 + ;; + *) + dfatal "Architecture '$(uname -m)' not supported to create a UEFI executable" + exit 1 + ;; + esac + + if ! [[ -s $uefi_stub ]]; then + uefi_stub="$dracutsysrootdir${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" + fi + + if ! [[ -s $uefi_stub ]]; then + dfatal "Can't find a uefi stub '$uefi_stub' to create a UEFI executable" + exit 1 + fi + + if ! [[ $kernel_image ]]; then + for kernel_image in "$dracutsysrootdir/lib/modules/$kernel/vmlinuz" "$dracutsysrootdir/boot/vmlinuz-$kernel"; do + [[ -s $kernel_image ]] || continue + break + done + fi + if ! [[ -s $kernel_image ]]; then + dfatal "Can't find a kernel image '$kernel_image' to create a UEFI executable" + exit 1 + fi + fi +fi + +if [[ $acpi_override == yes ]] && ! (check_kernel_config CONFIG_ACPI_TABLE_UPGRADE || check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE); then + dwarn "Disabling ACPI override, because kernel does not support it. CONFIG_ACPI_INITRD_TABLE_OVERRIDE!=y or CONFIG_ACPI_TABLE_UPGRADE!=y" + unset acpi_override +fi + +if [[ $early_microcode == yes ]]; then + if [[ $hostonly ]]; then + if [[ $(get_cpu_vendor) == "AMD" ]]; then + check_kernel_config CONFIG_MICROCODE_AMD || unset early_microcode + elif [[ $(get_cpu_vendor) == "Intel" ]]; then + check_kernel_config CONFIG_MICROCODE_INTEL || unset early_microcode + else + unset early_microcode + fi + else + ! check_kernel_config CONFIG_MICROCODE_AMD \ + && ! check_kernel_config CONFIG_MICROCODE_INTEL \ + && unset early_microcode + fi + # Do not complain on non-x86 architectures as it makes no sense + case $(uname -m) in + x86_64 | i?86) + [[ $early_microcode != yes ]] \ + && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y" + ;; + *) ;; + esac +fi + +# Need to be able to have non-root users read stuff (rpcbind etc) +chmod 755 "$initdir" + +if [[ $hostonly ]]; then + for i in /sys /proc /run /dev; do + if ! findmnt --target "$i" &> /dev/null; then + dwarning "Turning off host-only mode: '$i' is not mounted!" + unset hostonly + fi + done +fi + +declare -A host_fs_types + +for line in "${fstab_lines[@]}"; do + # shellcheck disable=SC2086 + set -- $line + dev="$1" + #dev mp fs fsopts + case "$dev" in + UUID=*) + dev=$(blkid -l -t "UUID=${dev#UUID=}" -o device) + ;; + LABEL=*) + dev=$(blkid -l -t "LABEL=${dev#LABEL=}" -o device) + ;; + PARTUUID=*) + dev=$(blkid -l -t "PARTUUID=${dev#PARTUUID=}" -o device) + ;; + PARTLABEL=*) + dev=$(blkid -l -t "PARTLABEL=${dev#PARTLABEL=}" -o device) + ;; + esac + [ -z "$dev" ] && dwarn "Bad fstab entry $*" && continue + if [[ $3 == btrfs ]]; then + for mp in $(findmnt --source "$1" -o TARGET -n); do + for i in $(btrfs_devs "$mp"); do + push_host_devs "$i" + done + done + fi + push_host_devs "$dev" + host_fs_types["$dev"]="$3" +done + +for f in $add_fstab; do + [[ -e $f ]] || continue + while read -r dev rest || [ -n "$dev" ]; do + push_host_devs "$dev" + done < "$f" +done + +for dev in $add_device; do + push_host_devs "$dev" +done + +if ((${#add_device_l[@]})); then + add_device+=" ${add_device_l[*]} " + push_host_devs "${add_device_l[@]}" +fi + +if [[ $hostonly ]] && [[ $hostonly_default_device != "no" ]]; then + # in hostonly mode, determine all devices, which have to be accessed + # and examine them for filesystem types + + for mp in \ + "/" \ + "/etc" \ + "/bin" \ + "/sbin" \ + "/lib" \ + "/lib64" \ + "/usr" \ + "/usr/bin" \ + "/usr/sbin" \ + "/usr/lib" \ + "/usr/lib64" \ + "/boot" \ + "/boot/efi" \ + "/boot/zipl"; do + mp=$(readlink -f "$dracutsysrootdir$mp") + mountpoint "$mp" > /dev/null 2>&1 || continue + _dev=$(find_block_device "$mp") + _bdev=$(readlink -f "/dev/block/$_dev") + [[ -b $_bdev ]] && _dev=$_bdev + [[ $mp == "/" ]] && root_devs+=("$_dev") + push_host_devs "$_dev" + if [[ $(find_mp_fstype "$mp") == btrfs ]]; then + for i in $(btrfs_devs "$mp"); do + [[ $mp == "/" ]] && root_devs+=("$i") + push_host_devs "$i" + done + fi + done + + # TODO - with sysroot, /proc/swaps is not relevant + if [[ -f /proc/swaps ]] && [[ -f $dracutsysrootdir/etc/fstab ]]; then + while read -r dev type rest || [ -n "$dev" ]; do + [[ -b $dev ]] || continue + [[ $type == "partition" ]] || continue + + while read -r _d _m _t _o _ || [ -n "$_d" ]; do + [[ $_d == \#* ]] && continue + [[ $_d ]] || continue + [[ $_t != "swap" ]] && continue + [[ $_m != "swap" ]] && [[ $_m != "none" ]] && continue + [[ $_o == *noauto* ]] && continue + _d=$(expand_persistent_dev "$_d") + [[ $_d -ef $dev ]] || continue + + if [[ -f $dracutsysrootdir/etc/crypttab ]]; then + while read -r _mapper _ _p _o || [ -n "$_mapper" ]; do + [[ $_mapper == \#* ]] && continue + [[ $_d -ef /dev/mapper/"$_mapper" ]] || continue + [[ "$_o" ]] || _o="$_p" + # skip entries with password files + [[ $_p == /* ]] && [[ -f $_p ]] && continue 2 + # skip mkswap swap + [[ $_o == *swap* ]] && continue 2 + done < "$dracutsysrootdir"/etc/crypttab + fi + + _dev="$(readlink -f "$dev")" + push_host_devs "$_dev" + swap_devs+=("$_dev") + break + done < "$dracutsysrootdir"/etc/fstab + done < /proc/swaps + fi + + # collect all "x-initrd.mount" entries from /etc/fstab + if [[ -f $dracutsysrootdir/etc/fstab ]]; then + while read -r _d _m _t _o _ || [ -n "$_d" ]; do + [[ $_d == \#* ]] && continue + [[ $_d ]] || continue + [[ $_o != *x-initrd.mount* ]] && continue + _dev=$(expand_persistent_dev "$_d") + _dev="$(readlink -f "$_dev")" + [[ -b $_dev ]] || continue + + push_host_devs "$_dev" + if [[ $_t == btrfs ]]; then + for i in $(btrfs_devs "$_m"); do + push_host_devs "$i" + done + fi + done < "$dracutsysrootdir"/etc/fstab + fi +fi + +unset m +unset rest + +_get_fs_type() { + [[ $1 ]] || return + if [[ -b /dev/block/$1 ]]; then + ID_FS_TYPE=$(get_fs_env "/dev/block/$1") && host_fs_types["$(readlink -f "/dev/block/$1")"]="$ID_FS_TYPE" + return 1 + fi + if [[ -b $1 ]]; then + ID_FS_TYPE=$(get_fs_env "$1") && host_fs_types["$(readlink -f "$1")"]="$ID_FS_TYPE" + return 1 + fi + if fstype=$(find_dev_fstype "$1"); then + host_fs_types["$1"]="$fstype" + return 1 + fi + return 1 +} + +for dev in "${host_devs[@]}"; do + _get_fs_type "$dev" + check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")" +done + +for dev in "${!host_fs_types[@]}"; do + [[ ${host_fs_types[$dev]} == "reiserfs" ]] || [[ ${host_fs_types[$dev]} == "xfs" ]] || continue + rootopts=$(find_dev_fsopts "$dev") + if [[ ${host_fs_types[$dev]} == "reiserfs" ]]; then + journaldev=$(fs_get_option "$rootopts" "jdev") + elif [[ ${host_fs_types[$dev]} == "xfs" ]]; then + journaldev=$(fs_get_option "$rootopts" "logdev") + fi + if [[ $journaldev ]]; then + dev="$(readlink -f "$dev")" + push_host_devs "$dev" + _get_fs_type "$dev" + check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")" + fi +done + +[[ -d $dracutsysrootdir$dbus ]] \ + || dbus=$(pkg-config dbus --variable=dbus 2> /dev/null) + +[[ -d $dracutsysrootdir$dbus ]] || dbus=/usr/share/dbus-1 + +[[ -d $dracutsysrootdir$dbusconfdir ]] \ + || dbusconfdir=$(pkg-config dbus --variable=dbusconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$dbusconfdir ]] || dbusconfdir=/etc/dbus-1 + +[[ -d $dracutsysrootdir$dbusinterfaces ]] \ + || dbusinterfaces=$(pkg-config dbus --variable=dbusinterfaces 2> /dev/null) + +[[ -d $dracutsysrootdir$dbusinterfaces ]] || dbusinterfaces=${dbus}/interfaces + +[[ -d $dracutsysrootdir$dbusinterfacesconfdir ]] \ + || dbusinterfacesconfdir=$(pkg-config dbus --variable=dbusinterfacesconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$dbusinterfacesconfdir ]] || dbusinterfacesconfdir=${dbusconfdir}/interfaces + +[[ -d $dracutsysrootdir$dbusservices ]] \ + || dbusservices=$(pkg-config dbus --variable=dbusservices 2> /dev/null) + +[[ -d $dracutsysrootdir$dbusservices ]] || dbusservices=${dbus}/services + +[[ -d $dracutsysrootdir$dbusservicesconfdir ]] \ + || dbusservicesconfdir=$(pkg-config dbus --variable=dbusservicesconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$dbusservicesconfdir ]] || dbusservicesconfdir=${dbusconfdir}/services + +[[ -d $dracutsysrootdir$dbussession ]] \ + || dbussession=$(pkg-config dbus --variable=dbussession 2> /dev/null) + +[[ -d $dracutsysrootdir$dbussession ]] || dbussession=${dbus}/session.d + +[[ -d $dracutsysrootdir$dbussessionconfdir ]] \ + || dbussessionconfdir=$(pkg-config dbus --variable=dbussessionconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$dbussessionconfdir ]] || dbussessionconfdir=${dbusconfdir}/session.d + +[[ -d $dracutsysrootdir$dbussystem ]] \ + || dbussystem=$(pkg-config dbus --variable=dbussystem 2> /dev/null) + +[[ -d $dracutsysrootdir$dbussystem ]] || dbussystem=${dbus}/system.d + +[[ -d $dracutsysrootdir$dbussystemconfdir ]] \ + || dbussystemconfdir=$(pkg-config dbus --variable=dbussystemconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$dbussystemconfdir ]] || dbussystemconfdir=${dbusconfdir}/system.d + +[[ -d $dracutsysrootdir$dbussystemservices ]] \ + || dbussystemservices=$(pkg-config dbus --variable=dbussystemservices 2> /dev/null) + +[[ -d $dracutsysrootdir$dbussystemservices ]] || dbussystemservices=${dbus}/system-services + +[[ -d $dracutsysrootdir$dbussystemservicesconfdir ]] \ + || dbussystemservicesconfdir=$(pkg-config dbus --variable=dbussystemservicesconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$dbussystemservicesconfdir ]] || dbussystemservicesconfdir=${dbusconfdir}/system-services + +[[ -d $dracutsysrootdir$udevdir ]] \ + || udevdir="$(pkg-config udev --variable=udevdir 2> /dev/null)" +if ! [[ -d $dracutsysrootdir$udevdir ]]; then + [[ -e $dracutsysrootdir/lib/udev/ata_id ]] && udevdir=/lib/udev + [[ -e $dracutsysrootdir/usr/lib/udev/ata_id ]] && udevdir=/usr/lib/udev +fi + +[[ -d $dracutsysrootdir$udevconfdir ]] \ + || udevconfdir=$(pkg-config udev --variable=udevconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$udevconfdir ]] || udevconfdir=/etc/udev + +[[ -d $dracutsysrootdir$udevrulesdir ]] \ + || udevrulesdir=$(pkg-config udev --variable=udevrulesdir 2> /dev/null) + +[[ -d $dracutsysrootdir$udevrulesdir ]] || udevrulesdir=${udevdir}/rules.d + +[[ -d $dracutsysrootdir$udevrulesconfdir ]] \ + || udevrulesconfdir=$(pkg-config udev --variable=udevrulesconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$udevrulesconfdir ]] || udevrulesconfdir=${udevconfdir}/rules.d + +[[ -d $dracutsysrootdir$sysctld ]] \ + || sysctld=$(pkg-config systemd --variable=sysctld 2> /dev/null) + +[[ -d $dracutsysrootdir$sysctld ]] || sysctld=/usr/lib/sysctl.d + +[[ -d $dracutsysrootdir$sysctlconfdir ]] \ + || sysctlconfdir=$(pkg-config systemd --variable=sysctlconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$sysctlconfdir ]] || sysctlconfdir=/etc/sysctl.d + +[[ -d $dracutsysrootdir$environment ]] \ + || environment=$(pkg-config systemd --variable=environment 2> /dev/null) + +[[ -d $dracutsysrootdir$environment ]] || environment=/usr/lib/environment.d + +[[ -d $dracutsysrootdir$environmentconfdir ]] \ + || environmentconfdir=$(pkg-config systemd --variable=environmentconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$environmentconfdir ]] || environmentconfdir=/etc/environment.d + +[[ -d $dracutsysrootdir$systemdcatalog ]] \ + || systemdcatalog=$(pkg-config systemd --variable=systemdcatalog 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdcatalog ]] || systemdcatalog=${systemdutildir}/catalog + +[[ -d $dracutsysrootdir$modulesload ]] \ + || modulesload=$(pkg-config systemd --variable=modulesload 2> /dev/null) + +[[ -d $dracutsysrootdir$modulesload ]] || modulesload=/usr/lib/modules-load.d + +[[ -d $dracutsysrootdir$modulesloadconfdir ]] \ + || modulesloadconfdir=$(pkg-config systemd --variable=modulesloadconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$modulesloadconfdir ]] || modulesloadconfdir=/etc/modules-load.d + +[[ -d $dracutsysrootdir$systemdnetwork ]] \ + || systemdnetwork=$(pkg-config systemd --variable=systemdnetwork 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdnetwork ]] || systemdnetwork=${systemdutildir}/network + +[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] \ + || systemdnetworkconfdir=$(pkg-config systemd --variable=systemdnetworkconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] || systemdnetworkconfdir=${systemdsystemconfdir}/network + +[[ -d $dracutsysrootdir$systemdntpunits ]] \ + || systemdntpunits=$(pkg-config systemd --variable=systemdntpunits 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdntpunits ]] || systemdntpunits=${systemdutildir}/ntp-units.d + +[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] \ + || systemdntpunitsconfdir=$(pkg-config systemd --variable=systemdntpunitsconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] || systemdntpunitsconfdir=${systemdsystemconfdir}/ntp-units.d + +[[ -d $dracutsysrootdir$systemdportable ]] \ + || systemdportable=$(pkg-config systemd --variable=systemdportable 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdportable ]] || systemdportable=${systemdutildir}/portable + +[[ -d $dracutsysrootdir$systemdportableconfdir ]] \ + || systemdportableconfdir=$(pkg-config systemd --variable=systemdportableconfdir 2> /dev/null) + +[[ -d "$dracutsysrootdir$systemdportableconfdir" ]] || systemdportableconfdir=${systemdsystemconfdir}/portable + +[[ -d $dracutsysrootdir$systemdsystemunitdir ]] \ + || systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2> /dev/null) + +[[ -d "$dracutsysrootdir$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system + +[[ -d $dracutsysrootdir$systemduser ]] \ + || systemduser=$(pkg-config systemd --variable=systemduser 2> /dev/null) + +[[ -d $dracutsysrootdir$systemduser ]] || systemduser=${systemdutildir}/user + +[[ -d $dracutsysrootdir$systemduserconfdir ]] \ + || systemduserconfdir=$(pkg-config systemd --variable=systemduserconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$systemduserconfdir ]] || systemduserconfdir=${systemdsystemconfdir}/user + +[[ -d $dracutsysrootdir$systemdsystemconfdir ]] \ + || systemdsystemconfdir=$(pkg-config systemd --variable=systemdsystemconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$systemdsystemconfdir ]] || systemdsystemconfdir=/etc/systemd/system + +[[ -d $dracutsysrootdir$sysusers ]] \ + || sysusers=$(pkg-config systemd --variable=sysusers 2> /dev/null) + +[[ -d $dracutsysrootdir$sysusers ]] || sysusers=/usr/lib/sysusers.d + +[[ -d $dracutsysrootdir$sysusersconfdir ]] \ + || sysusersconfdir=$(pkg-config systemd --variable=sysusersconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$sysusersconfdir ]] || sysusersconfdir=/etc/sysusers.d + +[[ -d $dracutsysrootdir$tmpfilesdir ]] \ + || tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2> /dev/null) + +if ! [[ -d $dracutsysrootdir$tmpfilesdir ]]; then + [[ -d $dracutsysrootdir/lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d + [[ -d $dracutsysrootdir/usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d +fi + +[[ -d $dracutsysrootdir$tmpfilesconfdir ]] \ + || tmpfilesconfdir=$(pkg-config systemd --variable=tmpfilesconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$tmpfilesconfdir ]] || tmpfilesconfdir=/etc/tmpfiles.d + +[[ -d $dracutsysrootdir$depmodd ]] \ + || sysctld=$(pkg-config libkmod --variable=depmodd 2> /dev/null) + +[[ -d $dracutsysrootdir$depmodd ]] || depmodd=/usr/lib/depmod.d + +[[ -d $dracutsysrootdir$depmodconfdir ]] \ + || sysctlconfdir=$(pkg-config libkmod --variable=depmodconfdir 2> /dev/null) + +[[ -d $dracutsysrootdir$depmodconfdir ]] || depmodconfdir=/etc/depmod.d + +# me +[ -z "$kbddir" ] && kbddir=/usr/share +export initdir dracutbasedir \ + dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \ + mods_to_load \ + fw_dir drivers_dir debug no_kernel kernel_only \ + omit_drivers mdadmconf lvmconf root_devs \ + use_fstab fstab_lines libdirs fscks nofscks ro_mnt \ + stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \ + debug host_fs_types host_devs swap_devs sshkey add_fstab \ + DRACUT_VERSION udevdir udevconfdir udevrulesdir udevrulesconfdir \ + prefix filesystems drivers dbus dbusconfdir dbusinterfaces \ + dbusinterfacesconfdir dbusservices dbusservicesconfdir dbussession \ + dbussessionconfdir dbussystem dbussystemconfdir dbussystemservices \ + dbussystemservicesconfdir environment environmentconfdir modulesload \ + modulesloadconfdir sysctl sysctlconfdir sysusers sysusersconfdir \ + systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \ + systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \ + hostonly_cmdline loginstall tmpfilesdir tmpfilesconfdir depmodd \ + kbddir depmodconfdir + +mods_to_load="" +# check all our modules to see if they should be sourced. +# This builds a list of modules that we will install next. +for_each_module_dir check_module +for_each_module_dir check_mount + +dracut_module_included "fips" && export DRACUT_FIPS_MODE=1 + +do_print_cmdline() { + local -A _mods_to_print + for i in $modules_loaded $mods_to_load; do + _mods_to_print[$i]=1 + done + + # source our modules. + for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do + _d_mod=${moddir##*/} + _d_mod=${_d_mod#[0-9][0-9]} + [[ ${_mods_to_print[$_d_mod]} ]] || continue + module_cmdline "$_d_mod" "$moddir" + done + unset moddir +} + +if [[ $print_cmdline ]]; then + do_print_cmdline + printf "\n" + exit 0 +fi + +# Create some directory structure first +# shellcheck disable=SC2174 +[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}" + +# shellcheck disable=SC2174 +[[ -L $dracutsysrootdir/lib ]] || mkdir -m 0755 -p "${initdir}${prefix}/lib" +[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib" + +if [[ $prefix ]]; then + for d in bin etc lib sbin tmp usr var $libdirs; do + d=${d#/} + [[ $d == */* ]] && continue + ln -sfn "${prefix#/}/${d#/}" "$initdir/$d" + done +fi + +if [[ $kernel_only != yes ]]; then + for d in usr usr/bin usr/sbin bin etc lib sbin tmp var var/tmp $libdirs; do + d=${d#/} + [[ -e "${initdir}${prefix}/$d" ]] && continue + if [ -L "/$d" ]; then + inst_symlink "/$d" "${prefix}/$d" + else + # shellcheck disable=SC2174 + mkdir -m 0755 -p "${initdir}${prefix}/$d" + fi + done + + for d in dev proc sys sysroot root run; do + if [ -L "/$d" ]; then + inst_symlink "/$d" + else + # shellcheck disable=SC2174 + mkdir -m 0755 -p "$initdir/$d" + fi + done + + ln -sfn ../run "$initdir/var/run" + ln -sfn ../run/lock "$initdir/var/lock" +else + for d in lib "$libdirs"; do + [[ -e "${initdir}${prefix}/$d" ]] && continue + if [ -h "/$d" ]; then + inst "/$d" "${prefix}/$d" + else + # shellcheck disable=SC2174 + mkdir -m 0755 -p "${initdir}${prefix}/$d" + fi + done +fi + +if [[ $kernel_only != yes ]]; then + mkdir -p "${initdir}/etc/cmdline.d" + # shellcheck disable=SC2174 + mkdir -m 0755 -p "${initdir}"/lib "${initdir}"/lib/dracut "${initdir}"/lib/dracut/hooks + # shellcheck disable=SC2154 + for _d in $hookdirs; do + # shellcheck disable=SC2174 + mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d" + done + if [[ $EUID == "0" ]] && ! [[ $DRACUT_NO_MKNOD ]]; then + [[ -c ${initdir}/dev/null ]] || mknod "${initdir}"/dev/null c 1 3 + [[ -c ${initdir}/dev/kmsg ]] || mknod "${initdir}"/dev/kmsg c 1 11 + [[ -c ${initdir}/dev/console ]] || mknod "${initdir}"/dev/console c 5 1 + [[ -c ${initdir}/dev/random ]] || mknod "${initdir}"/dev/random c 1 8 + [[ -c ${initdir}/dev/urandom ]] || mknod "${initdir}"/dev/urandom c 1 9 + fi +fi + +_isize=0 #initramfs size +modules_loaded=" " +# source our modules. +for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do + _d_mod=${moddir##*/} + _d_mod=${_d_mod#[0-9][0-9]} + [[ $mods_to_load == *\ $_d_mod\ * ]] || continue + if [[ $show_modules == yes ]]; then + printf "%s\n" "$_d_mod" + else + dinfo "*** Including module: $_d_mod ***" + fi + if [[ $kernel_only == yes ]]; then + module_installkernel "$_d_mod" "$moddir" || { + dfatal "installkernel failed in module $_d_mod" + exit 1 + } + else + module_install "$_d_mod" "$moddir" + if [[ $no_kernel != yes ]]; then + module_installkernel "$_d_mod" "$moddir" || { + dfatal "installkernel failed in module $_d_mod" + exit 1 + } + fi + fi + mods_to_load=${mods_to_load// $_d_mod /} + modules_loaded+="$_d_mod " + + #print the module install size + if [ -n "$printsize" ]; then + _isize_new=$(du -sk "${initdir}" | { + read -r a _ + echo -n "$a" + }) + _isize_delta=$((_isize_new - _isize)) + printf "%s\n" "$_d_mod install size: ${_isize_delta}k" + _isize=$_isize_new + fi +done +unset moddir + +for i in $modules_loaded; do + mkdir -p "$initdir"/lib/dracut + printf "%s\n" "$i" >> "$initdir"/lib/dracut/modules.txt +done + +dinfo "*** Including modules done ***" + +## final stuff that has to happen +if [[ $no_kernel != yes ]]; then + if [[ $hostonly_mode == "strict" ]]; then + cp "$DRACUT_KERNEL_MODALIASES" "$initdir"/lib/dracut/hostonly-kernel-modules.txt + fi + + if [[ $drivers ]]; then + # shellcheck disable=SC2086 + hostonly='' instmods $drivers + fi + + if [[ -n ${add_drivers// /} ]]; then + # shellcheck disable=SC2086 + hostonly='' instmods -c $add_drivers + fi + if [[ $force_drivers ]]; then + # shellcheck disable=SC2086 + hostonly='' instmods -c $force_drivers + rm -f "$initdir"/etc/cmdline.d/20-force_driver.conf + for mod in $force_drivers; do + echo "rd.driver.pre=$mod" >> "$initdir"/etc/cmdline.d/20-force_drivers.conf + done + fi + if [[ $filesystems ]]; then + # shellcheck disable=SC2086 + hostonly='' instmods -c $filesystems + fi + + dinfo "*** Installing kernel module dependencies ***" + dracut_kernel_post + dinfo "*** Installing kernel module dependencies done ***" +# me + for _src in $(eval echo {${KBDSUBDIRS}}); do + [ -d "${initdir}/usr/share/${_src}" ] && continue + [ -h "${initdir}/usr/share/${_src}" ] && \ + rm "${initdir}/usr/share/${_src}" + ln -s "../../${_src}" "${initdir}/usr/share/${_src}" + done + + # dinfo 4 $( ls -l "${initdir}/usr/share/" ) $kdddir + + if [[ $noimageifnotneeded == yes ]] && [[ $hostonly ]]; then + if [[ ! -f "$initdir/lib/dracut/need-initqueue" ]] \ + && [[ -f ${initdir}/lib/modules/$kernel/modules.dep && ! -s ${initdir}/lib/modules/$kernel/modules.dep ]]; then + for i in "${initdir}"/etc/cmdline.d/*.conf; do + # We need no initramfs image and do not generate one. + [[ $i == "${initdir}/etc/cmdline.d/*.conf" ]] && exit 0 + done + fi + fi +fi + +if [[ $kernel_only != yes ]]; then + # FIXME: handle legacy item split + # shellcheck disable=SC2068 + ((${#install_items[@]} > 0)) && inst_multiple ${install_items[@]} + # shellcheck disable=SC2068 + ((${#install_optional_items[@]} > 0)) && inst_multiple -o ${install_optional_items[@]} + + if [[ $kernel_cmdline ]] && [[ $uefi != yes ]]; then + printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf" + fi + + for line in "${fstab_lines[@]}"; do + read -r -a fstab_field <<< "$line" + if [ -z "${fstab_field[1]}" ]; then + # Determine device and mount options from current system + mountpoint -q "${fstab_field[0]}" || derror "${fstab_field[0]} is not a mount point!" + read -r -a fstab_field < <(findmnt --raw -n --target "${fstab_field[0]}" --output=source,target,fstype,options) + dinfo "Line for ${fstab_field[1]}: ${fstab_field[*]}" + else + # Use default options + [ -z "${fstab_field[3]}" ] && fstab_field[3]="defaults" + fi + + # Default options for freq and passno + [ -z "${fstab_field[4]}" ] && fstab_field[4]="0" + [ -z "${fstab_field[5]}" ] && fstab_field[5]="2" + + strstr "${fstab_field[2]}" "nfs" && fstab_field[5]="0" + echo "${fstab_field[@]}" >> "${initdir}/etc/fstab" + done + + for f in $add_fstab; do + cat "$f" >> "${initdir}/etc/fstab" + done + + if [[ $dracutsysrootdir$systemdutildir ]]; then + if [[ -d ${initdir}/$systemdutildir ]]; then + mkdir -p "${initdir}"/etc/conf.d + { + printf "%s\n" "systemdutildir=\"$systemdutildir\"" + printf "%s\n" "systemdsystemunitdir=\"$systemdsystemunitdir\"" + printf "%s\n" "systemdsystemconfdir=\"$systemdsystemconfdir\"" + } > "${initdir}"/etc/conf.d/systemd.conf + fi + fi + + if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then + dinfo "*** Resolving executable dependencies ***" + find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \ + | xargs -r -0 "$DRACUT_INSTALL" ${initdir:+-D "$initdir"} ${dracutsysrootdir:+-r "$dracutsysrootdir"} -R ${DRACUT_FIPS_MODE:+-f} -- + dinfo "*** Resolving executable dependencies done ***" + fi + + # Now we are done with lazy resolving, always install dependencies + unset DRACUT_RESOLVE_LAZY + export DRACUT_RESOLVE_DEPS=1 +fi + +for ((i = 0; i < ${#include_src[@]}; i++)); do + src="${include_src[$i]}" + target="${include_target[$i]}" + if [[ $src && $target ]]; then + if [[ -f $src ]]; then + inst "$src" "$target" + elif [[ -d $src ]]; then + ddebug "Including directory: $src" + destdir="${initdir}/${target}" + mkdir -p "$destdir" + # check for preexisting symlinks, so we can cope with the + # symlinks to $prefix + # Objectname is a file or a directory + for objectname in "$src"/*; do + [[ -e $objectname || -L $objectname ]] || continue + if [[ -d $objectname ]]; then + # objectname is a directory, let's compute the final directory name + object_destdir=${destdir}/${objectname#$src/} + if ! [[ -e $object_destdir ]]; then + # shellcheck disable=SC2174 + mkdir -m 0755 -p "$object_destdir" + chmod --reference="$objectname" "$object_destdir" + fi + $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/* + else + $DRACUT_CP -t "$destdir" "$dracutsysrootdir$objectname" + fi + done + elif [[ -e $src ]]; then + derror "$src is neither a directory nor a regular file" + else + derror "$src doesn't exist" + fi + fi +done + +if [[ $do_hardlink == yes ]] && command -v hardlink > /dev/null; then + dinfo "*** Hardlinking files ***" + hardlink "$initdir" 2>&1 | dinfo + dinfo "*** Hardlinking files done ***" +fi + +# strip binaries +if [[ $do_strip == yes ]]; then + # Prefer strip from elfutils for package size + declare strip_cmd + strip_cmd=$(command -v eu-strip) + [ -z "$strip_cmd" ] && strip_cmd="strip" + + for p in $strip_cmd xargs find; do + if ! type -P $p > /dev/null; then + dinfo "Could not find '$p'. Not stripping the initramfs." + do_strip=no + fi + done +fi + +# cleanup empty ldconfig_paths directories +for d in $(ldconfig_paths); do + rmdir -p --ignore-fail-on-non-empty "$initdir/$d" > /dev/null 2>&1 +done + +if [[ $early_microcode == yes ]]; then + dinfo "*** Generating early-microcode cpio image ***" + ucode_dir=(amd-ucode intel-ucode) + ucode_dest=(AuthenticAMD.bin GenuineIntel.bin) + _dest_dir="$early_cpio_dir/d/kernel/x86/microcode" + _dest_idx="0 1" + mkdir -p "$_dest_dir" + if [[ $hostonly ]]; then + [[ $(get_cpu_vendor) == "AMD" ]] && _dest_idx="0" + [[ $(get_cpu_vendor) == "Intel" ]] && _dest_idx="1" + fi + for idx in $_dest_idx; do + _fw=${ucode_dir[$idx]} + for _fwdir in $fw_dir; do + if [[ -d $_fwdir && -d $_fwdir/$_fw ]]; then + _src="*" + dinfo "*** Constructing ${ucode_dest[$idx]} ***" + if [[ $hostonly ]]; then + _src=$(get_ucode_file) + [[ $_src ]] || break + [[ -r $_fwdir/$_fw/$_src ]] || _src="${_src}.early" + [[ -r $_fwdir/$_fw/$_src ]] || break + fi + + for i in $_fwdir/$_fw/$_src; do + [ -e "$i" ] && break + break 2 + done + for i in $_fwdir/$_fw/$_src; do + [[ -e $i ]] || continue + # skip gpg files + str_ends "$i" ".asc" && continue + cat "$i" >> "$_dest_dir/${ucode_dest[$idx]}" + done + create_early_cpio="yes" + fi + done + if [[ ! -e "$_dest_dir/${ucode_dest[$idx]}" ]]; then + if cd "$early_cpio_dir/d"; then + for _ucodedir in "${early_microcode_image_dir[@]}"; do + for _ucodename in "${early_microcode_image_name[@]}"; do + [[ -e "$_ucodedir/$_ucodename" ]] \ + && cpio --extract --file "$_ucodedir/$_ucodename" --quiet \ + "kernel/x86/microcode/${ucode_dest[$idx]}" + if [[ -e "$_dest_dir/${ucode_dest[$idx]}" ]]; then + dinfo "*** Using microcode found in '$_ucodedir/$_ucodename' ***" + create_early_cpio="yes" + break 2 + fi + done + done + fi + fi + done +fi + +if [[ $acpi_override == yes ]] && [[ -d $acpi_table_dir ]]; then + dinfo "*** Packaging ACPI tables to override BIOS provided ones ***" + _dest_dir="$early_cpio_dir/d/kernel/firmware/acpi" + mkdir -p "$_dest_dir" + for table in "$acpi_table_dir"/*.aml; do + dinfo " Adding ACPI table: $table" + $DRACUT_CP "$table" "$_dest_dir" + create_early_cpio="yes" + done +fi + +dinfo "*** Store current command line parameters ***" +if ! (echo "$PARMS_TO_STORE" > "$initdir"/lib/dracut/build-parameter.txt); then + dfatal "Could not store the current command line parameters" + exit 1 +fi + +if [[ $hostonly_cmdline == "yes" ]]; then + unset _stored_cmdline + if [[ -d $initdir/etc/cmdline.d ]]; then + dinfo "Stored kernel commandline:" + for conf in "$initdir"/etc/cmdline.d/*.conf; do + [ -e "$conf" ] || continue + dinfo "$(< "$conf")" + _stored_cmdline=1 + done + fi + if ! [[ $_stored_cmdline ]]; then + dinfo "No dracut internal kernel commandline stored in the initramfs" + fi +fi + +if [[ $kernel_only != yes ]]; then + # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so + for _dir in $libdirs; do + for _f in "$dracutsysrootdir$_dir/libpthread.so"*; do + [[ -e $_f ]] || continue + inst_libdir_file "libgcc_s.so*" + break 2 + done + done + + # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled + if [[ $DRACUT_FIPS_MODE ]]; then + for _dir in $libdirs; do + for _f in "$dracutsysrootdir$_dir/libcrypto.so"*; do + [[ -e $_f ]] || continue + inst_libdir_file -o "libssl.so*" + break 2 + done + done + fi +fi + +if [[ $kernel_only != yes ]]; then + # make sure that library links are correct and up to date + for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do + [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}" + done + if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then + if [[ $EUID == 0 ]]; then + derror "ldconfig exited ungracefully" + else + derror "ldconfig might need uid=0 (root) for chroot()" + fi + fi +fi + +if dracut_module_included "squash"; then + readonly squash_dir="$initdir/squash/root" + readonly squash_img="$initdir/squash-root.img" + mkdir -p "$squash_dir" + dinfo "*** Install squash loader ***" + DRACUT_SQUASH_POST_INST=1 module_install "squash" +fi + +if [[ $do_strip == yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then + dinfo "*** Stripping files ***" + find "$initdir" -type f \ + -executable -not -path '*/lib/modules/*.ko' -print0 \ + | xargs -r -0 $strip_cmd -g -p 2> /dev/null + + # strip kernel modules, but do not touch signed modules + find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \ + | while read -r -d $'\0' f || [ -n "$f" ]; do + SIG=$(tail -c 28 "$f" | tr -d '\000') + [[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; } + done | xargs -r -0 $strip_cmd -g -p + dinfo "*** Stripping files done ***" +fi + +if dracut_module_included "squash"; then + dinfo "*** Squashing the files inside the initramfs ***" + declare squash_compress_arg + # shellcheck disable=SC2086 + if [[ $compress ]]; then + if ! mksquashfs /dev/null "$DRACUT_TMPDIR"/.squash-test.img -no-progress -comp $compress &> /dev/null; then + dwarn "mksquashfs doesn't support compressor '$compress', failing back to default compressor." + else + squash_compress_arg="$compress" + fi + fi + + # shellcheck disable=SC2086 + if ! mksquashfs "$squash_dir" "$squash_img" \ + -no-xattrs -no-exports -noappend -no-recovery -always-use-fragments \ + -no-progress ${squash_compress_arg:+-comp $squash_compress_arg} 1> /dev/null; then + dfatal "dracut: Failed making squash image" + exit 1 + fi + + rm -rf "$squash_dir" + dinfo "*** Squashing the files inside the initramfs done ***" + + # Skip initramfs compress + compress="cat" +fi + +dinfo "*** Creating image file '$outfile' ***" + +if [[ $uefi == yes ]]; then + readonly uefi_outdir="$DRACUT_TMPDIR/uefi" + mkdir -p "$uefi_outdir" +fi + +if [[ $DRACUT_REPRODUCIBLE ]]; then + find "$initdir" -newer "$dracutbasedir/dracut-functions.sh" -print0 \ + | xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh" + + if [[ "$(cpio --help)" == *--reproducible* ]]; then + CPIO_REPRODUCIBLE=1 + else + dinfo "cpio does not support '--reproducible'. Resulting image will not be reproducible." + fi +fi + +[[ $EUID != 0 ]] && cpio_owner="0:0" + +if [[ $create_early_cpio == yes ]]; then + echo 1 > "$early_cpio_dir/d/early_cpio" + + if [[ $DRACUT_REPRODUCIBLE ]]; then + find "$early_cpio_dir/d" -newer "$dracutbasedir/dracut-functions.sh" -print0 \ + | xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh" + fi + + # The microcode blob is _before_ the initramfs blob, not after + if ! ( + umask 077 + cd "$early_cpio_dir/d" + find . -print0 | sort -z \ + | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null \ + ${cpio_owner:+-R "$cpio_owner"} -H newc -o --quiet > "${DRACUT_TMPDIR}/initramfs.img" + ); then + dfatal "dracut: creation of $outfile failed" + exit 1 + fi +fi + +if ! [[ $compress ]]; then + # check all known compressors, if none specified + for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $ $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $OMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do + command -v "$i" &> /dev/null || continue + compress="$i" + break + done + if [[ $compress == cat ]]; then + printf "%s\n" "dracut: no compression tool available. Initramfs image is going to be big." >&2 + fi +fi + +# choose the right arguments for the compressor +case $compress in + bzip2 | lbzip2) + if [[ $compress == lbzip2 ]] || command -v "$DRACUT_COMPRESS_LBZIP2" &> /dev/null; then + compress="$DRACUT_COMPRESS_LBZIP2 -9" + else + compress="$DRACUT_COMPRESS_BZIP2 -9" + fi + ;; + lzma) + compress="$DRACUT_COMPRESS_LZMA -9 -T0" + ;; + xz) + compress="$DRACUT_COMPRESS_XZ --check=crc32 --lzma2=dict=1MiB -T0" + ;; + gzip | pigz) + if [[ $compress == pigz ]] || command -v "$DRACUT_COMPRESS_PIGZ" &> /dev/null; then + compress="$DRACUT_COMPRESS_PIGZ -9 -n -T -R" + elif command -v gzip &> /dev/null && $DRACUT_COMPRESS_GZIP --help 2>&1 | grep -q rsyncable; then + compress="$DRACUT_COMPRESS_GZIP -n -9 --rsyncable" + else + compress="$DRACUT_COMPRESS_GZIP -n -9" + fi + ;; + lzo | lzop) + compress="$DRACUT_COMPRESS_LZOP -9" + ;; + lz4) + compress="$DRACUT_COMPRESS_LZ4 -l -9" + ;; + zstd) + compress="$DRACUT_COMPRESS_ZSTD -15 -q -T0" + ;; +esac + +if ! ( + umask 077 + cd "$initdir" + find . -print0 | sort -z \ + | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null ${cpio_owner:+-R "$cpio_owner"} -H newc -o --quiet \ + | $compress >> "${DRACUT_TMPDIR}/initramfs.img" +); then + dfatal "dracut: creation of $outfile failed" + exit 1 +fi + +# shellcheck disable=SC2154 +if ((maxloglvl >= 5)) && ((verbosity_mod_l >= 0)); then + if [[ $allowlocal ]]; then + "$dracutbasedir/lsinitrd.sh" "${DRACUT_TMPDIR}/initramfs.img" | ddebug + else + lsinitrd "${DRACUT_TMPDIR}/initramfs.img" | ddebug + fi +fi + +umask 077 + +if [[ $uefi == yes ]]; then + if [[ $kernel_cmdline ]]; then + echo -n "$kernel_cmdline" > "$uefi_outdir/cmdline.txt" + elif [[ $hostonly_cmdline == yes ]] && [ -d "$initdir/etc/cmdline.d" ]; then + for conf in "$initdir"/etc/cmdline.d/*.conf; do + [ -e "$conf" ] || continue + printf "%s " "$(< "$conf")" >> "$uefi_outdir/cmdline.txt" + done + fi + + if [[ $kernel_cmdline ]] || [[ $hostonly_cmdline == yes && -d "$initdir/etc/cmdline.d" ]]; then + echo -ne "\x00" >> "$uefi_outdir/cmdline.txt" + dinfo "Using UEFI kernel cmdline:" + dinfo "$(tr -d '\000' < "$uefi_outdir/cmdline.txt")" + uefi_cmdline="${uefi_outdir}/cmdline.txt" + else + unset uefi_cmdline + fi + + [[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release" + [[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release" + if [[ -s ${dracutsysrootdir}${uefi_splash_image} ]]; then + uefi_splash_image="${dracutsysrootdir}${uefi_splash_image}" + else + unset uefi_splash_image + fi + + if objcopy \ + ${uefi_osrelease:+--add-section .osrel="$uefi_osrelease" --change-section-vma .osrel=0x20000} \ + ${uefi_cmdline:+--add-section .cmdline="$uefi_cmdline" --change-section-vma .cmdline=0x30000} \ + ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=0x40000} \ + --add-section .linux="$kernel_image" --change-section-vma .linux=0x2000000 \ + --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd=0x3000000 \ + "$uefi_stub" "${uefi_outdir}/linux.efi"; then + if [[ -n ${uefi_secureboot_key} && -n ${uefi_secureboot_cert} ]]; then + if sbsign \ + --key "${uefi_secureboot_key}" \ + --cert "${uefi_secureboot_cert}" \ + --output "$outfile" "${uefi_outdir}/linux.efi"; then + dinfo "*** Creating signed UEFI image file '$outfile' done ***" + else + dfatal "*** Creating signed UEFI image file '$outfile' failed ***" + exit 1 + fi + else + if cp --reflink=auto "${uefi_outdir}/linux.efi" "$outfile"; then + dinfo "*** Creating UEFI image file '$outfile' done ***" + fi + fi + else + rm -f -- "$outfile" + dfatal "*** Creating UEFI image file '$outfile' failed ***" + exit 1 + fi +else + if cp --reflink=auto "${DRACUT_TMPDIR}/initramfs.img" "$outfile"; then + dinfo "*** Creating initramfs image file '$outfile' done ***" + else + rm -f -- "$outfile" + dfatal "dracut: creation of $outfile failed" + exit 1 + fi +fi + +command -v restorecon &> /dev/null && restorecon -- "$outfile" + +btrfs_uuid() { + btrfs filesystem show "$1" | sed -n '1s/^.*uuid: //p' +} + +freeze_ok_for_btrfs() { + local mnt uuid1 uuid2 + # If the output file is on btrfs, we need to make sure that it's + # not on a subvolume of the same file system as the root FS. + # Otherwise, fsfreeze() might freeze the entire system. + # This is most conveniently checked by comparing the FS uuid. + + [[ "$(stat -f -c %T -- "/")" == "btrfs" ]] || return 0 + mnt=$(stat -c %m -- "$1") + uuid1=$(btrfs_uuid "$mnt") + uuid2=$(btrfs_uuid "/") + [[ $uuid1 && $uuid2 && $uuid1 != "$uuid2" ]] +} + +freeze_ok_for_fstype() { + local outfile=$1 + local fstype + + [[ "$(stat -c %m -- "$outfile")" == "/" ]] && return 1 + fstype=$(stat -f -c %T -- "$outfile") + case $fstype in + msdos) + return 1 + ;; + btrfs) + freeze_ok_for_btrfs "$outfile" + ;; + *) + return 0 + ;; + esac +} + +# We sync/fsfreeze only if we're operating on a live booted system. +# It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent, +# and there's no reason to sync, and *definitely* no reason to fsfreeze. +# Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze +# globally. See e.g. https://github.com/ostreedev/ostree/commit/8642ef5ab3fec3ac8eb8f193054852f83a8bc4d0 +if [[ -d $dracutsysrootdir/run/systemd/system ]]; then + if ! sync "$outfile" 2> /dev/null; then + dinfo "dracut: sync operation on newly created initramfs $outfile failed" + exit 1 + fi + + # use fsfreeze only if we're not writing to / + if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then + FSFROZEN="$(dirname "$outfile")" + if ! (fsfreeze -f "${FSFROZEN}" 2> /dev/null && fsfreeze -u "${FSFROZEN}" 2> /dev/null); then + dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")" + fi + unset FSFROZEN + fi +fi + +exit 0 diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/install.d/50-dracut.install b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/install.d/50-dracut.install new file mode 100755 index 0000000..70632ec --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/install.d/50-dracut.install @@ -0,0 +1,65 @@ +#!/bin/bash + +COMMAND="$1" +KERNEL_VERSION="$2" +BOOT_DIR_ABS="$3" +KERNEL_IMAGE="$4" + +# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory. +# So, let's skip to create initrd. +if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then + exit 0 +fi + +if [[ -d "$BOOT_DIR_ABS" ]]; then + INITRD="initrd" +else + BOOT_DIR_ABS="/boot" + INITRD="initramfs-${KERNEL_VERSION}.img" +fi + +ret=0 +case "$COMMAND" in + add) + INITRD_IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd + if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then + # we found an initrd at the same place as the kernel + # use this and don't generate a new one + cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \ + && chown root:root "$BOOT_DIR_ABS/$INITRD" \ + && chmod 0600 "$BOOT_DIR_ABS/$INITRD" \ + && exit 0 + fi + + if [[ -f /etc/kernel/cmdline ]]; then + read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline + elif [[ -f /usr/lib/kernel/cmdline ]]; then + read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline + else + declare -a BOOT_OPTIONS + + read -r -d '' -a line < /proc/cmdline + for i in "${line[@]}"; do + [[ "${i#initrd=*}" != "$i" ]] && continue + BOOT_OPTIONS+=("$i") + done + fi + + unset noimageifnotneeded + + for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do + # shellcheck disable=SC1001 + if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then + noimageifnotneeded="yes" + break + fi + done + dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION" + ret=$? + ;; + remove) + rm -f -- "$BOOT_DIR_ABS/$INITRD" + ret=$? + ;; +esac +exit $ret diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/install.d/51-dracut-rescue.install b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/install.d/51-dracut-rescue.install new file mode 100755 index 0000000..8bf9a6d --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/install.d/51-dracut-rescue.install @@ -0,0 +1,133 @@ +#!/bin/bash + +export LANG=C + +COMMAND="$1" +KERNEL_VERSION="$2" +BOOT_DIR_ABS="${3%/*}/0-rescue" +KERNEL_IMAGE="$4" + + +dropindirs_sort() +{ + suffix=$1; shift + args=("$@") + files=$( + while (( $# > 0 )); do + for i in "${1}"/*"${suffix}"; do + [[ -f $i ]] && echo "${i##*/}" + done + shift + done | sort -Vu + ) + + for f in $files; do + for d in "${args[@]}"; do + if [[ -f "$d/$f" ]]; then + echo "$d/$f" + continue 2 + fi + done + done +} + +[[ -f /etc/os-release ]] && . /etc/os-release + +if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then + MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID +elif [[ -f /etc/machine-id ]] ; then + read -r MACHINE_ID < /etc/machine-id +fi + +if ! [[ $MACHINE_ID ]]; then + exit 0 +fi + +if [[ -f /etc/kernel/cmdline ]]; then + read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline +elif [[ -f /usr/lib/kernel/cmdline ]]; then + read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline +else + declare -a BOOT_OPTIONS + + read -r -d '' -a line < /proc/cmdline + for i in "${line[@]}"; do + [[ "${i#initrd=*}" != "$i" ]] && continue + BOOT_OPTIONS+=("$i") + done +fi + +if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then + BOOT_DIR="/${MACHINE_ID}/0-rescue" + BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR} + LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf" + KERNEL="linux" + INITRD="initrd" +else + BLS_DIR="/boot/loader/entries" + BOOT_DIR_ABS="/boot" + LOADER_ENTRY="$BLS_DIR/${MACHINE_ID}-0-rescue.conf" + KERNEL="vmlinuz-0-rescue-${MACHINE_ID}" + INITRD="initramfs-0-rescue-${MACHINE_ID}.img" +fi + +ret=0 + +case "$COMMAND" in + add) + [[ -f "$LOADER_ENTRY" ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \ + && [[ -f "$BOOT_DIR_ABS/$INITRD" ]] && exit 0 + + # source our config dir + for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do + if [[ -e $f ]]; then + # shellcheck disable=SC1090 + . "$f" + fi + done + + # shellcheck disable=SC2154 + [[ $dracut_rescue_image != "yes" ]] && exit 0 + + [[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS" + + if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then + echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2 + fi + + if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then + dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION" + ((ret+=$?)) + fi + + if [[ "${BOOT_DIR_ABS}" != "/boot" ]]; then + { + echo "title $PRETTY_NAME - Rescue Image" + echo "version $KERNEL_VERSION" + echo "machine-id $MACHINE_ID" + echo "options ${BOOT_OPTIONS[*]} rd.auto=1" + echo "linux $BOOT_DIR/linux" + echo "initrd $BOOT_DIR/initrd" + } > "$LOADER_ENTRY" + else + if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then + cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" "$LOADER_ENTRY" + else + cp -aT "${KERNEL_IMAGE%/*}/bls.conf" "$LOADER_ENTRY" + fi + sed -i "s/${KERNEL_VERSION}/0-rescue-${MACHINE_ID}/" "$LOADER_ENTRY" + fi + + ((ret+=$?)) + ;; + + remove) + exit 0 + ;; + + *) + usage + ret=1;; +esac + +exit $ret diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/lsinitrd.sh b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/lsinitrd.sh new file mode 100755 index 0000000..7e35ded --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/lsinitrd.sh @@ -0,0 +1,365 @@ +#!/bin/bash +# +# Copyright 2005-2010 Harald Hoyer +# Copyright 2005-2010 Red Hat, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +usage() { + { + echo "Usage: ${0##*/} [options] [ [ [ [...] ]]]" + echo "Usage: ${0##*/} [options] -k " + echo + echo "-h, --help print a help message and exit." + echo "-s, --size sort the contents of the initramfs by size." + echo "-m, --mod list modules." + echo "-f, --file print the contents of ." + echo "--unpack unpack the initramfs, instead of displaying the contents." + echo " If optional filenames are given, will only unpack specified files," + echo " else the whole image will be unpacked. Won't unpack anything from early cpio part." + echo "--unpackearly unpack the early microcode part of the initramfs." + echo " Same as --unpack, but only unpack files from early cpio part." + echo "-v, --verbose unpack verbosely." + echo "-k, --kver inspect the initramfs of ." + echo + } >&2 +} + +[[ $dracutbasedir ]] || dracutbasedir=/usr/local/lib/dracut + +sorted=0 +modules=0 +unset verbose +declare -A filenames + +unset POSIXLY_CORRECT +TEMP=$(getopt \ + -o "vshmf:k:" \ + --long kver: \ + --long file: \ + --long mod \ + --long help \ + --long size \ + --long unpack \ + --long unpackearly \ + --long verbose \ + -- "$@") + +# shellcheck disable=SC2181 +if (($? != 0)); then + usage + exit 1 +fi + +eval set -- "$TEMP" + +while (($# > 0)); do + case $1 in + -k | --kver) + KERNEL_VERSION="$2" + shift + ;; + -f | --file) + filenames[${2#/}]=1 + shift + ;; + -s | --size) sorted=1 ;; + -h | --help) + usage + exit 0 + ;; + -m | --mod) modules=1 ;; + -v | --verbose) verbose="--verbose" ;; + --unpack) unpack=1 ;; + --unpackearly) unpackearly=1 ;; + --) + shift + break + ;; + *) + usage + exit 1 + ;; + esac + shift +done + +[[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(uname -r)" + +if [[ $1 ]]; then + image="$1" + if ! [[ -f $image ]]; then + { + echo "$image does not exist" + echo + } >&2 + usage + exit 1 + fi +else + [[ -f /etc/machine-id ]] && read -r MACHINE_ID < /etc/machine-id + + if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \ + && [[ $MACHINE_ID ]] \ + && [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]]; then + image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd" + elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \ + && [[ $MACHINE_ID ]] \ + && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]]; then + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" + else + image="/boot/initramfs-${KERNEL_VERSION}.img" + fi +fi + +shift +while (($# > 0)); do + filenames[${1#/}]=1 + shift +done + +if ! [[ -f $image ]]; then + { + echo "No specified and the default image '$image' cannot be accessed!" + echo + } >&2 + usage + exit 1 +fi + +TMPDIR="$(mktemp -d -t lsinitrd.XXXXXX)" +# shellcheck disable=SC2064 +trap "rm -rf '$TMPDIR'" EXIT + +dracutlibdirs() { + for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do + echo "$d/$1" + done +} + +extract_files() { + ((${#filenames[@]} == 1)) && nofileinfo=1 + for f in "${!filenames[@]}"; do + [[ $nofileinfo ]] || echo "initramfs:/$f" + [[ $nofileinfo ]] || echo "========================================================================" + $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2> /dev/null + ((ret += $?)) + [[ $nofileinfo ]] || echo "========================================================================" + [[ $nofileinfo ]] || echo + done +} + +list_modules() { + echo "dracut modules:" + # shellcheck disable=SC2046 + $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \ + $(dracutlibdirs modules.txt) 2> /dev/null + ((ret += $?)) +} + +list_files() { + echo "========================================================================" + if [ "$sorted" -eq 1 ]; then + $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -n -k5 + else + $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -k9 + fi + ((ret += $?)) + echo "========================================================================" +} + +list_squash_content() { + SQUASH_IMG="squash-root.img" + SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh" + + $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \ + $SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null + if [[ -s $SQUASH_TMPFILE ]]; then + echo "Squashed content ($SQUASH_IMG):" + echo "========================================================================" + unsquashfs -ll "$SQUASH_TMPFILE" | tail -n +4 + echo "========================================================================" + fi +} + +unpack_files() { + if ((${#filenames[@]} > 0)); then + for f in "${!filenames[@]}"; do + $CAT "$image" 2> /dev/null | cpio -id --quiet $verbose $f + ((ret += $?)) + done + else + $CAT "$image" 2> /dev/null | cpio -id --quiet $verbose + ((ret += $?)) + fi +} + +read -r -N 2 bin < "$image" +if [ "$bin" = "MZ" ]; then + command -v objcopy > /dev/null || { + echo "Need 'objcopy' to unpack an UEFI executable." + exit 1 + } + objcopy \ + --dump-section .linux="$TMPDIR/vmlinuz" \ + --dump-section .initrd="$TMPDIR/initrd.img" \ + --dump-section .cmdline="$TMPDIR/cmdline.txt" \ + --dump-section .osrel="$TMPDIR/osrel.txt" \ + "$image" /dev/null + uefi="$image" + image="$TMPDIR/initrd.img" + [ -f "$image" ] || exit 1 +fi + +if ((${#filenames[@]} <= 0)) && [[ -z $unpack ]] && [[ -z $unpackearly ]]; then + if [ -n "$uefi" ]; then + echo -n "initrd in UEFI: $uefi: " + du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done + if [ -f "$TMPDIR/osrel.txt" ]; then + name=$(sed -En '/^PRETTY_NAME/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt") + id=$(sed -En '/^ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt") + build=$(sed -En '/^BUILD_ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt") + echo "OS Release: $name (${id}-${build})" + fi + if [ -f "$TMPDIR/vmlinuz" ]; then + version=$(strings -n 20 "$TMPDIR/vmlinuz" | sed -En '/[0-9]+\.[0-9]+\.[0-9]+/ { p; q 0 }') + echo "Kernel Version: $version" + fi + if [ -f "$TMPDIR/cmdline.txt" ]; then + echo "Command line:" + sed -En 's/\s+/\n/g; s/\x00/\n/; p' "$TMPDIR/cmdline.txt" + fi + else + echo -n "Image: $image: " + du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done + fi + + echo "========================================================================" +fi + +read -r -N 6 bin < "$image" +case $bin in + $'\x71\xc7'* | 070701) + CAT="cat --" + is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2> /dev/null) + # Debian mkinitramfs does not create the file 'early_cpio', so let's check if firmware files exist + [[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2> /dev/null) + if [[ "$is_early" ]]; then + if [[ -n $unpack ]]; then + # should use --unpackearly for early CPIO + : + elif [[ -n $unpackearly ]]; then + unpack_files + elif ((${#filenames[@]} > 0)); then + extract_files + else + echo "Early CPIO image" + list_files + fi + if [[ -d "$dracutbasedir/skipcpio" ]]; then + SKIP="$dracutbasedir/skipcpio/skipcpio" + else + SKIP="$dracutbasedir/skipcpio" + fi + if ! [[ -x $SKIP ]]; then + echo + echo "'$SKIP' not found, cannot display remaining contents!" >&2 + echo + exit 0 + fi + fi + ;; +esac + +if [[ $SKIP ]]; then + bin="$($SKIP "$image" | { read -r -N 6 bin && echo "$bin"; })" +else + read -r -N 6 bin < "$image" +fi +case $bin in + $'\x1f\x8b'*) + CAT="zcat --" + ;; + BZh*) + CAT="bzcat --" + ;; + $'\x71\xc7'* | 070701) + CAT="cat --" + ;; + $'\x02\x21'*) + CAT="lz4 -d -c" + ;; + $'\x89'LZO$'\0'*) + CAT="lzop -d -c" + ;; + $'\x28\xB5\x2F\xFD'*) + CAT="zstd -d -c" + ;; + *) + if echo "test" | xz | xzcat --single-stream > /dev/null 2>&1; then + CAT="xzcat --single-stream --" + else + CAT="xzcat --" + fi + ;; +esac + +skipcpio() { + $SKIP "$@" | $ORIG_CAT +} + +if [[ $SKIP ]]; then + ORIG_CAT="$CAT" + CAT=skipcpio +fi + +if ((${#filenames[@]} > 1)); then + TMPFILE="$TMPDIR/initrd.cpio" + $CAT "$image" 2> /dev/null > "$TMPFILE" + pre_decompress() { + cat "$TMPFILE" + } + CAT=pre_decompress +fi + +ret=0 + +if [[ -n $unpack ]]; then + unpack_files +elif ((${#filenames[@]} > 0)); then + extract_files +else + # shellcheck disable=SC2046 + version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \ + $(dracutlibdirs 'dracut-*') 2> /dev/null) + ((ret += $?)) + echo "Version: $version" + echo + if [ "$modules" -eq 1 ]; then + list_modules + echo "========================================================================" + else + echo -n "Arguments: " + # shellcheck disable=SC2046 + $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \ + $(dracutlibdirs build-parameter.txt) 2> /dev/null + echo + list_modules + list_files + list_squash_content + fi +fi + +exit "$ret" diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut-catimages.8 b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut-catimages.8 new file mode 100644 index 0000000..bee1be6 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut-catimages.8 @@ -0,0 +1,93 @@ +'\" t +.\" Title: dracut-catimages +.\" Author: [see the "AUTHORS" section] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 05/17/2021 +.\" Manual: dracut +.\" Source: dracut +.\" Language: English +.\" +.TH "DRACUT\-CATIMAGES" "8" "05/17/2021" "dracut" "dracut" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +dracut-catimages \- creates initial ramdisk image by concatenating images +.SH "SYNOPSIS" +.sp +\fBdracut\-catimages\fR [\fIOPTION\fR\&...] \fI\fR [\fI\fR\&...] +.SH "DESCRIPTION" +.sp +dracut\-catimages creates an initial ramdisk image by concatenating several images from the command line and /boot/dracut/*\&.img +.SH "OPTIONS" +.PP +\fB\-f, \-\-force\fR +.RS 4 +overwrite existing initramfs file\&. +.RE +.PP +\fB\-i, \-\-imagedir\fR +.RS 4 +Directory with additional images to add (default: /boot/dracut/) +.RE +.PP +\fB\-o, \-\-overlaydir\fR +.RS 4 +Overlay directory, which contains additional files that will be used to create an additional image +.RE +.PP +\fB\-\-nooverlay\fR +.RS 4 +Do not use the overlay directory +.RE +.PP +\fB\-\-noimagedir\fR +.RS 4 +Do not use the additional image directory +.RE +.PP +\fB\-h, \-\-help\fR +.RS 4 +display help text and exit\&. +.RE +.PP +\fB\-\-debug\fR +.RS 4 +output debug information of the build process +.RE +.PP +\fB\-v, \-\-verbose\fR +.RS 4 +verbose output during the build process +.RE +.SH "FILES" +.PP +\fI/boot/dracut/*\&.img\fR +.RS 4 +images to work with +.RE +.SH "AUTHORS" +.sp +Harald Hoyer +.SH "AVAILABILITY" +.sp +The dracut\-catimages command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[] +.SH "SEE ALSO" +.sp +\fBdracut\fR(8) diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut-catimages.8.asc b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut-catimages.8.asc new file mode 100644 index 0000000..57f422c --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut-catimages.8.asc @@ -0,0 +1,59 @@ +DRACUT-CATIMAGES(8) +=================== +:doctype: manpage +:man source: dracut +:man manual: dracut + +NAME +---- +dracut-catimages - creates initial ramdisk image by concatenating images + +SYNOPSIS +-------- +**dracut-catimages** [_OPTION_...] __ [__...] + +DESCRIPTION +----------- +dracut-catimages creates an initial ramdisk image by concatenating several +images from the command line and /boot/dracut/*.img + +OPTIONS +------- +**-f, --force**:: + overwrite existing initramfs file. + +**-i, --imagedir**:: + Directory with additional images to add (default: /boot/dracut/) + +**-o, --overlaydir**:: + Overlay directory, which contains additional files that will be used to + create an additional image + +**--nooverlay**:: Do not use the overlay directory + +**--noimagedir**:: Do not use the additional image directory + +**-h, --help**:: display help text and exit. + +**--debug**:: output debug information of the build process + +**-v, --verbose**:: verbose output during the build process + +FILES +----- +_/boot/dracut/*.img_:: + images to work with + +AUTHORS +------- +Harald Hoyer + +AVAILABILITY +------------ +The dracut-catimages command is part of the dracut package and is available from +link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org] + +SEE ALSO +-------- +*dracut*(8) + diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.8 b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.8 new file mode 100644 index 0000000..aefda53 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.8 @@ -0,0 +1,2181 @@ +'\" t +.\" Title: dracut +.\" Author: [see the "AUTHORS" section] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 05/17/2021 +.\" Manual: dracut +.\" Source: dracut 054-2-gb9b6f0ee +.\" Language: English +.\" +.TH "DRACUT" "8" "05/17/2021" "dracut 054\-2\-gb9b6f0ee" "dracut" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +dracut \- low\-level tool for generating an initramfs/initrd image +.SH "SYNOPSIS" +.sp +\fBdracut\fR [\fIOPTION\&...\fR] [\fI\fR [\fI\fR]] +.SH "DESCRIPTION" +.sp +Create an initramfs for the kernel with the version \&. If is omitted, then the version of the actual running kernel is used\&. If is omitted or empty, then the default location /boot/initramfs\-\&.img is used\&. +.sp +dracut creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem, mounting the root filesystem and booting into the real system\&. +.sp +At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it as initial root file system\&. All finding of the root device happens in this early userspace\&. +.sp +Initramfs images are also called "initrd"\&. +.sp +For a complete list of kernel command line options see \fBdracut\&.cmdline\fR(7)\&. +.sp +If you are dropped to an emergency shell, while booting your initramfs, the file \fI/run/initramfs/rdsosreport\&.txt\fR is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick\&. Additional debugging info can be produced by adding \fBrd\&.debug\fR to the kernel command line\&. \fI/run/initramfs/rdsosreport\&.txt\fR contains all logs and the output of some tools\&. It should be attached to any report about dracut problems\&. +.SH "USAGE" +.sp +To create a initramfs image, the most simple command is: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut +.fi +.if n \{\ +.RE +.\} +.sp +This will generate a general purpose initramfs image, with all possible functionality resulting of the combination of the installed dracut modules and system tools\&. The image is /boot/initramfs\-\fI\fR\&.img and contains the kernel modules of the currently active kernel with version \fI\fR\&. +.sp +If the initramfs image already exists, dracut will display an error message, and to overwrite the existing image, you have to use the \-\-force option\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-force +.fi +.if n \{\ +.RE +.\} +.sp +If you want to specify another filename for the resulting image you would issue a command like: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut foobar\&.img +.fi +.if n \{\ +.RE +.\} +.sp +To generate an image for a specific kernel version, the command would be: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut foobar\&.img 2\&.6\&.40\-1\&.rc5\&.f20 +.fi +.if n \{\ +.RE +.\} +.sp +A shortcut to generate the image at the default location for a specific kernel version is: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-kver 2\&.6\&.40\-1\&.rc5\&.f20 +.fi +.if n \{\ +.RE +.\} +.sp +If you want to create lighter, smaller initramfs images, you may want to specify the \-\-hostonly or \-H option\&. Using this option, the resulting image will contain only those dracut modules, kernel modules and filesystems, which are needed to boot this specific machine\&. This has the drawback, that you can\(cqt put the disk on another controller or machine, and that you can\(cqt switch to another root filesystem, without recreating the initramfs image\&. The usage of the \-\-hostonly option is only for experts and you will have to keep the broken pieces\&. At least keep a copy of a general purpose image (and corresponding kernel) as a fallback to rescue your system\&. +.SS "Inspecting the Contents" +.sp +To see the contents of the image created by dracut, you can use the lsinitrd tool\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +# lsinitrd | less +.fi +.if n \{\ +.RE +.\} +.sp +To display the contents of a file in the initramfs also use the lsinitrd tool: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# lsinitrd \-f /etc/ld\&.so\&.conf +include ld\&.so\&.conf\&.d/*\&.conf +.fi +.if n \{\ +.RE +.\} +.SS "Adding dracut Modules" +.sp +Some dracut modules are turned off by default and have to be activated manually\&. You can do this by adding the dracut modules to the configuration file \fI/etc/dracut\&.conf\fR or \fI/etc/dracut\&.conf\&.d/myconf\&.conf\fR\&. See \fBdracut\&.conf\fR(5)\&. You can also add dracut modules on the command line by using the \-a or \-\-add option: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-add module initramfs\-module\&.img +.fi +.if n \{\ +.RE +.\} +.sp +To see a list of available dracut modules, use the \-\-list\-modules option: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-list\-modules +.fi +.if n \{\ +.RE +.\} +.SS "Omitting dracut Modules" +.sp +Sometimes you don\(cqt want a dracut module to be included for reasons of speed, size or functionality\&. To do this, either specify the omit_dracutmodules variable in the \fIdracut\&.conf\fR or \fI/etc/dracut\&.conf\&.d/myconf\&.conf\fR configuration file (see \fBdracut\&.conf\fR(5)), or use the \-o or \-\-omit option on the command line: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-o "multipath lvm" no\-multipath\-lvm\&.img +.fi +.if n \{\ +.RE +.\} +.SS "Adding Kernel Modules" +.sp +If you need a special kernel module in the initramfs, which is not automatically picked up by dracut, you have the use the \-\-add\-drivers option on the command line or the drivers variable in the \fI/etc/dracut\&.conf\fR or \fI/etc/dracut\&.conf\&.d/myconf\&.conf\fR configuration file (see \fBdracut\&.conf\fR(5)): +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-add\-drivers mymod initramfs\-with\-mymod\&.img +.fi +.if n \{\ +.RE +.\} +.SS "Boot parameters" +.sp +An initramfs generated without the "hostonly" mode, does not contain any system configuration files (except for some special exceptions), so the configuration has to be done on the kernel command line\&. With this flexibility, you can easily boot from a changed root partition, without the need to recompile the initramfs image\&. So, you could completely change your root partition (move it inside a md raid with encryption and LVM on top), as long as you specify the correct filesystem LABEL or UUID on the kernel command line for your root device, dracut will find it and boot from it\&. +.sp +The kernel command line can also be provided by the dhcp server with the root\-path option\&. See the section called \(lqNetwork Boot\(rq\&. +.sp +For a full reference of all kernel command line parameters, see \fBdracut\&.cmdline\fR(5)\&. +.sp +To get a quick start for the suitable kernel command line on your system, use the \fI\-\-print\-cmdline\fR option: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-print\-cmdline + root=UUID=8b8b6f91\-95c7\-4da2\-831b\-171e12179081 rootflags=rw,relatime,discard,data=ordered rootfstype=ext4 +.fi +.if n \{\ +.RE +.\} +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBSpecifying the root Device\fR +.RS 4 +.sp +This is the only option dracut really needs to boot from your root partition\&. Because your root partition can live in various environments, there are a lot of formats for the root= option\&. The most basic one is root=\fI\fR: +.sp +.if n \{\ +.RS 4 +.\} +.nf +root=/dev/sda2 +.fi +.if n \{\ +.RE +.\} +.sp +Because device node names can change, dependent on the drive ordering, you are encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) to specify your root partition: +.sp +.if n \{\ +.RS 4 +.\} +.nf +root=UUID=19e9dda3\-5a38\-484d\-a9b0\-fa6b067d0331 +.fi +.if n \{\ +.RE +.\} +.sp +or +.sp +.if n \{\ +.RS 4 +.\} +.nf +root=LABEL=myrootpartitionlabel +.fi +.if n \{\ +.RE +.\} +.sp +To see all UUIDs or LABELs on your system, do: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# ls \-l /dev/disk/by\-uuid +.fi +.if n \{\ +.RE +.\} +.sp +or +.sp +.if n \{\ +.RS 4 +.\} +.nf +# ls \-l /dev/disk/by\-label +.fi +.if n \{\ +.RE +.\} +.sp +If your root partition is on the network see the section called \(lqNetwork Boot\(rq\&. +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBKeyboard Settings\fR +.RS 4 +.sp +If you have to input passwords for encrypted disk volumes, you might want to set the keyboard layout and specify a display font\&. +.sp +A typical german kernel command line would contain: +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.vconsole\&.font=eurlatgr rd\&.vconsole\&.keymap=de\-latin1\-nodeadkeys rd\&.locale\&.LANG=de_DE\&.UTF\-8 +.fi +.if n \{\ +.RE +.\} +.sp +Setting these options can override the setting stored on your system, if you use a modern init system, like systemd\&. +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBBlacklisting Kernel Modules\fR +.RS 4 +.sp +Sometimes it is required to prevent the automatic kernel module loading of a specific kernel module\&. To do this, just add rd\&.blacklist=\fI\fR, with \fI\fR not containing the \fI\&.ko\fR suffix, to the kernel command line\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.driver\&.blacklist=mptsas rd\&.driver\&.blacklist=nouveau +.fi +.if n \{\ +.RE +.\} +.sp +The option can be specified multiple times on the kernel command line\&. +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBSpeeding up the Boot Process\fR +.RS 4 +.sp +If you want to speed up the boot process, you can specify as much information for dracut on the kernel command as possible\&. For example, you can tell dracut, that you root partition is not on a LVM volume or not on a raid partition, or that it lives inside a specific crypto LUKS encrypted volume\&. By default, dracut searches everywhere\&. A typical dracut kernel command line for a plain primary or logical partition would contain: +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.luks=0 rd\&.lvm=0 rd\&.md=0 rd\&.dm=0 +.fi +.if n \{\ +.RE +.\} +.sp +This turns off every automatic assembly of LVM, MD raids, DM raids and crypto LUKS\&. +.sp +Of course, you could also omit the dracut modules in the initramfs creation process, but then you would lose the possibility to turn it on on demand\&. +.RE +.SS "Injecting custom Files" +.sp +To add your own files to the initramfs image, you have several possibilities\&. +.sp +The \-\-include option let you specify a source path and a target path\&. For example +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-include cmdline\-preset /etc/cmdline\&.d/mycmdline\&.conf initramfs\-cmdline\-pre\&.img +.fi +.if n \{\ +.RE +.\} +.sp +will create an initramfs image, where the file cmdline\-preset will be copied inside the initramfs to \fI/etc/cmdline\&.d/mycmdline\&.conf\fR\&. \-\-include can only be specified once\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +# mkdir \-p rd\&.live\&.overlay/etc/cmdline\&.d +# mkdir \-p rd\&.live\&.overlay/etc/conf\&.d +# echo "ip=dhcp" >> rd\&.live\&.overlay/etc/cmdline\&.d/mycmdline\&.conf +# echo export FOO=testtest >> rd\&.live\&.overlay/etc/conf\&.d/testvar\&.conf +# echo export BAR=testtest >> rd\&.live\&.overlay/etc/conf\&.d/testvar\&.conf +# tree rd\&.live\&.overlay/ +rd\&.live\&.overlay/ +`\-\- etc + |\-\- cmdline\&.d + | `\-\- mycmdline\&.conf + `\-\- conf\&.d + `\-\- testvar\&.conf + +# dracut \-\-include rd\&.live\&.overlay / initramfs\-rd\&.live\&.overlay\&.img +.fi +.if n \{\ +.RE +.\} +.sp +This will put the contents of the rd\&.live\&.overlay directory into the root of the initramfs image\&. +.sp +The \-\-install option let you specify several files, which will get installed in the initramfs image at the same location, as they are present on initramfs creation time\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-install \*(Aqstrace fsck\&.ext3 ssh\*(Aq initramfs\-dbg\&.img +.fi +.if n \{\ +.RE +.\} +.sp +This will create an initramfs with the strace, fsck\&.ext3 and ssh executables, together with the libraries needed to start those\&. The \-\-install option can be specified multiple times\&. +.SS "Network Boot" +.sp +If your root partition is on a network drive, you have to have the network dracut modules installed to create a network aware initramfs image\&. +.sp +If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp server about the ip address for the machine\&. The dhcp server can also serve an additional root\-path, which will set the root device for dracut\&. With this mechanism, you have static configuration on your client machine and a centralized boot configuration on your TFTP/DHCP server\&. If you can\(cqt pass a kernel command line, then you can inject \fI/etc/cmdline\&.d/mycmdline\&.conf\fR, with a method described in the section called \(lqInjecting custom Files\(rq\&. +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBReducing the Image Size\fR +.RS 4 +.sp +To reduce the size of the initramfs, you should create it with by omitting all dracut modules, which you know, you don\(cqt need to boot the machine\&. +.sp +You can also specify the exact dracut and kernel modules to produce a very tiny initramfs image\&. +.sp +For example for a NFS image, you would do: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-m "nfs network base" initramfs\-nfs\-only\&.img +.fi +.if n \{\ +.RE +.\} +.sp +Then you would boot from this image with your target machine and reduce the size once more by creating it on the target machine with the \-\-host\-only option: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-m "nfs network base" \-\-host\-only initramfs\-nfs\-host\-only\&.img +.fi +.if n \{\ +.RE +.\} +.sp +This will reduce the size of the initramfs image significantly\&. +.RE +.SH "TROUBLESHOOTING" +.sp +If the boot process does not succeed, you have several options to debug the situation\&. Some of the basic operations are covered here\&. For more information you should also visit: \m[blue]\fBhttps://www\&.kernel\&.org/pub/linux/utils/boot/dracut/dracut\&.html\fR\m[] +.SS "Identifying your problem area" +.sp +.RS 4 +.ie n \{\ +\h'-04' 1.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 1." 4.2 +.\} +Remove +\fI\*(Aqrhgb\fR\*(Aq and +\fI\*(Aqquiet\fR\*(Aq from the kernel command line +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 2.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 2." 4.2 +.\} +Add +\fI\*(Aqrd\&.shell\fR\*(Aq to the kernel command line\&. This will present a shell should dracut be unable to locate your root device +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 3.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 3." 4.2 +.\} +Add +\fI\*(Aqrd\&.shell rd\&.debug log_buf_len=1M\fR\*(Aq to the kernel command line so that dracut shell commands are printed as they are executed +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 4.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 4." 4.2 +.\} +The file /run/initramfs/rdsosreport\&.txt is generated, which contains all the logs and the output of all significant tools, which are mentioned later\&. +.RE +.sp +If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that\&. Then you can store the output for later inspection\&. +.SS "Information to include in your report" +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBAll bug reports\fR +.RS 4 +.sp +In all cases, the following should be mentioned and attached to your bug report: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The exact kernel command\-line used\&. Typically from the bootloader configuration file (e\&.g\&. +\fI/boot/grub2/grub\&.cfg\fR) or from +\fI/proc/cmdline\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +A copy of your disk partition information from +\fI/etc/fstab\fR, which might be obtained booting an old working initramfs or a rescue medium\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Turn on dracut debugging (see +\fIthe \fR\fI\fIdebugging dracut\fR\fR\fI section\fR), and attach the file /run/initramfs/rdsosreport\&.txt\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If you use a dracut configuration file, please include +\fI/etc/dracut\&.conf\fR +and all files in +\fI/etc/dracut\&.conf\&.d/*\&.conf\fR +.RE +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNetwork root device related problems\fR +.RS 4 +.sp +This section details information to include when experiencing problems on a system whose root device is located on a network attached volume (e\&.g\&. iSCSI, NFS or NBD)\&. As well as the information from the section called \(lqAll bug reports\(rq, include the following information: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Please include the output of +.sp +.if n \{\ +.RS 4 +.\} +.nf +# /sbin/ifup +# ip addr show +.fi +.if n \{\ +.RE +.\} +.RE +.RE +.SS "Debugging dracut" +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBConfigure a serial console\fR +.RS 4 +.sp +Successfully debugging dracut will require some form of console logging during the system boot\&. This section documents configuring a serial console connection to record boot messages\&. +.sp +.RS 4 +.ie n \{\ +\h'-04' 1.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 1." 4.2 +.\} +First, enable serial console output for both the kernel and the bootloader\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 2.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 2." 4.2 +.\} +Open the file +\fI/boot/grub2/grub\&.cfg\fR +for editing\&. Below the line +\fI\*(Aqtimeout=5\fR\*(Aq, add the following: +.sp +.if n \{\ +.RS 4 +.\} +.nf +serial \-\-unit=0 \-\-speed=9600 +terminal \-\-timeout=5 serial console +.fi +.if n \{\ +.RE +.\} +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 3.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 3." 4.2 +.\} +Also in +\fI/boot/grub2/grub\&.cfg\fR, add the following boot arguments to the +\fI\*(Aqkernel\fR\*(Aq line: +.sp +.if n \{\ +.RS 4 +.\} +.nf +console=tty0 console=ttyS0,9600 +.fi +.if n \{\ +.RE +.\} +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 4.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 4." 4.2 +.\} +When finished, the +\fI/boot/grub2/grub\&.cfg\fR +file should look similar to the example below\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +default=0 +timeout=5 +serial \-\-unit=0 \-\-speed=9600 +terminal \-\-timeout=5 serial console +title Fedora (2\&.6\&.29\&.5\-191\&.fc11\&.x86_64) + root (hd0,0) + kernel /vmlinuz\-2\&.6\&.29\&.5\-191\&.fc11\&.x86_64 ro root=/dev/mapper/vg_uc1\-lv_root console=tty0 console=ttyS0,9600 + initrd /dracut\-2\&.6\&.29\&.5\-191\&.fc11\&.x86_64\&.img +.fi +.if n \{\ +.RE +.\} +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 5.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 5." 4.2 +.\} +More detailed information on how to configure the kernel for console output can be found at +\m[blue]\fBhttp://www\&.faqs\&.org/docs/Linux\-HOWTO/Remote\-Serial\-Console\-HOWTO\&.html#CONFIGURE\-KERNEL\fR\m[]\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 6.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 6." 4.2 +.\} +Redirecting non\-interactive output +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +You can redirect all non\-interactive output to +\fI/dev/kmsg\fR +and the kernel will put it out on the console when it reaches the kernel buffer by doing +.sp .5v +.RE +.sp +.if n \{\ +.RS 4 +.\} +.nf +# exec >/dev/kmsg 2>&1
/run/initramfs/etc/cmdline\&.d/debug\&.conf +# touch /run/initramfs/\&.need_shutdown +.fi +.if n \{\ +.RE +.\} +.sp +This will give you a dracut shell after the system pivot\(cqed back in the initramfs\&. +.RE +.SH "OPTIONS" +.PP +\fB\-\-kver\fR \fI\fR +.RS 4 +set the kernel version\&. This enables to specify the kernel version, without specifying the location of the initramfs image\&. For example: +.RE +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-kver 3\&.5\&.0\-0\&.rc7\&.git1\&.2\&.fc18\&.x86_64 +.fi +.if n \{\ +.RE +.\} +.PP +\fB\-f, \-\-force\fR +.RS 4 +overwrite existing initramfs file\&. +.RE +.PP +\fB\-a, \-\-add\fR\ \&\fI\fR +.RS 4 +add a space\-separated list of dracut modules to the default set of modules\&. This parameter can be specified multiple times\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-add "module1 module2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-\-force\-add\fR\ \&\fI\fR +.RS 4 +force to add a space\-separated list of dracut modules to the default set of modules, when \-H is specified\&. This parameter can be specified multiple times\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-force\-add "module1 module2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-o, \-\-omit\fR\ \&\fI\fR +.RS 4 +omit a space\-separated list of dracut modules\&. This parameter can be specified multiple times\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-omit "module1 module2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-m, \-\-modules\fR \fI\fR +.RS 4 +specify a space\-separated list of dracut modules to call when building the initramfs\&. Modules are located in +\fI/usr/lib/dracut/modules\&.d\fR\&. This parameter can be specified multiple times\&. This option forces dracut to only include the specified dracut modules\&. In most cases the "\-\-add" option is what you want to use\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-modules "module1 module2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-d, \-\-drivers\fR\ \&\fI\fR +.RS 4 +specify a space\-separated list of kernel modules to exclusively include in the initramfs\&. The kernel modules have to be specified without the "\&.ko" suffix\&. This parameter can be specified multiple times\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-drivers "kmodule1 kmodule2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-\-add\-drivers\fR\ \&\fI\fR +.RS 4 +specify a space\-separated list of kernel modules to add to the initramfs\&. The kernel modules have to be specified without the "\&.ko" suffix\&. This parameter can be specified multiple times\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-add\-drivers "kmodule1 kmodule2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-\-force\-drivers\fR \fI\fR +.RS 4 +See add\-drivers above\&. But in this case it is ensured that the drivers are tried to be loaded early via modprobe\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-force\-drivers "kmodule1 kmodule2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-\-omit\-drivers\fR\ \&\fI\fR +.RS 4 +specify a space\-separated list of kernel modules not to add to the initramfs\&. The kernel modules have to be specified without the "\&.ko" suffix\&. This parameter can be specified multiple times\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-omit\-drivers "kmodule1 kmodule2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-\-filesystems\fR\ \&\fI\fR +.RS 4 +specify a space\-separated list of kernel filesystem modules to exclusively include in the generic initramfs\&. This parameter can be specified multiple times\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-filesystems "filesystem1 filesystem2" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-k, \-\-kmoddir\fR\ \&\fI\fR +.RS 4 +specify the directory, where to look for kernel modules +.RE +.PP +\fB\-\-fwdir\fR\ \&\fI[:\&...]++\fR +.RS 4 +specify additional directories, where to look for firmwares\&. This parameter can be specified multiple times\&. +.RE +.PP +\fB\-\-kernel\-cmdline \fR +.RS 4 +specify default kernel command line parameters +.RE +.PP +\fB\-\-kernel\-only\fR +.RS 4 +only install kernel drivers and firmware files +.RE +.PP +\fB\-\-no\-kernel\fR +.RS 4 +do not install kernel drivers and firmware files +.RE +.PP +\fB\-\-early\-microcode\fR +.RS 4 +Combine early microcode with ramdisk +.RE +.PP +\fB\-\-no\-early\-microcode\fR +.RS 4 +Do not combine early microcode with ramdisk +.RE +.PP +\fB\-\-print\-cmdline\fR +.RS 4 +print the kernel command line for the current disk layout +.RE +.PP +\fB\-\-mdadmconf\fR +.RS 4 +include local +\fI/etc/mdadm\&.conf\fR +.RE +.PP +\fB\-\-nomdadmconf\fR +.RS 4 +do not include local +\fI/etc/mdadm\&.conf\fR +.RE +.PP +\fB\-\-lvmconf\fR +.RS 4 +include local +\fI/etc/lvm/lvm\&.conf\fR +.RE +.PP +\fB\-\-nolvmconf\fR +.RS 4 +do not include local +\fI/etc/lvm/lvm\&.conf\fR +.RE +.PP +\fB\-\-fscks\fR [LIST] +.RS 4 +add a space\-separated list of fsck tools, in addition to +\fIdracut\&.conf\fR\*(Aqs specification; the installation is opportunistic (non\-existing tools are ignored) +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-fscks "fsck\&.foo barfsck" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-\-nofscks\fR +.RS 4 +inhibit installation of any fsck tools +.RE +.PP +\fB\-\-strip\fR +.RS 4 +strip binaries in the initramfs (default) +.RE +.PP +\fB\-\-nostrip\fR +.RS 4 +do not strip binaries in the initramfs +.RE +.PP +\fB\-\-hardlink\fR +.RS 4 +hardlink files in the initramfs (default) +.RE +.PP +\fB\-\-nohardlink\fR +.RS 4 +do not hardlink files in the initramfs +.RE +.PP +\fB\-\-prefix\fR\ \&\fI\fR +.RS 4 +prefix initramfs files with the specified directory +.RE +.PP +\fB\-\-noprefix\fR +.RS 4 +do not prefix initramfs files (default) +.RE +.PP +\fB\-h, \-\-help\fR +.RS 4 +display help text and exit\&. +.RE +.PP +\fB\-\-debug\fR +.RS 4 +output debug information of the build process +.RE +.PP +\fB\-v, \-\-verbose\fR +.RS 4 +increase verbosity level (default is info(4)) +.RE +.PP +\fB\-\-version\fR +.RS 4 +display version and exit +.RE +.PP +\fB\-q, \-\-quiet\fR +.RS 4 +decrease verbosity level (default is info(4)) +.RE +.PP +\fB\-c, \-\-conf\fR\ \&\fI\fR +.RS 4 +specify configuration file to use\&. +.sp +Default: +\fI/etc/dracut\&.conf\fR +.RE +.PP +\fB\-\-confdir\fR\ \&\fI\fR +.RS 4 +specify configuration directory to use\&. +.sp +Default: +\fI/etc/dracut\&.conf\&.d\fR +.RE +.PP +\fB\-\-tmpdir\fR\ \&\fI\fR +.RS 4 +specify temporary directory to use\&. +.sp +Default: +\fI/var/tmp\fR +.RE +.PP +\fB\-r, \-\-sysroot\fR \fI\fR +.RS 4 +specify the sysroot directory to collect files from\&. This is useful to create the initramfs image from a cross\-compiled sysroot directory\&. For the extra helper variables, see +\fBENVIRONMENT\fR +below\&. +.sp +Default: +\fIempty\fR +.RE +.PP +\fB\-\-sshkey\fR\ \&\fI\fR +.RS 4 +ssh key file used with ssh\-client module\&. +.RE +.PP +\fB\-\-logfile\fR\ \&\fI\fR +.RS 4 +logfile to use; overrides any setting from the configuration files\&. +.sp +Default: +\fI/var/log/dracut\&.log\fR +.RE +.PP +\fB\-l, \-\-local\fR +.RS 4 +activates the local mode\&. dracut will use modules from the current working directory instead of the system\-wide installed modules in +\fI/usr/lib/dracut/modules\&.d\fR\&. This is useful when running dracut from a git checkout\&. +.RE +.PP +\fB\-H, \-\-hostonly\fR +.RS 4 +Host\-Only mode: Install only what is needed for booting the local host instead of a generic host and generate host\-specific configuration\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +If chrooted to another root other than the real root device, use "\-\-fstab" and provide a valid +\fI/etc/fstab\fR\&. +.sp .5v +.RE +.RE +.PP +\fB\-N, \-\-no\-hostonly\fR +.RS 4 +Disable Host\-Only mode +.RE +.sp +\fB\-\-hostonly\-cmdline\fR: Store kernel command line arguments needed in the initramfs +.sp +\fB\-\-no\-hostonly\-cmdline\fR: Do not store kernel command line arguments needed in the initramfs +.sp +\fB\-\-no\-hostonly\-default\-device\fR: Do not generate implicit host devices like root, swap, fstab, etc\&. Use "\-\-mount" or "\-\-add\-device" to explicitly add devices as needed\&. +.sp +\fB\-\-hostonly\-i18n\fR: Install only needed keyboard and font files according to the host configuration (default)\&. +.sp +\fB\-\-no\-hostonly\-i18n\fR: Install all keyboard and font files available\&. +.PP +\fB\-\-persistent\-policy\fR \fI\fR +.RS 4 +Use +\fI\fR +to address disks and partitions\&. +\fI\fR +can be any directory name found in /dev/disk\&. E\&.g\&. "by\-uuid", "by\-label" +.RE +.PP +\fB\-\-fstab\fR +.RS 4 +Use +\fI/etc/fstab\fR +instead of +\fI/proc/self/mountinfo\fR\&. +.RE +.PP +\fB\-\-add\-fstab\fR \fI\fR +.RS 4 +Add entries of +\fI\fR +to the initramfs /etc/fstab\&. +.RE +.PP +\fB\-\-mount\fR\ \&"\fI\fR \fI\fR \fI\fR [\fI\fR [\fI\fR [\fI\fR]]]" +.RS 4 +Mount +\fI\fR +on +\fI\fR +with +\fI\fR +in the initramfs\&. +\fI\fR, +\fI\fR +and +\fI\fR +can be specified, see fstab manpage for the details\&. The default +\fI\fR +is "defaults"\&. The default +\fI\fR +is "0"\&. the default +\fI\fR +is "2"\&. +.RE +.PP +\fB\-\-mount\fR "\fI\fR" +.RS 4 +Like above, but +\fI\fR, +\fI\fR +and +\fI\fR +are determined by looking at the current mounts\&. +.RE +.PP +\fB\-\-add\-device\fR \fI\fR +.RS 4 +Bring up +\fI\fR +in initramfs, +\fI\fR +should be the device name\&. This can be useful in hostonly mode for resume support when your swap is on LVM or an encrypted partition\&. [NB \-\-device can be used for compatibility with earlier releases] +.RE +.PP +\fB\-i, \-\-include\fR \fI\fR \fI\fR +.RS 4 +include the files in the SOURCE directory into the TARGET directory in the final initramfs\&. If SOURCE is a file, it will be installed to TARGET in the final initramfs\&. This parameter can be specified multiple times\&. +.RE +.PP +\fB\-I, \-\-install\fR \fI\fR +.RS 4 +install the space separated list of files into the initramfs\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +If [LIST] has multiple arguments, then you have to put these in quotes\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# dracut \-\-install "/bin/foo /sbin/bar" \&.\&.\&. +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE +.RE +.PP +\fB\-\-install\-optional\fR \fI\fR +.RS 4 +install the space separated list of files into the initramfs, if they exist\&. +.RE +.PP +\fB\-\-gzip\fR +.RS 4 +Compress the generated initramfs using gzip\&. This will be done by default, unless another compression option or \-\-no\-compress is passed\&. Equivalent to "\-\-compress=gzip \-9" +.RE +.PP +\fB\-\-bzip2\fR +.RS 4 +Compress the generated initramfs using bzip2\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +Make sure your kernel has bzip2 decompression support compiled in, otherwise you will not be able to boot\&. Equivalent to "\-\-compress=bzip2" +.sp .5v +.RE +.RE +.PP +\fB\-\-lzma\fR +.RS 4 +Compress the generated initramfs using lzma\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +Make sure your kernel has lzma decompression support compiled in, otherwise you will not be able to boot\&. Equivalent to "lzma \-\-compress=lzma \-9" +.sp .5v +.RE +.RE +.PP +\fB\-\-xz\fR +.RS 4 +Compress the generated initramfs using xz\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +Make sure your kernel has xz decompression support compiled in, otherwise you will not be able to boot\&. Equivalent to "lzma \-\-compress=xz \-\-check=crc32 \-\-lzma2=dict=1MiB" +.sp .5v +.RE +.RE +.PP +\fB\-\-lzo\fR +.RS 4 +Compress the generated initramfs using lzop\&. +.RE +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +.sp +Make sure your kernel has lzo decompression support compiled in, otherwise you will not be able to boot\&. +.sp .5v +.RE +.PP +\fB\-\-lz4\fR +.RS 4 +Compress the generated initramfs using lz4\&. +.RE +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +.sp +Make sure your kernel has lz4 decompression support compiled in, otherwise you will not be able to boot\&. +.sp .5v +.RE +.PP +\fB\-\-zstd\fR +.RS 4 +Compress the generated initramfs using Zstandard\&. +.RE +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +.sp +Make sure your kernel has zstd decompression support compiled in, otherwise you will not be able to boot\&. +.sp .5v +.RE +.PP +\fB\-\-compress\fR\ \&\fI\fR +.RS 4 +Compress the generated initramfs using the passed compression program\&. If you pass it just the name of a compression program, it will call that program with known\-working arguments\&. If you pass a quoted string with arguments, it will be called with exactly those arguments\&. Depending on what you pass, this may result in an initramfs that the kernel cannot decompress\&. The default value can also be set via the +\fIINITRD_COMPRESS\fR +environment variable\&. +.RE +.PP +\fB\-\-no\-compress\fR +.RS 4 +Do not compress the generated initramfs\&. This will override any other compression options\&. +.RE +.PP +\fB\-\-reproducible\fR +.RS 4 +Create reproducible images\&. +.RE +.PP +\fB\-\-no\-reproducible\fR +.RS 4 +Do not create reproducible images\&. +.RE +.PP +\fB\-\-list\-modules\fR +.RS 4 +List all available dracut modules\&. +.RE +.PP +\fB\-M, \-\-show\-modules\fR +.RS 4 +Print included module\(cqs name to standard output during build\&. +.RE +.PP +\fB\-\-keep\fR +.RS 4 +Keep the initramfs temporary directory for debugging purposes\&. +.RE +.PP +\fB\-\-printsize\fR +.RS 4 +Print out the module install size +.RE +.sp +\fB\-\-profile\fR: Output profile information of the build process +.sp +\fB\-\-ro\-mnt\fR: Mount / and /usr read\-only by default\&. +.PP +\fB\-L, \-\-stdlog\fR\ \&\fI\fR +.RS 4 +[0\-6] Specify logging level (to standard error) +.RE +.sp +.if n \{\ +.RS 4 +.\} +.nf + 0 \- suppress any messages + 1 \- only fatal errors + 2 \- all errors + 3 \- warnings + 4 \- info + 5 \- debug info (here starts lots of output) + 6 \- trace info (and even more) +.fi +.if n \{\ +.RE +.\} +.PP +\fB\-\-regenerate\-all\fR +.RS 4 +Regenerate all initramfs images at the default location with the kernel versions found on the system\&. Additional parameters are passed through\&. +.RE +.PP +\fB\-\-loginstall \fR\fB\fI\fR\fR +.RS 4 +Log all files installed from the host to +\fI\fR\&. +.RE +.PP +\fB\-\-uefi\fR +.RS 4 +Instead of creating an initramfs image, dracut will create an UEFI executable, which can be executed by an UEFI BIOS\&. The default output filename is +\fI/EFI/Linux/linux\-$kernel$\-\-\&.efi\fR\&. might be +\fI/efi\fR, +\fI/boot\fR +or +\fI/boot/efi\fR +depending on where the ESP partition is mounted\&. The is taken from BUILD_ID in +\fI/usr/lib/os\-release\fR +or if it exists +\fI/etc/os\-release\fR +and is left out, if BUILD_ID is non\-existant or empty\&. +.RE +.PP +\fB\-\-no\-uefi\fR +.RS 4 +Disables UEFI mode\&. +.RE +.PP +\fB\-\-no\-machineid\fR +.RS 4 +affects the default output filename of +\fB\-\-uefi\fR +and will discard the part\&. +.RE +.PP +\fB\-\-uefi\-stub \fR\fB\fI\fR\fR +.RS 4 +Specifies the UEFI stub loader, which will load the attached kernel, initramfs and kernel command line and boots the kernel\&. The default is +\fI$prefix/lib/systemd/boot/efi/linux\&.efi\&.stub\fR +.RE +.PP +\fB\-\-uefi\-splash\-image \fR\fB\fI\fR\fR +.RS 4 +Specifies the UEFI stub loader\(cqs splash image\&. Requires bitmap (\fB\&.bmp\fR) image format\&. +.RE +.PP +\fB\-\-kernel\-image \fR\fB\fI\fR\fR +.RS 4 +Specifies the kernel image, which to include in the UEFI executable\&. The default is +\fI/lib/modules//vmlinuz\fR +or +\fI/boot/vmlinuz\-\fR +.RE +.SH "ENVIRONMENT" +.PP +\fIINITRD_COMPRESS\fR +.RS 4 +sets the default compression program\&. See +\fB\-\-compress\fR\&. +.RE +.PP +\fIDRACUT_LDCONFIG\fR +.RS 4 +sets the +\fIldconfig\fR +program path and options\&. Optional\&. Used for +\fB\-\-sysroot\fR\&. +.sp +Default: +\fIldconfig\fR +.RE +.PP +\fIDRACUT_LDD\fR +.RS 4 +sets the +\fIldd\fR +program path and options\&. Optional\&. Used for +\fB\-\-sysroot\fR\&. +.sp +Default: +\fIldd\fR +.RE +.PP +\fIDRACUT_TESTBIN\fR +.RS 4 +sets the initially tested binary for detecting library paths\&. Optional\&. Used for +\fB\-\-sysroot\fR\&. In the cross\-compiled sysroot, the default value (\fI/bin/sh\fR) is unusable, as it is an absolute symlink and points outside the sysroot directory\&. +.sp +Default: +\fI/bin/sh\fR +.RE +.PP +\fIDRACUT_INSTALL\fR +.RS 4 +overrides path and options for executing +\fIdracut\-install\fR +internally\&. Optional\&. Can be used to debug +\fIdracut\-install\fR +while running the main dracut script\&. +.sp +Default: +\fIdracut\-install\fR +.sp +Example: DRACUT_INSTALL="valgrind dracut\-install" +.RE +.PP +\fIDRACUT_COMPRESS_BZIP2\fR, \fIDRACUT_COMPRESS_BZIP2\fR, \fIDRACUT_COMPRESS_LBZIP2\fR, \fIDRACUT_COMPRESS_LZMA\fR, \fIDRACUT_COMPRESS_XZ\fR, \fIDRACUT_COMPRESS_GZIP\fR, \fIDRACUT_COMPRESS_PIGZ\fR, \fIDRACUT_COMPRESS_LZOP\fR, \fIDRACUT_COMPRESS_ZSTD\fR, \fIDRACUT_COMPRESS_LZ4\fR, \fIDRACUT_COMPRESS_CAT\fR +.RS 4 +overrides for compression utilities to support using them from non\-standard paths\&. +.sp +Default values are the default compression utility names to be found in +\fBPATH\fR\&. +.RE +.PP +\fIDRACUT_ARCH\fR +.RS 4 +overrides the value of +\fBuname \-m\fR\&. Used for +\fB\-\-sysroot\fR\&. +.sp +Default: +\fIempty\fR +(the value of +\fBuname \-m\fR +on the host system) +.RE +.PP +\fISYSTEMD_VERSION\fR +.RS 4 +overrides systemd version\&. Used for +\fB\-\-sysroot\fR\&. +.RE +.PP +\fISYSTEMCTL\fR +.RS 4 +overrides the systemctl binary\&. Used for +\fB\-\-sysroot\fR\&. +.RE +.PP +\fINM_VERSION\fR +.RS 4 +overrides the NetworkManager version\&. Used for +\fB\-\-sysroot\fR\&. +.RE +.PP +\fIDRACUT_INSTALL_PATH\fR +.RS 4 +overrides +\fBPATH\fR +environment for +\fBdracut\-install\fR +to look for binaries relative to +\fB\-\-sysroot\fR\&. In a cross\-compiled environment (e\&.g\&. Yocto), PATH points to natively built binaries that are not in the host\(cqs /bin, /usr/bin, etc\&. +\fBdracut\-install\fR +still needs plain /bin and /usr/bin that are relative to the cross\-compiled sysroot\&. +.sp +Default: +\fIPATH\fR +.RE +.PP +\fIDRACUT_INSTALL_LOG_TARGET\fR +.RS 4 +overrides +\fBDRACUT_LOG_TARGET\fR +for +\fBdracut\-install\fR\&. It allows running +\fBdracut\-install* to run with different log target that \fRdracut** runs with\&. +.sp +Default: +\fIDRACUT_LOG_TARGET\fR +.RE +.PP +\fIDRACUT_INSTALL_LOG_LEVEL\fR +.RS 4 +overrides +\fBDRACUT_LOG_LEVEL\fR +for +\fBdracut\-install\fR\&. It allows running +\fBdracut\-install* to run with different log level that \fRdracut** runs with\&. +.sp +Default: +\fIDRACUT_LOG_LEVEL\fR +.RE +.SH "FILES" +.PP +\fI/var/log/dracut\&.log\fR +.RS 4 +logfile of initramfs image creation +.RE +.PP +\fI/tmp/dracut\&.log\fR +.RS 4 +logfile of initramfs image creation, if +\fI/var/log/dracut\&.log\fR +is not writable +.RE +.PP +\fI/etc/dracut\&.conf\fR +.RS 4 +see dracut\&.conf5 +.RE +.PP +\fI/etc/dracut\&.conf\&.d/*\&.conf\fR +.RS 4 +see dracut\&.conf5 +.RE +.PP +\fI/usr/lib/dracut/dracut\&.conf\&.d/*\&.conf\fR +.RS 4 +see dracut\&.conf5 +.RE +.SS "Configuration in the initramfs" +.PP +\fI/etc/conf\&.d/\fR +.RS 4 +Any files found in +\fI/etc/conf\&.d/\fR +will be sourced in the initramfs to set initial values\&. Command line options will override these values set in the configuration files\&. +.RE +.PP +\fI/etc/cmdline\fR +.RS 4 +Can contain additional command line options\&. Deprecated, better use /etc/cmdline\&.d/*\&.conf\&. +.RE +.PP +\fI/etc/cmdline\&.d/*\&.conf\fR +.RS 4 +Can contain additional command line options\&. +.RE +.SH "AVAILABILITY" +.sp +The dracut command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[] +.SH "AUTHORS" +.sp +Harald Hoyer +.sp +Victor Lowther +.sp +Amadeusz Żołnowski +.sp +Hannes Reinecke +.sp +Daniel Molkentin +.sp +Will Woods +.sp +Philippe Seewer +.sp +Warren Togami +.SH "SEE ALSO" +.sp +\fBdracut\&.cmdline\fR(7) \fBdracut\&.conf\fR(5) \fBlsinitrd\fR(1) diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.8.asc b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.8.asc new file mode 100644 index 0000000..515e32d --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.8.asc @@ -0,0 +1,687 @@ +DRACUT(8) +========= +:doctype: manpage +:man source: dracut +:man manual: dracut +:man version: {version} + +NAME +---- +dracut - low-level tool for generating an initramfs/initrd image + +SYNOPSIS +-------- +*dracut* [__OPTION...__] [____ [____]] + +DESCRIPTION +----------- + +Create an initramfs for the kernel with the version . +If is omitted, then the version of the actual running +kernel is used. If is omitted or empty, then the default location +/boot/initramfs-.img is used. + +dracut creates an initial image used by the kernel for preloading the block +device modules (such as IDE, SCSI or RAID) which are needed to access the root +filesystem, mounting the root filesystem and booting into the real system. + +At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it +as initial root file system. All finding of the root device happens in this +early userspace. + +Initramfs images are also called "initrd". + +For a complete list of kernel command line options see *dracut.cmdline*(7). + +If you are dropped to an emergency shell, while booting your initramfs, +the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a +(to be mounted by hand) partition (usually /boot) or a USB stick. +Additional debugging info can be produced by adding **rd.debug** to the kernel +command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output +of some tools. It should be attached to any report about dracut problems. + +USAGE +----- + +include::dracut.usage.asc[] + +OPTIONS +------- +**--kver** __:: + set the kernel version. This enables to specify the kernel version, without + specifying the location of the initramfs image. For example: +---- +# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64 +---- + +**-f, --force**:: + overwrite existing initramfs file. + +**-a, --add** __:: + add a space-separated list of dracut modules to the default set of modules. + This parameter can be specified multiple times. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --add "module1 module2" ... +---- +=============================== + +**--force-add** __:: + force to add a space-separated list of dracut modules to the default set of + modules, when -H is specified. This parameter can be specified multiple + times. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --force-add "module1 module2" ... +---- +=============================== + +**-o, --omit** __:: + omit a space-separated list of dracut modules. This parameter can be + specified multiple times. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --omit "module1 module2" ... +---- +=============================== + +**-m, --modules** __:: + specify a space-separated list of dracut modules to call when building the + initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This + parameter can be specified multiple times. + This option forces dracut to only include the specified dracut modules. + In most cases the "--add" option is what you want to use. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --modules "module1 module2" ... +---- +=============================== + +**-d, --drivers** __:: + specify a space-separated list of kernel modules to exclusively include + in the initramfs. The kernel modules have to be specified without the ".ko" + suffix. This parameter can be specified multiple times. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --drivers "kmodule1 kmodule2" ... +---- +=============================== + +**--add-drivers** __:: + specify a space-separated list of kernel modules to add to the initramfs. + The kernel modules have to be specified without the ".ko" suffix. This + parameter can be specified multiple times. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --add-drivers "kmodule1 kmodule2" ... +---- +=============================== + +**--force-drivers** __:: + See add-drivers above. But in this case it is ensured that the drivers + are tried to be loaded early via modprobe. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --force-drivers "kmodule1 kmodule2" ... +---- +=============================== + +**--omit-drivers** __:: + specify a space-separated list of kernel modules not to add to the + initramfs. + The kernel modules have to be specified without the ".ko" suffix. This + parameter can be specified multiple times. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --omit-drivers "kmodule1 kmodule2" ... +---- +=============================== + +**--filesystems** __:: + specify a space-separated list of kernel filesystem modules to exclusively + include in the generic initramfs. This parameter can be specified multiple + times. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --filesystems "filesystem1 filesystem2" ... +---- +=============================== + +**-k, --kmoddir** __:: + specify the directory, where to look for kernel modules + +**--fwdir** _[:...]++_:: + specify additional directories, where to look for firmwares. This parameter + can be specified multiple times. + +**--kernel-cmdline **:: + specify default kernel command line parameters + + +**--kernel-only**:: + only install kernel drivers and firmware files + +**--no-kernel**:: + do not install kernel drivers and firmware files + +**--early-microcode**:: + Combine early microcode with ramdisk + +**--no-early-microcode**:: + Do not combine early microcode with ramdisk + +**--print-cmdline**:: + print the kernel command line for the current disk layout + +**--mdadmconf**:: + include local _/etc/mdadm.conf_ + +**--nomdadmconf**:: + do not include local _/etc/mdadm.conf_ + +**--lvmconf**:: + include local _/etc/lvm/lvm.conf_ + +**--nolvmconf**:: + do not include local _/etc/lvm/lvm.conf_ + +**--fscks** [LIST]:: + add a space-separated list of fsck tools, in addition to _dracut.conf_'s + specification; the installation is opportunistic (non-existing tools are + ignored) ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --fscks "fsck.foo barfsck" ... +---- +=============================== + +**--nofscks**:: + inhibit installation of any fsck tools + +**--strip**:: + strip binaries in the initramfs (default) + +**--nostrip**:: + do not strip binaries in the initramfs + +**--hardlink**:: + hardlink files in the initramfs (default) + +**--nohardlink**:: + do not hardlink files in the initramfs + +**--prefix** __:: + prefix initramfs files with the specified directory + +**--noprefix**:: + do not prefix initramfs files (default) + +**-h, --help**:: + display help text and exit. + +**--debug**:: + output debug information of the build process + +**-v, --verbose**:: + increase verbosity level (default is info(4)) + +**--version**:: + display version and exit + +**-q, --quiet**:: decrease verbosity level (default is info(4)) + +**-c, --conf** __:: + specify configuration file to use. ++ +Default: + _/etc/dracut.conf_ + +**--confdir** __:: + specify configuration directory to use. ++ +Default: + _/etc/dracut.conf.d_ + +**--tmpdir** __:: + specify temporary directory to use. ++ +Default: + _/var/tmp_ + +**-r, --sysroot** __:: + specify the sysroot directory to collect files from. + This is useful to create the initramfs image from + a cross-compiled sysroot directory. For the extra helper + variables, see *ENVIRONMENT* below. ++ +Default: + _empty_ + +**--sshkey** __:: ssh key file used with ssh-client module. + +**--logfile** __:: logfile to use; overrides any setting from + the configuration files. ++ +Default: + _/var/log/dracut.log_ + +**-l, --local**:: + activates the local mode. dracut will use modules from the current working + directory instead of the system-wide installed modules in + _/usr/lib/dracut/modules.d_. + This is useful when running dracut from a git checkout. + +**-H, --hostonly**:: + Host-Only mode: Install only what is needed for booting the local host + instead of a generic host and generate host-specific configuration. ++ +[WARNING] +==== +If chrooted to another root other than the real root device, use "--fstab" and +provide a valid _/etc/fstab_. +==== + +**-N, --no-hostonly**:: + Disable Host-Only mode + +**--hostonly-cmdline**: + Store kernel command line arguments needed in the initramfs + +**--no-hostonly-cmdline**: + Do not store kernel command line arguments needed in the initramfs + +**--no-hostonly-default-device**: + Do not generate implicit host devices like root, swap, fstab, etc. + Use "--mount" or "--add-device" to explicitly add devices as needed. + +**--hostonly-i18n**: + Install only needed keyboard and font files according to the host configuration (default). + +**--no-hostonly-i18n**: + Install all keyboard and font files available. + +**--persistent-policy** __:: + Use __ to address disks and partitions. + __ can be any directory name found in /dev/disk. + E.g. "by-uuid", "by-label" + +**--fstab**:: + Use _/etc/fstab_ instead of _/proc/self/mountinfo_. + +**--add-fstab** __:: + Add entries of __ to the initramfs /etc/fstab. + +**--mount** "__ __ __ [__ [__ [__]]]":: + Mount __ on __ with __ in the + initramfs. __, __ and __ can + be specified, see fstab manpage for the details. + The default __ is "defaults". + The default __ is "0". + the default __ is "2". + +**--mount** "__":: + Like above, but __, __ and __ + are determined by looking at the current mounts. + +**--add-device** __ :: + Bring up __ in initramfs, __ should be the device name. + This can be useful in hostonly mode for resume support when your swap is on + LVM or an encrypted partition. + [NB --device can be used for compatibility with earlier releases] + +**-i, --include** __ __:: + include the files in the SOURCE directory into the + TARGET directory in the final initramfs. If SOURCE is a file, it will be + installed to TARGET in the final initramfs. This parameter can be specified + multiple times. + +**-I, --install** __:: + install the space separated list of files into the initramfs. ++ +[NOTE] +=============================== +If [LIST] has multiple arguments, then you have to put these in quotes. For +example: +---- +# dracut --install "/bin/foo /sbin/bar" ... +---- +=============================== + +**--install-optional** __:: + install the space separated list of files into the initramfs, if they exist. + +**--gzip**:: + Compress the generated initramfs using gzip. This will be done by default, + unless another compression option or --no-compress is passed. Equivalent to + "--compress=gzip -9" + +**--bzip2**:: + Compress the generated initramfs using bzip2. ++ +[WARNING] +==== +Make sure your kernel has bzip2 decompression support compiled in, otherwise you +will not be able to boot. Equivalent to "--compress=bzip2" +==== + +**--lzma**:: + Compress the generated initramfs using lzma. ++ +[WARNING] +==== +Make sure your kernel has lzma decompression support compiled in, otherwise you +will not be able to boot. Equivalent to "lzma --compress=lzma -9" +==== + +**--xz**:: + Compress the generated initramfs using xz. ++ +[WARNING] +==== +Make sure your kernel has xz decompression support compiled in, otherwise you +will not be able to boot. Equivalent to +"lzma --compress=xz --check=crc32 --lzma2=dict=1MiB" +==== + +**--lzo**:: + Compress the generated initramfs using lzop. +[WARNING] +==== +Make sure your kernel has lzo decompression support compiled in, otherwise you +will not be able to boot. +==== + +**--lz4**:: + Compress the generated initramfs using lz4. +[WARNING] +==== +Make sure your kernel has lz4 decompression support compiled in, otherwise you +will not be able to boot. +==== + +**--zstd**:: + Compress the generated initramfs using Zstandard. +[WARNING] +==== +Make sure your kernel has zstd decompression support compiled in, otherwise you +will not be able to boot. +==== + +**--compress** __:: + Compress the generated initramfs using the passed compression program. If + you pass it just the name of a compression program, it will call that + program with known-working arguments. If you pass a quoted string with + arguments, it will be called with exactly those arguments. Depending on what + you pass, this may result in an initramfs that the kernel cannot decompress. + The default value can also be set via the _INITRD_COMPRESS_ environment variable. + +**--no-compress**:: + Do not compress the generated initramfs. This will override any other + compression options. + +**--reproducible**:: + Create reproducible images. + +**--no-reproducible**:: + Do not create reproducible images. + +**--list-modules**:: + List all available dracut modules. + +**-M, --show-modules**:: + Print included module's name to standard output during build. + +**--keep**:: + Keep the initramfs temporary directory for debugging purposes. + +**--printsize**:: + Print out the module install size + +**--profile**: + Output profile information of the build process + +**--ro-mnt**: + Mount / and /usr read-only by default. + +**-L, --stdlog** __:: + [0-6] Specify logging level (to standard error) +---- + 0 - suppress any messages + 1 - only fatal errors + 2 - all errors + 3 - warnings + 4 - info + 5 - debug info (here starts lots of output) + 6 - trace info (and even more) +---- + +**--regenerate-all**:: + Regenerate all initramfs images at the default location with the kernel + versions found on the system. Additional parameters are passed through. + +**--loginstall __**:: + Log all files installed from the host to __. + +**--uefi**:: + Instead of creating an initramfs image, dracut will create an UEFI executable, + which can be executed by an UEFI BIOS. The default output filename is + _/EFI/Linux/linux-$kernel$--.efi_. might be + _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP partition is mounted. + The is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists + _/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty. + +**--no-uefi**:: + Disables UEFI mode. + +**--no-machineid**:: + affects the default output filename of **--uefi** and will discard the + part. + +**--uefi-stub __**:: + Specifies the UEFI stub loader, which will load the attached kernel, initramfs and + kernel command line and boots the kernel. The default is + _$prefix/lib/systemd/boot/efi/linux.efi.stub_ + +**--uefi-splash-image __**:: + Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image + format. + +**--kernel-image __**:: + Specifies the kernel image, which to include in the UEFI executable. The default is + _/lib/modules//vmlinuz_ or _/boot/vmlinuz-_ + +ENVIRONMENT +----------- + +_INITRD_COMPRESS_:: + sets the default compression program. See **--compress**. + +_DRACUT_LDCONFIG_:: + sets the _ldconfig_ program path and options. Optional. + Used for **--sysroot**. ++ +Default: + _ldconfig_ + +_DRACUT_LDD_:: + sets the _ldd_ program path and options. Optional. + Used for **--sysroot**. ++ +Default: + _ldd_ + +_DRACUT_TESTBIN_:: + sets the initially tested binary for detecting library paths. + Optional. Used for **--sysroot**. In the cross-compiled sysroot, + the default value (_/bin/sh_) is unusable, as it is an absolute + symlink and points outside the sysroot directory. ++ +Default: + _/bin/sh_ + +_DRACUT_INSTALL_:: + overrides path and options for executing _dracut-install_ internally. + Optional. Can be used to debug _dracut-install_ while running the + main dracut script. ++ +Default: + _dracut-install_ ++ +Example: + DRACUT_INSTALL="valgrind dracut-install" + +_DRACUT_COMPRESS_BZIP2_:: +_DRACUT_COMPRESS_BZIP2_:: +_DRACUT_COMPRESS_LBZIP2_:: +_DRACUT_COMPRESS_LZMA_:: +_DRACUT_COMPRESS_XZ_:: +_DRACUT_COMPRESS_GZIP_:: +_DRACUT_COMPRESS_PIGZ_:: +_DRACUT_COMPRESS_LZOP_:: +_DRACUT_COMPRESS_ZSTD_:: +_DRACUT_COMPRESS_LZ4_:: +_DRACUT_COMPRESS_CAT_:: + overrides for compression utilities to support using them from + non-standard paths. ++ +Default values are the default compression utility names to be found in **PATH**. + +_DRACUT_ARCH_:: + overrides the value of **uname -m**. Used for **--sysroot**. ++ +Default: + _empty_ (the value of **uname -m** on the host system) + +_SYSTEMD_VERSION_:: + overrides systemd version. Used for **--sysroot**. + +_SYSTEMCTL_:: + overrides the systemctl binary. Used for **--sysroot**. + +_NM_VERSION_:: + overrides the NetworkManager version. Used for **--sysroot**. + +_DRACUT_INSTALL_PATH_:: + overrides **PATH** environment for **dracut-install** to look for + binaries relative to **--sysroot**. In a cross-compiled environment + (e.g. Yocto), PATH points to natively built binaries that are not + in the host's /bin, /usr/bin, etc. **dracut-install** still needs plain + /bin and /usr/bin that are relative to the cross-compiled sysroot. ++ +Default: + _PATH_ + +_DRACUT_INSTALL_LOG_TARGET_:: + overrides **DRACUT_LOG_TARGET** for **dracut-install**. It allows + running **dracut-install* to run with different log target that + **dracut** runs with. ++ +Default: + _DRACUT_LOG_TARGET_ + +_DRACUT_INSTALL_LOG_LEVEL_:: + overrides **DRACUT_LOG_LEVEL** for **dracut-install**. It allows + running **dracut-install* to run with different log level that + **dracut** runs with. ++ +Default: + _DRACUT_LOG_LEVEL_ + +FILES +----- +_/var/log/dracut.log_:: + logfile of initramfs image creation + +_/tmp/dracut.log_:: + logfile of initramfs image creation, if _/var/log/dracut.log_ is not + writable + +_/etc/dracut.conf_:: + see dracut.conf5 + +_/etc/dracut.conf.d/*.conf_:: + see dracut.conf5 + +_/usr/lib/dracut/dracut.conf.d/*.conf_:: + see dracut.conf5 + +Configuration in the initramfs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +_/etc/conf.d/_:: + Any files found in _/etc/conf.d/_ will be sourced in the initramfs to + set initial values. Command line options will override these values + set in the configuration files. + +_/etc/cmdline_:: + Can contain additional command line options. Deprecated, better use + /etc/cmdline.d/*.conf. + +_/etc/cmdline.d/*.conf_:: + Can contain additional command line options. + +AVAILABILITY +------------ +The dracut command is part of the dracut package and is available from +link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org] + +AUTHORS +------- +Harald Hoyer + +Victor Lowther + +Amadeusz Żołnowski + +Hannes Reinecke + +Daniel Molkentin + +Will Woods + +Philippe Seewer + +Warren Togami + +SEE ALSO +-------- +*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1) diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.asc b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.asc new file mode 100644 index 0000000..cc11d01 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.asc @@ -0,0 +1,182 @@ +dracut {mainversion} +==================== +:author: Harald Hoyer +:email: harald@redhat.com +:revnumber: {version} +:language: bash + += Introduction +This section is a modified version of +http://en.wikipedia.org/wiki/Initrd which is licensed under the +Creative Commons Attribution/Share-Alike License. + +== Definition +An _initial ramdisk_ is a temporary file system used in the boot process of the +Linux kernel. _initrd_ and _initramfs_ refer to slightly different schemes for +loading this file system into memory. Both are commonly used to make +preparations before the real root file system can be mounted. + +== Rationale +Many Linux distributions ship a single, generic kernel image that is intended to +boot as wide a variety of hardware as possible. The device drivers for this +generic kernel image are included as loadable modules, as it is not possible to +statically compile them all into the one kernel without making it too large to +boot from computers with limited memory or from lower-capacity media like floppy +disks. + +This then raises the problem of detecting and loading the modules necessary to +mount the root file system at boot time (or, for that matter, deducing where or +what the root file system is). + +To further complicate matters, the root file system may be on a software RAID +volume, LVM, NFS (on diskless workstations), or on an encrypted partition. All +of these require special preparations to mount. + +Another complication is kernel support for hibernation, which suspends the +computer to disk by dumping an image of the entire system to a swap partition or +a regular file, then powering off. On next boot, this image has to be made +accessible before it can be loaded back into memory. + +To avoid having to hardcode handling for so many special cases into the kernel, +an initial boot stage with a temporary root file system +—now dubbed early user space— is used. This root file system would contain +user-space helpers that would do the hardware detection, module loading and +device discovery necessary to get the real root file system mounted. + +== Implementation +An image of this initial root file system (along with the kernel image) must be +stored somewhere accessible by the Linux bootloader or the boot firmware of the +computer. This can be: + +* The root file system itself +* A boot image on an optical disc +* A small ext2/ext3 or FAT-formatted partition on a local disk + (a _boot partition_) +* A TFTP server (on systems that can boot from Ethernet) + +The bootloader will load the kernel and initial root file system image into +memory and then start the kernel, passing in the memory address of the image. + +Depending on which algorithms were compiled statically into it, the kernel can +currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA. + +== Mount preparations +dracut can generate a customized initramfs image which contains only whatever is +necessary to boot some particular computer, such as ATA, SCSI and filesystem +kernel modules (host-only mode). + +dracut can also generate a more generic initramfs image (default mode). + +dracut's initramfs starts only with the device name of the root file system (or +its UUID) and must discover everything else at boot time. A complex cascade of +tasks must be performed to get the root file system mounted: + +* Any hardware drivers that the boot process depends on must be loaded. All +kernel modules for common storage devices are packed onto the initramfs and then +udev pulls in modules matching the computer's detected hardware. + +* On systems which display a boot rd.splash screen, the video hardware must be +initialized and a user-space helper started to paint animations onto the display +in lockstep with the boot process. + +* If the root file system is on NFS, dracut does then: +** Bring up the primary network interface. +** Invoke a DHCP client, with which it can obtain a DHCP lease. +** Extract the name of the NFS share and the address of the NFS server from the +lease. +** Mount the NFS share. + +* If the root file system appears to be on a software RAID device, there is no +way of knowing which devices the RAID volume spans; the standard MD utilities +must be invoked to scan all available block devices with a raid signature and +bring the required ones online. + +* If the root file system appears to be on a logical volume, the LVM utilities +must be invoked to scan for and activate the volume group containing it. + +* If the root file system is on an encrypted block device: +** Invoke a helper script to prompt the user to type in a passphrase and/or +insert a hardware token (such as a smart card or a USB security dongle). + +* Create a decryption target with the device mapper. + +dracut uses udev, an event-driven hotplug agent, which invokes helper programs +as hardware devices, disk partitions and storage volumes matching certain rules +come online. This allows discovery to run in parallel, and to progressively +cascade into arbitrary nestings of LVM, RAID or encryption to get at the root +file system. + +When the root file system finally becomes visible: + +* Any maintenance tasks which cannot run on a mounted root file system +are done. +* The root file system is mounted read-only. +* Any processes which must continue running (such as the rd.splash screen helper +and its command FIFO) are hoisted into the newly-mounted root file system. + +The final root file system cannot simply be mounted over /, since that would +make the scripts and tools on the initial root file system inaccessible for any +final cleanup tasks. On an initramfs, the initial root file system cannot be +rotated away. Instead, it is simply emptied and the final root file system +mounted over the top. + +If the systemd module is used in the initramfs, the ordering of the services +started looks like <>. + +== Dracut on shutdown + +On a systemd driven system, the dracut initramfs is also used for the shutdown +procedure. + +The following steps are executed during a shutdown: + +* systemd switches to the shutdown.target +* systemd starts + $prefix/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service +* dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore + which unpacks the initramfs to /run/initramfs +* systemd finishes shutdown.target +* systemd kills all processes +* systemd tries to unmount everything and mounts the remaining read-only +* systemd checks, if there is a /run/initramfs/shutdown executable +* if yes, it does a pivot_root to /run/initramfs and executes ./shutdown. + The old root is then mounted on /oldroot. + /usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable. +* shutdown will try to unmount every /oldroot mount and calls the various + shutdown hooks from the dracut modules + +This ensures, that all devices are disassembled and unmounted cleanly. + += User Manual + +:leveloffset: 1 +include::dracut.8.asc[] + +:leveloffset: 1 +[[dracutconf5]] +include::dracut.conf.5.asc[] + +[[dracutcmdline7]] +include::dracut.cmdline.7.asc[] + +[[lsinitrd1]] +include::lsinitrd.1.asc[] + += Developer Manual + +:leveloffset: 1 +[[dracutmodules7]] +include::dracut.modules.7.asc[] + +[[dracutbootup7]] +include::dracut.bootup.7.asc[] + +:leveloffset: 0 +[appendix] +License +------- +This work is licensed under the Creative Commons Attribution/Share-Alike +License. To view a copy of this license, visit +http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative +Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.bootup.7 b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.bootup.7 new file mode 100644 index 0000000..9d96978 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.bootup.7 @@ -0,0 +1,145 @@ +'\" t +.\" Title: dracut.bootup +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 05/17/2021 +.\" Manual: dracut +.\" Source: dracut 054-2-gb9b6f0ee +.\" Language: English +.\" +.TH "DRACUT\&.BOOTUP" "7" "05/17/2021" "dracut 054\-2\-gb9b6f0ee" "dracut" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +dracut.bootup \- boot ordering in the initramfs +.SH "DESCRIPTION" +.sp +This flow chart illustrates the ordering of the services, if systemd is used in the dracut initramfs\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf + systemd\-journal\&.socket + | + v + dracut\-cmdline\&.service + | + v + dracut\-pre\-udev\&.service + | + v + systemd\-udevd\&.service + | + v +local\-fs\-pre\&.target dracut\-pre\-trigger\&.service + | | + v v + (various mounts) (various swap systemd\-udev\-trigger\&.service + | devices\&.\&.\&.) | (various low\-level (various low\-level + | | | services: seed, API VFS mounts: + v v v tmpfiles, random mqueue, configfs, + local\-fs\&.target swap\&.target dracut\-initqueue\&.service sysctl, \&.\&.\&.) debugfs, \&.\&.\&.) + | | | | | + \e_______________|____________________ | ___________________|____________________/ + \e|/ + v + sysinit\&.target + | + _________________/|\e___________________ + / | \e + | | | + v | v + (various | rescue\&.service + sockets\&.\&.\&.) | | + | | v + v | rescue\&.target + sockets\&.target | + | | + \e_________________ | emergency\&.service + \e| | + v v + basic\&.target emergency\&.target + | + ______________________/| + / | + | v + | dracut\-pre\-mount\&.service + | | + | v + | sysroot\&.mount + | | + | v + | initrd\-root\-fs\&.target + (custom initrd services) | + | v + | dracut\-mount\&.service + | | + | v + | initrd\-parse\-etc\&.service + | | + | v + | (sysroot\-usr\&.mount and + | various mounts marked + | with fstab option + | x\-initrd\&.mount) + | | + | v + | initrd\-fs\&.target + \e______________________ | + \e| + v + initrd\&.target + | + v + dracut\-pre\-pivot\&.service + | + v + initrd\-cleanup\&.service + isolates to + initrd\-switch\-root\&.target + | + v + ______________________/| + / | + | initrd\-udevadm\-cleanup\-db\&.service + | | + (custom initrd services) | + | | + \e______________________ | + \e| + v + initrd\-switch\-root\&.target + | + v + initrd\-switch\-root\&.service + | + v + switch\-root +.fi +.if n \{\ +.RE +.\} +.SH "AUTHOR" +.sp +Harald Hoyer +.SH "SEE ALSO" +.sp +\fBdracut\fR(8) \fBbootup\fR(7) diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.bootup.7.asc b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.bootup.7.asc new file mode 100644 index 0000000..b842384 --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.bootup.7.asc @@ -0,0 +1,124 @@ +DRACUT.BOOTUP(7) +================ +:doctype: manpage +:man source: dracut +:man manual: dracut +:man version: {version} + +NAME +---- +dracut.bootup - boot ordering in the initramfs + +DESCRIPTION +----------- + +This flow chart illustrates the ordering of the services, if systemd is used in +the dracut initramfs. +---- + + systemd-journal.socket + | + v + dracut-cmdline.service + | + v + dracut-pre-udev.service + | + v + systemd-udevd.service + | + v +local-fs-pre.target dracut-pre-trigger.service + | | + v v + (various mounts) (various swap systemd-udev-trigger.service + | devices...) | (various low-level (various low-level + | | | services: seed, API VFS mounts: + v v v tmpfiles, random mqueue, configfs, + local-fs.target swap.target dracut-initqueue.service sysctl, ...) debugfs, ...) + | | | | | + \_______________|____________________ | ___________________|____________________/ + \|/ + v + sysinit.target + | + _________________/|\___________________ + / | \ + | | | + v | v + (various | rescue.service + sockets...) | | + | | v + v | rescue.target + sockets.target | + | | + \_________________ | emergency.service + \| | + v v + basic.target emergency.target + | + ______________________/| + / | + | v + | dracut-pre-mount.service + | | + | v + | sysroot.mount + | | + | v + | initrd-root-fs.target + (custom initrd services) | + | v + | dracut-mount.service + | | + | v + | initrd-parse-etc.service + | | + | v + | (sysroot-usr.mount and + | various mounts marked + | with fstab option + | x-initrd.mount) + | | + | v + | initrd-fs.target + \______________________ | + \| + v + initrd.target + | + v + dracut-pre-pivot.service + | + v + initrd-cleanup.service + isolates to + initrd-switch-root.target + | + v + ______________________/| + / | + | initrd-udevadm-cleanup-db.service + | | + (custom initrd services) | + | | + \______________________ | + \| + v + initrd-switch-root.target + | + v + initrd-switch-root.service + | + v + switch-root +---- + + +AUTHOR +------ +Harald Hoyer + +SEE ALSO +-------- +*dracut*(8) *bootup*(7) diff --git a/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.cmdline.7 b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.cmdline.7 new file mode 100644 index 0000000..4eb531d --- /dev/null +++ b/roles/toxcore/overlay/Linux/usr/local/src/dracut-055/man/dracut.cmdline.7 @@ -0,0 +1,2354 @@ +'\" t +.\" Title: dracut.cmdline +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 05/17/2021 +.\" Manual: dracut +.\" Source: dracut 054-2-gb9b6f0ee +.\" Language: English +.\" +.TH "DRACUT\&.CMDLINE" "7" "05/17/2021" "dracut 054\-2\-gb9b6f0ee" "dracut" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +dracut.cmdline \- dracut kernel command line options +.SH "DESCRIPTION" +.sp +The root device used by the kernel is specified in the boot configuration file on the kernel command line, as always\&. +.sp +The traditional \fIroot=/dev/sda1\fR style device specification is allowed, but not encouraged\&. The root device should better be identified by LABEL or UUID\&. If a label is used, as in \fIroot=LABEL=\fR the initramfs will search all available devices for a filesystem with the appropriate label, and mount that device as the root filesystem\&. \fIroot=UUID=\fR will mount the partition with that UUID as the root filesystem\&. +.sp +In the following all kernel command line parameters, which are processed by dracut, are described\&. +.sp +"rd\&.*" parameters mentioned without "=" are boolean parameters\&. They can be turned on/off by setting them to {0|1}\&. If the assignment with "=" is missing "=1" is implied\&. For example \fIrd\&.info\fR can be turned off with \fIrd\&.info=0\fR or turned on with \fIrd\&.info=1\fR or \fIrd\&.info\fR\&. The last value in the kernel command line is the value, which is honored\&. +.SS "Standard" +.PP +\fBinit=\fR\fI\fR +.RS 4 +specify the path to the init program to be started after the initramfs has finished +.RE +.PP +\fBroot=\fR\fI\fR +.RS 4 +specify the block device to use as the root filesystem\&. +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +root=/dev/sda1 +root=/dev/disk/by\-path/pci\-0000:00:1f\&.1\-scsi\-0:0:1:0\-part1 +root=/dev/disk/by\-label/Root +root=LABEL=Root +root=/dev/disk/by\-uuid/3f5ad593\-4546\-4a94\-a374\-bcfb68aa11f7 +root=UUID=3f5ad593\-4546\-4a94\-a374\-bcfb68aa11f7 +root=PARTUUID=3f5ad593\-4546\-4a94\-a374\-bcfb68aa11f7 +.fi +.if n \{\ +.RE +.\} +.sp +.RE +.PP +\fBrootfstype=\fR\fI\fR +.RS 4 +"auto" if not specified\&. +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +rootfstype=ext3 +.fi +.if n \{\ +.RE +.\} +.sp +.RE +.PP +\fBrootflags=\fR\fI\fR +.RS 4 +specify additional mount options for the root filesystem\&. If not set, +\fI/etc/fstab\fR +of the real root will be parsed for special mount options and mounted accordingly\&. +.RE +.PP +\fBro\fR +.RS 4 +force mounting +\fI/\fR +and +\fI/usr\fR +(if it is a separate device) read\-only\&. If none of ro and rw is present, both are mounted according to +\fI/etc/fstab\fR\&. +.RE +.PP +\fBrw\fR +.RS 4 +force mounting +\fI/\fR +and +\fI/usr\fR +(if it is a separate device) read\-write\&. See also ro option\&. +.RE +.PP +\fBrootfallback=\fR\fI\fR +.RS 4 +specify the block device to use as the root filesystem, if the normal root cannot be found\&. This can only be a simple block device with a simple file system, for which the filesystem driver is either compiled in, or added manually to the initramfs\&. This parameter can be specified multiple times\&. +.RE +.PP +\fBrd\&.auto\fR \fBrd\&.auto=1\fR +.RS 4 +enable autoassembly of special devices like cryptoLUKS, dmraid, mdraid or lvm\&. Default is off as of dracut version >= 024\&. +.RE +.PP +\fBrd\&.hostonly=0\fR +.RS 4 +removes all compiled in configuration of the host system the initramfs image was built on\&. This helps booting, if any disk layout changed, especially in combination with rd\&.auto or other parameters specifying the layout\&. +.RE +.PP +\fBrd\&.cmdline=ask\fR +.RS 4 +prompts the user for additional kernel command line parameters +.RE +.PP +\fBrd\&.fstab=0\fR +.RS 4 +do not honor special mount options for the root filesystem found in +\fI/etc/fstab\fR +of the real root\&. +.RE +.PP +\fBresume=\fR\fI\fR +.RS 4 +resume from a swap partition +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +resume=/dev/disk/by\-path/pci\-0000:00:1f\&.1\-scsi\-0:0:1:0\-part1 +resume=/dev/disk/by\-uuid/3f5ad593\-4546\-4a94\-a374\-bcfb68aa11f7 +resume=UUID=3f5ad593\-4546\-4a94\-a374\-bcfb68aa11f7 +.fi +.if n \{\ +.RE +.\} +.sp +.RE +.PP +\fBrd\&.skipfsck\fR +.RS 4 +skip fsck for rootfs and +\fI/usr\fR\&. If you\(cqre mounting +\fI/usr\fR +read\-only and the init system performs fsck before remount, you might want to use this option to avoid duplication\&. +.RE +.SS "iso\-scan/filename" +.sp +Mount all mountable devices and search for ISO pointed by the argument\&. When the ISO is found set it up as a loop device\&. Device containing this ISO image will stay mounted at /run/initramfs/isoscandev\&. Using iso\-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work by copying the original kernel cmdline parameters\&. +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +menuentry \*(AqLive Fedora 20\*(Aq \-\-class fedora \-\-class gnu\-linux \-\-class gnu \-\-class os { + set isolabel=Fedora\-Live\-LXDE\-x86_64\-20\-1 + set isofile="/boot/iso/Fedora\-Live\-LXDE\-x86_64\-20\-1\&.iso" + loopback loop $isofile + linux (loop)/isolinux/vmlinuz0 boot=isolinux iso\-scan/filename=$isofile root=live:LABEL=$isolabel ro rd\&.live\&.image quiet rhgb + initrd (loop)/isolinux/initrd0\&.img +} +.fi +.if n \{\ +.RE +.\} +.sp +.SS "Misc" +.PP +\fBrd\&.emergency=\fR\fI[reboot|poweroff|halt]\fR +.RS 4 +specify, what action to execute in case of a critical failure\&. rd\&.shell=0 also be specified\&. +.RE +.PP +\fBrd\&.driver\&.blacklist=\fR\fI\fR[,\fI\fR,\&...] +.RS 4 +do not load kernel module \&. This parameter can be specified multiple times\&. +.RE +.PP +\fBrd\&.driver\&.pre=\fR\fI\fR[,\fI\fR,\&...] +.RS 4 +force loading kernel module \&. This parameter can be specified multiple times\&. +.RE +.PP +\fBrd\&.driver\&.post=\fR\fI\fR[,\fI\fR,\&...] +.RS 4 +force loading kernel module after all automatic loading modules have been loaded\&. This parameter can be specified multiple times\&. +.RE +.PP +\fBrd\&.retry=\fR\fI\fR +.RS 4 +specify how long dracut should retry the initqueue to configure devices\&. The default is 30 seconds\&. After 2/3 of the time, degraded raids are force started\&. If you have hardware, which takes a very long time to announce its drives, you might want to extend this value\&. +.RE +.PP +\fBrd\&.timeout=\fR\fI\fR +.RS 4 +specify how long dracut should wait for devices to appear\&. The default is +\fI0\fR, which means +\fIforever\fR\&. Note that this timeout should be longer than rd\&.retry to allow for proper configuration\&. +.RE +.PP +\fBrd\&.noverifyssl\fR +.RS 4 +accept self\-signed certificates for ssl downloads\&. +.RE +.PP +\fBrd\&.ctty=\fR\fI\fR +.RS 4 +specify the controlling terminal for the console\&. This is useful, if you have multiple "console=" arguments\&. +.RE +.PP +\fBrd\&.shutdown\&.timeout\&.umount=\fR\fI\fR +.RS 4 +specify how long dracut should wait for an individual umount to finish during shutdown\&. This avoids the system from blocking when unmounting a file system cannot complete and waits indefinitely\&. Value +\fI0\fR +means to wait +\fIforever\fR\&. The default is 90 seconds\&. +.RE +.SS "Debug" +.sp +If you are dropped to an emergency shell, the file \fI/run/initramfs/rdsosreport\&.txt\fR is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick\&. Additional debugging info can be produced by adding \fBrd\&.debug\fR to the kernel command line\&. \fI/run/initramfs/rdsosreport\&.txt\fR contains all logs and the output of some tools\&. It should be attached to any report about dracut problems\&. +.PP +\fBrd\&.info\fR +.RS 4 +print informational output though "quiet" is set +.RE +.PP +\fBrd\&.shell\fR +.RS 4 +allow dropping to a shell, if root mounting fails +.RE +.PP +\fBrd\&.debug\fR +.RS 4 +set \-x for the dracut shell\&. If systemd is active in the initramfs, all output is logged to the systemd journal, which you can inspect with "journalctl \-ab"\&. If systemd is not active, the logs are written to dmesg and +\fI/run/initramfs/init\&.log\fR\&. If "quiet" is set, it also logs to the console\&. +.RE +.PP +\fBrd\&.memdebug=[0\-5]\fR +.RS 4 +Print memory usage info at various points, set the verbose level from 0 to 5\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +Higher level means more debugging output: +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf + 0 \- no output + 1 \- partial /proc/meminfo + 2 \- /proc/meminfo + 3 \- /proc/meminfo + /proc/slabinfo + 4 \- /proc/meminfo + /proc/slabinfo + memstrack summary + NOTE: memstrack is a memory tracing tool that tracks the total memory + consumption, and peak memory consumption of each kernel modules + and userspace progress during the whole initramfs runtime, report + is genereted and the end of initramsfs run\&. + 5 \- /proc/meminfo + /proc/slabinfo + memstrack (with top memory stacktrace) + NOTE: memstrack (with top memory stacktrace) will print top memory + allocation stack traces during the whole initramfs runtime\&. +.fi +.if n \{\ +.RE +.\} +.RE +.PP +\fBrd\&.break\fR +.RS 4 +drop to a shell at the end +.RE +.PP +\fBrd\&.break=\fR\fI{cmdline|pre\-udev|pre\-trigger|initqueue|pre\-mount|mount|pre\-pivot|cleanup}\fR +.RS 4 +drop to a shell on defined breakpoint +.RE +.PP +\fBrd\&.udev\&.info\fR +.RS 4 +set udev to loglevel info +.RE +.PP +\fBrd\&.udev\&.debug\fR +.RS 4 +set udev to loglevel debug +.RE +.SS "I18N" +.PP +\fBrd\&.vconsole\&.keymap=\fR\fI\fR +.RS 4 +keyboard translation table loaded by loadkeys; taken from keymaps directory; will be written as KEYMAP to +\fI/etc/vconsole\&.conf\fR +in the initramfs\&. +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.vconsole\&.keymap=de\-latin1\-nodeadkeys +.fi +.if n \{\ +.RE +.\} +.sp +.RE +.PP +\fBrd\&.vconsole\&.keymap\&.ext=\fR\fI\fR +.RS 4 +list of extra keymaps to bo loaded (sep\&. by space); will be written as EXT_KEYMAP to +\fI/etc/vconsole\&.conf\fR +in the initramfs +.RE +.PP +\fBrd\&.vconsole\&.unicode\fR +.RS 4 +boolean, indicating UTF\-8 mode; will be written as UNICODE to +\fI/etc/vconsole\&.conf\fR +in the initramfs +.RE +.PP +\fBrd\&.vconsole\&.font=\fR\fI\fR +.RS 4 +console font; taken from consolefonts directory; will be written as FONT to +\fI/etc/vconsole\&.conf\fR +in the initramfs\&. +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.vconsole\&.font=eurlatgr +.fi +.if n \{\ +.RE +.\} +.sp +.RE +.PP +\fBrd\&.vconsole\&.font\&.map=\fR\fI\fR +.RS 4 +see description of +\fI\-m\fR +parameter in setfont manual; taken from consoletrans directory; will be written as FONT_MAP to +\fI/etc/vconsole\&.conf\fR +in the initramfs +.RE +.PP +\fBrd\&.vconsole\&.font\&.unimap=\fR\fI\fR +.RS 4 +see description of +\fI\-u\fR +parameter in setfont manual; taken from unimaps directory; will be written as FONT_UNIMAP to +\fI/etc/vconsole\&.conf\fR +in the initramfs +.RE +.PP +\fBrd\&.locale\&.LANG=\fR\fI\fR +.RS 4 +taken from the environment; if no UNICODE is defined we set its value in basis of LANG value (whether it ends with "\&.utf8" (or similar) or not); will be written as LANG to +\fI/etc/locale\&.conf\fR +in the initramfs\&. +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.locale\&.LANG=pl_PL\&.utf8 +.fi +.if n \{\ +.RE +.\} +.sp +.RE +.PP +\fBrd\&.locale\&.LC_ALL=\fR\fI\fR +.RS 4 +taken from the environment; will be written as LC_ALL to +\fI/etc/locale\&.conf\fR +in the initramfs +.RE +.SS "LVM" +.PP +\fBrd\&.lvm=0\fR +.RS 4 +disable LVM detection +.RE +.PP +\fBrd\&.lvm\&.vg=\fR\fI\fR +.RS 4 +only activate all logical volumes in the the volume groups with the given name\&. rd\&.lvm\&.vg can be specified multiple times on the kernel command line\&. +.RE +.PP +\fBrd\&.lvm\&.lv=\fR\fI/\fR +.RS 4 +only activate the logical volumes with the given name\&. rd\&.lvm\&.lv can be specified multiple times on the kernel command line\&. +.RE +.PP +\fBrd\&.lvm\&.conf=0\fR +.RS 4 +remove any +\fI/etc/lvm/lvm\&.conf\fR, which may exist in the initramfs +.RE +.SS "crypto LUKS" +.PP +\fBrd\&.luks=0\fR +.RS 4 +disable crypto LUKS detection +.RE +.PP +\fBrd\&.luks\&.uuid=\fR\fI\fR +.RS 4 +only activate the LUKS partitions with the given UUID\&. Any "luks\-" of the LUKS UUID is removed before comparing to +\fI\fR\&. The comparisons also matches, if +\fI\fR +is only the beginning of the LUKS UUID, so you don\(cqt have to specify the full UUID\&. This parameter can be specified multiple times\&. +\fI\fR +may be prefixed by the keyword +keysource:, see +\fIrd\&.luks\&.key\fR +below\&. +.RE +.PP +\fBrd\&.luks\&.allow\-discards=\fR\fI\fR +.RS 4 +Allow using of discards (TRIM) requests for LUKS partitions with the given UUID\&. Any "luks\-" of the LUKS UUID is removed before comparing to +\fI\fR\&. The comparisons also matches, if +\fI\fR +is only the beginning of the LUKS UUID, so you don\(cqt have to specify the full UUID\&. This parameter can be specified multiple times\&. +.RE +.PP +\fBrd\&.luks\&.allow\-discards\fR +.RS 4 +Allow using of discards (TRIM) requests on all LUKS partitions\&. +.RE +.PP +\fBrd\&.luks\&.crypttab=0\fR +.RS 4 +do not check, if LUKS partition is in +\fI/etc/crypttab\fR +.RE +.PP +\fBrd\&.luks\&.timeout=\fR\fI\fR +.RS 4 +specify how long dracut should wait when waiting for the user to enter the password\&. This avoid blocking the boot if no password is entered\&. It does not apply to luks key\&. The default is +\fI0\fR, which means +\fIforever\fR\&. +.RE +.SS "crypto LUKS \- key on removable device support" +.sp +NB: If systemd is included in the dracut initrd, dracut\(cqs built in removable device keying support won\(cqt work\&. systemd will prompt for a password from the console even if you\(cqve supplied \fBrd\&.luks\&.key\fR\&. You may be able to use standard systemd \fBfstab\fR(5) syntax to get the same effect\&. If you do need \fBrd\&.luks\&.key\fR to work, you will have to exclude the "systemd" dracut module and any modules that depend on it\&. See \fBdracut\&.conf\fR(5) and \m[blue]\fBhttps://bugzilla\&.redhat\&.com/show_bug\&.cgi?id=905683\fR\m[] for more information\&. +.PP +\fBrd\&.luks\&.key=\fR\fI[:[:]]\fR +.RS 4 +\fI\fR +is the pathname of a key file, relative to the root of the filesystem on some device\&. It\(cqs REQUIRED\&. When +\fI\fR +ends with +\fI\&.gpg\fR +it\(cqs considered to be key encrypted symmetrically with GPG\&. You will be prompted for the GPG password on boot\&. GPG support comes with the +\fIcrypt\-gpg\fR +module, which needs to be added explicitly\&. +.sp +\fI\fR +identifies the device on which the key file resides\&. It may be the kernel name of the device (should start with "/dev/"), a UUID (prefixed with "UUID=") or a label (prefix with "LABEL=")\&. You don\(cqt have to specify a full UUID\&. Just its beginning will suffice, even if its ambiguous\&. All matching devices will be probed\&. This parameter is recommended, but not required\&. If it\(cqs not present, all block devices will be probed, which may significantly increase boot time\&. +.sp +If +\fI\fR +is given, the specified key will only be used for the specified LUKS device\&. Possible values are the same as for +\fI\fR\&. Unless you have several LUKS devices, you don\(cqt have to specify this parameter\&. The simplest usage is: +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.luks\&.key=/foo/bar\&.key +.fi +.if n \{\ +.RE +.\} +.sp + +As you see, you can skip colons in such a case\&. +.RE +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.sp +Your LUKS partition must match your key file\&. +.sp +dracut provides keys to cryptsetup with \fI\-d\fR (an older alias for \fI\-\-key\-file\fR)\&. This uses the entire binary content of the key file as part of the secret\&. If you pipe a password into cryptsetup \fBwithout\fR \fI\-d\fR or \fI\-\-key\-file\fR, it will be treated as text user input, and only characters before the first newline will be used\&. Therefore, when you\(cqre creating an encrypted partition for dracut to mount, and you pipe a key into \fIcryptsetup luksFormat\fR,you must use \fI\-d \-\fR\&. +.sp +Here is an example for a key encrypted with GPG (warning: \fI\-\-batch\-mode\fR will overwrite the device without asking for confirmation): +.sp +.if n \{\ +.RS 4 +.\} +.nf +gpg \-\-quiet \-\-decrypt rootkey\&.gpg | \e +cryptsetup \-\-batch\-mode \-\-key\-file \- \e + luksFormat /dev/sda47 +.fi +.if n \{\ +.RE +.\} +.sp +If you use unencrypted key files, just use the key file pathname instead of the standard input\&. For a random key with 256 bits of entropy, you might use: +.sp +.if n \{\ +.RS 4 +.\} +.nf +head \-32c /dev/urandom > rootkey\&.key +cryptsetup \-\-batch\-mode \-\-key\-file rootkey\&.key \e + luksFormat /dev/sda47 +.fi +.if n \{\ +.RE +.\} +.sp +You can also use regular key files on an encrypted \fIkeydev\fR\&. +.sp +Compared to using GPG encrypted keyfiles on an unencrypted device this provides the following advantages: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +you can unlock your disk(s) using multiple passphrases +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +better security by not loosing the key stretching mechanism +.RE +.sp +To use an encrypted \fIkeydev\fR you \fBmust\fR ensure that it becomes available by using the keyword keysource, e\&.g\&. rd\&.luks\&.uuid=keysource:aaaa \fIaaaa\fR being the uuid of the encrypted \fIkeydev\fR\&. +.sp +Example: +.sp +Lets assume you have three disks \fIA\fR, \fIB\fR and \fIC\fR with the uuids \fIaaaa\fR, \fIbbbb\fR and \fIcccc\fR\&. You want to unlock \fIA\fR and \fIB\fR using keyfile \fIkeyfile\fR\&. The unlocked volumes be \fIA\*(Aq\fR, \fIB\*(Aq\fR and \fIC\*(Aq\fR with the uuids \fIAAAA\fR, \fIBBBB\fR and \fICCCC\fR\&. \fIkeyfile\fR is saved on \fIC\*(Aq\fR as \fI/keyfile\fR\&. +.sp +One luks keyslot of each \fIA\fR, \fIB\fR and \fIC\fR is setup with a passphrase\&. Another luks keyslot of each \fIA\fR and \fIB\fR is setup with \fIkeyfile\fR\&. +.sp +To boot this configuration you could use: +.sp +.if n \{\ +.RS 4 +.\} +.nf +rd\&.luks\&.uuid=aaaa +rd\&.luks\&.uuid=bbbb +rd\&.luks\&.uuid=keysource:cccc +rd\&.luks\&.key=/keyfile:UUID=CCCC +.fi +.if n \{\ +.RE +.\} +.sp +Dracut asks for the passphrase for \fIC\fR and uses the keyfile to unlock \fIA\fR and \fIB\fR\&. If getting the passphrase for \fIC\fR fails it falls back to asking for the passphrases for \fIA\fR and \fIB\fR\&. +.sp +If you want \fIC\*(Aq\fR to stay unlocked, specify a luks name for it, e\&.g\&. rd\&.luks\&.name=cccc=mykeys, otherwise it gets closed when not needed anymore\&. +.sp .5v +.RE +.SS "MD RAID" +.PP +\fBrd\&.md=0\fR +.RS 4 +disable MD RAID detection +.RE +.PP +\fBrd\&.md\&.imsm=0\fR +.RS 4 +disable MD RAID for imsm/isw raids, use DM RAID instead +.RE +.PP +\fBrd\&.md\&.ddf=0\fR +.RS 4 +disable MD RAID for SNIA ddf raids, use DM RAID instead +.RE +.PP +\fBrd\&.md\&.conf=0\fR +.RS 4 +ignore mdadm\&.conf included in initramfs +.RE +.PP +\fBrd\&.md\&.waitclean=1\fR +.RS 4 +wait for any resync, recovery, or reshape activity to finish before continuing +.RE +.PP +\fBrd\&.md\&.uuid=\fR\fI\fR +.RS 4 +only activate the raid sets with the given UUID\&. This parameter can be specified multiple times\&. +.RE +.SS "DM RAID" +.PP +\fBrd\&.dm=0\fR +.RS 4 +disable DM RAID detection +.RE +.PP +\fBrd\&.dm\&.uuid=\fR\fI\fR +.RS 4 +only activate the raid sets with the given UUID\&. This parameter can be specified multiple times\&. +.RE +.SS "MULTIPATH" +.PP +\fBrd\&.multipath=0\fR +.RS 4 +disable multipath detection +.RE +.PP +\fBrd\&.multipath=default\fR +.RS 4 +use default multipath settings +.RE +.SS "FIPS" +.PP +\fBrd\&.fips\fR +.RS 4 +enable FIPS +.RE +.PP +\fBboot=\fR\fI\fR +.RS 4 +specify the device, where /boot is located\&. +.PP +\fBExample\fR. +.sp +.if n \{\ +.RS 4 +.\} +.nf +boot=/dev/sda1 +boot=/dev/disk/by\-path/pci\-0000:00:1f\&.1\-scsi\-0:0:1:0\-part1 +boot=UUID= +boot=LABEL=