Subversion Repositories svn LFS-FR

Rev

Rev 8069 | Rev 8142 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7156 jlepiller 1
# SOME DESCRIPTIVE TITLE
2
# Copyright (C) YEAR Free Software Foundation, Inc.
3
# This file is distributed under the same license as the PACKAGE package.
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
7313 jlepiller 5
#
7156 jlepiller 6
msgid ""
7
msgstr ""
8
"Project-Id-Version: PACKAGE VERSION\n"
8079 jlepiller 9
"POT-Creation-Date: 2019-09-07 20:02+0000\n"
7220 jlepiller 10
"PO-Revision-Date: 2016-12-28 11:27+0000\n"
7156 jlepiller 11
"Last-Translator: roptat <roptat@lepiller.eu>\n"
12
"Language-Team: LANGUAGE <LL@li.org>\n"
7313 jlepiller 13
"Language: fr\n"
7156 jlepiller 14
"MIME-Version: 1.0\n"
15
"Content-Type: text/plain; charset=UTF-8\n"
16
"Content-Transfer-Encoding: 8bit\n"
17
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
18
"X-Generator: Pootle 2.7\n"
7220 jlepiller 19
"X-POOTLE-MTIME: 1482924437.304380\n"
7156 jlepiller 20
 
21
#. type: Content of: <sect1><sect1info>
22
#: blfs-en/postlfs/filesystems/initramfs.xml:12
8079 jlepiller 23
#| msgid ""
24
#| "<othername>$LastChangedBy: bdubbs $</othername> <date>$Date: 2019-06-27 "
25
#| "20:55:17 +0000 (Thu, 27 Jun 2019) $</date>"
7156 jlepiller 26
msgid ""
8079 jlepiller 27
"<othername>$LastChangedBy: pierre $</othername> <date>$Date: 2019-09-07 "
28
"13:43:10 +0000 (Sat, 07 Sep 2019) $</date>"
7156 jlepiller 29
msgstr ""
8079 jlepiller 30
"<othername>$LastChangedBy: pierre $</othername> <date>$Date: 2019-09-07 "
31
"13:43:10 +0000 (Sat, 07 Sep 2019) $</date>"
7156 jlepiller 32
 
33
#. type: Content of: <sect1><title>
34
#: blfs-en/postlfs/filesystems/initramfs.xml:16
35
msgid "About initramfs"
7220 jlepiller 36
msgstr "À propos de initramfs"
7156 jlepiller 37
 
38
#. type: Content of: <sect1><para>
39
#: blfs-en/postlfs/filesystems/initramfs.xml:18
40
msgid ""
41
"The only purpose of an initramfs is to mount the root filesystem.  The "
42
"initramfs is a complete set of directories that you would find on a normal "
43
"root filesystem.  It is bundled into a single cpio archive and compressed "
44
"with one of several compression algorithms."
45
msgstr ""
7165 jlepiller 46
"La seule fonction d'un initramfs est de monter le système de fichier racine."
47
"  L'initramfs est un ensemble complet de répertoires que vous pouvez trouver"
48
" dans un système de fichiers racine normal. Il est regroupé dans une seule "
49
"archive cpio et compressé avec l'un des nombreux algorithmes de compression."
7156 jlepiller 50
 
51
#. type: Content of: <sect1><para>
52
#: blfs-en/postlfs/filesystems/initramfs.xml:23
53
msgid ""
54
"At boot time, the boot loader loads the kernel and the initramfs image into "
55
"memory and starts the kernel.  The kernel checks for the presence of the "
56
"initramfs and, if found, mounts it as / and runs /init. The init program is "
7165 jlepiller 57
"typically a shell script.  Note that the boot process takes longer, possibly"
58
" significantly longer, if an initramfs is used."
7156 jlepiller 59
msgstr ""
60
"Au moment du démarrage, le chargeur de démarrage charge le noyau et l'image "
61
"initramfs dans la mémoire et démarre le noyau. Le noyau vérifie la présence "
62
"d'un initramfs et, s'il le trouve, le monte sur / et lance /init. Le "
63
"programme init est typiquement un script shell.  Notez que le processus de "
64
"démarrage est plus long, même significativement plus long, si un initramfs "
65
"est utilisé."
66
 
67
#. type: Content of: <sect1><para>
68
#: blfs-en/postlfs/filesystems/initramfs.xml:29
69
msgid ""
70
"For most distributions, kernel modules are the biggest reason to have an "
71
"initramfs.  In a general distribution, there are many unknowns such as file "
72
"system types and disk layouts.  In a way, this is the opposite of LFS where "
7165 jlepiller 73
"the system capabilities and layout are known and a custom kernel is normally"
74
" built.  In this situation, an initramfs is rarely needed."
7156 jlepiller 75
msgstr ""
76
"Pour la plupart des distributions, les modules du noyau sont la plus "
7165 jlepiller 77
"importante raison d'avoir un initramfs. Dans une distribution générale, il y"
78
" a beaucoup d'inconnues comme les types de systèmes de fichiers et les "
79
"couches des disques. Dans un sens, c'est l'opposé de LFS où les capacités et"
7220 jlepiller 80
" les couches du système sont connus et un noyau personnalisé est normalement"
81
" construit.  Dans cette situation, un initramfs est rarement nécessaire."
7156 jlepiller 82
 
83
#. type: Content of: <sect1><para>
84
#: blfs-en/postlfs/filesystems/initramfs.xml:35
85
msgid ""
86
"There are only four primary reasons to have an initramfs in the LFS "
87
"environment: loading the rootfs from a network, loading it from an LVM "
88
"logical volume, having an encrypted rootfs where a password is required, or "
89
"for the convenience of specifying the rootfs as a LABEL or UUID.  Anything "
90
"else usually means that the kernel was not configured properly."
91
msgstr ""
92
"Il y a seulement quatre raisons d'avoir un initramfs dans un environnement "
93
"LFS&nbsp;: le chargement du rootfs depuis le réseau, son chargement depuis "
94
"un volume logique LVM, avoir un rootfs chiffré où un mot de passe est "
7165 jlepiller 95
"requis, ou pour le confort d'un rootfs spécifié par un LABEL ou un UUID. Les"
96
" autres cas signifient souvent que le noyau n'est pas configuré "
97
"correctement."
7156 jlepiller 98
 
99
#. type: Content of: <sect1><sect2><title>
100
#: blfs-en/postlfs/filesystems/initramfs.xml:42
101
msgid "Building an initramfs"
102
msgstr "Construire un initramfs"
103
 
104
#. type: Content of: <sect1><sect2><para>
105
#: blfs-en/postlfs/filesystems/initramfs.xml:44
106
msgid ""
7165 jlepiller 107
"If you do decide to build an initramfs, the following scripts will provide a"
108
" basis to do it.  The scripts will allow specifying a rootfs via partition "
7156 jlepiller 109
"UUID or partition LABEL or a rootfs on an LVM logical volume.  They do not "
110
"support an encrypted root file system or mounting the rootfs over a network "
7165 jlepiller 111
"card.  For a more complete capability see <ulink "
112
"url=\"http://www.linuxfromscratch.org/hints/read.html\"> the LFS "
113
"Hints</ulink> or <ulink url=\"http://fedoraproject.org/wiki/Dracut\"> "
114
"dracut</ulink>."
7156 jlepiller 115
msgstr ""
116
"Si vous décidez de construire un initramfs, les scripts suivants fourniront "
7165 jlepiller 117
"les bases pour le faire. Les scripts autoriseront la spécification du rootfs"
118
" via un UUID de partition ou un LABEL de partition ou un rootfs dans un "
7156 jlepiller 119
"volume logique LVM. Ils ne supportent pas les systèmes de fichier racine "
120
"chiffrés ou le montage des rootfs par des cartes réseaux. Pour plus "
7220 jlepiller 121
"d'informations sur les possibilités, voir <ulink "
122
"url=\"http://www.linuxfromscratch.org/hints/read.html\">L'astuce LFS "
123
"</ulink> ou <ulink "
124
"url=\"http://fedoraproject.org/wiki/Dracut\">dracut</ulink>."
7156 jlepiller 125
 
126
#. type: Content of: <sect1><sect2><para>
127
#: blfs-en/postlfs/filesystems/initramfs.xml:53
128
msgid ""
129
"To install these scripts, run the following commands as the <systemitem "
130
"class=\"username\">root</systemitem> user:"
131
msgstr ""
132
"Pour installer ces scripts, lancez les commandes suivantes en tant "
133
"qu'utilisateur <systemitem class=\"username\">root</systemitem>&nbsp;:"
134
 
135
#. type: Content of: <sect1><sect2><screen>
136
#: blfs-en/postlfs/filesystems/initramfs.xml:56
7165 jlepiller 137
#, no-wrap
8079 jlepiller 138
#| msgid ""
139
#| "<userinput>cat &gt; /sbin/mkinitramfs &lt;&lt; \"EOF\"\n"
140
#| "<literal>#!/bin/bash\n"
141
#| "# This file based in part on the mkinitramfs script for the LFS LiveCD\n"
142
#| "# written by Alexander E. Patrakov and Jeremy Huntwork.\n"
143
#| "\n"
144
#| "copy()\n"
145
#| "{\n"
146
#| "  local file\n"
147
#| "\n"
148
#| "  if [ \"$2\" == \"lib\" ]; then\n"
149
#| "    file=$(PATH=/lib:/usr/lib type -p $1)\n"
150
#| "  else\n"
151
#| "    file=$(type -p $1)\n"
152
#| "  fi\n"
153
#| "\n"
154
#| "  if [ -n $file ] ; then\n"
155
#| "    cp $file $WDIR/$2\n"
156
#| "  else\n"
157
#| "    echo \"Missing required file: $1 for directory $2\"\n"
158
#| "    rm -rf $WDIR\n"
159
#| "    exit 1\n"
160
#| "  fi\n"
161
#| "}\n"
162
#| "\n"
163
#| "if [ -z $1 ] ; then\n"
164
#| "  INITRAMFS_FILE=initrd.img-no-kmods\n"
165
#| "else\n"
166
#| "  KERNEL_VERSION=$1\n"
167
#| "  INITRAMFS_FILE=initrd.img-$KERNEL_VERSION\n"
168
#| "fi\n"
169
#| "\n"
170
#| "if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ ! -d \"/lib/modules/$1\" ] ; then\n"
171
#| "  echo \"No modules directory named $1\"\n"
172
#| "  exit 1\n"
173
#| "fi\n"
174
#| "\n"
175
#| "printf \"Creating $INITRAMFS_FILE... \"\n"
176
#| "\n"
177
#| "binfiles=\"sh cat cp dd killall ls mkdir mknod mount \"\n"
178
#| "binfiles=\"$binfiles umount sed sleep ln rm uname\"\n"
179
#| "binfiles=\"$binfiles readlink basename\"\n"
180
#| "\n"
181
#| "# Systemd installs udevadm in /bin. Other udev implementations have it in /sbin\n"
182
#| "if [ -x /bin/udevadm ] ; then binfiles=\"$binfiles udevadm\"; fi\n"
183
#| "\n"
184
#| "sbinfiles=\"modprobe blkid switch_root\"\n"
185
#| "\n"
186
#| "#Optional files and locations\n"
187
#| "for f in mdadm mdmon udevd udevadm; do\n"
188
#| "  if [ -x /sbin/$f ] ; then sbinfiles=\"$sbinfiles $f\"; fi\n"
189
#| "done\n"
190
#| "\n"
191
#| "unsorted=$(mktemp /tmp/unsorted.XXXXXXXXXX)\n"
192
#| "\n"
193
#| "DATADIR=/usr/share/mkinitramfs\n"
194
#| "INITIN=init.in\n"
195
#| "\n"
196
#| "# Create a temporary working directory\n"
197
#| "WDIR=$(mktemp -d /tmp/initrd-work.XXXXXXXXXX)\n"
198
#| "\n"
199
#| "# Create base directory structure\n"
200
#| "mkdir -p $WDIR/{bin,dev,lib/firmware,run,sbin,sys,proc,usr}\n"
201
#| "mkdir -p $WDIR/etc/{modprobe.d,udev/rules.d}\n"
202
#| "touch $WDIR/etc/modprobe.d/modprobe.conf\n"
203
#| "ln -s lib $WDIR/lib64\n"
204
#| "ln -s ../bin $WDIR/usr/bin\n"
205
#| "\n"
206
#| "# Create necessary device nodes\n"
207
#| "mknod -m 640 $WDIR/dev/console c 5 1\n"
208
#| "mknod -m 664 $WDIR/dev/null    c 1 3\n"
209
#| "\n"
210
#| "# Install the udev configuration files\n"
211
#| "if [ -f /etc/udev/udev.conf ]; then\n"
212
#| "  cp /etc/udev/udev.conf $WDIR/etc/udev/udev.conf\n"
213
#| "fi\n"
214
#| "\n"
215
#| "for file in $(find /etc/udev/rules.d/ -type f) ; do\n"
216
#| "  cp $file $WDIR/etc/udev/rules.d\n"
217
#| "done\n"
218
#| "\n"
219
#| "# Install any firmware present\n"
220
#| "cp -a /lib/firmware $WDIR/lib\n"
221
#| "\n"
222
#| "# Copy the RAID configuration file if present\n"
223
#| "if [ -f /etc/mdadm.conf ] ; then\n"
224
#| "  cp /etc/mdadm.conf $WDIR/etc\n"
225
#| "fi\n"
226
#| "\n"
227
#| "# Install the init file\n"
228
#| "install -m0755 $DATADIR/$INITIN $WDIR/init\n"
229
#| "\n"
230
#| "if [  -n \"$KERNEL_VERSION\" ] ; then\n"
231
#| "  if [ -x /bin/kmod ] ; then\n"
232
#| "    binfiles=\"$binfiles kmod\"\n"
233
#| "  else\n"
234
#| "    binfiles=\"$binfiles lsmod\"\n"
235
#| "    sbinfiles=\"$sbinfiles insmod\"\n"
236
#| "  fi\n"
237
#| "fi\n"
238
#| "\n"
239
#| "# Install basic binaries\n"
240
#| "for f in $binfiles ; do\n"
241
#| "  if [ -e /bin/$f ]; then d=\"/bin\"; else d=\"/usr/bin\"; fi\n"
242
#| "  ldd $d/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
243
#| "  copy $d/$f bin\n"
244
#| "done\n"
245
#| "\n"
246
#| "# Add lvm if present\n"
247
#| "if [ -x /sbin/lvm ] ; then sbinfiles=\"$sbinfiles lvm dmsetup\"; fi\n"
248
#| "\n"
249
#| "for f in $sbinfiles ; do\n"
250
#| "  ldd /sbin/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
251
#| "  copy $f sbin\n"
252
#| "done\n"
253
#| "\n"
254
#| "# Add udevd libraries if not in /sbin\n"
255
#| "if [ -x /lib/udev/udevd ] ; then\n"
256
#| "  ldd /lib/udev/udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
257
#| "elif [ -x /lib/systemd/systemd-udevd ] ; then\n"
258
#| "  ldd /lib/systemd/systemd-udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
259
#| "fi\n"
260
#| "\n"
261
#| "# Add module symlinks if appropriate\n"
262
#| "if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ -x /bin/kmod ] ; then\n"
263
#| "  ln -s kmod $WDIR/bin/lsmod\n"
264
#| "  ln -s kmod $WDIR/bin/insmod\n"
265
#| "fi\n"
266
#| "\n"
267
#| "# Add lvm symlinks if appropriate\n"
268
#| "# Also copy the lvm.conf file\n"
269
#| "if  [ -x /sbin/lvm ] ; then\n"
270
#| "  ln -s lvm $WDIR/sbin/lvchange\n"
271
#| "  ln -s lvm $WDIR/sbin/lvrename\n"
272
#| "  ln -s lvm $WDIR/sbin/lvextend\n"
273
#| "  ln -s lvm $WDIR/sbin/lvcreate\n"
274
#| "  ln -s lvm $WDIR/sbin/lvdisplay\n"
275
#| "  ln -s lvm $WDIR/sbin/lvscan\n"
276
#| "\n"
277
#| "  ln -s lvm $WDIR/sbin/pvchange\n"
278
#| "  ln -s lvm $WDIR/sbin/pvck\n"
279
#| "  ln -s lvm $WDIR/sbin/pvcreate\n"
280
#| "  ln -s lvm $WDIR/sbin/pvdisplay\n"
281
#| "  ln -s lvm $WDIR/sbin/pvscan\n"
282
#| "\n"
283
#| "  ln -s lvm $WDIR/sbin/vgchange\n"
284
#| "  ln -s lvm $WDIR/sbin/vgcreate\n"
285
#| "  ln -s lvm $WDIR/sbin/vgscan\n"
286
#| "  ln -s lvm $WDIR/sbin/vgrename\n"
287
#| "  ln -s lvm $WDIR/sbin/vgck\n"
288
#| "  # Conf file(s)\n"
289
#| "  cp -a /etc/lvm $WDIR/etc\n"
290
#| "fi\n"
291
#| "\n"
292
#| "# Install libraries\n"
293
#| "sort $unsorted | uniq | while read library ; do\n"
294
#| "  if [ \"$library\" == \"linux-vdso.so.1\" ] ||\n"
295
#| "     [ \"$library\" == \"linux-gate.so.1\" ]; then\n"
296
#| "    continue\n"
297
#| "  fi\n"
298
#| "\n"
299
#| "  copy $library lib\n"
300
#| "done\n"
301
#| "\n"
302
#| "if [ -d /lib/udev ]; then\n"
303
#| "  cp -a /lib/udev $WDIR/lib\n"
304
#| "fi\n"
305
#| "if [ -d /lib/systemd ]; then\n"
306
#| "  cp -a /lib/systemd $WDIR/lib\n"
307
#| "fi\n"
308
#| "\n"
309
#| "# Install the kernel modules if requested\n"
310
#| "if [ -n \"$KERNEL_VERSION\" ]; then\n"
311
#| "  find                                                                        \\\n"
312
#| "     /lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib}                      \\\n"
313
#| "     /lib/modules/$KERNEL_VERSION/kernel/drivers/{block,ata,md,firewire}      \\\n"
314
#| "     /lib/modules/$KERNEL_VERSION/kernel/drivers/{scsi,message,pcmcia,virtio} \\\n"
315
#| "     /lib/modules/$KERNEL_VERSION/kernel/drivers/usb/{host,storage}           \\\n"
316
#| "     -type f 2&gt; /dev/null | cpio --make-directories -p --quiet $WDIR\n"
317
#| "\n"
318
#| "  cp /lib/modules/$KERNEL_VERSION/modules.{builtin,order}                     \\\n"
319
#| "            $WDIR/lib/modules/$KERNEL_VERSION\n"
320
#| "\n"
321
#| "  depmod -b $WDIR $KERNEL_VERSION\n"
322
#| "fi\n"
323
#| "\n"
324
#| "( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) &gt; $INITRAMFS_FILE\n"
325
#| "\n"
326
#| "# Remove the temporary directory and file\n"
327
#| "rm -rf $WDIR $unsorted\n"
328
#| "printf \"done.\\n\"\n"
329
#| "</literal>\n"
330
#| "EOF\n"
331
#| "\n"
332
#| "chmod 0755 /sbin/mkinitramfs</userinput>"
7156 jlepiller 333
msgid ""
334
"<userinput>cat &gt; /sbin/mkinitramfs &lt;&lt; \"EOF\"\n"
7983 jlepiller 335
"<literal>#!/bin/bash\n"
7156 jlepiller 336
"# This file based in part on the mkinitramfs script for the LFS LiveCD\n"
337
"# written by Alexander E. Patrakov and Jeremy Huntwork.\n"
338
"\n"
339
"copy()\n"
340
"{\n"
341
"  local file\n"
342
"\n"
343
"  if [ \"$2\" == \"lib\" ]; then\n"
344
"    file=$(PATH=/lib:/usr/lib type -p $1)\n"
345
"  else\n"
346
"    file=$(type -p $1)\n"
347
"  fi\n"
348
"\n"
349
"  if [ -n $file ] ; then\n"
350
"    cp $file $WDIR/$2\n"
351
"  else\n"
352
"    echo \"Missing required file: $1 for directory $2\"\n"
353
"    rm -rf $WDIR\n"
354
"    exit 1\n"
355
"  fi\n"
356
"}\n"
357
"\n"
358
"if [ -z $1 ] ; then\n"
359
"  INITRAMFS_FILE=initrd.img-no-kmods\n"
360
"else\n"
361
"  KERNEL_VERSION=$1\n"
362
"  INITRAMFS_FILE=initrd.img-$KERNEL_VERSION\n"
363
"fi\n"
364
"\n"
365
"if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ ! -d \"/lib/modules/$1\" ] ; then\n"
366
"  echo \"No modules directory named $1\"\n"
367
"  exit 1\n"
368
"fi\n"
369
"\n"
370
"printf \"Creating $INITRAMFS_FILE... \"\n"
371
"\n"
372
"binfiles=\"sh cat cp dd killall ls mkdir mknod mount \"\n"
373
"binfiles=\"$binfiles umount sed sleep ln rm uname\"\n"
7334 jlepiller 374
"binfiles=\"$binfiles readlink basename\"\n"
7156 jlepiller 375
"\n"
376
"# Systemd installs udevadm in /bin. Other udev implementations have it in /sbin\n"
377
"if [ -x /bin/udevadm ] ; then binfiles=\"$binfiles udevadm\"; fi\n"
378
"\n"
379
"sbinfiles=\"modprobe blkid switch_root\"\n"
380
"\n"
381
"#Optional files and locations\n"
7164 jlepiller 382
"for f in mdadm mdmon udevd udevadm; do\n"
7156 jlepiller 383
"  if [ -x /sbin/$f ] ; then sbinfiles=\"$sbinfiles $f\"; fi\n"
384
"done\n"
385
"\n"
386
"unsorted=$(mktemp /tmp/unsorted.XXXXXXXXXX)\n"
387
"\n"
388
"DATADIR=/usr/share/mkinitramfs\n"
389
"INITIN=init.in\n"
390
"\n"
7164 jlepiller 391
"# Create a temporary working directory\n"
7156 jlepiller 392
"WDIR=$(mktemp -d /tmp/initrd-work.XXXXXXXXXX)\n"
393
"\n"
394
"# Create base directory structure\n"
7334 jlepiller 395
"mkdir -p $WDIR/{bin,dev,lib/firmware,run,sbin,sys,proc,usr}\n"
7156 jlepiller 396
"mkdir -p $WDIR/etc/{modprobe.d,udev/rules.d}\n"
397
"touch $WDIR/etc/modprobe.d/modprobe.conf\n"
398
"ln -s lib $WDIR/lib64\n"
7334 jlepiller 399
"ln -s ../bin $WDIR/usr/bin\n"
7156 jlepiller 400
"\n"
401
"# Create necessary device nodes\n"
402
"mknod -m 640 $WDIR/dev/console c 5 1\n"
403
"mknod -m 664 $WDIR/dev/null    c 1 3\n"
404
"\n"
405
"# Install the udev configuration files\n"
406
"if [ -f /etc/udev/udev.conf ]; then\n"
407
"  cp /etc/udev/udev.conf $WDIR/etc/udev/udev.conf\n"
408
"fi\n"
409
"\n"
410
"for file in $(find /etc/udev/rules.d/ -type f) ; do\n"
411
"  cp $file $WDIR/etc/udev/rules.d\n"
412
"done\n"
413
"\n"
414
"# Install any firmware present\n"
415
"cp -a /lib/firmware $WDIR/lib\n"
416
"\n"
417
"# Copy the RAID configuration file if present\n"
418
"if [ -f /etc/mdadm.conf ] ; then\n"
419
"  cp /etc/mdadm.conf $WDIR/etc\n"
420
"fi\n"
421
"\n"
422
"# Install the init file\n"
423
"install -m0755 $DATADIR/$INITIN $WDIR/init\n"
424
"\n"
425
"if [  -n \"$KERNEL_VERSION\" ] ; then\n"
426
"  if [ -x /bin/kmod ] ; then\n"
427
"    binfiles=\"$binfiles kmod\"\n"
428
"  else\n"
429
"    binfiles=\"$binfiles lsmod\"\n"
430
"    sbinfiles=\"$sbinfiles insmod\"\n"
431
"  fi\n"
432
"fi\n"
433
"\n"
434
"# Install basic binaries\n"
435
"for f in $binfiles ; do\n"
7334 jlepiller 436
"  if [ -e /bin/$f ]; then d=\"/bin\"; else d=\"/usr/bin\"; fi\n"
437
"  ldd $d/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
438
"  copy $d/$f bin\n"
7156 jlepiller 439
"done\n"
440
"\n"
441
"# Add lvm if present\n"
442
"if [ -x /sbin/lvm ] ; then sbinfiles=\"$sbinfiles lvm dmsetup\"; fi\n"
443
"\n"
444
"for f in $sbinfiles ; do\n"
445
"  ldd /sbin/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
446
"  copy $f sbin\n"
447
"done\n"
448
"\n"
449
"# Add udevd libraries if not in /sbin\n"
450
"if [ -x /lib/udev/udevd ] ; then\n"
451
"  ldd /lib/udev/udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
452
"elif [ -x /lib/systemd/systemd-udevd ] ; then\n"
453
"  ldd /lib/systemd/systemd-udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
454
"fi\n"
455
"\n"
456
"# Add module symlinks if appropriate\n"
457
"if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ -x /bin/kmod ] ; then\n"
458
"  ln -s kmod $WDIR/bin/lsmod\n"
459
"  ln -s kmod $WDIR/bin/insmod\n"
460
"fi\n"
461
"\n"
462
"# Add lvm symlinks if appropriate\n"
463
"# Also copy the lvm.conf file\n"
464
"if  [ -x /sbin/lvm ] ; then\n"
465
"  ln -s lvm $WDIR/sbin/lvchange\n"
466
"  ln -s lvm $WDIR/sbin/lvrename\n"
467
"  ln -s lvm $WDIR/sbin/lvextend\n"
468
"  ln -s lvm $WDIR/sbin/lvcreate\n"
469
"  ln -s lvm $WDIR/sbin/lvdisplay\n"
470
"  ln -s lvm $WDIR/sbin/lvscan\n"
471
"\n"
472
"  ln -s lvm $WDIR/sbin/pvchange\n"
473
"  ln -s lvm $WDIR/sbin/pvck\n"
474
"  ln -s lvm $WDIR/sbin/pvcreate\n"
475
"  ln -s lvm $WDIR/sbin/pvdisplay\n"
476
"  ln -s lvm $WDIR/sbin/pvscan\n"
477
"\n"
478
"  ln -s lvm $WDIR/sbin/vgchange\n"
479
"  ln -s lvm $WDIR/sbin/vgcreate\n"
480
"  ln -s lvm $WDIR/sbin/vgscan\n"
481
"  ln -s lvm $WDIR/sbin/vgrename\n"
482
"  ln -s lvm $WDIR/sbin/vgck\n"
483
"  # Conf file(s)\n"
484
"  cp -a /etc/lvm $WDIR/etc\n"
485
"fi\n"
486
"\n"
487
"# Install libraries\n"
488
"sort $unsorted | uniq | while read library ; do\n"
489
"  if [ \"$library\" == \"linux-vdso.so.1\" ] ||\n"
490
"     [ \"$library\" == \"linux-gate.so.1\" ]; then\n"
491
"    continue\n"
492
"  fi\n"
493
"\n"
494
"  copy $library lib\n"
495
"done\n"
496
"\n"
497
"if [ -d /lib/udev ]; then\n"
498
"  cp -a /lib/udev $WDIR/lib\n"
499
"fi\n"
500
"if [ -d /lib/systemd ]; then\n"
501
"  cp -a /lib/systemd $WDIR/lib\n"
502
"fi\n"
8079 jlepiller 503
"if [ -d /lib/elogind ]; then\n"
504
"  cp -a /lib/elogind $WDIR/lib\n"
505
"fi\n"
7156 jlepiller 506
"\n"
507
"# Install the kernel modules if requested\n"
508
"if [ -n \"$KERNEL_VERSION\" ]; then\n"
509
"  find                                                                        \\\n"
510
"     /lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib}                      \\\n"
511
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{block,ata,md,firewire}      \\\n"
512
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{scsi,message,pcmcia,virtio} \\\n"
513
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/usb/{host,storage}           \\\n"
514
"     -type f 2&gt; /dev/null | cpio --make-directories -p --quiet $WDIR\n"
515
"\n"
516
"  cp /lib/modules/$KERNEL_VERSION/modules.{builtin,order}                     \\\n"
517
"            $WDIR/lib/modules/$KERNEL_VERSION\n"
518
"\n"
519
"  depmod -b $WDIR $KERNEL_VERSION\n"
520
"fi\n"
521
"\n"
522
"( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) &gt; $INITRAMFS_FILE\n"
523
"\n"
524
"# Remove the temporary directory and file\n"
525
"rm -rf $WDIR $unsorted\n"
526
"printf \"done.\\n\"\n"
7983 jlepiller 527
"</literal>\n"
7156 jlepiller 528
"EOF\n"
529
"\n"
7854 jlepiller 530
"chmod 0755 /sbin/mkinitramfs</userinput>"
7156 jlepiller 531
msgstr ""
532
"<userinput>cat &gt; /sbin/mkinitramfs &lt;&lt; \"EOF\"\n"
7983 jlepiller 533
"<literal>#!/bin/bash\n"
7156 jlepiller 534
"# This file based in part on the mkinitramfs script for the LFS LiveCD\n"
535
"# written by Alexander E. Patrakov and Jeremy Huntwork.\n"
536
"\n"
537
"copy()\n"
538
"{\n"
539
"  local file\n"
540
"\n"
541
"  if [ \"$2\" == \"lib\" ]; then\n"
542
"    file=$(PATH=/lib:/usr/lib type -p $1)\n"
543
"  else\n"
544
"    file=$(type -p $1)\n"
545
"  fi\n"
546
"\n"
547
"  if [ -n $file ] ; then\n"
548
"    cp $file $WDIR/$2\n"
549
"  else\n"
550
"    echo \"Missing required file: $1 for directory $2\"\n"
551
"    rm -rf $WDIR\n"
552
"    exit 1\n"
553
"  fi\n"
554
"}\n"
555
"\n"
556
"if [ -z $1 ] ; then\n"
557
"  INITRAMFS_FILE=initrd.img-no-kmods\n"
558
"else\n"
559
"  KERNEL_VERSION=$1\n"
560
"  INITRAMFS_FILE=initrd.img-$KERNEL_VERSION\n"
561
"fi\n"
562
"\n"
563
"if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ ! -d \"/lib/modules/$1\" ] ; then\n"
564
"  echo \"No modules directory named $1\"\n"
565
"  exit 1\n"
566
"fi\n"
567
"\n"
568
"printf \"Creating $INITRAMFS_FILE... \"\n"
569
"\n"
570
"binfiles=\"sh cat cp dd killall ls mkdir mknod mount \"\n"
571
"binfiles=\"$binfiles umount sed sleep ln rm uname\"\n"
7334 jlepiller 572
"binfiles=\"$binfiles readlink basename\"\n"
7156 jlepiller 573
"\n"
574
"# Systemd installs udevadm in /bin. Other udev implementations have it in /sbin\n"
575
"if [ -x /bin/udevadm ] ; then binfiles=\"$binfiles udevadm\"; fi\n"
576
"\n"
577
"sbinfiles=\"modprobe blkid switch_root\"\n"
578
"\n"
579
"#Optional files and locations\n"
7165 jlepiller 580
"for f in mdadm mdmon udevd udevadm; do\n"
7156 jlepiller 581
"  if [ -x /sbin/$f ] ; then sbinfiles=\"$sbinfiles $f\"; fi\n"
582
"done\n"
583
"\n"
584
"unsorted=$(mktemp /tmp/unsorted.XXXXXXXXXX)\n"
585
"\n"
586
"DATADIR=/usr/share/mkinitramfs\n"
587
"INITIN=init.in\n"
588
"\n"
7165 jlepiller 589
"# Create a temporary working directory\n"
7156 jlepiller 590
"WDIR=$(mktemp -d /tmp/initrd-work.XXXXXXXXXX)\n"
591
"\n"
592
"# Create base directory structure\n"
7334 jlepiller 593
"mkdir -p $WDIR/{bin,dev,lib/firmware,run,sbin,sys,proc,usr}\n"
7156 jlepiller 594
"mkdir -p $WDIR/etc/{modprobe.d,udev/rules.d}\n"
595
"touch $WDIR/etc/modprobe.d/modprobe.conf\n"
596
"ln -s lib $WDIR/lib64\n"
7334 jlepiller 597
"ln -s ../bin $WDIR/usr/bin\n"
7156 jlepiller 598
"\n"
599
"# Create necessary device nodes\n"
600
"mknod -m 640 $WDIR/dev/console c 5 1\n"
601
"mknod -m 664 $WDIR/dev/null    c 1 3\n"
602
"\n"
603
"# Install the udev configuration files\n"
604
"if [ -f /etc/udev/udev.conf ]; then\n"
605
"  cp /etc/udev/udev.conf $WDIR/etc/udev/udev.conf\n"
606
"fi\n"
607
"\n"
608
"for file in $(find /etc/udev/rules.d/ -type f) ; do\n"
609
"  cp $file $WDIR/etc/udev/rules.d\n"
610
"done\n"
611
"\n"
612
"# Install any firmware present\n"
613
"cp -a /lib/firmware $WDIR/lib\n"
614
"\n"
615
"# Copy the RAID configuration file if present\n"
616
"if [ -f /etc/mdadm.conf ] ; then\n"
617
"  cp /etc/mdadm.conf $WDIR/etc\n"
618
"fi\n"
619
"\n"
620
"# Install the init file\n"
621
"install -m0755 $DATADIR/$INITIN $WDIR/init\n"
622
"\n"
623
"if [  -n \"$KERNEL_VERSION\" ] ; then\n"
624
"  if [ -x /bin/kmod ] ; then\n"
625
"    binfiles=\"$binfiles kmod\"\n"
626
"  else\n"
627
"    binfiles=\"$binfiles lsmod\"\n"
628
"    sbinfiles=\"$sbinfiles insmod\"\n"
629
"  fi\n"
630
"fi\n"
631
"\n"
632
"# Install basic binaries\n"
633
"for f in $binfiles ; do\n"
7334 jlepiller 634
"  if [ -e /bin/$f ]; then d=\"/bin\"; else d=\"/usr/bin\"; fi\n"
635
"  ldd $d/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
636
"  copy $d/$f bin\n"
7156 jlepiller 637
"done\n"
638
"\n"
639
"# Add lvm if present\n"
640
"if [ -x /sbin/lvm ] ; then sbinfiles=\"$sbinfiles lvm dmsetup\"; fi\n"
641
"\n"
642
"for f in $sbinfiles ; do\n"
643
"  ldd /sbin/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
644
"  copy $f sbin\n"
645
"done\n"
646
"\n"
647
"# Add udevd libraries if not in /sbin\n"
648
"if [ -x /lib/udev/udevd ] ; then\n"
649
"  ldd /lib/udev/udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
650
"elif [ -x /lib/systemd/systemd-udevd ] ; then\n"
651
"  ldd /lib/systemd/systemd-udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
652
"fi\n"
653
"\n"
654
"# Add module symlinks if appropriate\n"
655
"if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ -x /bin/kmod ] ; then\n"
656
"  ln -s kmod $WDIR/bin/lsmod\n"
657
"  ln -s kmod $WDIR/bin/insmod\n"
658
"fi\n"
659
"\n"
660
"# Add lvm symlinks if appropriate\n"
661
"# Also copy the lvm.conf file\n"
662
"if  [ -x /sbin/lvm ] ; then\n"
663
"  ln -s lvm $WDIR/sbin/lvchange\n"
664
"  ln -s lvm $WDIR/sbin/lvrename\n"
665
"  ln -s lvm $WDIR/sbin/lvextend\n"
666
"  ln -s lvm $WDIR/sbin/lvcreate\n"
667
"  ln -s lvm $WDIR/sbin/lvdisplay\n"
668
"  ln -s lvm $WDIR/sbin/lvscan\n"
669
"\n"
670
"  ln -s lvm $WDIR/sbin/pvchange\n"
671
"  ln -s lvm $WDIR/sbin/pvck\n"
672
"  ln -s lvm $WDIR/sbin/pvcreate\n"
673
"  ln -s lvm $WDIR/sbin/pvdisplay\n"
674
"  ln -s lvm $WDIR/sbin/pvscan\n"
675
"\n"
676
"  ln -s lvm $WDIR/sbin/vgchange\n"
677
"  ln -s lvm $WDIR/sbin/vgcreate\n"
678
"  ln -s lvm $WDIR/sbin/vgscan\n"
679
"  ln -s lvm $WDIR/sbin/vgrename\n"
680
"  ln -s lvm $WDIR/sbin/vgck\n"
681
"  # Conf file(s)\n"
682
"  cp -a /etc/lvm $WDIR/etc\n"
683
"fi\n"
684
"\n"
685
"# Install libraries\n"
686
"sort $unsorted | uniq | while read library ; do\n"
687
"  if [ \"$library\" == \"linux-vdso.so.1\" ] ||\n"
688
"     [ \"$library\" == \"linux-gate.so.1\" ]; then\n"
689
"    continue\n"
690
"  fi\n"
691
"\n"
692
"  copy $library lib\n"
693
"done\n"
694
"\n"
695
"if [ -d /lib/udev ]; then\n"
696
"  cp -a /lib/udev $WDIR/lib\n"
697
"fi\n"
698
"if [ -d /lib/systemd ]; then\n"
699
"  cp -a /lib/systemd $WDIR/lib\n"
700
"fi\n"
8079 jlepiller 701
"if [ -d /lib/elogind ]; then\n"
702
"  cp -a /lib/elogind $WDIR/lib\n"
703
"fi\n"
7156 jlepiller 704
"\n"
705
"# Install the kernel modules if requested\n"
706
"if [ -n \"$KERNEL_VERSION\" ]; then\n"
707
"  find                                                                        \\\n"
708
"     /lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib}                      \\\n"
709
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{block,ata,md,firewire}      \\\n"
710
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{scsi,message,pcmcia,virtio} \\\n"
711
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/usb/{host,storage}           \\\n"
712
"     -type f 2&gt; /dev/null | cpio --make-directories -p --quiet $WDIR\n"
713
"\n"
714
"  cp /lib/modules/$KERNEL_VERSION/modules.{builtin,order}                     \\\n"
715
"            $WDIR/lib/modules/$KERNEL_VERSION\n"
716
"\n"
717
"  depmod -b $WDIR $KERNEL_VERSION\n"
718
"fi\n"
719
"\n"
720
"( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) &gt; $INITRAMFS_FILE\n"
721
"\n"
722
"# Remove the temporary directory and file\n"
723
"rm -rf $WDIR $unsorted\n"
724
"printf \"done.\\n\"\n"
7983 jlepiller 725
"</literal>\n"
7156 jlepiller 726
"EOF\n"
727
"\n"
7854 jlepiller 728
"chmod 0755 /sbin/mkinitramfs</userinput>"
7156 jlepiller 729
 
730
#. type: Content of: <sect1><sect2><screen>
8079 jlepiller 731
#: blfs-en/postlfs/filesystems/initramfs.xml:254
7156 jlepiller 732
#, no-wrap
8079 jlepiller 733
#| msgid ""
734
#| "<userinput>mkdir -p /usr/share/mkinitramfs &amp;&amp;\n"
735
#| "cat &gt; /usr/share/mkinitramfs/init.in &lt;&lt; \"EOF\"\n"
736
#| "<literal>#!/bin/sh\n"
737
#| "\n"
738
#| "PATH=/bin:/usr/bin:/sbin:/usr/sbin\n"
739
#| "export PATH\n"
740
#| "\n"
741
#| "problem()\n"
742
#| "{\n"
743
#| "   printf \"Encountered a problem!\\n\\nDropping you to a shell.\\n\\n\"\n"
744
#| "   sh\n"
745
#| "}\n"
746
#| "\n"
747
#| "no_device()\n"
748
#| "{\n"
749
#| "   printf \"The device %s, which is supposed to contain the\\n\" $1\n"
750
#| "   printf \"root file system, does not exist.\\n\"\n"
751
#| "   printf \"Please fix this problem and exit this shell.\\n\\n\"\n"
752
#| "}\n"
753
#| "\n"
754
#| "no_mount()\n"
755
#| "{\n"
756
#| "   printf \"Could not mount device %s\\n\" $1\n"
757
#| "   printf \"Sleeping forever. Please reboot and fix the kernel command line.\\n\\n\"\n"
758
#| "   printf \"Maybe the device is formatted with an unsupported file system?\\n\\n\"\n"
759
#| "   printf \"Or maybe filesystem type autodetection went wrong, in which case\\n\"\n"
760
#| "   printf \"you should add the rootfstype=... parameter to the kernel command line.\\n\\n\"\n"
761
#| "   printf \"Available partitions:\\n\"\n"
762
#| "}\n"
763
#| "\n"
764
#| "do_mount_root()\n"
765
#| "{\n"
766
#| "   mkdir /.root\n"
767
#| "   [ -n \"$rootflags\" ] &amp;&amp; rootflags=\"$rootflags,\"\n"
768
#| "   rootflags=\"$rootflags$ro\"\n"
769
#| "\n"
770
#| "   case \"$root\" in\n"
771
#| "      /dev/* ) device=$root ;;\n"
772
#| "      UUID=* ) eval $root; device=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
773
#| "      LABEL=*) eval $root; device=\"/dev/disk/by-label/$LABEL\" ;;\n"
774
#| "      \"\"     ) echo \"No root device specified.\" ; problem    ;;\n"
775
#| "   esac\n"
776
#| "\n"
777
#| "   while [ ! -b \"$device\" ] ; do\n"
778
#| "       no_device $device\n"
779
#| "       problem\n"
780
#| "   done\n"
781
#| "\n"
782
#| "   if ! mount -n -t \"$rootfstype\" -o \"$rootflags\" \"$device\" /.root ; then\n"
783
#| "       no_mount $device\n"
784
#| "       cat /proc/partitions\n"
785
#| "       while true ; do sleep 10000 ; done\n"
786
#| "   else\n"
787
#| "       echo \"Successfully mounted device $root\"\n"
788
#| "   fi\n"
789
#| "}\n"
790
#| "\n"
791
#| "init=/sbin/init\n"
792
#| "root=\n"
793
#| "rootdelay=\n"
794
#| "rootfstype=auto\n"
795
#| "ro=\"ro\"\n"
796
#| "rootflags=\n"
797
#| "device=\n"
798
#| "\n"
799
#| "mount -n -t devtmpfs devtmpfs /dev\n"
800
#| "mount -n -t proc     proc     /proc\n"
801
#| "mount -n -t sysfs    sysfs    /sys\n"
802
#| "mount -n -t tmpfs    tmpfs    /run\n"
803
#| "\n"
804
#| "read -r cmdline &lt; /proc/cmdline\n"
805
#| "\n"
806
#| "for param in $cmdline ; do\n"
807
#| "  case $param in\n"
808
#| "    init=*      ) init=${param#init=}             ;;\n"
809
#| "    root=*      ) root=${param#root=}             ;;\n"
810
#| "    rootdelay=* ) rootdelay=${param#rootdelay=}   ;;\n"
811
#| "    rootfstype=*) rootfstype=${param#rootfstype=} ;;\n"
812
#| "    rootflags=* ) rootflags=${param#rootflags=}   ;;\n"
813
#| "    ro          ) ro=\"ro\"                         ;;\n"
814
#| "    rw          ) ro=\"rw\"                         ;;\n"
815
#| "  esac\n"
816
#| "done\n"
817
#| "\n"
818
#| "# udevd location depends on version\n"
819
#| "if [ -x /sbin/udevd ]; then\n"
820
#| "  UDEVD=/sbin/udevd\n"
821
#| "elif [ -x /lib/udev/udevd ]; then\n"
822
#| "  UDEVD=/lib/udev/udevd\n"
823
#| "elif [ -x /lib/systemd/systemd-udevd ]; then\n"
824
#| "  UDEVD=/lib/systemd/systemd-udevd\n"
825
#| "else\n"
826
#| "  echo \"Cannot find udevd nor systemd-udevd\"\n"
827
#| "  problem\n"
828
#| "fi\n"
829
#| "\n"
830
#| "${UDEVD} --daemon --resolve-names=never\n"
831
#| "udevadm trigger\n"
832
#| "udevadm settle\n"
833
#| "\n"
834
#| "if [ -f /etc/mdadm.conf ] ; then mdadm -As                       ; fi\n"
835
#| "if [ -x /sbin/vgchange  ] ; then /sbin/vgchange -a y &gt; /dev/null ; fi\n"
836
#| "if [ -n \"$rootdelay\"    ] ; then sleep \"$rootdelay\"              ; fi\n"
837
#| "\n"
838
#| "do_mount_root\n"
839
#| "\n"
840
#| "killall -w ${UDEVD##*/}\n"
841
#| "\n"
842
#| "exec switch_root /.root \"$init\" \"$@\"\n"
843
#| "</literal>\n"
844
#| "EOF</userinput>"
7156 jlepiller 845
msgid ""
846
"<userinput>mkdir -p /usr/share/mkinitramfs &amp;&amp;\n"
847
"cat &gt; /usr/share/mkinitramfs/init.in &lt;&lt; \"EOF\"\n"
7983 jlepiller 848
"<literal>#!/bin/sh\n"
7156 jlepiller 849
"\n"
850
"PATH=/bin:/usr/bin:/sbin:/usr/sbin\n"
851
"export PATH\n"
852
"\n"
853
"problem()\n"
854
"{\n"
855
"   printf \"Encountered a problem!\\n\\nDropping you to a shell.\\n\\n\"\n"
856
"   sh\n"
857
"}\n"
858
"\n"
859
"no_device()\n"
860
"{\n"
861
"   printf \"The device %s, which is supposed to contain the\\n\" $1\n"
862
"   printf \"root file system, does not exist.\\n\"\n"
863
"   printf \"Please fix this problem and exit this shell.\\n\\n\"\n"
864
"}\n"
865
"\n"
866
"no_mount()\n"
867
"{\n"
868
"   printf \"Could not mount device %s\\n\" $1\n"
869
"   printf \"Sleeping forever. Please reboot and fix the kernel command line.\\n\\n\"\n"
870
"   printf \"Maybe the device is formatted with an unsupported file system?\\n\\n\"\n"
871
"   printf \"Or maybe filesystem type autodetection went wrong, in which case\\n\"\n"
872
"   printf \"you should add the rootfstype=... parameter to the kernel command line.\\n\\n\"\n"
873
"   printf \"Available partitions:\\n\"\n"
874
"}\n"
875
"\n"
876
"do_mount_root()\n"
877
"{\n"
878
"   mkdir /.root\n"
879
"   [ -n \"$rootflags\" ] &amp;&amp; rootflags=\"$rootflags,\"\n"
880
"   rootflags=\"$rootflags$ro\"\n"
881
"\n"
882
"   case \"$root\" in\n"
883
"      /dev/* ) device=$root ;;\n"
884
"      UUID=* ) eval $root; device=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
885
"      LABEL=*) eval $root; device=\"/dev/disk/by-label/$LABEL\" ;;\n"
886
"      \"\"     ) echo \"No root device specified.\" ; problem    ;;\n"
887
"   esac\n"
888
"\n"
889
"   while [ ! -b \"$device\" ] ; do\n"
890
"       no_device $device\n"
891
"       problem\n"
892
"   done\n"
893
"\n"
894
"   if ! mount -n -t \"$rootfstype\" -o \"$rootflags\" \"$device\" /.root ; then\n"
895
"       no_mount $device\n"
896
"       cat /proc/partitions\n"
897
"       while true ; do sleep 10000 ; done\n"
898
"   else\n"
899
"       echo \"Successfully mounted device $root\"\n"
900
"   fi\n"
901
"}\n"
902
"\n"
8079 jlepiller 903
"do_try_resume()\n"
904
"{\n"
905
"   case \"$resume\" in\n"
906
"      UUID=* ) eval $resume; resume=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
907
"      LABEL=*) eval $resume; resume=\"/dev/disk/by-label/$LABEL\" ;;\n"
908
"   esac\n"
909
"\n"
910
"   if $noresume || ! [ -b \"$resume\" ]; then return; fi\n"
911
"\n"
912
"   ls -lH \"$resume\" | ( read x x x x maj min x\n"
913
"       echo -n ${maj%,}:$min &gt; /sys/power/resume )\n"
914
"}\n"
915
"\n"
7156 jlepiller 916
"init=/sbin/init\n"
917
"root=\n"
918
"rootdelay=\n"
919
"rootfstype=auto\n"
920
"ro=\"ro\"\n"
921
"rootflags=\n"
922
"device=\n"
8079 jlepiller 923
"resume=\n"
924
"noresume=false\n"
7156 jlepiller 925
"\n"
926
"mount -n -t devtmpfs devtmpfs /dev\n"
927
"mount -n -t proc     proc     /proc\n"
928
"mount -n -t sysfs    sysfs    /sys\n"
929
"mount -n -t tmpfs    tmpfs    /run\n"
930
"\n"
931
"read -r cmdline &lt; /proc/cmdline\n"
932
"\n"
933
"for param in $cmdline ; do\n"
934
"  case $param in\n"
935
"    init=*      ) init=${param#init=}             ;;\n"
936
"    root=*      ) root=${param#root=}             ;;\n"
937
"    rootdelay=* ) rootdelay=${param#rootdelay=}   ;;\n"
938
"    rootfstype=*) rootfstype=${param#rootfstype=} ;;\n"
939
"    rootflags=* ) rootflags=${param#rootflags=}   ;;\n"
8079 jlepiller 940
"    resume=*    ) resume=${param#resume=}         ;;\n"
941
"    noresume    ) noresume=true                   ;;\n"
7156 jlepiller 942
"    ro          ) ro=\"ro\"                         ;;\n"
943
"    rw          ) ro=\"rw\"                         ;;\n"
944
"  esac\n"
945
"done\n"
946
"\n"
947
"# udevd location depends on version\n"
948
"if [ -x /sbin/udevd ]; then\n"
949
"  UDEVD=/sbin/udevd\n"
950
"elif [ -x /lib/udev/udevd ]; then\n"
951
"  UDEVD=/lib/udev/udevd\n"
952
"elif [ -x /lib/systemd/systemd-udevd ]; then\n"
953
"  UDEVD=/lib/systemd/systemd-udevd\n"
954
"else\n"
955
"  echo \"Cannot find udevd nor systemd-udevd\"\n"
956
"  problem\n"
957
"fi\n"
958
"\n"
959
"${UDEVD} --daemon --resolve-names=never\n"
960
"udevadm trigger\n"
961
"udevadm settle\n"
962
"\n"
963
"if [ -f /etc/mdadm.conf ] ; then mdadm -As                       ; fi\n"
964
"if [ -x /sbin/vgchange  ] ; then /sbin/vgchange -a y &gt; /dev/null ; fi\n"
965
"if [ -n \"$rootdelay\"    ] ; then sleep \"$rootdelay\"              ; fi\n"
966
"\n"
8079 jlepiller 967
"do_try_resume # This function will not return if resuming from disk\n"
7156 jlepiller 968
"do_mount_root\n"
969
"\n"
970
"killall -w ${UDEVD##*/}\n"
971
"\n"
972
"exec switch_root /.root \"$init\" \"$@\"\n"
7983 jlepiller 973
"</literal>\n"
7156 jlepiller 974
"EOF</userinput>"
975
msgstr ""
976
"<userinput>mkdir -p /usr/share/mkinitramfs &amp;&amp;\n"
977
"cat &gt; /usr/share/mkinitramfs/init.in &lt;&lt; \"EOF\"\n"
7983 jlepiller 978
"<literal>#!/bin/sh\n"
7156 jlepiller 979
"\n"
980
"PATH=/bin:/usr/bin:/sbin:/usr/sbin\n"
981
"export PATH\n"
982
"\n"
983
"problem()\n"
984
"{\n"
985
"   printf \"Encountered a problem!\\n\\nDropping you to a shell.\\n\\n\"\n"
986
"   sh\n"
987
"}\n"
988
"\n"
989
"no_device()\n"
990
"{\n"
991
"   printf \"The device %s, which is supposed to contain the\\n\" $1\n"
992
"   printf \"root file system, does not exist.\\n\"\n"
993
"   printf \"Please fix this problem and exit this shell.\\n\\n\"\n"
994
"}\n"
995
"\n"
996
"no_mount()\n"
997
"{\n"
998
"   printf \"Could not mount device %s\\n\" $1\n"
999
"   printf \"Sleeping forever. Please reboot and fix the kernel command line.\\n\\n\"\n"
1000
"   printf \"Maybe the device is formatted with an unsupported file system?\\n\\n\"\n"
1001
"   printf \"Or maybe filesystem type autodetection went wrong, in which case\\n\"\n"
1002
"   printf \"you should add the rootfstype=... parameter to the kernel command line.\\n\\n\"\n"
1003
"   printf \"Available partitions:\\n\"\n"
1004
"}\n"
1005
"\n"
1006
"do_mount_root()\n"
1007
"{\n"
1008
"   mkdir /.root\n"
1009
"   [ -n \"$rootflags\" ] &amp;&amp; rootflags=\"$rootflags,\"\n"
1010
"   rootflags=\"$rootflags$ro\"\n"
1011
"\n"
1012
"   case \"$root\" in\n"
1013
"      /dev/* ) device=$root ;;\n"
1014
"      UUID=* ) eval $root; device=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
1015
"      LABEL=*) eval $root; device=\"/dev/disk/by-label/$LABEL\" ;;\n"
1016
"      \"\"     ) echo \"No root device specified.\" ; problem    ;;\n"
1017
"   esac\n"
1018
"\n"
1019
"   while [ ! -b \"$device\" ] ; do\n"
1020
"       no_device $device\n"
1021
"       problem\n"
1022
"   done\n"
1023
"\n"
1024
"   if ! mount -n -t \"$rootfstype\" -o \"$rootflags\" \"$device\" /.root ; then\n"
1025
"       no_mount $device\n"
1026
"       cat /proc/partitions\n"
1027
"       while true ; do sleep 10000 ; done\n"
1028
"   else\n"
1029
"       echo \"Successfully mounted device $root\"\n"
1030
"   fi\n"
1031
"}\n"
1032
"\n"
8079 jlepiller 1033
"do_try_resume()\n"
1034
"{\n"
1035
"   case \"$resume\" in\n"
1036
"      UUID=* ) eval $resume; resume=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
1037
"      LABEL=*) eval $resume; resume=\"/dev/disk/by-label/$LABEL\" ;;\n"
1038
"   esac\n"
1039
"\n"
1040
"   if $noresume || ! [ -b \"$resume\" ]; then return; fi\n"
1041
"\n"
1042
"   ls -lH \"$resume\" | ( read x x x x maj min x\n"
1043
"       echo -n ${maj%,}:$min &gt; /sys/power/resume )\n"
1044
"}\n"
1045
"\n"
7156 jlepiller 1046
"init=/sbin/init\n"
1047
"root=\n"
1048
"rootdelay=\n"
1049
"rootfstype=auto\n"
1050
"ro=\"ro\"\n"
1051
"rootflags=\n"
1052
"device=\n"
8079 jlepiller 1053
"resume=\n"
1054
"noresume=false\n"
7156 jlepiller 1055
"\n"
1056
"mount -n -t devtmpfs devtmpfs /dev\n"
1057
"mount -n -t proc     proc     /proc\n"
1058
"mount -n -t sysfs    sysfs    /sys\n"
1059
"mount -n -t tmpfs    tmpfs    /run\n"
1060
"\n"
1061
"read -r cmdline &lt; /proc/cmdline\n"
1062
"\n"
1063
"for param in $cmdline ; do\n"
1064
"  case $param in\n"
1065
"    init=*      ) init=${param#init=}             ;;\n"
1066
"    root=*      ) root=${param#root=}             ;;\n"
1067
"    rootdelay=* ) rootdelay=${param#rootdelay=}   ;;\n"
1068
"    rootfstype=*) rootfstype=${param#rootfstype=} ;;\n"
1069
"    rootflags=* ) rootflags=${param#rootflags=}   ;;\n"
8079 jlepiller 1070
"    resume=*    ) resume=${param#resume=}         ;;\n"
1071
"    noresume    ) noresume=true                   ;;\n"
7156 jlepiller 1072
"    ro          ) ro=\"ro\"                         ;;\n"
1073
"    rw          ) ro=\"rw\"                         ;;\n"
1074
"  esac\n"
1075
"done\n"
1076
"\n"
1077
"# udevd location depends on version\n"
1078
"if [ -x /sbin/udevd ]; then\n"
1079
"  UDEVD=/sbin/udevd\n"
1080
"elif [ -x /lib/udev/udevd ]; then\n"
1081
"  UDEVD=/lib/udev/udevd\n"
1082
"elif [ -x /lib/systemd/systemd-udevd ]; then\n"
1083
"  UDEVD=/lib/systemd/systemd-udevd\n"
1084
"else\n"
1085
"  echo \"Cannot find udevd nor systemd-udevd\"\n"
1086
"  problem\n"
1087
"fi\n"
1088
"\n"
1089
"${UDEVD} --daemon --resolve-names=never\n"
1090
"udevadm trigger\n"
1091
"udevadm settle\n"
1092
"\n"
1093
"if [ -f /etc/mdadm.conf ] ; then mdadm -As                       ; fi\n"
1094
"if [ -x /sbin/vgchange  ] ; then /sbin/vgchange -a y &gt; /dev/null ; fi\n"
1095
"if [ -n \"$rootdelay\"    ] ; then sleep \"$rootdelay\"              ; fi\n"
1096
"\n"
8079 jlepiller 1097
"do_try_resume # This function will not return if resuming from disk\n"
7156 jlepiller 1098
"do_mount_root\n"
1099
"\n"
1100
"killall -w ${UDEVD##*/}\n"
1101
"\n"
1102
"exec switch_root /.root \"$init\" \"$@\"\n"
7983 jlepiller 1103
"</literal>\n"
7156 jlepiller 1104
"EOF</userinput>"
1105
 
1106
#. type: Content of: <sect1><sect2><title>
8079 jlepiller 1107
#: blfs-en/postlfs/filesystems/initramfs.xml:387
7156 jlepiller 1108
msgid "Using an initramfs"
1109
msgstr "Utilisation d'un initramfs"
1110
 
1111
#. type: Content of: <sect1><sect2><bridgehead>
8079 jlepiller 1112
#: blfs-en/postlfs/filesystems/initramfs.xml:389
7156 jlepiller 1113
msgid "Required Runtime Dependency"
1114
msgstr "Dépendance d'exécution requise"
1115
 
1116
#. type: Content of: <sect1><sect2><para>
8079 jlepiller 1117
#: blfs-en/postlfs/filesystems/initramfs.xml:392
7313 jlepiller 1118
msgid "<xref role=\"runtime\" linkend=\"cpio\"/>"
1119
msgstr "<xref role=\"runtime\" linkend=\"cpio\"/>"
7156 jlepiller 1120
 
1121
#. type: Content of: <sect1><sect2><para>
8079 jlepiller 1122
#: blfs-en/postlfs/filesystems/initramfs.xml:395
7156 jlepiller 1123
msgid "User Notes: <ulink url=\"&blfs-wiki;/initramfs\"/>"
1124
msgstr "Notes utilisateur&nbsp;: <ulink url=\"&blfs-wiki;/initramfs\"/>"
1125
 
1126
#. type: Content of: <sect1><sect2><para>
8079 jlepiller 1127
#: blfs-en/postlfs/filesystems/initramfs.xml:400
7156 jlepiller 1128
msgid ""
7165 jlepiller 1129
"To build an initramfs, run the following as the <systemitem "
1130
"class=\"username\">root</systemitem> user:"
7156 jlepiller 1131
msgstr ""
1132
"Pour construire un initramfs, lancer ce qui suit en tant qu'utilisateur "
1133
"<systemitem class=\"username\">root</systemitem>&nbsp;:"
1134
 
1135
#. type: Content of: <sect1><sect2><screen>
8079 jlepiller 1136
#: blfs-en/postlfs/filesystems/initramfs.xml:403
7156 jlepiller 1137
#, no-wrap
1138
msgid "<userinput>mkinitramfs [KERNEL VERSION]</userinput>"
1139
msgstr "<userinput>mkinitramfs [KERNEL VERSION]</userinput>"
1140
 
1141
#. type: Content of: <sect1><sect2><para>
8079 jlepiller 1142
#: blfs-en/postlfs/filesystems/initramfs.xml:405
7156 jlepiller 1143
msgid ""
1144
"The optional argument is the directory where the appropriate kernel modules "
7165 jlepiller 1145
"are located. This must be a subdirectory of <filename class='directory'> "
1146
"/lib/modules</filename>.  If no modules are specified, then the initramfs is"
1147
" named <emphasis>initrd.img-no-kmods</emphasis>.  If a kernel version is "
1148
"specified, the initrd is named "
1149
"<emphasis>initrd.img-$KERNEL_VERSION</emphasis> and is only appropriate for "
1150
"the specific kernel specified. The output file will be placed in the current"
1151
" directory."
7156 jlepiller 1152
msgstr ""
1153
"L'argument facultatif est le répertoire où les modules appropriés du noyau "
1154
"sont enregistrés.  Cela peut être un sous-répertoire de <filename "
7165 jlepiller 1155
"class='directory'> /lib/modules</filename>.  Si aucun module n'est spécifié,"
1156
" alors l'initramfs est appelé <emphasis>initrd.img-no-kmods</emphasis>.  Si "
7156 jlepiller 1157
"une version du noyau est précisé, le fichier initrd est appelé "
1158
"<emphasis>initrd.img-$KERNEL_VERSION</emphasis> et est seulement destiné "
1159
"pour le noyau spécifiquement précisé. Les fichiers de sortie seront "
1160
"enregistrés dans le répertoire courant."
1161
 
1162
#. type: Content of: <sect1><sect2><para>
8079 jlepiller 1163
#: blfs-en/postlfs/filesystems/initramfs.xml:414
7156 jlepiller 1164
msgid ""
7165 jlepiller 1165
"After generating the initrd, copy it to the <filename "
1166
"class='directory'>/boot</filename> directory."
7156 jlepiller 1167
msgstr ""
7165 jlepiller 1168
"Après avoir généré le fichier initrd, copiez-le dans le répertoire <filename"
1169
" class='directory'>/boot</filename>."
7156 jlepiller 1170
 
1171
#. type: Content of: <sect1><sect2><para>
8079 jlepiller 1172
#: blfs-en/postlfs/filesystems/initramfs.xml:417
7156 jlepiller 1173
msgid ""
1174
"Now edit <filename>/boot/grub/grub.cfg</filename> and add a new menuentry.  "
1175
"Below are several examples."
1176
msgstr ""
1177
"Maintenant éditez <filename>/boot/grub/grub.cfg</filename> et ajoutez une "
1178
"nouvelle entrée dans le menu. En dessous, plusieurs exemples sont présentés."
1179
 
1180
#. type: Content of: <sect1><sect2><screen>
8079 jlepiller 1181
#: blfs-en/postlfs/filesystems/initramfs.xml:420
7156 jlepiller 1182
#, no-wrap
1183
msgid ""
1184
"<userinput># Generic initramfs and root fs identified by UUID\n"
1185
"menuentry \"LFS Dev (LFS-7.0-Feb14) initrd, Linux 3.0.4\"\n"
1186
"{\n"
1187
"  linux  /vmlinuz-3.0.4-lfs-20120214 root=UUID=54b934a9-302d-415e-ac11-4988408eb0a8 ro\n"
1188
"  initrd /initrd.img-no-kmods\n"
1189
"}</userinput>"
1190
msgstr ""
1191
"<userinput># Generic initramfs and root fs identified by UUID\n"
1192
"menuentry \"LFS Dev (LFS-7.0-Feb14) initrd, Linux 3.0.4\"\n"
1193
"{\n"
1194
"  linux  /vmlinuz-3.0.4-lfs-20120214 root=UUID=54b934a9-302d-415e-ac11-4988408eb0a8 ro\n"
1195
"  initrd /initrd.img-no-kmods\n"
1196
"}</userinput>"
1197
 
1198
#. type: Content of: <sect1><sect2><screen>
8079 jlepiller 1199
#: blfs-en/postlfs/filesystems/initramfs.xml:427
7156 jlepiller 1200
#, no-wrap
1201
msgid ""
1202
"<userinput># Generic initramfs and root fs on LVM partition\n"
1203
"menuentry \"LFS Dev (LFS-7.0-Feb18) initrd lvm, Linux 3.0.4\"\n"
1204
"{\n"
1205
"  linux  /vmlinuz-3.0.4-lfs-20120218 root=/dev/mapper/myroot ro\n"
1206
"  initrd /initrd.img-no-kmods\n"
1207
"}</userinput>"
1208
msgstr ""
1209
"<userinput># Generic initramfs and root fs on LVM partition\n"
1210
"menuentry \"LFS Dev (LFS-7.0-Feb18) initrd lvm, Linux 3.0.4\"\n"
1211
"{\n"
1212
"  linux  /vmlinuz-3.0.4-lfs-20120218 root=/dev/mapper/myroot ro\n"
1213
"  initrd /initrd.img-no-kmods\n"
1214
"}</userinput>"
1215
 
1216
#. type: Content of: <sect1><sect2><screen>
8079 jlepiller 1217
#: blfs-en/postlfs/filesystems/initramfs.xml:434
7156 jlepiller 1218
#, no-wrap
1219
msgid ""
1220
"<userinput># Specific initramfs and root fs identified by LABEL\n"
1221
"menuentry \"LFS Dev (LFS-7.1-Feb20) initrd label, Linux 3.2.6\"\n"
1222
"{\n"
1223
"  linux  /vmlinuz-3.2.6-lfs71-120220 root=LABEL=lfs71 ro\n"
1224
"  initrd /initrd.img-3.2.6-lfs71-120220\n"
1225
"}</userinput>"
1226
msgstr ""
1227
"<userinput># Specific initramfs and root fs identified by LABEL\n"
1228
"menuentry \"LFS Dev (LFS-7.1-Feb20) initrd label, Linux 3.2.6\"\n"
1229
"{\n"
1230
"  linux  /vmlinuz-3.2.6-lfs71-120220 root=LABEL=lfs71 ro\n"
1231
"  initrd /initrd.img-3.2.6-lfs71-120220\n"
1232
"}</userinput>"
1233
 
1234
#. type: Content of: <sect1><sect2><para>
8079 jlepiller 1235
#: blfs-en/postlfs/filesystems/initramfs.xml:441
7156 jlepiller 1236
msgid "Finally, reboot the system and select the desired system."
1237
msgstr "Finalement, redémarrez le système et sélectionnez le système désiré."