From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6880180325712920576 X-Received: by 2002:a19:383:: with SMTP id 125mr140712lfd.356.1601916991959; Mon, 05 Oct 2020 09:56:31 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:651c:93:: with SMTP id 19ls1215754ljq.4.gmail; Mon, 05 Oct 2020 09:56:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxds6PMwUorKqDA6YH8I+1+BgDsqoYi1dyzKI7i9zT9+lV0KD48cDvcClrGg9TOrEG+XVAh X-Received: by 2002:a2e:89d6:: with SMTP id c22mr241562ljk.242.1601916990641; Mon, 05 Oct 2020 09:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601916990; cv=none; d=google.com; s=arc-20160816; b=0/Txso7b9C+uhT6nOvRbfb8ZO3XeX+oyA46P4U4h3pj9sDaNtkWHrVXiWyFQFkesMu AENgycPZXTPKhOdGkJ2OC7InzzzAY6f1gWeg3E1IFSuhUjIBoT6yxsHk+763AIsgzGAI 5+op5ao5v8qJXlZOuBKEg3VpBXj5pNdcWkD2YdtkjZtiN+mVthXrLDQEmSM9LegDIgMT /y80YmQ6NVZB//S7uo7Y1Y7LTxe9ve+l1ns7GwuSVeKtW4+O40oNEikK8k9f8TMba+yF fpZL1QdsJ0Sgt1hVZftSP5qddijc2v7dNLUNtE6GvVFIqcOU19+Z49OtAFiDdvvl/Lv4 X79w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=rT/7cQ2QV9f2SnKyZhLUrNBuFuO1ypDC5N+Rh/+dvWE=; b=pXWO5QOmu20fi3DggheYOqmu63kEjQ6nphjzaEWAPtj81vzarBsolabwBvObnbm4oD c8FbvWsiTuA1zKjC206vwn1G7PbkkKyoPsEUWuQuoSf84d6RxlPqRsMoNVBCuRn9t/aF dXoXmhDYAHIOYpk/Yi47AZx27ZnbJsrteKrKnYf6/yNWE/J3x5VdjTnz350z9h0fPR7Q eAeZzIIhfmoNsXRHi3JWjAHnDqAgmvTCOZg7r44eWct1llAsZRQUlb3OpOeSh/0+bjMm QA0fvz1VkCp5OhFCL8nh6ofiH2OWmBfT+E+tVJrWHwRom+k2HIE1DoxVC4jn1541zj+R n0LA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id y75si10311lfa.3.2020.10.05.09.56.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2020 09:56:30 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: UrRnDel5aLOiOzVXnkVuy+3zUpf9zvQ11h6EsQxRiEnZq62JwrbH6gNvlTTzas2KaloqcHG0bb 794ZoDrB6Y4SDqd1fhegSX5crS6a8XvBbDXVY3v2TwO3XHwI1qtH+gaecQ3NUFsauV44Ob+E1p n+1YPeQKiFwNRCs5ArlAx4FNmsSpjPFMTiSPTJF/0rQYZRLPgvet98KGwToB8gnpV7Z8GQUmf5 CmPFULwY0jFPBRR54HJgawaYcKw8PFYDRbAjgV4ivca1jv/u44ANMwYv3E9KPs4rMoebYxTguW vVs= X-IronPort-AV: E=Sophos;i="5.77,340,1596528000"; d="scan'208";a="53722894" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 05 Oct 2020 08:56:29 -0800 IronPort-SDR: Ra14Nw9cMpehGOAmZ+frDDqm3mto8ePuVMO+x1YO0gWmi4YNgbEm08XcbdmU5/3uq6RKZSnY+I n0KGGEEcyyrfnOkQimAgoPJXckllVAHYN+KXpw4h1ObkLIXX+BRNpKPwccAmtiAR1OJcCJ8wVK EF1klEgxRFpoTxz/L+xrrwol21dshuxS58G61Wf3bcEzIiMTvPLm/e0MJqfEuEqc9IuWLRqjHW rGgyCiZHRy4IrlQJfzmY9axCIHJoyVNiwXQd/VqznfBDAgS8qWOPyfcK7EZqsBsiZMv+GwKIbJ Kaw= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH v5 7/8] Fix legacy bios boot partition Date: Mon, 5 Oct 2020 22:25:41 +0530 Message-ID: <20201005165542.14954-3-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201005165542.14954-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201005165307.14668-5-Vijaikumar_Kanagarajan@mentor.com> <20201005165542.14954-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: 2y79xg9QtGIV In case of legacy bios, the kernel is required to be present in a seperate partition with necessary syslinux files. This was never mounted onto the target and standard kernel update via apt-get was impossible. Rename the existing kernel and initrd files in the syslinux partition to the standard debian naming format. Copy over System.map and config files to the partition and exclude the /boot in root partition. The latest wic automatically adds the necessary entry for /boot partition in fstab which automounts it during boot. Signed-off-by: Vijai Kumar K --- .../lib/wic/canned-wks/common-isar.wks.inc | 2 +- meta/classes/wic-img.bbclass | 3 +- .../wic/plugins/source/bootimg-pcbios-isar.py | 31 ++++++++++++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/meta-isar/scripts/lib/wic/canned-wks/common-isar.wks.inc b/meta-isar/scripts/lib/wic/canned-wks/common-isar.wks.inc index c8ea4c2..cc38a01 100644 --- a/meta-isar/scripts/lib/wic/canned-wks/common-isar.wks.inc +++ b/meta-isar/scripts/lib/wic/canned-wks/common-isar.wks.inc @@ -1,3 +1,3 @@ # This file is included into 3 canned wks files from this directory part /boot --source bootimg-pcbios-isar --ondisk sda --label boot --active --align 1024 -part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 +part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --exclude-path=boot diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index 33ab53e..7ffdf1d 100644 --- a/meta/classes/wic-img.bbclass +++ b/meta/classes/wic-img.bbclass @@ -95,7 +95,8 @@ WIC_CREATE_EXTRA_ARGS ?= "" WICVARS += "\ BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE FAKEROOTCMD IMAGE_BASENAME IMAGE_BOOT_FILES \ IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR RECIPE_SYSROOT_NATIVE \ - ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS TRANSLATED_TARGET_ARCH" + ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS TRANSLATED_TARGET_ARCH \ + KERNEL_NAME KERNEL_FILE" # Isar specific vars used in our plugins WICVARS += "KERNEL_IMAGE INITRD_IMAGE DISTRO_ARCH" diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py index 4d916d6..493615b 100644 --- a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py +++ b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py @@ -131,8 +131,13 @@ class BootimgPcbiosIsarPlugin(SourcePlugin): syslinux_conf += "DEFAULT boot\n" syslinux_conf += "LABEL boot\n" - kernel = get_bitbake_var("KERNEL_IMAGE") - initrd = get_bitbake_var("INITRD_IMAGE") + kernel_file = get_bitbake_var("KERNEL_FILE") + kernel_name = get_bitbake_var("KERNEL_NAME") + rootfs_dir = get_bitbake_var("IMAGE_ROOTFS") + kernel = os.path.basename(os.path.realpath(os.path.join(rootfs_dir, kernel_file))) + kernel_version = kernel.strip('-' + kernel_name).strip(kernel_file + '-') + initrd = "initrd.img-%s-%s" % (kernel_version, kernel_name) + syslinux_conf += "KERNEL " + kernel + "\n" syslinux_conf += "APPEND label=boot root=%s initrd=%s %s\n" % \ @@ -156,15 +161,25 @@ class BootimgPcbiosIsarPlugin(SourcePlugin): syslinux_dir = cls._get_syslinux_dir(bootimg_dir) staging_kernel_dir = kernel_dir - kernel = get_bitbake_var("KERNEL_IMAGE") - initrd = get_bitbake_var("INITRD_IMAGE") + kernel_file = get_bitbake_var("KERNEL_FILE") + kernel_name = get_bitbake_var("KERNEL_NAME") + rootfs_dir = rootfs_dir['ROOTFS_DIR'] + kernel = os.path.basename(os.path.realpath(os.path.join(rootfs_dir, kernel_file))) + kernel_version = kernel.strip('-' + kernel_name).strip(kernel_file + '-') + initrd = "initrd.img-%s-%s" % (kernel_version, kernel_name) + config = "config-%s-%s" % (kernel_version, kernel_name) + mapfile = "System.map-%s-%s" % (kernel_version, kernel_name) hdddir = "%s/hdd/boot" % cr_workdir - cmds = ("install -m 0644 %s/%s %s/%s" % - (staging_kernel_dir, kernel, hdddir, kernel), - "install -m 0644 %s/%s %s/%s" % - (staging_kernel_dir, initrd, hdddir, initrd), + cmds = ("install -m 0644 %s/%s/%s %s/%s" % + (rootfs_dir, "boot", kernel, hdddir, kernel), + "install -m 0644 %s/%s/%s %s/%s" % + (rootfs_dir, "boot", initrd, hdddir, initrd), + "install -m 0644 %s/%s/%s %s/%s" % + (rootfs_dir, "boot", config, hdddir, config), + "install -m 0644 %s/%s/%s %s/%s" % + (rootfs_dir, "boot", mapfile, hdddir, mapfile), "install -m 444 %s/modules/bios/ldlinux.c32 %s/ldlinux.c32" % (syslinux_dir, hdddir), "install -m 0644 %s/modules/bios/vesamenu.c32 %s/vesamenu.c32" % -- 2.17.1