image: apk: remove explicit distfeeds handling

Currently the build fails due to the following:

 mv: cannot stat 'linux-mediatek_filogic/target-dir-7872e783/etc/apk/repositories': No such file or directory

as the changes done in the commit e031dab93e ("base-files: move apk
distfeeds into directory") forget to adapt image generation part.

While looking into this, I've realized, that we don't need this explicit
handling in the image generating code since the feeds are solely
configured by `base-files` and `apk` packages, so those should always
provide the correct feeds content, so lets simply drop this unnecessary
code.

Moving away /etc/opkg is done to prevent opkg from picking up the remote
feeds defined from base-files and only use the local feeds, but for apk
we explicitly pass --repositories-file which disables parsing of
/etc/apk/repositories and /etc/apk/repositories.d, so we do not need to
backup anything.

Fixes: #16981
Fixes: e031dab93e ("base-files: move apk distfeeds into directory")
Reported-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[jonas.gorski: add an explicit explanation where the original mv comes
from and why we don't need it for apk].
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
This commit is contained in:
Petr Štetiar 2024-11-17 06:50:05 +00:00 committed by Jonas Gorski
parent afffcd09e5
commit bdfae5a166

View File

@ -372,12 +372,10 @@ target-dir-%: FORCE
ifneq ($(CONFIG_USE_APK),) ifneq ($(CONFIG_USE_APK),)
rm -rf $(mkfs_cur_target_dir) rm -rf $(mkfs_cur_target_dir)
$(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir) $(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir)
mv $(mkfs_cur_target_dir)/etc/apk/repositories $(mkfs_cur_target_dir).repositories
$(if $(mkfs_packages_remove), \ $(if $(mkfs_packages_remove), \
$(apk_target) del $(mkfs_packages_remove)) $(apk_target) del $(mkfs_packages_remove))
$(if $(mkfs_packages_add), \ $(if $(mkfs_packages_add), \
$(apk_target) add $(mkfs_packages_add)) $(apk_target) add $(mkfs_packages_add))
mv $(mkfs_cur_target_dir).repositories $(mkfs_cur_target_dir)/etc/apk/repositories
else else
rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg rm -rf $(mkfs_cur_target_dir) $(mkfs_cur_target_dir).opkg
$(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir) $(CP) $(TARGET_DIR_ORIG) $(mkfs_cur_target_dir)