From 1fa75fc9e4d0dc54fb6b250137f4ff39f0deb8fa Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 25 Jun 2012 12:59:06 +0000 Subject: SystemBuilder: fix mounting options fstab had errors=remount-ro, this is an ext option, btrfs doesn't support it. However it should be mounted noatime, to prevent the metadata trees being duplicated because they were read. extlinux.conf also has its mounting options changed so that the rootfs is mounted read-only initially. This should prevent the metadata trees being updated by reading them until it is remounted with noatime. --- morphlib/builder2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'morphlib') diff --git a/morphlib/builder2.py b/morphlib/builder2.py index d11ba97b..3139d619 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -584,7 +584,7 @@ class SystemBuilder(BuilderBase): # pragma: no cover with open(fstab, 'w') as f: f.write('proc /proc proc defaults 0 0\n') f.write('sysfs /sys sysfs defaults 0 0\n') - f.write('/dev/sda1 / btrfs errors=remount-ro 0 1\n') + f.write('/dev/sda1 / btrfs defaults,rw,noatime 0 1\n') def _create_extlinux_config(self, path): logging.debug('Creating extlinux.conf in %s' % path) @@ -596,7 +596,7 @@ class SystemBuilder(BuilderBase): # pragma: no cover f.write('label linux\n') f.write('kernel /boot/vmlinuz\n') f.write('append root=/dev/sda1 rootflags=subvol=factory-run ' - 'init=/sbin/init rw\n') + 'init=/sbin/init ro\n') def _create_subvolume_snapshot(self, path, source, target): logging.debug('Creating subvolume snapshot %s to %s' % -- cgit v1.2.1 From 6953c87c92d95bc6a895b931b0f54005b590a2ec Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 2 Jul 2012 15:41:34 +0100 Subject: CacheKeyComputer: increment compat-version This will prevent systems that don't have the right mount options being cache hits. Having fstab be in some System configuration morphology, which is also included in the cache key would prevent this being needed if the fstab format changes again. --- morphlib/cachekeycomputer.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'morphlib') diff --git a/morphlib/cachekeycomputer.py b/morphlib/cachekeycomputer.py index 720ec4c2..c2e7490a 100644 --- a/morphlib/cachekeycomputer.py +++ b/morphlib/cachekeycomputer.py @@ -96,6 +96,8 @@ class CacheKeyComputer(object): keys['morphology-sha1'] = checksum.hexdigest() if kind == 'stratum': keys['stratum-format-version'] = 1 + elif kind == 'system': + keys['system-compatibility-version'] = 1 return keys -- cgit v1.2.1