Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42d12fa98b |
@@ -1055,7 +1055,7 @@ config ARCH_QEMU
|
||||
imply DM_RNG
|
||||
imply DM_RTC
|
||||
imply RTC_PL031
|
||||
imply OF_HAS_PRIOR_STAGE if !TARGET_QEMU_ARM_SBSA
|
||||
imply OF_HAS_PRIOR_STAGE if !TARGET_QEMU_ARM_SBSA && !QEMU_MANUAL_DTB
|
||||
imply VIDEO
|
||||
imply VIDEO_BOCHS
|
||||
imply SYS_WHITE_ON_BLACK
|
||||
|
||||
@@ -13,3 +13,15 @@ config MTDPARTS_NOR1
|
||||
help
|
||||
This define the partition of nor1 used to build mtparts dynamically
|
||||
for the u-boot env stored on nor1.
|
||||
|
||||
config QEMU_MANUAL_DTB
|
||||
bool "Manually provide a device tree to QEMU"
|
||||
help
|
||||
For some use cases, such as FIT validation where a public key must be
|
||||
placed in U-Boot's device tree, we need to override the device tree
|
||||
that QEMU would normally provide to us.
|
||||
|
||||
Note: this work-around is necessary since Linaro has blocked
|
||||
addition of a feature to support additions to the QEMU devicetree:
|
||||
|
||||
Link: https://patchwork.kernel.org/project/qemu-devel/patch/20210926183410.256484-1-sjg@chromium.org/#24481799
|
||||
|
||||
@@ -46,3 +46,8 @@ You can then run qemu with the merged devicetree, e.g.::
|
||||
|
||||
Note that there seems to be a bug in some versions of qemu where the output of
|
||||
dumpdtb does not quite match what is provided to U-Boot.
|
||||
|
||||
See also the
|
||||
`rejected QEMU patch <https://patchwork.kernel.org/project/qemu-devel/patch/20231117021840.117874-1-sjg@chromium.org>`_
|
||||
and
|
||||
`discussion <https://patchwork.kernel.org/project/qemu-devel/patch/20210926183410.256484-1-sjg@chromium.org>`_.
|
||||
|
||||
@@ -737,13 +737,9 @@ static int cr50_i2c_report_state(struct udevice *dev, char *str, int str_max)
|
||||
|
||||
static int cr50_i2c_open(struct udevice *dev)
|
||||
{
|
||||
struct cr50_priv *priv = dev_get_priv(dev);
|
||||
char buf[80];
|
||||
int ret;
|
||||
|
||||
if (priv->locality != -1)
|
||||
return -EBUSY;
|
||||
|
||||
ret = process_reset(dev);
|
||||
if (ret)
|
||||
return log_msg_ret("reset", ret);
|
||||
|
||||
@@ -205,8 +205,13 @@ config OF_HAS_PRIOR_STAGE
|
||||
development purposes, but it is not recommended, and likely will not
|
||||
even work, for production systems.
|
||||
|
||||
Note: This option must be set in Kconfig and cannot be enabled or
|
||||
disabled in the board's defconfig file.
|
||||
Note: This option can be disabled for QEMU usiing QEMU_MANUAL_DTB thus
|
||||
allowing QEMU to support FIT validation, where the devicetree must
|
||||
include a public key.
|
||||
|
||||
See also this for context:
|
||||
|
||||
https://patchwork.kernel.org/project/qemu-devel/patch/20210926183410.256484-1-sjg@chromium.org/#24481799
|
||||
|
||||
config OF_OMIT_DTB
|
||||
bool "Omit the device tree output when building"
|
||||
|
||||
@@ -63,8 +63,7 @@ def prepare_patches(col, branch, count, start, end, ignore_binary, signoff,
|
||||
branch, start, to_do, ignore_binary, series, signoff)
|
||||
|
||||
# Fix up the patch files to our liking, and insert the cover letter
|
||||
patchstream.fix_patches(series, patch_files, keep_change_id,
|
||||
insert_base_commit=not cover_fname)
|
||||
patchstream.fix_patches(series, patch_files, keep_change_id)
|
||||
if cover_fname and series.get('cover'):
|
||||
patchstream.insert_cover_letter(cover_fname, series, to_do)
|
||||
return series, cover_fname, patch_files
|
||||
|
||||
@@ -357,31 +357,6 @@ Changes in v2:
|
||||
expected = expected.splitlines()
|
||||
self.assertEqual(expected, lines[start:(start+len(expected))])
|
||||
|
||||
def test_base_commit(self):
|
||||
"""Test adding a base commit with no cover letter"""
|
||||
orig_text = self._get_text('test01.txt')
|
||||
pos = orig_text.index('commit 5ab48490f03051875ab13d288a4bf32b507d76fd')
|
||||
text = orig_text[:pos]
|
||||
series = patchstream.get_metadata_for_test(text)
|
||||
series.base_commit = Commit('1a44532')
|
||||
series.branch = 'mybranch'
|
||||
cover_fname, args = self._create_patches_for_test(series)
|
||||
self.assertFalse(cover_fname)
|
||||
with capture_sys_output() as out:
|
||||
patchstream.fix_patches(series, args, insert_base_commit=True)
|
||||
self.assertEqual('Cleaned 1 patch\n', out[0].getvalue())
|
||||
lines = tools.read_file(args[0], binary=False).splitlines()
|
||||
pos = lines.index('-- ')
|
||||
|
||||
# We expect these lines at the end:
|
||||
# -- (with trailing space)
|
||||
# 2.7.4
|
||||
# (empty)
|
||||
# base-commit: xxx
|
||||
# branch: xxx
|
||||
self.assertEqual('base-commit: 1a44532', lines[pos + 3])
|
||||
self.assertEqual('branch: mybranch', lines[pos + 4])
|
||||
|
||||
def make_commit_with_file(self, subject, body, fname, text):
|
||||
"""Create a file and add it to the git repo with a new commit
|
||||
|
||||
@@ -552,11 +527,6 @@ complicated as possible''')
|
||||
self.assertEqual(f'base-commit: {base}', lines[0])
|
||||
self.assertEqual('branch: second', lines[1])
|
||||
|
||||
# Make sure that the base-commit is not present when it is in the
|
||||
# cover letter
|
||||
for fname in patch_files:
|
||||
self.assertNotIn(b'base-commit:', tools.read_file(fname))
|
||||
|
||||
# Check that it can skip patches at the end
|
||||
with capture_sys_output() as _:
|
||||
_, cover_fname, patch_files = control.prepare_patches(
|
||||
|
||||
@@ -76,13 +76,8 @@ class PatchStream:
|
||||
are interested in. We can also process a patch file in order to remove
|
||||
unwanted tags or inject additional ones. These correspond to the two
|
||||
phases of processing.
|
||||
|
||||
Args:
|
||||
keep_change_id (bool): Keep the Change-Id tag
|
||||
insert_base_commit (bool): True to add the base commit to the end
|
||||
"""
|
||||
def __init__(self, series, is_log=False, keep_change_id=False,
|
||||
insert_base_commit=False):
|
||||
def __init__(self, series, is_log=False, keep_change_id=False):
|
||||
self.skip_blank = False # True to skip a single blank line
|
||||
self.found_test = False # Found a TEST= line
|
||||
self.lines_after_test = 0 # Number of lines found after TEST=
|
||||
@@ -108,7 +103,6 @@ class PatchStream:
|
||||
self.recent_quoted = collections.deque([], 5)
|
||||
self.recent_unquoted = queue.Queue()
|
||||
self.was_quoted = None
|
||||
self.insert_base_commit = insert_base_commit
|
||||
|
||||
@staticmethod
|
||||
def process_text(text, is_comment=False):
|
||||
@@ -664,13 +658,6 @@ class PatchStream:
|
||||
outfd.write(line + '\n')
|
||||
self.blank_count = 0
|
||||
self.finalise()
|
||||
if self.insert_base_commit:
|
||||
if self.series.base_commit:
|
||||
print(f'base-commit: {self.series.base_commit.hash}',
|
||||
file=outfd)
|
||||
if self.series.branch:
|
||||
print(f'branch: {self.series.branch}', file=outfd)
|
||||
|
||||
|
||||
def insert_tags(msg, tags_to_emit):
|
||||
"""Add extra tags to a commit message
|
||||
@@ -791,8 +778,7 @@ def get_metadata_for_test(text):
|
||||
pst.finalise()
|
||||
return series
|
||||
|
||||
def fix_patch(backup_dir, fname, series, cmt, keep_change_id=False,
|
||||
insert_base_commit=False):
|
||||
def fix_patch(backup_dir, fname, series, cmt, keep_change_id=False):
|
||||
"""Fix up a patch file, by adding/removing as required.
|
||||
|
||||
We remove our tags from the patch file, insert changes lists, etc.
|
||||
@@ -806,7 +792,6 @@ def fix_patch(backup_dir, fname, series, cmt, keep_change_id=False,
|
||||
series (Series): Series information about this patch set
|
||||
cmt (Commit): Commit object for this patch file
|
||||
keep_change_id (bool): Keep the Change-Id tag.
|
||||
insert_base_commit (bool): True to add the base commit to the end
|
||||
|
||||
Return:
|
||||
list: A list of errors, each str, or [] if all ok.
|
||||
@@ -814,8 +799,7 @@ def fix_patch(backup_dir, fname, series, cmt, keep_change_id=False,
|
||||
handle, tmpname = tempfile.mkstemp()
|
||||
outfd = os.fdopen(handle, 'w', encoding='utf-8')
|
||||
infd = open(fname, 'r', encoding='utf-8')
|
||||
pst = PatchStream(series, keep_change_id=keep_change_id,
|
||||
insert_base_commit=insert_base_commit)
|
||||
pst = PatchStream(series, keep_change_id=keep_change_id)
|
||||
pst.commit = cmt
|
||||
pst.process_stream(infd, outfd)
|
||||
infd.close()
|
||||
@@ -827,7 +811,7 @@ def fix_patch(backup_dir, fname, series, cmt, keep_change_id=False,
|
||||
shutil.move(tmpname, fname)
|
||||
return cmt.warn
|
||||
|
||||
def fix_patches(series, fnames, keep_change_id=False, insert_base_commit=False):
|
||||
def fix_patches(series, fnames, keep_change_id=False):
|
||||
"""Fix up a list of patches identified by filenames
|
||||
|
||||
The patch files are processed in place, and overwritten.
|
||||
@@ -836,7 +820,6 @@ def fix_patches(series, fnames, keep_change_id=False, insert_base_commit=False):
|
||||
series (Series): The Series object
|
||||
fnames (:type: list of str): List of patch files to process
|
||||
keep_change_id (bool): Keep the Change-Id tag.
|
||||
insert_base_commit (bool): True to add the base commit to the end
|
||||
"""
|
||||
# Current workflow creates patches, so we shouldn't need a backup
|
||||
backup_dir = None #tempfile.mkdtemp('clean-patch')
|
||||
@@ -846,8 +829,7 @@ def fix_patches(series, fnames, keep_change_id=False, insert_base_commit=False):
|
||||
cmt.patch = fname
|
||||
cmt.count = count
|
||||
result = fix_patch(backup_dir, fname, series, cmt,
|
||||
keep_change_id=keep_change_id,
|
||||
insert_base_commit=insert_base_commit)
|
||||
keep_change_id=keep_change_id)
|
||||
if result:
|
||||
print('%d warning%s for %s:' %
|
||||
(len(result), 's' if len(result) > 1 else '', fname))
|
||||
|
||||
Reference in New Issue
Block a user