Commit Graph

222 Commits (c97209fe69dbbacb1f87acf5ec8a0e558e553ddc)

Author SHA1 Message Date
Harald Hoyer 3177d12d2b Merge pull request #91 from dracut-mailing-devs/1437470322-992-1-git-send-email-cfan@redhat.com
remove the incomplete .img file
2015-11-11 11:48:21 +01:00
Lidong Zhong aa169b3bd3 dracut.sh: remove duplicate call of push_host_devs
There is no way exit between the two places that call push_host_devs
2015-08-24 18:27:54 +08:00
Harald Hoyer 3c00189988 dracut.sh: remove quotes from install_items and install_optional_items
Unfortunately these are lists with whitespaces.
2015-08-10 14:05:15 +02:00
Harald Hoyer 96d694c0b5 dracut.sh: simplify modalias reading 2015-07-30 12:11:42 +02:00
Harald Hoyer 693b7a3283 Cleanup compressor handling
If no compressor is specified, try to find a suitable one.

Check if kernel modules can be uncompressed.
2015-07-22 11:35:28 +02:00
Chao Fan 7eeaa4ab14 remove the incomplete .img file
If the directory where the .img file is saved has no enough space, or in
other wrong conditions, dracut will get an incomplete file xxx.img. But
sometimes this .img file will be loaded when rebooting the system. And then
some bugs will happen because this .img file is wrong.

So I think dracut should remove the incomplete file because this .img file
with problems was made by dracut. And then the wrong file will not be loaded
anymore.

Signed-off-by: Chao Fan <cfan@redhat.com>
2015-07-21 12:05:42 +02:00
Harald Hoyer e50f91e600 use mktemp "-p" instead of "--tmpdir" for busybox 2015-07-15 11:47:43 +02:00
Harald Hoyer ee44f62972 dracut.sh: early check for bash version 2015-07-09 19:44:30 +02:00
Harald Hoyer e8f19bcf26 dracut.sh: remember $0 for --regenerate-all 2015-07-09 18:22:15 +02:00
Harald Hoyer cb0913db0d dracut.sh: reduce code 2015-07-09 18:06:55 +02:00
Harald Hoyer 3721635b2c guard ${arrays[@]} with "" 2015-07-09 15:36:25 +02:00
Harald Hoyer 694725abf0 dracut.sh: remove pop() 2015-07-09 15:36:25 +02:00
Harald Hoyer 5a66d51102 dracut.sh: remove push()
can be done with var+=(val)
2015-07-09 15:36:25 +02:00
Harald Hoyer 1cadc26fd4 Add all btrfs devices
We have to find them with "btrfs usage", which is cumbersome.
2015-07-09 15:36:25 +02:00
Harald Hoyer 777f2db037 splitup dracut-init.sh from dracut-functions.sh
other tools want to source dracut-functions.sh without any mkdir side
effects.
2015-07-02 16:04:05 +02:00
Harald Hoyer 916559e073 dracut.sh: add devices with x-initrd.mount in /etc/fstab to host_devs
otherwise dracut might not even be able to mount those.
2015-07-02 14:55:31 +02:00
Dimitri John Ledkov 80dab03a7d Fix default udev & systemd dir detection, in usr-merge configurations.
Test that /lib is not a symlink, before using split-usr paths.
2015-06-22 11:56:28 +01:00
Christian Rodrigues b52cfbeaa5 Correct paths for openSUSE
openSUSE has things stored in different places, so fixup the
paths here.

Signed-off-by: Christian Rodrigues <crrodriguez@opensuse.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-06-02 12:24:59 +02:00
Harald Hoyer b562bc55a8 Merge pull request #67 from dracut-mailing-devs/1432116434-18050-1-git-send-email-cfan@redhat.com
Change the fs_passno of nfs to 0
2015-06-02 11:57:58 +02:00
Harald Hoyer dfec3c2d8b Merge pull request #68 from dracut-mailing-devs/1431698021-16626-3-git-send-email-colin@mageia.org
dracut: Make host only mode more resilient to missing swaps.
This patch set allows swap devices to disappear without cocking up a
host-only initramfs boot.
2015-06-02 11:54:07 +02:00
Harald Hoyer e409c9e8f8 Merge pull request #65 from scop/comment
Fix stale comment about required bash version
2015-06-02 11:10:59 +02:00
Harald Hoyer 0e5c01f8b8 Merge pull request #66 from scop/lbzip2
Use lbzip2 instead of bzip2 if available
2015-06-02 11:10:29 +02:00
Harald Hoyer 3ac9cdb1c5 dracut.sh: fall back to /usr/lib/os-release, if /etc/os-release missing 2015-05-28 19:47:37 +02:00
Ville Skyttä ee84640963 Use lbzip2 instead of bzip2 if available 2015-05-24 22:29:20 +03:00
Ville Skyttä f8139a8b28 Fix stale comment about required bash version 2015-05-24 22:26:20 +03:00
Chao Fan 3586a7aa77 Change the fs_passno of nfs to 0
There is a bug that kdump-initrd contains entry requesting nfs dump
filesystem to get filesystemchecked. And there is an erro message said
that nfs need be checked. But there's no fsck for nfs utility, e.g
fsck.nfs like other file system. Whatever fs_passno 0 or 2 are passed,
no fsck is executed at all for nfs mount.But in dracut, set it to be 2
always, so the erro message appear and it should be set to 0.

In the fstab,the sixth variable fs_passno stands for that the device need
checked or not,and dracut set it to "2".To fix this issue, it should
be "0" when the device is nfs.The third variable stands for the type of
the filesystem and we can use it to judge whether the device is nfs.
So when the third variable of fstab contains "nfs", the sixth variable
fs_passno should be set to "0".

Signed-off-by: Chao Fan <cfan@redhat.com>
2015-05-20 12:07:57 +02:00
Colin Guthrie 3e3ed34f03 base: Don't wait for swap devices in host-only mode.
The only reason we add swap devices to host-only mode (added in
dd5875499e) is to allow us to process
resume= arguments passed on the kernel command line when the swap
partition lives on something slightly more complex than a normal
partion (e.g. in an LVM or RAID setup).

By adding the device to host_devs, the necessary LVM and RAID hooks
are added and thus the underlying storage will be initialised OK, and
the 95resume module handles the waiting for the device (via udev rules
creating the /dev/resume symlink).

So ultimately, we do not need to hard-code the waiting for the swap
devices into the initramfs at build time as the waiting part can be
dynamic.

This makes things more resiliant to swap partitions disappearing and
being reformatted etc.

Inspired by a patch by Martin Whitaker on Mageia bug:
https://bugs.mageia.org/show_bug.cgi?id=12305
2015-05-15 16:01:41 +02:00
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Harald Hoyer 2bc5054a64 Merge pull request #35 from enovance/fix_include_variables_name
dracut: Ajusting variables name for --include
2015-03-24 20:46:06 +01:00
Harald Hoyer 6f92423c89 dracut.sh: create /var/tmp 2015-03-24 16:03:11 +01:00
Harald Hoyer 636d2d46a5 dracut.sh: add support for creating a UEFI boot executable
With an EFI stub, the kernel, the initramfs and a kernel cmdline can be
glued together to a single UEFI executable, which can be booted by a
UEFI BIOS.
2015-03-20 14:31:23 +01:00
Harald Hoyer 21a209735a dracut.sh: only print cmdline from modules, which would be included 2015-03-20 14:31:22 +01:00
Harald Hoyer bee086532f dracut.sh: simplify module install loop 2015-03-20 14:31:22 +01:00
Harald Hoyer 9119059723 dracut.sh: factor out do_print_cmdline() 2015-03-19 11:04:02 +01:00
Harald Hoyer 6ac2c83570 dracut.sh: call bash with --norc
We don't want any user aliases or functions to be defined in dracut.
2015-02-19 09:55:12 +01:00
Harald Hoyer f182cb9599 dracut.sh: simplify the "find" for files with the x bit
'(' -perm -0100 -or -perm -0010 -or -perm -0001 ')'
is the same as
-perm /0111
2015-01-22 15:58:20 +01:00
Harald Hoyer 496e3d962d dracut.sh: handle empty $initrd/etc/cmdline.d 2015-01-21 09:32:20 +01:00
Erwan Velu c9364f6ea2 dracut: Ajusting variables name for --include
When reading the --include part of the script, we had the following
issues to make the code easy to read:
- src & tgt were extract for the original options
- i variable was a file or a directory from src
- s variable was the directory name in case $i was a directory

"s" sounds very close to "src" while "s" is on the "tgt" side. Very
confusing.

"s" was defined before the "if it's a directory" statement while it's
only used inside the "if".

"i" was commit from the "src" but wasn't really explicit.

Having some lines mixing "i" and "s" takes a little time to get read
properly.

This patch offer the following changes:
- "i" is renamed to "objectname" as we don't know if its a file or a
  directory

- "s" is renamed to "object_destdir" as the object name becomes a
  directory on the destdir

- "object_destdir" (former "s") is moved inside the "if" statement as it's
  only used here

- tgt is finally renamed to "target" to be more explicit. We are not all
  native english ;o)

My 2 (semantic) cents,
2014-12-19 14:49:00 +01:00
Erwan Velu 332ecaa900 dracut: Don't fail at copying files when including directories
When including a directory, the files were considered in the directory
name which lead to messages like :

cp: failed to access '/var/tmp/initramfs.L9s2zO///init-func': No such file or directory

This patch does make the destdir more explicit and copy files into the
destination directory instead of destdir/filename/
2014-12-19 13:42:57 +01:00
Harald Hoyer a17d5cf494 Revert "95rootfs-block: Correctly terminate commandline parameter"
This reverts commit 4b6b46bb2a.

$ ./dracut.sh -l --print-cmdline
root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76brootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cacherootfstype=btrfs

instead of:

$ ./dracut.sh -l --print-cmdline
 root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76b
rootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cache
rootfstype=btrfs

and also

$ make testimage
…
 *** Store current command line parameters ***
Stored kernel commandline:
root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76brootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cacherootfstype=btrfs
…
2014-12-17 11:44:18 +01:00
Hannes Reinecke 4b6b46bb2a 95rootfs-block: Correctly terminate commandline parameter
95rootfs-block would not terminate the commandline parameter with
a space or newline, instead it'll rely on the main routine from
dracut.sh to do this.
Which will cause unexpected problems for any modules called
after this.

So terminate the commandline parameters correctly here and remove
the newline from dracut.sh.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thomas Renninger 6df523517f dracut.sh: Fix UUID= fstab parsing in case --mount option is passed
Dracut parses /etc/fstab when --mount is option is passed (e.g. kdump).

In host_devs variable the real block device must be stored, not UUID=
There are other /etc/fstab syntax possibilities we now warn that they
are not correctly parsed. This will be fixed by another patch
when there is time to test this properly.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger 118ca9ecfc dracut.sh: Avoid duplicate devices in host_devs
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
jloeser 3838dc47c3 Check for logfile (--logfile option) and create it if necessary
If a logfile is passed to dracut via --logfile option and doesn't
exist, dracut doesn't create it and logs nothing. Instead, dracut
should try to touch the file and print a warning if creating fails.

References: bnc#892191
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke fe273e3901 Print stored dracut commandline during initramfs build
When generating the initramfs we should be printing out the
generated dracut commandline used for booting.
This will simplify debugging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Harald Hoyer 99d4fd6bb7 do not symlink /var/log to /run/log
some programs e.g. systemd-journald expect a directory in /var/log as
the marker to do some actions. Here journald tries to flush
/run/log/journal to /var/log/journal, if the directory is seen.

/var/log is now a symlink to /run/initramfs/log.
2014-12-01 12:36:20 +01:00
Harald Hoyer 3a04bddeed dracut.sh: add $tmpfilesdir to install files to /usr/lib/tmpfiles.d 2014-12-01 12:34:54 +01:00
Harald Hoyer 66fd7e4329 dracut.sh: don't check gzip for --rsyncable, if pigz is available 2014-10-29 14:18:34 +01:00
Vasiliy Tolstov 3c90cc2f48 fix gzip compress then it not supports rsyncable option
dracut fail to create initramfs when compressor gzip and
it not have rsyncable option

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2014-10-27 13:43:13 +03:00
Harald Hoyer ab2f95e45e dracut: fixed module dependency handling
Fail for "--modules" and "--force-add" dracut modules, if they or their
dependencies cannot be included.
2014-10-24 13:19:58 +02:00