public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper
@ 2018-09-11 12:05 Jan Kiszka
  2018-09-11 12:05 ` [PATCH 01/16] meta-isar: Adjust kernel params in sdimage-efi.wks Jan Kiszka
                   ` (16 more replies)
  0 siblings, 17 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

Key features of this series:
 - cleanup / fix / control of filesystem checks
 - removal of ROOTFS_DEV and ROOTFS_TYPE
 - wks file cleanups and corrections
 - avoidance of ROOTFS_EXTRA for wic images
 - fix for linux-custom.inc, allows to tell linux-cip and linux-cip-rt apart
 - move IMAGE_PREINSTALL = "init" to distro conf

And then there is a new goody again: When adding expand-on-first-boot to
IMAGE_INSTALL, this helper will expand the last partition of an image to
the full size of the target medium. Very useful to generate small SD
card images that become big once used on the target device. That's also
what many images for maker boards include.

Jan

Jan Kiszka (16):
  meta-isar: Adjust kernel params in sdimage-efi.wks
  meta-isar: Reduce grub timeout to 3 seconds
  meta-isar: Fix bananapi root disk specification
  meta-isar: Remove "=" after wic parameters
  u-boot-script: Become independent of target /etc/fstab
  isar-image-base: Disable rootfs check by default
  isar-image-base: Use generic parameters for rootfs entry in fstab
  meta: Remove ROOTFS_TYPE
  start_vm: Rename QEMU_ROOTFS_DEV to QEMU_DISK_ARGS
  start_vm: Rename ROOTFS_DEV to QEMU_ROOTFS_DEV
  RECIPE-API-CHANGELOG: Add ROOTFS_DEV/TYPE removal
  meta: Add expand-on-first-boot support package
  image: Limit ROOTFS_EXTRA to non-wic image type
  linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching
  meta-isar: Move init preinstallation into distro conf
  meta: Add enable-fsck helper recipe

 RECIPE-API-CHANGELOG.md                            | 15 ++++++
 meta-isar/conf/distro/debian-buster.conf           |  2 +
 meta-isar/conf/distro/debian-stretch.conf          |  2 +
 meta-isar/conf/local.conf.sample                   |  2 +-
 meta-isar/conf/multiconfig/bananapi-stretch.conf   |  4 --
 meta-isar/conf/multiconfig/qemuamd64-buster.conf   |  6 +--
 meta-isar/conf/multiconfig/qemuamd64-jessie.conf   |  4 +-
 meta-isar/conf/multiconfig/qemuamd64-stretch.conf  |  6 +--
 meta-isar/conf/multiconfig/qemuarm-buster.conf     |  6 +--
 meta-isar/conf/multiconfig/qemuarm-jessie.conf     |  4 +-
 meta-isar/conf/multiconfig/qemuarm-stretch.conf    |  6 +--
 meta-isar/conf/multiconfig/qemuarm-wheezy.conf     |  4 +-
 meta-isar/conf/multiconfig/qemuarm64-buster.conf   |  6 +--
 meta-isar/conf/multiconfig/qemuarm64-stretch.conf  |  6 +--
 meta-isar/conf/multiconfig/qemui386-buster.conf    |  6 +--
 meta-isar/conf/multiconfig/qemui386-jessie.conf    |  4 +-
 meta-isar/conf/multiconfig/qemui386-stretch.conf   |  6 +--
 meta-isar/conf/multiconfig/rpi-jessie.conf         |  2 -
 meta-isar/recipes-core/images/isar-image-base.bb   |  2 +-
 meta-isar/scripts/lib/wic/canned-wks/bananapi.wks  |  6 +--
 .../scripts/lib/wic/canned-wks/directdisk-isar.wks |  2 +-
 .../scripts/lib/wic/canned-wks/sdimage-efi.wks     |  6 +--
 meta/classes/ext4-img.bbclass                      |  2 -
 meta/classes/image.bbclass                         | 12 ++---
 meta/classes/wic-img.bbclass                       |  3 +-
 meta/recipes-bsp/u-boot-script/files/u-boot-script |  7 ++-
 .../u-boot-script/files/update-u-boot-script       | 12 +----
 .../recipes-bsp/u-boot-script/u-boot-script_1.0.bb | 55 ++++++++++++++++++----
 meta/recipes-kernel/linux/linux-custom.inc         | 10 ++--
 meta/recipes-support/enable-fsck/enable-fsck.bb    | 25 ++++++++++
 .../enable-fsck/files/enable-fsck.service          | 23 +++++++++
 .../enable-fsck/files/enable-fsck.sh               | 16 +++++++
 meta/recipes-support/enable-fsck/files/postinst    |  3 ++
 .../expand-on-first-boot/expand-on-first-boot.bb   | 25 ++++++++++
 .../files/expand-last-partition.sh                 | 31 ++++++++++++
 .../files/expand-on-first-boot.service             | 23 +++++++++
 .../expand-on-first-boot/files/postinst            |  3 ++
 scripts/start_vm                                   |  6 +--
 38 files changed, 264 insertions(+), 99 deletions(-)
 create mode 100644 meta/recipes-support/enable-fsck/enable-fsck.bb
 create mode 100644 meta/recipes-support/enable-fsck/files/enable-fsck.service
 create mode 100644 meta/recipes-support/enable-fsck/files/enable-fsck.sh
 create mode 100644 meta/recipes-support/enable-fsck/files/postinst
 create mode 100644 meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
 create mode 100644 meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
 create mode 100644 meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
 create mode 100644 meta/recipes-support/expand-on-first-boot/files/postinst

-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 01/16] meta-isar: Adjust kernel params in sdimage-efi.wks
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 02/16] meta-isar: Reduce grub timeout to 3 seconds Jan Kiszka
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

The rootfs type is unneeded, but we want rootwait in case we have to
wait for a slow SD card or USB device.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 7aba8e3..f8bd874 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
@@ -6,4 +6,4 @@ part /boot --source bootimg-efi-isar --sourceparams="loader=grub-efi" --ondisk s
 
 part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
 
-bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
+bootloader --ptable gpt --timeout=5 --append "rootwait console=ttyS0,115200 console=tty0"
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 02/16] meta-isar: Reduce grub timeout to 3 seconds
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
  2018-09-11 12:05 ` [PATCH 01/16] meta-isar: Adjust kernel params in sdimage-efi.wks Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 03/16] meta-isar: Fix bananapi root disk specification Jan Kiszka
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Should be enough to intercept.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 f8bd874..4088ece 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
@@ -6,4 +6,4 @@ part /boot --source bootimg-efi-isar --sourceparams="loader=grub-efi" --ondisk s
 
 part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
 
-bootloader --ptable gpt --timeout=5 --append "rootwait console=ttyS0,115200 console=tty0"
+bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 03/16] meta-isar: Fix bananapi root disk specification
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
  2018-09-11 12:05 ` [PATCH 01/16] meta-isar: Adjust kernel params in sdimage-efi.wks Jan Kiszka
  2018-09-11 12:05 ` [PATCH 02/16] meta-isar: Reduce grub timeout to 3 seconds Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-12  8:57   ` Henning Schild
  2018-09-11 12:05 ` [PATCH 04/16] meta-isar: Remove "=" after wic parameters Jan Kiszka
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

...and remove the unneeded --ondisk parameter from the bootloader
section.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/scripts/lib/wic/canned-wks/bananapi.wks | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
index d60868a..10cb7ae 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
@@ -1,5 +1,5 @@
-part u-boot --source rawcopy --sourceparams="file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin" --ondisk mmcblk --no-table --align 8
+part u-boot --source rawcopy --sourceparams="file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin" --no-table --align 8
 
-part / --source rootfs --ondisk mmcblk --fstype=ext4 --label platform --align 1024
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label platform --align 1024
 
 bootloader --append="rootwait"
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 04/16] meta-isar: Remove "=" after wic parameters
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (2 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 03/16] meta-isar: Fix bananapi root disk specification Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 05/16] u-boot-script: Become independent of target /etc/fstab Jan Kiszka
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Choose a consistent style, and that shall be without "=" after a
parameter in a wks file.

In fact, some parameters seem to break if separated by "=", though none
of those changed here.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/scripts/lib/wic/canned-wks/bananapi.wks        | 6 +++---
 meta-isar/scripts/lib/wic/canned-wks/directdisk-isar.wks | 2 +-
 meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks     | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
index 10cb7ae..e8fcdbe 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
@@ -1,5 +1,5 @@
-part u-boot --source rawcopy --sourceparams="file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin" --no-table --align 8
+part u-boot --source rawcopy --sourceparams "file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin" --no-table --align 8
 
-part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label platform --align 1024
+part / --source rootfs --ondisk mmcblk0 --fstype ext4 --label platform --align 1024
 
-bootloader --append="rootwait"
+bootloader --append "rootwait"
diff --git a/meta-isar/scripts/lib/wic/canned-wks/directdisk-isar.wks b/meta-isar/scripts/lib/wic/canned-wks/directdisk-isar.wks
index 2b9576d..e78429c 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/directdisk-isar.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/directdisk-isar.wks
@@ -4,4 +4,4 @@
 
 include common-isar.wks.inc
 
-bootloader  --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
+bootloader  --timeout=0  --append "rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
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 4088ece..2afa016 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
+++ b/meta-isar/scripts/lib/wic/canned-wks/sdimage-efi.wks
@@ -2,8 +2,8 @@
 # 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 /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
+part / --source rootfs --ondisk sda --fstype ext4 --label platform --align 1024 --use-uuid
 
 bootloader --ptable gpt --timeout 3 --append "rootwait console=ttyS0,115200 console=tty0"
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 05/16] u-boot-script: Become independent of target /etc/fstab
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (3 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 04/16] meta-isar: Remove "=" after wic parameters Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 06/16] isar-image-base: Disable rootfs check by default Jan Kiszka
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

It's a bit hacky to rely on that file during image creation,
specifically as imagers such as wic may change them. So far we used the
side channel ROOTFS_DEV which needs to be maintained separately from the
commonly used source: the wks file of the target.

This changes the interface of /etc/default/u-boot-script slightly and
reworks how its recipe fills that config file:
 - ROOT_PARTITION variable is added, saving the root partition number
 - KERNEL_ARGS replaces KERNEL_ARGS_APPEND and is supposed to include
   root=<rootdev> from now on
 - do_install derives both the root partition number as well as the root
   device from the wks file, when available
 - in all other (special) cases, u-boot-script should be set by a
   customization package

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/recipes-bsp/u-boot-script/files/u-boot-script |  7 ++-
 .../u-boot-script/files/update-u-boot-script       | 12 +----
 .../recipes-bsp/u-boot-script/u-boot-script_1.0.bb | 55 ++++++++++++++++++----
 3 files changed, 52 insertions(+), 22 deletions(-)

diff --git a/meta/recipes-bsp/u-boot-script/files/u-boot-script b/meta/recipes-bsp/u-boot-script/files/u-boot-script
index 53cc613..ca31b6d 100644
--- a/meta/recipes-bsp/u-boot-script/files/u-boot-script
+++ b/meta/recipes-bsp/u-boot-script/files/u-boot-script
@@ -1,6 +1,9 @@
-# Arguments to append to kernel command line.
+# Root filesystem partition number
+ROOT_PARTITION="\${distro_bootpart}"
+
+# Arguments for the kernel command line.
 # Make sure to escape $ in u-boot variables, e.g. "\${console}".
-KERNEL_ARGS_APPEND=""
+KERNEL_ARGS=""
 
 # Set to "yes" or "1" to leave out initrd, even if present
 NO_INITRD=""
diff --git a/meta/recipes-bsp/u-boot-script/files/update-u-boot-script b/meta/recipes-bsp/u-boot-script/files/update-u-boot-script
index c12c3ed..c613b13 100755
--- a/meta/recipes-bsp/u-boot-script/files/update-u-boot-script
+++ b/meta/recipes-bsp/u-boot-script/files/update-u-boot-script
@@ -13,23 +13,15 @@ if [ -f /etc/default/u-boot-script ]; then
 	. /etc/default/u-boot-script
 fi
 
-ROOT_DEV=$(egrep '^[^# 	]+[ 	]+/[ 	]' /etc/fstab | awk '{print $1}') \
-	|| true
-
-ROOT_PART="\${distro_bootpart}"
-if [ -n "${ROOT_DEV}" ]; then
-	ROOT_PART=$(echo ${ROOT_DEV} | sed 's/.*[^0-9]\([0-9]*\)$/\1/')
-fi
-
 BOOT_CMD=$(mktemp)
 
 KERNEL_VERSION=$(linux-version list | linux-version sort --reverse | head -1)
 
 echo "${SCRIPT_PREPEND}" >> ${BOOT_CMD}
 
-echo "setenv bootargs root=${ROOT_DEV} ${KERNEL_ARGS_APPEND}" >> ${BOOT_CMD}
+echo "setenv bootargs ${KERNEL_ARGS}" >> ${BOOT_CMD}
 
-echo "load \${devtype} \${devnum}:${ROOT_PART} \${fdt_addr_r}" \
+echo "load \${devtype} \${devnum}:${ROOT_PARTITION} \${fdt_addr_r}" \
      "/usr/lib/linux-image-${KERNEL_VERSION}/\${fdtfile}" >> ${BOOT_CMD}
 echo "load \${devtype} \${devnum}:\${distro_bootpart} \${kernel_addr_r}" \
      "/boot/vmlinuz-${KERNEL_VERSION}" >> ${BOOT_CMD}
diff --git a/meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb b/meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb
index da8dca5..8d1ad25 100644
--- a/meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb
+++ b/meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb
@@ -16,6 +16,50 @@ SRC_URI = " \
 
 DEBIAN_DEPENDS = "u-boot-tools, linux-image-${KERNEL_NAME}"
 
+# Extract the following information from the wks file and add it to the
+# packaged /etc/default/u-boot-script:
+#  - --append parameters from a bootloader entry
+#  - root partition number
+#  - disk name the root partition is located on
+
+init_config_from_wks() {
+	# Filter out the bootloader line, then grap the argument of --append.
+	# The argument may be quoted, respect that but remove the quotes prior
+	# to assigning the target variable. Will be re-added later.
+	KERNEL_ARGS=$(grep "^bootloader " $1 | \
+		      sed -e 's/.* --append[= ]\(".*"\|[^ $]*\).*/\1/' \
+			  -e 's/\"\(.*\)\"/\1/')
+
+	COUNT=0
+	while read COMMAND MNT OPTIONS; do
+		if [ "${COMMAND}" != part ] ||
+		   echo "${OPTIONS}" | grep -q "\--no-table"; then
+			continue
+		fi
+		COUNT=$(expr ${COUNT} + 1)
+		if [ "${MNT}" = "/" ]; then
+			ROOT_PARTITION=${COUNT}
+			break
+		fi
+	done < $1
+	if [ -n "${ROOT_PARTITION}" ]; then
+		# filter out parameter of --ondisk or --ondrive
+		ROOT=$(echo ${OPTIONS} | \
+		       sed 's/.*--on\(disk\|drive\)[ ]\+\([^ ]\+\) .*/\2/')
+		# anything found?
+		if [ "${ROOT}" != "${OPTIONS}" ]; then
+			# special case: append 'p' to mmcblkN
+			ROOT=$(echo ${ROOT} | sed 's/^\(mmcblk[0-9]\+\)/\1p/')
+
+			KERNEL_ARGS="\"root=/dev/${ROOT}${ROOT_PARTITION} ${KERNEL_ARGS}\""
+		fi
+	fi
+
+	sed -i -e 's|\(^ROOT_PARTITION=\).*|\1\"'"${ROOT_PARTITION}"'\"|' \
+	       -e 's|\(^KERNEL_ARGS=\).*|\1'"${KERNEL_ARGS}"'|' \
+		${WORKDIR}/u-boot-script
+}
+
 do_install() {
 	# Find WKS_FILE specified for the current target.
 	WKS_DIRS=$(dirname $(which wic))/lib/wic/canned-wks
@@ -24,20 +68,11 @@ do_install() {
 	done
 	for DIR in ${WKS_DIRS}; do
 		if [ -f ${DIR}/${WKS_FILE}.wks ]; then
-			WKS_PATH=${DIR}/${WKS_FILE}.wks
+			init_config_from_wks ${DIR}/${WKS_FILE}.wks
 			break
 		fi
 	done
 
-	# Transfer --append parameters from a bootloader entry in the wks file
-	# to the packaged /etc/default/u-boot-script.
-	if [ -n ${WKS_PATH} ]; then
-		APPEND=$(grep "^bootloader " ${WKS_PATH} | \
-			 sed 's/.* --append=\(".*"\|[^ $]*\).*/\1/')
-		sed -i 's|\(^KERNEL_ARGS_APPEND=\).*|\1'"${APPEND}"'|' \
-			${WORKDIR}/u-boot-script
-	fi
-
 	sudo rm -rf ${D}/etc ${D}/usr
 
 	install -v -d ${D}/usr/sbin
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 06/16] isar-image-base: Disable rootfs check by default
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (4 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 05/16] u-boot-script: Become independent of target /etc/fstab Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 07/16] isar-image-base: Use generic parameters for rootfs entry in fstab Jan Kiszka
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

While the fsck hook of initramfs-tools does evaluate our generated fstab
it ignores the filesystem type we provide and rather tries to probe
that. Naturally, that is unreliable in the build environment.

To make things simpler and better configurable, disable the rootfs
check. We will add a helper recipe to reenable this and more, but that
only during first boot when we have the final fstab and and the real
rootfs device available.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/recipes-core/images/isar-image-base.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 84001fd..36bf11f 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -32,7 +32,7 @@ do_rootfs[root_cleandirs] = "${IMAGE_ROOTFS} \
 do_rootfs() {
     cat > ${WORKDIR}/fstab << EOF
 # Begin /etc/fstab
-/dev/${ROOTFS_DEV}	/		${ROOTFS_TYPE}		defaults		1	1
+/dev/${ROOTFS_DEV}	/		${ROOTFS_TYPE}		defaults		0	0
 proc		/proc		proc		nosuid,noexec,nodev	0	0
 sysfs		/sys		sysfs		nosuid,noexec,nodev	0	0
 devpts		/dev/pts	devpts		gid=5,mode=620		0	0
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 07/16] isar-image-base: Use generic parameters for rootfs entry in fstab
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (5 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 06/16] isar-image-base: Disable rootfs check by default Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 08/16] meta: Remove ROOTFS_TYPE Jan Kiszka
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

No need anymore to require exact information. The kernel already knows
which device is behind the rootfs, and we mount can guess the
filesystem. The fsck topic will be addressed later.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/recipes-core/images/isar-image-base.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 36bf11f..13d0e71 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -32,7 +32,7 @@ do_rootfs[root_cleandirs] = "${IMAGE_ROOTFS} \
 do_rootfs() {
     cat > ${WORKDIR}/fstab << EOF
 # Begin /etc/fstab
-/dev/${ROOTFS_DEV}	/		${ROOTFS_TYPE}		defaults		0	0
+/dev/root	/		auto		defaults		0	0
 proc		/proc		proc		nosuid,noexec,nodev	0	0
 sysfs		/sys		sysfs		nosuid,noexec,nodev	0	0
 devpts		/dev/pts	devpts		gid=5,mode=620		0	0
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 08/16] meta: Remove ROOTFS_TYPE
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (6 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 07/16] isar-image-base: Use generic parameters for rootfs entry in fstab Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 09/16] start_vm: Rename QEMU_ROOTFS_DEV to QEMU_DISK_ARGS Jan Kiszka
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

No longer used.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/ext4-img.bbclass | 2 --
 meta/classes/wic-img.bbclass  | 2 --
 2 files changed, 4 deletions(-)

diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index d19d036..78036a2 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -1,8 +1,6 @@
 # This software is a part of ISAR.
 # Copyright (C) 2015-2017 ilbers GmbH
 
-ROOTFS_TYPE = "ext4"
-
 EXT4_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img"
 
 do_ext4_image[stamp-extra-info] = "${DISTRO}-${MACHINE}"
diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 635fbbf..475326d 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -9,8 +9,6 @@ python () {
         bb.fatal("WKS_FILE must be set")
 }
 
-ROOTFS_TYPE ?= "ext4"
-
 STAGING_DATADIR ?= "/usr/lib/"
 STAGING_LIBDIR ?= "/usr/lib/"
 STAGING_DIR ?= "${TMPDIR}"
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 09/16] start_vm: Rename QEMU_ROOTFS_DEV to QEMU_DISK_ARGS
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (7 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 08/16] meta: Remove ROOTFS_TYPE Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 10/16] start_vm: Rename ROOTFS_DEV to QEMU_ROOTFS_DEV Jan Kiszka
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

This describes better what the variable contains and frees the name for
the real QEMU-related ROOTFS_DEV.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/conf/multiconfig/qemuamd64-buster.conf  | 2 +-
 meta-isar/conf/multiconfig/qemuamd64-jessie.conf  | 2 +-
 meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 2 +-
 meta-isar/conf/multiconfig/qemuarm-buster.conf    | 2 +-
 meta-isar/conf/multiconfig/qemuarm-jessie.conf    | 2 +-
 meta-isar/conf/multiconfig/qemuarm-stretch.conf   | 2 +-
 meta-isar/conf/multiconfig/qemuarm-wheezy.conf    | 2 +-
 meta-isar/conf/multiconfig/qemuarm64-buster.conf  | 2 +-
 meta-isar/conf/multiconfig/qemuarm64-stretch.conf | 2 +-
 meta-isar/conf/multiconfig/qemui386-buster.conf   | 2 +-
 meta-isar/conf/multiconfig/qemui386-jessie.conf   | 2 +-
 meta-isar/conf/multiconfig/qemui386-stretch.conf  | 2 +-
 scripts/start_vm                                  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster.conf b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
index 404f48a..90bb0d1 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
@@ -18,4 +18,4 @@ ROOTFS_DEV ?= "sda2"
 QEMU_ARCH ?= "x86_64"
 QEMU_MACHINE ?= "q35"
 QEMU_CPU ?= ""
-QEMU_ROOTFS_DEV ?= "-hda ##ROOTFS_IMAGE## -bios /usr/local/share/ovmf/OVMF.fd"
+QEMU_DISK_ARGS ?= "-hda ##ROOTFS_IMAGE## -bios /usr/local/share/ovmf/OVMF.fd"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
index b422008..65167a9 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
@@ -13,4 +13,4 @@ ROOTFS_DEV ?= "sda"
 QEMU_ARCH ?= "x86_64"
 QEMU_MACHINE ?= "pc"
 QEMU_CPU ?= ""
-QEMU_ROOTFS_DEV ?= "-hda ##ROOTFS_IMAGE##"
+QEMU_DISK_ARGS ?= "-hda ##ROOTFS_IMAGE##"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index 3d1ef28..3592cdc 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -19,4 +19,4 @@ ROOTFS_DEV ?= "sda2"
 QEMU_ARCH ?= "x86_64"
 QEMU_MACHINE ?= "q35"
 QEMU_CPU ?= ""
-QEMU_ROOTFS_DEV ?= "-hda ##ROOTFS_IMAGE## -bios /usr/local/share/ovmf/OVMF.fd"
+QEMU_DISK_ARGS ?= "-hda ##ROOTFS_IMAGE## -bios /usr/local/share/ovmf/OVMF.fd"
diff --git a/meta-isar/conf/multiconfig/qemuarm-buster.conf b/meta-isar/conf/multiconfig/qemuarm-buster.conf
index 003f7c4..aa80ad6 100644
--- a/meta-isar/conf/multiconfig/qemuarm-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-buster.conf
@@ -15,4 +15,4 @@ QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "virt"
 QEMU_CPU ?= "cortex-a15"
 # TODO: start_vm doesn't support multiline vars
-QEMU_ROOTFS_DEV ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
+QEMU_DISK_ARGS ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index fe1d760..0735d95 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -21,4 +21,4 @@ QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "virt"
 QEMU_CPU ?= "cortex-a15"
 # TODO: start_vm doesn't support multiline vars
-QEMU_ROOTFS_DEV ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
+QEMU_DISK_ARGS ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index 00cdaa0..db74cb6 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -16,4 +16,4 @@ QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "virt"
 QEMU_CPU ?= "cortex-a15"
 # TODO: start_vm doesn't support multiline vars
-QEMU_ROOTFS_DEV ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
+QEMU_DISK_ARGS ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index c573254..5498652 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -20,4 +20,4 @@ ROOTFS_DEV ?= "mmcblk0"
 QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "vexpress-a9"
 QEMU_CPU ?= ""
-QEMU_ROOTFS_DEV ?= "-sd ##ROOTFS_IMAGE##"
+QEMU_DISK_ARGS ?= "-sd ##ROOTFS_IMAGE##"
diff --git a/meta-isar/conf/multiconfig/qemuarm64-buster.conf b/meta-isar/conf/multiconfig/qemuarm64-buster.conf
index 80b88f2..6e037ed 100644
--- a/meta-isar/conf/multiconfig/qemuarm64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuarm64-buster.conf
@@ -17,4 +17,4 @@ QEMU_ARCH ?= "aarch64"
 QEMU_MACHINE ?= "virt"
 QEMU_CPU ?= "cortex-a57"
 # TODO: start_vm doesn't support multiline vars
-QEMU_ROOTFS_DEV ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
+QEMU_DISK_ARGS ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
diff --git a/meta-isar/conf/multiconfig/qemuarm64-stretch.conf b/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
index cffdcdb..ee8f35e 100644
--- a/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
@@ -17,4 +17,4 @@ QEMU_ARCH ?= "aarch64"
 QEMU_MACHINE ?= "virt"
 QEMU_CPU ?= "cortex-a57"
 # TODO: start_vm doesn't support multiline vars
-QEMU_ROOTFS_DEV ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
+QEMU_DISK_ARGS ?= "-drive file=##ROOTFS_IMAGE##,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
diff --git a/meta-isar/conf/multiconfig/qemui386-buster.conf b/meta-isar/conf/multiconfig/qemui386-buster.conf
index 279d321..be89001 100644
--- a/meta-isar/conf/multiconfig/qemui386-buster.conf
+++ b/meta-isar/conf/multiconfig/qemui386-buster.conf
@@ -18,4 +18,4 @@ ROOTFS_DEV ?= "sda2"
 QEMU_ARCH ?= "i386"
 QEMU_MACHINE ?= "pc"
 QEMU_CPU ?= ""
-QEMU_ROOTFS_DEV ?= "-hda ##ROOTFS_IMAGE##"
+QEMU_DISK_ARGS ?= "-hda ##ROOTFS_IMAGE##"
diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
index e8c81fb..33d515c 100644
--- a/meta-isar/conf/multiconfig/qemui386-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemui386-jessie.conf
@@ -13,4 +13,4 @@ ROOTFS_DEV ?= "sda"
 QEMU_ARCH ?= "i386"
 QEMU_MACHINE ?= "pc"
 QEMU_CPU ?= ""
-QEMU_ROOTFS_DEV ?= "-hda ##ROOTFS_IMAGE##"
+QEMU_DISK_ARGS ?= "-hda ##ROOTFS_IMAGE##"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index 6f3041b..7df80f5 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -19,4 +19,4 @@ ROOTFS_DEV ?= "sda2"
 QEMU_ARCH ?= "i386"
 QEMU_MACHINE ?= "pc"
 QEMU_CPU ?= ""
-QEMU_ROOTFS_DEV ?= "-hda ##ROOTFS_IMAGE##"
+QEMU_DISK_ARGS ?= "-hda ##ROOTFS_IMAGE##"
diff --git a/scripts/start_vm b/scripts/start_vm
index 5d6556d..5be348a 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -17,7 +17,7 @@ bb2sh() {
 }
 
 start_qemu() {
-    root=`echo $QEMU_ROOTFS_DEV \
+    root=`echo $QEMU_DISK_ARGS \
         | sed 's,##ROOTFS_IMAGE##,'$IMAGE_DIR/$ROOTFS_IMAGE','`
     local had_x
     echo $- | grep -q x && had_x=1 || had_x=0
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 10/16] start_vm: Rename ROOTFS_DEV to QEMU_ROOTFS_DEV
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (8 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 09/16] start_vm: Rename QEMU_ROOTFS_DEV to QEMU_DISK_ARGS Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 11/16] RECIPE-API-CHANGELOG: Add ROOTFS_DEV/TYPE removal Jan Kiszka
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

The old ROOTFS_DEV variable is now only used for start_vm. Rename it to
clarify the scope. Drop it from configs that use wic images or do not
support QEMU anyway.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/conf/multiconfig/bananapi-stretch.conf  | 2 --
 meta-isar/conf/multiconfig/qemuamd64-buster.conf  | 2 --
 meta-isar/conf/multiconfig/qemuamd64-jessie.conf  | 2 +-
 meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 2 --
 meta-isar/conf/multiconfig/qemuarm-buster.conf    | 2 +-
 meta-isar/conf/multiconfig/qemuarm-jessie.conf    | 2 +-
 meta-isar/conf/multiconfig/qemuarm-stretch.conf   | 2 +-
 meta-isar/conf/multiconfig/qemuarm-wheezy.conf    | 2 +-
 meta-isar/conf/multiconfig/qemuarm64-buster.conf  | 2 +-
 meta-isar/conf/multiconfig/qemuarm64-stretch.conf | 2 +-
 meta-isar/conf/multiconfig/qemui386-buster.conf   | 2 --
 meta-isar/conf/multiconfig/qemui386-jessie.conf   | 2 +-
 meta-isar/conf/multiconfig/qemui386-stretch.conf  | 2 --
 meta-isar/conf/multiconfig/rpi-jessie.conf        | 2 --
 scripts/start_vm                                  | 4 ++--
 15 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/meta-isar/conf/multiconfig/bananapi-stretch.conf b/meta-isar/conf/multiconfig/bananapi-stretch.conf
index b884b44..96cfffd 100644
--- a/meta-isar/conf/multiconfig/bananapi-stretch.conf
+++ b/meta-isar/conf/multiconfig/bananapi-stretch.conf
@@ -20,5 +20,3 @@ IMAGE_INSTALL += "u-boot-script"
 IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "bananapi"
 IMAGER_INSTALL += "u-boot-sunxi"
-
-ROOTFS_DEV ?= "mmcblk0p1"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster.conf b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
index 90bb0d1..a6fc40e 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
@@ -13,8 +13,6 @@ IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "sdimage-efi"
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
 
-ROOTFS_DEV ?= "sda2"
-
 QEMU_ARCH ?= "x86_64"
 QEMU_MACHINE ?= "q35"
 QEMU_CPU ?= ""
diff --git a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
index 65167a9..ca00e15 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-jessie.conf
@@ -8,7 +8,7 @@ DISTRO_ARCH ?= "amd64"
 
 KERNEL_NAME ?= "amd64"
 
-ROOTFS_DEV ?= "sda"
+QEMU_ROOTFS_DEV ?= "sda"
 
 QEMU_ARCH ?= "x86_64"
 QEMU_MACHINE ?= "pc"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index 3592cdc..632f3b5 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -14,8 +14,6 @@ IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "sdimage-efi"
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
 
-ROOTFS_DEV ?= "sda2"
-
 QEMU_ARCH ?= "x86_64"
 QEMU_MACHINE ?= "q35"
 QEMU_CPU ?= ""
diff --git a/meta-isar/conf/multiconfig/qemuarm-buster.conf b/meta-isar/conf/multiconfig/qemuarm-buster.conf
index aa80ad6..f9c97ec 100644
--- a/meta-isar/conf/multiconfig/qemuarm-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-buster.conf
@@ -9,7 +9,7 @@ KERNEL_NAME ?= "armmp"
 
 IMAGE_PREINSTALL += "init"
 
-ROOTFS_DEV ?= "vda"
+QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "virt"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index 0735d95..7001b05 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -15,7 +15,7 @@ DISTRO_ARCH ?= "armhf"
 
 KERNEL_NAME ?= "armmp"
 
-ROOTFS_DEV ?= "vda"
+QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "virt"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index db74cb6..3094d5b 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -10,7 +10,7 @@ KERNEL_NAME ?= "armmp"
 
 IMAGE_PREINSTALL += "init"
 
-ROOTFS_DEV ?= "vda"
+QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "virt"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index 5498652..19b9daa 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -15,7 +15,7 @@ DISTRO_ARCH ?= "armhf"
 
 KERNEL_NAME ?= "vexpress"
 
-ROOTFS_DEV ?= "mmcblk0"
+QEMU_ROOTFS_DEV ?= "mmcblk0"
 
 QEMU_ARCH ?= "arm"
 QEMU_MACHINE ?= "vexpress-a9"
diff --git a/meta-isar/conf/multiconfig/qemuarm64-buster.conf b/meta-isar/conf/multiconfig/qemuarm64-buster.conf
index 6e037ed..77141d1 100644
--- a/meta-isar/conf/multiconfig/qemuarm64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuarm64-buster.conf
@@ -11,7 +11,7 @@ KERNEL_NAME ?= "arm64"
 
 IMAGE_PREINSTALL += "init"
 
-ROOTFS_DEV ?= "vda"
+QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "aarch64"
 QEMU_MACHINE ?= "virt"
diff --git a/meta-isar/conf/multiconfig/qemuarm64-stretch.conf b/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
index ee8f35e..90b5a84 100644
--- a/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
@@ -11,7 +11,7 @@ KERNEL_NAME ?= "arm64"
 
 IMAGE_PREINSTALL += "init"
 
-ROOTFS_DEV ?= "vda"
+QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "aarch64"
 QEMU_MACHINE ?= "virt"
diff --git a/meta-isar/conf/multiconfig/qemui386-buster.conf b/meta-isar/conf/multiconfig/qemui386-buster.conf
index be89001..000769a 100644
--- a/meta-isar/conf/multiconfig/qemui386-buster.conf
+++ b/meta-isar/conf/multiconfig/qemui386-buster.conf
@@ -13,8 +13,6 @@ IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "directdisk-isar"
 IMAGER_INSTALL += "${SYSLINUX_BOOTLOADER_INSTALL}"
 
-ROOTFS_DEV ?= "sda2"
-
 QEMU_ARCH ?= "i386"
 QEMU_MACHINE ?= "pc"
 QEMU_CPU ?= ""
diff --git a/meta-isar/conf/multiconfig/qemui386-jessie.conf b/meta-isar/conf/multiconfig/qemui386-jessie.conf
index 33d515c..9db9f8c 100644
--- a/meta-isar/conf/multiconfig/qemui386-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemui386-jessie.conf
@@ -8,7 +8,7 @@ DISTRO_ARCH ?= "i386"
 
 KERNEL_NAME ?= "686-pae"
 
-ROOTFS_DEV ?= "sda"
+QEMU_ROOTFS_DEV ?= "sda"
 
 QEMU_ARCH ?= "i386"
 QEMU_MACHINE ?= "pc"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index 7df80f5..6586947 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -14,8 +14,6 @@ IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "directdisk-isar"
 IMAGER_INSTALL += "${SYSLINUX_BOOTLOADER_INSTALL}"
 
-ROOTFS_DEV ?= "sda2"
-
 QEMU_ARCH ?= "i386"
 QEMU_MACHINE ?= "pc"
 QEMU_CPU ?= ""
diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
index fcc10d9..03c32e2 100644
--- a/meta-isar/conf/multiconfig/rpi-jessie.conf
+++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
@@ -31,5 +31,3 @@ IMAGE_PREINSTALL += " \
     traceroute \
     vim \
     "
-
-ROOTFS_DEV ?= "mmcblk0p2"
diff --git a/scripts/start_vm b/scripts/start_vm
index 5be348a..6492c54 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -109,7 +109,7 @@ readonly MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf
 eval "$(egrep 'MACHINE_SERIAL' $MACHINE_CONF |bb2sh)"
 
 readonly CONFIG_CONF=$ISARROOT/meta-isar/conf/multiconfig/qemu$ARCH-$DISTRO.conf
-eval "$(egrep 'ROOTFS_DEV|QEMU_' $CONFIG_CONF |bb2sh)"
+eval "$(egrep 'QEMU_' $CONFIG_CONF |bb2sh)"
 
 eval $(bitbake -e multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep "^IMAGE_TYPE=")
 case "$IMAGE_TYPE" in
@@ -124,7 +124,7 @@ case "$IMAGE_TYPE" in
     EXTRA_ARGS="$EXTRA_ARGS \
 	-kernel $QKERNEL \
 	-initrd $QINITRD"
-    KARGS="console=$MACHINE_SERIAL root=/dev/$ROOTFS_DEV rw"
+    KARGS="console=$MACHINE_SERIAL root=/dev/$QEMU_ROOTFS_DEV rw"
     ;;
     wic-img)
     readonly ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.wic.img
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 11/16] RECIPE-API-CHANGELOG: Add ROOTFS_DEV/TYPE removal
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (9 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 10/16] start_vm: Rename ROOTFS_DEV to QEMU_ROOTFS_DEV Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 12/16] meta: Add expand-on-first-boot support package Jan Kiszka
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 RECIPE-API-CHANGELOG.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 601fc6b..69c36fa 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -57,3 +57,10 @@ If the top-layer is managed in git, set `LAYERDIR_mylayer = "${LAYERDIR}"` in
                             --match 'v[0-9].[0-9]*'"
 
 in the image recipe (or `isar-image-base.bbappend`) of that layer.
+
+### ROOTFS_DEV and ROOTFS_TYPE no longer needed
+
+These variables can be removed from own machine.conf or multiconfig files.
+
+If you want to enable support for QEMU in your config (start_vm), specify the
+`QEMU_ROOTFS_DEV` and `QEMU_DISK_ARGS` instead.
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 12/16] meta: Add expand-on-first-boot support package
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (10 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 11/16] RECIPE-API-CHANGELOG: Add ROOTFS_DEV/TYPE removal Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-12 13:46   ` Henning Schild
  2018-09-11 12:05 ` [PATCH 13/16] image: Limit ROOTFS_EXTRA to non-wic image type Jan Kiszka
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

When installed, this systemd service expands the last partition on a the
boot medium to the full size of that medium. It then deactivates itself.

Based on sysvinit version by Henning Schild.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../expand-on-first-boot/expand-on-first-boot.bb   | 25 +++++++++++++++++
 .../files/expand-last-partition.sh                 | 31 ++++++++++++++++++++++
 .../files/expand-on-first-boot.service             | 23 ++++++++++++++++
 .../expand-on-first-boot/files/postinst            |  3 +++
 4 files changed, 82 insertions(+)
 create mode 100644 meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
 create mode 100644 meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
 create mode 100644 meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
 create mode 100644 meta/recipes-support/expand-on-first-boot/files/postinst

diff --git a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
new file mode 100644
index 0000000..49d6c3b
--- /dev/null
+++ b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
@@ -0,0 +1,25 @@
+# Resize last partition to full medium size on fist boot
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg-raw
+
+DESCRIPTION = "This service grows the last partition to the full medium during first boot"
+
+DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, util-linux"
+
+SRC_URI = " \
+    file://expand-on-first-boot.service \
+    file://expand-last-partition.sh \
+    file://postinst"
+
+do_install() {
+    install -d -m 755 ${D}/lib/systemd/system
+    install -m 644 ${WORKDIR}/expand-on-first-boot.service ${D}/lib/systemd/system/
+
+    install -d -m 755 ${D}/usr/share/expand-on-first-boot
+    install -m 755 ${WORKDIR}/expand-last-partition.sh ${D}/usr/share/expand-on-first-boot/
+}
diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
new file mode 100644
index 0000000..913e63b
--- /dev/null
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Resize last partition to full medium size
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+set -e
+
+ROOT_DEV=$(findmnt / -o source -n)
+BOOT_DEV=$(echo ${ROOT_DEV} | sed 's/p\?[0-9]*$//')
+
+if [ "${ROOT_DEV}" = "${BOOT_DEV}" ]; then
+	echo "Boot device equals root device - no partitioning found" >&2
+	exit 1
+fi
+
+LAST_PART=$(sfdisk -d ${BOOT_DEV} 2>/dev/null | tail -1 | cut -d ' ' -f 1)
+
+# Remove all hints to the current medium (last-lba) and last partition size,
+# then ask sfdisk to recreate the partitioning
+sfdisk -d ${BOOT_DEV} 2>/dev/null | grep -v last-lba | \
+	sed 's|\('${LAST_PART}' .*, \)size=[^,]*, |\1|' | \
+	sfdisk --force ${BOOT_DEV}
+
+# Inform the kernel about the partitioning change
+partx -u ${LAST_PART}
+
+resize2fs ${LAST_PART}
diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
new file mode 100644
index 0000000..cbe3857
--- /dev/null
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
@@ -0,0 +1,23 @@
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+[Unit]
+Description=Expand last partition
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=systemd-remount-fs.service
+Before=sysinit.target shutdown.target
+ConditionPathIsReadWrite=/etc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/share/expand-on-first-boot/expand-last-partition.sh
+ExecStartPost=-/bin/systemctl disable expand-on-first-boot.service
+StandardOutput=syslog
+StandardError=syslog
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta/recipes-support/expand-on-first-boot/files/postinst b/meta/recipes-support/expand-on-first-boot/files/postinst
new file mode 100644
index 0000000..a190b01
--- /dev/null
+++ b/meta/recipes-support/expand-on-first-boot/files/postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+systemctl enable expand-on-first-boot.service
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 13/16] image: Limit ROOTFS_EXTRA to non-wic image type
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (11 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 12/16] meta: Add expand-on-first-boot support package Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 14/16] linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching Jan Kiszka
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

wic does its own extra-space / overhead-factor management, and the
proper interface for that is the wks file. However, keep the
ROOTFS_EXTRA for other image types.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/image.bbclass   | 12 ++++++------
 meta/classes/wic-img.bbclass |  3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index c251477..3f00806 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -7,6 +7,12 @@ IMAGE_ROOTFS   = "${WORKDIR}/rootfs"
 
 IMAGE_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}"
 
+# These variables are used by wic and start_vm
+KERNEL_IMAGE ?= "${@get_image_name(d, 'vmlinuz')[1]}"
+INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')[1]}"
+
+inherit ${IMAGE_TYPE}
+
 # Extra space for rootfs in MB
 ROOTFS_EXTRA ?= "64"
 
@@ -57,12 +63,6 @@ python set_image_size () {
     d.setVarFlag('ROOTFS_SIZE', 'export', '1')
 }
 
-# These variables are used by wic and start_vm
-KERNEL_IMAGE ?= "${@get_image_name(d, 'vmlinuz')[1]}"
-INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')[1]}"
-
-inherit ${IMAGE_TYPE}
-
 do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}"
 do_rootfs[depends] = "isar-apt:do_cache_config isar-bootstrap-target:do_bootstrap"
 
diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 475326d..3ac613c 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -9,6 +9,9 @@ python () {
         bb.fatal("WKS_FILE must be set")
 }
 
+# wic comes with reasonable defaults, and the proper interface is the wks file
+ROOTFS_EXTRA ?= "0"
+
 STAGING_DATADIR ?= "/usr/lib/"
 STAGING_LIBDIR ?= "/usr/lib/"
 STAGING_DIR ?= "${TMPDIR}"
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 14/16] linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (12 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 13/16] image: Limit ROOTFS_EXTRA to non-wic image type Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 15/16] meta-isar: Move init preinstallation into distro conf Jan Kiszka
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

The old mechanism tried to be too smart my deriving missing elements
when defining the PROVIDES of a custom kernel recipe from the currently
selected target KERNEL_NAME. But that broke when there was both a
linux-foo and a linux-foo-bar.

Let's make it straight and simple: A custom kernel recipe can control
the suffix "[-featureset]-flavor" of the generated linux-{image,headers}
meta packages by

 a) calling itself "linux-featureset-flavor"
 b) setting the variable KERNEL_NAME_PRODVIDED to "featureset-flavor"

Effectively, KERNEL_NAME is now matched against KERNEL_NAME_PRODVIDED
(in practice, the meta package names are matched). Actually, this is the
same logic that was already used for distro kernels.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 RECIPE-API-CHANGELOG.md                    |  8 ++++++++
 meta/recipes-kernel/linux/linux-custom.inc | 10 ++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 69c36fa..8d93ef4 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -64,3 +64,11 @@ These variables can be removed from own machine.conf or multiconfig files.
 
 If you want to enable support for QEMU in your config (start_vm), specify the
 `QEMU_ROOTFS_DEV` and `QEMU_DISK_ARGS` instead.
+
+### KERNEL_NAME_PROVIDED replaces KERNEL_FLAVOR in custom kernels
+
+The matching logic for custom kernel recipes to the selected kernel was
+reworked and simplified. If your kernel recipe is called `linux-foo_4.18.bb`,
+you now have to set `KERNEL_NAME = "foo"` in order to select that kernel.
+Alternatively, a recipe with a different naming scheme can set
+`KERNEL_NAME_PROVIDED = "foo"` in order to match as well.
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 4144b67..10a50c3 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -9,15 +9,13 @@ FILESPATH =. "${LAYERDIR_core}/recipes-kernel/linux/files:"
 
 DESCRIPTION ?= "Custom kernel"
 
-KERNEL_FLAVOR ?= "${@ d.getVar('PN', True).partition('linux-')[2]}"
+KERNEL_NAME_PRODVIDED ?= "${@ d.getVar('PN', True).partition('linux-')[2]}"
 KERNEL_DEFCONFIG ?= "defconfig"
 
 python() {
-    kernel = d.getVar("KERNEL_NAME", True)
-    flavor = d.getVar("KERNEL_FLAVOR", True)
-    if kernel and flavor and kernel.startswith(flavor + "-"):
-        d.setVar('PROVIDES', 'linux-image-' + kernel + ' ' + \
-                             'linux-headers-' + kernel)
+    kernel_name = d.getVar("KERNEL_NAME_PRODVIDED", True)
+    d.setVar('PROVIDES', 'linux-image-' + kernel_name + ' ' + \
+                         'linux-headers-' + kernel_name)
 }
 
 inherit dpkg-base
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 15/16] meta-isar: Move init preinstallation into distro conf
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (13 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 14/16] linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-11 12:05 ` [PATCH 16/16] meta: Add enable-fsck helper recipe Jan Kiszka
  2018-09-25 11:27 ` [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Maxim Yu. Osipov
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Since stretch, we need to install init explicitly in order to get a
bootable image. This is a distro property, nothing machine-specific. So
move it to the related distro confs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/conf/distro/debian-buster.conf          | 2 ++
 meta-isar/conf/distro/debian-stretch.conf         | 2 ++
 meta-isar/conf/multiconfig/bananapi-stretch.conf  | 2 --
 meta-isar/conf/multiconfig/qemuamd64-buster.conf  | 2 --
 meta-isar/conf/multiconfig/qemuamd64-stretch.conf | 2 --
 meta-isar/conf/multiconfig/qemuarm-buster.conf    | 2 --
 meta-isar/conf/multiconfig/qemuarm-stretch.conf   | 2 --
 meta-isar/conf/multiconfig/qemuarm64-buster.conf  | 2 --
 meta-isar/conf/multiconfig/qemuarm64-stretch.conf | 2 --
 meta-isar/conf/multiconfig/qemui386-buster.conf   | 2 --
 meta-isar/conf/multiconfig/qemui386-stretch.conf  | 2 --
 11 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/meta-isar/conf/distro/debian-buster.conf b/meta-isar/conf/distro/debian-buster.conf
index f3f843c..61367ef 100644
--- a/meta-isar/conf/distro/debian-buster.conf
+++ b/meta-isar/conf/distro/debian-buster.conf
@@ -7,4 +7,6 @@ DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
 DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-pae amd64 arm64 armmp \
     armmp-lpae cloud-amd64 loongson-3 marvell octeon powerpc64le s390x"
 
+IMAGE_PREINSTALL += "init"
+
 WIC_IMAGER_INSTALL += "python3-distutils"
diff --git a/meta-isar/conf/distro/debian-stretch.conf b/meta-isar/conf/distro/debian-stretch.conf
index cce5493..b3d2c2d 100644
--- a/meta-isar/conf/distro/debian-stretch.conf
+++ b/meta-isar/conf/distro/debian-stretch.conf
@@ -8,3 +8,5 @@ DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
 DISTRO_KERNELS ?= "4kc-malta 586 5kc-malta 686 686-pae amd64 arm64 armmp \
     armmp-lpae kirkwood loongson-3 marvell octeon orion5x powerpc64le \
     rt-686-pae rt-amd64 s390x"
+
+IMAGE_PREINSTALL += "init"
diff --git a/meta-isar/conf/multiconfig/bananapi-stretch.conf b/meta-isar/conf/multiconfig/bananapi-stretch.conf
index 96cfffd..7fafe69 100644
--- a/meta-isar/conf/multiconfig/bananapi-stretch.conf
+++ b/meta-isar/conf/multiconfig/bananapi-stretch.conf
@@ -10,8 +10,6 @@ DISTRO_ARCH ?= "armhf"
 
 KERNEL_NAME ?= "armmp"
 
-IMAGE_PREINSTALL += "init"
-
 DISTRO_APT_SOURCES_append = " conf/distro/debian-stretch-backports.list"
 DISTRO_APT_PREFERENCES += "conf/multiconfig/preferences.bananapi.conf"
 
diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster.conf b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
index a6fc40e..059ea00 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
@@ -7,8 +7,6 @@ DISTRO_ARCH ?= "amd64"
 
 KERNEL_NAME ?= "amd64"
 
-IMAGE_PREINSTALL += "init"
-
 IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "sdimage-efi"
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
index 632f3b5..f9d283c 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-stretch.conf
@@ -8,8 +8,6 @@ DISTRO_ARCH ?= "amd64"
 
 KERNEL_NAME ?= "amd64"
 
-IMAGE_PREINSTALL += "init"
-
 IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "sdimage-efi"
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
diff --git a/meta-isar/conf/multiconfig/qemuarm-buster.conf b/meta-isar/conf/multiconfig/qemuarm-buster.conf
index f9c97ec..bc84c8b 100644
--- a/meta-isar/conf/multiconfig/qemuarm-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-buster.conf
@@ -7,8 +7,6 @@ DISTRO_ARCH ?= "armhf"
 
 KERNEL_NAME ?= "armmp"
 
-IMAGE_PREINSTALL += "init"
-
 QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemuarm-stretch.conf b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
index 3094d5b..a2e3df1 100644
--- a/meta-isar/conf/multiconfig/qemuarm-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-stretch.conf
@@ -8,8 +8,6 @@ DISTRO_ARCH ?= "armhf"
 
 KERNEL_NAME ?= "armmp"
 
-IMAGE_PREINSTALL += "init"
-
 QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "arm"
diff --git a/meta-isar/conf/multiconfig/qemuarm64-buster.conf b/meta-isar/conf/multiconfig/qemuarm64-buster.conf
index 77141d1..40f1d41 100644
--- a/meta-isar/conf/multiconfig/qemuarm64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuarm64-buster.conf
@@ -9,8 +9,6 @@ DISTRO_ARCH ?= "arm64"
 
 KERNEL_NAME ?= "arm64"
 
-IMAGE_PREINSTALL += "init"
-
 QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "aarch64"
diff --git a/meta-isar/conf/multiconfig/qemuarm64-stretch.conf b/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
index 90b5a84..dcef370 100644
--- a/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemuarm64-stretch.conf
@@ -9,8 +9,6 @@ DISTRO_ARCH ?= "arm64"
 
 KERNEL_NAME ?= "arm64"
 
-IMAGE_PREINSTALL += "init"
-
 QEMU_ROOTFS_DEV ?= "vda"
 
 QEMU_ARCH ?= "aarch64"
diff --git a/meta-isar/conf/multiconfig/qemui386-buster.conf b/meta-isar/conf/multiconfig/qemui386-buster.conf
index 000769a..4216d85 100644
--- a/meta-isar/conf/multiconfig/qemui386-buster.conf
+++ b/meta-isar/conf/multiconfig/qemui386-buster.conf
@@ -7,8 +7,6 @@ DISTRO_ARCH ?= "i386"
 
 KERNEL_NAME ?= "686-pae"
 
-IMAGE_PREINSTALL += "init"
-
 IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "directdisk-isar"
 IMAGER_INSTALL += "${SYSLINUX_BOOTLOADER_INSTALL}"
diff --git a/meta-isar/conf/multiconfig/qemui386-stretch.conf b/meta-isar/conf/multiconfig/qemui386-stretch.conf
index 6586947..037ba23 100644
--- a/meta-isar/conf/multiconfig/qemui386-stretch.conf
+++ b/meta-isar/conf/multiconfig/qemui386-stretch.conf
@@ -8,8 +8,6 @@ DISTRO_ARCH ?= "i386"
 
 KERNEL_NAME ?= "686-pae"
 
-IMAGE_PREINSTALL += "init"
-
 IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "directdisk-isar"
 IMAGER_INSTALL += "${SYSLINUX_BOOTLOADER_INSTALL}"
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 16/16] meta: Add enable-fsck helper recipe
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (14 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 15/16] meta-isar: Move init preinstallation into distro conf Jan Kiszka
@ 2018-09-11 12:05 ` Jan Kiszka
  2018-09-25 11:27 ` [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Maxim Yu. Osipov
  16 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-11 12:05 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

This is a run-once systemd service that enables checks for all regular
filesystems on the target. We do this on the live system rather during
build because we only have the full information required for
populating the initramfs with the right tools available then - at least
as long as we do not want to patch much more.

Enable this feature in the demo local.conf by default because we have
read/write filesystems here.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/conf/local.conf.sample                   |  2 +-
 meta/recipes-support/enable-fsck/enable-fsck.bb    | 25 ++++++++++++++++++++++
 .../enable-fsck/files/enable-fsck.service          | 23 ++++++++++++++++++++
 .../enable-fsck/files/enable-fsck.sh               | 16 ++++++++++++++
 meta/recipes-support/enable-fsck/files/postinst    |  3 +++
 5 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/enable-fsck/enable-fsck.bb
 create mode 100644 meta/recipes-support/enable-fsck/files/enable-fsck.service
 create mode 100644 meta/recipes-support/enable-fsck/files/enable-fsck.sh
 create mode 100644 meta/recipes-support/enable-fsck/files/postinst

diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 769d853..92588fe 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -159,7 +159,7 @@ CONF_VERSION = "1"
 
 #
 # The default list of extra packages to be installed.
-IMAGE_INSTALL = "example-hello example-raw example-module"
+IMAGE_INSTALL = "example-hello example-raw example-module enable-fsck"
 
 #
 # Enable cross-compilation support
diff --git a/meta/recipes-support/enable-fsck/enable-fsck.bb b/meta/recipes-support/enable-fsck/enable-fsck.bb
new file mode 100644
index 0000000..0413f79
--- /dev/null
+++ b/meta/recipes-support/enable-fsck/enable-fsck.bb
@@ -0,0 +1,25 @@
+# Resize last partition to full medium size on fist boot
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg-raw
+
+DESCRIPTION = "This service enables fsck on first boot"
+
+DEBIAN_DEPENDS = "systemd, sed, mount, initramfs-tools"
+
+SRC_URI = " \
+    file://enable-fsck.service \
+    file://enable-fsck.sh \
+    file://postinst"
+
+do_install() {
+    install -d -m 755 ${D}/lib/systemd/system
+    install -m 644 ${WORKDIR}/enable-fsck.service ${D}/lib/systemd/system/
+
+    install -d -m 755 ${D}/usr/share/enable-fsck
+    install -m 755 ${WORKDIR}/enable-fsck.sh ${D}/usr/share/enable-fsck/
+}
diff --git a/meta/recipes-support/enable-fsck/files/enable-fsck.service b/meta/recipes-support/enable-fsck/files/enable-fsck.service
new file mode 100644
index 0000000..846497d
--- /dev/null
+++ b/meta/recipes-support/enable-fsck/files/enable-fsck.service
@@ -0,0 +1,23 @@
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+[Unit]
+Description=Enable fsck for mounted devices
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=systemd-remount-fs.service
+Before=sysinit.target shutdown.target
+ConditionPathIsReadWrite=/etc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/share/enable-fsck/enable-fsck.sh
+ExecStartPost=-/bin/systemctl disable enable-fsck.service
+StandardOutput=syslog
+StandardError=syslog
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta/recipes-support/enable-fsck/files/enable-fsck.sh b/meta/recipes-support/enable-fsck/files/enable-fsck.sh
new file mode 100644
index 0000000..b3dce44
--- /dev/null
+++ b/meta/recipes-support/enable-fsck/files/enable-fsck.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Update rootfs device in fstab, enable checks for all regular filesystems
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+set -e
+
+ROOT_DEV=$(/bin/findmnt -n -o SOURCE /)
+sed -i -e 's|^/dev/root\([ 	]\+.*[ 	]\+\)0[ 	]\+0|'$ROOT_DEV'\10	1|' \
+       -e 's|^\(/dev/.*[ 	]\+\)0[ 	]\+0|\10	2|' /etc/fstab
+
+update-initramfs -u
diff --git a/meta/recipes-support/enable-fsck/files/postinst b/meta/recipes-support/enable-fsck/files/postinst
new file mode 100644
index 0000000..1c4c3bd
--- /dev/null
+++ b/meta/recipes-support/enable-fsck/files/postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+systemctl enable enable-fsck.service
-- 
2.16.4


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 03/16] meta-isar: Fix bananapi root disk specification
  2018-09-11 12:05 ` [PATCH 03/16] meta-isar: Fix bananapi root disk specification Jan Kiszka
@ 2018-09-12  8:57   ` Henning Schild
  2018-09-12  8:59     ` Henning Schild
  0 siblings, 1 reply; 24+ messages in thread
From: Henning Schild @ 2018-09-12  8:57 UTC (permalink / raw)
  To: [ext] Jan Kiszka; +Cc: isar-users

Am Tue, 11 Sep 2018 14:05:43 +0200
schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:

> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> ...and remove the unneeded --ondisk parameter from the bootloader
> section.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  meta-isar/scripts/lib/wic/canned-wks/bananapi.wks | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
> b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks index
> d60868a..10cb7ae 100644 ---
> a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks +++
> b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks @@ -1,5 +1,5 @@
> -part u-boot --source rawcopy
> --sourceparams="file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin"
> --ondisk mmcblk --no-table --align 8 +part u-boot --source rawcopy
> --sourceparams="file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin"
> --no-table --align 8 -part / --source rootfs --ondisk mmcblk
> --fstype=ext4 --label platform --align 1024 +part / --source rootfs
> --ondisk mmcblk0 --fstype=ext4 --label platform --align 1024
> bootloader --append="rootwait"

You might want to drop the "=" for consistency, also with the previous
patch.

Henning

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 03/16] meta-isar: Fix bananapi root disk specification
  2018-09-12  8:57   ` Henning Schild
@ 2018-09-12  8:59     ` Henning Schild
  0 siblings, 0 replies; 24+ messages in thread
From: Henning Schild @ 2018-09-12  8:59 UTC (permalink / raw)
  To: [ext] Jan Kiszka; +Cc: isar-users

Am Wed, 12 Sep 2018 10:57:24 +0200
schrieb "[ext] Henning Schild" <henning.schild@siemens.com>:

> Am Tue, 11 Sep 2018 14:05:43 +0200
> schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
> 
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> > 
> > ...and remove the unneeded --ondisk parameter from the bootloader
> > section.
> > 
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > ---
> >  meta-isar/scripts/lib/wic/canned-wks/bananapi.wks | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks
> > b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks index
> > d60868a..10cb7ae 100644 ---
> > a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks +++
> > b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks @@ -1,5 +1,5 @@
> > -part u-boot --source rawcopy
> > --sourceparams="file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin"
> > --ondisk mmcblk --no-table --align 8 +part u-boot --source rawcopy
> > --sourceparams="file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin"
> > --no-table --align 8 -part / --source rootfs --ondisk mmcblk
> > --fstype=ext4 --label platform --align 1024 +part / --source rootfs
> > --ondisk mmcblk0 --fstype=ext4 --label platform --align 1024
> > bootloader --append="rootwait"  
> 
> You might want to drop the "=" for consistency, also with the previous
> patch.

Ok, i did not read the whole series ... The next commit does exactly
that.

Henning

> Henning
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 12/16] meta: Add expand-on-first-boot support package
  2018-09-11 12:05 ` [PATCH 12/16] meta: Add expand-on-first-boot support package Jan Kiszka
@ 2018-09-12 13:46   ` Henning Schild
  2018-09-13  8:33     ` Jan Kiszka
  0 siblings, 1 reply; 24+ messages in thread
From: Henning Schild @ 2018-09-12 13:46 UTC (permalink / raw)
  To: [ext] Jan Kiszka; +Cc: isar-users

Am Tue, 11 Sep 2018 14:05:52 +0200
schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:

> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> When installed, this systemd service expands the last partition on a
> the boot medium to the full size of that medium. It then deactivates
> itself.
> 
> Based on sysvinit version by Henning Schild.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  .../expand-on-first-boot/expand-on-first-boot.bb   | 25
> +++++++++++++++++ .../files/expand-last-partition.sh
> | 31
> ++++++++++++++++++++++ .../files/expand-on-first-boot.service
> | 23
> ++++++++++++++++ .../expand-on-first-boot/files/postinst
> |  3 +++ 4 files changed, 82 insertions(+) create mode 100644
> meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> create mode 100644
> meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> create mode 100644
> meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> create mode 100644
> meta/recipes-support/expand-on-first-boot/files/postinst
> 
> diff --git
> a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> new file mode 100644 index 0000000..49d6c3b --- /dev/null
> +++
> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> @@ -0,0 +1,25 @@ +# Resize last partition to full medium size on fist
> boot +#
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018
> +#
> +# SPDX-License-Identifier: MIT
> +
> +inherit dpkg-raw
> +
> +DESCRIPTION = "This service grows the last partition to the full
> medium during first boot" +
> +DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs,
> util-linux" +
> +SRC_URI = " \
> +    file://expand-on-first-boot.service \
> +    file://expand-last-partition.sh \
> +    file://postinst"
> +
> +do_install() {
> +    install -d -m 755 ${D}/lib/systemd/system
> +    install -m 644 ${WORKDIR}/expand-on-first-boot.service
> ${D}/lib/systemd/system/ +
> +    install -d -m 755 ${D}/usr/share/expand-on-first-boot
> +    install -m 755 ${WORKDIR}/expand-last-partition.sh
> ${D}/usr/share/expand-on-first-boot/ +}
> diff --git
> a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> new file mode 100644 index 0000000..913e63b --- /dev/null
> +++
> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> @@ -0,0 +1,31 @@ +#!/bin/sh
> +#
> +# Resize last partition to full medium size
> +#
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018
> +#
> +# SPDX-License-Identifier: MIT
> +
> +set -e
> +
> +ROOT_DEV=$(findmnt / -o source -n)
> +BOOT_DEV=$(echo ${ROOT_DEV} | sed 's/p\?[0-9]*$//')
> +
> +if [ "${ROOT_DEV}" = "${BOOT_DEV}" ]; then
> +	echo "Boot device equals root device - no partitioning
> found" >&2
> +	exit 1
> +fi
> +
> +LAST_PART=$(sfdisk -d ${BOOT_DEV} 2>/dev/null | tail -1 | cut -d ' '
> -f 1) +
> +# Remove all hints to the current medium (last-lba) and last
> partition size, +# then ask sfdisk to recreate the partitioning
> +sfdisk -d ${BOOT_DEV} 2>/dev/null | grep -v last-lba | \
> +	sed 's|\('${LAST_PART}' .*, \)size=[^,]*, |\1|' | \
> +	sfdisk --force ${BOOT_DEV}
> +
> +# Inform the kernel about the partitioning change
> +partx -u ${LAST_PART}
> +
> +resize2fs ${LAST_PART}
> diff --git
> a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> new file mode 100644 index 0000000..cbe3857 --- /dev/null
> +++
> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> @@ -0,0 +1,23 @@ +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018
> +#
> +# SPDX-License-Identifier: MIT
> +
> +[Unit]
> +Description=Expand last partition
> +DefaultDependencies=no
> +Conflicts=shutdown.target
> +After=systemd-remount-fs.service
> +Before=sysinit.target shutdown.target
> +ConditionPathIsReadWrite=/etc
> +
> +[Service]
> +Type=oneshot
> +RemainAfterExit=yes
> +ExecStart=/usr/share/expand-on-first-boot/expand-last-partition.sh
> +ExecStartPost=-/bin/systemctl disable expand-on-first-boot.service

Ok, this seems to be how you try to make sure this is done only once at
the first boot. Is this a hack or somehow documented in systemd? I just
read something about "ConditionFirstBoot=" in systemd.

Henning

> +StandardOutput=syslog
> +StandardError=syslog
> +
> +[Install]
> +WantedBy=sysinit.target
> diff --git a/meta/recipes-support/expand-on-first-boot/files/postinst
> b/meta/recipes-support/expand-on-first-boot/files/postinst new file
> mode 100644 index 0000000..a190b01
> --- /dev/null
> +++ b/meta/recipes-support/expand-on-first-boot/files/postinst
> @@ -0,0 +1,3 @@
> +#!/bin/sh
> +
> +systemctl enable expand-on-first-boot.service


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 12/16] meta: Add expand-on-first-boot support package
  2018-09-12 13:46   ` Henning Schild
@ 2018-09-13  8:33     ` Jan Kiszka
  2018-09-13  9:30       ` Henning Schild
  0 siblings, 1 reply; 24+ messages in thread
From: Jan Kiszka @ 2018-09-13  8:33 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

On 12.09.18 15:46, Henning Schild wrote:
> Am Tue, 11 Sep 2018 14:05:52 +0200
> schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
> 
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> When installed, this systemd service expands the last partition on a
>> the boot medium to the full size of that medium. It then deactivates
>> itself.
>>
>> Based on sysvinit version by Henning Schild.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>  .../expand-on-first-boot/expand-on-first-boot.bb   | 25
>> +++++++++++++++++ .../files/expand-last-partition.sh
>> | 31
>> ++++++++++++++++++++++ .../files/expand-on-first-boot.service
>> | 23
>> ++++++++++++++++ .../expand-on-first-boot/files/postinst
>> |  3 +++ 4 files changed, 82 insertions(+) create mode 100644
>> meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>> create mode 100644
>> meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>> create mode 100644
>> meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>> create mode 100644
>> meta/recipes-support/expand-on-first-boot/files/postinst
>>
>> diff --git
>> a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>> new file mode 100644 index 0000000..49d6c3b --- /dev/null
>> +++
>> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>> @@ -0,0 +1,25 @@ +# Resize last partition to full medium size on fist
>> boot +#
>> +# This software is a part of ISAR.
>> +# Copyright (c) Siemens AG, 2018
>> +#
>> +# SPDX-License-Identifier: MIT
>> +
>> +inherit dpkg-raw
>> +
>> +DESCRIPTION = "This service grows the last partition to the full
>> medium during first boot" +
>> +DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs,
>> util-linux" +
>> +SRC_URI = " \
>> +    file://expand-on-first-boot.service \
>> +    file://expand-last-partition.sh \
>> +    file://postinst"
>> +
>> +do_install() {
>> +    install -d -m 755 ${D}/lib/systemd/system
>> +    install -m 644 ${WORKDIR}/expand-on-first-boot.service
>> ${D}/lib/systemd/system/ +
>> +    install -d -m 755 ${D}/usr/share/expand-on-first-boot
>> +    install -m 755 ${WORKDIR}/expand-last-partition.sh
>> ${D}/usr/share/expand-on-first-boot/ +}
>> diff --git
>> a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>> new file mode 100644 index 0000000..913e63b --- /dev/null
>> +++
>> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>> @@ -0,0 +1,31 @@ +#!/bin/sh
>> +#
>> +# Resize last partition to full medium size
>> +#
>> +# This software is a part of ISAR.
>> +# Copyright (c) Siemens AG, 2018
>> +#
>> +# SPDX-License-Identifier: MIT
>> +
>> +set -e
>> +
>> +ROOT_DEV=$(findmnt / -o source -n)
>> +BOOT_DEV=$(echo ${ROOT_DEV} | sed 's/p\?[0-9]*$//')
>> +
>> +if [ "${ROOT_DEV}" = "${BOOT_DEV}" ]; then
>> +	echo "Boot device equals root device - no partitioning
>> found" >&2
>> +	exit 1
>> +fi
>> +
>> +LAST_PART=$(sfdisk -d ${BOOT_DEV} 2>/dev/null | tail -1 | cut -d ' '
>> -f 1) +
>> +# Remove all hints to the current medium (last-lba) and last
>> partition size, +# then ask sfdisk to recreate the partitioning
>> +sfdisk -d ${BOOT_DEV} 2>/dev/null | grep -v last-lba | \
>> +	sed 's|\('${LAST_PART}' .*, \)size=[^,]*, |\1|' | \
>> +	sfdisk --force ${BOOT_DEV}
>> +
>> +# Inform the kernel about the partitioning change
>> +partx -u ${LAST_PART}
>> +
>> +resize2fs ${LAST_PART}
>> diff --git
>> a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>> new file mode 100644 index 0000000..cbe3857 --- /dev/null
>> +++
>> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>> @@ -0,0 +1,23 @@ +# This software is a part of ISAR.
>> +# Copyright (c) Siemens AG, 2018
>> +#
>> +# SPDX-License-Identifier: MIT
>> +
>> +[Unit]
>> +Description=Expand last partition
>> +DefaultDependencies=no
>> +Conflicts=shutdown.target
>> +After=systemd-remount-fs.service
>> +Before=sysinit.target shutdown.target
>> +ConditionPathIsReadWrite=/etc
>> +
>> +[Service]
>> +Type=oneshot
>> +RemainAfterExit=yes
>> +ExecStart=/usr/share/expand-on-first-boot/expand-last-partition.sh
>> +ExecStartPost=-/bin/systemctl disable expand-on-first-boot.service
> 
> Ok, this seems to be how you try to make sure this is done only once at
> the first boot. Is this a hack or somehow documented in systemd? I just
> read something about "ConditionFirstBoot=" in systemd.

ConditionFirstBoot was my first try as well, but it does not work here because -
my guess, didn't analyze deeply - the debootstrap run or the rootfs installation
step count as such, and the condition is false on FirstRealBoot.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 12/16] meta: Add expand-on-first-boot support package
  2018-09-13  8:33     ` Jan Kiszka
@ 2018-09-13  9:30       ` Henning Schild
  2018-09-13 13:17         ` Jan Kiszka
  0 siblings, 1 reply; 24+ messages in thread
From: Henning Schild @ 2018-09-13  9:30 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: isar-users

Am Thu, 13 Sep 2018 10:33:59 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:

> On 12.09.18 15:46, Henning Schild wrote:
> > Am Tue, 11 Sep 2018 14:05:52 +0200
> > schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
> >   
> >> From: Jan Kiszka <jan.kiszka@siemens.com>
> >>
> >> When installed, this systemd service expands the last partition on
> >> a the boot medium to the full size of that medium. It then
> >> deactivates itself.
> >>
> >> Based on sysvinit version by Henning Schild.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> >> ---
> >>  .../expand-on-first-boot/expand-on-first-boot.bb   | 25
> >> +++++++++++++++++ .../files/expand-last-partition.sh
> >> | 31
> >> ++++++++++++++++++++++ .../files/expand-on-first-boot.service
> >> | 23
> >> ++++++++++++++++ .../expand-on-first-boot/files/postinst
> >> |  3 +++ 4 files changed, 82 insertions(+) create mode 100644
> >> meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> >> create mode 100644
> >> meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> >> create mode 100644
> >> meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> >> create mode 100644
> >> meta/recipes-support/expand-on-first-boot/files/postinst
> >>
> >> diff --git
> >> a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> >> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> >> new file mode 100644 index 0000000..49d6c3b --- /dev/null
> >> +++
> >> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
> >> @@ -0,0 +1,25 @@ +# Resize last partition to full medium size on
> >> fist boot +#
> >> +# This software is a part of ISAR.
> >> +# Copyright (c) Siemens AG, 2018
> >> +#
> >> +# SPDX-License-Identifier: MIT
> >> +
> >> +inherit dpkg-raw
> >> +
> >> +DESCRIPTION = "This service grows the last partition to the full
> >> medium during first boot" +
> >> +DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs,
> >> util-linux" +
> >> +SRC_URI = " \
> >> +    file://expand-on-first-boot.service \
> >> +    file://expand-last-partition.sh \
> >> +    file://postinst"
> >> +
> >> +do_install() {
> >> +    install -d -m 755 ${D}/lib/systemd/system
> >> +    install -m 644 ${WORKDIR}/expand-on-first-boot.service
> >> ${D}/lib/systemd/system/ +
> >> +    install -d -m 755 ${D}/usr/share/expand-on-first-boot
> >> +    install -m 755 ${WORKDIR}/expand-last-partition.sh
> >> ${D}/usr/share/expand-on-first-boot/ +}
> >> diff --git
> >> a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> >> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> >> new file mode 100644 index 0000000..913e63b --- /dev/null
> >> +++
> >> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
> >> @@ -0,0 +1,31 @@ +#!/bin/sh
> >> +#
> >> +# Resize last partition to full medium size
> >> +#
> >> +# This software is a part of ISAR.
> >> +# Copyright (c) Siemens AG, 2018
> >> +#
> >> +# SPDX-License-Identifier: MIT
> >> +
> >> +set -e
> >> +
> >> +ROOT_DEV=$(findmnt / -o source -n)
> >> +BOOT_DEV=$(echo ${ROOT_DEV} | sed 's/p\?[0-9]*$//')
> >> +
> >> +if [ "${ROOT_DEV}" = "${BOOT_DEV}" ]; then
> >> +	echo "Boot device equals root device - no partitioning
> >> found" >&2
> >> +	exit 1
> >> +fi
> >> +
> >> +LAST_PART=$(sfdisk -d ${BOOT_DEV} 2>/dev/null | tail -1 | cut -d
> >> ' ' -f 1) +
> >> +# Remove all hints to the current medium (last-lba) and last
> >> partition size, +# then ask sfdisk to recreate the partitioning
> >> +sfdisk -d ${BOOT_DEV} 2>/dev/null | grep -v last-lba | \
> >> +	sed 's|\('${LAST_PART}' .*, \)size=[^,]*, |\1|' | \
> >> +	sfdisk --force ${BOOT_DEV}
> >> +
> >> +# Inform the kernel about the partitioning change
> >> +partx -u ${LAST_PART}
> >> +
> >> +resize2fs ${LAST_PART}
> >> diff --git
> >> a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> >> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> >> new file mode 100644 index 0000000..cbe3857 --- /dev/null
> >> +++
> >> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
> >> @@ -0,0 +1,23 @@ +# This software is a part of ISAR.
> >> +# Copyright (c) Siemens AG, 2018
> >> +#
> >> +# SPDX-License-Identifier: MIT
> >> +
> >> +[Unit]
> >> +Description=Expand last partition
> >> +DefaultDependencies=no
> >> +Conflicts=shutdown.target
> >> +After=systemd-remount-fs.service
> >> +Before=sysinit.target shutdown.target
> >> +ConditionPathIsReadWrite=/etc
> >> +
> >> +[Service]
> >> +Type=oneshot
> >> +RemainAfterExit=yes
> >> +ExecStart=/usr/share/expand-on-first-boot/expand-last-partition.sh
> >> +ExecStartPost=-/bin/systemctl disable
> >> expand-on-first-boot.service  
> > 
> > Ok, this seems to be how you try to make sure this is done only
> > once at the first boot. Is this a hack or somehow documented in
> > systemd? I just read something about "ConditionFirstBoot=" in
> > systemd.  
> 
> ConditionFirstBoot was my first try as well, but it does not work
> here because - my guess, didn't analyze deeply - the debootstrap run
> or the rootfs installation step count as such, and the condition is
> false on FirstRealBoot.

I would suggest leaving a mark with "touch" from within the script and
using "ConditionPathExists=!", calling systemd from systemd sounds like
a bad idea. Unless that is the officialy documented way of doing such
things.

Henning

> Jan
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 12/16] meta: Add expand-on-first-boot support package
  2018-09-13  9:30       ` Henning Schild
@ 2018-09-13 13:17         ` Jan Kiszka
  0 siblings, 0 replies; 24+ messages in thread
From: Jan Kiszka @ 2018-09-13 13:17 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

On 13.09.18 11:30, Henning Schild wrote:
> Am Thu, 13 Sep 2018 10:33:59 +0200
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> 
>> On 12.09.18 15:46, Henning Schild wrote:
>>> Am Tue, 11 Sep 2018 14:05:52 +0200
>>> schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
>>>   
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> When installed, this systemd service expands the last partition on
>>>> a the boot medium to the full size of that medium. It then
>>>> deactivates itself.
>>>>
>>>> Based on sysvinit version by Henning Schild.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>> ---
>>>>  .../expand-on-first-boot/expand-on-first-boot.bb   | 25
>>>> +++++++++++++++++ .../files/expand-last-partition.sh
>>>> | 31
>>>> ++++++++++++++++++++++ .../files/expand-on-first-boot.service
>>>> | 23
>>>> ++++++++++++++++ .../expand-on-first-boot/files/postinst
>>>> |  3 +++ 4 files changed, 82 insertions(+) create mode 100644
>>>> meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>>>> create mode 100644
>>>> meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>>>> create mode 100644
>>>> meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>>>> create mode 100644
>>>> meta/recipes-support/expand-on-first-boot/files/postinst
>>>>
>>>> diff --git
>>>> a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>>>> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>>>> new file mode 100644 index 0000000..49d6c3b --- /dev/null
>>>> +++
>>>> b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>>>> @@ -0,0 +1,25 @@ +# Resize last partition to full medium size on
>>>> fist boot +#
>>>> +# This software is a part of ISAR.
>>>> +# Copyright (c) Siemens AG, 2018
>>>> +#
>>>> +# SPDX-License-Identifier: MIT
>>>> +
>>>> +inherit dpkg-raw
>>>> +
>>>> +DESCRIPTION = "This service grows the last partition to the full
>>>> medium during first boot" +
>>>> +DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs,
>>>> util-linux" +
>>>> +SRC_URI = " \
>>>> +    file://expand-on-first-boot.service \
>>>> +    file://expand-last-partition.sh \
>>>> +    file://postinst"
>>>> +
>>>> +do_install() {
>>>> +    install -d -m 755 ${D}/lib/systemd/system
>>>> +    install -m 644 ${WORKDIR}/expand-on-first-boot.service
>>>> ${D}/lib/systemd/system/ +
>>>> +    install -d -m 755 ${D}/usr/share/expand-on-first-boot
>>>> +    install -m 755 ${WORKDIR}/expand-last-partition.sh
>>>> ${D}/usr/share/expand-on-first-boot/ +}
>>>> diff --git
>>>> a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>>>> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>>>> new file mode 100644 index 0000000..913e63b --- /dev/null
>>>> +++
>>>> b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>>>> @@ -0,0 +1,31 @@ +#!/bin/sh
>>>> +#
>>>> +# Resize last partition to full medium size
>>>> +#
>>>> +# This software is a part of ISAR.
>>>> +# Copyright (c) Siemens AG, 2018
>>>> +#
>>>> +# SPDX-License-Identifier: MIT
>>>> +
>>>> +set -e
>>>> +
>>>> +ROOT_DEV=$(findmnt / -o source -n)
>>>> +BOOT_DEV=$(echo ${ROOT_DEV} | sed 's/p\?[0-9]*$//')
>>>> +
>>>> +if [ "${ROOT_DEV}" = "${BOOT_DEV}" ]; then
>>>> +	echo "Boot device equals root device - no partitioning
>>>> found" >&2
>>>> +	exit 1
>>>> +fi
>>>> +
>>>> +LAST_PART=$(sfdisk -d ${BOOT_DEV} 2>/dev/null | tail -1 | cut -d
>>>> ' ' -f 1) +
>>>> +# Remove all hints to the current medium (last-lba) and last
>>>> partition size, +# then ask sfdisk to recreate the partitioning
>>>> +sfdisk -d ${BOOT_DEV} 2>/dev/null | grep -v last-lba | \
>>>> +	sed 's|\('${LAST_PART}' .*, \)size=[^,]*, |\1|' | \
>>>> +	sfdisk --force ${BOOT_DEV}
>>>> +
>>>> +# Inform the kernel about the partitioning change
>>>> +partx -u ${LAST_PART}
>>>> +
>>>> +resize2fs ${LAST_PART}
>>>> diff --git
>>>> a/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>>>> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>>>> new file mode 100644 index 0000000..cbe3857 --- /dev/null
>>>> +++
>>>> b/meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>>>> @@ -0,0 +1,23 @@ +# This software is a part of ISAR.
>>>> +# Copyright (c) Siemens AG, 2018
>>>> +#
>>>> +# SPDX-License-Identifier: MIT
>>>> +
>>>> +[Unit]
>>>> +Description=Expand last partition
>>>> +DefaultDependencies=no
>>>> +Conflicts=shutdown.target
>>>> +After=systemd-remount-fs.service
>>>> +Before=sysinit.target shutdown.target
>>>> +ConditionPathIsReadWrite=/etc
>>>> +
>>>> +[Service]
>>>> +Type=oneshot
>>>> +RemainAfterExit=yes
>>>> +ExecStart=/usr/share/expand-on-first-boot/expand-last-partition.sh
>>>> +ExecStartPost=-/bin/systemctl disable
>>>> expand-on-first-boot.service  
>>>
>>> Ok, this seems to be how you try to make sure this is done only
>>> once at the first boot. Is this a hack or somehow documented in
>>> systemd? I just read something about "ConditionFirstBoot=" in
>>> systemd.  
>>
>> ConditionFirstBoot was my first try as well, but it does not work
>> here because - my guess, didn't analyze deeply - the debootstrap run
>> or the rootfs installation step count as such, and the condition is
>> false on FirstRealBoot.
> 
> I would suggest leaving a mark with "touch" from within the script and
> using "ConditionPathExists=!", calling systemd from systemd sounds like
> a bad idea. Unless that is the officialy documented way of doing such
> things.

I picked it up from the grub2-once service of my distro. Works without problems,
so I don't see a need to fall back to that inferior PathExists method.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper
  2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
                   ` (15 preceding siblings ...)
  2018-09-11 12:05 ` [PATCH 16/16] meta: Add enable-fsck helper recipe Jan Kiszka
@ 2018-09-25 11:27 ` Maxim Yu. Osipov
  16 siblings, 0 replies; 24+ messages in thread
From: Maxim Yu. Osipov @ 2018-09-25 11:27 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On 9/11/18 3:05 PM, Jan Kiszka wrote:
> Key features of this series:
>   - cleanup / fix / control of filesystem checks
>   - removal of ROOTFS_DEV and ROOTFS_TYPE
>   - wks file cleanups and corrections
>   - avoidance of ROOTFS_EXTRA for wic images
>   - fix for linux-custom.inc, allows to tell linux-cip and linux-cip-rt apart
>   - move IMAGE_PREINSTALL = "init" to distro conf
> 
> And then there is a new goody again: When adding expand-on-first-boot to
> IMAGE_INSTALL, this helper will expand the last partition of an image to
> the full size of the target medium. Very useful to generate small SD
> card images that become big once used on the target device. That's also
> what many images for maker boards include.

Applied to the 'next',

Thanks,
Maxim.

> Jan
> 
> Jan Kiszka (16):
>    meta-isar: Adjust kernel params in sdimage-efi.wks
>    meta-isar: Reduce grub timeout to 3 seconds
>    meta-isar: Fix bananapi root disk specification
>    meta-isar: Remove "=" after wic parameters
>    u-boot-script: Become independent of target /etc/fstab
>    isar-image-base: Disable rootfs check by default
>    isar-image-base: Use generic parameters for rootfs entry in fstab
>    meta: Remove ROOTFS_TYPE
>    start_vm: Rename QEMU_ROOTFS_DEV to QEMU_DISK_ARGS
>    start_vm: Rename ROOTFS_DEV to QEMU_ROOTFS_DEV
>    RECIPE-API-CHANGELOG: Add ROOTFS_DEV/TYPE removal
>    meta: Add expand-on-first-boot support package
>    image: Limit ROOTFS_EXTRA to non-wic image type
>    linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching
>    meta-isar: Move init preinstallation into distro conf
>    meta: Add enable-fsck helper recipe
> 
>   RECIPE-API-CHANGELOG.md                            | 15 ++++++
>   meta-isar/conf/distro/debian-buster.conf           |  2 +
>   meta-isar/conf/distro/debian-stretch.conf          |  2 +
>   meta-isar/conf/local.conf.sample                   |  2 +-
>   meta-isar/conf/multiconfig/bananapi-stretch.conf   |  4 --
>   meta-isar/conf/multiconfig/qemuamd64-buster.conf   |  6 +--
>   meta-isar/conf/multiconfig/qemuamd64-jessie.conf   |  4 +-
>   meta-isar/conf/multiconfig/qemuamd64-stretch.conf  |  6 +--
>   meta-isar/conf/multiconfig/qemuarm-buster.conf     |  6 +--
>   meta-isar/conf/multiconfig/qemuarm-jessie.conf     |  4 +-
>   meta-isar/conf/multiconfig/qemuarm-stretch.conf    |  6 +--
>   meta-isar/conf/multiconfig/qemuarm-wheezy.conf     |  4 +-
>   meta-isar/conf/multiconfig/qemuarm64-buster.conf   |  6 +--
>   meta-isar/conf/multiconfig/qemuarm64-stretch.conf  |  6 +--
>   meta-isar/conf/multiconfig/qemui386-buster.conf    |  6 +--
>   meta-isar/conf/multiconfig/qemui386-jessie.conf    |  4 +-
>   meta-isar/conf/multiconfig/qemui386-stretch.conf   |  6 +--
>   meta-isar/conf/multiconfig/rpi-jessie.conf         |  2 -
>   meta-isar/recipes-core/images/isar-image-base.bb   |  2 +-
>   meta-isar/scripts/lib/wic/canned-wks/bananapi.wks  |  6 +--
>   .../scripts/lib/wic/canned-wks/directdisk-isar.wks |  2 +-
>   .../scripts/lib/wic/canned-wks/sdimage-efi.wks     |  6 +--
>   meta/classes/ext4-img.bbclass                      |  2 -
>   meta/classes/image.bbclass                         | 12 ++---
>   meta/classes/wic-img.bbclass                       |  3 +-
>   meta/recipes-bsp/u-boot-script/files/u-boot-script |  7 ++-
>   .../u-boot-script/files/update-u-boot-script       | 12 +----
>   .../recipes-bsp/u-boot-script/u-boot-script_1.0.bb | 55 ++++++++++++++++++----
>   meta/recipes-kernel/linux/linux-custom.inc         | 10 ++--
>   meta/recipes-support/enable-fsck/enable-fsck.bb    | 25 ++++++++++
>   .../enable-fsck/files/enable-fsck.service          | 23 +++++++++
>   .../enable-fsck/files/enable-fsck.sh               | 16 +++++++
>   meta/recipes-support/enable-fsck/files/postinst    |  3 ++
>   .../expand-on-first-boot/expand-on-first-boot.bb   | 25 ++++++++++
>   .../files/expand-last-partition.sh                 | 31 ++++++++++++
>   .../files/expand-on-first-boot.service             | 23 +++++++++
>   .../expand-on-first-boot/files/postinst            |  3 ++
>   scripts/start_vm                                   |  6 +--
>   38 files changed, 264 insertions(+), 99 deletions(-)
>   create mode 100644 meta/recipes-support/enable-fsck/enable-fsck.bb
>   create mode 100644 meta/recipes-support/enable-fsck/files/enable-fsck.service
>   create mode 100644 meta/recipes-support/enable-fsck/files/enable-fsck.sh
>   create mode 100644 meta/recipes-support/enable-fsck/files/postinst
>   create mode 100644 meta/recipes-support/expand-on-first-boot/expand-on-first-boot.bb
>   create mode 100644 meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
>   create mode 100644 meta/recipes-support/expand-on-first-boot/files/expand-on-first-boot.service
>   create mode 100644 meta/recipes-support/expand-on-first-boot/files/postinst
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-09-25 11:28 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 12:05 [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Jan Kiszka
2018-09-11 12:05 ` [PATCH 01/16] meta-isar: Adjust kernel params in sdimage-efi.wks Jan Kiszka
2018-09-11 12:05 ` [PATCH 02/16] meta-isar: Reduce grub timeout to 3 seconds Jan Kiszka
2018-09-11 12:05 ` [PATCH 03/16] meta-isar: Fix bananapi root disk specification Jan Kiszka
2018-09-12  8:57   ` Henning Schild
2018-09-12  8:59     ` Henning Schild
2018-09-11 12:05 ` [PATCH 04/16] meta-isar: Remove "=" after wic parameters Jan Kiszka
2018-09-11 12:05 ` [PATCH 05/16] u-boot-script: Become independent of target /etc/fstab Jan Kiszka
2018-09-11 12:05 ` [PATCH 06/16] isar-image-base: Disable rootfs check by default Jan Kiszka
2018-09-11 12:05 ` [PATCH 07/16] isar-image-base: Use generic parameters for rootfs entry in fstab Jan Kiszka
2018-09-11 12:05 ` [PATCH 08/16] meta: Remove ROOTFS_TYPE Jan Kiszka
2018-09-11 12:05 ` [PATCH 09/16] start_vm: Rename QEMU_ROOTFS_DEV to QEMU_DISK_ARGS Jan Kiszka
2018-09-11 12:05 ` [PATCH 10/16] start_vm: Rename ROOTFS_DEV to QEMU_ROOTFS_DEV Jan Kiszka
2018-09-11 12:05 ` [PATCH 11/16] RECIPE-API-CHANGELOG: Add ROOTFS_DEV/TYPE removal Jan Kiszka
2018-09-11 12:05 ` [PATCH 12/16] meta: Add expand-on-first-boot support package Jan Kiszka
2018-09-12 13:46   ` Henning Schild
2018-09-13  8:33     ` Jan Kiszka
2018-09-13  9:30       ` Henning Schild
2018-09-13 13:17         ` Jan Kiszka
2018-09-11 12:05 ` [PATCH 13/16] image: Limit ROOTFS_EXTRA to non-wic image type Jan Kiszka
2018-09-11 12:05 ` [PATCH 14/16] linux-custom: Simplify and clarify KERNEL_NAME-to-recipe matching Jan Kiszka
2018-09-11 12:05 ` [PATCH 15/16] meta-isar: Move init preinstallation into distro conf Jan Kiszka
2018-09-11 12:05 ` [PATCH 16/16] meta: Add enable-fsck helper recipe Jan Kiszka
2018-09-25 11:27 ` [PATCH 00/16] Cleanups, linux-custom fix, auto-expansion helper Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox