From 97ce134864c09718929e5cd5605910738a616dbf Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 10 2022 07:01:30 +0000 Subject: import coreos-installer-0.11.0-3.el8 --- diff --git a/.coreos-installer.metadata b/.coreos-installer.metadata index 2b51770..bbb06fd 100644 --- a/.coreos-installer.metadata +++ b/.coreos-installer.metadata @@ -1,2 +1,3 @@ -9ad623e572641316d7bdb51e11e136713b019bfa SOURCES/coreos-installer-0.9.1-vendor.tar.gz -147efc72c044194209d686b78d62e3acbc761763 SOURCES/coreos-installer-0.9.1.crate +2a876f160edceed577652d36f61c32b27e2bd734 SOURCES/coreos-installer-0.11.0-vendor.tar.gz +4ab40027b2ec1716b95a47090f750d7760c5bd90 SOURCES/coreos-installer-0.11.0.crate +01dc4e66374b6239963bfcf6d80724b0cddd7b75 SOURCES/coreos-installer-dracut-1a262bd.tar.gz diff --git a/.gitignore b/.gitignore index 9b1e12c..5f43e53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/coreos-installer-0.9.1-vendor.tar.gz -SOURCES/coreos-installer-0.9.1.crate +SOURCES/coreos-installer-0.11.0-vendor.tar.gz +SOURCES/coreos-installer-0.11.0.crate +SOURCES/coreos-installer-dracut-1a262bd.tar.gz diff --git a/SOURCES/coidracut.patch b/SOURCES/coidracut.patch deleted file mode 100644 index 1399a79..0000000 --- a/SOURCES/coidracut.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff --git a/dracut/50rdcore/module-setup.sh b/dracut/50rdcore/module-setup.sh -index 27a2ac3..443b5cf 100755 ---- a/dracut/50rdcore/module-setup.sh -+++ b/dracut/50rdcore/module-setup.sh -@@ -1,5 +1,47 @@ - #!/bin/bash - -+install_and_enable_unit() { -+ unit="$1"; shift -+ target="$1"; shift -+ inst_simple "$moddir/$unit" "$systemdsystemunitdir/$unit" -+ # note we `|| exit 1` here so we error out if e.g. the units are missing -+ # see https://github.com/coreos/fedora-coreos-config/issues/799 -+ systemctl -q --root="$initdir" add-requires "$target" "$unit" || exit 1 -+} -+ - install() { - inst_simple "$moddir/rdcore" "/usr/bin/rdcore" -+ -+ inst_simple "$moddir/coreos-installer" "/usr/bin/coreos-installer" -+ -+ inst_simple "$moddir/coreos-installer-generator" \ -+ "$systemdutildir/system-generators/coreos-installer-generator" -+ -+ inst_script "$moddir/coreos-installer-service" \ -+ "/usr/libexec/coreos-installer-service" -+ -+ inst_script "$moddir/coreos-installer-disable-device-auto-activation" \ -+ "/usr/libexec/coreos-installer-disable-device-auto-activation" -+ -+ install_and_enable_unit "coreos-installer.service" \ -+ "default.target" -+ -+ install_and_enable_unit "coreos-installer-reboot.service" \ -+ "default.target" -+ -+# install_and_enable_unit "coreos-installer-noreboot.service" \ -+# "basic.target" -+# inst_simple "$moddir/coreos-installer-reboot.service" \ -+# "$systemdsystemunitdir/coreos-installer-reboot.service" -+# inst_simple "$moddir/coreos-installer-noreboot.service" \ -+# "$systemdsystemunitdir/coreos-installer-noreboot.service" -+# -+# inst_simple "$moddir/coreos-installer.target" \ -+# "$systemdsystemunitdir/coreos-installer.target" -+# -+# inst_simple "$moddir/coreos-installer-pre.target" \ -+# "$systemdsystemunitdir/coreos-installer-pre.target" -+# -+# inst_simple "$moddir/coreos-installer-post.target" \ -+# "$systemdsystemunitdir/coreos-installer-post.target" - } -diff --git a/systemd/coreos-installer-generator b/systemd/coreos-installer-generator -index 804d045..b2bcaec 100755 ---- a/systemd/coreos-installer-generator -+++ b/systemd/coreos-installer-generator -@@ -30,11 +30,11 @@ karg_bool() { - } - - if [ -n "$(karg coreos.inst.install_dev)" ]; then -- ln -sf "/usr/lib/systemd/system/coreos-installer-post.target" \ -- "${UNIT_DIR}/default.target" -+# ln -sf "/usr/lib/systemd/system/coreos-installer-post.target" \ -+# "${UNIT_DIR}/basic.target" - - # Create precondition for coreos-installer-reboot.service if requested - if ! karg_bool coreos.inst.skip_reboot; then -- touch /run/coreos-installer-reboot -+ > /run/coreos-installer-reboot - fi - fi -diff --git a/systemd/coreos-installer-reboot.service b/systemd/coreos-installer-reboot.service -index 18fdb4b..ad79614 100644 ---- a/systemd/coreos-installer-reboot.service -+++ b/systemd/coreos-installer-reboot.service -@@ -1,7 +1,7 @@ - [Unit] - Description=Reboot after CoreOS Installer --Requires=coreos-installer.target --After=coreos-installer.target -+#Requires=coreos-installer.target -+After=coreos-installer.service - OnFailure=emergency.target - OnFailureJobMode=replace-irreversibly - ConditionPathExists=/run/coreos-installer-reboot -diff --git a/systemd/coreos-installer.service b/systemd/coreos-installer.service -index 5e222f2..716b783 100644 ---- a/systemd/coreos-installer.service -+++ b/systemd/coreos-installer.service -@@ -1,12 +1,20 @@ - [Unit] - Description=CoreOS Installer --Before=coreos-installer.target --After=network-online.target --Wants=network-online.target -+#Before=coreos-installer.target -+#After=nm-run.service -+#After=network-online.target -+#Wants=network-online.target - # Until we retry HTTP requests let's wait here until - # systemd-resolved comes up if enabled. - # https://github.com/coreos/coreos-installer/issues/283 --After=systemd-resolved.service -+#After=systemd-resolved.service -+ -+After=basic.target -+# Network is enabled here -+After=nm-run.service -+# compat: remove when everyone is on dracut 053+ -+After=dracut-initqueue.service -+ - ConditionKernelCommandLine=coreos.inst.install_dev - OnFailure=emergency.target - OnFailureJobMode=replace-irreversibly diff --git a/SOURCES/coidracut2.patch b/SOURCES/coidracut2.patch deleted file mode 100644 index e5e33c8..0000000 --- a/SOURCES/coidracut2.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/dracut/50rdcore/module-setup.sh b/dracut/50rdcore/module-setup.sh -index 443b5cf..c065851 100755 ---- a/dracut/50rdcore/module-setup.sh -+++ b/dracut/50rdcore/module-setup.sh -@@ -10,6 +10,10 @@ install_and_enable_unit() { - } - - install() { -+ inst_multiple gpg -+ inst_multiple gpg-agent -+ inst_multiple gpg-connect-agent -+ - inst_simple "$moddir/rdcore" "/usr/bin/rdcore" - - inst_simple "$moddir/coreos-installer" "/usr/bin/coreos-installer" -diff --git a/scripts/coreos-installer-service b/scripts/coreos-installer-service -index 347b5f5..239de3a 100755 ---- a/scripts/coreos-installer-service -+++ b/scripts/coreos-installer-service -@@ -87,6 +87,7 @@ fi - - # Other args that should just be copied over - copy_arg coreos.inst.image_url --image-url -+copy_arg coreos.inst.image_file --image-file - copy_arg coreos.inst.platform_id --platform - copy_arg coreos.inst.stream --stream - copy_arg coreos.inst.save_partlabel --save-partlabel diff --git a/SOURCES/coidracut3.patch b/SOURCES/coidracut3.patch deleted file mode 100644 index c03bd2f..0000000 --- a/SOURCES/coidracut3.patch +++ /dev/null @@ -1,246 +0,0 @@ -diff --git a/dracut/50rdcore/module-setup.sh b/dracut/50rdcore/module-setup.sh -index c065851..2d689d9 100755 ---- a/dracut/50rdcore/module-setup.sh -+++ b/dracut/50rdcore/module-setup.sh -@@ -14,6 +14,48 @@ install() { - inst_multiple gpg-agent - inst_multiple gpg-connect-agent - -+ inst_multiple \ -+ realpath \ -+ basename \ -+ blkid \ -+ cat \ -+ dirname \ -+ findmnt \ -+ growpart \ -+ realpath \ -+ resize2fs \ -+ tail \ -+ tune2fs \ -+ touch \ -+ xfs_admin \ -+ xfs_growfs \ -+ wc \ -+ lsblk \ -+ wipefs -+ -+ inst_multiple \ -+ awk \ -+ cat \ -+ dd \ -+ grep \ -+ mktemp \ -+ partx \ -+ rm \ -+ sed \ -+ sfdisk \ -+ sgdisk \ -+ find -+ -+ inst_multiple -o \ -+ clevis-encrypt-sss \ -+ clevis-encrypt-tang \ -+ clevis-encrypt-tpm2 \ -+ clevis-luks-bind \ -+ clevis-luks-common-functions \ -+ clevis-luks-unlock \ -+ pwmake \ -+ tpm2_create -+ - inst_simple "$moddir/rdcore" "/usr/bin/rdcore" - - inst_simple "$moddir/coreos-installer" "/usr/bin/coreos-installer" -@@ -33,19 +75,8 @@ install() { - install_and_enable_unit "coreos-installer-reboot.service" \ - "default.target" - --# install_and_enable_unit "coreos-installer-noreboot.service" \ --# "basic.target" --# inst_simple "$moddir/coreos-installer-reboot.service" \ --# "$systemdsystemunitdir/coreos-installer-reboot.service" --# inst_simple "$moddir/coreos-installer-noreboot.service" \ --# "$systemdsystemunitdir/coreos-installer-noreboot.service" --# --# inst_simple "$moddir/coreos-installer.target" \ --# "$systemdsystemunitdir/coreos-installer.target" --# --# inst_simple "$moddir/coreos-installer-pre.target" \ --# "$systemdsystemunitdir/coreos-installer-pre.target" --# --# inst_simple "$moddir/coreos-installer-post.target" \ --# "$systemdsystemunitdir/coreos-installer-post.target" -+ install_and_enable_unit "growfs.service" \ -+ "default.target" -+ inst_script "$moddir/growfs" \ -+ /usr/sbin/growfs - } -diff --git a/scripts/growfs b/scripts/growfs -new file mode 100644 -index 0000000..45c495c ---- /dev/null -+++ b/scripts/growfs -@@ -0,0 +1,100 @@ -+#!/bin/bash -+set -euo pipefail -+ -+# This script grows the root -+ -+sleep 5 -+udevadm settle -+TYPE=$(lsblk --output FSTYPE /dev/disk/by-label/root | tail -n1) -+echo ${TYPE} -+dev=$(realpath /dev/disk/by-label/root) -+ -+mount -t ${TYPE} /dev/disk/by-label/root /sysroot -+ -+# We run after the rootfs is mounted at /sysroot -+path=/sysroot -+ -+# The use of tail is to avoid errors from duplicate mounts; -+# this shouldn't happen for us but we're being conservative. -+src=$(findmnt -nvr -o SOURCE "$path" | tail -n1) -+ -+partition=$(realpath /dev/disk/by-label/root) -+ -+# Go through each blockdev in the hierarchy and verify we know how to grow them -+lsblk -no TYPE "${partition}" | while read dev; do -+ case "${dev}" in -+ part|crypt) ;; -+ *) echo "error: Unsupported blockdev type ${dev}" 1>&2; exit 1 ;; -+ esac -+done -+ -+# Get the filesystem type before extending the partition. This matters -+# because the partition, once extended, might include leftover superblocks -+# from the previous contents of the disk (notably ZFS), causing blkid to -+eval $(blkid -o export "${src}") -+ -+ROOTFS_TYPE=${TYPE:-} -+case "${ROOTFS_TYPE}" in -+ xfs|ext4|btrfs) ;; -+ *) echo "error: Unsupported filesystem for ${path}: '${ROOTFS_TYPE}'" 1>&2; exit 1 ;; -+esac -+ -+# Now, go through the hierarchy, growing everything. Note we go one device at a -+# time using --nodeps, because ordering is buggy in el8: -+# https://bugzilla.redhat.com/show_bug.cgi?id=1940607 -+current_blkdev=${partition} -+while true; do -+ eval "$(lsblk --paths --nodeps --pairs -o NAME,TYPE,PKNAME "${current_blkdev}")" -+ MAJMIN=$(echo $(lsblk -dno MAJ:MIN "${NAME}")) -+ case "${TYPE}" in -+ part) -+ eval $(udevadm info --query property --export "${current_blkdev}" | grep ^DM_ || :) -+ if [ -n "${DM_MPATH:-}" ]; then -+ # Since growpart does not understand device mapper, we have to use sfdisk. -+ echo ", +" | sfdisk --no-reread --no-tell-kernel --force -N "${DM_PART}" "/dev/mapper/${DM_MPATH}" -+ udevadm settle # Wait for udev-triggered kpartx to update mappings -+ else -+ partnum=$(cat "/sys/dev/block/${MAJMIN}/partition") -+ # XXX: ideally this'd be idempotent and we wouldn't `|| :` -+ growpart "${PKNAME}" "${partnum}" || : -+ fi -+ ;; -+ crypt) -+ # XXX: yuck... we need to expose this sanely in clevis -+ (. /usr/bin/clevis-luks-common-functions -+ eval $(udevadm info --query=property --export "${NAME}") -+ # lsblk doesn't print PKNAME of crypt devices with --nodeps -+ PKNAME=/dev/$(ls "/sys/dev/block/${MAJMIN}/slaves") -+ clevis_luks_unlock_device "${PKNAME}" | cryptsetup resize -d- "${DM_NAME}" -+ ) -+ ;; -+ # already checked -+ *) echo "unreachable" 1>&2; exit 1 ;; -+ esac -+ holders="/sys/dev/block/${MAJMIN}/holders" -+ [ -d "${holders}" ] || break -+ nholders="$(ls "${holders}" | wc -l)" -+ if [ "${nholders}" -eq 0 ]; then -+ break -+ elif [ "${nholders}" -gt 1 ]; then -+ # this shouldn't happen since we've checked the partition types already -+ echo "error: Unsupported block device with multiple children: ${NAME}" 1>&2 -+ exit 1 -+ fi -+ current_blkdev=/dev/$(ls "${holders}") -+done -+ -+# Wipe any filesystem signatures from the extended partition that don't -+# correspond to the FS type we detected earlier. -+wipefs -af -t "no${ROOTFS_TYPE}" "${src}" -+ -+# TODO: Add XFS to https://github.com/systemd/systemd/blob/master/src/partition/growfs.c -+# and use it instead. -+case "${ROOTFS_TYPE}" in -+ xfs) xfs_growfs "${path}" ;; -+ ext4) resize2fs "${src}" ;; -+ btrfs) btrfs filesystem resize max ${path} ;; -+esac -+ -+# this is useful for tests -+touch /run/growfs.stamp -\ No newline at end of file -diff --git a/src/blockdev.rs b/src/blockdev.rs -index f9701b9..2fdd6f0 100644 ---- a/src/blockdev.rs -+++ b/src/blockdev.rs -@@ -970,7 +970,7 @@ pub fn udev_settle() -> Result<()> { - // udevd hasn't yet received updates from the kernel, settle will return - // immediately, and lsblk won't pick up partition labels. Try to sleep - // our way out of this. -- sleep(Duration::from_millis(200)); -+ sleep(Duration::from_millis(500)); - - runcmd!("udevadm", "settle")?; - Ok(()) -diff --git a/systemd/coreos-installer-reboot.service b/systemd/coreos-installer-reboot.service -index ad79614..f9ba80e 100644 ---- a/systemd/coreos-installer-reboot.service -+++ b/systemd/coreos-installer-reboot.service -@@ -1,6 +1,5 @@ - [Unit] - Description=Reboot after CoreOS Installer --#Requires=coreos-installer.target - After=coreos-installer.service - OnFailure=emergency.target - OnFailureJobMode=replace-irreversibly -diff --git a/systemd/coreos-installer.service b/systemd/coreos-installer.service -index 716b783..e8199a9 100644 ---- a/systemd/coreos-installer.service -+++ b/systemd/coreos-installer.service -@@ -1,13 +1,5 @@ - [Unit] - Description=CoreOS Installer --#Before=coreos-installer.target --#After=nm-run.service --#After=network-online.target --#Wants=network-online.target --# Until we retry HTTP requests let's wait here until --# systemd-resolved comes up if enabled. --# https://github.com/coreos/coreos-installer/issues/283 --#After=systemd-resolved.service - - After=basic.target - # Network is enabled here -diff --git a/systemd/growfs.service b/systemd/growfs.service -new file mode 100644 -index 0000000..6d77aaa ---- /dev/null -+++ b/systemd/growfs.service -@@ -0,0 +1,13 @@ -+[Unit] -+Description=Grow root filesystem -+DefaultDependencies=false -+ -+After=coreos-installer.service -+Before=coreos-installer-reboot.service -+Requires=dev-disk-by\x2dlabel-root.device -+After=dev-disk-by\x2dlabel-root.device -+ -+[Service] -+Type=oneshot -+ExecStart=/usr/sbin/growfs -+RemainAfterExit=yes -\ No newline at end of file diff --git a/SOURCES/coidracut4.patch b/SOURCES/coidracut4.patch deleted file mode 100644 index 903b317..0000000 --- a/SOURCES/coidracut4.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/systemd/coreos-installer-generator b/systemd/coreos-installer-generator -index b2bcaec..2b85dc5 100755 ---- a/systemd/coreos-installer-generator -+++ b/systemd/coreos-installer-generator -@@ -2,6 +2,8 @@ - # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- - # ex: ts=8 sw=4 sts=4 et filetype=sh - -+command -v getarg >/dev/null || . /usr/lib/dracut-lib.sh -+ - set -e - - # Generators don't have logging right now -@@ -10,6 +12,14 @@ exec 1>/dev/kmsg; exec 2>&1 - - UNIT_DIR="${1:-/tmp}" - -+add_requires() { -+ local name="$1"; shift -+ local target="$1"; shift -+ local requires_dir="${UNIT_DIR}/${target}.requires" -+ mkdir -p "${requires_dir}" -+ ln -sf "../${name}" "${requires_dir}/${name}" -+} -+ - cmdline=( $( /run/coreos-installer-reboot - fi - fi -+ -+add_requires run-media-iso.mount default.target -+ -+isoroot=$(getarg edge.liveiso= ||:) -+ -+mkdir -p /run/media/iso -+isosrc=dev/disk/by-label/${isoroot} -+isosrc_escaped=$(systemd-escape -p --suffix=device "${isosrc}") -+ -+if [ -n "${isoroot}" ]; then -+cat >"${UNIT_DIR}/run-media-iso.mount" < -Date: Mon, 7 Jun 2021 18:53:29 -0400 -Subject: [PATCH] add coreos.force_persist_ip to list of persisted dracut args - -xref: https://github.com/coreos/fedora-coreos-config/pull/1045 ---- - scripts/coreos-installer-service | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/coreos-installer-service b/scripts/coreos-installer-service -index ff9ff5f..347b5f5 100755 ---- a/scripts/coreos-installer-service -+++ b/scripts/coreos-installer-service -@@ -8,7 +8,7 @@ PERSIST_KERNEL_NET_PARAMS=("ipv6.disable" "net.ifnames" "net.naming-scheme") - # Dracut networking params to persist - # Everything other than rd.neednet. - # List from https://www.mankier.com/7/dracut.cmdline#Description-Network --PERSIST_DRACUT_NET_PARAMS=("ip" "ifname" "rd.route" "bootdev" "BOOTIF" "rd.bootif" "nameserver" "rd.peerdns" "biosdevname" "vlan" "bond" "team" "bridge" "rd.net.timeout.carrier" "coreos.no_persist_ip") -+PERSIST_DRACUT_NET_PARAMS=("ip" "ifname" "rd.route" "bootdev" "BOOTIF" "rd.bootif" "nameserver" "rd.peerdns" "biosdevname" "vlan" "bond" "team" "bridge" "rd.net.timeout.carrier" "coreos.no_persist_ip" "coreos.force_persist_ip") - - # IBM S390X params to persist - PERSIST_S390X_PARAMS=("rd.dasd" "rd.zfcp" "rd.znet" "zfcp.allow_lun_scan" "cio_ignore") --- -2.31.1 - diff --git a/SOURCES/s390x-support-virtio-dasd-0.9.1.patch b/SOURCES/s390x-support-virtio-dasd-0.9.1.patch deleted file mode 100644 index bae8ba3..0000000 --- a/SOURCES/s390x-support-virtio-dasd-0.9.1.patch +++ /dev/null @@ -1,166 +0,0 @@ -From c4fabc7c801491019263523df3c9078cca99bb6e Mon Sep 17 00:00:00 2001 -From: Nikita Dubrovskii -Date: Wed, 2 Jun 2021 14:27:42 +0200 -Subject: [PATCH] s390: add support for virtio dasds - -This is a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1960485 - -Signed-off-by: Nikita Dubrovskii ---- - src/blockdev.rs | 30 ++++++++++++++++++++++++++++-- - src/cmdline.rs | 2 +- - src/install.rs | 6 +++--- - src/s390x/dasd.rs | 15 +++++++++++---- - 4 files changed, 43 insertions(+), 10 deletions(-) - -diff --git a/src/blockdev.rs b/src/blockdev.rs -index 90c6bee..df8e10a 100644 ---- a/src/blockdev.rs -+++ b/src/blockdev.rs -@@ -970,10 +970,36 @@ pub fn detect_formatted_sector_size(buf: &[u8]) -> Option { - } - - /// Checks if underlying device is IBM DASD disk --pub fn is_dasd(device: &str) -> Result { -+pub fn is_dasd(device: &str, fd: Option<&mut File>) -> Result { - let target = - canonicalize(device).with_context(|| format!("getting absolute path to {}", device))?; -- Ok(target.to_string_lossy().starts_with("/dev/dasd")) -+ if target.to_string_lossy().starts_with("/dev/dasd") { -+ return Ok(true); -+ } -+ let read_magic = |device: &str, disk: &mut File| -> Result<[u8; 4]> { -+ let offset = disk -+ .seek(SeekFrom::Current(0)) -+ .with_context(|| format!("saving offset {}", device))?; -+ disk.seek(SeekFrom::Start(8194)) -+ .with_context(|| format!("seeking {}", device))?; -+ let mut lbl = [0u8; 4]; -+ disk.read_exact(&mut lbl) -+ .with_context(|| format!("reading label {}", device))?; -+ disk.seek(SeekFrom::Start(offset)) -+ .with_context(|| format!("restoring offset {}", device))?; -+ Ok(lbl) -+ }; -+ if target.to_string_lossy().starts_with("/dev/vd") { -+ let cdl_magic = [0xd3, 0xf1, 0xe5, 0xd6]; -+ let lbl = if let Some(t) = fd { -+ read_magic(device, t)? -+ } else { -+ let mut disk = File::open(device).with_context(|| format!("opening {}", device))?; -+ read_magic(device, &mut disk)? -+ }; -+ return Ok(cdl_magic == lbl); -+ } -+ Ok(false) - } - - // create unsafe ioctl wrappers -diff --git a/src/cmdline.rs b/src/cmdline.rs -index db3d1d0..53b8179 100644 ---- a/src/cmdline.rs -+++ b/src/cmdline.rs -@@ -853,7 +853,7 @@ fn parse_install(matches: &ArgMatches) -> Result { - // it changes to the recommended 4096 - // https://bugzilla.redhat.com/show_bug.cgi?id=1905159 - #[allow(clippy::match_bool, clippy::match_single_binding)] -- let sector_size = match is_dasd(&device) -+ let sector_size = match is_dasd(&device, None) - .with_context(|| format!("checking whether {} is an IBM DASD disk", device))? - { - #[cfg(target_arch = "s390x")] -diff --git a/src/install.rs b/src/install.rs -index baa3880..20d1f41 100644 ---- a/src/install.rs -+++ b/src/install.rs -@@ -47,7 +47,7 @@ pub fn install(config: &InstallConfig) -> Result<()> { - - #[cfg(target_arch = "s390x")] - { -- if is_dasd(&config.device)? { -+ if is_dasd(&config.device, None)? { - if !config.save_partitions.is_empty() { - // The user requested partition saving, but SavedPartitions - // doesn't understand DASD VTOCs and won't find any partitions -@@ -156,7 +156,7 @@ fn write_disk( - - // copy the image - #[allow(clippy::match_bool, clippy::match_single_binding)] -- let image_copy = match is_dasd(&config.device)? { -+ let image_copy = match is_dasd(&config.device, Some(dest))? { - #[cfg(target_arch = "s390x")] - true => s390x::image_copy_s390x, - _ => image_copy_default, -@@ -527,7 +527,7 @@ fn reset_partition_table( - ) -> Result<()> { - eprintln!("Resetting partition table"); - -- if is_dasd(&config.device)? { -+ if is_dasd(&config.device, Some(dest))? { - // Don't write out a GPT, since the backup GPT may overwrite - // something we're not allowed to touch. Just clear the first MiB - // of disk. -diff --git a/src/s390x/dasd.rs b/src/s390x/dasd.rs -index 7145071..b7dea78 100644 ---- a/src/s390x/dasd.rs -+++ b/src/s390x/dasd.rs -@@ -35,13 +35,15 @@ pub(crate) struct Range { - pub length: u64, - } - --/// There are 2 types of DASD devices: -+/// There are 3 types of DASD devices: - /// - ECKD (Extended Count Key Data) - is regular DASD of type 3390 - /// - FBA (Fixed Block Access) - is used for emulated device that represents a real SCSI device -+/// - Virt - ECKD on LPAR/zKVM as virtio-device - /// Only ECKD disks require `dasdfmt, fdasd` linux tools to be configured. - enum DasdType { - Eckd, - Fba, -+ Virt, - } - - fn get_dasd_type>(device: P) -> Result { -@@ -53,6 +55,9 @@ fn get_dasd_type>(device: P) -> Result { - .with_context(|| format!("getting name of {}", device.display()))? - .to_string_lossy() - .to_string(); -+ if device.starts_with("vd") { -+ return Ok(DasdType::Virt); -+ } - let devtype_path = format!("/sys/class/block/{}/device/devtype", device); - let devtype_str = std::fs::read_to_string(&devtype_path) - .with_context(|| format!("reading {}", devtype_path))?; -@@ -66,7 +71,7 @@ fn get_dasd_type>(device: P) -> Result { - pub fn prepare_dasd(dasd: &str) -> Result<()> { - match get_dasd_type(dasd)? { - DasdType::Eckd => eckd_prepare(dasd), -- DasdType::Fba => Ok(()), -+ DasdType::Fba | DasdType::Virt => Ok(()), - } - } - -@@ -75,7 +80,7 @@ pub fn prepare_dasd(dasd: &str) -> Result<()> { - pub fn dasd_try_get_sector_size(dasd: &str) -> Result> { - match get_dasd_type(dasd)? { - DasdType::Eckd => eckd_try_get_sector_size(dasd), -- DasdType::Fba => Ok(None), -+ DasdType::Fba | DasdType::Virt => Ok(None), - } - } - -@@ -87,8 +92,10 @@ pub fn image_copy_s390x( - _saved: Option<&SavedPartitions>, - ) -> Result<()> { - let ranges = match get_dasd_type(dest_path)? { -- DasdType::Eckd => eckd_make_partitions(&dest_path.to_string_lossy(), dest_file, first_mb)?, - DasdType::Fba => fba_make_partitions(&dest_path.to_string_lossy(), dest_file, first_mb)?, -+ DasdType::Eckd | DasdType::Virt => { -+ eckd_make_partitions(&dest_path.to_string_lossy(), dest_file, first_mb)? -+ } - }; - - // copy each partition --- -2.31.1 - diff --git a/SPECS/coreos-installer.spec b/SPECS/coreos-installer.spec index efbd865..1ec8969 100644 --- a/SPECS/coreos-installer.spec +++ b/SPECS/coreos-installer.spec @@ -5,18 +5,22 @@ # The library is for internal code reuse and is not a public API %global __cargo_is_lib 0 +%global coidracutcommit 1a262bd9553ee0b3607b4d1982947a1fd6567c35 +%global coidracutshortcommit %(c=%{coidracutcommit}; echo ${c:0:7}) + %global crate coreos-installer Name: %{crate} -Version: 0.9.1 -Release: 17%{?dist} +Version: 0.11.0 +Release: 3%{?dist} Summary: Installer for Fedora CoreOS and RHEL CoreOS # Upstream license specification: Apache-2.0 License: ASL 2.0 -URL: https://github.com/fedora-iot/coreos-installer +URL: https://github.com/coreos/coreos-installer Source: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate Source1: https://github.com/coreos/coreos-installer/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz +Source2: https://github.com/runcom/coreos-installer-dracut/archive/%{coidracutcommit}/coreos-installer-dracut-%{coidracutshortcommit}.tar.gz # The RHEL 8 rust-toolset macros don't let us enable features from the # %%cargo_* macros. Enable rdcore directly in Cargo.toml. @@ -25,23 +29,14 @@ Patch0: enable-rdcore.patch # https://github.com/coreos/coreos-installer/pull/360 # https://github.com/coreos/coreos-installer/issues/372 # https://bugzilla.redhat.com/show_bug.cgi?id=1863466 -Patch1: disable-lto-0.6.0.patch -# Add coreos.force_persist_ip karg forwarding -# https://github.com/coreos/coreos-installer/pull/554 -Patch2: force_persist_ip-0.9.1.patch -# Support s390x DASDs in VMs via virtio -# https://github.com/coreos/coreos-installer/pull/552 -Patch3: s390x-support-virtio-dasd-0.9.1.patch -Patch4: coidracut.patch -Patch5: coidracut2.patch -Patch6: coidracut3.patch -Patch7: coidracut4.patch -Patch8: coidracut5.patch +Patch1: disable-lto.patch ExclusiveArch: %{rust_arches} BuildRequires: openssl-devel +BuildRequires: xz-devel BuildRequires: rust-toolset BuildRequires: systemd +BuildRequires: gnupg2 Requires: gnupg Requires: kpartx @@ -62,9 +57,6 @@ Requires: /usr/sbin/zipl # deprecated `coreos-installer` package (https://src.fedoraproject.org/rpms/coreos-installer), # an explicit `Obsoletes:` for `coreos-installer` is not necessary. -# Obsolete dracut modules as they are not provided in this package. -Obsoletes: coreos-installer-dracut < 0.0.1 - %global _description %{expand: coreos-installer installs Fedora CoreOS or RHEL CoreOS to bare-metal machines (or, occasionally, to virtual machines). @@ -78,6 +70,7 @@ machines (or, occasionally, to virtual machines). %prep %autosetup -n %{crate}-%{version} -p1 +%setup -D -T -a 2 %cargo_prep -V 1 # https://github.com/rust-lang-nursery/error-chain/pull/289 find -name '*.rs' -executable -exec chmod a-x {} \; @@ -100,19 +93,19 @@ install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer.target install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/coreos-installer-post.target install -D -m 0755 -t %{buildroot}%{_systemdgeneratordir} systemd/coreos-installer-generator mv %{buildroot}%{_bindir}/rdcore %{buildroot}%{dracutlibdir}/modules.d/50rdcore/ -cp -a %{buildroot}%{_bindir}/coreos-installer %{buildroot}%{dracutlibdir}/modules.d/50rdcore/ -install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore scripts/coreos-installer-service -install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore scripts/growfs -install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore scripts/coreos-installer-disable-device-auto-activation -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-disable-device-auto-activation.service -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer.service -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/growfs.service -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-reboot.service -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-noreboot.service -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-pre.target -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer.target -install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-post.target -install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/50rdcore systemd/coreos-installer-generator + +# 51coreos-installer for coreos-installer-dracut +install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/51coreos-installer/module-setup.sh +install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer.target +install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/scripts/coreos-installer-service +install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/scripts/coreos-installer-growfs +install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer.service +install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer-growfs.service +install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer-luks-open.service +install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer-reboot.service +install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer-noreboot.service +install -D -m 0644 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer-poweroff.service +install -D -m 0755 -t %{buildroot}%{dracutlibdir}/modules.d/51coreos-installer coreos-installer-dracut-%{coidracutcommit}/dracut/systemd/coreos-installer-generator %package -n %{crate}-bootinfra Summary: %{crate} boot-time infrastructure for use on Fedora/RHEL CoreOS @@ -127,17 +120,55 @@ This subpackage contains boot-time infrastructure for Fedora CoreOS and RHEL CoreOS. It is not needed on other platforms. %files -n %{crate}-bootinfra -%{dracutlibdir}/modules.d/* +%{dracutlibdir}/modules.d/50rdcore/* %{_libexecdir}/* %{_unitdir}/* %{_systemdgeneratordir}/* +%package -n %{crate}-dracut +Summary: %{crate} provides coreos-installer as a dracut module. +Requires: %{crate} = %{version}-%{release} + +%description -n %{crate}-dracut +This subpackage contains files and configuration to run coreos-installer +from the initramfs. + +%files -n %{crate}-dracut +%{dracutlibdir}/modules.d/51coreos-installer/* + %if %{with check} %check %cargo_test %endif %changelog +* Thu Feb 24 2022 Antonio Murdaca - 0.11.0-3 +- update coi-dracut to fix growfs service Before + +* Thu Feb 10 2022 Antonio Murdaca - 0.11.0-2 +- update coi-dracut to support default poweroff behavior + +* Wed Feb 02 2022 Antonio Murdaca - 0.11.0-1 +- bump to 0.11.0 and support luks in -dracut + +* Thu Nov 18 2021 Antonio Murdaca - 0.10.1-2 +- fix dracut module dependencies + +* Wed Oct 13 2021 Antonio Murdaca - 0.10.1-1 +- bump to 0.10.1 +- bump coreos-installer-dracut + +* Thu Sep 9 2021 Antonio Murdaca - 0.9.1-19 +- add a new coreos-installer-dracut subpkg to include just the + dracut module (fedora-iot/coreos-installer-dracut) + +* Tue Aug 31 2021 Jan Schintag - 0.10.0-1 +- Bump version to 0.10.0 + +* Mon Jun 21 2021 Jonathan Lebon - 0.9.1-4 +- Add xz-devel BR to ensure we're not bundling + Related: https://bugzilla.redhat.com/show_bug.cgi?id=1974453 + * Thu Jun 10 2021 Benjamin Gilbert - 0.9.1-3 - Support s390x DASDs in VMs via virtio