aboutsummaryrefslogtreecommitdiffstats
path: root/main/mkinitfs/0001-Revert-init-only-use-etc-apk-world-when-it-exists.patch
blob: 41d1bdd1d2d131ef689e9218c504446008a4fe01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 4c8535b759fb9f2b34d05f971bee3a4ecc86b734 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 17 May 2012 14:33:18 +0000
Subject: [PATCH] Revert "init: only use /etc/apk/world when it exists"

We can not only use /etc/apk/world since it will always
be there due to previous apk add --initdb.

Instead, clean up the /var/lib/apk/world after upgrade

This reverts commit 8981ccbf5b2636c7d2e06b08ffdf87be80fe19c8.

Conflicts:
	initramfs-init.in
---
 initramfs-init.in |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/initramfs-init.in b/initramfs-init.in
index b14ebf9..6e1ebc1 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -481,13 +481,11 @@ if [ -f "$ovl" ]; then
 	# hack, incase /root/.ssh was included in apkovl
 	[ -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
-	for world in etc/apk/world var/lib/apk/world; do
-		if [ -e "$sysroot/$world" ]; then
-			pkgs="$pkgs $(cat $sysroot/$world)"
-			break;
-		fi
-	done
+	pkgs="$pkgs $(cat $sysroot/var/lib/apk/world \
+		$sysroot/etc/apk/world 2>/dev/null)"
+	# clean up after upgrade
+	rm -f $sysroot/etc/lbu/packages.list \
+		$sysroot/var/lib/apk/world
 
 	# fix up inittab from pre openrc times (alpine v1.8)
 	if [ -f "$sysroot"/etc/inittab ]; then
-- 
1.7.10.2