From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:a67:13c6:: with SMTP id 189mr15275039vst.3.1600267882235; Wed, 16 Sep 2020 07:51:22 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6122:554:: with SMTP id y20ls123358vko.2.gmail; Wed, 16 Sep 2020 07:51:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjQz4lRvyXITZ7c+8ke4NoMm9DTaL31zcLa6jtp4S4xSFbr2SAdRAH+2hByCwk4mByUnV9 X-Received: by 2002:a1f:8d8a:: with SMTP id p132mr5019343vkd.14.1600267881599; Wed, 16 Sep 2020 07:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600267881; cv=none; d=google.com; s=arc-20160816; b=kTsUHg4+XUzVrBSlWamzBLLf1P6bjPrOU+wrtXR8GE4W/V1jgg31TZwCuf3xlXTYYb Vj7XXV5ngNrwW8CPnv5L0vZKBU8NJeg4TTYyBkWSi+E4IudCnAr59rt1uUGbsj9lROD0 R0qHrMU05BMgSFIpFqORm+pKMvgDesO9tuDe+ye1jE5TuLhWiWGbPhIjHnUdM7olEvbW bwQ/btkvTFsTDPgI6YdWaVkTRwLC7e4oxJ88nqzJwAMJRJWLI2J8koRZ52ffQo9Bqrer eWImsxaCmztR0YN5s1e2AAo9x4mK1ORF3dC5c7bjgOCQ/jzHTF0l/5+cy9oYrg3vOfbF ANYg== 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:to:from :ironport-sdr:ironport-sdr; bh=UYEKBWEe5qoDxUZEg+f7jlNpYWmO9Zm7Oz63SGu5bTk=; b=nub5gVWEQYAI7XkGWz/esHIDoMsYE/v/sXHYd6b/3STxluzBgm8rr1SB+in7bbcQeG 7IlxrZxHHSjeVECwUlPtBq+1+77NNf+q9MlDy2J0va0fOq7EHjKiSeqhCjcaeqfh7ecC 3zBceHhWyeNOqfQD5cH/L2TnE+BRTsXLECDL7jAweQ2QvvdiRJOON6ezIpaJ2QFVCdTn RxO8vI0brbf13u5EOXqobOWyy4l5S7AlL6sSl0bDCMlyzh8fy/JKYy1P1pQLO0AaeVwR C92NEhRIOfdDkBBPnBJDdH6JqIhbR7gbwVSzabrC1IGDqfIOQYWy+6qCLArd7sHmlv/O yAIQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.129.153 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com. [68.232.129.153]) by gmr-mx.google.com with ESMTPS id s11si901191vsn.1.2020.09.16.07.51.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2020 07:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.129.153 as permitted sender) client-ip=68.232.129.153; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.129.153 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: RXpyDaX/1R8HsN1QP1v/4D3lD58CshO6StUnXhNPZhvvQ4Re3+Zc3F3kscyqwgksVqeMSdw847 Q4Ob56bLQOGSvX5Ew5qab56tqjSNzVe1ZI2kJV7AC4sz7Eg9pDZHuJLatu0hfC4/0GCk2vzQDr wB/RcxuFrA9tStSJXS2cdvcMba4KljsuLNDSSSOx/NDDEWo2GdWLRUMkj9U69AWmpvm3UknuqI FjsTrZfVVqcjxNUPOmi0eBimjiB2bFwo48cHXTzVISI4Cd/CyFR9y9g1eB1uJyCWS3FaRebhlB y5Q= X-IronPort-AV: E=Sophos;i="5.76,433,1592899200"; d="scan'208";a="55173190" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 16 Sep 2020 06:51:20 -0800 IronPort-SDR: zJEECMCUtj9Utto+7spDn1BDPEwpI4SVzEqvCXkZNgc6qxqruA8ZM1kV52Qbssy5dwqVMCPukA qKLq1rACuLN+wXAeUkLjEPg3cRAu8ZVYD9OwSH+LthsktcDA35y2uxVEeprYKoE9B/BJbK9Bjn fWXn6NM7NJaiowarbSJp+gDY8msJ/3Yy7vv6g45lzDp67MQw5FPntBIgfn0btNTLwBB642pW63 cVGMWl7Re+i+G8P9BUC44Zey/+UrMwMBMxFtNuGSmMdWIPl4sREWt8WgfAGTiV8+OBm2Evrpg1 0fs= From: Vijai Kumar K To: , , Subject: [PATCH v4 7/8] Fix legacy bios boot partition Date: Wed, 16 Sep 2020 20:20:20 +0530 Message-ID: <20200916145021.5856-8-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200916145021.5856-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200916145021.5856-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: uwKexdxWhJu1 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 b1a7259..0752d8f 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