From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6677531658230431744 X-Received: by 2002:ac2:51a1:: with SMTP id f1mr1353801lfk.13.1554733994710; Mon, 08 Apr 2019 07:33:14 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:b04e:: with SMTP id d14ls1818518ljl.7.gmail; Mon, 08 Apr 2019 07:33:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbZJSUHV5GJ+3Y5MUCXW9HEBoNiAMhm3+CtrhYCpNGSl6cRN5WnfIfc6T3JhN+CB1OiGYv X-Received: by 2002:a2e:9c2:: with SMTP id 185mr1477003ljj.4.1554733994051; Mon, 08 Apr 2019 07:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554733994; cv=none; d=google.com; s=arc-20160816; b=WjNnrvZ6CFRESZoQbO5rOWCljsMsblUF5gCGegr+ULS/Rq717mFF6svndvvmObFUYR gDLpnyNWVyrBJ93xdhpiLHkUOAENpsPg6jqZYpTLC6+n6mYNRgqvMX178jHjNRaQ88T5 V4ZefN1WiyTPIjXGKucgftfIsTciBAKpfC3b1vlF32JokUy2aQ5ByFBSo6eeDl4Q+xpE zU2pLIyCJWVyI6lDjfDUBt+evPwsZdmzNwOhmc6w1v80FBC1GoMQrxQ+jEGBJAKBNveU 0nzCG7fZK8IMYAbi6j9eK6vSIZUdB6PSmTKpAzTnLqOho6OSYdRrtaNnBD1KbZKiPAXm d5hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=QhaFhuCsoRNOBgdK83RAFYWn/RXgYmXN+b2/6QzAINM=; b=tqzaS9TegGMWTEEyXUHAt5m0DXLfr3lKLSmw7uGF4vxEkMRA/18f7nXOWHsS+UOQwd 4mrkiW3Ohg1fTMjaXN9YHuq1GwiIthec8vjaenH1OgdDN0NrOt3zkTnCL/YnmfUDlupX eD3aPYJgA/woF3oBLsoNyWkXMGNQkLGRUJmBMEL4gfkaJYnAFYRSKRxkWhObcP3rGaNh rEY5TyWycd3Vgghf5u7d3kWGA/IeO0DjjidBws/kTCCWPXrNCWdWhfpIEfcJWFlbfHxx s1Rvdl724qnEcAT1bRHmNfVjOVsnHqE5qIAPVQpOfb+aq7dRA+JjSnGQVnYj5odzj8PJ lYfA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id t82si1558262lje.3.2019.04.08.07.33.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 07:33:14 -0700 (PDT) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x38EXDDE017268 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 8 Apr 2019 16:33:13 +0200 Received: from MD1ZFJVC.ad001.siemens.net ([139.25.68.236]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id x38EXD4l007451; Mon, 8 Apr 2019 16:33:13 +0200 From: Christian Storm To: isar-users@googlegroups.com Cc: Christian Storm Subject: [PATCH] expand-on-first-boot: Don't fail when using systemd mount units Date: Mon, 8 Apr 2019 16:33:09 +0200 Message-Id: <20190408143309.3614-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: GjUA++yvxL5x By default, resize2fs fails with the error message "Can't check if filesystem is mounted due to missing mtab file" if the to be resized filesystem isn't listed in mtab. This is the case, e.g., when using systemd mount units instead of /etc/fstab. Hence, selectively disable this safety check by exporting the environment variable EXT2FS_NO_MTAB_OK=1 [1]. [1] https://github.com/tytso/e2fsprogs/blob/master/lib/ext2fs/ismounted.c#L111 Signed-off-by: Christian Storm --- .../expand-on-first-boot/files/expand-last-partition.sh | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh 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 old mode 100644 new mode 100755 index 4cf90de..08c69db --- 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 @@ -28,4 +28,8 @@ sfdisk -d "${BOOT_DEV}" 2>/dev/null | grep -v last-lba | \ # Inform the kernel about the partitioning change partx -u "${LAST_PART}" +# Do not fail resize2fs if no mtab entry is found, e.g., +# when using systemd mount units. +export EXT2FS_NO_MTAB_OK=1 + resize2fs "${LAST_PART}" -- 2.21.0