Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
apk-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
60
Issues
60
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
apk-tools
Commits
99010588
Commit
99010588
authored
Apr 22, 2011
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db: remount ro cache to rw earlier for update to work
parent
595c6659
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
src/database.c
src/database.c
+16
-15
No files found.
src/database.c
View file @
99010588
...
...
@@ -1263,6 +1263,22 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
}
}
}
if
((
dbopts
->
open_flags
&
(
APK_OPENF_WRITE
|
APK_OPENF_CACHE_WRITE
))
&&
db
->
ro_cache
)
{
/* remount cache read-write */
db
->
cache_remount_dir
=
find_mountpoint
(
db
->
root_fd
,
db
->
cache_dir
);
if
(
db
->
cache_remount_dir
==
NULL
)
{
apk_warning
(
"Unable to find cache directory mount point"
);
}
else
if
(
do_remount
(
db
->
cache_remount_dir
,
"rw"
)
!=
0
)
{
free
(
db
->
cache_remount_dir
);
db
->
cache_remount_dir
=
NULL
;
apk_error
(
"Unable to remount cache read-write"
);
r
=
EROFS
;
goto
ret_r
;
}
}
if
(
!
(
dbopts
->
open_flags
&
APK_OPENF_NO_SYS_REPOS
))
{
list_for_each_entry
(
repo
,
&
dbopts
->
repository_list
,
list
)
{
r
=
apk_db_add_repository
(
db
,
APK_BLOB_STR
(
repo
->
url
));
...
...
@@ -1293,21 +1309,6 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
"might not function properly"
);
}
if
((
dbopts
->
open_flags
&
(
APK_OPENF_WRITE
|
APK_OPENF_CACHE_WRITE
))
&&
db
->
ro_cache
)
{
/* remount cache read-write */
db
->
cache_remount_dir
=
find_mountpoint
(
db
->
root_fd
,
db
->
cache_dir
);
if
(
db
->
cache_remount_dir
==
NULL
)
{
apk_warning
(
"Unable to find cache directory mount point"
);
}
else
if
(
do_remount
(
db
->
cache_remount_dir
,
"rw"
)
!=
0
)
{
free
(
db
->
cache_remount_dir
);
db
->
cache_remount_dir
=
NULL
;
apk_error
(
"Unable to remount cache read-write"
);
r
=
EROFS
;
goto
ret_r
;
}
}
return
rr
;
ret_errno:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment