Subversion Repositories svn LFS-FR

Rev

Rev 7854 | Rev 8069 | 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"
7983 jlepiller 9
"POT-Creation-Date: 2019-06-28 04:06+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
7854 jlepiller 23
#| msgid ""
7983 jlepiller 24
#| "<othername>$LastChangedBy: pierre $</othername> <date>$Date: 2019-03-25 "
25
#| "21:43:22 +0000 (Mon, 25 Mar 2019) $</date>"
7156 jlepiller 26
msgid ""
7983 jlepiller 27
"<othername>$LastChangedBy: bdubbs $</othername> <date>$Date: 2019-06-27 "
28
"20:55:17 +0000 (Thu, 27 Jun 2019) $</date>"
7156 jlepiller 29
msgstr ""
7983 jlepiller 30
"<othername>$LastChangedBy: bdubbs $</othername> <date>$Date: 2019-06-27 "
31
"20:55:17 +0000 (Thu, 27 Jun 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
7854 jlepiller 138
#| msgid ""
139
#| "<userinput>cat &gt; /sbin/mkinitramfs &lt;&lt; \"EOF\"\n"
140
#| "#!/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
#| "\n"
330
#| "EOF\n"
331
#| "\n"
7983 jlepiller 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"
503
"\n"
504
"# Install the kernel modules if requested\n"
505
"if [ -n \"$KERNEL_VERSION\" ]; then\n"
506
"  find                                                                        \\\n"
507
"     /lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib}                      \\\n"
508
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{block,ata,md,firewire}      \\\n"
509
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{scsi,message,pcmcia,virtio} \\\n"
510
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/usb/{host,storage}           \\\n"
511
"     -type f 2&gt; /dev/null | cpio --make-directories -p --quiet $WDIR\n"
512
"\n"
513
"  cp /lib/modules/$KERNEL_VERSION/modules.{builtin,order}                     \\\n"
514
"            $WDIR/lib/modules/$KERNEL_VERSION\n"
515
"\n"
516
"  depmod -b $WDIR $KERNEL_VERSION\n"
517
"fi\n"
518
"\n"
519
"( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) &gt; $INITRAMFS_FILE\n"
520
"\n"
521
"# Remove the temporary directory and file\n"
522
"rm -rf $WDIR $unsorted\n"
523
"printf \"done.\\n\"\n"
7983 jlepiller 524
"</literal>\n"
7156 jlepiller 525
"EOF\n"
526
"\n"
7854 jlepiller 527
"chmod 0755 /sbin/mkinitramfs</userinput>"
7156 jlepiller 528
msgstr ""
529
"<userinput>cat &gt; /sbin/mkinitramfs &lt;&lt; \"EOF\"\n"
7983 jlepiller 530
"<literal>#!/bin/bash\n"
7156 jlepiller 531
"# This file based in part on the mkinitramfs script for the LFS LiveCD\n"
532
"# written by Alexander E. Patrakov and Jeremy Huntwork.\n"
533
"\n"
534
"copy()\n"
535
"{\n"
536
"  local file\n"
537
"\n"
538
"  if [ \"$2\" == \"lib\" ]; then\n"
539
"    file=$(PATH=/lib:/usr/lib type -p $1)\n"
540
"  else\n"
541
"    file=$(type -p $1)\n"
542
"  fi\n"
543
"\n"
544
"  if [ -n $file ] ; then\n"
545
"    cp $file $WDIR/$2\n"
546
"  else\n"
547
"    echo \"Missing required file: $1 for directory $2\"\n"
548
"    rm -rf $WDIR\n"
549
"    exit 1\n"
550
"  fi\n"
551
"}\n"
552
"\n"
553
"if [ -z $1 ] ; then\n"
554
"  INITRAMFS_FILE=initrd.img-no-kmods\n"
555
"else\n"
556
"  KERNEL_VERSION=$1\n"
557
"  INITRAMFS_FILE=initrd.img-$KERNEL_VERSION\n"
558
"fi\n"
559
"\n"
560
"if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ ! -d \"/lib/modules/$1\" ] ; then\n"
561
"  echo \"No modules directory named $1\"\n"
562
"  exit 1\n"
563
"fi\n"
564
"\n"
565
"printf \"Creating $INITRAMFS_FILE... \"\n"
566
"\n"
567
"binfiles=\"sh cat cp dd killall ls mkdir mknod mount \"\n"
568
"binfiles=\"$binfiles umount sed sleep ln rm uname\"\n"
7334 jlepiller 569
"binfiles=\"$binfiles readlink basename\"\n"
7156 jlepiller 570
"\n"
571
"# Systemd installs udevadm in /bin. Other udev implementations have it in /sbin\n"
572
"if [ -x /bin/udevadm ] ; then binfiles=\"$binfiles udevadm\"; fi\n"
573
"\n"
574
"sbinfiles=\"modprobe blkid switch_root\"\n"
575
"\n"
576
"#Optional files and locations\n"
7165 jlepiller 577
"for f in mdadm mdmon udevd udevadm; do\n"
7156 jlepiller 578
"  if [ -x /sbin/$f ] ; then sbinfiles=\"$sbinfiles $f\"; fi\n"
579
"done\n"
580
"\n"
581
"unsorted=$(mktemp /tmp/unsorted.XXXXXXXXXX)\n"
582
"\n"
583
"DATADIR=/usr/share/mkinitramfs\n"
584
"INITIN=init.in\n"
585
"\n"
7165 jlepiller 586
"# Create a temporary working directory\n"
7156 jlepiller 587
"WDIR=$(mktemp -d /tmp/initrd-work.XXXXXXXXXX)\n"
588
"\n"
589
"# Create base directory structure\n"
7334 jlepiller 590
"mkdir -p $WDIR/{bin,dev,lib/firmware,run,sbin,sys,proc,usr}\n"
7156 jlepiller 591
"mkdir -p $WDIR/etc/{modprobe.d,udev/rules.d}\n"
592
"touch $WDIR/etc/modprobe.d/modprobe.conf\n"
593
"ln -s lib $WDIR/lib64\n"
7334 jlepiller 594
"ln -s ../bin $WDIR/usr/bin\n"
7156 jlepiller 595
"\n"
596
"# Create necessary device nodes\n"
597
"mknod -m 640 $WDIR/dev/console c 5 1\n"
598
"mknod -m 664 $WDIR/dev/null    c 1 3\n"
599
"\n"
600
"# Install the udev configuration files\n"
601
"if [ -f /etc/udev/udev.conf ]; then\n"
602
"  cp /etc/udev/udev.conf $WDIR/etc/udev/udev.conf\n"
603
"fi\n"
604
"\n"
605
"for file in $(find /etc/udev/rules.d/ -type f) ; do\n"
606
"  cp $file $WDIR/etc/udev/rules.d\n"
607
"done\n"
608
"\n"
609
"# Install any firmware present\n"
610
"cp -a /lib/firmware $WDIR/lib\n"
611
"\n"
612
"# Copy the RAID configuration file if present\n"
613
"if [ -f /etc/mdadm.conf ] ; then\n"
614
"  cp /etc/mdadm.conf $WDIR/etc\n"
615
"fi\n"
616
"\n"
617
"# Install the init file\n"
618
"install -m0755 $DATADIR/$INITIN $WDIR/init\n"
619
"\n"
620
"if [  -n \"$KERNEL_VERSION\" ] ; then\n"
621
"  if [ -x /bin/kmod ] ; then\n"
622
"    binfiles=\"$binfiles kmod\"\n"
623
"  else\n"
624
"    binfiles=\"$binfiles lsmod\"\n"
625
"    sbinfiles=\"$sbinfiles insmod\"\n"
626
"  fi\n"
627
"fi\n"
628
"\n"
629
"# Install basic binaries\n"
630
"for f in $binfiles ; do\n"
7334 jlepiller 631
"  if [ -e /bin/$f ]; then d=\"/bin\"; else d=\"/usr/bin\"; fi\n"
632
"  ldd $d/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
633
"  copy $d/$f bin\n"
7156 jlepiller 634
"done\n"
635
"\n"
636
"# Add lvm if present\n"
637
"if [ -x /sbin/lvm ] ; then sbinfiles=\"$sbinfiles lvm dmsetup\"; fi\n"
638
"\n"
639
"for f in $sbinfiles ; do\n"
640
"  ldd /sbin/$f | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
641
"  copy $f sbin\n"
642
"done\n"
643
"\n"
644
"# Add udevd libraries if not in /sbin\n"
645
"if [ -x /lib/udev/udevd ] ; then\n"
646
"  ldd /lib/udev/udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
647
"elif [ -x /lib/systemd/systemd-udevd ] ; then\n"
648
"  ldd /lib/systemd/systemd-udevd | sed \"s/\\t//\" | cut -d \" \" -f1 &gt;&gt; $unsorted\n"
649
"fi\n"
650
"\n"
651
"# Add module symlinks if appropriate\n"
652
"if [ -n \"$KERNEL_VERSION\" ] &amp;&amp; [ -x /bin/kmod ] ; then\n"
653
"  ln -s kmod $WDIR/bin/lsmod\n"
654
"  ln -s kmod $WDIR/bin/insmod\n"
655
"fi\n"
656
"\n"
657
"# Add lvm symlinks if appropriate\n"
658
"# Also copy the lvm.conf file\n"
659
"if  [ -x /sbin/lvm ] ; then\n"
660
"  ln -s lvm $WDIR/sbin/lvchange\n"
661
"  ln -s lvm $WDIR/sbin/lvrename\n"
662
"  ln -s lvm $WDIR/sbin/lvextend\n"
663
"  ln -s lvm $WDIR/sbin/lvcreate\n"
664
"  ln -s lvm $WDIR/sbin/lvdisplay\n"
665
"  ln -s lvm $WDIR/sbin/lvscan\n"
666
"\n"
667
"  ln -s lvm $WDIR/sbin/pvchange\n"
668
"  ln -s lvm $WDIR/sbin/pvck\n"
669
"  ln -s lvm $WDIR/sbin/pvcreate\n"
670
"  ln -s lvm $WDIR/sbin/pvdisplay\n"
671
"  ln -s lvm $WDIR/sbin/pvscan\n"
672
"\n"
673
"  ln -s lvm $WDIR/sbin/vgchange\n"
674
"  ln -s lvm $WDIR/sbin/vgcreate\n"
675
"  ln -s lvm $WDIR/sbin/vgscan\n"
676
"  ln -s lvm $WDIR/sbin/vgrename\n"
677
"  ln -s lvm $WDIR/sbin/vgck\n"
678
"  # Conf file(s)\n"
679
"  cp -a /etc/lvm $WDIR/etc\n"
680
"fi\n"
681
"\n"
682
"# Install libraries\n"
683
"sort $unsorted | uniq | while read library ; do\n"
684
"  if [ \"$library\" == \"linux-vdso.so.1\" ] ||\n"
685
"     [ \"$library\" == \"linux-gate.so.1\" ]; then\n"
686
"    continue\n"
687
"  fi\n"
688
"\n"
689
"  copy $library lib\n"
690
"done\n"
691
"\n"
692
"if [ -d /lib/udev ]; then\n"
693
"  cp -a /lib/udev $WDIR/lib\n"
694
"fi\n"
695
"if [ -d /lib/systemd ]; then\n"
696
"  cp -a /lib/systemd $WDIR/lib\n"
697
"fi\n"
698
"\n"
699
"# Install the kernel modules if requested\n"
700
"if [ -n \"$KERNEL_VERSION\" ]; then\n"
701
"  find                                                                        \\\n"
702
"     /lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib}                      \\\n"
703
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{block,ata,md,firewire}      \\\n"
704
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/{scsi,message,pcmcia,virtio} \\\n"
705
"     /lib/modules/$KERNEL_VERSION/kernel/drivers/usb/{host,storage}           \\\n"
706
"     -type f 2&gt; /dev/null | cpio --make-directories -p --quiet $WDIR\n"
707
"\n"
708
"  cp /lib/modules/$KERNEL_VERSION/modules.{builtin,order}                     \\\n"
709
"            $WDIR/lib/modules/$KERNEL_VERSION\n"
710
"\n"
711
"  depmod -b $WDIR $KERNEL_VERSION\n"
712
"fi\n"
713
"\n"
714
"( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) &gt; $INITRAMFS_FILE\n"
715
"\n"
716
"# Remove the temporary directory and file\n"
717
"rm -rf $WDIR $unsorted\n"
718
"printf \"done.\\n\"\n"
7983 jlepiller 719
"</literal>\n"
7156 jlepiller 720
"EOF\n"
721
"\n"
7854 jlepiller 722
"chmod 0755 /sbin/mkinitramfs</userinput>"
7156 jlepiller 723
 
724
#. type: Content of: <sect1><sect2><screen>
7334 jlepiller 725
#: blfs-en/postlfs/filesystems/initramfs.xml:251
7156 jlepiller 726
#, no-wrap
7983 jlepiller 727
#| msgid ""
728
#| "<userinput>mkdir -p /usr/share/mkinitramfs &amp;&amp;\n"
729
#| "cat &gt; /usr/share/mkinitramfs/init.in &lt;&lt; \"EOF\"\n"
730
#| "#!/bin/sh\n"
731
#| "\n"
732
#| "PATH=/bin:/usr/bin:/sbin:/usr/sbin\n"
733
#| "export PATH\n"
734
#| "\n"
735
#| "problem()\n"
736
#| "{\n"
737
#| "   printf \"Encountered a problem!\\n\\nDropping you to a shell.\\n\\n\"\n"
738
#| "   sh\n"
739
#| "}\n"
740
#| "\n"
741
#| "no_device()\n"
742
#| "{\n"
743
#| "   printf \"The device %s, which is supposed to contain the\\n\" $1\n"
744
#| "   printf \"root file system, does not exist.\\n\"\n"
745
#| "   printf \"Please fix this problem and exit this shell.\\n\\n\"\n"
746
#| "}\n"
747
#| "\n"
748
#| "no_mount()\n"
749
#| "{\n"
750
#| "   printf \"Could not mount device %s\\n\" $1\n"
751
#| "   printf \"Sleeping forever. Please reboot and fix the kernel command line.\\n\\n\"\n"
752
#| "   printf \"Maybe the device is formatted with an unsupported file system?\\n\\n\"\n"
753
#| "   printf \"Or maybe filesystem type autodetection went wrong, in which case\\n\"\n"
754
#| "   printf \"you should add the rootfstype=... parameter to the kernel command line.\\n\\n\"\n"
755
#| "   printf \"Available partitions:\\n\"\n"
756
#| "}\n"
757
#| "\n"
758
#| "do_mount_root()\n"
759
#| "{\n"
760
#| "   mkdir /.root\n"
761
#| "   [ -n \"$rootflags\" ] &amp;&amp; rootflags=\"$rootflags,\"\n"
762
#| "   rootflags=\"$rootflags$ro\"\n"
763
#| "\n"
764
#| "   case \"$root\" in\n"
765
#| "      /dev/* ) device=$root ;;\n"
766
#| "      UUID=* ) eval $root; device=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
767
#| "      LABEL=*) eval $root; device=\"/dev/disk/by-label/$LABEL\" ;;\n"
768
#| "      \"\"     ) echo \"No root device specified.\" ; problem    ;;\n"
769
#| "   esac\n"
770
#| "\n"
771
#| "   while [ ! -b \"$device\" ] ; do\n"
772
#| "       no_device $device\n"
773
#| "       problem\n"
774
#| "   done\n"
775
#| "\n"
776
#| "   if ! mount -n -t \"$rootfstype\" -o \"$rootflags\" \"$device\" /.root ; then\n"
777
#| "       no_mount $device\n"
778
#| "       cat /proc/partitions\n"
779
#| "       while true ; do sleep 10000 ; done\n"
780
#| "   else\n"
781
#| "       echo \"Successfully mounted device $root\"\n"
782
#| "   fi\n"
783
#| "}\n"
784
#| "\n"
785
#| "init=/sbin/init\n"
786
#| "root=\n"
787
#| "rootdelay=\n"
788
#| "rootfstype=auto\n"
789
#| "ro=\"ro\"\n"
790
#| "rootflags=\n"
791
#| "device=\n"
792
#| "\n"
793
#| "mount -n -t devtmpfs devtmpfs /dev\n"
794
#| "mount -n -t proc     proc     /proc\n"
795
#| "mount -n -t sysfs    sysfs    /sys\n"
796
#| "mount -n -t tmpfs    tmpfs    /run\n"
797
#| "\n"
798
#| "read -r cmdline &lt; /proc/cmdline\n"
799
#| "\n"
800
#| "for param in $cmdline ; do\n"
801
#| "  case $param in\n"
802
#| "    init=*      ) init=${param#init=}             ;;\n"
803
#| "    root=*      ) root=${param#root=}             ;;\n"
804
#| "    rootdelay=* ) rootdelay=${param#rootdelay=}   ;;\n"
805
#| "    rootfstype=*) rootfstype=${param#rootfstype=} ;;\n"
806
#| "    rootflags=* ) rootflags=${param#rootflags=}   ;;\n"
807
#| "    ro          ) ro=\"ro\"                         ;;\n"
808
#| "    rw          ) ro=\"rw\"                         ;;\n"
809
#| "  esac\n"
810
#| "done\n"
811
#| "\n"
812
#| "# udevd location depends on version\n"
813
#| "if [ -x /sbin/udevd ]; then\n"
814
#| "  UDEVD=/sbin/udevd\n"
815
#| "elif [ -x /lib/udev/udevd ]; then\n"
816
#| "  UDEVD=/lib/udev/udevd\n"
817
#| "elif [ -x /lib/systemd/systemd-udevd ]; then\n"
818
#| "  UDEVD=/lib/systemd/systemd-udevd\n"
819
#| "else\n"
820
#| "  echo \"Cannot find udevd nor systemd-udevd\"\n"
821
#| "  problem\n"
822
#| "fi\n"
823
#| "\n"
824
#| "${UDEVD} --daemon --resolve-names=never\n"
825
#| "udevadm trigger\n"
826
#| "udevadm settle\n"
827
#| "\n"
828
#| "if [ -f /etc/mdadm.conf ] ; then mdadm -As                       ; fi\n"
829
#| "if [ -x /sbin/vgchange  ] ; then /sbin/vgchange -a y &gt; /dev/null ; fi\n"
830
#| "if [ -n \"$rootdelay\"    ] ; then sleep \"$rootdelay\"              ; fi\n"
831
#| "\n"
832
#| "do_mount_root\n"
833
#| "\n"
834
#| "killall -w ${UDEVD##*/}\n"
835
#| "\n"
836
#| "exec switch_root /.root \"$init\" \"$@\"\n"
837
#| "\n"
838
#| "EOF</userinput>"
7156 jlepiller 839
msgid ""
840
"<userinput>mkdir -p /usr/share/mkinitramfs &amp;&amp;\n"
841
"cat &gt; /usr/share/mkinitramfs/init.in &lt;&lt; \"EOF\"\n"
7983 jlepiller 842
"<literal>#!/bin/sh\n"
7156 jlepiller 843
"\n"
844
"PATH=/bin:/usr/bin:/sbin:/usr/sbin\n"
845
"export PATH\n"
846
"\n"
847
"problem()\n"
848
"{\n"
849
"   printf \"Encountered a problem!\\n\\nDropping you to a shell.\\n\\n\"\n"
850
"   sh\n"
851
"}\n"
852
"\n"
853
"no_device()\n"
854
"{\n"
855
"   printf \"The device %s, which is supposed to contain the\\n\" $1\n"
856
"   printf \"root file system, does not exist.\\n\"\n"
857
"   printf \"Please fix this problem and exit this shell.\\n\\n\"\n"
858
"}\n"
859
"\n"
860
"no_mount()\n"
861
"{\n"
862
"   printf \"Could not mount device %s\\n\" $1\n"
863
"   printf \"Sleeping forever. Please reboot and fix the kernel command line.\\n\\n\"\n"
864
"   printf \"Maybe the device is formatted with an unsupported file system?\\n\\n\"\n"
865
"   printf \"Or maybe filesystem type autodetection went wrong, in which case\\n\"\n"
866
"   printf \"you should add the rootfstype=... parameter to the kernel command line.\\n\\n\"\n"
867
"   printf \"Available partitions:\\n\"\n"
868
"}\n"
869
"\n"
870
"do_mount_root()\n"
871
"{\n"
872
"   mkdir /.root\n"
873
"   [ -n \"$rootflags\" ] &amp;&amp; rootflags=\"$rootflags,\"\n"
874
"   rootflags=\"$rootflags$ro\"\n"
875
"\n"
876
"   case \"$root\" in\n"
877
"      /dev/* ) device=$root ;;\n"
878
"      UUID=* ) eval $root; device=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
879
"      LABEL=*) eval $root; device=\"/dev/disk/by-label/$LABEL\" ;;\n"
880
"      \"\"     ) echo \"No root device specified.\" ; problem    ;;\n"
881
"   esac\n"
882
"\n"
883
"   while [ ! -b \"$device\" ] ; do\n"
884
"       no_device $device\n"
885
"       problem\n"
886
"   done\n"
887
"\n"
888
"   if ! mount -n -t \"$rootfstype\" -o \"$rootflags\" \"$device\" /.root ; then\n"
889
"       no_mount $device\n"
890
"       cat /proc/partitions\n"
891
"       while true ; do sleep 10000 ; done\n"
892
"   else\n"
893
"       echo \"Successfully mounted device $root\"\n"
894
"   fi\n"
895
"}\n"
896
"\n"
897
"init=/sbin/init\n"
898
"root=\n"
899
"rootdelay=\n"
900
"rootfstype=auto\n"
901
"ro=\"ro\"\n"
902
"rootflags=\n"
903
"device=\n"
904
"\n"
905
"mount -n -t devtmpfs devtmpfs /dev\n"
906
"mount -n -t proc     proc     /proc\n"
907
"mount -n -t sysfs    sysfs    /sys\n"
908
"mount -n -t tmpfs    tmpfs    /run\n"
909
"\n"
910
"read -r cmdline &lt; /proc/cmdline\n"
911
"\n"
912
"for param in $cmdline ; do\n"
913
"  case $param in\n"
914
"    init=*      ) init=${param#init=}             ;;\n"
915
"    root=*      ) root=${param#root=}             ;;\n"
916
"    rootdelay=* ) rootdelay=${param#rootdelay=}   ;;\n"
917
"    rootfstype=*) rootfstype=${param#rootfstype=} ;;\n"
918
"    rootflags=* ) rootflags=${param#rootflags=}   ;;\n"
919
"    ro          ) ro=\"ro\"                         ;;\n"
920
"    rw          ) ro=\"rw\"                         ;;\n"
921
"  esac\n"
922
"done\n"
923
"\n"
924
"# udevd location depends on version\n"
925
"if [ -x /sbin/udevd ]; then\n"
926
"  UDEVD=/sbin/udevd\n"
927
"elif [ -x /lib/udev/udevd ]; then\n"
928
"  UDEVD=/lib/udev/udevd\n"
929
"elif [ -x /lib/systemd/systemd-udevd ]; then\n"
930
"  UDEVD=/lib/systemd/systemd-udevd\n"
931
"else\n"
932
"  echo \"Cannot find udevd nor systemd-udevd\"\n"
933
"  problem\n"
934
"fi\n"
935
"\n"
936
"${UDEVD} --daemon --resolve-names=never\n"
937
"udevadm trigger\n"
938
"udevadm settle\n"
939
"\n"
940
"if [ -f /etc/mdadm.conf ] ; then mdadm -As                       ; fi\n"
941
"if [ -x /sbin/vgchange  ] ; then /sbin/vgchange -a y &gt; /dev/null ; fi\n"
942
"if [ -n \"$rootdelay\"    ] ; then sleep \"$rootdelay\"              ; fi\n"
943
"\n"
944
"do_mount_root\n"
945
"\n"
946
"killall -w ${UDEVD##*/}\n"
947
"\n"
948
"exec switch_root /.root \"$init\" \"$@\"\n"
7983 jlepiller 949
"</literal>\n"
7156 jlepiller 950
"EOF</userinput>"
951
msgstr ""
952
"<userinput>mkdir -p /usr/share/mkinitramfs &amp;&amp;\n"
953
"cat &gt; /usr/share/mkinitramfs/init.in &lt;&lt; \"EOF\"\n"
7983 jlepiller 954
"<literal>#!/bin/sh\n"
7156 jlepiller 955
"\n"
956
"PATH=/bin:/usr/bin:/sbin:/usr/sbin\n"
957
"export PATH\n"
958
"\n"
959
"problem()\n"
960
"{\n"
961
"   printf \"Encountered a problem!\\n\\nDropping you to a shell.\\n\\n\"\n"
962
"   sh\n"
963
"}\n"
964
"\n"
965
"no_device()\n"
966
"{\n"
967
"   printf \"The device %s, which is supposed to contain the\\n\" $1\n"
968
"   printf \"root file system, does not exist.\\n\"\n"
969
"   printf \"Please fix this problem and exit this shell.\\n\\n\"\n"
970
"}\n"
971
"\n"
972
"no_mount()\n"
973
"{\n"
974
"   printf \"Could not mount device %s\\n\" $1\n"
975
"   printf \"Sleeping forever. Please reboot and fix the kernel command line.\\n\\n\"\n"
976
"   printf \"Maybe the device is formatted with an unsupported file system?\\n\\n\"\n"
977
"   printf \"Or maybe filesystem type autodetection went wrong, in which case\\n\"\n"
978
"   printf \"you should add the rootfstype=... parameter to the kernel command line.\\n\\n\"\n"
979
"   printf \"Available partitions:\\n\"\n"
980
"}\n"
981
"\n"
982
"do_mount_root()\n"
983
"{\n"
984
"   mkdir /.root\n"
985
"   [ -n \"$rootflags\" ] &amp;&amp; rootflags=\"$rootflags,\"\n"
986
"   rootflags=\"$rootflags$ro\"\n"
987
"\n"
988
"   case \"$root\" in\n"
989
"      /dev/* ) device=$root ;;\n"
990
"      UUID=* ) eval $root; device=\"/dev/disk/by-uuid/$UUID\"  ;;\n"
991
"      LABEL=*) eval $root; device=\"/dev/disk/by-label/$LABEL\" ;;\n"
992
"      \"\"     ) echo \"No root device specified.\" ; problem    ;;\n"
993
"   esac\n"
994
"\n"
995
"   while [ ! -b \"$device\" ] ; do\n"
996
"       no_device $device\n"
997
"       problem\n"
998
"   done\n"
999
"\n"
1000
"   if ! mount -n -t \"$rootfstype\" -o \"$rootflags\" \"$device\" /.root ; then\n"
1001
"       no_mount $device\n"
1002
"       cat /proc/partitions\n"
1003
"       while true ; do sleep 10000 ; done\n"
1004
"   else\n"
1005
"       echo \"Successfully mounted device $root\"\n"
1006
"   fi\n"
1007
"}\n"
1008
"\n"
1009
"init=/sbin/init\n"
1010
"root=\n"
1011
"rootdelay=\n"
1012
"rootfstype=auto\n"
1013
"ro=\"ro\"\n"
1014
"rootflags=\n"
1015
"device=\n"
1016
"\n"
1017
"mount -n -t devtmpfs devtmpfs /dev\n"
1018
"mount -n -t proc     proc     /proc\n"
1019
"mount -n -t sysfs    sysfs    /sys\n"
1020
"mount -n -t tmpfs    tmpfs    /run\n"
1021
"\n"
1022
"read -r cmdline &lt; /proc/cmdline\n"
1023
"\n"
1024
"for param in $cmdline ; do\n"
1025
"  case $param in\n"
1026
"    init=*      ) init=${param#init=}             ;;\n"
1027
"    root=*      ) root=${param#root=}             ;;\n"
1028
"    rootdelay=* ) rootdelay=${param#rootdelay=}   ;;\n"
1029
"    rootfstype=*) rootfstype=${param#rootfstype=} ;;\n"
1030
"    rootflags=* ) rootflags=${param#rootflags=}   ;;\n"
1031
"    ro          ) ro=\"ro\"                         ;;\n"
1032
"    rw          ) ro=\"rw\"                         ;;\n"
1033
"  esac\n"
1034
"done\n"
1035
"\n"
1036
"# udevd location depends on version\n"
1037
"if [ -x /sbin/udevd ]; then\n"
1038
"  UDEVD=/sbin/udevd\n"
1039
"elif [ -x /lib/udev/udevd ]; then\n"
1040
"  UDEVD=/lib/udev/udevd\n"
1041
"elif [ -x /lib/systemd/systemd-udevd ]; then\n"
1042
"  UDEVD=/lib/systemd/systemd-udevd\n"
1043
"else\n"
1044
"  echo \"Cannot find udevd nor systemd-udevd\"\n"
1045
"  problem\n"
1046
"fi\n"
1047
"\n"
1048
"${UDEVD} --daemon --resolve-names=never\n"
1049
"udevadm trigger\n"
1050
"udevadm settle\n"
1051
"\n"
1052
"if [ -f /etc/mdadm.conf ] ; then mdadm -As                       ; fi\n"
1053
"if [ -x /sbin/vgchange  ] ; then /sbin/vgchange -a y &gt; /dev/null ; fi\n"
1054
"if [ -n \"$rootdelay\"    ] ; then sleep \"$rootdelay\"              ; fi\n"
1055
"\n"
1056
"do_mount_root\n"
1057
"\n"
1058
"killall -w ${UDEVD##*/}\n"
1059
"\n"
1060
"exec switch_root /.root \"$init\" \"$@\"\n"
7983 jlepiller 1061
"</literal>\n"
7156 jlepiller 1062
"EOF</userinput>"
1063
 
1064
#. type: Content of: <sect1><sect2><title>
7334 jlepiller 1065
#: blfs-en/postlfs/filesystems/initramfs.xml:366
7156 jlepiller 1066
msgid "Using an initramfs"
1067
msgstr "Utilisation d'un initramfs"
1068
 
1069
#. type: Content of: <sect1><sect2><bridgehead>
7334 jlepiller 1070
#: blfs-en/postlfs/filesystems/initramfs.xml:368
7156 jlepiller 1071
msgid "Required Runtime Dependency"
1072
msgstr "Dépendance d'exécution requise"
1073
 
1074
#. type: Content of: <sect1><sect2><para>
7334 jlepiller 1075
#: blfs-en/postlfs/filesystems/initramfs.xml:371
7313 jlepiller 1076
msgid "<xref role=\"runtime\" linkend=\"cpio\"/>"
1077
msgstr "<xref role=\"runtime\" linkend=\"cpio\"/>"
7156 jlepiller 1078
 
1079
#. type: Content of: <sect1><sect2><para>
7334 jlepiller 1080
#: blfs-en/postlfs/filesystems/initramfs.xml:374
7156 jlepiller 1081
msgid "User Notes: <ulink url=\"&blfs-wiki;/initramfs\"/>"
1082
msgstr "Notes utilisateur&nbsp;: <ulink url=\"&blfs-wiki;/initramfs\"/>"
1083
 
1084
#. type: Content of: <sect1><sect2><para>
7334 jlepiller 1085
#: blfs-en/postlfs/filesystems/initramfs.xml:379
7156 jlepiller 1086
msgid ""
7165 jlepiller 1087
"To build an initramfs, run the following as the <systemitem "
1088
"class=\"username\">root</systemitem> user:"
7156 jlepiller 1089
msgstr ""
1090
"Pour construire un initramfs, lancer ce qui suit en tant qu'utilisateur "
1091
"<systemitem class=\"username\">root</systemitem>&nbsp;:"
1092
 
1093
#. type: Content of: <sect1><sect2><screen>
7334 jlepiller 1094
#: blfs-en/postlfs/filesystems/initramfs.xml:382
7156 jlepiller 1095
#, no-wrap
1096
msgid "<userinput>mkinitramfs [KERNEL VERSION]</userinput>"
1097
msgstr "<userinput>mkinitramfs [KERNEL VERSION]</userinput>"
1098
 
1099
#. type: Content of: <sect1><sect2><para>
7334 jlepiller 1100
#: blfs-en/postlfs/filesystems/initramfs.xml:384
7156 jlepiller 1101
msgid ""
1102
"The optional argument is the directory where the appropriate kernel modules "
7165 jlepiller 1103
"are located. This must be a subdirectory of <filename class='directory'> "
1104
"/lib/modules</filename>.  If no modules are specified, then the initramfs is"
1105
" named <emphasis>initrd.img-no-kmods</emphasis>.  If a kernel version is "
1106
"specified, the initrd is named "
1107
"<emphasis>initrd.img-$KERNEL_VERSION</emphasis> and is only appropriate for "
1108
"the specific kernel specified. The output file will be placed in the current"
1109
" directory."
7156 jlepiller 1110
msgstr ""
1111
"L'argument facultatif est le répertoire où les modules appropriés du noyau "
1112
"sont enregistrés.  Cela peut être un sous-répertoire de <filename "
7165 jlepiller 1113
"class='directory'> /lib/modules</filename>.  Si aucun module n'est spécifié,"
1114
" alors l'initramfs est appelé <emphasis>initrd.img-no-kmods</emphasis>.  Si "
7156 jlepiller 1115
"une version du noyau est précisé, le fichier initrd est appelé "
1116
"<emphasis>initrd.img-$KERNEL_VERSION</emphasis> et est seulement destiné "
1117
"pour le noyau spécifiquement précisé. Les fichiers de sortie seront "
1118
"enregistrés dans le répertoire courant."
1119
 
1120
#. type: Content of: <sect1><sect2><para>
7334 jlepiller 1121
#: blfs-en/postlfs/filesystems/initramfs.xml:393
7156 jlepiller 1122
msgid ""
7165 jlepiller 1123
"After generating the initrd, copy it to the <filename "
1124
"class='directory'>/boot</filename> directory."
7156 jlepiller 1125
msgstr ""
7165 jlepiller 1126
"Après avoir généré le fichier initrd, copiez-le dans le répertoire <filename"
1127
" class='directory'>/boot</filename>."
7156 jlepiller 1128
 
1129
#. type: Content of: <sect1><sect2><para>
7334 jlepiller 1130
#: blfs-en/postlfs/filesystems/initramfs.xml:396
7156 jlepiller 1131
msgid ""
1132
"Now edit <filename>/boot/grub/grub.cfg</filename> and add a new menuentry.  "
1133
"Below are several examples."
1134
msgstr ""
1135
"Maintenant éditez <filename>/boot/grub/grub.cfg</filename> et ajoutez une "
1136
"nouvelle entrée dans le menu. En dessous, plusieurs exemples sont présentés."
1137
 
1138
#. type: Content of: <sect1><sect2><screen>
7334 jlepiller 1139
#: blfs-en/postlfs/filesystems/initramfs.xml:399
7156 jlepiller 1140
#, no-wrap
1141
msgid ""
1142
"<userinput># Generic initramfs and root fs identified by UUID\n"
1143
"menuentry \"LFS Dev (LFS-7.0-Feb14) initrd, Linux 3.0.4\"\n"
1144
"{\n"
1145
"  linux  /vmlinuz-3.0.4-lfs-20120214 root=UUID=54b934a9-302d-415e-ac11-4988408eb0a8 ro\n"
1146
"  initrd /initrd.img-no-kmods\n"
1147
"}</userinput>"
1148
msgstr ""
1149
"<userinput># Generic initramfs and root fs identified by UUID\n"
1150
"menuentry \"LFS Dev (LFS-7.0-Feb14) initrd, Linux 3.0.4\"\n"
1151
"{\n"
1152
"  linux  /vmlinuz-3.0.4-lfs-20120214 root=UUID=54b934a9-302d-415e-ac11-4988408eb0a8 ro\n"
1153
"  initrd /initrd.img-no-kmods\n"
1154
"}</userinput>"
1155
 
1156
#. type: Content of: <sect1><sect2><screen>
7334 jlepiller 1157
#: blfs-en/postlfs/filesystems/initramfs.xml:406
7156 jlepiller 1158
#, no-wrap
1159
msgid ""
1160
"<userinput># Generic initramfs and root fs on LVM partition\n"
1161
"menuentry \"LFS Dev (LFS-7.0-Feb18) initrd lvm, Linux 3.0.4\"\n"
1162
"{\n"
1163
"  linux  /vmlinuz-3.0.4-lfs-20120218 root=/dev/mapper/myroot ro\n"
1164
"  initrd /initrd.img-no-kmods\n"
1165
"}</userinput>"
1166
msgstr ""
1167
"<userinput># Generic initramfs and root fs on LVM partition\n"
1168
"menuentry \"LFS Dev (LFS-7.0-Feb18) initrd lvm, Linux 3.0.4\"\n"
1169
"{\n"
1170
"  linux  /vmlinuz-3.0.4-lfs-20120218 root=/dev/mapper/myroot ro\n"
1171
"  initrd /initrd.img-no-kmods\n"
1172
"}</userinput>"
1173
 
1174
#. type: Content of: <sect1><sect2><screen>
7334 jlepiller 1175
#: blfs-en/postlfs/filesystems/initramfs.xml:413
7156 jlepiller 1176
#, no-wrap
1177
msgid ""
1178
"<userinput># Specific initramfs and root fs identified by LABEL\n"
1179
"menuentry \"LFS Dev (LFS-7.1-Feb20) initrd label, Linux 3.2.6\"\n"
1180
"{\n"
1181
"  linux  /vmlinuz-3.2.6-lfs71-120220 root=LABEL=lfs71 ro\n"
1182
"  initrd /initrd.img-3.2.6-lfs71-120220\n"
1183
"}</userinput>"
1184
msgstr ""
1185
"<userinput># Specific initramfs and root fs identified by LABEL\n"
1186
"menuentry \"LFS Dev (LFS-7.1-Feb20) initrd label, Linux 3.2.6\"\n"
1187
"{\n"
1188
"  linux  /vmlinuz-3.2.6-lfs71-120220 root=LABEL=lfs71 ro\n"
1189
"  initrd /initrd.img-3.2.6-lfs71-120220\n"
1190
"}</userinput>"
1191
 
1192
#. type: Content of: <sect1><sect2><para>
7334 jlepiller 1193
#: blfs-en/postlfs/filesystems/initramfs.xml:420
7156 jlepiller 1194
msgid "Finally, reboot the system and select the desired system."
1195
msgstr "Finalement, redémarrez le système et sélectionnez le système désiré."