diff options
| author | Maciej Borzecki <maciej.borzecki@open-rnd.pl> | 2014-07-24 14:27:16 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-26 09:01:05 +0100 |
| commit | 09def7a78c8b7488f0b6a4578f4bfa096fc3b0f1 (patch) | |
| tree | dbc672c921064ef4c55d25345fa51e9972a18286 /scripts/lib/mic | |
| parent | 56275905240384896990d4ecce55fb9e7bd17827 (diff) | |
| download | poky-09def7a78c8b7488f0b6a4578f4bfa096fc3b0f1.tar.gz | |
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.
(From OE-Core rev: a9e59d7b1fa1ed33ce9678fb77a367800d7a8f87)
Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/mic')
| -rw-r--r-- | scripts/lib/mic/imager/direct.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py index ebf77d666d..7e2b63a37c 100644 --- a/scripts/lib/mic/imager/direct.py +++ b/scripts/lib/mic/imager/direct.py | |||
| @@ -270,10 +270,12 @@ class DirectImageCreator(BaseImageCreator): | |||
| 270 | # when/if we need to actually do package selection we | 270 | # when/if we need to actually do package selection we |
| 271 | # should modify things to use those objects, but for now | 271 | # should modify things to use those objects, but for now |
| 272 | # we can avoid that. | 272 | # we can avoid that. |
| 273 | |||
| 274 | fstab = self.__write_fstab(self.rootfs_dir.get("ROOTFS_DIR")) | ||
| 275 | |||
| 273 | p.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir, | 276 | p.prepare(self, self.workdir, self.oe_builddir, self.rootfs_dir, |
| 274 | self.bootimg_dir, self.kernel_dir, self.native_sysroot) | 277 | self.bootimg_dir, self.kernel_dir, self.native_sysroot) |
| 275 | 278 | ||
| 276 | fstab = self.__write_fstab(p.get_rootfs()) | ||
| 277 | self._restore_fstab(fstab) | 279 | self._restore_fstab(fstab) |
| 278 | 280 | ||
| 279 | self.__instimage.add_partition(int(p.size), | 281 | self.__instimage.add_partition(int(p.size), |
| @@ -286,6 +288,7 @@ class DirectImageCreator(BaseImageCreator): | |||
| 286 | boot = p.active, | 288 | boot = p.active, |
| 287 | align = p.align, | 289 | align = p.align, |
| 288 | part_type = p.part_type) | 290 | part_type = p.part_type) |
| 291 | |||
| 289 | self.__instimage.layout_partitions(self._ptable_format) | 292 | self.__instimage.layout_partitions(self._ptable_format) |
| 290 | 293 | ||
| 291 | self.__imgdir = self.workdir | 294 | self.__imgdir = self.workdir |
