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
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
alpine-conf
Commits
13d1c081
Commit
13d1c081
authored
Feb 09, 2010
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-disk: implemeint -o option for restoring from apkovl
parent
dedf2504
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
setup-disk.in
setup-disk.in
+15
-4
No files found.
setup-disk.in
View file @
13d1c081
...
...
@@ -87,8 +87,13 @@ install_mounted_root() {
rootdisk
=
$(
disk_from_part
$rootdev
)
if
[
-z
"
$APKOVL
"
]
;
then
lbu package - |
tar
-C
"
$mnt
"
-zx
else
echo
"Restoring backup from
$APKOVL
to
$rootdev
..."
tar
-C
"
$mnt
"
-zxf
"
$APKOVL
"
fi
echon
"Installing system on
$rootdev
: "
lbu package - |
tar
-C
"
$mnt
"
-zx
# apk reads config from target root so we need to copy the config
mkdir
-p
"
$mnt
"
/etc/apk/keys/
cp
/etc/apk/keys/
*
"
$mnt
"
/etc/apk/keys/
...
...
@@ -188,7 +193,10 @@ is_available_disk() {
has_mounted_part
$dev
&&
return
1
# check so its not part of an md setup
has_holders /sys/block/
$b
&&
return
1
if
has_holders /sys/block/
$b
;
then
[
-n
"
$USE_RAID
"
]
&&
echo
"Warning:
$dev
is part of a running raid"
>
&2
return
1
fi
# check so its not an md device
[
-e
/sys/block/
$b
/md
]
&&
return
1
...
...
@@ -204,7 +212,6 @@ find_disks() {
}
useall
()
{
local
rootdisk_dev
=
"
$1
"
local
i size
local
boot_size
=
100
boot_part_type
=
"83"
...
...
@@ -234,6 +241,9 @@ useall() {
echo
" swap
${
swap_size
}
MB"
echo
" /
${
root_size
}
MB"
echo
""
if
[
-n
"
$APKOVL
"
]
;
then
echo
"System from
$APKOVL
will be restored"
fi
echo
-n
"WARNING: All contents of
$rootdisk_dev
will be erased. Continue? [y/N]: "
read
i
case
"
$i
"
in
...
...
@@ -310,9 +320,10 @@ EOF
}
# Parse args
while
getopts
"r"
opt
;
do
while
getopts
"r
o:
"
opt
;
do
case
$opt
in
r
)
USE_RAID
=
1
;;
o
)
APKOVL
=
"
$OPTARG
"
;;
esac
done
shift
$((
OPTIND
-
1
))
...
...
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