Commit Graph

81 Commits

Author SHA1 Message Date
Marcus Schäfer
dc0deb47a7
Fixed oem resize message and invokation
The oem resize should only start if there is unallocated
space on the disk available. If it starts the message in
case of a not applicable resize should be more meaningful
This commit addresses both issues and Fixes #1102
2019-10-21 15:31:47 +02:00
Marcus Schäfer
df367b78a6
Fixed return code validation of check_filesystem
Usually the return code from the filesystem check tools is
simple: Non zero exit code means an error occurred. However
in case of the extX filesystem this does not apply. This
commit documents the possible error conditions and supplies
a tool specific check condition. This Fixes #1209
2019-09-25 11:48:35 +02:00
Marcus Schäfer
fbba0445db
Fixed kiwi-live module setup
The installation of the checkmedia tool is optional and
and not mandatory. In addition activate the media check
verification also through the upstream used rd.live.check
kernel parameter. This is related to Issue #1158
2019-09-24 17:48:39 +02:00
David Cassany
8d334b4c92
Make kiwi-overlay module compatible with kiwi-repart
This commit makes the modules provided by dracut-kiwi-overlay and
dracut-kiwi-oem-repart compatible. The main idea of this commit
is forcing the preparation of the overlay rootfs write partition
after kiwi-repart gets into the play. Since kiwi-overlay mounts the
write partitiontition it has to be executed after the kiwi-repart.

For that instead of doing the job using an initqueue event added by a
udev rule we just add the very same logic in pre-mount hook that happens
after the kiwi-repart pre-mount hook thanks to lower priority.

Fixes #1184
2019-09-18 17:47:15 +02:00
Marcus Schäfer
a9aee8a8e3
Detect raid compound in root disk detection
Make sure raid managed storage e.g fake raid is detected
using the correct md device. Fixes #1181
2019-09-13 10:12:44 +02:00
jpwidera
b03f52e755 Reverting partsthat are already implemented
This problem is discussed in #1195
2019-09-12 10:32:12 +00:00
jpwidera
b7af21d598 Switched back to original root-device search 2019-09-10 14:42:05 +00:00
Jan Widera
4a370416e8 Allows to list fake-raid partitions
Solves problem in #1181
2019-08-30 11:29:40 +00:00
Marcus Schäfer
3a1145797b
Merge pull request #1185 from OSInside/detect_raid_disks
Detect raid disks in oem dump module
2019-08-29 10:17:32 +02:00
David Cassany
07ea23a4c4
Avoid default installation of dracut kiwi modules
With this commit dracut modules won't be installed by default
in the initrd unless they are requested by the commandline calling
dracut or by a dracut configuration file.

Fixes bsc#1142899 bsc#1136444
Fixes #1103
2019-08-28 16:11:48 +02:00
Marcus Schäfer
f965584847
Detect raid disks in oem dump module
The current disk detection only takes lsblk entries into
account that marks the device as 'disk'. However on raid
disks like fake raid controllers the disk is mapped via
dmraid and marked as 'raidX' device. This commit also takes
those devices into account for deployment. Issue #1181
2019-08-28 16:07:31 +02:00
David Cassany
225e445b6e
Add crypt dependency to kiwi-lib dracut module
This commit fixes the dependencies of the kiwi-lib dracut module to
include crypt module required by kiwi-luks-lib.sh.

In addition it also updates the check() section to return 255 instead of
0. In check section a return code of 0 means install it, 255 install
only if required by another module, anything else, do not install.

Related with bsc#1142899
2019-08-22 09:47:59 +02:00
Marcus Schäfer
8b04c2cdae
Use message variable for long message text 2019-08-12 10:53:08 +02:00
Marcus Schäfer
d01d5fc940
Fixed handling of bool values in initrd code
Some values evaluated in the initrd code are created in
the kiwi builder and passed in as a profile file. bool
values created by kiwi for use in shell scripts takes
the string 'true' or 'false' or are not set at all if not
specified in the kiwi XML description. Some code paths
in the initrd code uses the '-n' switch to check for bool
values, however if the string 'false' is passed '-n' will
do the wrong thing. Therefore a method for the initrd
code has been introduced to clearly handle bool values
2019-08-12 10:42:11 +02:00
Daniel Molkentin
0659096d5b 99-kiwi-lib requires rmdir, install it
Fixes bsc#1143033
2019-07-26 16:05:34 +02:00
Marcus Schäfer
7e4bbc0469
Fixed get_persistent_device_from_unix_node
The method get_persistent_device_from_unix_node takes a device
path and looks up it's basename to be present as persistent
variant below the given schema, e.g by-id. However if the
method receives an already persistent device path e.g from
/dev/mapper the persistent schema representation will only
match a numbered dm-N device and not the map name. The method
then returns nothing but should return the original device
path. This caused bad after effects like reported in
Issue SUSE-Enceladus/azure-li-services#163
2019-07-08 11:11:12 +02:00
Thomas Schraitle
3a8e31b26d
Simplify shell pipe expression with shell builtin
Replace "echo $var | sed ..." expression with ${var//SEARCH/REPLACE}
shell builtin as suggested by Codacy
2019-05-17 14:11:07 +02:00
Marcus Schäfer
0a70464463
Merge pull request #1085 from SUSE/fix_sysroot_mount_dependencies
Discard default dependencies for sysroot.mount
2019-05-09 09:05:43 +02:00
Alberto Planas
92285d7e95 kiwi-live-lib: mount live ISO as read-only
During the boot process of a live image, dracut shows this WARNING:

dracut-initqueue: mount: /run/initramfs/live: WARNING: device write-protected, mounted read-only

This is not a problem, as the live ISO image is, indeed, read-only.

This patch fix this cosmetic issue being explicit in the mount
options in `mountIso` function.
2019-05-08 17:02:46 +02:00
David Cassany
4238b7eac9
Discard default dependencies for sysroot.mount
This commit makes default dependencies from sysroot.mount to be
explicitly omitted. This fixes potential inconsistencies in
ordering pre-mount.service with local-fs.target. This change is
also applied to upstream sysroot.mount generator here:

https://github.com/systemd/systemd/pull/12281

Fixes #1015
2019-05-06 15:53:45 +02:00
David Cassany
2fe5d0b15b
Adding custom curl options for dracut-kiwi-lib module
This commit parses the `rd.kiwi.install.pxe.curl_options` argument from
the kernel command line to read and use curl options for the
`fetch_file` function of `kiwi-net-lib.sh` utility. Options are passed
as comma separated values.

Fixes #891
2019-04-09 11:31:18 +02:00
David Cassany
024318a9c8
Fix regression on kiwi-repart dracut module
There was a regression introduced in #1035 (048b5c3e). We mask
systemd-fsck-root.service during the repart, but we are not always
unmasking it. If the repart is not possible the service is masked but
not unmasked, which causes the boot to fail.

With this commit after masking the fsck service we trap EXIT and run the
unmask command on script exit. This way we ensure the unmask command is
always executed.
2019-04-03 15:41:50 +02:00
Stefan Seyfried
048b5c3eb1 kiwi-repart: avoid race between repart and fsck
See issue #1034, this fixes non-booting CentOS-7 OEM images that fail
during repartition / FS resize.
Summary: all parted actions trigger a rescan of partition tables and
this repeatedly starts / stops systemd-fsck-root.service until it
finally fails. The workaround is to mask systemd-fsck-root.service
during repartitioning / FS resize.
2019-03-29 13:07:34 +01:00
Marcus Schäfer
958184e81f
Fixed race condition on live overlay mount
Make sure to wait for all targets of the overlay mount
This Fixes #1015
2019-03-18 15:27:16 +01:00
Stefan Seyfried
36e9a14134 add rd.kiwi.oem.maxdisk= boot parameter
this limits the disks considered for oem deployment to a given size
2019-03-13 16:59:41 +01:00
Stefan Seyfried
c38cc03ef2 kiwi-dump-image: fix kiwi_oemdevicefilter for rd.debug 2019-03-13 14:02:15 +01:00
Marcus Schäfer
1a682b678c
Fixed evaluation of @root size setup
The @root volume setup allows to specify a size for the root
volume in an LVM setup. The size setting was not respected and
the root volume was always resized to the rest space available.
This patch fixes the read_volume_setup_all_free method
on the dracut kiwi library to know if there is root volume
setup and respect its contents. This Fixes #983
2019-03-08 10:51:03 +01:00
Stefan Seyfried
d9ab8bce6a pxe: use dracut's network code, drop own setup 2019-03-04 09:46:18 +01:00
Marcus Schäfer
81e13d149b
Fixed shellcheck issue on kiwi-partitions-lib.sh
Fixup SC2046: Quote this to prevent word splitting
2019-02-28 10:44:08 +01:00
Stefan Seyfried
12e57bb461 add rd.kiwi.install.pass.bootparam boot parameter
if this boolean is set, most boot parameters are passed on
to the kexec kernel on OEM image deployments
2019-02-25 16:24:44 +01:00
Marcus Schäfer
162b09d122
Merge pull request #962 from SUSE/fix_multipath
Followup fix for disk detection from root device
2019-02-23 20:39:25 +01:00
Marcus Schäfer
daf90b9ed4
Followup fix for disk detection from root device
No matter if one ore more devices are used in a multipath map,
if the root device is managed by multipath kiwi has to use the
mapped device for all operations, otherwise we run into busy
or blocked state inside of the initrd operations. This is
related to Issue #954 and bsc#1126283 and bsc#1126318
2019-02-23 20:22:06 +01:00
Marcus Schäfer
9190f80ad7
Fixed relocation of GPT
Simplify the relocation of the GPT to the end of the current
disk by using sgdisk -e instead of gdisk. The possitive after
effect of this is that the broken return value handling of
gdisk in centos will be fixed and did not harm the kiwi
deployment anymore. This Fixes #958
2019-02-23 16:11:30 +01:00
Marcus Schäfer
5c02bafa92
Merge pull request #959 from b1-systems/net-fix-bootif
fix network failure with "BOOTIF=" parameter
2019-02-22 10:25:02 +01:00
Stefan Seyfried
624633776d fix network failure with "BOOTIF=" parameter
If a BOOTIF= parameter (pxelinux "IPAPPEND 2" option) is present, dracut
handles the network already *and* overwrites the 90-net.rules that
kiwi-*-net-genrules.sh created, thus the interface is not named "lan0"
and ifup is destined to fail.
Work around the issue by detecting if the interface is already handled
by generic dracut code and just skipping the ifup call.
Fixes / improves issue #942
2019-02-21 17:34:13 +01:00
Marcus Schäfer
d757e824de
Fixed disk detection from root device
The method lookup_disk_device_from_root assigns the disk device
matching the root device uuid. However in a multipath environment
multiple disk devices matches the same root device. The code to
assign the multipath map in this case was missing in the dracut
code base. This Fixes #954 and Fixes bsc#1126283 and bsc#1126318
2019-02-21 17:12:14 +01:00
Ruediger Oertel
fc0709a343 testing: fix issues marked by shellcheck 2018-12-04 17:24:05 +01:00
Marcus Schäfer
f1cdf155a6
Use cow file on persistent grub live loop boot
When using tools like live-grub-stick the live iso as generated
by kiwi will be copied as file on the target device and a grub
loopback setup is created there to boot the live system from file.
In such a case the persistent write setup which tries to create
an extra write partition on the target fails in almost all cases
because the target has no free and unpartitioned space available.
Therefore in case of such a loopback mounted system we create a
cow file(live_system.cow) instead of a partition to setup
persistent writing. The cow file will be created in the same
directory the live iso image file was read from grub
This Fixes #860
2018-11-26 11:26:35 +01:00
Marcus Schäfer
02049b003b
Better exception handling in oem installer
If an error condition applies in the kiwi dump dracut code
the reaction was to stop the process with a dracut die() call.
If the option 'rd.debug' was set on boot, this lead to a debugging
shell which is good, but in a standard process this lead to a
lock of the machine which is an unfortunate situation. This
patch changes the behavior to always print the error message
as a dialog message box on the primary console and reboot
the system after keypress or timeout. In case of the debug
switch configured the system die()'s as before.
This Fixes #884
2018-11-23 11:27:24 +01:00
Stefan Seyfried
4780f444e5 kiwi-dump-image: improve dialog usage
Dialog's "--radiolist" feature requires to navigate to the item,
press "space" to select the item and then "enter" to execute.
With "--menu", it is enough to just navigate to the item and press
"enter" to execute, which is much more intuitive for most users.
2018-11-09 14:53:54 +01:00
Marcus Schäfer
aa02325ea2
Fixed oem installer
In the implementation of the ramdisk installer from
SUSE/ramdisk_deployment(4fdeee3faa) an error for the
standard case was introduced such that the lsblk call
was invalid. This lead to no devices being present
for the installation. This patch Fixes #877
2018-11-09 10:09:21 +01:00
Stefan Seyfried
dd1668ad27 kiwi-partitions-lib: wait for udev before lsblk
A LVM-enabled oem image spuriously did not resize its PV / LVs. Tracking
this down, I discovered that lsblk was sometimes racing with udev and
the disk was just not available during get_partition_node_name().
Call udev_pending() before all lsblk calls to avoid that.
(lsblk man page also advocates this to synchronize with udev)
2018-11-06 10:39:21 +01:00
Marcus Schäfer
8a0ef0461c
Support ramdisk deployment in OEM images
Using the rd.kiwi.ramdisk boot option enables the deployment
into a ramdisk. If this option is enabled only ramdisk devices
as provided by the brd kernel driver will be available for
deployment
2018-10-31 10:26:38 +01:00
David Cassany
f28aced0e0
Make volume id customizable for installation ISOs
This commit makes volid attribute also available for OEM images.
The installation media makes use of the volid value. Only posix
safe names are allowed, up to 32 characters.

Fixes #811
2018-09-26 11:57:01 +02:00
Marcus Schäfer
2aba8d981f
Fixed disk detection for live iso in loopback grub
If the live iso is used as a disk on e.g USB sticks and
is configured to setup a persistent write space via the
initrd option rd.live.overlay.persistent, it's required
to find the disk device to create a write partition on
it.

This detection worked if the live iso is binary dumped
on the disk and bootet due to the hybrid support each
iso built by kiwi provides.

However if the live ISO deployment should not destroy
existing data on the disk there is an alternative setup
which uses grub's loopback support and puts the iso as a
file on some partition of the disk. In this mode the
kiwi-live dracut module failed to find the disk device
and could not setup a persistent write partition.
2018-09-19 16:01:11 +02:00
Marcus Schäfer
8ddab94511
Added support for pxe live boot via AOE
The live ISO should support a network reference. We are using
the Ata Over Ethernet protocol to achieve this. In combination
with pxe boot of the kernel/initrd a live iso can boot from
the network using the following parameter example:

    root=live:AOEINTERFACE:e0.1 rd.kiwi.live.pxe

Export of the live iso file via AOE can be achieved using the
vblade toolkit which needs to be available on the exporting
system and compatible with the live operating system.
This Fixes #796
2018-08-07 11:43:36 +02:00
Marcus Schäfer
d30cd0e902
Delete dmraid aka: softraid soft/fakeraid support
In fate#323743 the decision was made to drop dmraid from
the distribution. Along with the low business case for those
controllers and the support for linux softraid via mdadm
we also drop the support in kiwi for oem-ataraid-scan
2018-08-06 12:23:53 +02:00
Marcus Schäfer
37c8851d12
Make sure profile env is included in live images
For all images which boots via dracut the .profile file is included
except for live iso's because no information is needed from that file
to boot or customize the boot. However the .profile contains the
kiwi_revision information which is useful for any image type.
This Fixes #755
2018-06-04 11:18:13 +02:00
David Cassany
8916aea373 Verify file does not exist before creating symlink 2018-05-28 15:37:09 +02:00
David Cassany
2f8added7d Add service dependencies in generators
Correctly adding the initrd-root-fs.target service dependency to
auto generated sysroot.mount for kiwi-live and kiwi-overlay dracut
modules.

Fixes #741
2018-05-28 11:20:35 +02:00