summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-07 21:52:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-07 21:57:16 +0100
commit157a12d499ad83a2b3140d0524b8d664f7f4e154 (patch)
tree4ee2055600ad33491579056a3e90ed214a528919 /scripts
parent9a5aa31870ff1b35d19d9e17b57fc40acf4686cb (diff)
downloadpoky-157a12d499ad83a2b3140d0524b8d664f7f4e154.tar.gz
Revert "wic: Add --embed-rootfs argument"
This reverts commit efdcf94801f6abe8e4099e324d9a3deccd8d4384. After discussion on the mailing list it was felt these changes were not ready yet. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/help.py8
-rw-r--r--scripts/lib/wic/ksparser.py1
-rw-r--r--scripts/lib/wic/partition.py1
-rw-r--r--scripts/lib/wic/plugins/source/rootfs.py22
4 files changed, 1 insertions, 31 deletions
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index f1afd903ac..1e3d06a87b 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -980,14 +980,6 @@ DESCRIPTION
980 copies. This option only has an effect with the rootfs 980 copies. This option only has an effect with the rootfs
981 source plugin. 981 source plugin.
982 982
983 --embed-rootfs: This option is specific to wic. It embeds a rootfs into
984 the given path to the resulting image. The option
985 contains two fields, the roofs and the path, separated
986 by a space. The rootfs follows the same logic as the
987 rootfs-dir argument. Multiple options can be provided
988 in order to embed multiple rootfs. This option only has
989 an effect with the rootfs source plugin.
990
991 --extra-space: This option is specific to wic. It adds extra 983 --extra-space: This option is specific to wic. It adds extra
992 space after the space filled by the content 984 space after the space filled by the content
993 of the partition. The final size can go 985 of the partition. The final size can go
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 64c8c1175e..650b976223 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -138,7 +138,6 @@ class KickStart():
138 part.add_argument('--align', type=int) 138 part.add_argument('--align', type=int)
139 part.add_argument('--exclude-path', nargs='+') 139 part.add_argument('--exclude-path', nargs='+')
140 part.add_argument('--include-path', nargs='+') 140 part.add_argument('--include-path', nargs='+')
141 part.add_argument('--embed-rootfs', nargs=2, action='append')
142 part.add_argument("--extra-space", type=sizetype) 141 part.add_argument("--extra-space", type=sizetype)
143 part.add_argument('--fsoptions', dest='fsopts') 142 part.add_argument('--fsoptions', dest='fsopts')
144 part.add_argument('--fstype', default='vfat', 143 part.add_argument('--fstype', default='vfat',
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 13857df82f..2d95f78439 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -31,7 +31,6 @@ class Partition():
31 self.extra_space = args.extra_space 31 self.extra_space = args.extra_space
32 self.exclude_path = args.exclude_path 32 self.exclude_path = args.exclude_path
33 self.include_path = args.include_path 33 self.include_path = args.include_path
34 self.embed_rootfs = args.embed_rootfs
35 self.fsopts = args.fsopts 34 self.fsopts = args.fsopts
36 self.fstype = args.fstype 35 self.fstype = args.fstype
37 self.label = args.label 36 self.label = args.label
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
index 089aaea477..40419a64b3 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -17,7 +17,6 @@ import shutil
17import sys 17import sys
18 18
19from oe.path import copyhardlinktree, copytree 19from oe.path import copyhardlinktree, copytree
20from pathlib import Path
21 20
22from wic import WicError 21from wic import WicError
23from wic.pluginbase import SourcePlugin 22from wic.pluginbase import SourcePlugin
@@ -81,7 +80,7 @@ class RootfsPlugin(SourcePlugin):
81 80
82 new_rootfs = None 81 new_rootfs = None
83 # Handle excluded paths. 82 # Handle excluded paths.
84 if part.exclude_path or part.include_path or part.embed_rootfs: 83 if part.exclude_path or part.include_path:
85 # We need a new rootfs directory we can delete files from. Copy to 84 # We need a new rootfs directory we can delete files from. Copy to
86 # workdir. 85 # workdir.
87 new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno)) 86 new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno))
@@ -101,25 +100,6 @@ class RootfsPlugin(SourcePlugin):
101 for path in part.include_path or []: 100 for path in part.include_path or []:
102 copyhardlinktree(path, new_rootfs) 101 copyhardlinktree(path, new_rootfs)
103 102
104 for embed in part.embed_rootfs or []:
105 [embed_rootfs, path] = embed
106 #we need to remove the initial / for os.path.join to work
107 if os.path.isabs(path):
108 path = path[1:]
109 if embed_rootfs in krootfs_dir:
110 embed_rootfs = krootfs_dir[embed_rootfs]
111 embed_rootfs = cls.__get_rootfs_dir(embed_rootfs)
112 tar_file = os.path.realpath(os.path.join(cr_workdir, "aux.tar"))
113 tar_cmd = "%s tar cpf %s -C %s ." % (cls.__get_pseudo(native_sysroot,
114 embed_rootfs), tar_file, embed_rootfs)
115 exec_native_cmd(tar_cmd, native_sysroot)
116 untar_cmd = "%s tar xf %s -C %s ." % (cls.__get_pseudo(native_sysroot, new_rootfs),
117 tar_file, os.path.join(new_rootfs, path))
118 Path(os.path.join(new_rootfs, path)).mkdir(parents=True, exist_ok=True)
119 exec_native_cmd(untar_cmd, native_sysroot,
120 cls.__get_pseudo(native_sysroot, new_rootfs))
121 os.remove(tar_file)
122
123 for orig_path in part.exclude_path or []: 103 for orig_path in part.exclude_path or []:
124 path = orig_path 104 path = orig_path
125 if os.path.isabs(path): 105 if os.path.isabs(path):