Compare commits
143 Commits
check_conf
...
050
Author | SHA1 | Date | |
---|---|---|---|
![]() |
00efe708ca | ||
![]() |
0c983cdc49 | ||
![]() |
821e08da03 | ||
![]() |
ebeed55c07 | ||
![]() |
991100ba7a | ||
![]() |
f2d33a7f61 | ||
![]() |
7dc918cad1 | ||
![]() |
452cb40497 | ||
![]() |
286f2a04a1 | ||
![]() |
38c8fed48a | ||
![]() |
5b1d8bcc58 | ||
![]() |
c7403700df | ||
![]() |
ce62465caf | ||
![]() |
b3d40a4390 | ||
![]() |
3d2a6d29d4 | ||
![]() |
1edee0c4a1 | ||
![]() |
ecbdff68af | ||
![]() |
3ea80545d6 | ||
![]() |
ef8915d7af | ||
![]() |
7261a0540a | ||
![]() |
11a5501d0f | ||
![]() |
355df861da | ||
![]() |
8cba0ff833 | ||
![]() |
f1dc2180d4 | ||
![]() |
3f4ffebf33 | ||
![]() |
d5088b1703 | ||
![]() |
9ca53063ee | ||
![]() |
69341c9572 | ||
![]() |
55a974bae6 | ||
![]() |
3703ec8672 | ||
![]() |
74ba8f9e1d | ||
![]() |
a3f73298f2 | ||
![]() |
4b60a34715 | ||
![]() |
7374391434 | ||
![]() |
c6c588d648 | ||
![]() |
77537bf2d7 | ||
![]() |
7c51256eb2 | ||
![]() |
ba66cb2789 | ||
![]() |
2d75433cd7 | ||
![]() |
58ee6dc7f9 | ||
![]() |
0d33ba030b | ||
![]() |
63b67a48f9 | ||
![]() |
4bd0ab61b2 | ||
![]() |
b4de4f287f | ||
![]() |
eb8856a58c | ||
![]() |
3c5036a62f | ||
![]() |
074ac62576 | ||
![]() |
53e299e6f4 | ||
![]() |
2996d9e56f | ||
![]() |
2f78bafa4b | ||
![]() |
f7b9356c9e | ||
![]() |
3aae122c4b | ||
![]() |
93be2bc6ab | ||
![]() |
a8ba1c4e25 | ||
![]() |
4985aa8c6e | ||
![]() |
7795fde44c | ||
![]() |
2dc0cb50e3 | ||
![]() |
150cea0336 | ||
![]() |
4237aeb040 | ||
![]() |
16abea2592 | ||
![]() |
c7ee6b3dbb | ||
![]() |
cdc9cd0e41 | ||
![]() |
76f6566fd7 | ||
![]() |
962310483f | ||
![]() |
579fbb9fc4 | ||
![]() |
f668e7174e | ||
![]() |
1bef2934d7 | ||
![]() |
350ec5d9dd | ||
![]() |
d613d88dd2 | ||
![]() |
2ee69a40c8 | ||
![]() |
d0de58f232 | ||
![]() |
f4ad2e5c89 | ||
![]() |
cb86c560b0 | ||
![]() |
70b19acf94 | ||
![]() |
d5e818f349 | ||
![]() |
4598b5540e | ||
![]() |
5965710e01 | ||
![]() |
05b75703b0 | ||
![]() |
7fea85ce5f | ||
![]() |
2181c80c91 | ||
![]() |
212043f94d | ||
![]() |
958ca9e912 | ||
![]() |
7d47d1c423 | ||
![]() |
ff2043fb42 | ||
![]() |
8996d3dfcd | ||
![]() |
c226bfdda7 | ||
![]() |
9a752007b3 | ||
![]() |
80238086ab | ||
![]() |
50057af19c | ||
![]() |
e863807685 | ||
![]() |
f3f081e542 | ||
![]() |
c9391e8f6a | ||
![]() |
031e949c62 | ||
![]() |
10f8438c1e | ||
![]() |
f5d48a31db | ||
![]() |
fe54c9b7a9 | ||
![]() |
41a37bc626 | ||
![]() |
cf31ed2ae6 | ||
![]() |
62f27ee6f1 | ||
![]() |
718aefda13 | ||
![]() |
6e761674ad | ||
![]() |
687e17aa7f | ||
![]() |
3f4bbca751 | ||
![]() |
cc6792a01e | ||
![]() |
ca4aa84851 | ||
![]() |
ba813779bf | ||
![]() |
9e759aa969 | ||
![]() |
27f758e12c | ||
![]() |
4efcd19a4e | ||
![]() |
0595a79b19 | ||
![]() |
9d88e89350 | ||
![]() |
b552d364a3 | ||
![]() |
a01204202b | ||
![]() |
89bc1aa324 | ||
![]() |
0d609ae274 | ||
![]() |
7ff0fcb723 | ||
![]() |
feebf17187 | ||
![]() |
e3edd247ce | ||
![]() |
916ac45cbe | ||
![]() |
0bac59ee5e | ||
![]() |
fb3d292800 | ||
![]() |
1b38fa412c | ||
![]() |
66bfa66add | ||
![]() |
678627f349 | ||
![]() |
3c8c807db1 | ||
![]() |
78efd6988e | ||
![]() |
1aa2d1eddf | ||
![]() |
519186e9e6 | ||
![]() |
64082786b2 | ||
![]() |
159175d525 | ||
![]() |
9b9dd9993e | ||
![]() |
c0e5e48aab | ||
![]() |
28749d9973 | ||
![]() |
ac7582af48 | ||
![]() |
0d5597044f | ||
![]() |
5fbe772b44 | ||
![]() |
906896e220 | ||
![]() |
f551886f5c | ||
![]() |
1ab6778ee4 | ||
![]() |
7f0b48627a | ||
![]() |
5d88809319 | ||
![]() |
da36b76ab0 | ||
![]() |
a69e6c4eae |
48
.github/workflows/fedora-30.yml
vendored
Normal file
48
.github/workflows/fedora-30.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-30
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
#container: quay.io/haraldh/dracut-fedora:30
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
test: [
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"17",
|
||||
"20",
|
||||
"30",
|
||||
"35",
|
||||
"40",
|
||||
"50",
|
||||
"60",
|
||||
"99",
|
||||
]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "TEST-${{ matrix.test }}"
|
||||
run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:30 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
54
.github/workflows/fedora-31.yml
vendored
Normal file
54
.github/workflows/fedora-31.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-31
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
#container: quay.io/haraldh/dracut-fedora:30
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
test: [
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"17",
|
||||
"20",
|
||||
"21",
|
||||
"30",
|
||||
"31",
|
||||
"35",
|
||||
"36",
|
||||
"40",
|
||||
"41",
|
||||
"50",
|
||||
"51",
|
||||
"60",
|
||||
"61",
|
||||
"99",
|
||||
]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "TEST-${{ matrix.test }}"
|
||||
run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:31 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
17
.travis.yml
17
.travis.yml
@@ -9,24 +9,30 @@ env:
|
||||
- IMAGE=latest TESTS=01
|
||||
- IMAGE=latest TESTS=12
|
||||
- IMAGE=latest TESTS=20
|
||||
- IMAGE=latest TESTS=21
|
||||
- IMAGE=latest TESTS=50
|
||||
- IMAGE=latest TESTS=51
|
||||
- IMAGE=latest TESTS=30
|
||||
- IMAGE=latest TESTS=31
|
||||
- IMAGE=latest TESTS=35
|
||||
- IMAGE=latest TESTS=36
|
||||
- IMAGE=latest TESTS=40
|
||||
- IMAGE=latest TESTS=41
|
||||
- IMAGE=latest TESTS=60
|
||||
- IMAGE=latest TESTS=70
|
||||
- IMAGE=latest TESTS=61
|
||||
- IMAGE=latest TESTS=99
|
||||
- IMAGE=latest TESTS=02
|
||||
- IMAGE=latest TESTS=03
|
||||
- IMAGE=latest TESTS=04
|
||||
- IMAGE=latest TESTS=10
|
||||
- IMAGE=latest TESTS=11
|
||||
- IMAGE=29 TESTS=13
|
||||
- IMAGE=29 TESTS=14
|
||||
- IMAGE=latest TESTS=13
|
||||
- IMAGE=latest TESTS=14
|
||||
- IMAGE=latest TESTS=15
|
||||
- IMAGE=latest TESTS=17
|
||||
|
||||
before_script:
|
||||
- docker pull fedora:$IMAGE
|
||||
- docker pull quay.io/haraldh/dracut-fedora:$IMAGE
|
||||
- |
|
||||
sudo modprobe kvm-intel nested=1 || :
|
||||
sudo modprobe kvm-amd nested=1 || :
|
||||
@@ -37,7 +43,8 @@ before_script:
|
||||
git describe --tags || :
|
||||
|
||||
script:
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
|
77
AUTHORS
77
AUTHORS
@@ -5,15 +5,17 @@ Hannes Reinecke <hare@suse.com>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Thomas Renninger <trenn@suse.com>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
@@ -22,24 +24,29 @@ Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Martin Wilck <mwilck@suse.de>
|
||||
Frantisek Sumsal <frantisek@sumsal.cz>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Fabian Vogt <fvogt@suse.com>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Xunlei Pang <xlpang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Angelo "pallotron" Failla <pallotron@fb.com>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Böszörményi Zoltán <zboszor@pr.hu>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Jonathan Lebon <jonathan@jlebon.com>
|
||||
Renaud Métrich <rmetrich@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Brendan Germain <brendan.germain@nasdaqomx.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Jonas Witschel <diabonas@gmx.de>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Moritz Maxeiner <moritz@ucworks.org>
|
||||
Nathan Rini <nate@ucar.edu>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Ondrej Mosnacek <omosnace@redhat.com>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
@@ -47,20 +54,23 @@ Javier Martinez Canillas <javierm@redhat.com>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Lidong Zhong <lidong.zhong@suse.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Martin Wilck <mwilck@suse.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Mimi Zohar <zohar@linux.vnet.ibm.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Takashi Iwai <tiwai@suse.de>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
tpgxyz <tpgxyz@gmail.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
@@ -68,6 +78,7 @@ Chapman Flack <g2@anastigmatix.net>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Doan Tran Cong Danh <congdanhqx@gmail.com>
|
||||
Jan Synacek <jsynacek@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Juan RP <xtraeme@gmail.com>
|
||||
@@ -75,7 +86,9 @@ Lance Albertson <lance@osuosl.org>
|
||||
Marcos Mello <marcosfrm@gmail.com>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Matthias Gerstner <matthias.gerstner@suse.de>
|
||||
Max Resch <resch.max@gmail.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Norbert Lange <norbert.lange@andritz.com>
|
||||
Pratyush Anand <panand@redhat.com>
|
||||
Silvio Fricke <silvio.fricke@gmail.com>
|
||||
Steven Brudenell <steven.brudenell@gmail.com>
|
||||
@@ -83,13 +96,13 @@ Stig Telfer <stelfer@cray.com>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
tpgxyz <tpgxyz@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Alex Harpin <development@landsofshadow.co.uk>
|
||||
Ankit Kumar <ankit@linux.vnet.ibm.com>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Chao Fan <cfan@redhat.com>
|
||||
Daniel Cordero <dracut@0xdc.io>
|
||||
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Denis Silakov <dsilakov@virtuozzo.com>
|
||||
@@ -101,15 +114,21 @@ Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
Imran Haider <imran1008@gmail.com>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
Jan Macku <jamacku@redhat.com>
|
||||
Jiri Konecny <jkonecny@redhat.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Julian Wolf <juwolf@suse.com>
|
||||
Koen Kooi <koen@dominion.thruhere.net>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Michal Koutný <mkoutny@suse.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Pedro Monreal <pmgdeb@gmail.com>
|
||||
Pingfan Liu <piliu@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Robert LeBlanc <robert@leblancnet.us>
|
||||
@@ -117,18 +136,27 @@ Robert Scheck <robert@fedoraproject.org>
|
||||
Stefan Berger <stefanb@us.ibm.com>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Till Maas <opensource@till.name>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
Tony Asleson <tasleson@redhat.com>
|
||||
Topi Miettinen <toiwoton@gmail.com>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Alexander Kurtz <alexander@kurtz.be>
|
||||
Alexander Miroshnichenko <alex@millerson.name>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Alexey Kodanev <alexey.kodanev@oracle.com>
|
||||
Andreas Schwab <schwab@suse.de>
|
||||
Andreas Stieger <astieger@suse.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Arnaud Rebillout <arnaud.rebillout@collabora.com>
|
||||
Artem Savkov <asavkov@redhat.com>
|
||||
Attila Bruncsak <bruncsak@users.noreply.github.com>
|
||||
B. Wilson <x@wilsonb.com>
|
||||
Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Brian C. Lane <bcl@brianlane.com>
|
||||
Bruno E. O. Meneguele <bmeneg@redhat.com>
|
||||
Bryn M. Reeves <bmr@redhat.com>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Carlo Caione <carlo@endlessm.com>
|
||||
@@ -141,12 +169,16 @@ David Disseldorp <ddiss@suse.de>
|
||||
David Michael <david.michael@coreos.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Derek Higgins <derekh@redhat.com>
|
||||
Donovan Tremura <neurognostic@protonmail.ch>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Dusty Mabe <dusty@dustymabe.com>
|
||||
Elan Ruusamäe <glen@delfi.ee>
|
||||
Enno Boland <g@s01.de>
|
||||
Eugene S. Sobolev <sobolev@protei.ru>
|
||||
Eugene Syromiatnikov <esyr@redhat.com>
|
||||
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
|
||||
Florian Gamböck <mail@floga.de>
|
||||
Frank Deng <frank.deng@oracle.com>
|
||||
François Cami <fcami@fedoraproject.org>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
@@ -154,11 +186,14 @@ HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
|
||||
Hendrik Brueckner <brueckner@linux.ibm.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
Hiroaki Mizuguchi <hiroaki-m@iij.ad.jp>
|
||||
Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Hui Wang <john.wanghui@huawei.com>
|
||||
Ignaz Forster <iforster@suse.com>
|
||||
Jacob Wen <jian.w.wen@oracle.com>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jason Dana <jasondana@quarksecurity.com>
|
||||
Jens Heise <46450477+heisej@users.noreply.github.com>
|
||||
Jeremy Linton <lintonrjeremy@gmail.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
@@ -166,19 +201,21 @@ Johannes Thumshirn <jthumshirn@suse.com>
|
||||
Jonas Jonsson <jonas@websystem.se>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lee Duncan <lduncan@suse.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lianbo Jiang <lijiang@redhat.com>
|
||||
Lucas C. Villa Real <lucasvr@gmail.com>
|
||||
Major Hayden <major@mhtx.net>
|
||||
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
Marian Csontos <mcsontos@redhat.com>
|
||||
Mark Fasheh <mfasheh@suse.de>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Matthew Thode <mthode@mthode.org>
|
||||
Mei Liu <liumbj@linux.vnet.ibm.com>
|
||||
Michael Chapman <mike@very.puzzling.org>
|
||||
Michael McCracken <michael.mccracken@gmail.com>
|
||||
Michal Koutný <mkoutny@suse.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Michal Sekletar <msekleta@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
@@ -186,16 +223,20 @@ Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nicolas Porcel <nicolasporcel06@gmail.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
Ondrej Dubaj <odubaj@redhat.com>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Patrick Talbert <ptalbert@redhat.com>
|
||||
Paul Robins <exp@users.noreply.github.com>
|
||||
Pavel Zhukov <pzhukov@redhat.com>
|
||||
Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
|
||||
Pekka Wallendahl <wyrmiyu@gmail.com>
|
||||
Petr Tesarik <ptesarik@suse.com>
|
||||
Petr Vorel <pvorel@suse.cz>
|
||||
Prarit Bhargava <prarit@redhat.com>
|
||||
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Renaud Métrich <rmetrich@redhat.com>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
@@ -204,12 +245,12 @@ Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Stijn Hoop <stijn@sandcat.nl>
|
||||
Sullivan (CTR), Austin <austin.sullivan.ctr@progeny.net>
|
||||
Thierry Vignaud <thierry.vignaud@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
Thomas Abraham <tabraham@suse.com>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tobias Klauser <tklauser@distanz.ch>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Tong Li <tonli@redhat.com>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
@@ -218,11 +259,19 @@ Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
|
||||
Ziyue Yang <ziyang@redhat.com>
|
||||
gaoyi <ymuemc@163.com>
|
||||
honza801 <honza801@gmail.com>
|
||||
jbash aka John Bashinski <jbash@velvet.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
johannes <johannes.brechtmann@gmail.com>
|
||||
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
|
||||
logan <logancaldwell23@gmail.com>
|
||||
masem <matej.semian@gmail.com>
|
||||
maximilian attems <max@stro.at>
|
||||
nabijaczleweli <nabijaczleweli@gmail.com>
|
||||
privb0x23 <privb0x23@users.noreply.github.com>
|
||||
q66 <daniel@octaforge.org>
|
||||
tpg <tpgxyz@gmail.com>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
Đoàn Trần Công Danh <congdanhqx@gmail.com>
|
||||
Дамјан Георгиевски <gdamjan@gmail.com>
|
||||
|
11
Makefile
11
Makefile
@@ -62,7 +62,7 @@ install/util.o: install/util.c install/util.h install/macro.h install/log.h
|
||||
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
|
||||
|
||||
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS)
|
||||
|
||||
logtee: logtee.c
|
||||
$(CC) $(LDFLAGS) -o $@ $<
|
||||
@@ -92,13 +92,16 @@ endif
|
||||
|
||||
%.xml: %.asc
|
||||
@rm -f -- "$@"
|
||||
asciidoc -d manpage -b docbook -o "$@" $<
|
||||
asciidoc -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" -d manpage -b docbook -o "$@" $<
|
||||
|
||||
dracut.8: dracut.usage.asc dracut.8.asc
|
||||
|
||||
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
@rm -f -- dracut.xml
|
||||
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
|
||||
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
|
||||
-a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" \
|
||||
-a numbered \
|
||||
-d book -b docbook -o dracut.xml dracut.asc
|
||||
@rm -f -- dracut.html
|
||||
xsltproc -o dracut.html --xinclude -nonet \
|
||||
--stringparam custom.css.source dracut.css \
|
||||
@@ -207,7 +210,7 @@ dracut-$(DRACUT_MAIN_VERSION).tar.xz: doc syncheck
|
||||
rm -f -- dracut-$(DRACUT_MAIN_VERSION).tar
|
||||
|
||||
rpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
rpmbuild=$$(mktemp -d -p /var/tmp rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \
|
||||
LC_MESSAGES=C $$src/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
(cd "$$rpmbuild"; \
|
||||
|
65
NEWS
65
NEWS
@@ -1,3 +1,68 @@
|
||||
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 <FILE>`
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
|
70
README.cross
Normal file
70
README.cross
Normal file
@@ -0,0 +1,70 @@
|
||||
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
|
||||
|
||||
Extensions to be used with Yocto
|
||||
================================
|
||||
|
||||
examples/yocto/classes/dracut.bbclass:
|
||||
Bitbake class for running dracut during the "do_rootfs" stage of
|
||||
creating a distribution image and from the postinstall script of
|
||||
a package. A kernel recipe needs this line to activate it:
|
||||
|
||||
inherit dracut
|
||||
|
||||
examples/yocto/postinst-intercepts/execute_dracut
|
||||
The "intercept" script used during "do_rootfs" mentioned above.
|
||||
|
||||
examples/yocto/recipes/cross-compiler-ldd_git.bb
|
||||
Package recipe for the cross-compiler-ldd script from the above link.
|
||||
|
||||
All the above three need to be added to a Yocto layer to their
|
||||
proper locations.
|
||||
|
||||
They were tested on Yocto 2.7 with MACHINE="intel-core2-32" and
|
||||
MACHINE="genericx86-64".
|
@@ -4,6 +4,8 @@ dracut
|
||||
dracut is an event driven initramfs infrastructure.
|
||||
|
||||
[](https://travis-ci.org/dracutdevs/dracut)
|
||||

|
||||

|
||||
|
||||
dracut (the tool) is used to create an initramfs image by copying tools
|
||||
and files from an installed system and combining it with the
|
||||
|
44
configure
vendored
44
configure
vendored
@@ -7,6 +7,7 @@ prefix=/usr
|
||||
|
||||
enable_documentation=yes
|
||||
|
||||
CC="${CC:-cc}"
|
||||
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
|
||||
|
||||
# Little helper function for reading args from the commandline.
|
||||
@@ -57,6 +58,48 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF >conftest.c
|
||||
#include <fts.h>
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
${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 <fts.h>
|
||||
int main(void) {
|
||||
fts_open(0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
found=no
|
||||
for lib in "-lc" "-lfts"; do
|
||||
${CC} $CFLAGS -Wl,$lib $LDFLAGS conftest.c >/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}
|
||||
@@ -68,6 +111,7 @@ 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
|
||||
|
||||
{
|
||||
|
@@ -40,19 +40,43 @@ 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() {
|
||||
if [[ -z ${1##/*} ]]; then
|
||||
if [[ -x $1 ]] || { [[ "$1" == *.so* ]] && ldd "$1" &>/dev/null; }; then
|
||||
local _delim
|
||||
local l
|
||||
local p
|
||||
[[ -z ${1##/*} ]] || _delim="/"
|
||||
|
||||
if [[ "$1" == *.so* ]]; then
|
||||
for l in libdirs ; do
|
||||
if { $DRACUT_LDD "$dracutsysrootdir$l$_delim$1" &>/dev/null; }; then
|
||||
printf "%s\n" "$1"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
if { $DRACUT_LDD "$dracutsysrootdir$_delim$1" &>/dev/null; }; then
|
||||
printf "%s\n" "$1"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
if [[ "$1" == */* ]]; then
|
||||
if [[ -L $dracutsysrootdir$_delim$1 ]] || [[ -x $dracutsysrootdir$_delim$1 ]]; then
|
||||
printf "%s\n" "$1"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
for p in $DRACUT_PATH ; do
|
||||
if [[ -L $dracutsysrootdir$p$_delim$1 ]] || [[ -x $dracutsysrootdir$p$_delim$1 ]]; then
|
||||
printf "%s\n" "$1"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
[[ -n "$dracutsysrootdir" ]] && return 1
|
||||
type -P "${1##*/}"
|
||||
}
|
||||
|
||||
ldconfig_paths()
|
||||
{
|
||||
ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
|
||||
$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.
|
||||
@@ -592,6 +616,12 @@ check_vol_slaves_all() {
|
||||
# strip space
|
||||
_vg="${_vg//[[:space:]]/}"
|
||||
if [[ $_vg ]]; then
|
||||
# when filter/global_filter is set, lvm may be failed
|
||||
lvm lvs --noheadings -o vg_name $_vg 2>/dev/null 1>/dev/null
|
||||
if [ $? -ne 0 ]; 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)
|
||||
@@ -627,9 +657,9 @@ check_kernel_config()
|
||||
{
|
||||
local _config_opt="$1"
|
||||
local _config_file
|
||||
[[ -f /boot/config-$kernel ]] \
|
||||
[[ -f $dracutsysrootdir/boot/config-$kernel ]] \
|
||||
&& _config_file="/boot/config-$kernel"
|
||||
[[ -f /lib/modules/$kernel/config ]] \
|
||||
[[ -f $dracutsysrootdir/lib/modules/$kernel/config ]] \
|
||||
&& _config_file="/lib/modules/$kernel/config"
|
||||
|
||||
# no kernel config file, so return true
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#
|
||||
export LC_MESSAGES=C
|
||||
|
||||
if [[ "$EUID" = "0" ]]; then
|
||||
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"
|
||||
@@ -57,7 +57,7 @@ if ! [[ $kernel ]]; then
|
||||
export kernel
|
||||
fi
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
srcmods="$dracutsysrootdir/lib/modules/$kernel/"
|
||||
|
||||
[[ $drivers_dir ]] && {
|
||||
if ! command -v kmod &>/dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
|
||||
@@ -79,17 +79,21 @@ export srcmods
|
||||
export hookdirs
|
||||
}
|
||||
|
||||
DRACUT_LDD=${DRACUT_LDD:-ldd}
|
||||
DRACUT_TESTBIN=${DRACUT_TESTBIN:-/bin/sh}
|
||||
DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig}
|
||||
|
||||
. $dracutbasedir/dracut-functions.sh
|
||||
|
||||
# Detect lib paths
|
||||
if ! [[ $libdirs ]] ; then
|
||||
if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
|
||||
&& [[ -d /lib64 ]]; then
|
||||
if [[ "$($DRACUT_LDD $dracutsysrootdir$DRACUT_TESTBIN)" == */lib64/* ]] &>/dev/null \
|
||||
&& [[ -d $dracutsysrootdir/lib64 ]]; then
|
||||
libdirs+=" /lib64"
|
||||
[[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
|
||||
[[ -d $dracutsysrootdir/usr/lib64 ]] && libdirs+=" /usr/lib64"
|
||||
else
|
||||
libdirs+=" /lib"
|
||||
[[ -d /usr/lib ]] && libdirs+=" /usr/lib"
|
||||
[[ -d $dracutsysrootdir/usr/lib ]] && libdirs+=" /usr/lib"
|
||||
fi
|
||||
|
||||
libdirs+=" $(ldconfig_paths)"
|
||||
@@ -168,7 +172,18 @@ elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]];
|
||||
DRACUT_INSTALL=$dracutbasedir/install/dracut-install
|
||||
fi
|
||||
|
||||
if ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
# 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 ]] && ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
dfatal "dracut-install not found!"
|
||||
exit 10
|
||||
fi
|
||||
@@ -176,15 +191,15 @@ fi
|
||||
if [[ $hostonly == "-h" ]]; then
|
||||
if ! [[ $DRACUT_KERNEL_MODALIASES ]] || ! [[ -f "$DRACUT_KERNEL_MODALIASES" ]]; then
|
||||
export DRACUT_KERNEL_MODALIASES="${DRACUT_TMPDIR}/modaliases"
|
||||
$DRACUT_INSTALL ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_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
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@" || :
|
||||
}
|
||||
|
||||
inst() {
|
||||
@@ -194,8 +209,8 @@ inst() {
|
||||
shift
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_simple() {
|
||||
@@ -206,8 +221,8 @@ inst_simple() {
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_symlink() {
|
||||
@@ -218,15 +233,15 @@ inst_symlink() {
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -L $1 ]] || return 1
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_multiple() {
|
||||
local _ret
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
_ret=$?
|
||||
(($_ret != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
(($_ret != 0)) && 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
|
||||
}
|
||||
|
||||
@@ -243,8 +258,9 @@ dracut_instmods() {
|
||||
done
|
||||
|
||||
$DRACUT_INSTALL \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@"
|
||||
(($? != 0)) && (($_silent == 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
(($? != 0)) && (($_silent == 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
}
|
||||
|
||||
inst_library() {
|
||||
@@ -255,24 +271,24 @@ inst_library() {
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_binary() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
inst_script() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
inst_fsck_help() {
|
||||
local _helper="/run/dracut/fsck/fsck_help_$1.txt"
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper || :
|
||||
}
|
||||
|
||||
# Use with form hostonly="$(optional_hostonly)" inst_xxxx <args>
|
||||
@@ -369,12 +385,12 @@ inst_rule_group_owner() {
|
||||
|
||||
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:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep -E "^$i:" $dracutsysrootdir/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
fi
|
||||
done
|
||||
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:" /etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
grep -E "^$i:" $dracutsysrootdir/etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -394,7 +410,7 @@ inst_rules() {
|
||||
inst_dir "$_target"
|
||||
for _rule in "$@"; do
|
||||
if [ "${_rule#/}" = "$_rule" ]; then
|
||||
for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do
|
||||
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"
|
||||
@@ -403,7 +419,7 @@ inst_rules() {
|
||||
inst_simple "$_found"
|
||||
done
|
||||
fi
|
||||
for r in '' $dracutbasedir/rules.d/; do
|
||||
for r in '' $dracutsysrootdir$dracutbasedir/rules.d/; do
|
||||
# skip rules without an absolute path
|
||||
[[ "${r}$_rule" != /* ]] && continue
|
||||
[[ -f ${r}$_rule ]] || continue
|
||||
@@ -445,6 +461,14 @@ inst_rules_wildcard() {
|
||||
|
||||
prepare_udev_rules() {
|
||||
[ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
|
||||
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"
|
||||
@@ -525,7 +549,7 @@ inst_libdir_file() {
|
||||
for _i in "$@"; do
|
||||
for _f in "$_dir"/$_i; do
|
||||
[[ "$_f" =~ $_pattern ]] || continue
|
||||
[[ -e "$_f" ]] && _files+="$_f "
|
||||
[[ -e "$dracutsysrootdir$_f" ]] && _files+="$_f "
|
||||
done
|
||||
done
|
||||
done
|
||||
@@ -533,7 +557,7 @@ inst_libdir_file() {
|
||||
for _dir in $libdirs; do
|
||||
for _i in "$@"; do
|
||||
for _f in "$_dir"/$_i; do
|
||||
[[ -e "$_f" ]] && _files+="$_f "
|
||||
[[ -e "$dracutsysrootdir$_f" ]] && _files+="$_f "
|
||||
done
|
||||
done
|
||||
done
|
||||
@@ -947,6 +971,7 @@ instmods() {
|
||||
|
||||
$DRACUT_INSTALL \
|
||||
${initdir:+-D "$initdir"} \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${loginstall:+-L "$loginstall"} \
|
||||
${hostonly:+-H} \
|
||||
${omit_drivers:+-N "$omit_drivers"} \
|
||||
@@ -960,6 +985,7 @@ instmods() {
|
||||
derror "FAILED: " \
|
||||
$DRACUT_INSTALL \
|
||||
${initdir:+-D "$initdir"} \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${loginstall:+-L "$loginstall"} \
|
||||
${hostonly:+-H} \
|
||||
${omit_drivers:+-N "$omit_drivers"} \
|
||||
@@ -1006,4 +1032,4 @@ is_qemu_virtualized() {
|
||||
[[ "$vendor" == "Bochs" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
99
dracut.8.asc
99
dracut.8.asc
@@ -3,6 +3,7 @@ DRACUT(8)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
@@ -284,6 +285,15 @@ Default:
|
||||
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
|
||||
@@ -507,6 +517,10 @@ will not be able to boot.
|
||||
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _$prefix/lib/gummiboot/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>_
|
||||
@@ -517,6 +531,91 @@ 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**.
|
||||
|
||||
_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_::
|
||||
|
10
dracut.asc
10
dracut.asc
@@ -1,8 +1,8 @@
|
||||
dracut
|
||||
======
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
v3.0, October 2013
|
||||
|
||||
dracut {mainversion}
|
||||
====================
|
||||
:author: Harald Hoyer
|
||||
:email: harald@redhat.com
|
||||
:revnumber: {version}
|
||||
:language: bash
|
||||
|
||||
= Introduction
|
||||
|
@@ -3,6 +3,7 @@ DRACUT.BOOTUP(7)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
@@ -3,6 +3,7 @@ DRACUT.CMDLINE(7)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
@@ -318,22 +319,37 @@ crypto LUKS
|
||||
|
||||
crypto LUKS - key on removable device support
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
**rd.luks.key=**__<keypath>__:__<keydev>__:__<luksdev>__::
|
||||
_keypath_ is a path to key file to look for. It's REQUIRED. When _keypath_
|
||||
ends with '.gpg' it's considered to be key encrypted symmetrically with GPG.
|
||||
You will be prompted for password on boot. GPG support comes with
|
||||
'crypt-gpg' module which needs to be added explicitly.
|
||||
|
||||
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_ is a device on which key file resides. It might be kernel name of
|
||||
devices (should start with "/dev/"), UUID (prefixed with "UUID=") or label
|
||||
(prefix with "LABEL="). You don't have to specify 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 not present, all block
|
||||
devices will be probed, which may significantly increase boot time.
|
||||
_<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 applied for that 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:
|
||||
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:
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
@@ -342,27 +358,40 @@ rd.luks.key=/foo/bar.key
|
||||
--
|
||||
+
|
||||
As you see, you can skip colons in such a case.
|
||||
+
|
||||
|
||||
[NOTE]
|
||||
===============================
|
||||
dracut pipes key to cryptsetup with _-d -_ argument, therefore you need to pipe
|
||||
to cryptsetup luksFormat with _-d -_, too!
|
||||
Your LUKS partition must match your key file.
|
||||
|
||||
Here follows example for key encrypted with GPG:
|
||||
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):
|
||||
|
||||
[listing]
|
||||
--
|
||||
gpg --quiet --decrypt rootkey.gpg | \
|
||||
cryptsetup -d - -v --cipher serpent-cbc-essiv:sha256 \
|
||||
--key-size 256 luksFormat /dev/sda3
|
||||
cryptsetup --batch-mode --key-file - \
|
||||
luksFormat /dev/sda47
|
||||
--
|
||||
|
||||
If you use plain keys, just add path to _-d_ option:
|
||||
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:
|
||||
|
||||
[listing]
|
||||
--
|
||||
cryptsetup -d rootkey.key -v --cipher serpent-cbc-essiv:sha256 \
|
||||
--key-size 256 luksFormat /dev/sda3
|
||||
head -32c /dev/urandom > rootkey.key
|
||||
cryptsetup --batch-mode --key-file rootkey.key \
|
||||
luksFormat /dev/sda47
|
||||
--
|
||||
===============================
|
||||
|
||||
@@ -645,7 +674,7 @@ NFS
|
||||
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 5 seconds.
|
||||
Wait <seconds> until carrier is recognized. Default is 10 seconds.
|
||||
|
||||
CIFS
|
||||
~~~
|
||||
@@ -757,6 +786,9 @@ 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.
|
||||
|
||||
|
@@ -3,6 +3,7 @@ DRACUT.CONF(5)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
@@ -204,6 +205,9 @@ provide a valid _/etc/fstab_.
|
||||
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _/usr/lib/gummiboot/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.
|
||||
|
@@ -3,6 +3,7 @@ DRACUT.MODULES(7)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
247
dracut.sh
247
dracut.sh
@@ -37,7 +37,8 @@ readonly dracut_cmd="$(readlink -f $0)"
|
||||
set -o pipefail
|
||||
|
||||
usage() {
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
[[ $sysroot_l ]] && dracutsysrootdir="$sysroot_l"
|
||||
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut
|
||||
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
||||
. $dracutbasedir/dracut-version.sh
|
||||
fi
|
||||
@@ -62,7 +63,7 @@ EOF
|
||||
}
|
||||
|
||||
long_usage() {
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut
|
||||
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
||||
. $dracutbasedir/dracut-version.sh
|
||||
fi
|
||||
@@ -140,6 +141,7 @@ Creates initial ramdisk images for preloading modules
|
||||
from. Default: /etc/dracut.conf.d
|
||||
--tmpdir [DIR] Temporary directory to be used instead of default
|
||||
/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/lib/dracut/modules.d.
|
||||
@@ -182,8 +184,8 @@ Creates initial ramdisk images for preloading modules
|
||||
--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.
|
||||
--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
|
||||
@@ -234,7 +236,12 @@ Creates initial ramdisk images for preloading modules
|
||||
--uefi Create an UEFI executable with the kernel cmdline and
|
||||
kernel combined
|
||||
--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
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
|
||||
@@ -312,7 +319,7 @@ rearrange_params()
|
||||
set -- "${newat[@]}" # Set new $@
|
||||
|
||||
TEMP=$(unset POSIXLY_CORRECT; getopt \
|
||||
-o "a:m:o:d:I:k:c:L:fvqlHhMN" \
|
||||
-o "a:m:o:d:I:k:c:r:L:fvqlHhMN" \
|
||||
--long kver: \
|
||||
--long add: \
|
||||
--long force-add: \
|
||||
@@ -338,6 +345,7 @@ rearrange_params()
|
||||
--long conf: \
|
||||
--long confdir: \
|
||||
--long tmpdir: \
|
||||
--long sysroot: \
|
||||
--long stdlog: \
|
||||
--long compress: \
|
||||
--long prefix: \
|
||||
@@ -395,6 +403,7 @@ rearrange_params()
|
||||
--long loginstall: \
|
||||
--long uefi \
|
||||
--long uefi-stub: \
|
||||
--long uefi-splash-image: \
|
||||
--long kernel-image: \
|
||||
--long no-hostonly-i18n \
|
||||
--long hostonly-i18n \
|
||||
@@ -511,6 +520,7 @@ while :; do
|
||||
-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;;
|
||||
@@ -592,6 +602,8 @@ while :; do
|
||||
--uefi) uefi="yes";;
|
||||
--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)
|
||||
@@ -617,6 +629,8 @@ while (($# > 0)); do
|
||||
shift
|
||||
done
|
||||
|
||||
[[ $sysroot_l ]] && dracutsysrootdir="$sysroot_l"
|
||||
|
||||
if [[ $regenerate_all == "yes" ]]; then
|
||||
ret=0
|
||||
if [[ $kernel ]]; then
|
||||
@@ -635,7 +649,7 @@ if [[ $regenerate_all == "yes" ]]; then
|
||||
unset dracut_args[$i]
|
||||
done
|
||||
|
||||
cd /lib/modules
|
||||
cd $dracutsysrootdir/lib/modules
|
||||
for i in *; do
|
||||
[[ -f $i/modules.dep ]] || [[ -f $i/modules.dep.bin ]] || continue
|
||||
"$dracut_cmd" --kver="$i" "${dracut_args[@]}"
|
||||
@@ -669,14 +683,14 @@ export DRACUT_LOG_LEVEL=warning
|
||||
debug=yes
|
||||
}
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/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="/etc/dracut.conf"
|
||||
conffile="$dracutsysrootdir/etc/dracut.conf"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -684,7 +698,7 @@ if [[ ! -d $confdir ]]; then
|
||||
if [[ $allowlocal ]]; then
|
||||
confdir="$dracutbasedir/dracut.conf.d"
|
||||
else
|
||||
confdir="/etc/dracut.conf.d"
|
||||
confdir="$dracutsysrootdir/etc/dracut.conf.d"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -700,8 +714,8 @@ DRACUT_PATH=${DRACUT_PATH:-/sbin /bin /usr/sbin /usr/bin}
|
||||
|
||||
for i in $DRACUT_PATH; do
|
||||
rl=$i
|
||||
if [ -L "$i" ]; then
|
||||
rl=$(readlink -f $i)
|
||||
if [ -L "$dracutsysrootdir$i" ]; then
|
||||
rl=$(readlink -f $dracutsysrootdir$i)
|
||||
fi
|
||||
if [[ "$NPATH" != *:$rl* ]] ; then
|
||||
NPATH+=":$rl"
|
||||
@@ -748,10 +762,10 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $use_fstab_l ]] && use_fstab=$use_fstab_l
|
||||
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
||||
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
[[ $fw_dir ]] || fw_dir="/lib/firmware/updates:/lib/firmware:/lib/firmware/$kernel"
|
||||
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut
|
||||
[[ $fw_dir ]] || fw_dir="$dracutsysrootdir/lib/firmware/updates:$dracutsysrootdir/lib/firmware:$dracutsysrootdir/lib/firmware/$kernel"
|
||||
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
|
||||
[[ $tmpdir ]] || tmpdir=/var/tmp
|
||||
[[ $tmpdir ]] || tmpdir=$dracutsysrootdir/var/tmp
|
||||
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
|
||||
[[ $compress_l ]] && compress=$compress_l
|
||||
[[ $show_modules_l ]] && show_modules=$show_modules_l
|
||||
@@ -759,16 +773,20 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $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_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 /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
[[ -f $dracutsysrootdir/etc/machine-id ]] && read MACHINE_ID < $dracutsysrootdir/etc/machine-id
|
||||
fi
|
||||
|
||||
if [[ $uefi == "yes" ]]; then
|
||||
@@ -782,27 +800,34 @@ if ! [[ $outfile ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BUILD_ID=$(cat /etc/os-release /usr/lib/os-release \
|
||||
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 [[ -d /efi ]] && mountpoint -q /efi; then
|
||||
efidir=/efi/EFI
|
||||
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 /boot/efi/EFI ]] && mountpoint -q /boot/efi; then
|
||||
if [[ -d $dracutsysrootdir/boot/efi/EFI ]]; then
|
||||
efidir=/boot/efi/EFI
|
||||
fi
|
||||
fi
|
||||
mkdir -p "$efidir/Linux"
|
||||
outfile="$efidir/Linux/linux-$kernel${MACHINE_ID:+-${MACHINE_ID}}${BUILD_ID:+-${BUILD_ID}}.efi"
|
||||
mkdir -p "$dracutsysrootdir$efidir/Linux"
|
||||
outfile="$dracutsysrootdir$efidir/Linux/linux-$kernel${MACHINE_ID:+-${MACHINE_ID}}${BUILD_ID:+-${BUILD_ID}}.efi"
|
||||
else
|
||||
if [[ -e "/boot/vmlinuz-$kernel" ]]; then
|
||||
if [[ -e "$dracutsysrootdir/boot/vmlinuz-$kernel" ]]; then
|
||||
outfile="/boot/initramfs-$kernel.img"
|
||||
elif [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
|
||||
outfile="/boot/${MACHINE_ID}/$kernel/initrd"
|
||||
elif [[ $MACHINE_ID ]] && ( [[ -d $dracutsysrootdir/boot/${MACHINE_ID} ]] || [[ -L $dracutsysrootdir/boot/${MACHINE_ID} ]] ); then
|
||||
outfile="$dracutsysrootdir/boot/${MACHINE_ID}/$kernel/initrd"
|
||||
else
|
||||
outfile="/boot/initramfs-$kernel.img"
|
||||
outfile="$dracutsysrootdir/boot/initramfs-$kernel.img"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -822,13 +847,24 @@ if [[ -n "$logfile" ]];then
|
||||
fi
|
||||
|
||||
# handle compression options.
|
||||
if [[ $_no_compress_l = "cat" ]]; then
|
||||
compress="cat"
|
||||
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
|
||||
|
||||
if ! [[ $compress ]]; then
|
||||
# check all known compressors, if none specified
|
||||
for i in pigz gzip lz4 lzop zstd lzma xz lbzip2 bzip2 cat; do
|
||||
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
|
||||
@@ -841,35 +877,35 @@ fi
|
||||
# choose the right arguments for the compressor
|
||||
case $compress in
|
||||
bzip2|lbzip2)
|
||||
if [[ "$compress" = lbzip2 ]] || command -v lbzip2 &>/dev/null; then
|
||||
compress="lbzip2 -9"
|
||||
if [[ "$compress" = lbzip2 ]] || command -v $DRACUT_COMPRESS_LBZIP2 &>/dev/null; then
|
||||
compress="$DRACUT_COMPRESS_LBZIP2 -9"
|
||||
else
|
||||
compress="bzip2 -9"
|
||||
compress="$DRACUT_COMPRESS_BZIP2 -9"
|
||||
fi
|
||||
;;
|
||||
lzma)
|
||||
compress="lzma -9 -T0"
|
||||
compress="$DRACUT_COMPRESS_LZMA -9 -T0"
|
||||
;;
|
||||
xz)
|
||||
compress="xz --check=crc32 --lzma2=dict=1MiB -T0"
|
||||
compress="$DRACUT_COMPRESS_XZ --check=crc32 --lzma2=dict=1MiB -T0"
|
||||
;;
|
||||
gzip|pigz)
|
||||
if [[ "$compress" = pigz ]] || command -v pigz &>/dev/null; then
|
||||
compress="pigz -9 -n -T -R"
|
||||
elif command -v gzip &>/dev/null && gzip --help 2>&1 | grep -q rsyncable; then
|
||||
compress="gzip -n -9 --rsyncable"
|
||||
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="gzip -n -9"
|
||||
compress="$DRACUT_COMPRESS_GZIP -n -9"
|
||||
fi
|
||||
;;
|
||||
lzo|lzop)
|
||||
compress="lzop -9"
|
||||
compress="$DRACUT_COMPRESS_LZOP -9"
|
||||
;;
|
||||
lz4)
|
||||
compress="lz4 -l -9"
|
||||
compress="$DRACUT_COMPRESS_LZ4 -l -9"
|
||||
;;
|
||||
zstd)
|
||||
compress="zstd -15 -q -T0"
|
||||
compress="$DRACUT_COMPRESS_ZSTD -15 -q -T0"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -891,11 +927,32 @@ 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: $(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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
@@ -920,7 +977,7 @@ if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_t
|
||||
mkdir "$early_cpio_dir"
|
||||
fi
|
||||
|
||||
export DRACUT_RESOLVE_LAZY="1"
|
||||
[[ -n "$dracutsysrootdir" || "$noexec" ]] || export DRACUT_RESOLVE_LAZY="1"
|
||||
|
||||
if [[ $print_cmdline ]]; then
|
||||
stdloglvl=0
|
||||
@@ -949,8 +1006,8 @@ if [[ $no_kernel != yes ]] && ! [[ -d $srcmods ]]; then
|
||||
fi
|
||||
|
||||
if ! [[ $print_cmdline ]]; then
|
||||
inst /bin/sh
|
||||
if ! $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; 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
|
||||
@@ -1010,12 +1067,12 @@ esac
|
||||
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
|
||||
|
||||
|
||||
[[ -d $systemdutildir ]] \
|
||||
[[ -d $dracutsysrootdir$systemdutildir ]] \
|
||||
|| systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
|
||||
|
||||
if ! [[ -d "$systemdutildir" ]]; then
|
||||
[[ -e /lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd
|
||||
[[ -e /usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd
|
||||
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
|
||||
|
||||
|
||||
@@ -1093,8 +1150,8 @@ if [[ ! $print_cmdline ]]; then
|
||||
|
||||
if ! [[ -s $uefi_stub ]]; then
|
||||
for uefi_stub in \
|
||||
"${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" \
|
||||
"/usr/lib/gummiboot/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"; do
|
||||
$dracutsysrootdir"${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" \
|
||||
"$dracutsysrootdir/usr/lib/gummiboot/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"; do
|
||||
[[ -s $uefi_stub ]] || continue
|
||||
break
|
||||
done
|
||||
@@ -1105,7 +1162,7 @@ if [[ ! $print_cmdline ]]; then
|
||||
fi
|
||||
|
||||
if ! [[ $kernel_image ]]; then
|
||||
for kernel_image in "/lib/modules/$kernel/vmlinuz" "/boot/vmlinuz-$kernel"; do
|
||||
for kernel_image in "$dracutsysrootdir/lib/modules/$kernel/vmlinuz" "$dracutsysrootdir/boot/vmlinuz-$kernel"; do
|
||||
[[ -s "$kernel_image" ]] || continue
|
||||
break
|
||||
done
|
||||
@@ -1218,7 +1275,7 @@ if [[ $hostonly ]] && [[ "$hostonly_default_device" != "no" ]]; then
|
||||
"/boot/zipl" \
|
||||
;
|
||||
do
|
||||
mp=$(readlink -f "$mp")
|
||||
mp=$(readlink -f "$dracutsysrootdir$mp")
|
||||
mountpoint "$mp" >/dev/null 2>&1 || continue
|
||||
_dev=$(find_block_device "$mp")
|
||||
_bdev=$(readlink -f "/dev/block/$_dev")
|
||||
@@ -1233,7 +1290,8 @@ if [[ $hostonly ]] && [[ "$hostonly_default_device" != "no" ]]; then
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then
|
||||
# TODO - with sysroot, /proc/swaps is not relevant
|
||||
if [[ -f /proc/swaps ]] && [[ -f $dracutsysrootdir/etc/fstab ]]; then
|
||||
while read dev type rest || [ -n "$dev" ]; do
|
||||
[[ -b $dev ]] || continue
|
||||
[[ "$type" == "partition" ]] || continue
|
||||
@@ -1247,7 +1305,7 @@ if [[ $hostonly ]] && [[ "$hostonly_default_device" != "no" ]]; then
|
||||
_d=$(expand_persistent_dev "$_d")
|
||||
[[ "$_d" -ef "$dev" ]] || continue
|
||||
|
||||
if [[ -f /etc/crypttab ]]; then
|
||||
if [[ -f $dracutsysrootdir/etc/crypttab ]]; then
|
||||
while read _mapper _a _p _o || [ -n "$_mapper" ]; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
|
||||
@@ -1256,19 +1314,19 @@ if [[ $hostonly ]] && [[ "$hostonly_default_device" != "no" ]]; then
|
||||
[[ "$_p" == /* ]] && [[ -f $_p ]] && continue 2
|
||||
# skip mkswap swap
|
||||
[[ $_o == *swap* ]] && continue 2
|
||||
done < /etc/crypttab
|
||||
done < $dracutsysrootdir/etc/crypttab
|
||||
fi
|
||||
|
||||
_dev="$(readlink -f "$dev")"
|
||||
push_host_devs "$_dev"
|
||||
swap_devs+=("$_dev")
|
||||
break
|
||||
done < /etc/fstab
|
||||
done < $dracutsysrootdir/etc/fstab
|
||||
done < /proc/swaps
|
||||
fi
|
||||
|
||||
# collect all "x-initrd.mount" entries from /etc/fstab
|
||||
if [[ -f /etc/fstab ]]; then
|
||||
if [[ -f $dracutsysrootdir/etc/fstab ]]; then
|
||||
while read _d _m _t _o _r || [ -n "$_d" ]; do
|
||||
[[ "$_d" == \#* ]] && continue
|
||||
[[ $_d ]] || continue
|
||||
@@ -1283,7 +1341,7 @@ if [[ $hostonly ]] && [[ "$hostonly_default_device" != "no" ]]; then
|
||||
push_host_devs "$i"
|
||||
done
|
||||
fi
|
||||
done < /etc/fstab
|
||||
done < $dracutsysrootdir/etc/fstab
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1328,29 +1386,29 @@ for dev in "${!host_fs_types[@]}"; do
|
||||
fi
|
||||
done
|
||||
|
||||
[[ -d $udevdir ]] \
|
||||
[[ -d $dracutsysrootdir$udevdir ]] \
|
||||
|| udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
|
||||
if ! [[ -d "$udevdir" ]]; then
|
||||
[[ -e /lib/udev/ata_id ]] && udevdir=/lib/udev
|
||||
[[ -e /usr/lib/udev/ata_id ]] && udevdir=/usr/lib/udev
|
||||
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 $systemdsystemunitdir ]] \
|
||||
[[ -d $dracutsysrootdir$systemdsystemunitdir ]] \
|
||||
|| systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2>/dev/null)
|
||||
|
||||
[[ -d "$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system
|
||||
[[ -d "$dracutsysrootdir$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system
|
||||
|
||||
[[ -d $systemdsystemconfdir ]] \
|
||||
[[ -d $dracutsysrootdir$systemdsystemconfdir ]] \
|
||||
|| systemdsystemconfdir=$(pkg-config systemd --variable=systemdsystemconfdir 2>/dev/null)
|
||||
|
||||
[[ -d "$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system
|
||||
[[ -d "$dracutsysrootdir$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system
|
||||
|
||||
[[ -d $tmpfilesdir ]] \
|
||||
[[ -d $dracutsysrootdir$tmpfilesdir ]] \
|
||||
|| tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null)
|
||||
|
||||
if ! [[ -d "$tmpfilesdir" ]]; then
|
||||
[[ -d /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d
|
||||
[[ -d /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
|
||||
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
|
||||
|
||||
export initdir dracutbasedir \
|
||||
@@ -1399,7 +1457,7 @@ fi
|
||||
# Create some directory structure first
|
||||
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"
|
||||
|
||||
[[ -h /lib ]] || mkdir -m 0755 -p "${initdir}${prefix}/lib"
|
||||
[[ -h $dracutsysrootdir/lib ]] || mkdir -m 0755 -p "${initdir}${prefix}/lib"
|
||||
[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"
|
||||
|
||||
if [[ $prefix ]]; then
|
||||
@@ -1501,7 +1559,7 @@ dinfo "*** Including modules done ***"
|
||||
|
||||
## final stuff that has to happen
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
if [[ $hostonly ]]; then
|
||||
if [[ $hostonly_mode = "strict" ]]; then
|
||||
cp "$DRACUT_KERNEL_MODALIASES" $initdir/lib/dracut/hostonly-kernel-modules.txt
|
||||
fi
|
||||
|
||||
@@ -1569,7 +1627,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
cat "$f" >> "${initdir}/etc/fstab"
|
||||
done
|
||||
|
||||
if [[ $systemdutildir ]]; then
|
||||
if [[ $dracutsysrootdir$systemdutildir ]]; then
|
||||
if [ -d ${initdir}/$systemdutildir ]; then
|
||||
mkdir -p ${initdir}/etc/conf.d
|
||||
{
|
||||
@@ -1583,7 +1641,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
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"} -R ${DRACUT_FIPS_MODE:+-f} --
|
||||
| xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${dracutsysrootdir:+-r "$dracutsysrootdir"} -R ${DRACUT_FIPS_MODE:+-f} --
|
||||
dinfo "*** Resolving executable dependencies done ***"
|
||||
fi
|
||||
|
||||
@@ -1593,7 +1651,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
|
||||
# libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
|
||||
for _dir in $libdirs; do
|
||||
for _f in "$_dir/libpthread.so"*; do
|
||||
for _f in "$dracutsysrootdir$_dir/libpthread.so"*; do
|
||||
[[ -e "$_f" ]] || continue
|
||||
inst_libdir_file "libgcc_s.so*"
|
||||
break 2
|
||||
@@ -1623,9 +1681,9 @@ for ((i=0; i < ${#include_src[@]}; i++)); do
|
||||
mkdir -m 0755 -p "$object_destdir"
|
||||
chmod --reference="$objectname" "$object_destdir"
|
||||
fi
|
||||
$DRACUT_CP -t "$object_destdir" "$objectname"/*
|
||||
$DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/*
|
||||
else
|
||||
$DRACUT_CP -t "$destdir" "$objectname"
|
||||
$DRACUT_CP -t "$destdir" "$dracutsysrootdir$objectname"
|
||||
fi
|
||||
done
|
||||
elif [[ -e $src ]]; then
|
||||
@@ -1638,10 +1696,10 @@ done
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# make sure that library links are correct and up to date
|
||||
for f in /etc/ld.so.conf /etc/ld.so.conf.d/*; do
|
||||
[[ -f $f ]] && inst_simple "$f"
|
||||
for f in $dracutsysrootdir/etc/ld.so.conf $dracutsysrootdir/etc/ld.so.conf.d/*; do
|
||||
[[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
|
||||
done
|
||||
if ! ldconfig -r "$initdir"; then
|
||||
if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
|
||||
if [[ $EUID = 0 ]]; then
|
||||
derror "ldconfig exited ungracefully"
|
||||
else
|
||||
@@ -1695,6 +1753,7 @@ if [[ $early_microcode = yes ]]; then
|
||||
if [[ $hostonly ]]; then
|
||||
_src=$(get_ucode_file)
|
||||
[[ $_src ]] || break
|
||||
[[ -r $_fwdir/$_fw/$_src ]] || _src="${_src}.early"
|
||||
[[ -r $_fwdir/$_fw/$_src ]] || break
|
||||
fi
|
||||
|
||||
@@ -1711,6 +1770,21 @@ if [[ $early_microcode = yes ]]; then
|
||||
create_early_cpio="yes"
|
||||
fi
|
||||
done
|
||||
if [[ ! -e "$_dest_dir/${ucode_dest[$idx]}" ]]; then
|
||||
cd "$early_cpio_dir/d"
|
||||
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
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1871,7 +1945,7 @@ fi
|
||||
|
||||
if dracut_module_included "squash"; then
|
||||
dinfo "*** Squashing the files inside the initramfs ***"
|
||||
mksquashfs $squash_dir $squash_img -comp xz -b 64K -Xdict-size 100% &> /dev/null
|
||||
mksquashfs $squash_dir $squash_img -no-xattrs -no-exports -noappend -always-use-fragments -comp xz -Xdict-size 100% -no-progress 1> /dev/null
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
dfatal "dracut: Failed making squash image"
|
||||
@@ -1957,13 +2031,16 @@ if [[ $uefi = yes ]]; then
|
||||
dinfo "Using UEFI kernel cmdline:"
|
||||
dinfo $(tr -d '\000' < "$uefi_outdir/cmdline.txt")
|
||||
|
||||
[[ -s /usr/lib/os-release ]] && uefi_osrelease="/usr/lib/os-release"
|
||||
[[ -s /etc/os-release ]] && uefi_osrelease="/etc/os-release"
|
||||
[[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
|
||||
[[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
|
||||
[[ -s "${dracutsysrootdir}${uefi_splash_image}" ]] && \
|
||||
uefi_splash_image="${dracutsysroot}${uefi_splash_image}" || unset uefi_splash_image
|
||||
|
||||
if objcopy \
|
||||
${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \
|
||||
--add-section .cmdline="${uefi_outdir}/cmdline.txt" --change-section-vma .cmdline=0x30000 \
|
||||
--add-section .linux="$kernel_image" --change-section-vma .linux=0x40000 \
|
||||
${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 \
|
||||
@@ -2003,7 +2080,7 @@ command -v restorecon &>/dev/null && restorecon -- "$outfile"
|
||||
# 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 test -d /run/systemd/system; then
|
||||
if test -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
|
||||
|
@@ -117,7 +117,8 @@ Requires: %{name} = %{version}-%{release}
|
||||
%endif
|
||||
Requires: iputils
|
||||
Requires: iproute
|
||||
Requires: dhclient
|
||||
Requires: (NetworkManager >= 1.20 or dhclient)
|
||||
Suggests: NetworkManager
|
||||
Obsoletes: dracut-generic < 008
|
||||
Provides: dracut-generic = %{version}-%{release}
|
||||
|
||||
@@ -222,6 +223,9 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
|
||||
# we do not support dash in the initramfs
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
|
||||
|
||||
# we do not support mksh in the initramfs
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00mksh
|
||||
|
||||
# remove gentoo specific modules
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
|
||||
|
||||
@@ -362,6 +366,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/90mdraid
|
||||
%{dracutlibdir}/modules.d/90multipath
|
||||
%{dracutlibdir}/modules.d/90stratis
|
||||
%{dracutlibdir}/modules.d/90ppcmac
|
||||
%{dracutlibdir}/modules.d/90qemu
|
||||
%{dracutlibdir}/modules.d/91crypt-gpg
|
||||
%{dracutlibdir}/modules.d/91crypt-loop
|
||||
|
116
examples/yocto/classes/dracut.bbclass
Normal file
116
examples/yocto/classes/dracut.bbclass
Normal file
@@ -0,0 +1,116 @@
|
||||
DRACUT_PN ??= "${PN}"
|
||||
|
||||
def dracut_compression_type(d):
|
||||
rdtype = d.getVar("INITRAMFS_FSTYPES", True).split('.')
|
||||
if len(rdtype) != 2:
|
||||
return ['','','']
|
||||
if rdtype[0] != 'cpio':
|
||||
return ['','','']
|
||||
cmptypes = [['gz','--gzip','gzip'],['bz2', '--bzip2','bzip2'],['lzma','--lzma','xz'],['xz','--xz','xz'],['lzo','--lzo','lzo'],['lz4','--lz4','lz4'],['zstd','--zstd','zstd']]
|
||||
for cmp in cmptypes:
|
||||
if rdtype[1] == cmp[0]:
|
||||
return cmp
|
||||
return ['','','']
|
||||
|
||||
def dracut_compression_opt(d):
|
||||
cmp = dracut_compression_type(d)
|
||||
return cmp[1]
|
||||
|
||||
def dracut_compression_pkg(d):
|
||||
cmp = dracut_compression_type(d)
|
||||
return cmp[2]
|
||||
|
||||
def dracut_compression_pkg_native(d):
|
||||
cmp = dracut_compression_type(d)
|
||||
if cmp[2] == '':
|
||||
return ''
|
||||
return cmp[2] + '-native'
|
||||
|
||||
DRACUT_COMPRESS_OPT ??= "${@dracut_compression_opt(d)}"
|
||||
DRACUT_COMPRESS_PKG ??= "${@dracut_compression_pkg(d)}"
|
||||
DRACUT_COMPRESS_PKG_NATIVE ??= "${@dracut_compression_pkg_native(d)}"
|
||||
|
||||
DRACUT_OPTS ??= "--early-microcode ${DRACUT_COMPRESS_OPT}"
|
||||
|
||||
python __anonymous () {
|
||||
pkg = d.getVar("DRACUT_PN", True)
|
||||
if pkg != 'dracut':
|
||||
d.appendVar("RDEPENDS_%s" % pkg, " dracut %s " % d.getVar("DRACUT_COMPRESS_PKG", True))
|
||||
if not pkg.startswith('kernel'):
|
||||
d.appendVarFlag("do_configure", "depends", "virtual/kernel:do_shared_workdir")
|
||||
d.appendVarFlag("do_compile", "depends", "virtual/kernel:do_compile_kernelmodules")
|
||||
}
|
||||
|
||||
export BUILD_TIME_KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
|
||||
|
||||
dracut_postinst () {
|
||||
MY_KERNEL_VERSION=$(readlink $D/boot/bzimage | sed 's,^.*bzImage-,,')
|
||||
if [[ -z "$MY_KERNEL_VERSION" ]]; then
|
||||
MY_KERNEL_VERSION="${KERNEL_VERSION}"
|
||||
fi
|
||||
if [[ -z "$MY_KERNEL_VERSION" ]]; then
|
||||
MY_KERNEL_VERSION="${BUILD_TIME_KERNEL_VERSION}"
|
||||
fi
|
||||
if [[ -z "$MY_KERNEL_VERSION" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$D" ]; then
|
||||
#DEBUGOPTS="--debug --keep"
|
||||
DEBUGOPTS="--keep"
|
||||
|
||||
$INTERCEPT_DIR/postinst_intercept execute_dracut ${PKG} mlprefix=${MLPREFIX} \
|
||||
prefix= \
|
||||
MY_KERNEL_VERSION=$MY_KERNEL_VERSION \
|
||||
DEBUGOPTS="\"$DEBUGOPTS\"" \
|
||||
DRACUT_OPTS="\"${DRACUT_OPTS}\"" \
|
||||
systemdutildir=${systemd_unitdir} \
|
||||
systemdsystemunitdir=${systemd_system_unitdir} \
|
||||
systemdsystemconfdir=${sysconfdir}/systemd/system \
|
||||
udevdir=${libdir}/udev \
|
||||
DRACUT_TMPDIR=${WORKDIR}/dracut-tmpdir \
|
||||
DRACUT_ARCH="${TUNE_ARCH}" \
|
||||
DRACUT_COMPRESS_GZIP=$NATIVE_ROOT${bindir}/gzip \
|
||||
DRACUT_COMPRESS_BZIP2=$NATIVE_ROOT${bindir}/bzip2 \
|
||||
DRACUT_COMPRESS_LZMA=$NATIVE_ROOT${bindir}/lzma \
|
||||
DRACUT_LDD="\"PATH='$PATH' ${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
|
||||
DRACUT_LDCONFIG=$NATIVE_ROOT${bindir}/ldconfig \
|
||||
DRACUT_INSTALL="\"$NATIVE_ROOT${libdir}/dracut/dracut-install\"" \
|
||||
PLYMOUTH_LDD="\"${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
|
||||
PLYMOUTH_LDD_PATH="'$PATH'" \
|
||||
PLYMOUTH_PLUGIN_PATH=${libdir}/plymouth \
|
||||
PLYMOUTH_THEME_NAME=${PLYMOUTH_THEME_NAME:-spinner} \
|
||||
PLYMOUTH_THEME=${PLYMOUTH_THEME_NAME:-spinner}
|
||||
else
|
||||
depmod -a $MY_KERNEL_VERSION
|
||||
echo RUNNING: dracut -f ${DRACUT_OPTS} /boot/initramfs.img $MY_KERNEL_VERSION
|
||||
echo "dracut: $(dracut --help | grep 'Version:')"
|
||||
dracut -f ${DRACUT_OPTS} /boot/initramfs.img $MY_KERNEL_VERSION
|
||||
fi
|
||||
}
|
||||
|
||||
dracut_populate_packages[vardeps] += "dracut_postinst"
|
||||
|
||||
python dracut_populate_packages() {
|
||||
localdata = d.createCopy()
|
||||
|
||||
pkg = d.getVar('DRACUT_PN', True)
|
||||
|
||||
postinst = d.getVar('pkg_postinst_%s' % pkg, True)
|
||||
if not postinst:
|
||||
postinst = '#!/bin/sh\n'
|
||||
postinst += localdata.getVar('dracut_postinst', True)
|
||||
d.setVar('pkg_postinst_%s' % pkg, postinst)
|
||||
}
|
||||
|
||||
PACKAGESPLITFUNCS_prepend = "dracut_populate_packages "
|
||||
|
||||
DRACUT_DEPENDS = " \
|
||||
binutils-cross-${TUNE_ARCH} gcc-cross-${TUNE_ARCH} \
|
||||
ldconfig-native coreutils-native findutils-native \
|
||||
cpio-native util-linux-native kmod-native ${DRACUT_COMPRESS_PKG_NATIVE} \
|
||||
dracut-native pkgconfig-native cross-compiler-ldd \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
|
||||
"
|
||||
DEPENDS_append_class-target = " ${DRACUT_DEPENDS}"
|
||||
PACKAGE_WRITE_DEPS_append = " ${DRACUT_DEPENDS}"
|
44
examples/yocto/postinst-intercepts/execute_dracut
Executable file
44
examples/yocto/postinst-intercepts/execute_dracut
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z "$DRACUT_TMPDIR" ]]; then
|
||||
echo "DRACUT_TMPDIR is unset, exiting"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# We have to unset "prefix" as dracut uses it to move files around.
|
||||
# Yocto has it set as part of the build environment.
|
||||
export prefix=
|
||||
|
||||
# DRACUT settings
|
||||
export UDEVVERSION=241
|
||||
export SYSTEMD_VERSION=241
|
||||
export DRACUT_TESTBIN=/bin/bash.bash
|
||||
export DRACUT_INSTALL_PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
# PLYMOUTH settings
|
||||
export PLYMOUTH_SYSROOT=$D
|
||||
|
||||
export \
|
||||
systemdutildir systemdsystemunitdir systemdsystemconfdir udevdir \
|
||||
DRACUT_ARCH DRACUT_TESTBIN DRACUT_LDD DRACUT_LDCONFIG DRACUT_INSTALL \
|
||||
DRACUT_COMPRESS_GZIP DRACUT_COMPRESS_BZIP2 DRACUT_COMPRESS_LZMA \
|
||||
PLYMOUTH_LDD PLYMOUTH_LDD_PATH PLYMOUTH_PLUGIN_PATH \
|
||||
PLYMOUTH_THEME_NAME PLYMOUTH_THEME
|
||||
|
||||
# List environment for debugging
|
||||
echo ROOTFS-POSTINST-ENVIRONMENT
|
||||
echo -----------
|
||||
env
|
||||
echo -----------
|
||||
|
||||
[[ -d $DRACUT_TMPDIR ]] || mkdir -p $DRACUT_TMPDIR
|
||||
|
||||
# Execute depmod and dracut
|
||||
echo "$(date) - RUNNING: depmod -b $D -a $MY_KERNEL_VERSION"
|
||||
depmod -b $D -a $MY_KERNEL_VERSION
|
||||
echo "dracut: $(dracut --sysroot $D --help | grep 'Version:')"
|
||||
echo "$(date) - RUNNING: dracut -f --sysroot $D --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS -k $D/lib/modules/$MY_KERNEL_VERSION $D/boot/initramfs.img $MY_KERNEL_VERSION"
|
||||
dracut -f --sysroot $D --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS -k $D/lib/modules/$MY_KERNEL_VERSION $D/boot/initramfs.img $MY_KERNEL_VERSION
|
||||
echo "$(date) - DONE: dracut"
|
@@ -0,0 +1,19 @@
|
||||
diff --git a/cross-compile-ldd b/cross-compile-ldd
|
||||
index ef2ca20..332d57f 100644
|
||||
--- a/cross-compile-ldd
|
||||
+++ b/cross-compile-ldd
|
||||
@@ -337,13 +337,13 @@ do_scan_etc_ldsoconf() {
|
||||
# Build up the full list of search directories
|
||||
declare -a needed_search_path
|
||||
do_trace "Adding basic lib dirs\n"
|
||||
-ld_library_path="${ld_library_path}:"
|
||||
while [ -n "${ld_library_path}" ]; do
|
||||
d="${ld_library_path%%:*}"
|
||||
if [ -n "${d}" ]; then
|
||||
do_trace "-> adding search dir '%s'\n" "${d}"
|
||||
needed_search_path+=( "${d}" )
|
||||
fi
|
||||
+ [[ "$ld_library_path" == "${ld_library_path#*:}" ]] && break
|
||||
ld_library_path="${ld_library_path#*:}"
|
||||
done
|
||||
do_trace "Done adding basic lib dirs\n"
|
33
examples/yocto/recipes/cross-compiler-ldd_git.bb
Normal file
33
examples/yocto/recipes/cross-compiler-ldd_git.bb
Normal file
@@ -0,0 +1,33 @@
|
||||
SUMMARY = "Cross-compiler LDD"
|
||||
HOMEPAGE = "https://gist.github.com/c403786c1394f53f44a3b61214489e6f"
|
||||
BUGTRACKER = ""
|
||||
LICENSE = "GPLv2"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://cross-compile-ldd;beginline=53;endline=57;md5=2b29d19d18a430b931dda3750e865c84"
|
||||
|
||||
SRCBRANCH = "master"
|
||||
SRCREV = "eb44581caf7dd60b149a6691abef46264c46e866"
|
||||
SRC_URI = " \
|
||||
git://gist.github.com/c403786c1394f53f44a3b61214489e6f.git;protocol=https;branch=${SRCBRANCH} \
|
||||
file://cross-compile-ldd-fix-infinite-loop.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit siteinfo
|
||||
|
||||
SYSROOT_PREPROCESS_FUNCS += " cross_ldd_populate_sysroot "
|
||||
|
||||
cross_ldd_populate_sysroot() {
|
||||
mkdir -p ${SYSROOT_DESTDIR}${bindir_crossscripts}
|
||||
cat ${S}/cross-compile-ldd | \
|
||||
sed \
|
||||
-e "s,^prefix=.*$,prefix=${TARGET_SYS}," \
|
||||
-e "s,^bits=.*$,bits=${SITEINFO_BITS}," \
|
||||
-e "s,^ld_library_path=.*$,ld_library_path=${LD_LIBRARY_PATH:-/lib:/usr/lib}," \
|
||||
>${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
|
||||
chmod +x ${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
|
||||
}
|
||||
|
||||
DEPENDS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
|
||||
PACKAGE_WRITE_DEPS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
|
45
fedora-test-github.sh
Executable file
45
fedora-test-github.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
[[ -d ${0%/*} ]] && cd ${0%/*}
|
||||
|
||||
RUN_ID="$1"
|
||||
TESTS=$2
|
||||
|
||||
./configure
|
||||
|
||||
NCPU=$(getconf _NPROCESSORS_ONLN)
|
||||
|
||||
if ! [[ $TESTS ]]; then
|
||||
# GitHub workflows fetch a clone of the dracut repository which doesn't
|
||||
# contain git tags, thus "breaking" the RPM build in certain situations
|
||||
# i.e.:
|
||||
# DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`,
|
||||
# which in full git clone returns a tag with a numeric version. However,
|
||||
# without tags it returns SHA of the last commit, which later propagates into
|
||||
# `Provides:` attribute of the built RPM and can break dependency tree when
|
||||
# installed
|
||||
[[ -d .git ]] && git fetch --tags && git describe --tags
|
||||
make -j$NCPU all syncheck rpm logtee
|
||||
else
|
||||
if [[ $TESTS == "99" ]]; then
|
||||
[[ -d .git ]] && git fetch --tags && git describe --tags
|
||||
make_docs=yes
|
||||
else
|
||||
make_docs=no
|
||||
fi
|
||||
|
||||
make -j$NCPU enable_documentation=$make_docs all logtee
|
||||
|
||||
cd test
|
||||
|
||||
time LOGTEE_TIMEOUT_MS=590000 make \
|
||||
enable_documentation=$make_docs \
|
||||
KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \
|
||||
DRACUT_NO_XATTR=1 \
|
||||
TEST_RUN_ID=$RUN_ID \
|
||||
${TESTS:+TESTS="$TESTS"} \
|
||||
-k V=1 \
|
||||
check
|
||||
fi
|
@@ -7,41 +7,6 @@ set -ex
|
||||
RUN_ID="$1"
|
||||
TESTS=$2
|
||||
|
||||
dnf -y update --best --allowerasing &>/dev/null
|
||||
|
||||
dnf -y install --best --allowerasing \
|
||||
dash \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
dmraid \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
scsi-target-utils \
|
||||
iscsi-initiator-utils \
|
||||
strace \
|
||||
btrfs-progs \
|
||||
kmod-devel \
|
||||
gcc \
|
||||
bzip2 \
|
||||
xz \
|
||||
tar \
|
||||
wget \
|
||||
rpm-build \
|
||||
make \
|
||||
git \
|
||||
bash-completion \
|
||||
sudo \
|
||||
kernel \
|
||||
dhcp-client \
|
||||
/usr/bin/qemu-kvm \
|
||||
/usr/bin/qemu-system-$(uname -i) \
|
||||
e2fsprogs \
|
||||
tcpdump \
|
||||
$NULL &>/dev/null
|
||||
|
||||
./configure
|
||||
|
||||
NCPU=$(getconf _NPROCESSORS_ONLN)
|
||||
@@ -49,12 +14,15 @@ NCPU=$(getconf _NPROCESSORS_ONLN)
|
||||
if ! [[ $TESTS ]]; then
|
||||
make -j$NCPU all syncheck rpm logtee
|
||||
else
|
||||
make -j$NCPU all logtee
|
||||
[[ $TESTS == "99" ]] && make_docs=yes || make_docs=no
|
||||
make -j$NCPU enable_documentation=$make_docs all logtee
|
||||
|
||||
cd test
|
||||
|
||||
time sudo make \
|
||||
time sudo LOGTEE_TIMEOUT_MS=300000 make \
|
||||
enable_documentation=$make_docs \
|
||||
KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \
|
||||
DRACUT_NO_XATTR=1 \
|
||||
TEST_RUN_ID=$RUN_ID \
|
||||
${TESTS:+TESTS="$TESTS"} \
|
||||
-k V=2 \
|
||||
|
@@ -10,7 +10,7 @@ sub create_patches {
|
||||
|
||||
mkdir $pdir, 0755;
|
||||
|
||||
open( GIT, 'git log -p --pretty=email --stat -m --first-parent --reverse '.$tag.'..HEAD |');
|
||||
open( GIT, 'git log -p --pretty=email --stat -m --first-parent --reverse --binary '.$tag.'..HEAD |');
|
||||
|
||||
while (<GIT>) {
|
||||
if (/^From [a-z0-9]{40} .*$/) {
|
||||
|
@@ -59,11 +59,15 @@ static bool arg_modalias = false;
|
||||
static bool arg_resolvelazy = false;
|
||||
static bool arg_resolvedeps = false;
|
||||
static bool arg_hostonly = false;
|
||||
static bool no_xattr = false;
|
||||
static char *destrootdir = NULL;
|
||||
static char *sysrootdir = NULL;
|
||||
static size_t sysrootdirlen = 0;
|
||||
static char *kerneldir = NULL;
|
||||
static size_t kerneldirlen = 0;
|
||||
static char **firmwaredirs = NULL;
|
||||
static char **pathdirs;
|
||||
static char *ldd = NULL;
|
||||
static char *logdir = NULL;
|
||||
static char *logfile = NULL;
|
||||
FILE *logfile_f = NULL;
|
||||
@@ -307,7 +311,7 @@ static int cp(const char *src, const char *dst)
|
||||
normal_copy:
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
if (geteuid() == 0)
|
||||
if (geteuid() == 0 && no_xattr == false)
|
||||
execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,xattr,timestamps", "-fL", src, dst,
|
||||
NULL);
|
||||
else
|
||||
@@ -319,7 +323,7 @@ static int cp(const char *src, const char *dst)
|
||||
while (waitpid(pid, &ret, 0) < 0) {
|
||||
if (errno != EINTR) {
|
||||
ret = -1;
|
||||
if (geteuid() == 0)
|
||||
if (geteuid() == 0 && no_xattr == false)
|
||||
log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,xattr,timestamps -fL %s %s", src,
|
||||
dst);
|
||||
else
|
||||
@@ -398,6 +402,75 @@ static int library_install(const char *src, const char *lib)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *get_real_file(const char *src, bool fullyresolve)
|
||||
{
|
||||
char linktarget[PATH_MAX + 1];
|
||||
ssize_t linksz;
|
||||
_cleanup_free_ char *fullsrcpath;
|
||||
char *abspath = NULL;
|
||||
struct stat sb;
|
||||
|
||||
if (sysrootdirlen) {
|
||||
if (strncmp(src, sysrootdir, sysrootdirlen) == 0)
|
||||
fullsrcpath = strdup(src);
|
||||
else if (asprintf(&fullsrcpath, "%s/%s", (sysrootdirlen ? sysrootdir : ""), (src[0] == '/' ? src+1 : src)) < 0)
|
||||
_exit(EXIT_FAILURE);
|
||||
} else
|
||||
fullsrcpath = strdup(src);
|
||||
|
||||
log_debug("get_real_file('%s')", fullsrcpath);
|
||||
|
||||
if (lstat(fullsrcpath, &sb) < 0)
|
||||
return NULL;
|
||||
|
||||
switch (sb.st_mode & S_IFMT) {
|
||||
case S_IFDIR:
|
||||
case S_IFREG:
|
||||
return strdup(fullsrcpath);
|
||||
case S_IFLNK:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
linksz = readlink(fullsrcpath, linktarget, sizeof(linktarget));
|
||||
if (linksz < 0)
|
||||
return NULL;
|
||||
linktarget[linksz] = '\0';
|
||||
|
||||
log_debug("get_real_file: readlink('%s') returns '%s'", fullsrcpath, linktarget);
|
||||
|
||||
if (linktarget[0] == '/') {
|
||||
if (asprintf(&abspath, "%s%s", (sysrootdirlen ? sysrootdir : ""), linktarget) < 0)
|
||||
return NULL;
|
||||
} else {
|
||||
_cleanup_free_ char *fullsrcdir = strdup(fullsrcpath);
|
||||
|
||||
if (!fullsrcdir) {
|
||||
log_error("Out of memory!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fullsrcdir[dir_len(fullsrcdir)] = '\0';
|
||||
|
||||
if (asprintf(&abspath, "%s/%s", fullsrcdir, linktarget) < 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fullyresolve) {
|
||||
struct stat st;
|
||||
if (lstat(abspath, &st) < 0) {
|
||||
if (errno != ENOENT)
|
||||
return NULL;
|
||||
}
|
||||
if (S_ISLNK(st.st_mode))
|
||||
return get_real_file(abspath, fullyresolve);
|
||||
}
|
||||
|
||||
log_debug("get_real_file('%s') => '%s'", src, abspath);
|
||||
return abspath;
|
||||
}
|
||||
|
||||
static int resolve_deps(const char *src)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -406,6 +479,12 @@ static int resolve_deps(const char *src)
|
||||
size_t linesize = LINE_MAX;
|
||||
_cleanup_pclose_ FILE *fptr = NULL;
|
||||
_cleanup_free_ char *cmd = NULL;
|
||||
_cleanup_free_ char *fullsrcpath = NULL;
|
||||
|
||||
fullsrcpath = get_real_file(src, true);
|
||||
log_debug("resolve_deps('%s') -> get_real_file('%s', true) = '%s'", src, src, fullsrcpath);
|
||||
if (!fullsrcpath)
|
||||
return 0;
|
||||
|
||||
buf = malloc(LINE_MAX);
|
||||
if (buf == NULL)
|
||||
@@ -413,7 +492,7 @@ static int resolve_deps(const char *src)
|
||||
|
||||
if (strstr(src, ".so") == 0) {
|
||||
_cleanup_close_ int fd = -1;
|
||||
fd = open(src, O_RDONLY | O_CLOEXEC);
|
||||
fd = open(fullsrcpath, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
@@ -437,12 +516,14 @@ static int resolve_deps(const char *src)
|
||||
}
|
||||
|
||||
/* run ldd */
|
||||
ret = asprintf(&cmd, "ldd %s 2>&1", src);
|
||||
ret = asprintf(&cmd, "%s %s 2>&1", ldd, fullsrcpath);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
log_debug("%s", cmd);
|
||||
|
||||
ret = 0;
|
||||
|
||||
fptr = popen(cmd, "r");
|
||||
@@ -461,6 +542,13 @@ static int resolve_deps(const char *src)
|
||||
break;
|
||||
}
|
||||
|
||||
/* errors from cross-compiler-ldd */
|
||||
if (strstr(buf, "unable to find sysroot") || strstr(buf, "command not found")) {
|
||||
log_error("%s", buf);
|
||||
ret += 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* musl ldd */
|
||||
if (strstr(buf, "Not a valid dynamic program"))
|
||||
break;
|
||||
@@ -597,16 +685,80 @@ static bool check_hashmap(Hashmap *hm, const char *item)
|
||||
return false;
|
||||
}
|
||||
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst)
|
||||
static int dracut_mkdir(const char *src) {
|
||||
_cleanup_free_ char *parent = NULL;
|
||||
char *path;
|
||||
struct stat sb;
|
||||
|
||||
parent = strdup(src);
|
||||
if (!parent)
|
||||
return 1;
|
||||
|
||||
path = parent[0] == '/' ? parent+1 : parent;
|
||||
while (path) {
|
||||
path = strstr(path, "/");
|
||||
if (path)
|
||||
*path = '\0';
|
||||
|
||||
if (stat(parent, &sb) == 0) {
|
||||
if (!S_ISDIR(sb.st_mode)) {
|
||||
log_error("%s exists but is not a directory!", parent);
|
||||
return 1;
|
||||
}
|
||||
} else if (errno != ENOENT) {
|
||||
log_error("ERROR: stat '%s': %s", parent, strerror(errno));
|
||||
return 1;
|
||||
} else {
|
||||
if (mkdir(parent, 0755) < 0) {
|
||||
log_error("ERROR: mkdir '%s': %s", parent, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (path) {
|
||||
*path = '/';
|
||||
path++;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir, bool resolvedeps, bool hashdst)
|
||||
{
|
||||
struct stat sb, db;
|
||||
_cleanup_free_ char *fullsrcpath = NULL;
|
||||
_cleanup_free_ char *fulldstpath = NULL;
|
||||
_cleanup_free_ char *fulldstdir = NULL;
|
||||
int ret;
|
||||
bool src_exists = true;
|
||||
bool src_islink = false;
|
||||
bool src_isdir = false;
|
||||
mode_t src_mode = 0;
|
||||
bool dst_exists = true;
|
||||
char *i = NULL;
|
||||
_cleanup_free_ char *src;
|
||||
_cleanup_free_ char *dst;
|
||||
|
||||
log_debug("dracut_install('%s', '%s')", src, dst);
|
||||
if (sysrootdirlen) {
|
||||
if (strncmp(orig_src, sysrootdir, sysrootdirlen) == 0) {
|
||||
src = strdup(orig_src + sysrootdirlen);
|
||||
fullsrcpath = strdup(orig_src);
|
||||
} else {
|
||||
src = strdup(orig_src);
|
||||
if (asprintf(&fullsrcpath, "%s%s", sysrootdir, src) < 0)
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
if (strncmp(orig_dst, sysrootdir, sysrootdirlen) == 0)
|
||||
dst = strdup(orig_dst + sysrootdirlen);
|
||||
else
|
||||
dst = strdup(orig_dst);
|
||||
} else {
|
||||
src = strdup(orig_src);
|
||||
fullsrcpath = strdup(src);
|
||||
dst = strdup(orig_dst);
|
||||
}
|
||||
|
||||
log_debug("dracut_install('%s', '%s', %d, %d, %d)", src, dst, isdir, resolvedeps, hashdst);
|
||||
|
||||
if (check_hashmap(items_failed, src)) {
|
||||
log_debug("hash hit items_failed for '%s'", src);
|
||||
@@ -618,22 +770,19 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (lstat(src, &sb) < 0) {
|
||||
src_exists = false;
|
||||
if (lstat(fullsrcpath, &sb) < 0) {
|
||||
if (!isdir) {
|
||||
i = strdup(src);
|
||||
hashmap_put(items_failed, i, i);
|
||||
/* src does not exist */
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
src_islink = S_ISLNK(sb.st_mode);
|
||||
src_isdir = S_ISDIR(sb.st_mode);
|
||||
src_mode = sb.st_mode;
|
||||
}
|
||||
|
||||
i = strdup(dst);
|
||||
if (!i)
|
||||
return -ENOMEM;
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
|
||||
ret = asprintf(&fulldstpath, "%s/%s", destrootdir, (dst[0]=='/' ? (dst+1) : dst));
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
@@ -642,15 +791,18 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
|
||||
ret = stat(fulldstpath, &sb);
|
||||
|
||||
if (ret != 0 && (errno != ENOENT)) {
|
||||
log_error("ERROR: stat '%s': %m", fulldstpath);
|
||||
return 1;
|
||||
if (ret != 0) {
|
||||
dst_exists = false;
|
||||
if (errno != ENOENT) {
|
||||
log_error("ERROR: stat '%s': %m", fulldstpath);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
if (resolvedeps && S_ISREG(sb.st_mode) && (sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) {
|
||||
log_debug("'%s' already exists, but checking for any deps", fulldstpath);
|
||||
ret = resolve_deps(src);
|
||||
ret = resolve_deps(fullsrcpath + sysrootdirlen);
|
||||
} else
|
||||
log_debug("'%s' already exists", fulldstpath);
|
||||
|
||||
@@ -660,6 +812,10 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
|
||||
/* check destination directory */
|
||||
fulldstdir = strdup(fulldstpath);
|
||||
if (!fulldstdir) {
|
||||
log_error("Out of memory!");
|
||||
return 1;
|
||||
}
|
||||
fulldstdir[dir_len(fulldstdir)] = '\0';
|
||||
|
||||
ret = stat(fulldstdir, &db);
|
||||
@@ -686,24 +842,34 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
}
|
||||
}
|
||||
|
||||
if (isdir && !src_exists) {
|
||||
if (src_isdir) {
|
||||
if (dst_exists) {
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
log_debug("dest dir '%s' already exists", fulldstpath);
|
||||
return 0;
|
||||
}
|
||||
log_error("dest dir '%s' already exists but is not a directory", fulldstpath);
|
||||
return 1;
|
||||
}
|
||||
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
ret = mkdir(fulldstpath, 0755);
|
||||
ret = dracut_mkdir(fulldstpath);
|
||||
if (ret == 0) {
|
||||
i = strdup(dst);
|
||||
if (!i)
|
||||
return -ENOMEM;
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ready to install src */
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
ret = mkdir(fulldstpath, sb.st_mode | S_IWUSR);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (S_ISLNK(sb.st_mode)) {
|
||||
if (src_islink) {
|
||||
_cleanup_free_ char *abspath = NULL;
|
||||
|
||||
abspath = realpath(src, NULL);
|
||||
abspath = get_real_file(src, false);
|
||||
|
||||
if (abspath == NULL)
|
||||
return 1;
|
||||
@@ -721,7 +887,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
if (lstat(fulldstpath, &sb) != 0) {
|
||||
_cleanup_free_ char *absdestpath = NULL;
|
||||
|
||||
ret = asprintf(&absdestpath, "%s/%s", destrootdir, (abspath[0]=='/' ? (abspath+1) : abspath));
|
||||
ret = asprintf(&absdestpath, "%s/%s", destrootdir, (abspath[0]=='/' ? (abspath+1) : abspath) + sysrootdirlen);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -738,9 +904,9 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
|
||||
if (src_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
|
||||
if (resolvedeps)
|
||||
ret += resolve_deps(src);
|
||||
ret += resolve_deps(fullsrcpath + sysrootdirlen);
|
||||
if (arg_hmac) {
|
||||
/* copy .hmac files also */
|
||||
hmac_install(src, dst, NULL);
|
||||
@@ -748,14 +914,28 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
}
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
log_info("cp '%s' '%s'", src, fulldstpath);
|
||||
|
||||
if (arg_hostonly && !arg_module)
|
||||
mark_hostonly(dst);
|
||||
|
||||
ret += cp(src, fulldstpath);
|
||||
if (ret == 0 && logfile_f)
|
||||
dracut_log_cp(src);
|
||||
if (isdir) {
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
ret += dracut_mkdir(fulldstpath);
|
||||
} else {
|
||||
log_info("cp '%s' '%s'", fullsrcpath, fulldstpath);
|
||||
ret += cp(fullsrcpath, fulldstpath);
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
i = strdup(dst);
|
||||
if (!i)
|
||||
return -ENOMEM;
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
|
||||
if (logfile_f)
|
||||
dracut_log_cp(src);
|
||||
}
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
|
||||
@@ -771,11 +951,11 @@ static void item_free(char *i)
|
||||
static void usage(int status)
|
||||
{
|
||||
/* */
|
||||
printf("Usage: %s -D DESTROOTDIR [OPTION]... -a SOURCE...\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... SOURCE DEST\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... -m KERNELMODULE [KERNELMODULE …]\n"
|
||||
printf("Usage: %s -D DESTROOTDIR [-r SYSROOTDIR] [OPTION]... -a SOURCE...\n"
|
||||
"or: %s -D DESTROOTDIR [-r SYSROOTDIR] [OPTION]... SOURCE DEST\n"
|
||||
"or: %s -D DESTROOTDIR [-r SYSROOTDIR] [OPTION]... -m KERNELMODULE [KERNELMODULE …]\n"
|
||||
"\n"
|
||||
"Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n"
|
||||
"Install SOURCE (from rootfs or SYSROOTDIR) to DEST in DESTROOTDIR with all needed dependencies.\n"
|
||||
"\n"
|
||||
" KERNELMODULE can have the format:\n"
|
||||
" <absolute path> with a leading /\n"
|
||||
@@ -783,6 +963,7 @@ static void usage(int status)
|
||||
" <module name>\n"
|
||||
"\n"
|
||||
" -D --destrootdir Install all files to DESTROOTDIR as the root\n"
|
||||
" -r --sysrootdir Install all files from SYSROOTDIR\n"
|
||||
" -a --all Install all SOURCE arguments to DESTROOTDIR\n"
|
||||
" -o --optional If SOURCE does not exist, do not fail\n"
|
||||
" -d --dir SOURCE is a directory\n"
|
||||
@@ -842,6 +1023,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
{"module", no_argument, NULL, 'm'},
|
||||
{"fips", no_argument, NULL, 'f'},
|
||||
{"destrootdir", required_argument, NULL, 'D'},
|
||||
{"sysrootdir", required_argument, NULL, 'r'},
|
||||
{"logdir", required_argument, NULL, 'L'},
|
||||
{"mod-filter-path", required_argument, NULL, 'p'},
|
||||
{"mod-filter-nopath", required_argument, NULL, 'P'},
|
||||
@@ -855,7 +1037,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
while ((c = getopt_long(argc, argv, "madfhlL:oD:HRp:P:s:S:N:", options, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "madfhlL:oD:Hr:Rp:P:s:S:N:v", options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case ARG_VERSION:
|
||||
puts(PROGRAM_VERSION_STRING);
|
||||
@@ -894,6 +1076,10 @@ static int parse_argv(int argc, char *argv[])
|
||||
case 'D':
|
||||
destrootdir = strdup(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
sysrootdir = strdup(optarg);
|
||||
sysrootdirlen = strlen(sysrootdir);
|
||||
break;
|
||||
case 'p':
|
||||
if (regcomp(&mod_filter_path, optarg, REG_NOSUB|REG_EXTENDED) != 0) {
|
||||
log_error("Module path filter %s is not a regular expression", optarg);
|
||||
@@ -1022,6 +1208,7 @@ static char **find_binary(const char *src)
|
||||
{
|
||||
char **ret = NULL;
|
||||
char **q;
|
||||
char *fullsrcpath;
|
||||
char *newsrc = NULL;
|
||||
|
||||
STRV_FOREACH(q, pathdirs) {
|
||||
@@ -1034,15 +1221,28 @@ static char **find_binary(const char *src)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (stat(newsrc, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", newsrc);
|
||||
fullsrcpath = get_real_file(newsrc, false);
|
||||
|
||||
if (!fullsrcpath) {
|
||||
log_debug("get_real_file(%s) not found", newsrc);
|
||||
free(newsrc);
|
||||
newsrc = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lstat(fullsrcpath, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fullsrcpath);
|
||||
free(newsrc);
|
||||
newsrc = NULL;
|
||||
free(fullsrcpath);
|
||||
fullsrcpath = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
strv_push(&ret, newsrc);
|
||||
|
||||
free(fullsrcpath);
|
||||
fullsrcpath = NULL;
|
||||
};
|
||||
|
||||
if (ret) {
|
||||
@@ -1711,6 +1911,7 @@ int main(int argc, char **argv)
|
||||
int r;
|
||||
char *i;
|
||||
char *path = NULL;
|
||||
char *env_no_xattr = NULL;
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
if (r <= 0)
|
||||
@@ -1738,7 +1939,13 @@ int main(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
path = getenv("PATH");
|
||||
log_debug("Program arguments:");
|
||||
for (r = 0; r < argc; r++)
|
||||
log_debug("%s", argv[r]);
|
||||
|
||||
path = getenv("DRACUT_INSTALL_PATH");
|
||||
if (path == NULL)
|
||||
path = getenv("PATH");
|
||||
|
||||
if (path == NULL) {
|
||||
log_error("PATH is not set");
|
||||
@@ -1747,6 +1954,15 @@ int main(int argc, char **argv)
|
||||
|
||||
log_debug("PATH=%s", path);
|
||||
|
||||
ldd = getenv("DRACUT_LDD");
|
||||
if (ldd == NULL)
|
||||
ldd = "ldd";
|
||||
log_debug("LDD=%s", ldd);
|
||||
|
||||
env_no_xattr = getenv("DRACUT_NO_XATTR");
|
||||
if (env_no_xattr != NULL)
|
||||
no_xattr = true;
|
||||
|
||||
pathdirs = strv_split(path, ":");
|
||||
|
||||
umask(0022);
|
||||
|
@@ -41,86 +41,10 @@ struct Hashmap {
|
||||
|
||||
struct hashmap_entry *iterate_list_head, *iterate_list_tail;
|
||||
unsigned n_entries;
|
||||
|
||||
bool from_pool;
|
||||
};
|
||||
|
||||
#define BY_HASH(h) ((struct hashmap_entry**) ((uint8_t*) (h) + ALIGN(sizeof(Hashmap))))
|
||||
|
||||
struct pool {
|
||||
struct pool *next;
|
||||
unsigned n_tiles;
|
||||
unsigned n_used;
|
||||
};
|
||||
|
||||
static struct pool *first_hashmap_pool = NULL;
|
||||
static void *first_hashmap_tile = NULL;
|
||||
|
||||
static struct pool *first_entry_pool = NULL;
|
||||
static void *first_entry_tile = NULL;
|
||||
|
||||
static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size) {
|
||||
unsigned i;
|
||||
|
||||
if (*first_tile) {
|
||||
void *r;
|
||||
|
||||
r = *first_tile;
|
||||
*first_tile = * (void**) (*first_tile);
|
||||
return r;
|
||||
}
|
||||
|
||||
if (_unlikely_(!*first_pool) || _unlikely_((*first_pool)->n_used >= (*first_pool)->n_tiles)) {
|
||||
unsigned n;
|
||||
size_t size;
|
||||
struct pool *p;
|
||||
|
||||
n = *first_pool ? (*first_pool)->n_tiles : 0;
|
||||
n = MAX(512U, n * 2);
|
||||
size = PAGE_ALIGN(ALIGN(sizeof(struct pool)) + n*tile_size);
|
||||
n = (size - ALIGN(sizeof(struct pool))) / tile_size;
|
||||
|
||||
p = malloc(size);
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
p->next = *first_pool;
|
||||
p->n_tiles = n;
|
||||
p->n_used = 0;
|
||||
|
||||
*first_pool = p;
|
||||
}
|
||||
|
||||
i = (*first_pool)->n_used++;
|
||||
|
||||
return ((uint8_t*) (*first_pool)) + ALIGN(sizeof(struct pool)) + i*tile_size;
|
||||
}
|
||||
|
||||
static void deallocate_tile(void **first_tile, void *p) {
|
||||
* (void**) p = *first_tile;
|
||||
*first_tile = p;
|
||||
}
|
||||
|
||||
#ifndef __OPTIMIZE__
|
||||
|
||||
static void drop_pool(struct pool *p) {
|
||||
while (p) {
|
||||
struct pool *n;
|
||||
n = p->next;
|
||||
free(p);
|
||||
p = n;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((destructor)) static void cleanup_pool(void) {
|
||||
/* Be nice to valgrind */
|
||||
|
||||
drop_pool(first_hashmap_pool);
|
||||
drop_pool(first_entry_pool);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
unsigned string_hash_func(const void *p) {
|
||||
unsigned hash = 5381;
|
||||
const signed char *c;
|
||||
@@ -146,26 +70,15 @@ int trivial_compare_func(const void *a, const void *b) {
|
||||
}
|
||||
|
||||
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
|
||||
bool b;
|
||||
Hashmap *h;
|
||||
size_t size;
|
||||
|
||||
b = is_main_thread();
|
||||
|
||||
size = ALIGN(sizeof(Hashmap)) + NBUCKETS * sizeof(struct hashmap_entry*);
|
||||
|
||||
if (b) {
|
||||
h = allocate_tile(&first_hashmap_pool, &first_hashmap_tile, size);
|
||||
if (!h)
|
||||
return NULL;
|
||||
h = malloc0(size);
|
||||
|
||||
memset(h, 0, size);
|
||||
} else {
|
||||
h = malloc0(size);
|
||||
|
||||
if (!h)
|
||||
return NULL;
|
||||
}
|
||||
if (!h)
|
||||
return NULL;
|
||||
|
||||
h->hash_func = hash_func ? hash_func : trivial_hash_func;
|
||||
h->compare_func = compare_func ? compare_func : trivial_compare_func;
|
||||
@@ -173,8 +86,6 @@ Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
|
||||
h->n_entries = 0;
|
||||
h->iterate_list_head = h->iterate_list_tail = NULL;
|
||||
|
||||
h->from_pool = b;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -245,7 +156,8 @@ static void unlink_entry(Hashmap *h, struct hashmap_entry *e, unsigned hash) {
|
||||
h->n_entries--;
|
||||
}
|
||||
|
||||
static void remove_entry(Hashmap *h, struct hashmap_entry *e) {
|
||||
static void remove_entry(Hashmap *h, struct hashmap_entry **ep) {
|
||||
struct hashmap_entry *e = *ep;
|
||||
unsigned hash;
|
||||
|
||||
assert(h);
|
||||
@@ -255,10 +167,8 @@ static void remove_entry(Hashmap *h, struct hashmap_entry *e) {
|
||||
|
||||
unlink_entry(h, e, hash);
|
||||
|
||||
if (h->from_pool)
|
||||
deallocate_tile(&first_entry_tile, e);
|
||||
else
|
||||
free(e);
|
||||
free(e);
|
||||
*ep = NULL;
|
||||
}
|
||||
|
||||
void hashmap_free(Hashmap*h) {
|
||||
@@ -268,10 +178,7 @@ void hashmap_free(Hashmap*h) {
|
||||
|
||||
hashmap_clear(h);
|
||||
|
||||
if (h->from_pool)
|
||||
deallocate_tile(&first_hashmap_tile, h);
|
||||
else
|
||||
free(h);
|
||||
free(h);
|
||||
}
|
||||
|
||||
void hashmap_free_free(Hashmap *h) {
|
||||
@@ -287,8 +194,10 @@ void hashmap_clear(Hashmap *h) {
|
||||
if (!h)
|
||||
return;
|
||||
|
||||
while (h->iterate_list_head)
|
||||
remove_entry(h, h->iterate_list_head);
|
||||
while (h->iterate_list_head) {
|
||||
struct hashmap_entry *e = h->iterate_list_head;
|
||||
remove_entry(h, &e);
|
||||
}
|
||||
}
|
||||
|
||||
static struct hashmap_entry *hash_scan(Hashmap *h, unsigned hash, const void *key) {
|
||||
@@ -319,10 +228,7 @@ int hashmap_put(Hashmap *h, const void *key, void *value) {
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
if (h->from_pool)
|
||||
e = allocate_tile(&first_entry_pool, &first_entry_tile, sizeof(struct hashmap_entry));
|
||||
else
|
||||
e = new(struct hashmap_entry, 1);
|
||||
e = new(struct hashmap_entry, 1);
|
||||
|
||||
if (!e)
|
||||
return -ENOMEM;
|
||||
@@ -381,7 +287,7 @@ void* hashmap_remove(Hashmap *h, const void *key) {
|
||||
return NULL;
|
||||
|
||||
data = e->value;
|
||||
remove_entry(h, e);
|
||||
remove_entry(h, &e);
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -426,7 +332,7 @@ int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_
|
||||
|
||||
if ((k = hash_scan(h, new_hash, new_key)))
|
||||
if (e != k)
|
||||
remove_entry(h, k);
|
||||
remove_entry(h, &k);
|
||||
|
||||
unlink_entry(h, e, old_hash);
|
||||
|
||||
@@ -453,7 +359,7 @@ void* hashmap_remove_value(Hashmap *h, const void *key, void *value) {
|
||||
if (e->value != value)
|
||||
return NULL;
|
||||
|
||||
remove_entry(h, e);
|
||||
remove_entry(h, &e);
|
||||
|
||||
return value;
|
||||
}
|
||||
@@ -579,6 +485,7 @@ void* hashmap_last(Hashmap *h) {
|
||||
}
|
||||
|
||||
void* hashmap_steal_first(Hashmap *h) {
|
||||
struct hashmap_entry *e;
|
||||
void *data;
|
||||
|
||||
if (!h)
|
||||
@@ -587,13 +494,15 @@ void* hashmap_steal_first(Hashmap *h) {
|
||||
if (!h->iterate_list_head)
|
||||
return NULL;
|
||||
|
||||
data = h->iterate_list_head->value;
|
||||
remove_entry(h, h->iterate_list_head);
|
||||
e = h->iterate_list_head;
|
||||
data = e->value;
|
||||
remove_entry(h, &e);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void* hashmap_steal_first_key(Hashmap *h) {
|
||||
struct hashmap_entry *e;
|
||||
void *key;
|
||||
|
||||
if (!h)
|
||||
@@ -602,8 +511,9 @@ void* hashmap_steal_first_key(Hashmap *h) {
|
||||
if (!h->iterate_list_head)
|
||||
return NULL;
|
||||
|
||||
key = (void*) h->iterate_list_head->key;
|
||||
remove_entry(h, h->iterate_list_head);
|
||||
e = h->iterate_list_head;
|
||||
key = (void*) e->key;
|
||||
remove_entry(h, &e);
|
||||
|
||||
return key;
|
||||
}
|
||||
@@ -694,22 +604,6 @@ int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Hashmap *hashmap_copy(Hashmap *h) {
|
||||
Hashmap *copy;
|
||||
|
||||
assert(h);
|
||||
|
||||
if (!(copy = hashmap_new(h->hash_func, h->compare_func)))
|
||||
return NULL;
|
||||
|
||||
if (hashmap_merge(copy, h) < 0) {
|
||||
hashmap_free(copy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
char **hashmap_get_strv(Hashmap *h) {
|
||||
char **sv;
|
||||
Iterator it;
|
||||
|
@@ -46,7 +46,6 @@ int trivial_compare_func(const void *a, const void *b);
|
||||
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func);
|
||||
void hashmap_free(Hashmap *h);
|
||||
void hashmap_free_free(Hashmap *h);
|
||||
Hashmap *hashmap_copy(Hashmap *h);
|
||||
int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_func_t compare_func);
|
||||
|
||||
int hashmap_put(Hashmap *h, const void *key, void *value);
|
||||
|
@@ -264,14 +264,21 @@ int log_set_max_level_from_string(const char *e) {
|
||||
void log_parse_environment(void) {
|
||||
const char *e;
|
||||
|
||||
if ((e = getenv("DRACUT_LOG_TARGET")))
|
||||
if ((e = getenv("DRACUT_INSTALL_LOG_TARGET"))) {
|
||||
if (log_set_target_from_string(e) < 0)
|
||||
log_warning("Failed to parse log target %s. Ignoring.", e);
|
||||
} else if ((e = getenv("DRACUT_LOG_TARGET"))) {
|
||||
if (log_set_target_from_string(e) < 0)
|
||||
log_warning("Failed to parse log target %s. Ignoring.", e);
|
||||
}
|
||||
|
||||
if ((e = getenv("DRACUT_LOG_LEVEL")))
|
||||
if ((e = getenv("DRACUT_INSTALL_LOG_LEVEL"))) {
|
||||
if (log_set_max_level_from_string(e) < 0)
|
||||
log_warning("Failed to parse log level %s. Ignoring.", e);
|
||||
|
||||
} else if ((e = getenv("DRACUT_LOG_LEVEL"))) {
|
||||
if (log_set_max_level_from_string(e) < 0)
|
||||
log_warning("Failed to parse log level %s. Ignoring.", e);
|
||||
}
|
||||
}
|
||||
|
||||
LogTarget log_get_target(void) {
|
||||
|
25
logtee.c
25
logtee.c
@@ -1,5 +1,6 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -13,13 +14,26 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int fd;
|
||||
int len, slen;
|
||||
int ret;
|
||||
int timeout;
|
||||
char *timeout_env;
|
||||
struct pollfd fds[] = {{
|
||||
.fd = STDIN_FILENO,
|
||||
.events = POLLIN | POLLERR,
|
||||
}};
|
||||
|
||||
timeout_env = getenv("LOGTEE_TIMEOUT_MS");
|
||||
if (timeout_env)
|
||||
timeout = atoi(timeout_env);
|
||||
else
|
||||
timeout = -1;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s <file>\n", argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||
fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, 0644);
|
||||
if (fd == -1) {
|
||||
perror("open");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -30,8 +44,13 @@ main(int argc, char *argv[])
|
||||
slen = 0;
|
||||
|
||||
do {
|
||||
ret = poll (fds, sizeof(fds) / sizeof(fds[0]), timeout);
|
||||
if (ret == 0) {
|
||||
fprintf (stderr, "Timed out after %d milliseconds of no output.\n", timeout);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
len = splice(STDIN_FILENO, NULL, fd, NULL,
|
||||
BUFLEN, SPLICE_F_MOVE);
|
||||
BUFLEN, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
|
||||
|
||||
if (len < 0) {
|
||||
if (errno == EAGAIN)
|
||||
@@ -51,4 +70,4 @@ main(int argc, char *argv[])
|
||||
close(fd);
|
||||
fprintf(stderr, "\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ LSINITRD(1)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
@@ -236,6 +236,8 @@ 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
|
||||
|
@@ -53,7 +53,7 @@ default_kernel_images() {
|
||||
local regex kernel_image kernel_version version_version initrd_image
|
||||
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
|
||||
|
||||
case "$(uname -m)" in
|
||||
case "${DRACUT_ARCH:-$(uname -m)}" in
|
||||
s390|s390x)
|
||||
regex='image'
|
||||
;;
|
||||
|
@@ -164,7 +164,7 @@ default_kernel_images() {
|
||||
local regex kernel_image kernel_version version_version initrd_image
|
||||
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
|
||||
|
||||
case "$(uname -m)" in
|
||||
case "${DRACUT_ARCH:-$(uname -m)}" in
|
||||
s390|s390x)
|
||||
regex='image'
|
||||
;;
|
||||
|
@@ -3,6 +3,7 @@ MKINITRD(8)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
21
modules.d/00mksh/module-setup.sh
Executable file
21
modules.d/00mksh/module-setup.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
require_binaries /bin/mksh
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
# If another shell is already installed, do not use mksh
|
||||
[[ -x $initdir/bin/sh ]] && return
|
||||
|
||||
# Prefer mksh as /bin/sh if it is available.
|
||||
inst /bin/mksh && ln -sf mksh "${initdir}/bin/sh"
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
getSystemdVersion() {
|
||||
SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
|
||||
[ -z "$SYSTEMD_VERSION" ] && SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
|
||||
# Check if the systemd version is a valid number
|
||||
if ! [[ $SYSTEMD_VERSION =~ ^[0-9]+$ ]]; then
|
||||
dfatal "systemd version is not a number ($SYSTEMD_VERSION)"
|
||||
@@ -154,6 +154,7 @@ install() {
|
||||
mount umount reboot poweroff \
|
||||
systemd-run systemd-escape \
|
||||
systemd-cgls systemd-tmpfiles \
|
||||
systemd-ask-password systemd-tty-ask-password-agent \
|
||||
/etc/udev/udev.hwdb \
|
||||
${NULL}
|
||||
|
||||
@@ -163,7 +164,7 @@ install() {
|
||||
|
||||
modules_load_get() {
|
||||
local _line i
|
||||
for i in "$1"/*.conf; do
|
||||
for i in "$dracutsysrootdir$1"/*.conf; do
|
||||
[[ -f $i ]] || continue
|
||||
while read _line || [ -n "$_line" ]; do
|
||||
case $_line in
|
||||
@@ -208,17 +209,17 @@ install() {
|
||||
|
||||
# install adm user/group for journald
|
||||
inst_multiple nologin
|
||||
grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^utmp:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^root:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-journal:' $dracutsysrootdir/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^adm:' $dracutsysrootdir/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-journal:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
grep '^wheel:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
grep '^adm:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
grep '^utmp:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
grep '^root:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
|
||||
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
|
||||
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-network:' $dracutsysrootdir/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
|
||||
ln_r $systemdutildir/systemd "/init"
|
||||
ln_r $systemdutildir/systemd "/sbin/init"
|
||||
@@ -240,9 +241,7 @@ install() {
|
||||
systemd-ask-password-console.service \
|
||||
systemd-ask-password-plymouth.service \
|
||||
; do
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/${i}.wants"
|
||||
ln_r "${systemdsystemunitdir}/systemd-vconsole-setup.service" \
|
||||
"${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
|
||||
systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
|
||||
done
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
@@ -254,6 +253,5 @@ install() {
|
||||
echo "RateLimitBurst=0"
|
||||
} >> "$initdir/etc/systemd/journald.conf"
|
||||
|
||||
ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
|
||||
systemctl -q --root "$initdir" set-default multi-user.target
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
# hwclock does not exist on S390(x), bail out silently then
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1
|
||||
|
||||
[ -e /etc/localtime -a -e /etc/adjtime ] || return 1
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif [ -z "$fipsmode" ]; then
|
||||
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
|
||||
elif getarg boot= >/dev/null; then
|
||||
. /sbin/fips.sh
|
||||
if mount_boot; then
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif [ -z "$fipsmode" ]; then
|
||||
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
|
||||
elif ! [ -f /tmp/fipsdone ]; then
|
||||
. /sbin/fips.sh
|
||||
mount_boot
|
||||
|
@@ -111,14 +111,21 @@ do_fips()
|
||||
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
|
||||
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
|
||||
elif [ -e "/run/install/repo/images/pxeboot/vmlinuz" ]; then
|
||||
# This is a boot.iso with the .hmac inside the install.img
|
||||
do_rhevh_check /run/install/repo/images/pxeboot/vmlinuz || return 1
|
||||
else
|
||||
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
|
||||
|
||||
# Trim off any leading GRUB boot device (e.g. ($root) )
|
||||
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"
|
||||
|
||||
BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}"
|
||||
BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}"
|
||||
|
||||
if [ -z "$BOOT_IMAGE_NAME" ]; then
|
||||
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
|
||||
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}" ]; then
|
||||
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
|
||||
#if /boot is not a separate partition BOOT_IMAGE might start with /boot
|
||||
BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
|
||||
#on some achitectures BOOT_IMAGE does not contain path to kernel
|
||||
@@ -129,13 +136,13 @@ do_fips()
|
||||
fi
|
||||
fi
|
||||
|
||||
BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}.${BOOT_IMAGE_NAME}.hmac"
|
||||
BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac"
|
||||
if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then
|
||||
warn "${BOOT_IMAGE_HMAC} does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sha512hmac -c "${BOOT_IMAGE_HMAC}" || return 1
|
||||
(cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
|
||||
fi
|
||||
|
||||
info "All initrd crypto checks done"
|
||||
|
@@ -27,7 +27,7 @@ installkernel() {
|
||||
_fipsmodules+="cipher_null des3_ede aes cfb "
|
||||
|
||||
# Modes/templates:
|
||||
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac "
|
||||
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac ofb cts "
|
||||
|
||||
# Compression algs:
|
||||
_fipsmodules+="deflate lzo zlib "
|
||||
|
@@ -36,6 +36,5 @@ install() {
|
||||
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
|
||||
$systemdsystemunitdir/initrd-parse-etc.service
|
||||
|
||||
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
|
||||
systemctl -q --root "$initdir" set-default initrd.target
|
||||
}
|
||||
|
||||
|
@@ -48,12 +48,12 @@ install() {
|
||||
|
||||
# inst_dir /var/lib/systemd/clock
|
||||
|
||||
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
# grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-network:' $dracutsysrootdir/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
# grep '^systemd-timesync:' $dracutsysrootdir/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# grep '^systemd-timesync:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
|
||||
_arch=$(uname -m)
|
||||
_arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \
|
||||
@@ -61,11 +61,11 @@ install() {
|
||||
|
||||
for i in \
|
||||
systemd-networkd-wait-online.service \
|
||||
systemd-networkd.service \
|
||||
systemd-networkd.socket
|
||||
# systemd-timesyncd.service
|
||||
systemd-networkd.service \
|
||||
systemd-networkd.socket
|
||||
# systemd-timesyncd.service
|
||||
do
|
||||
systemctl --root "$initdir" enable "$i"
|
||||
systemctl -q --root "$initdir" enable "$i"
|
||||
done
|
||||
}
|
||||
|
||||
|
@@ -12,8 +12,8 @@ check() {
|
||||
# do not include module in hostonly mode,
|
||||
# if no keys are present
|
||||
if [[ $hostonly ]]; then
|
||||
x=$(echo /lib/modules/keys/*)
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && return 255
|
||||
x=$(echo $dracutsysrootdir/lib/modules/keys/*)
|
||||
[[ "${x}" = "$dracutsysrootdir/lib/modules/keys/*" ]] && return 255
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -31,8 +31,8 @@ install() {
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh"
|
||||
|
||||
for x in /lib/modules/keys/* ; do
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && break
|
||||
inst_simple "${x}"
|
||||
for x in $dracutsysrootdir/lib/modules/keys/* ; do
|
||||
[[ "${x}" = "$dracutsysrootdir/lib/modules/keys/*" ]] && break
|
||||
inst_simple "${x#$dracutsysrootdir}"
|
||||
done
|
||||
}
|
||||
|
@@ -33,7 +33,6 @@ check() {
|
||||
install() {
|
||||
inst rngd
|
||||
inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service"
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
|
||||
ln -rfs "${initdir}${systemdsystemunitdir}/rngd.service" \
|
||||
"${initdir}${systemdsystemunitdir}/sysinit.target.wants/rngd.service"
|
||||
|
||||
systemctl -q --root "$initdir" add-wants sysinit.target rngd.service
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ install() {
|
||||
if dracut_module_included "systemd"; then
|
||||
unset FONT
|
||||
unset KEYMAP
|
||||
[[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf
|
||||
[[ -f $dracutsysrootdir/etc/vconsole.conf ]] && . $dracutsysrootdir/etc/vconsole.conf
|
||||
fi
|
||||
|
||||
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
|
||||
@@ -32,8 +32,8 @@ install() {
|
||||
local MAPS=$1
|
||||
local MAPNAME=${1%.map*}
|
||||
local map
|
||||
[[ ! -f $MAPS ]] && \
|
||||
MAPS=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*)
|
||||
[[ ! -f $dracutsysrootdir$MAPS ]] && \
|
||||
MAPS=$(find $dracutsysrootdir${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*)
|
||||
|
||||
for map in $MAPS; do
|
||||
KEYMAPS="$KEYMAPS $map "
|
||||
@@ -44,7 +44,7 @@ install() {
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $map | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
for FN in $(find $dracutsysrootdir${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
strstr "$KEYMAPS" " $FN " || findkeymap $FN
|
||||
done
|
||||
done
|
||||
@@ -87,8 +87,8 @@ install() {
|
||||
for map in ${item[1]//,/ }
|
||||
do
|
||||
map=(${map//-/ })
|
||||
if [[ -f "${item[0]}" ]]; then
|
||||
value=$(grep "^${map[0]}=" "${item[0]}")
|
||||
if [[ -f "$dracutsysrootdir${item[0]}" ]]; then
|
||||
value=$(grep "^${map[0]}=" "$dracutsysrootdir${item[0]}")
|
||||
value=${value#*=}
|
||||
echo "${map[1]:-${map[0]}}=${value}"
|
||||
fi
|
||||
@@ -116,9 +116,10 @@ install() {
|
||||
install_all_kbd() {
|
||||
local rel f
|
||||
|
||||
for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
|
||||
for __src in $(eval echo $dracutsysrootdir${kbddir}/{${KBDSUBDIRS}}); do
|
||||
_src=${__src#$dracutsysrootdir}
|
||||
inst_dir "$_src"
|
||||
$DRACUT_CP -L -t "${initdir}/${_src}" "$_src"/*
|
||||
$DRACUT_CP -L -t "${initdir}/${_src}" "$__src"/*
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
@@ -139,8 +140,8 @@ install() {
|
||||
local map
|
||||
|
||||
eval $(gather_vars ${i18n_vars})
|
||||
[ -f $I18N_CONF ] && . $I18N_CONF
|
||||
[ -f $VCONFIG_CONF ] && . $VCONFIG_CONF
|
||||
[ -f $dracutsysrootdir$I18N_CONF ] && . $dracutsysrootdir$I18N_CONF
|
||||
[ -f $dracutsysrootdir$VCONFIG_CONF ] && . $dracutsysrootdir$VCONFIG_CONF
|
||||
|
||||
shopt -q -s nocasematch
|
||||
if [[ ${UNICODE} ]]
|
||||
@@ -222,14 +223,14 @@ install() {
|
||||
inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then
|
||||
if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${I18N_CONF} ]]; then
|
||||
inst_simple ${I18N_CONF}
|
||||
else
|
||||
mksubdirs ${initdir}${I18N_CONF}
|
||||
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then
|
||||
if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then
|
||||
inst_simple ${VCONFIG_CONF}
|
||||
else
|
||||
mksubdirs ${initdir}${VCONFIG_CONF}
|
||||
@@ -242,16 +243,16 @@ install() {
|
||||
checks() {
|
||||
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
|
||||
do
|
||||
[[ -d "${kbddir}" ]] && \
|
||||
[[ -d "$dracutsysrootdir${kbddir}" ]] && \
|
||||
for dir in ${KBDSUBDIRS//,/ }
|
||||
do
|
||||
[[ -d "${kbddir}/${dir}" ]] && continue
|
||||
[[ -d "$dracutsysrootdir${kbddir}/${dir}" ]] && continue
|
||||
false
|
||||
done && break
|
||||
kbddir=''
|
||||
done
|
||||
|
||||
[[ -f $I18N_CONF && -f $VCONFIG_CONF ]] || \
|
||||
[[ -f $dracutsysrootdir$I18N_CONF && -f $dracutsysrootdir$VCONFIG_CONF ]] || \
|
||||
[[ ! ${hostonly} || ${i18n_vars} ]] || {
|
||||
derror 'i18n_vars not set! Please set up i18n_vars in ' \
|
||||
'configuration file.'
|
||||
|
@@ -75,8 +75,8 @@ setup_interface() {
|
||||
|
||||
setup_interface6() {
|
||||
domain=$new_domain_name
|
||||
search=$(printf -- "$new_domain_search")
|
||||
namesrv=$new_domain_name_servers
|
||||
search=$(printf -- "$new_dhcp6_domain_search")
|
||||
namesrv=$new_dhcp6_name_servers
|
||||
hostname=$new_host_name
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
@@ -146,7 +146,7 @@ parse_option_121() {
|
||||
temp_result="$destination via $gateway dev $interface"
|
||||
fi
|
||||
|
||||
echo "/sbin/ip route add $temp_result"
|
||||
echo "/sbin/ip route replace $temp_result"
|
||||
done
|
||||
}
|
||||
|
||||
|
@@ -50,8 +50,9 @@ do_dhcp() {
|
||||
while [ $_COUNT -lt $_DHCPRETRY ]; do
|
||||
info "Starting dhcp for interface $netif"
|
||||
dhclient "$@" \
|
||||
${_timeout:+-timeout $_timeout} \
|
||||
${_timeout:+--timeout $_timeout} \
|
||||
-q \
|
||||
-1 \
|
||||
-cf /etc/dhclient.conf \
|
||||
-pf /tmp/dhclient.$netif.pid \
|
||||
-lf /tmp/dhclient.$netif.lease \
|
||||
@@ -61,6 +62,9 @@ do_dhcp() {
|
||||
[ $_COUNT -lt $_DHCPRETRY ] && sleep 1
|
||||
done
|
||||
warn "dhcp for interface $netif failed"
|
||||
# nuke those files since we failed; we might retry dhcp again if it's e.g.
|
||||
# `ip=dhcp,dhcp6` and we check for the PID file at the top
|
||||
rm -f /tmp/dhclient.$netif.{pid,lease}
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -449,19 +453,15 @@ for p in $(getargs ip=); do
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any|dhcp6)
|
||||
;;
|
||||
*)
|
||||
if [ $ret -eq 0 ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# and finally, finish interface set up if there isn't already a script
|
||||
# to do so (which is the case in the dhcp path)
|
||||
if [ ! -e $hookdir/initqueue/setup_net_$netif.sh ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
fi
|
||||
fi
|
||||
|
||||
if command -v wicked >/dev/null && [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
|
@@ -82,7 +82,7 @@ install() {
|
||||
)
|
||||
done
|
||||
|
||||
_arch=$(uname -m)
|
||||
_arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
|
||||
|
@@ -65,9 +65,9 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
bootdev=$(cat /tmp/net.bootdev)
|
||||
fi
|
||||
|
||||
ifup='/sbin/ifup $env{INTERFACE}'
|
||||
ifup='/sbin/ifup $name'
|
||||
|
||||
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
|
||||
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$name --unique --onetime $ifup\""
|
||||
|
||||
# We have some specific interfaces to handle
|
||||
if [ -n "${RAW_IFACES}${IFACES}" ]; then
|
||||
@@ -96,7 +96,11 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
for iface in $IFACES; do
|
||||
if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
|
||||
echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
|
||||
if [ -n "$netroot" ] && [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
echo "systemctl is-active initrd-root-device.target || [ -f /tmp/net.${iface}.did-setup ]"
|
||||
else
|
||||
echo "[ -f /tmp/net.${iface}.did-setup ]"
|
||||
fi >$hookdir/initqueue/finished/wait-$iface.sh
|
||||
fi
|
||||
done
|
||||
# Default: We don't know the interface to use, handle all
|
||||
|
@@ -26,7 +26,9 @@ install() {
|
||||
|
||||
_nm_version=$(NetworkManager --version)
|
||||
|
||||
inst_multiple sed grep
|
||||
# We don't need `ip` but having it is *really* useful for people debugging
|
||||
# in an emergency shell.
|
||||
inst_multiple ip sed grep
|
||||
|
||||
inst NetworkManager
|
||||
inst /usr/libexec/nm-initrd-generator
|
||||
|
@@ -1,12 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
|
||||
else
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
|
||||
fi
|
||||
for i in /usr/lib/NetworkManager/system-connections/* \
|
||||
/run/NetworkManager/system-connections/* \
|
||||
/etc/NetworkManager/system-connections/* \
|
||||
/etc/sysconfig/network-scripts/ifcfg-*; do
|
||||
[ -f "$i" ] || continue
|
||||
if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
|
||||
else
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
for _i in /sys/class/net/*/
|
||||
for _i in /sys/class/net/*
|
||||
do
|
||||
state=/run/NetworkManager/devices/$(cat $_i/ifindex)
|
||||
grep -q connection-uuid= $state 2>/dev/null || continue
|
||||
|
@@ -8,7 +8,7 @@ check() {
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo -n "kernel-network-modules "
|
||||
if ! dracut_module_included "network-legacy" && [ -x "/usr/libexec/nm-initrd-generator" ] ; then
|
||||
if ! dracut_module_included "network-legacy" && [ -x "$dracutsysrootdir/usr/libexec/nm-initrd-generator" ] ; then
|
||||
echo "network-manager"
|
||||
else
|
||||
echo "network-legacy"
|
||||
|
@@ -251,8 +251,10 @@ ibft_to_cmdline() {
|
||||
[ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a)
|
||||
# Skip invalid interfaces
|
||||
(( $flags & 1 )) || continue
|
||||
# Skip interfaces not used for booting
|
||||
(( $flags & 2 )) || continue
|
||||
# Skip interfaces not used for booting unless using multipath
|
||||
if ! getargbool 0 rd.iscsi.mp ; then
|
||||
(( $flags & 2 )) || continue
|
||||
fi
|
||||
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
[ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a)
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
@@ -655,7 +657,6 @@ wait_for_ipv6_dad_link() {
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link)" ] \
|
||||
&& [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
|
||||
&& return 1
|
||||
@@ -718,7 +719,7 @@ iface_has_carrier() {
|
||||
interface="/sys/class/net/$interface"
|
||||
[ -d "$interface" ] || return 2
|
||||
local timeout="$(getargs rd.net.timeout.carrier=)"
|
||||
timeout=${timeout:-5}
|
||||
timeout=${timeout:-10}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
linkup "$1"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ -d /etc/sysconfig/network-scripts ]] && return 0
|
||||
[[ -d $dracutsysrootdir/etc/sysconfig/network-scripts ]] && return 0
|
||||
return 255
|
||||
}
|
||||
|
||||
|
@@ -270,7 +270,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
done
|
||||
fi
|
||||
i=1
|
||||
for ns in $(getargs nameserver); do
|
||||
for ns in $(getargs nameserver) $dns1 $dns2; do
|
||||
echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif
|
||||
i=$((i+1))
|
||||
done
|
||||
|
@@ -26,14 +26,14 @@ install() {
|
||||
inst_libdir_file "libsqlite3.so*"
|
||||
|
||||
for _dir in $libdirs; do
|
||||
[[ -d $_dir ]] || continue
|
||||
for _lib in $_dir/libcurl.so.*; do
|
||||
[[ -d $dracutsysrootdir$_dir ]] || continue
|
||||
for _lib in $dracutsysrootdir$_dir/libcurl.so.*; do
|
||||
[[ -e $_lib ]] || continue
|
||||
[[ $_nssckbi ]] || _nssckbi=$(grep -F --binary-files=text -z libnssckbi $_lib)
|
||||
_crt=$(grep -F --binary-files=text -z .crt $_lib)
|
||||
[[ $_crt ]] || continue
|
||||
[[ $_crt == /*/* ]] || continue
|
||||
if ! inst "$_crt"; then
|
||||
if ! inst "${_crt#$dracutsysrootdir}"; then
|
||||
dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work."
|
||||
continue
|
||||
fi
|
||||
@@ -49,23 +49,23 @@ install() {
|
||||
_found=1
|
||||
inst_libdir_file "libnssckbi.so*" || _found=
|
||||
for _dir in $libdirs; do
|
||||
[[ -e $_dir/libnssckbi.so ]] || continue
|
||||
[[ -e $dracutsysrootdir$_dir/libnssckbi.so ]] || continue
|
||||
# this looks for directory-ish strings in the file
|
||||
for _p11roots in $(grep -o --binary-files=text "/[[:alpha:]][[:print:]]*" $_dir/libnssckbi.so) ; do
|
||||
for _p11roots in $(grep -o --binary-files=text "/[[:alpha:]][[:print:]]*" $dracutsysrootdir$_dir/libnssckbi.so) ; do
|
||||
# the string can be a :-separated list of dirs
|
||||
for _p11root in $(echo "$_p11roots" | tr ':' '\n') ; do
|
||||
# check if it's actually a directory (there are
|
||||
# several false positives in the results)
|
||||
[[ -d "$_p11root" ]] || continue
|
||||
[[ -d "$dracutsysrootdir$_p11root" ]] || continue
|
||||
# check if it has some specific subdirs that all
|
||||
# p11-kit trust dirs have
|
||||
[[ -d "${_p11root}/anchors" ]] || continue
|
||||
[[ -d "${_p11root}/blacklist" ]] || continue
|
||||
[[ -d "$dracutsysrootdir${_p11root}/anchors" ]] || continue
|
||||
[[ -d "$dracutsysrootdir${_p11root}/blacklist" ]] || continue
|
||||
# so now we know it's really a p11-kit trust dir;
|
||||
# install everything in it
|
||||
for _p11item in $(find "$_p11root") ; do
|
||||
if ! inst "$_p11item" ; then
|
||||
dwarn "Couldn't install '$_p11item' from p11-kit trust dir '$_p11root'; HTTPS might not work."
|
||||
for _p11item in $(find "$dracutsysrootdir$_p11root") ; do
|
||||
if ! inst "${_p11item#$dracutsysrootdir}" ; then
|
||||
dwarn "Couldn't install '${_p11item#$dracutsysrootdir}' from p11-kit trust dir '${_p11root#$dracutsysrootdir}'; HTTPS might not work."
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
@@ -15,7 +15,7 @@ installkernel() {
|
||||
local _modname
|
||||
# Include KMS capable drm drivers
|
||||
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
|
||||
if [[ "${DRACUT_ARCH:-$(uname -m)}" == arm* || "${DRACUT_ARCH:-$(uname -m)}" == aarch64 ]]; then
|
||||
# arm/aarch64 specific modules needed by drm
|
||||
instmods \
|
||||
"=drivers/gpu/drm/i2c" \
|
||||
@@ -40,6 +40,6 @@ installkernel() {
|
||||
fi
|
||||
done
|
||||
else
|
||||
dracut_instmods -o -s "drm_crtc_init" "=drivers/gpu/drm" "=drivers/staging"
|
||||
dracut_instmods -o -s "drm_crtc_init|drm_dev_register" "=drivers/gpu/drm" "=drivers/staging"
|
||||
fi
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ install() {
|
||||
_splash_res=${DRACUT_GENSPLASH_RES}
|
||||
elif [[ ${hostonly} ]]; then
|
||||
# Settings from config only in hostonly
|
||||
[[ -e /etc/conf.d/splash ]] && source /etc/conf.d/splash
|
||||
[[ -e $dracutsysrootdir/etc/conf.d/splash ]] && source $dracutsysrootdir/etc/conf.d/splash
|
||||
[[ ! ${_splash_theme} ]] && _splash_theme=default
|
||||
[[ ${_splash_res} ]] && _opts+=" -r ${_splash_res}"
|
||||
else
|
||||
|
@@ -6,7 +6,7 @@ pkglib_dir() {
|
||||
_dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
|
||||
fi
|
||||
for _dir in $_dirs; do
|
||||
if [ -x $_dir/plymouth-populate-initrd ]; then
|
||||
if [ -x $dracutsysrootdir$_dir/plymouth-populate-initrd ]; then
|
||||
echo $_dir
|
||||
return
|
||||
fi
|
||||
@@ -29,12 +29,12 @@ depends() {
|
||||
# called by dracut
|
||||
install() {
|
||||
PKGLIBDIR=$(pkglib_dir)
|
||||
if grep -q nash ${PKGLIBDIR}/plymouth-populate-initrd \
|
||||
|| [ ! -x ${PKGLIBDIR}/plymouth-populate-initrd ]; then
|
||||
if grep -q nash $dracutsysrootdir${PKGLIBDIR}/plymouth-populate-initrd \
|
||||
|| [ ! -x $dracutsysrootdir${PKGLIBDIR}/plymouth-populate-initrd ]; then
|
||||
. "$moddir"/plymouth-populate-initrd.sh
|
||||
else
|
||||
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
|
||||
${PKGLIBDIR}/plymouth-populate-initrd -t "$initdir"
|
||||
$dracutsysrootdir${PKGLIBDIR}/plymouth-populate-initrd -t "$initdir"
|
||||
fi
|
||||
|
||||
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
|
||||
|
@@ -17,25 +17,25 @@ if [[ $hostonly ]]; then
|
||||
"/usr/share/plymouth/themes/details/details.plymouth" \
|
||||
"/usr/share/plymouth/themes/text/text.plymouth" \
|
||||
|
||||
if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
|
||||
if [[ -d $dracutsysrootdir/usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
|
||||
for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do
|
||||
[[ -f "$x" ]] || break
|
||||
[[ -f "$dracutsysrootdir$x" ]] || break
|
||||
inst $x
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
if [ -L $dracutsysrootdir/usr/share/plymouth/themes/default.plymouth ]; then
|
||||
inst /usr/share/plymouth/themes/default.plymouth
|
||||
# Install plugin for this theme
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c || [ -n "$b" ]; do echo $b; done;)
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" $dracutsysrootdir/usr/share/plymouth/themes/default.plymouth | while read a b c || [ -n "$b" ]; do echo $b; done;)
|
||||
inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
|
||||
fi
|
||||
else
|
||||
for x in /usr/share/plymouth/themes/{text,details}/* ; do
|
||||
for x in $dracutsysrootdir/usr/share/plymouth/themes/{text,details}/* ; do
|
||||
[[ -f "$x" ]] || continue
|
||||
THEME_DIR=$(dirname "$x")
|
||||
THEME_DIR=$(dirname "${x#$dracutsysrootdir}")
|
||||
mkdir -m 0755 -p "${initdir}/$THEME_DIR"
|
||||
inst_multiple "$x"
|
||||
inst_multiple "${x#$dracutsysrootdir}"
|
||||
done
|
||||
(
|
||||
cd ${initdir}/usr/share/plymouth/themes;
|
||||
|
@@ -164,11 +164,11 @@ processcmsfile()
|
||||
driver=$NETTYPE
|
||||
fi
|
||||
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$name /sbin/cmsifup $name"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
# remove the default net rules
|
||||
rm -f -- /etc/udev/rules.d/91-default-net.rules
|
||||
[[ -f /etc/udev/rules.d/90-net.rules ]] \
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$name source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
udevadm control --reload
|
||||
znet_cio_free
|
||||
fi
|
||||
|
@@ -2,14 +2,14 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
arch=$(uname -m)
|
||||
arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
arch=$(uname -m)
|
||||
arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
echo znet zfcp dasd dasd_mod
|
||||
return 0
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
# do not add this module by default
|
||||
local arch=$(uname -m)
|
||||
local arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ crypttab_contains "$luks" "$dev" && exit 0
|
||||
allowdiscards="-"
|
||||
|
||||
# parse for allow-discards
|
||||
if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if [ -n "$DRACUT_SYSTEMD" ] || strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
discarduuids=$(str_replace "$discarduuids" 'luks-' '')
|
||||
if strstr " $discarduuids " " ${luks##luks-}"; then
|
||||
|
@@ -28,6 +28,7 @@ installkernel() {
|
||||
arch=$(uname -m)
|
||||
[[ $arch == x86_64 ]] && arch=x86
|
||||
[[ $arch == s390x ]] && arch=s390
|
||||
[[ $arch == aarch64 ]] && arch=arm64
|
||||
instmods dm_crypt =crypto =drivers/crypto =arch/$arch/crypto
|
||||
}
|
||||
|
||||
@@ -67,7 +68,7 @@ install() {
|
||||
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
|
||||
fi
|
||||
|
||||
if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then
|
||||
if [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/crypttab ]]; then
|
||||
# filter /etc/crypttab for the devices we need
|
||||
while read _mapper _dev _luksfile _luksoptions || [ -n "$_mapper" ]; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
@@ -113,11 +114,12 @@ install() {
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done < /etc/crypttab > $initdir/etc/crypttab
|
||||
done < $dracutsysrootdir/etc/crypttab > $initdir/etc/crypttab
|
||||
mark_hostonly /etc/crypttab
|
||||
fi
|
||||
|
||||
inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
|
||||
inst_script "$moddir/crypt-run-generator.sh" "/sbin/crypt-run-generator"
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_multiple -o \
|
||||
@@ -128,7 +130,6 @@ install() {
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
|
||||
systemd-ask-password systemd-tty-ask-password-agent
|
||||
inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
|
||||
fi
|
||||
|
||||
dracut_need_initqueue
|
||||
|
@@ -6,6 +6,7 @@ check() {
|
||||
# if we don't have dmraid installed on the host system, no point
|
||||
# in trying to support it in the initramfs.
|
||||
require_binaries dmraid || return 1
|
||||
require_binaries kpartx || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for dev in "${!host_fs_types[@]}"; do
|
||||
|
@@ -18,3 +18,9 @@ if [ -h /dev/root ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then
|
||||
done
|
||||
umount $NEWROOT/run
|
||||
fi
|
||||
# release resources on iso-scan boots with rd.live.ram
|
||||
if [ -d /run/initramfs/isoscan ] &&
|
||||
[ -f /run/initramfs/squashed.img -o -f /run/initramfs/rootfs.img ]; then
|
||||
umount --detach-loop /run/initramfs/live
|
||||
umount /run/initramfs/isoscan
|
||||
fi
|
||||
|
@@ -2,6 +2,8 @@
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
|
||||
|
||||
find_kernel_modules_external () {
|
||||
local _OLDIFS
|
||||
local external_pattern="^/"
|
||||
@@ -16,11 +18,25 @@ installkernel() {
|
||||
done < "$srcmods/modules.dep"
|
||||
IFS=$_OLDIFS
|
||||
}
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
|
||||
|
||||
is_block_dev() {
|
||||
[ -e /sys/dev/block/$1 ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
install_block_modules () {
|
||||
hostonly='' instmods sr_mod sd_mod scsi_dh ata_piix
|
||||
instmods \
|
||||
scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
=ide nvme vmd nfit \
|
||||
virtio_blk
|
||||
|
||||
dracut_instmods -o -s "${_blockfuncs}" "=drivers"
|
||||
}
|
||||
|
||||
if [[ -z $drivers ]]; then
|
||||
hostonly='' instmods \
|
||||
sr_mod sd_mod scsi_dh ata_piix hid_generic unix \
|
||||
hid_generic unix \
|
||||
ehci-hcd ehci-pci ehci-platform \
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
@@ -35,15 +51,16 @@ installkernel() {
|
||||
"=drivers/input/keyboard" \
|
||||
"=drivers/usb/storage" \
|
||||
"=drivers/pci/host" \
|
||||
"=drivers/pci/controller" \
|
||||
${NULL}
|
||||
|
||||
instmods \
|
||||
yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
yenta_socket \
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
|
||||
virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
|
||||
"=drivers/pcmcia" =ide nvme vmd nfit
|
||||
virtio virtio_ring virtio_pci virtio_scsi \
|
||||
"=drivers/pcmcia"
|
||||
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
|
||||
if [[ "${DRACUT_ARCH:-$(uname -m)}" == arm* || "${DRACUT_ARCH:-$(uname -m)}" == aarch64 ]]; then
|
||||
# arm/aarch64 specific modules
|
||||
_blockfuncs+='|dw_mc_probe|dw_mci_pltfm_register'
|
||||
instmods \
|
||||
@@ -72,10 +89,12 @@ installkernel() {
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
dracut_instmods -o -s "${_blockfuncs}" "=drivers"
|
||||
|
||||
find_kernel_modules_external | instmods
|
||||
|
||||
if ! [[ $hostonly ]] || for_each_host_dev_and_slaves is_block_dev; then
|
||||
install_block_modules
|
||||
fi
|
||||
|
||||
# if not on hostonly mode, install all known filesystems,
|
||||
# if the required list is not set via the filesystems variable
|
||||
if ! [[ $hostonly ]]; then
|
||||
|
@@ -13,7 +13,7 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
|
||||
|
||||
|
@@ -6,6 +6,8 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
. /lib/url-lib.sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
RETRIES=${RETRIES:-100}
|
||||
SLEEP=${SLEEP:-5}
|
||||
|
||||
[ -e /tmp/livenet.downloaded ] && exit 0
|
||||
|
||||
@@ -13,14 +15,32 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
netroot="$2"
|
||||
liveurl="${netroot#livenet:}"
|
||||
info "fetching $liveurl"
|
||||
imgfile=$(fetch_url "$liveurl")
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
warn "failed to download live image: error $?"
|
||||
exit 1
|
||||
fi
|
||||
imgfile=
|
||||
#retry until the imgfile is populated with data or the max retries
|
||||
i=1
|
||||
while [ "$i" -le $RETRIES ]
|
||||
do
|
||||
imgfile=$(fetch_url "$liveurl")
|
||||
|
||||
> /tmp/livenet.downloaded
|
||||
if [ $? != 0 ]; then
|
||||
warn "failed to download live image: error $?"
|
||||
imgfile=
|
||||
fi
|
||||
|
||||
if [ ! -z "$imgfile" -a -s "$imgfile" ]; then
|
||||
break
|
||||
else
|
||||
if [ $i -ge $RETRIES ]; then
|
||||
warn "failed to download live image after $i attempts."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep $SLEEP
|
||||
fi
|
||||
|
||||
i=$((i + 1))
|
||||
done > /tmp/livenet.downloaded
|
||||
|
||||
# TODO: couldn't dmsquash-live-root handle this?
|
||||
if [ ${imgfile##*.} = "iso" ]; then
|
||||
|
@@ -60,7 +60,7 @@ install() {
|
||||
inst_rules "$moddir/64-lvm.rules"
|
||||
|
||||
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
||||
if [ -f /etc/lvm/lvm.conf ]; then
|
||||
if [ -f $dracutsysrootdir/etc/lvm/lvm.conf ]; then
|
||||
inst_simple -H /etc/lvm/lvm.conf
|
||||
# FIXME: near-term hack to establish read-only locking;
|
||||
# use command-line lvm.conf editor once it is available
|
||||
@@ -70,7 +70,7 @@ install() {
|
||||
|
||||
export LVM_SUPPRESS_FD_WARNINGS=1
|
||||
# Also install any files needed for LVM system id support.
|
||||
if [ -f /etc/lvm/lvmlocal.conf ]; then
|
||||
if [ -f $dracutsysrootdir/etc/lvm/lvmlocal.conf ]; then
|
||||
inst_simple -H /etc/lvm/lvmlocal.conf
|
||||
fi
|
||||
eval $(lvm dumpconfig global/system_id_source &>/dev/null)
|
||||
|
@@ -104,16 +104,16 @@ install() {
|
||||
fi
|
||||
|
||||
if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
|
||||
if [ -f /etc/mdadm.conf ]; then
|
||||
if [ -f $dracutsysrootdir/etc/mdadm.conf ]; then
|
||||
inst -H /etc/mdadm.conf
|
||||
else
|
||||
[ -f /etc/mdadm/mdadm.conf ] && inst -H /etc/mdadm/mdadm.conf /etc/mdadm.conf
|
||||
[ -f $dracutsysrootdir/etc/mdadm/mdadm.conf ] && inst -H /etc/mdadm/mdadm.conf /etc/mdadm.conf
|
||||
fi
|
||||
if [ -d /etc/mdadm.conf.d ]; then
|
||||
if [ -d $dracutsysrootdir/etc/mdadm.conf.d ]; then
|
||||
local f
|
||||
inst_dir /etc/mdadm.conf.d
|
||||
for f in /etc/mdadm.conf.d/*.conf; do
|
||||
[ -f "$f" ] || continue
|
||||
[ -f "$dracutsysrootdir$f" ] || continue
|
||||
inst -H "$f"
|
||||
done
|
||||
fi
|
||||
@@ -127,13 +127,13 @@ install() {
|
||||
inst_script "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup
|
||||
inst_script "$moddir/mdraid_start.sh" /sbin/mdraid_start
|
||||
if dracut_module_included "systemd"; then
|
||||
if [ -e $systemdsystemunitdir/mdmon@.service ]; then
|
||||
if [ -e $dracutsysrootdir$systemdsystemunitdir/mdmon@.service ]; then
|
||||
inst_simple $systemdsystemunitdir/mdmon@.service
|
||||
fi
|
||||
if [ -e $systemdsystemunitdir/mdadm-last-resort@.service ]; then
|
||||
if [ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.service ]; then
|
||||
inst_simple $systemdsystemunitdir/mdadm-last-resort@.service
|
||||
fi
|
||||
if [ -e $systemdsystemunitdir/mdadm-last-resort@.timer ]; then
|
||||
if [ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.timer ]; then
|
||||
inst_simple $systemdsystemunitdir/mdadm-last-resort@.timer
|
||||
fi
|
||||
fi
|
||||
|
@@ -29,6 +29,7 @@ check() {
|
||||
|
||||
# if there's no multipath binary, no go.
|
||||
require_binaries multipath || return 1
|
||||
require_binaries kpartx || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
@@ -52,7 +53,7 @@ cmdline() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _ret
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
|
||||
local _s390
|
||||
|
||||
@@ -109,8 +110,7 @@ install() {
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
|
||||
ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service"
|
||||
systemctl -q --root "$initdir" enable multipathd.service
|
||||
else
|
||||
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
|
||||
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
|
||||
|
29
modules.d/90ppcmac/load-thermal.sh
Normal file
29
modules.d/90ppcmac/load-thermal.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This hook attempts to load the appropriate thermal modules
|
||||
# for PowerPC Macs depending on the specific machine you have.
|
||||
|
||||
[ -r /proc/cpuinfo ] || exit 0
|
||||
|
||||
load_windfarm() {
|
||||
local pm_model="$(sed -n '/model/p' /proc/cpuinfo)"
|
||||
pm_model="${pm_model##*: }"
|
||||
|
||||
# load quietly and respect the blacklist
|
||||
# this way if the modules are for some reason missing, it will
|
||||
# still exit successfully and not affect the boot process
|
||||
case "$pm_model" in
|
||||
PowerMac3,6) modprobe -b -q therm_windtunnel ;;
|
||||
PowerMac7,2|PowerMac7,3) modprobe -b -q windfarm_pm72 ;;
|
||||
PowerMac8,1|PowerMac8,2) modprobe -b -q windfarm_pm81 ;;
|
||||
PowerMac9,1) modprobe -b -q windfarm_pm91 ;;
|
||||
PowerMac11,2) modprobe -b -q windfarm_pm112 ;;
|
||||
PowerMac12,1) modprobe -b -q windfarm_pm121 ;;
|
||||
RackMac3,1) modprobe -b -q windfarm_rm31 ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
load_windfarm
|
82
modules.d/90ppcmac/module-setup.sh
Normal file
82
modules.d/90ppcmac/module-setup.sh
Normal file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This module attempts to properly deal with thermal behavior on PowerPC
|
||||
# based Mac systems, by installing the model-appropriate (when hostonly)
|
||||
# or all (when not) fan control/thermal kernel modules and loading them
|
||||
# in a hook.
|
||||
#
|
||||
# While this is not strictly necessary for all kernels, particularly
|
||||
# modular kernels will not autoload those drivers, even once the full
|
||||
# system is up, which results in the fans spinning up to 100%; this is
|
||||
# particularly annoying on live systems, where the system takes a while
|
||||
# to load, so it's best to load the drivers early in initramfs stage.
|
||||
#
|
||||
# The behavior of this is inspired by the thermal hook in Debian's
|
||||
# initramfs-tools, but written for dracut specifically and updated
|
||||
# for modern kernels (2012+).
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch="$(uname -m)"
|
||||
# only for PowerPC Macs
|
||||
[[ "$_arch" == ppc* && "$_arch" != ppc*le ]] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
pmac_model() {
|
||||
local pm_model="$(grep model /proc/cpuinfo)"
|
||||
echo "${pm_model##*: }"
|
||||
}
|
||||
|
||||
# only PowerMac3,6 has a module, special case
|
||||
if [[ "$(uname -m)" == ppc ]]; then
|
||||
if ! [[ $hostonly ]] || [[ "$(pmac_model)" == "PowerMac3,6" ]]; then
|
||||
instmods therm_windtunnel
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
windfarm_modules() {
|
||||
if ! [[ $hostonly ]]; then
|
||||
# include all drivers when not hostonly
|
||||
instmods \
|
||||
windfarm_pm72 windfarm_pm81 windfarm_pm91 windfarm_pm112 \
|
||||
windfarm_pm121 windfarm_rm31
|
||||
else
|
||||
# guess model specific module, then install the rest
|
||||
case "$(pmac_model)" in
|
||||
PowerMac7,2|PowerMac7,3) instmods windfarm_pm72 ;;
|
||||
PowerMac8,1|PowerMac8,2) instmods windfarm_pm81 ;;
|
||||
PowerMac9,1) instmods windfarm_pm91 ;;
|
||||
PowerMac11,2) instmods windfarm_pm112 ;;
|
||||
PowerMac12,1) instmods windfarm_pm121 ;;
|
||||
RackMac3,1) instmods windfarm_rm31 ;;
|
||||
# no match, so skip installation of the rest
|
||||
*) return 1 ;;
|
||||
esac
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# hostonly and didn't match a model; skip installing other modules
|
||||
windfarm_modules || return 0
|
||||
# these are all required by the assorted windfarm_pm*
|
||||
instmods \
|
||||
windfarm_core windfarm_cpufreq_clamp windfarm_pid \
|
||||
windfarm_smu_controls windfarm_smu_sat windfarm_smu_sensors \
|
||||
windfarm_fcu_controls windfarm_ad7417_sensor windfarm_max6690_sensor \
|
||||
windfarm_lm75_sensor windfarm_lm87_sensor
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
# this will attempt to load the appropriate modules
|
||||
inst_hook pre-udev 99 "$moddir/load-thermal.sh"
|
||||
}
|
@@ -24,10 +24,9 @@ install() {
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_simple "${moddir}/stratisd-init.service" "${systemdsystemunitdir}/stratisd-init.service"
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
|
||||
ln -rfs "${initdir}${systemdsystemunitdir}/stratisd-init.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/stratisd-init.service"
|
||||
systemctl -q --root "$initdir" enable stratisd-init.service
|
||||
else
|
||||
inst_hook cmdline 25 "$moddir/stratisd-start.sh"
|
||||
inst_hook pre-mount 25 "$moddir/stratisd-start.sh"
|
||||
inst_hook cleanup 25 "$moddir/stratisd-stop.sh"
|
||||
fi
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ install() {
|
||||
inst_multiple gpg-agent
|
||||
inst_multiple gpg-connect-agent
|
||||
inst_multiple /usr/libexec/scdaemon
|
||||
cp "$(sc_public_key)" "${initdir}/root/"
|
||||
cp "$dracutsysrootdir$(sc_public_key)" "${initdir}/root/"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ sc_supported() {
|
||||
require_binaries gpg-agent &&
|
||||
require_binaries gpg-connect-agent &&
|
||||
require_binaries /usr/libexec/scdaemon &&
|
||||
(ldd /usr/libexec/scdaemon | grep libusb > /dev/null); then
|
||||
($DRACUT_LDD $dracutsysrootdir/usr/libexec/scdaemon | grep libusb > /dev/null); then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@@ -54,7 +54,7 @@ sc_supported() {
|
||||
}
|
||||
|
||||
sc_requested() {
|
||||
if [ -f "$(sc_public_key)" ]; then
|
||||
if [ -f "$dracutsysrootdir$(sc_public_key)" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
# Only for systems on s390 using indirect booting via userland grub
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
|
||||
# /boot/zipl contains a first stage kernel used to launch grub in initrd
|
||||
|
@@ -41,7 +41,7 @@ install() {
|
||||
|
||||
inst_libdir_file 'libcap-ng.so*'
|
||||
|
||||
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
|
||||
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' $dracutsysrootdir/etc/nsswitch.conf \
|
||||
| tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
||||
_nsslibs=${_nsslibs#|}
|
||||
_nsslibs=${_nsslibs%|}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
|
||||
require_binaries normalize_dasd_arg || return 1
|
||||
return 0
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
|
||||
require_binaries grep sed seq
|
||||
|
||||
|
@@ -18,7 +18,7 @@ cmdline() {
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
local found=0
|
||||
local bdev
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
@@ -18,6 +18,6 @@ install() {
|
||||
tcpdump cp dd less hostname mkdir systemd-analyze \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck
|
||||
|
||||
grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^tcpdump:' $dracutsysrootdir/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
}
|
||||
|
||||
|
@@ -7,10 +7,10 @@
|
||||
# Write udev rules
|
||||
{
|
||||
if [ -n "$fcoe_mac" ] ; then
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode"
|
||||
else
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$name /sbin/fcoe-up $name %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode"
|
||||
fi
|
||||
} >> /etc/udev/rules.d/92-fcoe.rules
|
||||
|
@@ -92,7 +92,7 @@ cmdline() {
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool fcoemon fcoeadm
|
||||
if [ -e "/etc/hba.conf" ]; then
|
||||
if [ -e "$dracutsysrootdir/etc/hba.conf" ]; then
|
||||
inst_libdir_file 'libhbalinux.so*'
|
||||
inst_simple "/etc/hba.conf"
|
||||
fi
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
test -f /etc/fstab.sys || [[ -n $add_fstab || -n $fstab_lines ]]
|
||||
test -f $dracutsysrootdir/etc/fstab.sys || [[ -n $add_fstab || -n $fstab_lines ]]
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -12,6 +12,6 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
[ -f /etc/fstab.sys ] && inst_simple /etc/fstab.sys
|
||||
[ -f $dracutsysrootdir/etc/fstab.sys ] && inst_simple /etc/fstab.sys
|
||||
inst_hook pre-pivot 00 "$moddir/mount-sys.sh"
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && killproc iscsiuio
|
||||
|
||||
if [ -z "${DRACUT_SYSTEMD}" ] && ( [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ] ) ; then
|
||||
killproc iscsiuio
|
||||
fi
|
||||
|
@@ -36,9 +36,12 @@ iroot=${iroot#:}
|
||||
# figured out a way how to check whether this is built-in or not
|
||||
modprobe crc32c 2>/dev/null
|
||||
|
||||
if [ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then
|
||||
iscsiuio
|
||||
> /tmp/iscsiuio-started
|
||||
# start iscsiuio if needed
|
||||
if [ -z "${DRACUT_SYSTEMD}" ] && \
|
||||
( [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ] ) && \
|
||||
! [ -e /tmp/iscsiuio-started ]; then
|
||||
iscsiuio
|
||||
> /tmp/iscsiuio-started
|
||||
fi
|
||||
|
||||
|
||||
@@ -54,11 +57,11 @@ handle_firmware()
|
||||
if ! iscsiadm -m fw; then
|
||||
warn "iscsiadm: Could not get list of targets from firmware."
|
||||
else
|
||||
ifaces=( $(echo /sys/firmware/ibft/ethernet*) )
|
||||
ifaces=$(set -- /sys/firmware/ibft/ethernet*; echo $#)
|
||||
retry=$(cat /tmp/session-retry)
|
||||
|
||||
if [ $retry -lt ${#ifaces[*]} ]; then
|
||||
let retry++
|
||||
if [ $retry -lt $ifaces ]; then
|
||||
retry=$((retry+1))
|
||||
echo $retry > /tmp/session-retry
|
||||
return 1
|
||||
else
|
||||
@@ -87,17 +90,12 @@ handle_netroot()
|
||||
local iscsi_in_username iscsi_in_password
|
||||
local iscsi_iface_name iscsi_netdev_name
|
||||
local iscsi_param param
|
||||
local p
|
||||
local p found
|
||||
local login_retry_max_seen=
|
||||
|
||||
# override conf settings by command line options
|
||||
arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=)
|
||||
[ -n "$arg" ] && iscsi_initiator=$arg
|
||||
arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=)
|
||||
[ -n "$arg" ] && iscsi_target_name=$arg
|
||||
arg=$(getarg rd.iscsi.target.ip -d iscsi_target_ip)
|
||||
[ -n "$arg" ] && iscsi_target_ip=$arg
|
||||
arg=$(getarg rd.iscsi.target.port -d iscsi_target_port=)
|
||||
[ -n "$arg" ] && iscsi_target_port=$arg
|
||||
arg=$(getarg rd.iscsi.target.group -d iscsi_target_group=)
|
||||
[ -n "$arg" ] && iscsi_target_group=$arg
|
||||
arg=$(getarg rd.iscsi.username -d iscsi_username=)
|
||||
@@ -109,9 +107,13 @@ handle_netroot()
|
||||
arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=)
|
||||
[ -n "$arg" ] && iscsi_in_password=$arg
|
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do
|
||||
iscsi_param="$iscsi_param $p"
|
||||
[ "${p%=*}" = node.session.initial_login_retry_max ] && \
|
||||
login_retry_max_seen=yes
|
||||
iscsi_param="$iscsi_param $p"
|
||||
done
|
||||
|
||||
# this sets iscsi_target_name and possibly overwrites most
|
||||
# parameters read from the command line above
|
||||
parse_iscsi_root "$1" || return 1
|
||||
|
||||
# Bail out early, if there is no route to the destination
|
||||
@@ -120,15 +122,12 @@ handle_netroot()
|
||||
fi
|
||||
|
||||
#limit iscsistart login retries
|
||||
case "$iscsi_param" in
|
||||
*node.session.initial_login_retry_max*) ;;
|
||||
*)
|
||||
retries=$(getargnum 3 0 10000 rd.iscsi.login_retry_max)
|
||||
if [ $retries -gt 0 ]; then
|
||||
iscsi_param="${iscsi_param% } node.session.initial_login_retry_max=$retries"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [ "$login_retry_max_seen" != yes ]; then
|
||||
retries=$(getargnum 3 0 10000 rd.iscsi.login_retry_max)
|
||||
if [ $retries -gt 0 ]; then
|
||||
iscsi_param="${iscsi_param% } node.session.initial_login_retry_max=$retries"
|
||||
fi
|
||||
fi
|
||||
|
||||
# XXX is this needed?
|
||||
getarg ro && iscsirw=ro
|
||||
@@ -217,10 +216,9 @@ handle_netroot()
|
||||
targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/')
|
||||
[ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1
|
||||
|
||||
for target in $iscsi_target_name; do
|
||||
case "$targets" in
|
||||
*$target*)
|
||||
EXTRA=""
|
||||
found=
|
||||
for target in $targets; do
|
||||
if [ "$target" = "$iscsi_target_name" ]; then
|
||||
if [ -n "$iscsi_iface_name" ]; then
|
||||
iscsiadm -m iface -I $iscsi_iface_name --op=new
|
||||
EXTRA=" ${iscsi_netdev_name:+--name=iface.net_ifacename --value=$iscsi_netdev_name} "
|
||||
@@ -228,24 +226,32 @@ handle_netroot()
|
||||
fi
|
||||
[ -n "$iscsi_param" ] && for param in $iscsi_param; do EXTRA="$EXTRA --name=${param%=*} --value=${param#*=}"; done
|
||||
|
||||
iscsiadm -m node -T $target \
|
||||
CMD="iscsiadm -m node -T $target \
|
||||
${iscsi_iface_name:+-I $iscsi_iface_name} \
|
||||
-p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port} \
|
||||
--op=update \
|
||||
-p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port}"
|
||||
__op="--op=update \
|
||||
--name=node.startup --value=onboot \
|
||||
${iscsi_username:+ --name=node.session.auth.username --value=$iscsi_username} \
|
||||
${iscsi_password:+ --name=node.session.auth.password --value=$iscsi_password} \
|
||||
${iscsi_in_username:+--name=node.session.auth.username_in --value=$iscsi_in_username} \
|
||||
${iscsi_in_password:+--name=node.session.auth.password_in --value=$iscsi_in_password} \
|
||||
$EXTRA \
|
||||
$NULL
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
$NULL"
|
||||
$CMD $__op
|
||||
if [ "$netif" != "timeout" ]; then
|
||||
$CMD --login
|
||||
fi
|
||||
found=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
iscsiadm -m node -L onboot || :
|
||||
if [ "$netif" = "timeout" ]; then
|
||||
iscsiadm -m node -L onboot || :
|
||||
elif [ "$found" != yes ]; then
|
||||
warn "iSCSI target \"$iscsi_target_name\" not found on portal $iscsi_target_ip:$iscsi_target_port"
|
||||
return 1
|
||||
fi
|
||||
> $hookdir/initqueue/work
|
||||
|
||||
netroot_enc=$(str_replace "$1" '/' '\2f')
|
||||
|
@@ -89,6 +89,7 @@ install_iscsiroot() {
|
||||
iscsi_host=${host##*/}
|
||||
|
||||
for flash in ${host}/flashnode_sess-* ; do
|
||||
[ -f "$flash" ] || continue
|
||||
[ ! -e "$flash/is_boot_target" ] && continue
|
||||
is_boot=$(cat $flash/is_boot_target)
|
||||
if [ $is_boot -eq 1 ] ; then
|
||||
@@ -187,7 +188,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
local _funcs='iscsi_register_transport'
|
||||
|
||||
instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi qedi
|
||||
@@ -227,7 +228,8 @@ install() {
|
||||
$systemdsystemunitdir/sockets.target.wants/iscsiuio.socket
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
inst_dir $(/usr/bin/find /etc/iscsi)
|
||||
inst_dir /etc/iscsi
|
||||
inst_multiple $(find /etc/iscsi -type f)
|
||||
else
|
||||
inst_simple /etc/iscsi/iscsid.conf
|
||||
fi
|
||||
@@ -252,20 +254,18 @@ install() {
|
||||
$systemdsystemunitdir/iscsiuio.socket \
|
||||
iscsiadm iscsid
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/sockets.target.wants"
|
||||
for i in \
|
||||
iscsid.socket \
|
||||
iscsiuio.socket \
|
||||
; do
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/sockets.target.wants/${i}"
|
||||
systemctl -q --root "$initdir" enable "$i"
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/basic.target.wants"
|
||||
|
||||
for i in \
|
||||
iscsid.service \
|
||||
iscsiuio.service \
|
||||
; do
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/basic.target.wants/${i}"
|
||||
systemctl -q --root "$initdir" add-wants basic.target "$i"
|
||||
done
|
||||
|
||||
# Make sure iscsid is started after dracut-cmdline and ready for the initqueue
|
||||
|
@@ -84,7 +84,7 @@ if [ -n "$iscsi_firmware" ]; then
|
||||
modprobe -b -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -b -q iscsi_ibft
|
||||
# if no ip= is given, but firmware
|
||||
echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
initqueue --unique --online /sbin/iscsiroot online "iscsi:" "$NEWROOT"
|
||||
initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "iscsi:" "$NEWROOT"
|
||||
initqueue --unique --onetime --settled /sbin/iscsiroot online "iscsi:" "'$NEWROOT'"
|
||||
@@ -145,7 +145,7 @@ for nroot in $(getargs netroot); do
|
||||
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
parse_iscsi_root "$nroot" || return 1
|
||||
netroot_enc=$(str_replace "$nroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
done
|
||||
|
||||
# Done, all good!
|
||||
|
@@ -46,10 +46,10 @@ fi
|
||||
[ "${netroot%%:*}" = "nbd" ] || return
|
||||
|
||||
|
||||
if [ -n "${DRACUT_SYSTEMD}" ] && [ "$root" = "dhcp" ]; then
|
||||
echo "root=$netroot" > /etc/cmdline.d/root.conf
|
||||
systemctl --no-block daemon-reload
|
||||
fi
|
||||
#if [ -n "${DRACUT_SYSTEMD}" ] && [ "$root" = "dhcp" ]; then
|
||||
# echo "root=$netroot" > /etc/cmdline.d/root.conf
|
||||
# systemctl --no-block daemon-reload
|
||||
#fi
|
||||
|
||||
# Check required arguments
|
||||
netroot_to_var $netroot
|
||||
|
@@ -86,7 +86,7 @@ install() {
|
||||
[[ $_netconf ]] && printf "%s\n" "$_netconf" >> "${initdir}/etc/cmdline.d/95nfs.conf"
|
||||
fi
|
||||
|
||||
if [ -f /lib/modprobe.d/nfs.conf ]; then
|
||||
if [ -f $dracutsysrootdir/lib/modprobe.d/nfs.conf ]; then
|
||||
inst_multiple /lib/modprobe.d/nfs.conf
|
||||
else
|
||||
[ -d $initdir/etc/modprobe.d/ ] || mkdir $initdir/etc/modprobe.d
|
||||
@@ -95,7 +95,7 @@ install() {
|
||||
|
||||
inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*'
|
||||
|
||||
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
|
||||
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' $dracutsysrootdir/etc/nsswitch.conf \
|
||||
| tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
||||
_nsslibs=${_nsslibs#|}
|
||||
_nsslibs=${_nsslibs%|}
|
||||
@@ -113,13 +113,13 @@ install() {
|
||||
|
||||
# Rather than copy the passwd file in, just set a user for rpcbind
|
||||
# We'll save the state and restart the daemon from the root anyway
|
||||
grep -E '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
|
||||
grep -E '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group"
|
||||
grep -E '^nfsnobody:|^rpc:|^rpcuser:' $dracutsysrootdir/etc/passwd >> "$initdir/etc/passwd"
|
||||
grep -E '^nogroup:|^rpc:|^nobody:' $dracutsysrootdir/etc/group >> "$initdir/etc/group"
|
||||
|
||||
# rpc user needs to be able to write to this directory to save the warmstart
|
||||
# file
|
||||
chmod 770 "$initdir/var/lib/rpcbind"
|
||||
grep -q '^rpc:' /etc/passwd \
|
||||
&& grep -q '^rpc:' /etc/group
|
||||
grep -q '^rpc:' $dracutsysrootdir/etc/passwd \
|
||||
&& grep -q '^rpc:' $dracutsysrootdir/etc/group
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
local _online=0
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
|
||||
require_binaries /usr/lib/udev/collect || return 1
|
||||
|
@@ -2,12 +2,9 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
# No point trying to support resume, if no swap partition exist
|
||||
# Only support resume if hibernation is currently on
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ $fs =~ ^(swap|swsuspend|swsupend)$ ]] && return 0
|
||||
done
|
||||
return 255
|
||||
[[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
@@ -34,7 +31,7 @@ install() {
|
||||
fi
|
||||
|
||||
# if systemd is included and has the hibernate-resume tool, use it and nothing else
|
||||
if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then
|
||||
if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-hibernate-resume-generator \
|
||||
$systemdsystemunitdir/systemd-hibernate-resume@.service \
|
||||
@@ -45,9 +42,9 @@ install() {
|
||||
# Optional uswsusp support
|
||||
for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume
|
||||
do
|
||||
[[ -x "${_bin}" ]] && {
|
||||
[[ -x "$dracutsysrootdir${_bin}" ]] && {
|
||||
inst "${_bin}" /usr/sbin/resume
|
||||
[[ $hostonly ]] && [[ -f /etc/suspend.conf ]] && inst -H /etc/suspend.conf
|
||||
[[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/suspend.conf ]] && inst -H /etc/suspend.conf
|
||||
break
|
||||
}
|
||||
done
|
||||
|
@@ -10,7 +10,7 @@ check() {
|
||||
require_binaries ssh scp || return 1
|
||||
|
||||
if [[ $sshkey ]]; then
|
||||
[ ! -f $sshkey ] && {
|
||||
[ ! -f $dracutsysrootdir$sshkey ] && {
|
||||
derror "ssh key: $sshkey is not found!"
|
||||
return 1
|
||||
}
|
||||
@@ -27,7 +27,7 @@ depends() {
|
||||
|
||||
inst_sshenv()
|
||||
{
|
||||
if [ -d /root/.ssh ]; then
|
||||
if [ -d $dracutsysrootdir/root/.ssh ]; then
|
||||
inst_dir /root/.ssh
|
||||
chmod 700 ${initdir}/root/.ssh
|
||||
fi
|
||||
@@ -35,13 +35,13 @@ inst_sshenv()
|
||||
# Copy over ssh key and knowhosts if needed
|
||||
[[ $sshkey ]] && {
|
||||
inst_simple $sshkey
|
||||
[[ -f /root/.ssh/known_hosts ]] && inst_simple /root/.ssh/known_hosts
|
||||
[[ -f /etc/ssh/ssh_known_hosts ]] && inst_simple /etc/ssh/ssh_known_hosts
|
||||
[[ -f $dracutsysrootdir/root/.ssh/known_hosts ]] && inst_simple /root/.ssh/known_hosts
|
||||
[[ -f $dracutsysrootdir/etc/ssh/ssh_known_hosts ]] && inst_simple /etc/ssh/ssh_known_hosts
|
||||
}
|
||||
|
||||
# Copy over root and system-wide ssh configs.
|
||||
[[ -f /root/.ssh/config ]] && inst_simple /root/.ssh/config
|
||||
if [[ -f /etc/ssh/ssh_config ]]; then
|
||||
[[ -f $dracutsysrootdir/root/.ssh/config ]] && inst_simple /root/.ssh/config
|
||||
if [[ -f $dracutsysrootdir/etc/ssh/ssh_config ]]; then
|
||||
inst_simple /etc/ssh/ssh_config
|
||||
sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config
|
||||
while read key val || [ -n "$key" ]; do
|
||||
@@ -55,7 +55,7 @@ inst_sshenv()
|
||||
fi
|
||||
inst_simple "$val"
|
||||
fi
|
||||
done < /etc/ssh/ssh_config
|
||||
done < $dracutsysrootdir/etc/ssh/ssh_config
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -68,7 +68,9 @@ install() {
|
||||
inst_multiple ssh scp
|
||||
inst_sshenv
|
||||
|
||||
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
|
||||
_nsslibs=$(
|
||||
sed -e 's/#.*//; s/^[^:]*://; s/\[[^]]*\]//' \
|
||||
$dracutsysrootdir/etc/nsswitch.conf \
|
||||
| tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
||||
_nsslibs=${_nsslibs#|}
|
||||
_nsslibs=${_nsslibs%|}
|
||||
|
@@ -5,13 +5,13 @@ install() {
|
||||
local _terminfodir
|
||||
# terminfo bits make things work better if you fall into interactive mode
|
||||
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||
[ -f ${_terminfodir}/l/linux ] && break
|
||||
[ -f $dracutsysrootdir${_terminfodir}/l/linux ] && break
|
||||
done
|
||||
|
||||
if [ -d ${_terminfodir} ]; then
|
||||
if [ -d $dracutsysrootdir${_terminfodir} ]; then
|
||||
for i in "l/linux" "v/vt100" "v/vt102" "v/vt220"; do
|
||||
inst_dir "$_terminfodir/${i%/*}"
|
||||
$DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$_terminfodir/$i"
|
||||
$DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$dracutsysrootdir$_terminfodir/$i"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user