[v5,8/8] meta-isar/canned-wks: Remove unwanted /boot mountpoint

Message ID 20201005165542.14954-4-Vijaikumar_Kanagarajan@mentor.com
State Superseded, archived
Headers show
Series WIC update | expand

Commit Message

Vijai Kumar K Oct. 5, 2020, 7:55 a.m. UTC
In the older version of wic, the fstab entry for /boot mountpoint
was skipped. However in the latest wic this is not the case.
Adding a /boot mountpoint in part results in creating a fstab
entry for automount.

For machines that uses the kernel, initrd and related files from the root
partition; having /boot now as mountpoint for bootloader partition would
break the kernel update. Those original kernel files would no longer be
available once the bootloader partition is auto-mounted onto /boot.

For such machines, remove the bogus /boot mount point in wks files.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 RECIPE-API-CHANGELOG.md                       | 26 +++++++++++++++++++
 .../scripts/lib/wic/canned-wks/hikey.wks      |  2 +-
 .../lib/wic/canned-wks/sdimage-efi.wks        |  2 +-
 3 files changed, 28 insertions(+), 2 deletions(-)

Patch

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index ac9d8d6..da5734d 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -252,3 +252,29 @@  with ${D} which needs to be filled explicitly in do_install as before.
 ISARROOT variable is now removed from the bitbake environment. It is unset
 after the initial setup. It is replaced with dedicated variables like
 BITBAKEDIR, SCRIPTSDIR and TESTSUITEDIR.
+
+### Wic adds /boot mountpoint to fstab
+
+In the older version of wic, any mount point named /boot is skipped from adding
+into the fstab entry.
+
+With the latest wic, this is not the case. /boot mount point, if any, is added
+to /etc/fstab for automount.
+
+Any wks file which assumed that /boot would be skipped from /etc/fstab should
+now be corrected. Otherwise, it might conflict with the original /boot contents,
+i.e kernel initrd & config files will be unavailable after boot.
+
+Below is an example wks entry that might cause an issue.
+The efi partition created using bootimg-efi-isar plugin has only the efi stub in
+it. The kernel and initrd are present in the root(/) partition.
+Now with the latest wic which adds the /boot mount point to fstab, the /boot
+contents of "part /" would be unavailable after boot. This would break the
+kernel updates done via apt-get.
+
+```
+part /boot --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk sda --label efi --part-type EF00 --align 1024
+part / --source rootfs --ondisk sda --fstype ext4 --label platform --align 1024 --use-uuid
+```
+In this case we can either drop the /boot mountpoint or use some other mountpoint
+like /boot/efi to avoid such issues.
diff --git a/meta-isar/scripts/lib/wic/canned-wks/hikey.wks b/meta-isar/scripts/lib/wic/canned-wks/hikey.wks
index 1e82f8c..840858e 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/hikey.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/hikey.wks
@@ -3,7 +3,7 @@ 
 #
 # SPDX-License-Identifier: MIT
 
-part /boot --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk mmcblk1 --label efi --part-type EF00 --align 1024
+part --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk mmcblk1 --label efi --part-type EF00 --align 1024
 
 part / --source rootfs --ondisk mmcblk1 --fstype ext4 --label platform --align 1024 --use-uuid
 
diff --git a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
index 2afa016..e0fa7a1 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
@@ -2,7 +2,7 @@ 
 # long-description: Creates a partitioned EFI disk image without any swap that
 # the user can directly dd to boot media.
 
-part /boot --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk sda --label efi --part-type EF00 --align 1024
+part --source bootimg-efi-isar --sourceparams "loader=grub-efi" --ondisk sda --label efi --part-type EF00 --align 1024
 
 part / --source rootfs --ondisk sda --fstype ext4 --label platform --align 1024 --use-uuid