]> code.ossystems Code Review - openembedded-core.git/log
openembedded-core.git
4 years agoclasses/image_types_wic: Reorder do_flush_pseudodb
Ricardo Ribalda [Mon, 18 May 2020 10:22:04 +0000 (12:22 +0200)]
classes/image_types_wic: Reorder do_flush_pseudodb

When IMAGE_FSTYPES contains more types than wic, it can happen than the
pseudo database is not flushed properly.

This can be solved by changing the order of when do_flush_pseudodb is
launched.

Yocto Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13898
Fixes: dde90a5dd2b2 ("wic: Fix multi images .wks with bitbake")
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 445b0a9544b55735496bbb23dbff3399b3b9e9a4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agorng-tools: fix rngd_jitter initialization
Julien Massot [Wed, 3 Feb 2021 15:28:37 +0000 (16:28 +0100)]
rng-tools: fix rngd_jitter initialization

rngd daemon may spam the console when using an older version
than 6.11.

Backport patches from https://github.com/nhorman/rng-tools/pull/99/commits

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agosstatesig: Add descriptive error message to getpwuid/getgrgid "uid/gid not found...
Tomasz Dziendzielski [Mon, 1 Feb 2021 00:32:56 +0000 (01:32 +0100)]
sstatesig: Add descriptive error message to getpwuid/getgrgid "uid/gid not found" KeyError

If path is not owned by any user installed on target it gives
insufficient error "getpwuid(): uid not found" which may be misleading.
This exception occurs if uid/gid of path was not found in PSEUDO_PASSWD
files, which simply means the path is owned by host user and there is
host user contamination.

Add more information to the exception message to make it easier for user
to debug.

[YOCTO #14031]

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 38540b59ed4ec8632e30a5fd6364b010d9da8470)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolib/oe/patch.py: Ignore scissors line on applying patch
Tomasz Dziendzielski [Sun, 31 Jan 2021 10:46:49 +0000 (11:46 +0100)]
lib/oe/patch.py: Ignore scissors line on applying patch

The "devtool modify" could remove message body before scissors line, so
patches re-generated from git tree were incorrectly modified.
Adding --no-scissors to "git am" invocation to prevent this behaviour.

[YOCTO #12674]

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 13ea33fbd197b9ee3cf913d9995617115f22798f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolayer.conf: fix sanity error for PATH variable in extensible SDK workflow
Sourabh Banerjee [Tue, 13 Oct 2020 16:45:10 +0000 (22:15 +0530)]
layer.conf: fix sanity error for PATH variable in extensible SDK workflow

Sanity checker reports following error for the PATH variable,
when bitbake -e <recipe> command is run in an extensible SDK workspace.
   PATH contains '.', './' or '' (empty element), which will break the build

In case of extensible SDK, PATH variable is formed with two consecutive ':'
as bb.utils.which(d.getVar('PATH'),'bitbake') call returns an empty string.

This change adds ':' if BITBAKEPATH is a non empty string.

Signed-off-by: Sourabh Banerjee <sbanerje@codeaurora.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 05a87be51b44608ce4f77ac332df90a3cd2445ef)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoglib-2.0: Rename patch file for CVE-2020-35457
Anatol Belski [Wed, 3 Feb 2021 08:42:57 +0000 (08:42 +0000)]
glib-2.0: Rename patch file for CVE-2020-35457

The naming convention needs to be help so the CVE is recognized as
fixed by the tooling.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoqemu.inc: Should depend on qemu-system-native, not qemu-native
Richard Purdie [Sat, 30 Jan 2021 14:18:32 +0000 (14:18 +0000)]
qemu.inc: Should depend on qemu-system-native, not qemu-native

This looks like it was from before the recipe was split, we'd expect
the system qemu mode for running the images so the dependency should be
updated.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3a4fed4ae0e8a0d1bd62ea5fa1ef12925e1f20f5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopython3: Use addtask statement instead of task dependencies
Tomasz Dziendzielski [Mon, 25 Jan 2021 23:56:26 +0000 (00:56 +0100)]
python3: Use addtask statement instead of task dependencies

The externalsrc class deletes do_patch task which results with:
| ERROR: Task do_create_manifest in <PATH>/python3_3.8.2.bb depends upon
| non-existent task do_patch in <PATH>/python3_3.8.2.bb

Use addtask to define correct order to prevent this error, since addtask
mechanism accepts deleted tasks.

[YOCTO #14151]

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a746d034fa7eaad4f4876fa61c5a8c3c15e211c8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agonpm.bbclass: use python3 for npm config
Vyacheslav Yurkov [Thu, 28 Jan 2021 18:42:46 +0000 (19:42 +0100)]
npm.bbclass: use python3 for npm config

python2-native executable is not available in sysroot anymore, which
causes compilation of some nodejs modules to fail. Switch to python3 as a
default python version.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d21f50ecf8e8683a92b7d234fa8225c2c1470595)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobuildhistory.bbclass: avoid exception for empty BUILDHISTORY_FEATURES variable
Peter Bergin [Fri, 29 Jan 2021 09:50:54 +0000 (10:50 +0100)]
buildhistory.bbclass: avoid exception for empty BUILDHISTORY_FEATURES variable

An exception is fired when a BuildStarted event is sent to buildhistory bbclass
and the variable BUILDHISTORY_FEATURES is not set.

    ERROR: Execution of event handler 'buildhistory_eventhandler' failed
    Traceback (most recent call last):
      File "<...>/meta/classes/buildhistory.bbclass", line 862, in buildhistory_eventhandler(e=<bb.event.BuildStarted object at 0x7f94c3810250>):
         python buildhistory_eventhandler() {
        >    if e.data.getVar('BUILDHISTORY_FEATURES').strip():
                 reset = e.data.getVar("BUILDHISTORY_RESET")
    AttributeError: 'NoneType' object has no attribute 'strip'

This can happen in a multiconfig build where the default configuration use the
buildhistory class but not the configuration in mc. It should be a rare case that
this happens and it was found in a missconfigured build.

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a74e30a4de02c8efd3e7102ba7a4fe06df53cc34)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolinux-yocto/5.4: update to v5.4.94
Bruce Ashfield [Wed, 3 Feb 2021 03:24:05 +0000 (22:24 -0500)]
linux-yocto/5.4: update to v5.4.94

Updating linux-yocto/5.4 to the latest korg -stable release that comprises
the following commits:

    0fbca6ce4174 Linux 5.4.94
    315cd8fc2ad2 fs: fix lazytime expiration handling in __writeback_single_inode()
    5f8b8fccdfbc writeback: Drop I_DIRTY_TIME_EXPIRE
    2d8848edc96b dm integrity: conditionally disable "recalculate" feature
    43546b74ce6c tools: Factor HOSTCC, HOSTLD, HOSTAR definitions
    ab85b382dcf7 SMB3.1.1: do not log warning message if server doesn't populate salt
    0edc78af73d0 arm64: mm: use single quantity to represent the PA to VA translation
    b899d5b2a42a tracing: Fix race in trace_open and buffer resize call
    c4a23c852e80 io_uring: Fix current->fs handling in io_sq_wq_submit_work()
    336bb7dc5a1c HID: wacom: Correct NULL dereference on AES pen proximity
    ecd62d2e9ab4 futex: Handle faults correctly for PI futexes
    55ea172ce3eb futex: Simplify fixup_pi_state_owner()
    a3155c362ca0 futex: Use pi_state_update_owner() in put_pi_state()
    ceb83cf9ed67 rtmutex: Remove unused argument from rt_mutex_proxy_unlock()
    015b6a4c2564 futex: Provide and use pi_state_update_owner()
    65aad57cac8d futex: Replace pointless printk in fixup_owner()
    0dae88a92596 futex: Ensure the correct return value from futex_lock_pi()
    c27a2a1ecf69 Revert "mm/slub: fix a memory leak in sysfs_slab_add()"
    4afd772371d9 gpio: mvebu: fix pwm .get_state period calculation
    131f8d8a889a Linux 5.4.93
    f7020c437e13 tcp: fix TCP_USER_TIMEOUT with zero window
    945d182a046f tcp: do not mess with cloned skbs in tcp_add_backlog()
    ccc248b6444a net: dsa: b53: fix an off by one in checking "vlan->vid"
    ff64094dc718 net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled
    3e5b335a55e9 net: mscc: ocelot: allow offloading of bridge on top of LAG
    b47a3c32c4c2 ipv6: set multicast flag on the multicast route
    b778940f2ab9 net_sched: reject silly cell_log in qdisc_get_rtab()
    4ed347901f08 net_sched: avoid shift-out-of-bounds in tcindex_set_parms()
    bc757ba6dc75 ipv6: create multicast route with RTPROT_KERNEL
    60fb547a3d5d udp: mask TOS bits in udp_v4_early_demux()
    da3711f42c68 kasan: fix incorrect arguments passing in kasan_add_zero_shadow
    0d190f53fa2f kasan: fix unaligned address is unhandled in kasan_remove_zero_shadow
    5a3890bad3a4 skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too
    49aaf012c478 lightnvm: fix memory leak when submit fails
    0ff55fc4d6a1 sh_eth: Fix power down vs. is_opened flag ordering
    fd2f5130ae98 net: dsa: mv88e6xxx: also read STU state in mv88e6250_g1_vtu_getnext
    4e1d17a1f73b sh: dma: fix kconfig dependency for G2_DMA
    8a0b8e26f79f netfilter: rpfilter: mask ecn bits before fib lookup
    99328b4b4408 x86/cpu/amd: Set __max_die_per_package on AMD
    6f8ba0ada139 pinctrl: ingenic: Fix JZ4760 support
    382ffe786647 driver core: Extend device_is_dependent()
    4e749a28c909 xhci: tegra: Delay for disabling LFPS detector
    a6a5d08170c2 xhci: make sure TRB is fully written before giving it to the controller
    7f3cfc7e378d usb: bdc: Make bdc pci driver depend on BROKEN
    f764f90b0c77 usb: udc: core: Use lock when write to soft_connect
    564f3c532642 usb: gadget: aspeed: fix stop dma register setting.
    f89a193fd9d3 USB: ehci: fix an interrupt calltrace error
    9a660760299b ehci: fix EHCI host controller initialization sequence
    5eda5db39e28 serial: mvebu-uart: fix tx lost characters at power off
    a8fade59466c stm class: Fix module init return on allocation failure
    5e4bacea58ca intel_th: pci: Add Alder Lake-P support
    c5885886c72c x86/mmx: Use KFPU_387 for MMX string operations
    d1a9cd1dc53c x86/topology: Make __max_die_per_package available unconditionally
    cdb4ce96fdd2 x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state
    cd1c4882ab43 irqchip/mips-cpu: Set IPI domain parent chip
    9a2f6007a228 cifs: do not fail __smb_send_rqst if non-fatal signals are pending
    745229c90301 iio: ad5504: Fix setting power-down state
    ddd1416f4413 can: peak_usb: fix use after free bugs
    a24476b37167 can: vxcan: vxcan_xmit: fix use after free bug
    ac48ef15826e can: dev: can_restart: fix use after free bug
    391187744436 selftests: net: fib_tests: remove duplicate log test
    237375005739 platform/x86: intel-vbtn: Drop HP Stream x360 Convertible PC 11 from allow-list
    57f0f0ddf9e4 i2c: octeon: check correct size of maximum RECV_LEN packet
    485e0255c19e powerpc: Fix alignment bug within the init sections
    cfea5cddeb71 scsi: megaraid_sas: Fix MEGASAS_IOC_FIRMWARE regression
    da3324ec5497 pinctrl: aspeed: g6: Fix PWMG0 pinctrl setting
    5625c3da7167 powerpc: Use the common INIT_DATA_SECTION macro in vmlinux.lds.S
    73a229119983 drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0
    af91a2e7fb5e drm/nouveau/mmu: fix vram heap sizing
    ee2c9e58f430 drm/nouveau/i2c/gm200: increase width of aux semaphore owner fields
    38f35023fd30 drm/nouveau/privring: ack interrupts the same way as RM
    8c3d3b385ed8 drm/nouveau/bios: fix issue shadowing expansion ROMs
    f5dc9627ac04 drm/amd/display: Fix to be able to stop crc calculation
    9f6d85e20125 drm/amdgpu/psp: fix psp gfx ctrl cmds
    5b2266d62b54 riscv: defconfig: enable gpio support for HiFive Unleashed
    7eef73685871 dts: phy: fix missing mdio device and probe failure of vsc8541-01 device
    5fa6987258a7 x86/xen: Add xen_no_vector_callback option to test PCI INTX delivery
    a09d4e7acdbf xen: Fix event channel callback via INTX/GSI
    acc402fa5bf5 arm64: make atomic helpers __always_inline
    8ab3478335ad clk: tegra30: Add hda clock default rates to clock driver
    c074680653e2 HID: Ignore battery for Elan touchscreen on ASUS UX550
    9cec63a3aacb HID: logitech-dj: add the G602 receiver
    b1b943f5b65e riscv: Fix sifive serial driver
    cd0c46821aa5 riscv: Fix kernel time_init()
    5a1d7bb7d333 scsi: sd: Suppress spurious errors when WRITE SAME is being disabled
    68f99105752d scsi: qedi: Correct max length of CHAP secret
    97853a7eae80 scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback
    b477f4371045 dm integrity: select CRYPTO_SKCIPHER
    8ebe26a1e236 HID: multitouch: Enable multi-input for Synaptics pointstick/touchpad device
    6af49167440a ASoC: Intel: haswell: Add missing pm_ops
    ad1df24b37d9 drm/i915/gt: Prevent use of engine->wa_ctx after error
    6b59bd9eea08 drm/syncobj: Fix use-after-free
    559c0ffedbe0 drm/atomic: put state on error path
    42d855f06d12 dm integrity: fix a crash if "recalculate" used without "internal_hash"
    a03ce9cc4bb8 dm: avoid filesystem lookup in dm_get_dev_t()
    cd3aa1495d8a mmc: sdhci-xenon: fix 1.8v regulator stabilization
    6acdefd0bd34 mmc: core: don't initialize block size from ext_csd if not present
    d8a487e673ab btrfs: send: fix invalid clone operations when cloning from the same file and root
    4d1cf8eeda5b btrfs: don't clear ret in btrfs_start_dirty_block_groups
    e1065331b730 btrfs: fix lockdep splat in btrfs_recover_relocation
    68718453159e btrfs: don't get an EINTR during drop_snapshot for reloc
    a826af1dea4a ACPI: scan: Make acpi_bus_get_device() clear return pointer on error
    08fa4ae93e95 ALSA: hda/via: Add minimum mute flag
    1607adf1ac41 ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info()
    9c301133beda platform/x86: ideapad-laptop: Disable touchpad_switch for ELAN0634
    ea8d3c71313f platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes
    60066d5181be i2c: bpmp-tegra: Ignore unknown I2C_M flags
    09f983f0c7fc Linux 5.4.92
    e2d69319b713 spi: cadence: cache reference clock rate during probe
    d04c7938d0f8 mac80211: check if atf has been disabled in __ieee80211_schedule_txq
    d46996cb4b16 mac80211: do not drop tx nulldata packets on encrypted links
    56e8947bcf81 tipc: fix NULL deref in tipc_link_xmit()
    55bac51762c3 net, sctp, filter: remap copy_from_user failure error
    52e0b20c8c57 rxrpc: Fix handling of an unsupported token type in rxrpc_read()
    5c466480d7d4 net: avoid 32 x truesize under-estimation for tiny skbs
    f6499a78e581 net: sit: unregister_netdevice on newlink's error path
    a3870cf8a7a2 net: stmmac: Fixed mtu channged by cache aligned
    c213d85cae39 rxrpc: Call state should be read with READ_ONCE() under some circumstances
    6d57b582fb35 net: dcb: Accept RTM_GETDCB messages carrying set-like DCB commands
    d52f5929d997 net: dcb: Validate netlink message in DCB handler
    814e04776211 esp: avoid unneeded kmap_atomic call
    0ff06dd1b949 rndis_host: set proper input size for OID_GEN_PHYSICAL_MEDIUM request
    c897c10e4334 net: mvpp2: Remove Pause and Asym_Pause support
    18c29e175e30 mlxsw: core: Increase critical threshold for ASIC thermal zone
    7680783452ce mlxsw: core: Add validation of transceiver temperature thresholds
    ff6d4e8da7c6 net: ipv6: Validate GSO SKB before finish IPv6 processing
    b41352a93c16 net: skbuff: disambiguate argument and member for skb_list_walk_safe helper
    aa350dbe3a1e net: introduce skb_list_walk_safe for skb segment walking
    760e9fd4f7ab netxen_nic: fix MSI/MSI-x interrupts
    982e763ea3c3 udp: Prevent reuseport_select_sock from reading uninitialized socks
    bd4793843c85 bpf: Fix helper bpf_map_peek_elem_proto pointing to wrong callback
    79ce12cfa56a bpf: Don't leak memory in bpf getsockopt when optlen == 0
    4aef760c28e8 nfsd4: readdirplus shouldn't return parent of export
    9b72d5ba50f1 spi: npcm-fiu: Disable clock in probe error path
    6ef67f59263e spi: npcm-fiu: simplify the return expression of npcm_fiu_probe()
    fa6de8d82d9c scsi: lpfc: Make lpfc_defer_acc_rsp static
    e82b58aa6471 scsi: lpfc: Make function lpfc_defer_pt2pt_acc static
    5e6b88828526 elfcore: fix building with clang
    ac29c052654f xen/privcmd: allow fetching resource sizes
    dd113b79ee7e compiler.h: Raise minimum version of GCC to 5.1 for arm64
    24cea7d70516 usb: ohci: Make distrust_firmware param default to false
    d26b3110041a Linux 5.4.91
    516bd00e5ac1 netfilter: nft_compat: remove flush counter optimization
    935114863364 netfilter: nf_nat: Fix memleak in nf_nat_init
    49fc6d92b484 netfilter: conntrack: fix reading nf_conntrack_buckets
    548e4168e68d ALSA: firewire-tascam: Fix integer overflow in midi_port_work()
    68e67535e26b ALSA: fireface: Fix integer overflow in transmit_midi_msg()
    2c3d03cdbd39 dm: eliminate potential source of excessive kernel log noise
    a34294774a32 net: sunrpc: interpret the return value of kstrtou32 correctly
    8b5107a74db3 iommu/vt-d: Fix unaligned addresses for intel_flush_svm_range_dev()
    c2226680343d mm, slub: consider rest of partial list if acquire_slab() fails
    cd9e901fe2fc drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence
    9269296721b5 IB/mlx5: Fix error unwinding when set_has_smi_cap fails
    40a782293545 RDMA/mlx5: Fix wrong free of blue flame register on error
    e8c8d2319bd7 bnxt_en: Improve stats context resource accounting with RDMA driver loaded.
    3bcf35a7c05f RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp
    da834a9bdc23 RDMA/restrack: Don't treat as an error allocation ID wrapping
    986fdc7685fa ext4: fix superblock checksum failure when setting password salt
    38992092b54e NFS: nfs_igrab_and_active must first reference the superblock
    6b3ae2030db9 NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter
    aa2399f55eff pNFS: Stricter ordering of layoutget and layoutreturn
    78c2ab7f5265 pNFS: Mark layout for return if return-on-close was not sent
    7d1241ae1dce pNFS: We want return-on-close to complete when evicting the inode
    69d121ca892c NFS4: Fix use-after-free in trace_event_raw_event_nfs4_set_lock
    c70f6e0ac9f9 nvme-tcp: fix possible data corruption with bio merges
    55a102004376 ASoC: Intel: fix error code cnl_set_dsp_D0()
    2392a54de8ba ASoC: meson: axg-tdmin: fix axg skew offset
    973900cd4614 ASoC: meson: axg-tdm-interface: fix loopback
    08eb8a735c11 dump_common_audit_data(): fix racy accesses to ->d_name
    d443cefd9f73 perf intel-pt: Fix 'CPU too large' error
    221dee1d0d4e ARM: picoxcell: fix missing interrupt-parent properties
    ba74e0f222c7 drm/msm: Call msm_init_vram before binding the gpu
    0251d3eb4480 ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI
    bfdd0a3b86c3 usb: typec: Fix copy paste error for NVIDIA alt-mode description
    644baa95db2b drm/amdgpu: fix a GPU hang issue when remove device
    596b3423fddc nvmet-rdma: Fix list_del corruption on queue establishment failure
    4cb77b877fcc nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN
    242793c7ef2f selftests: fix the return value for UDP GRO test
    5fc06b706432 net: ethernet: fs_enet: Add missing MODULE_LICENSE
    15a8491cdcd4 misdn: dsp: select CONFIG_BITREVERSE
    635a658de303 arch/arc: add copy_user_page() to <asm/page.h> to fix build error on ARC
    bc68af1fdcac bfq: Fix computation of shallow depth
    2abc54579d1b lib/raid6: Let $(UNROLL) rules work with macOS userland
    1d05b91ab72e hwmon: (pwm-fan) Ensure that calculation doesn't discard big period values
    1229d433960c habanalabs: Fix memleak in hl_device_reset
    93aef8e6cc08 habanalabs: register to pci shutdown callback
    79df21218d63 ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram
    331a6438ebfd regulator: bd718x7: Add enable times
    d5f996bea464 btrfs: fix transaction leak and crash after RO remount caused by qgroup rescan
    c8dd8af4b35f netfilter: ipset: fixes possible oops in mtype_resize
    ca2fc0dc1cec ARC: build: move symlink creation to arch/arc/Makefile to avoid race
    6265a0f2410f ARC: build: add boot_targets to PHONY
    217d8ba22bce ARC: build: add uImage.lzma to the top-level target
    b9128252b9ee ARC: build: remove non-existing bootpImage from KBUILD_IMAGE
    5349b17c3df5 dm integrity: fix flush with external metadata device
    c553300f1453 cifs: fix interrupted close commands
    d17a9571e392 smb3: remove unused flag passed into close functions
    55a4dff288af ext4: don't leak old mountpoint samples
    2003c669df4c ext4: fix bug for rename with RENAME_WHITEOUT
    425faacff213 drm/i915/backlight: fix CPU mode backlight takeover on LPT
    72eb9fc82aea btrfs: tree-checker: check if chunk item end overflows
    82a948fc67ea r8152: Add Lenovo Powered USB-C Travel Hub
    ad5f19c7e9ce dm integrity: fix the maximum number of arguments
    5caac6317daf dm snapshot: flush merged data before committing metadata
    2017b99ec205 dm raid: fix discard limits for raid1
    4335af6c62fc mm/hugetlb: fix potential missing huge page size info
    c64366620d91 ACPI: scan: Harden acpi_device_add() against device ID overflows
    bc0b70f1d28c RDMA/ocrdma: Fix use after free in ocrdma_dealloc_ucontext_pd()
    f7a97dc302be MIPS: relocatable: fix possible boot hangup with KASLR enabled
    f5c2f7970683 MIPS: boot: Fix unaligned access with CONFIG_MIPS_RAW_APPENDED_DTB
    a650107de374 mips: lib: uncached: fix non-standard usage of variable 'sp'
    bda45bbc8e03 mips: fix Section mismatch in reference
    aeb64ef1f429 tracing/kprobes: Do the notrace functions check without kprobes on ftrace
    984f57e4258c x86/hyperv: check cpu mask after interrupt has been disabled
    1a202b9b9d23 ASoC: dapm: remove widget from dirty list on free
    82d1a5f6f2e5 btrfs: prevent NULL pointer dereference in extent_io_tree_panic
    bb562e6e0358 kbuild: enforce -Werror=return-type

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 80d066f627225e9eefba84c799e9b27bc17526fc)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolinux-yocto-rt/5.4: fix 5.4-stable caused build breakage
Bruce Ashfield [Wed, 3 Feb 2021 03:24:02 +0000 (22:24 -0500)]
linux-yocto-rt/5.4: fix 5.4-stable caused build breakage

5.4-stable included a backport of:

   Author: Eric W. Biederman <ebiederm@xmission.com>
   Date:   Thu Dec 3 14:11:13 2020 -0600

     rwsem: Implement down_read_interruptible

     [ Upstream commit 31784cff7ee073b34d6eddabb95e3be2880a425c ]

     In preparation for converting exec_update_mutex to a rwsem so that
     multiple readers can execute in parallel and not deadlock, add
     down_read_interruptible.  This is needed for perf_event_open to be
     converted (with no semantic changes) from working on a mutex to
     wroking on a rwsem.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/87k0tybqfy.fsf@x220.int.ebiederm.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
We implement a -rt variant to fix the build issues.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e610fb7cc22447441f18a9b1bffe58aadb6aaab6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolinux-yocto/5.4: update to v5.4.90
Bruce Ashfield [Wed, 3 Feb 2021 03:24:00 +0000 (22:24 -0500)]
linux-yocto/5.4: update to v5.4.90

Updating linux-yocto/5.4 to the latest korg -stable release that comprises
the following commits:

    ceed81a883dc Linux 5.4.90
    6f484096196b regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init()
    bbb2fee395e9 net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet
    bd0051a5cb05 block: fix use-after-free in disk_part_iter_next
    c5fe50e18fcb KVM: arm64: Don't access PMCR_EL0 when no PMU is available
    f595e44b161a net: mvpp2: disable force link UP during port init procedure
    5b8d3c3a9fcb regulator: qcom-rpmh-regulator: correct hfsmps515 definition
    3582406b9c04 wan: ds26522: select CONFIG_BITREVERSE
    480c5e9c7e4c regmap: debugfs: Fix a memory leak when calling regmap_attach_dev
    c3c774886790 net/mlx5e: Fix two double free cases
    ce74b5a0689d net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups
    a2b2ae3812e5 bpftool: Fix compilation failure for net.o with older glibc
    2992e3371a3a iommu/intel: Fix memleak in intel_irq_remapping_alloc
    006319327d21 lightnvm: select CONFIG_CRC32
    46c15eeb0a8a block: rsxx: select CONFIG_CRC32
    4834a984e456 wil6210: select CONFIG_CRC32
    b28378bc91d0 qed: select CONFIG_CRC32
    cc196d4604c9 dmaengine: xilinx_dma: fix mixed_enum_type coverity warning
    d0eaf8a8eff8 dmaengine: xilinx_dma: fix incompatible param warning in _child_probe()
    e6f247a5f927 dmaengine: xilinx_dma: check dma_async_device_register return value
    c15556cb344a dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function
    55503711adff i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly terminated
    12e8bcaef61a spi: stm32: FIFO threshold level - fix align packet size
    9ff4796e6fd9 cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get()
    4dd15f9bc881 can: kvaser_pciefd: select CONFIG_CRC32
    82adac5ad13b can: m_can: m_can_class_unregister(): remove erroneous m_can_clk_stop()
    3b68980596fb can: tcan4x5x: fix bittiming const, use common bittiming from m_can driver
    b77e0283efdc dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk()
    f6dd8c259ab8 i2c: sprd: use a specific timeout to avoid system hang up issue
    8d0cadc2ea64 ARM: OMAP2+: omap_device: fix idling of devices during probe
    003280bd8845 HID: wacom: Fix memory leakage caused by kfifo_alloc
    6f367fb1b7ee iio: imu: st_lsm6dsx: fix edge-trigger interrupts
    87ea51c90280 vmlinux.lds.h: Add PGO and AutoFDO input sections
    099340d3e758 exfat: Month timestamp metadata accidentally incremented
    bb039d45ebc5 x86/resctrl: Don't move a task to the same resource group
    628af07fc5cd x86/resctrl: Use an IPI instead of task_work_add() to update PQR_ASSOC MSR
    96fb3d28c885 chtls: Fix chtls resources release sequence
    fac9b53cfacb chtls: Added a check to avoid NULL pointer dereference
    38768ea1127d chtls: Replace skb_dequeue with skb_peek
    dcce456b2843 chtls: Fix panic when route to peer not configured
    44bed66b2be9 chtls: Remove invalid set_tcb call
    266ee00f402b chtls: Fix hardware tid leak
    ed62af62da41 net/mlx5e: ethtool, Fix restriction of autoneg with 56G
    cf59803ce4b3 net/mlx5: Use port_num 1 instead of 0 when delete a RoCE address
    3008c639c081 net: dsa: lantiq_gswip: Exclude RMII from modes that report 1 GbE
    fc1c907da5a1 s390/qeth: fix L2 header access in qeth_l3_osa_features_check()
    e6931e3eb084 nexthop: Unlink nexthop group entry in error path
    3cecab93f271 nexthop: Fix off-by-one error in error path
    f03b81e61ef5 octeontx2-af: fix memory leak of lmac and lmac->name
    12e10b12124c net: ip: always refragment ip defragmented packets
    41bfd4111257 net: fix pmtu check in nopmtudisc mode
    98fc9692ac3d tools: selftests: add test for changing routes with PTMU exceptions
    7694654168bb net: ipv6: fib: flush exceptions when purging route
    1cba7e270b16 net/sonic: Fix some resource leaks in error handling paths
    37e6368a8de6 net: vlan: avoid leaks on register_vlan_dev() failures
    4ff0737ebc76 net: stmmac: dwmac-sun8i: Balance internal PHY power
    5698f0921c9b net: stmmac: dwmac-sun8i: Balance internal PHY resource references
    fa020a28896c net: hns3: fix a phy loopback fail issue
    bddaf51d116c net: hns3: fix the number of queues actually used by ARQ
    d73f7e757526 net: cdc_ncm: correct overhead in delayed_ndp_size
    5597557244d4 vfio iommu: Add dma available capability
    335104082c21 x86/asm/32: Add ENDs to some functions and relabel with SYM_CODE_*
    a829146c3fdc Linux 5.4.89
    485e21729b1e scsi: target: Fix XCOPY NAA identifier lookup
    7795afa0d7a9 KVM: x86: fix shift out of bounds reported by UBSAN
    a9d49da7edf8 x86/mtrr: Correct the range check before performing MTRR type lookups
    a798b367a066 netfilter: nft_dynset: report EOPNOTSUPP on missing set feature
    5e401ea71676 netfilter: xt_RATEEST: reject non-null terminated string from userspace
    1dd6a790c220 netfilter: ipset: fix shift-out-of-bounds in htable_bits()
    e0281bb5a82d netfilter: x_tables: Update remaining dereference to RCU
    828f2a20f946 drm/i915: clear the gpu reloc batch
    ef8133b1b47e dmabuf: fix use-after-free of dmabuf's file->f_inode
    284be2b993ca Revert "device property: Keep secondary firmware node secondary by type"
    64d06c7f2fa2 btrfs: send: fix wrong file path when there is an inode with a pending rmdir
    0cb0b876f17f ALSA: hda/realtek: Add two "Intel Reference board" SSID in the ALC256.
    02e59692a6b1 ALSA: hda/realtek: Enable mute and micmute LED on HP EliteBook 850 G7
    d63a96f45c4f ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
    30fd9778cf8f ALSA: hda/conexant: add a new hda codec CX11970
    121944484cc4 ALSA: hda/via: Fix runtime PM for Clevo W35xSS
    a5c7a456680f kvm: check tlbs_dirty directly
    10dcb79ec79e x86/mm: Fix leak of pmd ptlock
    d3e5db486fd8 USB: serial: keyspan_pda: remove unused variable
    bcffe2de9dde usb: gadget: configfs: Fix use-after-free issue with udc_name
    276828221852 usb: gadget: configfs: Preserve function ordering after bind failure
    b2bd36f54495 usb: gadget: Fix spinlock lockup on usb_function_deactivate
    ce507b55db29 USB: gadget: legacy: fix return error code in acm_ms_bind()
    7f875ea9883c usb: gadget: u_ether: Fix MTU size mismatch with RX packet size
    b89a5f39c2b5 usb: gadget: function: printer: Fix a memory leak for interface descriptor
    692ab0726460 usb: gadget: f_uac2: reset wMaxPacketSize
    7ac84fa85ba2 usb: gadget: select CONFIG_CRC32
    77a804dd6b46 ALSA: usb-audio: Fix UBSAN warnings for MIDI jacks
    5c263f16822f USB: usblp: fix DMA to stack
    41f15da2abd9 USB: yurex: fix control-URB timeout handling
    175f7a5fa7e6 USB: serial: option: add Quectel EM160R-GL
    1a59feb52dc4 USB: serial: option: add LongSung M5710 module support
    ac48b1dacb07 USB: serial: iuu_phoenix: fix DMA from stack
    8a051eaae708 usb: uas: Add PNY USB Portable SSD to unusual_uas
    a7b81d0d2e07 usb: usbip: vhci_hcd: protect shift size
    f7cc27eb358d USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set
    ea472d839133 usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data()
    a37a0667e1e0 usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion
    5b8e1be9e0c1 USB: cdc-wdm: Fix use after free in service_outstanding_interrupt().
    5445502a344b USB: cdc-acm: blacklist another IR Droid device
    eeae1d95ce4e usb: gadget: enable super speed plus
    70cf59b8ffb4 staging: mt7621-dma: Fix a resource leak in an error handling path
    c511f27e130e powerpc: Handle .text.{hot,unlikely}.* in linker script
    867c10a03f84 crypto: asym_tpm: correct zero out potential secrets
    ff7397add935 crypto: ecdh - avoid buffer overflow in ecdh_set_secret()
    9e60056b1f53 video: hyperv_fb: Fix the mmap() regression for v5.4.y and older
    84d488719b27 Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close
    3417067b3111 kbuild: don't hardcode depmod path
    3f2a28930a7e net/sched: sch_taprio: ensure to reset/destroy all child qdiscs
    c41ea30c3839 ionic: account for vlan tag len in rx buffer len
    5c6eb887e192 vhost_net: fix ubuf refcount incorrectly when sendmsg fails
    8f64957fda12 net: usb: qmi_wwan: add Quectel EM160R-GL
    12ab7b627d43 CDC-NCM: remove "connected" log message
    171a2bce9d6c net: dsa: lantiq_gswip: Fix GSWIP_MII_CFG(p) register access
    c0883010d3b3 net: dsa: lantiq_gswip: Enable GSWIP_MII_CFG_EN also for internal PHYs
    07f26fc52b45 r8169: work around power-saving bug on some chip versions
    106ca9ca9acc net: hdlc_ppp: Fix issues when mod_timer is called while timer is running
    2b8aa896b151 erspan: fix version 1 check in gre_parse_header()
    606f5412ad86 net: hns: fix return value check in __lb_other_process()
    e40b5fc79110 net: sched: prevent invalid Scell_log shift count
    b16f883e71f3 ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst()
    a018c071de14 net: mvpp2: fix pkt coalescing int-threshold configuration
    443a71031e49 tun: fix return value when the number of iovs exceeds MAX_SKB_FRAGS
    c076e1198554 net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered
    8602c20a9160 net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc
    1f6b04a2b282 net-sysfs: take the rtnl lock when storing xps_rxqs
    67ed54a63f43 net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc
    fb14db9508c0 net-sysfs: take the rtnl lock when storing xps_cpus
    e43ec45d45af net: ethernet: Fix memleak in ethoc_probe
    56dc7908ed85 net/ncsi: Use real net-device for response handler
    dffef999e484 virtio_net: Fix recursive call to cpus_read_lock()
    5404192a8721 qede: fix offload for IPIP tunnel packets
    8009f6bb13a3 net: ethernet: mvneta: Fix error handling in mvneta_probe
    6d003fe7fe87 ibmvnic: continue fatal error reset after passive init
    3d16088a9668 net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
    8548c9679939 atm: idt77252: call pci_disable_device() on error path
    2a006b4fa5cc ethernet: ucc_geth: set dev->max_mtu to 1518
    c2ca14cc6f55 ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()
    af99cae96fdc net: systemport: set dev->max_mtu to UMAC_MAX_MTU_SIZE
    8dd98d5d2ba4 net: mvpp2: prs: fix PPPoE with ipv6 packet parse
    73445f29575a net: mvpp2: Add TCAM entry to drop flow control pause frames
    a5a6dc4dc293 iavf: fix double-release of rtnl_lock
    6aba31a7c72e i40e: Fix Error I40E_AQ_RC_EINVAL when removing VFs
    9ea03f6890ce proc: fix lookup in /proc/net subdirectories after setns(2)
    d2942e958f26 proc: change ->nlink under proc_subdir_lock
    59b10c8a59a1 depmod: handle the case of /sbin/depmod without /sbin in PATH
    663a0bcb3fa5 lib/genalloc: fix the overflow when size is too big
    19e0cf8fc481 scsi: scsi_transport_spi: Set RQF_PM for domain validation commands
    eb3e975ac2a3 scsi: ide: Do not set the RQF_PREEMPT flag for sense requests
    4ae3573c571e scsi: ufs-pci: Ensure UFS device is in PowerDown mode for suspend-to-disk ->poweroff()
    5f9c3d640505 scsi: ufs: Fix wrong print message in dev_err()
    515dc635eb76 workqueue: Kick a worker based on the actual activation of delayed works
    f3a4c8d50145 Linux 5.4.88
    0a49aaf4df29 mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
    117433236ae2 exec: Transform exec_update_mutex into a rw_semaphore
    d390fc97df62 rwsem: Implement down_read_interruptible
    1b75a263fbd9 rwsem: Implement down_read_killable_nested
    71b8355ba667 perf: Break deadlock involving exec_update_mutex
    732251cabeb3 fuse: fix bad inode
    06c672dd61b5 iio:imu:bmi160: Fix alignment and data leak issues
    7a736f41013e kdev_t: always inline major/minor helper functions
    61a0d8e437bb dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate()
    20d5ee563bfd dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate()
    f2a0b7677444 dmaengine: at_hdmac: Substitute kzalloc with kmalloc
    4d3ba541bede Revert "mtd: spinand: Fix OOB read"
    da5b4cf021b9 Revert "drm/amd/display: Fix memory leaks in S3 resume"

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5dcc8a5977725a9fe11ac13ebd16a7acc1eef37d)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agokernel.bbclass: fix deployment for initramfs images
Awais Belal [Fri, 29 Jan 2021 12:42:39 +0000 (17:42 +0500)]
kernel.bbclass: fix deployment for initramfs images

The do_bundle_initramfs() only processes kernel image
types that are found in KERNEL_IMAGETYPE_FOR_MAKE whereas
the build system can generate other types that are not
directly supported by the kernel build system. In which
case when we come to the deploy phase not all the images
mentioned in KERNEL_IMAGETYPES would have a respective
initramfs bundled image. An example is using vmlinux.gz
in KERNEL_IMAGETYPES and enabling initramfs and then we
see

install: cannot stat 'arch/arm64/boot/vmlinux.gz.initramfs': No such file or directory

So we align the deploy phase with bundle initramfs phase
and pick up relevant initramfs bundled images using
KERNEL_IMAGETYPE_FOR_MAKE instead of KERNEL_IMAGETYPES.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 526bdd88ccd758204452579333ba188e29270bde)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopackage: Ensure do_packagedata is cleaned correctly
Richard Purdie [Wed, 3 Feb 2021 14:22:13 +0000 (14:22 +0000)]
package: Ensure do_packagedata is cleaned correctly

In an earlier commit, libprocps was split into a separate package leaving
no shlibs in the main package. A bug was seen where igt-gpu-tools wouldn't
build correctly in some cases as it thought the librbary was still in the
main package, throwing qa errors as a result.

The issue was due to an extra file being left in the sstate output of
the do_packagedata task in the shlibs2/ folder which contained the bad
shlibs information.

The reason for this was that the temporary directory used in this
task wasn't being cleaned so files which were deleted were not handled
correctly. Add a missing cleandirs entry to fix this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 50f17d0a655a3a2556f9fcad67259101c2814a36)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopackage.bbclass: hash equivalency and pr service
Mark Hatle [Wed, 2 Sep 2020 15:33:22 +0000 (10:33 -0500)]
package.bbclass: hash equivalency and pr service

When the PR service is enabled a number of small changes may happen
to variables.  In the do_package step a call to package_get_auto_pr
will end up setting PRAUTO and modifying PKGV (if AUTOINC is there).

PRAUTO is then used by EXTENDPRAUTO, which is then used to generate
PKGR.

Since this behavior typically happens BEFORE the BB_UNIHASH is
calculated for do_package, we need a way to defer the expansion
until after we have the unihash value.

Writing out the pkgdata files w/o AUTOPR and PKGV (AUTOINC) expanded
to placeholder values is the easiest way to deal with this.  All other
variables are expanded as expected.

In the next task, typically do_packagedata, we will then use the
UNIHASH from the do_package to get the PR (AUTOPR) as well as
generate the AUTOINC replacement value (now PRSERV_PV_AUTOINC).

The do_packagedata then translates the placeholders to the final values
when copying the data from pkgdata to pkgdata-pdata-input.

Also update the prservice test case.  With unihash, just changing the
do_package (via a _append) will not change the PR.  So write the date
to a specific file that is incorporated into the unihash to ensure it
is always different for the test.  Various assert messages were also
updated to make it easier to figure out where/why a problem occured.

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2e32f37b0e4abc438c8f60e673cd18a5cc110768)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoopenssl: set CVE_VERSION_SUFFIX
Lee Chee Yang [Wed, 27 Jan 2021 09:03:54 +0000 (17:03 +0800)]
openssl: set CVE_VERSION_SUFFIX

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 17df664a32a74f17baaef8c31ac23adec2d6255f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agocve_check: add CVE_VERSION_SUFFIX to indicate suffix in versioning
Lee Chee Yang [Fri, 29 Jan 2021 03:51:15 +0000 (11:51 +0800)]
cve_check: add CVE_VERSION_SUFFIX to indicate suffix in versioning

add CVE_VERSION_SUFFIX to indicate the version suffix type, currently
works in two value, "alphabetical" if the version string uses single
alphabetical character suffix as incremental release, blank to not
consider the unidentified suffixes. This can be expand when more suffix
pattern identified.

refactor cve_check.Version class to use functools and add parameter to
handle suffix condition.

Also update testcases to cover new changes.

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5dfd5ad5144708b474ef31eaa89a846c57be8ac0)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agocve-check: replace Looseversion with custom version class
Lee Chee Yang [Fri, 22 Jan 2021 10:07:19 +0000 (18:07 +0800)]
cve-check: replace Looseversion with custom version class

The way distutils.version.LooseVersion compare version are tricky, it treat
all these ( "1.0-beta2", "1.0-rc1", "1.0A", "1.0p2" and "1.0pre1") as greater
version than "1.0". This might be right for "1.0A" and "1.0p1" but not for
the rest, also these version could be confusing, the "p" in "1.0p1" can be
"pre" or "patched" version or even other meaning.

Replace Looseversion with custom class, it uses regex to capture common
version format like "1.1.1" or tag format using date like "2020-12-12" as
release section, check for following known string/tags ( beta, rc, pre, dev,
alpha, preview) as pre-release section, any other trailing characters
are difficult to understand/define so ignore them. Compare release
section and pre-release section saperately.

included selftest for the version class.

[YOCTO#14127]

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 6ced85e9ddd3569240f1e8b82130d1ac0fffbc40)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoca-certificates: upgrade 20200601 -> 20210119
zhengruoqin [Thu, 28 Jan 2021 10:05:52 +0000 (18:05 +0800)]
ca-certificates: upgrade 20200601 -> 20210119

0001-certdata2pem.py-use-python3.patch
removed since it is included in 20210119

Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit afd86357e07f69090eaff4c5db2c517867dd4ccf)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoca-certificates: correct upstream version check
Alexander Kanavin [Mon, 8 Jun 2020 07:46:58 +0000 (09:46 +0200)]
ca-certificates: correct upstream version check

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9bc2943a7819c7e6d1bd4c1c03b265671811784c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoca-certificates: upgrade 20190110 -> 20200601
Wang Mingyu [Wed, 3 Jun 2020 10:51:57 +0000 (18:51 +0800)]
ca-certificates: upgrade 20190110 -> 20200601

-License-Update: format changed

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0007f38b03bcb0bd561bd9181fbffc7dec47fe9a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agosanity.bbclass: Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap
Dorinda [Mon, 1 Feb 2021 03:22:56 +0000 (22:22 -0500)]
sanity.bbclass: Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap

Added a sanity check for when PSEUDO_IGNORE_PATHS and paths under pseudo control overlap to avoid random failures generated.

[YOCTO #14193]

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 6e4bd8cabcdedf4b52345ef5eb421f71d0f19b1d)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Update to include passwd and file renaming fixes
Richard Purdie [Thu, 28 Jan 2021 21:28:23 +0000 (21:28 +0000)]
pseudo: Update to include passwd and file renaming fixes

Pulls in:
  pseudo_client: Ensure renames update open fd file paths
  pseudo_client.c: Rebuild passwd paths after chroot

which should fix issues seen in apt package index creation, new
binutils and other autobuilder race issues in pseudo amongst other
issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 44d11b56001f40622c055069b0901cc4ae15c76c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agostaging: Clean up files installed into the sysroot
Richard Purdie [Wed, 27 Jan 2021 17:15:17 +0000 (17:15 +0000)]
staging: Clean up files installed into the sysroot

There are a variety of files being installed into $datadir which we
don't need. Pick the top "offenders" which amount of thousands of files
and simply don't install them. These include things like test data,
terminfo data, locale data for native tools and so on. This saves
copying these files into native and target sysroots and should improve
performance (smaller sstate, fewer files to copy around).

With this and the python recipe change, alsa-tools went from:

recipe-sysroot: 18357
recipe-sysroot-native: 14129

to

recipe-sysroot: 10809
recipe-sysroot-native: 8079

which is a decent improvement.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 366c72941fe1c24d0b1d96df46e13cb9eb4e79d6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopython3: Avoid installing test data into recipe-sysroot
Richard Purdie [Wed, 27 Jan 2021 17:12:46 +0000 (17:12 +0000)]
python3: Avoid installing test data into recipe-sysroot

There are several thousand files in the test directory which we don't need.
Adding these for the native and target sysroots is a crazy amount of files
to be throwing around needlessly. Delete the files from the sysroot side
of things to tidy up the sysroots and improve performance.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f6bced03011ad1663d68b0322a2f8aeb4d836646)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoncurses: Don't put terminfo into the sysroot
Richard Purdie [Wed, 27 Jan 2021 12:13:28 +0000 (12:13 +0000)]
ncurses: Don't put terminfo into the sysroot

This recudes the file count from ~2850 to ~100 which is a huge win
for reducing build directory clutter, its unlikely anything uses the
terminfo data or man pages in the sysroot. This is especially helpful
as we usually end up with two copies of these sets of files.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 443633dfc20177ef88a388d96745675817510c99)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoexternalsrc: Detect code changes in submodules
Tomasz Dziendzielski [Wed, 27 Jan 2021 08:33:31 +0000 (09:33 +0100)]
externalsrc: Detect code changes in submodules

The srctree_hash was calculated only from main source directory ignoring
changes in submodules.

[YOCTO #13748]

Use submodule--helper to determine all submodules, and calculate hash
from all git tree objects names combined.

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 50ff9afb3990bcf60b4fa1f937506cb84028c32d)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agostrace: increase ptest timeout duration 120->240s
Yi Fan Yu [Tue, 26 Jan 2021 22:37:22 +0000 (17:37 -0500)]
strace: increase ptest timeout duration 120->240s

solve qual_fault-syscall.test and qual_fault.test
failing due to timeout.

Bug 14165

Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5af9f32d9b12654793289f44366251f978f6378a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agotimezone: upgrade to 2021a
Ovidiu Panait [Mon, 25 Jan 2021 08:45:52 +0000 (10:45 +0200)]
timezone: upgrade to 2021a

Release 2021a - 2021-01-24 10:54:57 -0800

  Changes to future timestamps

    South Sudan changes from +03 to +02 on 2021-02-01 at 00:00.
    (Thanks to Steffen Thorsen.)

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ed9114df2086c4ad0544cf99c9c1ff8fb7b830b9)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoselftest/devtool: Add modify_localfiles_only test checking symlink path
Tomasz Dziendzielski [Sat, 23 Jan 2021 15:15:10 +0000 (16:15 +0100)]
selftest/devtool: Add modify_localfiles_only test checking symlink path

If recipe uses only file:// fetcher devtool unpacks sources under
oe-local-files/ and adds symlink in source root directory. We need to
verify if the symlink in subdirectory has correct path.

See [YOCTO #13738] for details.

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 044c90d152bfd1b2a23272df39327ba4cd862dff)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoovmf-shell-image: image is only buildable on x86-64
Ross Burton [Fri, 22 Jan 2021 12:52:07 +0000 (12:52 +0000)]
ovmf-shell-image: image is only buildable on x86-64

This image is only buildable for x86-64, so add a COMPATIBLE assignment
to ensure it isn't attempted on others.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bdd8208675c8a0c0232c678804a8b62cd74f1d48)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agocore-image-sato-sdk-ptest: these images need ptest
Ross Burton [Fri, 22 Jan 2021 12:52:06 +0000 (12:52 +0000)]
core-image-sato-sdk-ptest: these images need ptest

As this image isn't buildable without ptest (the packages won't exist),
depend on the ptest DISTRO_FEATURE to ensure we don't try and build it.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0fe856d726c6d9c35533e32e70fbe05ef2b88b17)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agodtc: improve reproducibility
Oleksiy Obitotskyy [Fri, 22 Jan 2021 11:52:50 +0000 (03:52 -0800)]
dtc: improve reproducibility

Makefile override CFLAGS, so -fmacro/debug-prefix-map
optiions was omitted and binaries contains absolute
patch to sources.

Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b58e808a087bbc0a5abd78fd34bb6f1c0c93ba25)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agodevtool: Fix file:// fetcher symlink directory structure
Tomasz Dziendzielski [Thu, 21 Jan 2021 22:31:53 +0000 (23:31 +0100)]
devtool: Fix file:// fetcher symlink directory structure

Add relative path if file is under directory.

[YOCTO #13738]

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 19ddacc1b38f9ebb86a9359963ccc3c707f7125e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agooeqa/selftest/cases/tinfoil.py: increase timeout 10->60s test_wait_event
Yi Fan Yu [Thu, 21 Jan 2021 22:36:39 +0000 (17:36 -0500)]
oeqa/selftest/cases/tinfoil.py: increase timeout 10->60s test_wait_event

The test would timeout on autobuilders. This patch increases the
timeout to 60s

The test will now also exit as soon as we receive the 2 expected events
Expected runtime is around 1s if successful

Bug 14158

Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit be02aa9283f805de718badd5ea12c4968da8774f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoexternalsrc: Fix parsing error with devtool non-git sources
Tomasz Dziendzielski [Wed, 20 Jan 2021 14:55:25 +0000 (15:55 +0100)]
externalsrc: Fix parsing error with devtool non-git sources

If srcdir is under poky directory (e.g. devtool poky/build/workspace/sources)
and is not a git repository then ${@srctree_hash_files(d)} will run "git
rev-parse --git-dir" and detect poky directory as git-dir and run "'git', 'add',
'-A', '.'], cwd=s_dir" trying to add srcdir but build dir is in .gitignore and
latest git will fail with "The following paths are ignored by one of your
.gitignore files: build" which will end with "ExpansionError during parsing".

In this commit I added a check if git_dir is the same as git-dir from
TOPDIR (which will detect poky directory) and if yes, then treat srcdir
as non-git sources.

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 95fbac8dcad6c93f4c9737e9fe13e92ab6befa09)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agodevtool: Fix source extraction for gcc shared source
Tomasz Dziendzielski [Tue, 19 Jan 2021 18:56:29 +0000 (19:56 +0100)]
devtool: Fix source extraction for gcc shared source

If do_patch task is disabled then prepare do_configure dependencies to
fetch external sources and create symlink to ${S} in devtool workspace.

[YOCTO #13036]

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9e47319bfe62d289b90f7545a64dbdc1cbde7f1d)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agotoolchain-shar-relocate.sh: Fix handling files with colons
Oleksiy Obitotskyy yIEf0zt.mo [Tue, 19 Jan 2021 13:02:59 +0000 (05:02 -0800)]
toolchain-shar-relocate.sh: Fix handling files with colons

Files could contain colons in name and we should not use
colons (':') as field separator. E.g. perl/python man
pages packages.

Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 50d2ed0689f1aed6f33b4992d37e2e991c99eb07)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoflex: Fix --noline option behavior
Oleksiy Obitotskyy [Tue, 19 Jan 2021 12:49:38 +0000 (04:49 -0800)]
flex: Fix --noline option behavior

Option --noline or -L does not handled properly.
So generated code contains #line directives with
file absolute path and prevents to create
reproducible builds.

Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0bf2cb7dc2123f220accf1542c2ae4c4b4b8275a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoflex: Refresh patch
zangrc [Wed, 29 Jul 2020 01:31:22 +0000 (09:31 +0800)]
flex: Refresh patch

The patch changes the same file twice which causes issues with some patch
tools (not used in YP by default). Refresh the patch to clean this up
anyway.

RP: Tweak commit message
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cb6e65f8196fd6587c75c3ab2cf060c00a074ec6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoflex: fix build with autoconf 2.70
Ross Burton [Thu, 16 Jul 2020 11:55:45 +0000 (12:55 +0100)]
flex: fix build with autoconf 2.70

autoconf 2.70 is coming soon which has some small behavioural fixes, so
backport a patch from upstream to fix the build with that release.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 946610f2cc8cd42265ee3fab6c73ad4831aaeb4e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agooeqa/ptest: print a warning if ptests failed
Alexander Kanavin [Sat, 19 Dec 2020 17:29:08 +0000 (18:29 +0100)]
oeqa/ptest: print a warning if ptests failed

This allows spotting ptest regressions without having hard ptest failures
(for that full ptest stability should be achieved).

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 79b54d902df2788b0822b6c9cc14705ab00e6a5b)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit 5232c0b480eba4537c8db71c95189950011fb64d)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agosanity.bbclass: sanity check for if bitbake is present in PATH
Dorinda [Tue, 26 Jan 2021 01:33:59 +0000 (02:33 +0100)]
sanity.bbclass: sanity check for if bitbake is present in PATH

If a user executes the environment script instead of sourcing it,
there's an error about an empty element in PATH. This is because
bitbake isn't present in environment variable PATH. Hence, this
patch adds a sanity check to verify if bitbake is present in
PATH and if bitbake isn't present issue a warning message.

[YOCTO #13822]

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e08799913a7f207bc63e085eb98196fd61ed57bc)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agosanity: Verify that user isn't building in PSEUDO_IGNORE_PATHS
Dorinda [Tue, 26 Jan 2021 00:53:47 +0000 (01:53 +0100)]
sanity: Verify that user isn't building in PSEUDO_IGNORE_PATHS

If a user builds in a path in PSEUDO_IGNORE_PATHS, random failures
are generated. Hence this patch adds a sanity check in sanity.bbclass
to ensure that a user isn't building in PSEUDO_IGNORE_PATHS.

[YOCTO #14179]

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 7a681525e904914e938de25df5cc64209097d15d)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Optimise fstab modification for ext2/3/4 and msdos partitions
Paul Barker [Tue, 19 Jan 2021 16:26:10 +0000 (16:26 +0000)]
wic: Optimise fstab modification for ext2/3/4 and msdos partitions

The fix for [Yocto #13994] required the rootfs directory to be copied
(using hardlinks if possible) when modifying the fstab file under wic.

We can optimise this copy away for filesystems where we have the tools
to modify the contents of the partition image after it is created. For
ext2/3/4 filesystems we have the debugfs tool and for msdos/vfat
filesystems we have the mcopy tool. So for any of these filesystems we
skip the modification of the fstab file in the rootfs directory (and
skip the associated copy unless it is otherwise necessary) and update
the contents of fstab directly in the partition image.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5fb8ae0e9159597d7eaa9307a3a8543800bf9405)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Copy rootfs dir if fstab needs updating
Paul Barker [Tue, 19 Jan 2021 16:26:09 +0000 (16:26 +0000)]
wic: Copy rootfs dir if fstab needs updating

By default, wic updates the /etc/fstab in the rootfs to include details
of additional partitions described in the selected wks file. If this
modification is performed in place, other tasks which create an image
file from the rootfs directory (e.g. do_image_tar and do_image_ext4)
will pick up the modified fstab file which would not be appropriate for
those images as they do not include the additional partitions described
in the wks file. wic does undo modifications to the fstab file once it
has finished creating the filesystem image, however this leaves open a
race condition if one of the other tasks reads the contents of the fstab
file from the rootfs directory between the point where wic modifies the
fstab file and the point where wic restores the files original content.

This could be solved by adding a lockfile for tasks which use the rootfs
directory to ensure that no other such task is reading the rootfs
directory while do_image_wic is running. This would serialize several
do_image_* tasks and result in slower builds, especially for large
images. Another drawback of this solution is that it is hard to
selectively optimise - adding lockfiles to do_image_* tasks would result
in these tasks always being serialized even if no fstab modification
will take place.

An alternative solution is to copy the rootfs directory when fstab needs
to be modified. The code to do this in wic already exists as it is
needed when including or excluding content in the rootfs. This still
results in an impact on build times but the copy uses hardlinks if
possible (so little data is actually copied) and we can make selective
optimisations to improve things. The rootfs copy will only take place if
fstab modification is required (or if it was already needed to include
or exclude rootfs content). We can also follow up with further
optimisations after this commit. So this second solution is chosen.

Fixes [Yocto #13994]

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ce682a73b7447652f898ce1d1d0416a456df5416)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Add --change-directory argument
Ricardo Ribalda Delgado [Sun, 19 Apr 2020 06:35:31 +0000 (08:35 +0200)]
wic: Add --change-directory argument

This option allows to specify which part of a rootfs is going to be
included, the same way the -C argument on tar.

Thanks to this option we can make sure the permissions and usernames
on the target partition are respected, and also simplify the creation of
splitted partitons, not neeting to invoke external vars or using .wks.in
files. Eg:

part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/  Â 
part /etc --source rootfs --fstype=ext4 --change-directory=etc

Cc: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2265d089a58e1f78f26d623ee667c420cb1c3bd4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Update pseudo db when excluding content from rootfs
Paul Barker [Tue, 19 Jan 2021 16:26:08 +0000 (16:26 +0000)]
wic: Update pseudo db when excluding content from rootfs

To exclude content from the rootfs, wic makes a copy (using hardlinks if
possible) of the rootfs directory and associated pseudo db, then removes
files & directories as needed. However if these files and directories
are removed using the python functions os.remove and shutil.rmtree, the
copied pseudo db will not be updated correctly. For files copied from
the original rootfs, if hardlinks were used successfully when copying
the rootfs this should mean that the relevant inodes can't be reused and
so the risk of pseudo aborts should be avoided. However, this logic
doesn't apply for directories (as they can't be hardlinked) or for files
added via the '--include-path' argument (as they weren't present in the
original rootfs) and so there remains some risk of inodes being reused
and the pseudo db becoming corrupted.

To fix this, use the 'rm' command under pseudo when removing files &
directories from the copied rootfs to ensure that the copied pseudo db
is updated.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d5db7e268947f0392c2126137571a44acd29ccd6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoimage_types_wic: Move wic working directory
Paul Barker [Tue, 19 Jan 2021 16:26:07 +0000 (16:26 +0000)]
image_types_wic: Move wic working directory

By default the wic working directory is placed under the output
directory. When invoking wic under bitbake, the wic output directory is
added to PSEUDO_PATHS_IGNORE to avoid issues with files being removed
from outside a pseudo environment (see oe-core commit ad8f5532ff).

However, wic will copy the rootfs directory into its working directory
if it needs to add or remove content before creating a filesystem image.
This copy of the rootfs directory must be tracked by pseudo in order to
keep the permissions correct in the resulting image. So we can't have
the wic working directory under a path in PSEUDO_PATHS_IGNORE unless
we like broken permissions.

To fix this the new '-w' argument to wic is used to move the working
directory away from the output directory.

Note that wic deletes the temporary working directory automatically
when it finishes creating an image so users won't normally see the
'tmp-wic' directory under WORKDIR.

Fixes [Yocto #14129]

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4d07169499c47fa9dc759e6f81843416a6dc25c5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Ensure internal workdir is not reused
Paul Barker [Tue, 19 Jan 2021 16:26:06 +0000 (16:26 +0000)]
wic: Ensure internal workdir is not reused

If a path is specified for the internal wic working directory using
the -w/--workdir argument then it must not already exist. Re-using a
previous workdir could easily result in rootfs and intermediate files
from a previous build being added to the current image.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2e40c8d4109024ff704c5ce40d98050ca7f34dd5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit 5dcdb76f89c2e5bbc383e2921589482cd1c51491)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Allow exec_native_cmd to run HOSTTOOLS
Paul Barker [Mon, 11 Jan 2021 10:32:44 +0000 (10:32 +0000)]
wic: Allow exec_native_cmd to run HOSTTOOLS

This allows programs from HOSTTOOLS (e.g. 'install', 'rm', 'mv', etc) to
be more easily executed by wic. Without this change only programs from
an actual *-native recipe built by bitbake can be executed by wic.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 8eb186acdecfbb3151c9a0ab148358e3fe5cce39)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Add workdir argument
Paul Barker [Mon, 11 Jan 2021 10:32:42 +0000 (10:32 +0000)]
wic: Add workdir argument

This allows the path for the temporary workdir used by wic to be set
when running wic from bitbake or directly from the command line.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2e7314ac3a3cab89de93c932e8efc75de0feb0a7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit a2308800b7eb5215982db7269d74d6292075f19f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Update for arm host and memleak fixes/cleanup
Richard Purdie [Sat, 9 Jan 2021 09:14:00 +0000 (09:14 +0000)]
pseudo: Update for arm host and memleak fixes/cleanup

Pulls in:

makewrappers: support architecture-overrides in wrapper modifiers
makewrappers: fix Python 2 hangover
Fix some memory leaks
Disable deprecated function warnings
Silence switch block warnings
pseudo_util: don't overrun strings when looking for keys

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 11a3a9203ad595e7fa92acf442a7f3216d6e3830)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Add lchmod wrapper
Richard Purdie [Wed, 6 Jan 2021 22:31:25 +0000 (22:31 +0000)]
pseudo: Add lchmod wrapper

New versions of glibc have an lchmod function so we need to wrap it.

Identified through a reproducibility issue in initramfs-base where
/dev/console created by mknod from coreutils changed permissions
depending on the host distro (mknod used the gnulib wrapper on most
hosts but newer ones used the libc call).

[YOCTO #14162]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 20a645664977530e602e1ac97e8dc0962e730e6c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobitbake.conf: Add /run/ to PSEUDO_IGNORE_PATHS
Richard Purdie [Wed, 6 Jan 2021 14:42:56 +0000 (14:42 +0000)]
bitbake.conf: Add /run/ to PSEUDO_IGNORE_PATHS

Builds were failing on WSL2 which turns out to be due to accesses to
/run/ on those systems. Add this to PSEUDO_IGNORE_PATHS to fix
builds on WSL2.

[YOCTO #14175]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1d1bf51217e8b4d54af28739d3271484ee5a7974)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolicense.bbclass: Add COMMON_LICENSE_DIR and LICENSE_PATH dirs to PSEUDO_IGNORE_PATHS
Martin Jansa [Tue, 22 Dec 2020 18:08:09 +0000 (19:08 +0100)]
license.bbclass: Add COMMON_LICENSE_DIR and LICENSE_PATH dirs to PSEUDO_IGNORE_PATHS

* now without ${COREBASE}/meta in PSEUDO_IGNORE_PATHS after:
  73d538f207 bitbake.conf: Prevent pyc file generation in pseudo context
  the do_package tasks are failing when LICENSE_CREATE_PACKAGE is enabled
  pseudo.log shows that it's because of license texts copied from
  ${COREBASE}/meta:
  path mismatch [46 links]: ino 96733640 db '/OE/build/tmp-glibc/work/all-oe-linux/foo/1.0/image/usr/share/licenses/foo/generic_Apache-2.0' req '/OE/build/openembedded-core/meta/files/common-licenses/Apache-2.0'.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 39423a33595e7ade82fc88f55823660f8532cb84)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobitbake.conf: Prevent pyc file generation in pseudo context
Paul Barker [Wed, 16 Dec 2020 18:16:16 +0000 (18:16 +0000)]
bitbake.conf: Prevent pyc file generation in pseudo context

This also effectively reverts commit b6d30c21b0:
    bitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta

The contents of ${COREBASE}/meta were ignored as pyc files could be
generated for the contents of the lib subdirectory if python modules
were imported within a pseudo context. However this doesn't protect us
from pyc files being generated in the lib directories for other layers.
It's far better to tell python not to produce pyc files when running
under pseudo (by setting the PYTHONDONTWRITEBYTECODE variable) as this
will cover any location where pyc files could possibly be created. This
variable is set in FAKEROOTBASEENV so that it applies to the
bitbake-worker instance for fakeroot tasks, preventing pyc files from
being generated for imports in python tasks themselves.

Also add a test case to ensure that pyc files are not created in tasks
which are executed under pseudo.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 73d538f20743017a44cea4c20dbe09a0327cfc71)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Pass canonicalized paths in PSEUDO_IGNORE_PATHS
Peter Kjellerstedt [Wed, 9 Dec 2020 17:05:09 +0000 (18:05 +0100)]
wic: Pass canonicalized paths in PSEUDO_IGNORE_PATHS

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 55618cbd58d6784a82e773f323723be6f722232f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobitbake.conf: Canonicalize paths in PSEUDO_IGNORE_PATHS
Peter Kjellerstedt [Wed, 9 Dec 2020 17:05:08 +0000 (18:05 +0100)]
bitbake.conf: Canonicalize paths in PSEUDO_IGNORE_PATHS

Use oe.path.canonicalize() to canonicalize the paths in
PSEUDO_IGNORE_PATHS before passing them to pseudo. This is needed since
pseudo will compare them to paths that are canonicalized.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1f2a497daa09cf3459e27ad6e0e8513938b52c79)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolib/oe/path: Add canonicalize()
Peter Kjellerstedt [Wed, 9 Dec 2020 17:05:07 +0000 (18:05 +0100)]
lib/oe/path: Add canonicalize()

oe.path.canonicalize() is used to canonicalize paths (i.e., remove
symbolic links and "..", and make them absolute). It takes a string
with paths separated by commas, and returns the canonicalized path in
the same format.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 282b19c0e27488ec119f00fb2542ffdc1af54e2a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Drop patches merged into upstream branch
Richard Purdie [Wed, 16 Dec 2020 16:54:26 +0000 (16:54 +0000)]
pseudo: Drop patches merged into upstream branch

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 7386a116222979e6de60c39d2c094d5f216fb101)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agodistutils3: allow setup.py to be run from a different directory to ${S}
Jack Mitchell [Tue, 8 Dec 2020 16:03:14 +0000 (16:03 +0000)]
distutils3: allow setup.py to be run from a different directory to ${S}

Sometimes setup.py can be buried deep in a source tree. This has
traditionally been solved with setting S to the subdirectory in
the source. However with the new pseudo changes, some python modules
make changes to files beneath ${S}, for example:

S = "${WORKDIR}/git/python/pythonmodule"

then in setup.py it works with source code in a relative fashion, such
as:

../../src

This causes pseudo to abort as it isn't tracking the paths. Therefore
implement the variable DISTUTILS_SETUP_PATH so that recipes can use:

S = "${WORKDIR}/git"
DISTUTILS_SETUP_PATH = "${S}/python/pythonmodule"

inherit distutils3

This allows the full source tree to be monitored, while distutils
can run setup.py from a location other than ${S}.

Signed-off-by: Jack Mitchell <ml@embed.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ddcc349cede0c4fe1909df1ded7b0a7c509cd758)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Update to print PSEUDO_LOGFILE in abort message on path mismatches
Tomasz Dziendzielski [Wed, 2 Dec 2020 10:29:46 +0000 (11:29 +0100)]
pseudo: Update to print PSEUDO_LOGFILE in abort message on path mismatches

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9259d684415e3e7923de74359a4ed3487e0e9da7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Simplify pseudo_client_ignore_path_chroot()
Peter Kjellerstedt [Tue, 1 Dec 2020 18:11:47 +0000 (19:11 +0100)]
pseudo: Simplify pseudo_client_ignore_path_chroot()

This also plugs a memory leak in pseudo_client_ignore_path_chroot().

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d8dddd5054a1c4e20a3e32fa9ab31f5859d6fbb6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agouninative: Don't use single sstate for pseudo-native
Richard Purdie [Sat, 21 Nov 2020 16:16:40 +0000 (16:16 +0000)]
uninative: Don't use single sstate for pseudo-native

pseudo-native is a bit special. It conditionally compiles in support for
xattr, statx and statvfs amongst other options. If a pseudo-native binary is
used on a system where these functions are present but it wasn't compiled in
we see hard to debug permissions problems.

An example is the devtool.DevtoolExtractTests.test_devtool_deploy_target
oe-selftest which shows a cryptic error:

  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/selftest/cases/devtool.py", line 1388, in test_devtool_deploy_target
    self.assertEqual(filelist1, filelist2)
  File "/usr/lib64/python3.9/unittest/case.py", line 831, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib64/python3.9/unittest/case.py", line 1037, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File "/usr/lib64/python3.9/unittest/case.py", line 1019, in assertSequenceEqual
    self.fail(msg)
  File "/usr/lib64/python3.9/unittest/case.py", line 670, in fail
    raise self.failureException(msg)

AssertionError: Lists differ: ['-rwxr-xr-x 6000 6000 /etc/init.d/mdmonitor', '-rw-r-[10124 chars]n.8'] != ['-rwxr-xr-x root root /etc/init.d/mdmonitor', '-rw-r-[10124 chars]n.8']

First differing element 0:
'-rwxr-xr-x 6000 6000 /etc/init.d/mdmonitor'
'-rwxr-xr-x root root /etc/init.d/mdmonitor'

This is due to a version of pseudo without statx being used on a system where
ls uses statx, hence the files are displayed as 6000.6000 instead of root.root.

Avoid this by always building pseudo-native for the specific distro in question rather
than using a universal sstate feed.

This hopefully fixes one of the mysterious AB-INT issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 6e3785a3f1f3cf68f5fe101cd6bebe91db165973)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobitbake.conf: Exclude ${CCACHE_DIR} from pseudo database
Mingli Yu [Tue, 27 Oct 2020 01:29:39 +0000 (09:29 +0800)]
bitbake.conf: Exclude ${CCACHE_DIR} from pseudo database

When ccache enabled as below:
INHERIT += "ccache"
CCACHE_DIR = "/path/build/ccache"

There comes do_install failure for some recipes randomly, take
linux-libc-headerswhen as example.
 $ cat /path/build/tmp/work/corei7-64-wrs-linux/linux-libc-headers/5.8-r0/pseudo/pseudo.log
 [snip]
 path mismatch [1 link]: ino 243004209 db '/path/build/ccache/6/stats' req '/path/build/ccache/7/stats.lock'.
 [snip]

Exclude ${CCACHE_DIR} from pseudo database to fix the potential
do_install failure.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b65e5280bf9e7f1f9c8e6acabab79bcf209e5342)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agotcl: adapt to potential pseudo changes
Mingli Yu [Thu, 22 Oct 2020 03:27:25 +0000 (11:27 +0800)]
tcl: adapt to potential pseudo changes

It failed as below when rerun do_install for tcl:
 $ bitbake tcl
 $ bitbake tcl -f -cinstall
 [snip]
 | NOTE: make -j 72 DESTDIR=/build/tmp/work/core2-64-wrs-linux/tcl/8.6.10-r0/image install
 | abort()ing pseudo client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.
 | /build/tmp/work/core2-64-wrs-linux/tcl/8.6.10-r0/temp/run.do_install.3490694: line 184: 3499214 Aborted                 (core dumped) make -j 72 "$@"

By default the S is ${WORKDIR}/${BPN}-${PV}, but after unpack,
the tcl source [1] unpacked to ${WORKDIR}/${BPN}${PV} and all the
files under ${WORKDIR}/${BPN}${PV} are acutally the source files.

But the the main Makefile.in is under ${WORKDIR}/${BPN}${PV}/unix
for tcl, so there is below logic in tcl recipe:
S = "${WORKDIR}/${BPN}${PV}/unix"

To adapt the potential pseudo changes, there is a general logic to
exclude ${S} from pseudo database in base.bbclass in [2]. That's to
say, just the dir ${WORKDIR}/${BPN}${PV}/unix is excluded from the
pseudo database.

But it's not enough for tcl, we need to exclude the actual source dir
${WORKDIR}/${BPN}${PV} from pseudo database specifically to fix the
above do_install failure.

[1] https://downloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz
[2] https://git.openembedded.org/openembedded-core/tree/meta/classes/base.bbclass#n396

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0d835f8069a336fd6bab1058d4e605a81c844212)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agooeqa/selftest/runtime_test: Exclude gpg directory from pseudo database
Richard Purdie [Sat, 10 Oct 2020 12:35:21 +0000 (13:35 +0100)]
oeqa/selftest/runtime_test: Exclude gpg directory from pseudo database

Avoid pseudo abort()s like:
path mismatch [1 link]: ino 6295376 db '/tmp/oeqa-feed-sign-2mw7z81v/S.gpg-agent.yocto-native' req '/tmp/jwkivmu6'.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 189630ca6cdf7ceb6cf9b8f9d86c58997f505efc)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobase.bbclass: use os.path.normpath instead of just comparing WORKDIR and S as strings
Martin Jansa [Fri, 9 Oct 2020 12:58:12 +0000 (14:58 +0200)]
base.bbclass: use os.path.normpath instead of just comparing WORKDIR and S as strings

* cannot use os.path.samefile, because S/B might not exist at this time yet

* there is issue with PSEUDO_IGNORE_PATHS when some recipe sets e.g.
  S = "${WORKDIR}/"
  whole WORKDIR gets added to PSEUDO_IGNORE_PATHS and then the build
  can fail with various strange errors, in my case do_package was
  failing when do_package calls:
  fix_perms(.../1.0-r0/package/etc, 755, 0, 0, /etc)
  and fails with "[Errno 1] Operation not permitted:"

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 50b11a61ab29acb8ec990668353e0b7305114628)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Upgrade to include mkostemp64 wrapper
Richard Purdie [Fri, 9 Oct 2020 10:49:59 +0000 (11:49 +0100)]
pseudo: Upgrade to include mkostemp64 wrapper

Newer systems are using this currently unwrapped glibc function,
add it.

[YOCTO #14080]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cba4f51f0166e2c20e854ee0344be0c58769eaca)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Update to account for patches merged on branch
Richard Purdie [Thu, 8 Oct 2020 14:08:59 +0000 (15:08 +0100)]
pseudo: Update to account for patches merged on branch

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ea22fb3aa1c5dd3edcd1d8b415a0843a9ee4677c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoabi_version,sanity: Tell users TMPDIR must be clean after pseudo changes
Richard Purdie [Thu, 8 Oct 2020 20:34:42 +0000 (21:34 +0100)]
abi_version,sanity: Tell users TMPDIR must be clean after pseudo changes

After the recent path ignore changes, there are invalid entries in exiting
pseudo databases which will trip up users with the new abort() (proving
how common the pseudo potential corrpution is!). Inform them a clean TMPDIR
is needed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 016ee90e210c9b15b80e8370d83f41a14867a413)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta
Richard Purdie [Wed, 7 Oct 2020 22:08:45 +0000 (23:08 +0100)]
bitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta

Unfortunately, .pyc files can be generated in meta/lib/oe which corrupt the pseudo
database so we need to extend the ignore list to cover this as well.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e0cb6dd689a362d8433caa14cc5a9fdd5eb44923)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Fix statx function usage
Richard Purdie [Wed, 7 Oct 2020 16:16:15 +0000 (17:16 +0100)]
pseudo: Fix statx function usage

There is magic in the posts where specific variable names have specific
magic. For that magic to work, "path" needs to be used not "pathname" as
is currently there. Fix this, which fixes path issues on systems using
statx (Ubuntu 20.04 in particular).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f9ae80aee98a7bb59c83ac9ebf9d317302507cec)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Handle new PSEUDO_IGNORE_PATHS variable
Richard Purdie [Sun, 4 Oct 2020 22:42:22 +0000 (23:42 +0100)]
wic: Handle new PSEUDO_IGNORE_PATHS variable

Adjust wic to correctly handle the new PSEUDO_IGNORE_PATH variable and avoid
inode corruption issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 13500f5234361385c365c7c35e83f99435500481)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Avoid creating invalid pseudo directory
Ricardo Ribalda Delgado [Sun, 19 Apr 2020 06:35:33 +0000 (08:35 +0200)]
wic: Avoid creating invalid pseudo directory

If the source of the rootfs is not a bitbake cooked image, or it is not
pointing to the root of one, we call pseudo again, which will produce
a new pseudo folder at rootfs/../pseudo

Eg:

part /etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4

Cc: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 799a24ae78655f7a3eda7456b1a0ffaf3e43ec16)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Fix multi images .wks with bitbake
Ricardo Ribalda Delgado [Sun, 19 Apr 2020 06:35:30 +0000 (08:35 +0200)]
wic: Fix multi images .wks with bitbake

In order to support .wks files with multiple images inside bitbake we
need to explicitly set the pseudo database in use.

Eg: If we try this .mks:
part / --source rootfs --ondisk sda --fstype=ext4
part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4

The username for all the files under /export will be set to the runner
of bitbake (usually UID 1000).

Before we run wic, we need to make sure that the pseudo database will be
flushed, and contains all the data needed.

Cc: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit dde90a5dd2b22a539095d1bac82acc15c6380ac8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowic: Fix permissions when using exclude or include path
Ricardo Ribalda Delgado [Sun, 19 Apr 2020 06:35:29 +0000 (08:35 +0200)]
wic: Fix permissions when using exclude or include path

When parameters include_path or exclude_path are passed to the rootfs
plugin, it will copy the partition content into a folder and make all
the modifications there.

This is done using copyhardlinktree(), which does not take into
consideration the content of the pseudo folder, which contains the
information about the right permissions and ownership of the folders.

This results in a rootfs owned by the user that is running the wic
command (usually UID 1000), which makes some rootfs unbootable.

This bug can be easily triggerd with the following .wks

part / --source rootfs --fstype=ext4 --exclude-path=home

And this sequence:

$ wic create test-permissions -e core-image-minimal -o test/
$ sudo mount test/test-permissions-202004080823-sda.direct.p1 /mnt
$ ls -la /mnt/etc/shadow

To fix this we copy the content of the pseudo folders to the new folder
and modify the pseudo database using the "pseudo -B" command.

If the rootfs is not a rootfs generated by bitbake a warning is shown
making the user aware that the permissions on the target might not match
what he expects.

WARNING: /tmp/test/../pseudo folder does not exist. Usernames and permissions will be invalid

Cc: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit fd739c15cdba221d9d497d3402b7d929c0be2ca4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agobase/bitbake.conf: Enable pseudo path filtering
Richard Purdie [Thu, 24 Sep 2020 21:44:43 +0000 (22:44 +0100)]
base/bitbake.conf: Enable pseudo path filtering

This is a pretty big change to the way pseudo operates when used in OpenEmbedded.
Normally, pseudo monitors and logs (adds to its database) any file created or
modified whilst in a fakeroot environment. There are large numbers of files
we simply don't care about the permissions of whilst in that fakeroot context,
for example ${S}, ${B}, ${T}, ${SSTATE_DIR}, the central sstate control
directories,

This change uses new functionality in pseudo to ignore these directory trees,
resulting in a cleaner database with less chance of "stray" mismatches if files
are modified outside pseudo context. It also should reduce some overhead from
pseudo as the interprocess round trip to the server is avoided.

There is a possible complication where some existing recipe may break, for
example, we found a recipe which was writing to "${B}/install" for
"make install" in do_install and since we listed ${B} as not to be tracked,
there were errors trying to chown root for files in this location.

This patch fixes a few corner cases in OE-Core when used with this new
ignore list:

* The archiver directory matched a "${WORKDIR}/deploy*" pattern so was renamed
  to something else since that directory does need its root permissions
* The ${S} and ${B} ignoring is conditional on them being different to ${WORKDIR}
* package_write_* task output (the debs/rpms/ipks) are now owned by the build
  user so we don't want the file ownership information in the hashequiv outhash
  calculation even if they are built under pseudo.
* The fontcache postinstall intercept is run under qemu outside of pseudo context
  so delete files it may delete up front where pseudo can see this.
* SSTATE_DIR is in PSEUDO_PATHS_IGNORE, which is in FAKEROOTENV which is cached
  by bitbake. We therefore need to trigger reparsing if this changes, which means
  SSTATE_DIR can be in BB_HASHBASE_WHITELIST but not BB_HASHCONFIG_WHITELIST.
  Rework the variables to handle this. This otherwise breaks some of our sstate
  tests in oe-selftest.
* Ignore the temp directory wic uses for rebuilding rootfs.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ad8f5532ffaead9a5ad13e1034fe9e5e1b7979f4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Add pathfix patch
Richard Purdie [Sat, 3 Oct 2020 16:27:10 +0000 (17:27 +0100)]
pseudo: Add pathfix patch

Add a path to fix up handling of dirfd being passed as a full file
and with path="".

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3006bbe7768e4efe33d3d2d3f5786a561ecbe96f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Add may unlink patch
Richard Purdie [Sat, 3 Oct 2020 11:02:36 +0000 (12:02 +0100)]
pseudo: Add may unlink patch

Mark files which are unlinked (nlink == 0) but open with fd's as
"may-unlink" to avoid problematic database entries.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e1e481f3608c05ab14c61bf45cd0837d7287b6a5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Fix xattr segfault
Richard Purdie [Thu, 1 Oct 2020 17:20:06 +0000 (18:20 +0100)]
pseudo: Fix xattr segfault

Fix a NULL pointer dereference exposed by the path ignore code in
xattr handling.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 929a27bf6cbca94d1141d2094ae0c915d93bd3f4)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopsuedo: Add tracking of linked files for fds
Richard Purdie [Wed, 30 Sep 2020 13:36:20 +0000 (14:36 +0100)]
psuedo: Add tracking of linked files for fds

Where files are link()'d and one is unlink()'d, pseudo's fd mappings
can become confused. Add a patch to try and improve this for the common
usecases we see.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9ce621fa2099608ca0ccbb8420b31d71cdd7b00e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Abort on mismatch patch
Richard Purdie [Tue, 29 Sep 2020 16:57:38 +0000 (17:57 +0100)]
pseudo: Abort on mismatch patch

Rather than doing what turns out to be a rather dangerous "fixup" if
we see a file with a different path but the same inode as another file
we've previously seen, throw and abort. Direct the user to a wiki page
where we can maintain information about what this error means.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2db491d97da08d44ebd257f98489550a82a7935c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Add support for ignoring paths from the pseudo DB
Richard Purdie [Wed, 23 Sep 2020 23:02:04 +0000 (00:02 +0100)]
pseudo: Add support for ignoring paths from the pseudo DB

Add PSEUDO_IGNORE_PATHS, a comma separated list of path prefixes, where
any files underneath are not handled by pseudo. This allows files to
be left out of the pseudo datanase where we know we don't need the
fake root emulation. This is particularly useful if we know these files
can be deleted outside of pseudo context.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 8defb687a2c0ffac232c4d0d63a590871c453a2e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Ignore mismatched inodes from the db
Richard Purdie [Tue, 22 Sep 2020 13:07:48 +0000 (14:07 +0100)]
pseudo: Ignore mismatched inodes from the db

Currently, where pseudo finds a database entry for an inode but the path
doesn't match, it reuses that database entry metadata. This is causing
real world "corruption" of file attributes.

See [YOCTO #14057] for an example of this.

This can happen when files are deleted outside of pseudo context and the
inode is reused by a new file which pseduo then "sees".

Its possible the opposite could happen, it needs to reuse attributes
but this change would prevent it. As far as I can tell, we don't want
pseuo to reuse these attributes though so this code should be safer
and avoid bugs like the above.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1c13149b81e03a1ac48b27a208a139d5493c3ce7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: fix renaming to self
Joe Slater [Wed, 26 Aug 2020 18:58:57 +0000 (11:58 -0700)]
pseudo: fix renaming to self

Pseudo tests for an item being renamed to itself only after
information about it has been deleted.  Move the test to before
we change the database.

Note that pseudo does not support renameat2(), but neither does
glibc.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 6b3d109f42385ad1cf1f297a6c06ea7eb6509f26)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Update to add OFC fcntl lock updates
Richard Purdie [Mon, 20 Jul 2020 10:27:32 +0000 (11:27 +0100)]
pseudo: Update to add OFC fcntl lock updates

This adds in support for the OFC fcntl ioctl lock flags, removing
warnings on some more recent linux kernels.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 234168f803bee2e5b0955aabaddb1d967349fb82)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: merge in fixes for setfacl issue
Richard Purdie [Fri, 26 Jun 2020 10:49:53 +0000 (11:49 +0100)]
pseudo: merge in fixes for setfacl issue

[YOCTO #13959]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 18fbd28c9aa0276d110839c4282a9ab75fc9f28e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agopseudo: Switch to oe-core branch in git repo
Richard Purdie [Fri, 26 Jun 2020 10:47:12 +0000 (11:47 +0100)]
pseudo: Switch to oe-core branch in git repo

We have a significant number of outstanding patches to pseudo. Rather than
queue these up as patches, create a branch in the upstream repo and use that
until such times as we have someone with the time/skills to properly review
these for master in the pseudo repo.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f09088eaa803ce396726368626a35dee70168d91)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agolinuxloader: Avoid confusing string concat errors
Richard Purdie [Sat, 19 Dec 2020 11:42:58 +0000 (11:42 +0000)]
linuxloader: Avoid confusing string concat errors

None is a bad choice of return value for functions used in variables
(strings) as a failure results in concatination errors. Use a string
with a clear meaning that can be searched for instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 years agoppp: Whitelist CVE-2020-15704
Robert Joslyn [Sun, 17 Jan 2021 18:42:33 +0000 (10:42 -0800)]
ppp: Whitelist CVE-2020-15704

This CVE only applies to the load_ppp_generic_if_needed patch applied by
Ubuntu. This patch is not used by OpenEmbedded, so the CVE does not
apply.

Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agozip: whitelist CVE-2018-13410 and CVE-2018-13684
Mikko Rapeli [Fri, 15 Jan 2021 17:05:44 +0000 (19:05 +0200)]
zip: whitelist CVE-2018-13410 and CVE-2018-13684

https://nvd.nist.gov/vuln/detail/CVE-2018-13410 is disputed and
also Debian considers it not a vulnerability:

https://security-tracker.debian.org/tracker/CVE-2018-13410

http://seclists.org/fulldisclosure/2018/Jul/24
"Negligible security impact, would involve that a untrusted party controls the -TT value."

https://nvd.nist.gov/vuln/detail/CVE-2018-13684 is not for zip, also Debian concludes this:

https://security-tracker.debian.org/tracker/CVE-2018-13684

"NOT-FOR-US: smart contract implementation for ZIP"

Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 06b72a91b6dcf63fed437fd2105c59e922ba6525)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoglibc: CVE-2019-25013
Scott Murray [Thu, 14 Jan 2021 20:13:16 +0000 (12:13 -0800)]
glibc: CVE-2019-25013

Source: openembedded.org
MR: 107928
Type: Security Fix
Disposition: Backport from https://git.openembedded.org/openembedded-core/commit/meta/recipes-core/glibc?id=53d149df4d8832e34ace2470c31ddc688176faf7
ChangeID: 462441a4a91cb481401e170876c25dcdbd00f1e0
Description:

* CVE detail: https://nvd.nist.gov/vuln/detail/CVE-2019-25013

* upstream tracking: https://sourceware.org/bugzilla/show_bug.cgi?id=24973

* patch from upstream:
    https://sourceware.org/git/?p=glibc.git;a=patch;
    h=ee7a3144c9922808181009b7b3e50e852fb4999b

(From OE-Core rev: 53d149df4d8832e34ace2470c31ddc688176faf7)

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 164b3e63612b40e984aec19c5a54c8ae408725ec)
Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoglibc: Security fix for CVE-2020-29573
Armin Kuster [Thu, 14 Jan 2021 19:51:17 +0000 (11:51 -0800)]
glibc: Security fix for CVE-2020-29573

Source: glibc.org
MR: 107580
Type: Security Fix
Disposition: Backport from https://sourceware.org/git/?p=glibc.git;a=commit;h=681900d29683722b1cb0a8e565a0585846ec5a61

ChangeID: 7bc5edb2e1947ac0774a453000a1568bbe3bb7d2
Description:

Fixedup to match 2.31 context. ldbl2mpn.c is in i386 for this version

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoxorg: Security fix for CVE-2020-14345
Armin Kuster [Thu, 14 Jan 2021 18:15:12 +0000 (10:15 -0800)]
xorg: Security fix for CVE-2020-14345

Source: freedesktop.org
MR: 105894
Type: Security Fix
Disposition: Backport from https://gitlab.freedesktop.org/xorg/xserver/-/commit/f7cd1276bbd4fe3a9700096dec33b52b8440788d
ChangeID: 2c6b7553d8e5bc152258ad1794d95cb7d8b215eb
Description:

CVE-2020-14345 fix

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agocurl: fix CVE-2020-8231/8284/8285/8286
Lee Chee Yang [Wed, 13 Jan 2021 09:29:35 +0000 (17:29 +0800)]
curl: fix CVE-2020-8231/8284/8285/8286

backport CVE-2020-8284 fixes from upstream, but drop
binary file tests/data/test1465.

upstream fixes for CVE-2020-8231, CVE-2020-8285 and CVE-2020-8286
does not applies cleanly to 7.69.1, fedora have working patch
hence import patch from Fedora.
https://koji.fedoraproject.org/koji/rpminfo?rpmID=24270817

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agowaf: don't assume the waf intepretter is good
Ross Burton [Sat, 16 Jan 2021 17:44:14 +0000 (09:44 -0800)]
waf: don't assume the waf intepretter is good

Waf typically uses `python` as the intepretter but inside a task this
does not exist.  Typically this is solved by patching waf (see the
glmark2 recipe) but not all versionf of Waf support Python 3 so we can't
assume a specific interpretter.

Instead, create a new variable WAF_PYTHON for the correct interpretter,
and default this to `python3`.  If the user has a recipe that needs
Python 2 then this can be changed in the recipe.

(From OE-Core rev: 802e80d35e6374b9b80f89068d00b84fe2d04ca1)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 85b6301c6190a1d1823de9bfe7285f7a7d15a46f)
[Fixes build issue on Ubuntu 20 with mvp
https://github.com/openembedded/meta-openembedded/issues/304 ]
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 years agoclasses/waf: Add build and install arguments
Joshua Watt [Sat, 16 Jan 2021 17:44:13 +0000 (09:44 -0800)]
classes/waf: Add build and install arguments

Adds variables that can be used to allow a recipe to pass extra
arguments to `waf build` and `waf install`. In most cases, you want to
pass the same arguments to `build` and `install` (since install is a
superset of `build`), so by default setting EXTRA_OEWAF_BUILD also
affects `waf install`, but this can be overridded.

(From OE-Core rev: 493e17a2f5cbbbe3b1e435dadb281b007bca2cbf)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 633652284b13dc78206f4cc8e81f29de44777b75)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>