Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1270192rwb; Thu, 22 Sep 2022 12:30:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gEAe0IW7VMwy0Hu/1gImovNFuII2EgTKYnZF8bU0b7kCIWW8t5rcaw8I0W6JAauVsqs0i X-Received: by 2002:aa7:cb87:0:b0:43b:e650:6036 with SMTP id r7-20020aa7cb87000000b0043be6506036mr4968059edt.350.1663875053027; Thu, 22 Sep 2022 12:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663875053; cv=none; d=google.com; s=arc-20160816; b=U32/AmoAWpYMKW0D1yp21Lu47wYsvjv6Z2xZs6hwq02J1vRQ8OsEW/XtsrZqvRr5FZ t/1eHkcQroCBoqVH0BmN7fRq14Y/iBy1xxYYJW6Tomh9gFXDEW59hnm9tI2mONc11G3o UrW/R8DUjGPxaLtldOAoiw4LVUUeZnmmn0Y7P01Fh9R7xtJI0fdvfLqY2l+lpD6rojB9 jVR4TxJcJ0xQYnsMFDb63oggr9/+AO/LVOSL8jx6iG2m/zV2St0Dgbm9pEyDoUF4zVIL 8FQSbdA9sWbKDXDsIaUut1uoRPLT9JQZF2oYYgeYvIfCN64Zd3m6yMHIqGx3IJ7DruwI sK3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=KXR8aFo7IH4MA/ibI65C7sV8IgOxAzdBucUz3STBYMM=; b=abFnQe/zROPx/W2WJUdPiBDFGTaoGBOB+ZEizzfIxSILUBezeomtifelZqXxngHxGv XrFPR8jgjlqgEHSxw5jFI20lP08umXu7r/bifyFza9W7I3RZ8OZbw7vh1WhM7Baumdk1 Roew/5hE4AUV0Po04ld+OEGigjUzgxuWY+6oLAplH2fqkbohGZWzjfsm1BYbheQeEjuq Y+lp4r8XYTUgrcfZOLMNuHYb3glhpoSPx+bTRtQ4gsaFZ0s2Lm3g1lpQtw4x7zz+Dbs7 v6X+9e9Jdwoiy4+PPHdqjoHIiTy4rgQJUZy+7hOnzJeYPGpwn2QoJ4rIxrRtrs0J9n3v 5QHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kde.org header.s=users header.b=Wzq8w4AZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cu9-20020a170906e00900b007801a579899si4980196ejb.448.2022.09.22.12.30.27; Thu, 22 Sep 2022 12:30:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kde.org header.s=users header.b=Wzq8w4AZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232202AbiIVTDR (ORCPT + 99 others); Thu, 22 Sep 2022 15:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230241AbiIVTDO (ORCPT ); Thu, 22 Sep 2022 15:03:14 -0400 X-Greylist: delayed 600 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 22 Sep 2022 12:03:12 PDT Received: from letterbox.kde.org (letterbox.kde.org [46.43.1.242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B35BFB300; Thu, 22 Sep 2022 12:03:12 -0700 (PDT) Received: from vertex.localdomain (pool-173-49-113-140.phlapa.fios.verizon.net [173.49.113.140]) (Authenticated sender: zack) by letterbox.kde.org (Postfix) with ESMTPSA id 68B6B33CA5E; Thu, 22 Sep 2022 19:45:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kde.org; s=users; t=1663872330; bh=KXR8aFo7IH4MA/ibI65C7sV8IgOxAzdBucUz3STBYMM=; h=From:To:Cc:Subject:Date:From; b=Wzq8w4AZNvIbdNn4rk/xDh84qL1TfMVadvxauUIhNwLpn3o4LW1oYVbM4c0sk2mJm kEP9lU8cqqdVUZ3ehX4kZbGtqdQDv4hleu646pjsfY0uKFPjPRByZ3TBhoFkCTtDUw +03D8PjyYTBYzn2cBFHG1mYAO770Co+jehX+ybDG4YIg/EW/aHIlY7DFFT+9YYrQSL RTEdZLTHFTLGgD4LyU8rbC5rzrpIZHuLNSCC7tuAA3FgnT0nigr/FYE6+MO5/cldzb Mk4Z414+ofgPrn7qUw2Wx32Bk93tJsnbGVU28coR8TWc05GdGk+aUpMrVMHDWeJjpQ FtHwIylLSiCOw== From: Zack Rusin To: Masahiro Yamada Cc: Zack Rusin , Michal Marek , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's Date: Thu, 22 Sep 2022 14:45:25 -0400 Message-Id: <20220922184525.3021522-1-zack@kde.org> X-Mailer: git-send-email 2.34.1 Reply-To: Zack Rusin MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zack Rusin The debug vmlinux takes up the vast majority of space in the built rpm's. While having it enabled by default is a good idea because it makes debugging easier, having an option to skip it is highly valuable for CI/CD systems where small packages are a lot easier to deal with e.g. kernel rpm built using binrpm-pkg on Fedora 36 default 5.19.8 kernel config and localmodconfig goes from 255MB to 65MB which is an almost 4x difference. To skip adding vmlinux.bz2 to the built rpm add SKIP_RPM_VMLINUX environment variable which when set to "y", e.g. via "SKIP_RPM_VMLINUX=y make binrpm-pkg" won't include vmlinux.bz2 in the built rpm. Signed-off-by: Zack Rusin Cc: Masahiro Yamada Cc: Michal Marek Cc: Nick Desaulniers Cc: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- scripts/package/mkspec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 7c477ca7dc98..5a71fc0852b0 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -23,6 +23,12 @@ else M=DEL fi +if [ "$RPM_SKIP_VMLINUX" = y ]; then + D=DEL +else + D= +fi + if grep -q CONFIG_DRM=y .config; then PROVIDES=kernel-drm fi @@ -94,8 +100,8 @@ $M $MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install $MAKE %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE cp .config %{buildroot}/boot/config-$KERNELRELEASE - bzip2 -9 --keep vmlinux - mv vmlinux.bz2 %{buildroot}/boot/vmlinux-$KERNELRELEASE.bz2 +$D bzip2 -9 --keep vmlinux +$D mv vmlinux.bz2 %{buildroot}/boot/vmlinux-$KERNELRELEASE.bz2 $S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/build $S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/source $S$M mkdir -p %{buildroot}/usr/src/kernels/$KERNELRELEASE -- 2.34.1