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
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
alpine-conf
Commits
687c4927
Commit
687c4927
authored
Mar 24, 2011
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-disk: have '?' to display help
And initial work for data-only disk support.
parent
e9725347
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
29 deletions
+60
-29
setup-disk.in
setup-disk.in
+60
-29
No files found.
setup-disk.in
View file @
687c4927
...
...
@@ -481,6 +481,55 @@ __EOF__
exit
1
}
rootdisk_help
()
{
cat
<<
__EOF__
The root disk is the disk where / (root) gets mounted. This is also the
boot disk. There will created a separate /boot partition on this disk.
Select 'none' if you want have / (root) in memory only, i.e diskless or
data-only disk.
__EOF__
}
datadisk_help
()
{
cat
<<
__EOF__
With a data-only disk you will boot from your current boot media (cdrom,
USB, CF etc) and run from memory only but have a disk where your data
gets stored. By default, there will be created a single lvm managed partition
where /var gets mounted.
Select 'none' if you want run completely disk-less.
__EOF__
}
# ask for a root or data disk
# returns answer in global variable $answer
ask_disk
()
{
local
prompt
=
"
$1
"
local
help_func
=
"
$2
"
shift
2
answer
=
while
!
in_list
"
$answer
"
$@
"none"
"abort"
;
do
echo
"Available disks are:
$@
"
echon
"
$prompt
[
$1
] "
default_read answer
$1
case
"
$answer
"
in
'abort'
)
exit
0
;;
'none'
)
return
0
;;
'?'
)
$help_func
;;
*
)
if
!
[
-b
"/dev/
$answer
"
]
;
then
echo
"/dev/
$answer
is not a block device"
>
&2
answer
=
fi
;;
esac
done
}
KERNEL_FLAVOR
=
grsec
case
"
$(
uname
-r
)
"
in
*
-vs
[
0-9]
*
)
KERNEL_FLAVOR
=
vserver
;;
...
...
@@ -521,37 +570,19 @@ if [ $# -gt 0 ]; then
done
else
set
--
$disks
rootdisk
=
while
!
in_list
"
$rootdisk
"
$disks
"none"
"abort"
;
do
echo
"Available disks are:
$disks
"
echon
"Which one is the root disk? (or 'none' for tmpfs root) [
$1
] "
default_read rootdisk
$1
done
case
"
$rootdisk
"
in
abort
)
exit
0
;;
esac
ask_disk
"Which one is the root disk? (or '?' for help or 'none')"
\
rootdisk_help
$disks
rootdisk
=
$answer
rootdisk_dev
=
/dev/
$answer
fi
#echon "Do you want use *all* of $rootdisk for Alpine? (y/n) [n] "
#default_read useall "n"
#case "$useall" in
# [Yy]*) useall="yes";;
#esac
#
#if [ "x$useall" != "xyes" ]; then
# echo "Only 'use all' option is available at the moment. Sorry"
# exit 1
#fi
if
[
"
$rootdisk
"
=
"none"
]
;
then
exit
# native disk install
if
[
"
$rootdisk
"
!=
"none"
]
;
then
useall
$rootdisk_dev
exit
$?
fi
rootdisk_dev
=
${
rootdisk_dev
:-
"/dev/
$rootdisk
"
}
if
!
[
-b
"
$rootdisk_dev
"
]
;
then
echo
"
$rootdisk_dev
is not a block device"
>
&2
exit
1
fi
# data-only disk (hybrid) install
#ask_disk "Which one is the data-only disk? (or '?' for help or 'none')" \
# datadisk_help $disks
useall
$rootdisk_dev
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