Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF3D51369A7 for ; Mon, 20 May 2024 14:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716216979; cv=none; b=lnpLWz9vLvHqWO5DmO6zaHs5pJko//Lo1uSIn+fNoBpALjmzU/FDNsM2vc5OomaoJYjsthN1jUgKN/npaTVrBDgkLtYFZlorUFtm0G9CrWdKM7U9efIJHriuOnOwcWrkFfRnuvFSE/8zu9agj8R+GUmmXYUlV4Gl6Vkyt5ypxlo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716216979; c=relaxed/simple; bh=y3ADmNT4MjSMU+Lb6j732S6xU7+nhfrByKovDxzHK44=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VlRUYCon9AAymjHVZfW3twFOAJiV5As+QvhrbUygq/I93iyAeRYyqtqptPu5picwXrUNVHA/43QIt37BE0MP2+zDH/aAzF4UeEyeKjO/u/ApqL8j8iZT9/ykEMhxTmuATFcThKmPPWwGKzVVtt5DLKxAYrvxSbxQvMJl8cnag0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Bxk+OF2i; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Bxk+OF2i" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716216976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u+8Ws/czequYXaXq3bbnQIHYft2rUiflcPB+BW6EUXc=; b=Bxk+OF2ipEYwuDog/xqu1bWjZ58QFJ2GWNRrnj1FwqoDjHTPTj+r+E+sikhIhXiYTLwedV nkq/P5OsbS4GN4Dt+jiJ07nUOMWQdDIEkt6G/dmzypmI5c4mIhOQuYD4vmQJ493xAzHCaY XlbTZKn2TKe6SzJ5y3bu7IBG9Y04h/c= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-571-HVITlr5vO6SKmiF5GfjOJw-1; Mon, 20 May 2024 10:56:14 -0400 X-MC-Unique: HVITlr5vO6SKmiF5GfjOJw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9AE423806704 for ; Mon, 20 May 2024 14:56:14 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.33.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E0D8200A78F for ; Mon, 20 May 2024 14:56:14 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id 1D9C814C12E for ; Mon, 20 May 2024 10:56:14 -0400 (EDT) From: Scott Mayhew To: kdevops@lists.linux.dev Subject: [PATCH] guestfs: make pre_install_customizations() work on RHEL/Fedora/CentOS Date: Mon, 20 May 2024 10:56:14 -0400 Message-ID: <20240520145614.299932-1-smayhew@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true These all use grub2-mkconfig. Fixes: 7eacfee ("guestfs: modify grub prompt before first bring up") Reported-by: Chuck Lever III Signed-off-by: Scott Mayhew --- scripts/bringup_guestfs.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index 9238888..806abc6 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -191,12 +191,17 @@ _EOT pre_install_customizations() { + if echo $OS_VERSION | grep -qE "^(rhel|fedora|centos)"; then + UPDATE_GRUB_CMD="/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg" + else + UPDATE_GRUB_CMD="/usr/sbin/update-grub2" + fi cat <<_EOT >>$cmdfile install sudo,qemu-guest-agent,python3,bash run-command useradd -m kdevops -s /bin/bash append-line /etc/sudoers.d/kdevops:kdevops ALL=(ALL) NOPASSWD: ALL edit /etc/default/grub:s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"/ -run-command /usr/sbin/update-grub2 +run-command $UPDATE_GRUB_CMD root-password password:kdevops _EOT } -- 2.43.0