[oe-commits] Maciej Borzecki : wic: do not overwrite autogenerated /etc/ fstab with original too early
git at git.openembedded.org
git at git.openembedded.org
Sat Jul 26 08:07:16 UTC 2014
Module: openembedded-core.git
Branch: master-next
Commit: a9e59d7b1fa1ed33ce9678fb77a367800d7a8f87
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a9e59d7b1fa1ed33ce9678fb77a367800d7a8f87
Author: Maciej Borzecki <maciej.borzecki at open-rnd.pl>
Date: Thu Jul 24 14:27:16 2014 +0200
wic: do not overwrite autogenerated /etc/fstab with original too early
DirectImageCreator.__write_fstab() generates new /etc/fstab in sysroot
with rootfs contents. The fstab entries are generated base on the
initialn contents of /etc/fstab, plus any extra (other than / or
/boot) partitions listed in *.wks. A backup of original /etc/fstab is
done in a temp location. Subsequent call to __restore_fstab() restores
the backup copy, replacing the autogenerated one.
Calling __restore_fstab() before Wic_PartData.prepare() brings back the
original fstab before the partition image file actually is created. As
such, the autogenerated /etc/fstab will not make it to the partition.
Signed-off-by: Maciej Borzecki <maciej.borzecki at open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
scripts/lib/mic/imager/direct.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py
index ebf77d6..7e2b63a 100644
--- a/scripts/lib/mic/imager/direct.py
+++ b/scripts/lib/mic/imager/direct.py
@@ -270,10 +270,12 @@ class DirectImageCreator(BaseImageCreator):
# when/if we need to actually do package selection we
# should modify things to use those objects, but for now
# we can avoid that.
+
+ fstab = self.__write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+
p.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir,
self.bootimg_dir, self.kernel_dir, self.native_sysroot)
- fstab = self.__write_fstab(p.get_rootfs())
self._restore_fstab(fstab)
self.__instimage.add_partition(int(p.size),
@@ -286,6 +288,7 @@ class DirectImageCreator(BaseImageCreator):
boot = p.active,
align = p.align,
part_type = p.part_type)
+
self.__instimage.layout_partitions(self._ptable_format)
self.__imgdir = self.workdir
More information about the Openembedded-commits
mailing list