From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6924371667242188800 X-Received: by 2002:a2e:b8cc:: with SMTP id s12mr9276183ljp.221.1614611974144; Mon, 01 Mar 2021 07:19:34 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:bc11:: with SMTP id b17ls2867800ljf.7.gmail; Mon, 01 Mar 2021 07:19:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGPfMC9dwFi+Ghoa5vZ7qoy5/Esc4d5IBEashJwCW03lotj9DcxlrdJnsn07G6rzZZn+et X-Received: by 2002:a2e:3308:: with SMTP id d8mr476463ljc.100.1614611973150; Mon, 01 Mar 2021 07:19:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614611973; cv=none; d=google.com; s=arc-20160816; b=OAhVdeqaNbMYfEFpVJnZBLoieremTna/MptkzxwFOFV6zVx/cQ/7nnkpvG6UV8FfqW MXFB9zE760Rtb+GemLiB4zByt2ugDzYIDHPfC/dPl/E3upMH5wdIURj4BggHGDAqfz8b wIUtoTfb3CTcVy5k5cKlB0q7cfG9HczqtYKKsPIXxq3IMD8qQaX13tMEtnlLVl/N2bAE Xlu5NVo0M1xdYFCO3uHmUlFUWt2Vy8W2Z6ZWyvunIP4MUnyr7J7JqVXZZlHDdbN59IVC 8WxtfUuITcymMPV/ZDRvb56tnUczKnhvSQ17evZ0uD9G1hajU+f2ntKQSeDzIfp98lNV /+ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Fk2zx2Jp/LK9D20ffZmb3HN3ygZtvpJRT04WuhP8ASs=; b=wxkID85CYVmHCiQp9VJNZS5McSJ7CpTW7ALsvjUXPEvsL0XEoIvOVAArWFfMNGYYF5 9YJ+PHn4ZNSUm2TT55hBKsWwaZRPe1M1s+6TwrIN5VZTKgfa7+tx5IvNVZp4agK/OeGT Kx/hXOLOO+/cXe52O4Z2WGtwi1NXD1VTL5omMXxj+bLigtZLrj+K/bcMU5HMTOYn7cO0 u335U1clmgXChY8/gSn0CNq3PMGM7Ys8AdjmxruL4aGjTVX8BDULMtnOWDMXC2sCqjDN llU1kb0CYNKWX64cJspXfJj+9RCCqiIXH96eBtb0lBtrXFFRTumQNYcQs406xmdKSa9e qgdA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of florian.bezdeka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=florian.bezdeka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id a17si432425ljq.5.2021.03.01.07.19.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Mar 2021 07:19:33 -0800 (PST) Received-SPF: pass (google.com: domain of florian.bezdeka@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 florian.bezdeka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=florian.bezdeka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 121FJWYq027802 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Mar 2021 16:19:32 +0100 Received: from md2st94c.bbg.bezdeka.de ([167.87.0.232]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id 121FJVUT023372; Mon, 1 Mar 2021 16:19:32 +0100 From: Florian Bezdeka To: isar-users@googlegroups.com Cc: henning.schild@siemens.com, jan.kiszka@siemens.com, ibr@radix50.net, Florian Bezdeka Subject: [PATCH] wic: Warn if an ext filesystem affected by the Y2038 problem is used Date: Mon, 1 Mar 2021 16:18:23 +0100 Message-Id: <20210301151823.64574-1-florian.bezdeka@siemens.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210217115643.GD20742@yssyq.m.ilbers.de> References: <20210217115643.GD20742@yssyq.m.ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: aSnN2iShUtci This is the backport for upstream (openembedded-core) eecbe6255584 ("wic: Warn if an ext filesystem affected by the Y2038 problem is used") We are getting closer and closer to the year 2038 where the 32 bit time_t overflow will happen. While products (= embedded systems) with an expected life time of 15 years are still save the situation may change if your system has to survive the next 20 years. ext2 and ext3 filesystems are always affected by the time overflow, so let's warn the user if these filesystems are still being used. If ext4 is affected depends on the inode size chosen during filesystem creation. At least 256 bytes are necessary to be safe. As ext4 is used very often (and partitions may be created small first and extended later) this might be an issue for many users. Signed-off-by: Florian Bezdeka --- scripts/lib/wic/misc.py | 1 + scripts/lib/wic/partition.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py index 4b08d64..c4332d5 100644 --- a/scripts/lib/wic/misc.py +++ b/scripts/lib/wic/misc.py @@ -26,6 +26,7 @@ logger = logging.getLogger('wic') # executable -> recipe pairs for exec_native_cmd NATIVE_RECIPES = {"bmaptool": "bmap-tools", + "dumpe2fs": "e2fsprogs", "grub-mkimage": "grub-efi", "isohybrid": "syslinux", "mcopy": "mtools", diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index 4a5a31e..e6bcc9e 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py @@ -432,26 +432,25 @@ class Partition(): if part.mountpoint: args = [part.fstype, "mounted at %s" % part.mountpoint] elif part.label: - args = [part.fstype, "labeled %s" % part.label] + args = [part.fstype, "labeled '%s'" % part.label] elif part.part_name: - args = [part.fstype, "in partition %s" % part.part_name] + args = [part.fstype, "in partition '%s'" % part.part_name] else: - args = [part.fstype, ""] + args = [part.fstype, "in partition %s" % part.num] return err.format(*args) - ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot) - # ext2 and ext3 are always affected by the Y2038 problem if self.fstype in ["ext2", "ext3"]: logger.warn(get_err_str(self)) return + ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot) + # if ext4 is affected by the Y2038 problem depends on the inode size - # Remember: inode size depends on the file system size for line in out.splitlines(): if line.startswith("Inode size:"): size = int(line.split(":")[1].strip()) if size < 256: - logger.warn("%s Inodes (of size %d) are too small." % \ + logger.warn("%s Inodes (of size %d) are too small." % (get_err_str(self), size)) - break \ No newline at end of file + break -- 2.29.2