From 8981ccbf5b2636c7d2e06b08ffdf87be80fe19c8 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 30 Apr 2012 08:01:55 +0000 Subject: init: only use /etc/apk/world when it exists We should not read /var/lib/apk/world if /etc/apk/world exists. --- initramfs-init.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'initramfs-init.in') diff --git a/initramfs-init.in b/initramfs-init.in index 94cdc1b..bec3b52 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -484,7 +484,12 @@ if [ -f "$ovl" ]; then [ -d "$sysroot/root" ] && chmod 700 "$sysroot/root" pkgs="$pkgs $(sed 's/\#.*//' $sysroot/etc/lbu/packages.list 2>/dev/null)" rm -f "$sysroot"/etc/lbu/packages.list - pkgs="$pkgs $(cat $sysroot/var/lib/apk/world $sysroot/etc/apk/world 2>/dev/null)" + for world in etc/apk/world var/lib/apk/world; do + if [ -e "$sysroot/$world" ]; then + pkgs="$pkgs $(cat $sysroot/$world)" + break; + fi + done else # add some boot services by default rc_add devfs sysinit -- cgit v1.2.3