Commit Graph

102 Commits

Author SHA1 Message Date
Sandro Jäckel
376f1c80a9 build: use long hashes when generating feed.buildinfo
Short hashes are not guaranteed to be unambiguous forever and could
collide if the repo grows over time. Git also estimates how many
characters are roughly required to prevent such a collision and slowly
increases the amount of characters beginning from 6, OpenWrt is already
at 8. Lets use the full hash the have a predictable length and keep
hashes unambiguous forever.

Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2023-11-02 12:40:44 +01:00
Paul Spooren
7fae1e5677 feeds: use git-src-full to allow Git versioning
Both $(AUTORELEASE) and $(PKG_SRC_VERSION) (from luci.git) use the Git
log to determine releases and package timestamps.

Feeds are shallow cloned by default, resulting in an incomplete Git log
and therefore different local package versions than offered upstream.

This commits sets the default feeds to use `src-git-full` to solve that.

Add fixes from "2b1d92f: scripts/feeds: silence git warning by selecting
pull style" to `src-git-full`

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-15 00:24:24 +01:00
Felix Fietkau
ebc36ebb23 scripts/feeds: install targets to target/linux/feeds and support overriding
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-24 13:29:05 +01:00
Felix Fietkau
0bdf8d1206 scripts/feeds: fix installing targets without explicitly specifying the feed
Add similar code to what is done on packages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-24 13:29:05 +01:00
Ansuel Smith
88204bfa82 treewide: drop use of which
Ubuntu started to flag which as deprecated and it
seems which is not really standard and may vary
across Distro.
Drop the use of which and use the standard 'command -v'
for this simple task.
Which is still present in the prereq if some package/script
still use which.
A utility script called command_all.sh is implemented that
will just mimic the output of which -a.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-01-17 09:14:26 +01:00
Karel Kočí
1aa80ce393 scripts/feeds: generate index after all feeds are updated
This separates index update from feed update. The result is that all
requested feeds are first updated and only then indexed.

The reason for this change is to prevent errors being reported and
potentially invalid index being generated thanks to cross feeds
dependency.
The feeds script pulls in default all feeds as they come and on install
prefers packages from first feeds (unless special feed is requested).
Thus order of feeds in some way specifies preferences. This is handy for
downstream distributions as they can simply override any package from
upstream feeds by placing their feed before them. This removes need to
patch or fork upstream feeds.
The problem is that such feed most likely depends in some way also on
subsequent feeds. The most likely feeds are 'packages' or 'luci'. The
example would be Python package that needs 'python.mk' from 'packages'
feed. Ordering custom feed after dependent feeds is sometimes just not
possible because of preference requirement described before.
The solution is to just first pull all feeds and generate indexes only
after that. In the end this ensures that index is generated correctly at
first try without any error.

In terms of code this removes 'perform_update' argument from
'update_feed' as with index update removal the update is the only action
performed in that subroutine. Thus this moves condition to 'update'
subroutine.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
2021-06-07 12:44:50 -10:00
Paul Spooren
a323a653f0 scripts/feed: no warn on toolchain/linux overwrite
The recent 7f285d "scripts/feeds: warn when skipping core package
override" floods SDK output with warning of overwriting "linux" and
"toolchain" core packages. This should be ignored as these are not
regular packages added via feeds.

While at it slightly improve the warning string.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-01-06 14:04:34 -10:00
Karel Kočí
a3e5b24d43 scripts/feeds: fix preference of package install
The previous behavior prefered same feed for dependent packages as
initial package. This caused inconsitency in installation of packages.
The difference was if two feeds provide same package (different version)
there was different result if you executed install for that specific
version compared to install for package depending on it from different
feed.

This ensures that preferred feed is propagated without change and
selected feed is used only really for package it was selected for.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
2020-12-09 23:25:05 -10:00
Brian Norris
7f285d0b43 scripts/feeds: warn when skipping core package override
Otherwise, a n00b like myself can get quite confused when moving a
package from core to feeds, for example.

(Hint: one *really* needs to clear out the tmp/info/.packageinfo...
entries for the stale package, but '-f' works as well.)

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2020-12-09 11:30:07 -10:00
Hannu Nyman
2b1d92f134 scripts/feeds: silence git warning by selecting pull style
Silence the warning in git 2.27 about undefined fast-forward style
in git pull. Define "ff-only" as the style.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-11-26 19:29:18 -10:00
Felix Fietkau
d5cd80a1e8 scripts/feeds: fix accepting "-" in feed type string
Fixes a syntax error in processing the type src-git-full

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-15 19:54:03 +02:00
Bjørn Mork
a21b70be31 scripts/feeds: fix 'src-include' directive
Commit 775b70f8d5 renamed parse_file() parameters without
updating the recursive call. This broke parsing of any feeds.conf
using 'src-include'.

 $ scripts/feeds update -a
 Can't use string ("defaults") as a HASH ref while "strict refs" in use at scripts/feeds line 63, <$fh> line 1.

Fixes: 775b70f8d5 ("scripts/feeds: allow adding parameters to feeds")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2019-09-02 16:48:40 +02:00
Jo-Philipp Wich
775b70f8d5 scripts/feeds: allow adding parameters to feeds
this allows adding "--" prefixed parameters inside feeds.conf between the
target and name. The first parameter is --force which has the same effect
as using -f when installing any of the packages. This allows creating
feeds that will override base packages by default.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-08-28 16:10:41 +02:00
Bjørn Mork
7a1b575ac4 scripts/feeds: add src-include method
The src-include method allows recursive inclusion of feeds.conf snippets.

This can for example be used for adding static local feeds to
feeds.conf.default without ever having to update the local feeds.conf:

 src-include defaults feeds.conf.default
 src-link custom /usr/local/src/lede/custom

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2019-07-01 16:18:44 +02:00
Matthias Schiffer
16035a7dd3
include/feeds.mk: rework generation of opkg distfeeds.conf
Allow enabling/commenting/disabling each feed individually by using a
tristate config symbol.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-07-12 21:18:41 +02:00
Matthias Schiffer
6bdd5d8459
scripts/feeds: add src-dummy method
The src-dummy method does not actually obtain any feed, but it can be used
to insert addtional entries into the opkg distfeeds.conf. This is useful to
make package feeds available to users without requiring the corresponding
source feeds to be available during build.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-07-12 21:16:40 +02:00
Felix Fietkau
29b2199eb0 build: fix target metadata scan dependencies
Move SCAN_DEPS to scan.mk to eliminate redundancy with scripts/feeds
Add image/*.mk to SCAN_DEPS for targets to pick up newly added devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-07-02 14:27:06 +02:00
Felix Fietkau
41ab276fe4 scripts/feeds: add support for git feeds with submodules
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-04-27 15:19:19 +02:00
Matthias Schiffer
06d51dbb9e
scripts/feeds: fix install of packages with different source/binary names
The logic for choice between source and binary packages was reversed.

Fixes: 52719c2b67 "metadata: scripts/feeds: distinguish between source
and binary packages, resolve virtual dependencies"
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-01-14 17:07:58 +01:00
Matthias Schiffer
52719c2b67
metadata: scripts/feeds: distinguish between source and binary packages, resolve virtual dependencies
Properly resolve build depends to source packages and runtime depends to
binary packages. Dependencies on virtual packages are resolved to the first
provider now.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-01-13 19:54:45 +01:00
Matthias Schiffer
47d6b05ad3
metadata: always resolve dependencies through provides list
Instead of adding virtual packages to the normal package list, keep a
separate list for provides, make each package provide itself, and resolve
all dependencies through this list. This allows to use PROVIDES to replace
existing packages.

Fixes FS#837.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-01-13 19:54:44 +01:00
Matthias Schiffer
423ec18116
metadata: remove redundant fields from package hash
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-01-13 19:54:44 +01:00
Matthias Schiffer
504cb913eb
metadata: change pkg->{src} field to hold a reference
We often want to access fields of a source packages through pkg->{src}.
Allow accessing them directly instead of resolving the source hash through
srcpackages.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-01-13 19:54:44 +01:00
Matthias Schiffer
b2ab9c9d33
metadata: move 'builddepends' from binary to source packages
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-01-13 19:54:43 +01:00
Matthias Schiffer
19577582e4
metadata: make srcpackage extensible
Turn the srcpackage values into hashes to allow storing more information
than just binary package names.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-01-13 19:54:43 +01:00
Michal Sojka
b1f102b03e scripts/feeds: Reuse TOPDIR if defined in environment
The feeds script sets value of TOPDIR in a way that is inconsistent
with how toplevel Makefile sets it. The inconsistency manifests when I
use a "build directory" with symlinks to LEDE source (see below).

When make is invoked in such a directory, make's TOPDIR variable is
set to that directory, whereas scripts/feeds sets TOPDIR to the top of
LEDE source, which results in creating feeds directory inside the LEDE
source instead of in the build directory.

This patch changes the script so that it reuses the TOPDIR value form
the environment if it exists. The result is that 'make
package/symlinks' correctly fetches feeds to the build directory
instead in the source.

I use the following commands to create the build directory:

    ln -s $SRC/config config
    ln -s $SRC/Config.in Config.in
    ln -s $SRC/feeds.conf.default feeds.conf.default
    ln -s $SRC/include include
    ln -s $SRC/Makefile Makefile
    mkdir package
    ln -s $SRC/package/base-files package/base-files
    ln -s $SRC/package/boot package/boot
    ln -s $SRC/package/devel package/devel
    ln -s $SRC/package/firmware package/firmware
    ln -s $SRC/package/kernel package/kernel
    ln -s $SRC/package/libs package/libs
    ln -s $SRC/package/Makefile package/Makefile
    ln -s $SRC/package/network package/network
    ln -s $SRC/package/system package/system
    ln -s $SRC/package/utils package/utils
    ln -s $SRC/rules.mk rules.mk
    ln -s $SRC/scripts scripts
    ln -s $SRC/target target
    ln -s $SRC/toolchain toolchain
    ln -s $SRC/tools tools

This allows me to easily test changes in LEDE on multiple targets.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
2017-02-21 13:03:20 +01:00
Jo-Philipp Wich
3bfcd21e4b feeds: add option to force feed update despite modified files
Implement a new flag "-f" for the feeds update command which causes the
script to fall back to a more agressive git update strategy in case there
are locally modified files in the feeds directory.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-02-15 10:07:00 +01:00
Rafał Miłecki
0a6439154a scripts/feeds: use git rev-parse for getting revision
It provides simpler output so we don't need extra head and cut commands.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-08 11:17:11 +01:00
Rafał Miłecki
4f7947dab8 scripts/feeds: display "X" as revision of uninitialized feeds
So far we were displaying "local" which could be misinterpreted. It
wasn't possible e.g. to say if src-link feed was initialized or not.
Hopefully "X" makes (a bit) more sense.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-08 11:17:11 +01:00
Rafał Miłecki
a2944a0c09 scripts/feeds: use 10 chars for feed name column width
It's always hard to find a reasonable width that will make everyone
happy. This one at least makes "telephony" (one of default feeds) name
fit the column and hopefully isn't too big.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-03 08:34:38 +01:00
Daniel Dickinson
34527688fc scripts/feeds: Prevent .config autocreation
When using scripts/feeds upgrade the .config needs to be
updated but the code to do so was also autocreating a
.config if one didn't exist.  This is counter-productive
when you have not yet used menuconfig (or other config targets)
because things like selecting or deselecting CONFIG_ALL
(to build all package by default) only works if the
package selection has not already been done via an
existing .config selection.

Signed-off-by: Daniel Dickinson <lede@daniel.thecshore.com>
2016-07-05 22:59:13 +02:00
Jo-Philipp Wich
df18b3756f scripts: feeds: fix version detection for Make >= 4.2.1
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-06-15 19:10:32 +02:00
Iblis Lin
d9a0a8c78f scripts: avoid hard-coded paths in scripts
Signed-off-by: Iblis Lin <e196819@hotmail.com>
2016-04-28 16:43:28 +02:00
Jonas Gorski
0d54d44349 scripts/feeds: allow export of feeds with static revisions
Add a switch to scripts/feeds that allows listing the feeds with their
currently checked out revisions in feeds.conf compatible format.

This allows providing a feeds.conf for public builds to make replication
of the build easier.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 46706
2015-08-23 09:35:46 +00:00
Jo-Philipp Wich
c5fbcf59e0 scripts/feeds: return error status from feed update
This patch is a modified version of the patch being discussed at here:
https://patchwork.ozlabs.org/patch/471303/
from Martin Strbacka <martin.strbacka@nic.cz>

My version modifies scripts/feeds so that an error with one of the feeds just
raises the error flag, but script continues and tries to update the other
feeds. After all feeds have been updated, the script returns 1 if at least
one feed failed, and 0 on success with all feeds. The user can then utilise
the status in his build script, if he wants.

signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>

SVN-Revision: 46374
2015-07-14 22:27:39 +00:00
Steven Barth
37c015fe25 scripts/feeds: print the source of packages installed
Can be helpful in diagnosing unexpected package overlaps between
feeds/core.

Signed-off-by: Karl Palsson <karlp@remake.is>

SVN-Revision: 46255
2015-07-07 22:32:38 +00:00
Steven Barth
b6d0061fec scripts/feeds: observe -p flag for preferential feeds
lookup_target was trampling the $feed variable, resulting in the -p flag
no longer preferentially installing from the named feed.

Make sure to use a local variable for this instead.

Signed-off-by: Karl Palsson <karlp@remake.is>

SVN-Revision: 46120
2015-06-24 10:57:20 +00:00
Felix Fietkau
7de4c92804 scripts/feeds: fix typo in copied code
do_install_target copied code from do_install_package, but didn't
replace all text.

Signed-off-by: Karl Palsson <karlp@remake.is>

SVN-Revision: 45784
2015-05-27 15:20:22 +00:00
John Crispin
803ebd2725 scripts/feeds: Delete package/feeds folder in the clean procedure to prevent dangling links.
Hello,

if you run:
./scripts/feeds clean
It removes ./feeds folder but not ./package/feeds/ which is full of dangling links then. This patch fixes it.

Best Regards,
Martin Strbačka

Signed-off-by: Martin Strbacka <martin.strbacka@nic.cz>

SVN-Revision: 45738
2015-05-23 15:29:06 +00:00
Felix Fietkau
08436887fb scripts/feeds: add support for optionally using a full clone of git repositories
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45668
2015-05-10 15:51:19 +00:00
Felix Fietkau
4b1165d5c7 scripts/feeds: add support for uninstalling targets
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44782
2015-03-15 11:08:10 +00:00
Felix Fietkau
2484f3a86a scripts/feeds: add support for installing targets
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44781
2015-03-15 11:08:05 +00:00
Felix Fietkau
b7ebb19b02 scripts/feeds: get rid of redundant feed cache copy
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44779
2015-03-15 11:07:57 +00:00
Felix Fietkau
0efcb02c9d scripts/feeds: remove useless install_method abstraction
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44778
2015-03-15 11:07:52 +00:00
Felix Fietkau
b6ac0d799c scripts/feeds: add support for searching for targets
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44777
2015-03-15 11:07:44 +00:00
Felix Fietkau
f8b95e05f1 scripts/feeds: scan for target metadata
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44775
2015-03-15 11:07:34 +00:00
Felix Fietkau
1592f3f607 scripts/feeds: remove a few trailing tabs
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44773
2015-03-15 11:06:50 +00:00
John Crispin
2e2c04777b build: allow openwrt.git packages to be replaced by feeds
Currently, replacing a package available in openwrt.git requires
modifications in openwrt.git, or requires duplicating the package in a
feed but with a different name, which causes all kind of problems
related to dependencies (all packages selecting it would have to be
modified accordingly to select the new package).

With this change, if a package with the same name is present both in
feeds/ and package/ folders, the one in feeds/ can override the one
in package/, both in the menuconfig and during the build, by passing the
"-f" option to "./scripts/feeds install"

This mechanism is particularly useful for vendor tree, or in general for
application which needs to replace one particular package which exists
within openwrt.git by a custom/newer version.

Signed-off-by: Mathieu Olivari <mathieu@qca.qualcomm.com>

SVN-Revision: 44334
2015-02-09 12:09:23 +00:00
John Crispin
b6f268d775 build: revert r44076
the patch causes issues when installing feeds

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 44078
2015-01-22 13:13:09 +00:00
John Crispin
de3bf7e4c2 build: allow openwrt.git packages to be replaced by feeds
Currently, replacing a package available in openwrt.git requires
modifications in openwrt.git, or requires duplicating the package in a
feed but with a different name, which causes all kind of problems
related to dependencies (all packages selecting it would have to be
modified accordingly to select the new package).

With this change, if a package with the same name is present both in
feeds/ and package/ folders, the one in feeds/ can override the one
in package/, both in the menuconfig and during the build, by passing the
"-f" option to "./scripts/feeds install"

This mechanism is particularly useful for vendor tree, or in general for
application which needs to replace one particular package which exists
within openwrt.git by a custom/newer version.

Signed-off-by: Mathieu Olivari <mathieu@qca.qualcomm.com>

SVN-Revision: 44076
2015-01-22 09:35:40 +00:00