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
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
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
aa172c5a
Commit
aa172c5a
authored
May 04, 2012
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-bootable: cleanup. use vecho for echo when verbose mode
parent
9fc7174d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
setup-bootable.in
setup-bootable.in
+12
-7
No files found.
setup-bootable.in
View file @
aa172c5a
...
...
@@ -45,6 +45,11 @@ mount_srcdir() {
fi
}
vecho
()
{
[
-z
"
$verbose
"
]
&&
return
0
echo
"
$@
"
}
usage
()
{
cat
<<
__EOF__
$prog
$version
...
...
@@ -121,7 +126,7 @@ fi
# fish out label, uuid and type
eval
$(
blkid
$dest
|
cut
-d
:
-f2-
)
[
-n
"
$verbose
"
]
&&
echo
"Using
$dest
as target (mounted on
$destdir
)"
v
echo
"Using
$dest
as target (mounted on
$destdir
)"
# find parent device (i.e sda)
...
...
@@ -164,17 +169,17 @@ free_blocks=$(stat -f -c "%f" "$destdir")
block_size
=
$(
stat
-f
-c
"%s"
"
$destdir
"
)
blocks_per_mb
=
$((
1024
*
1024
/
$block_size
))
available_space
=
$((
$free_blocks
/
$blocks_per_mb
))
[
-n
"
$verbose
"
]
&&
echo
"Available space:
$available_space
MiB"
v
echo
"Available space:
$available_space
MiB"
if
[
-n
"
$srcdir
"
]
;
then
needed_space
=
$(
cd
"
$srcdir
"
&&
du
-m
-s
-c
boot apks syslinux.cfg .alpine-release |
awk
'$2 == "total" {print $1}'
)
[
-n
"
$verbose
"
]
&&
echo
"Needed space:
$needed_space
MiB"
v
echo
"Needed space:
$needed_space
MiB"
[
$available_space
-lt
$needed_space
]
\
&&
die
"Not enough space on
$destdir
. Aborting."
# copy the files to .new
for
i
in
boot apks syslinux.cfg .alpine-release
;
do
[
-n
"
$verbose
"
]
&&
echo
"Copying
$srcdir
/
$i
to
$destdir
/.new/"
v
echo
"Copying
$srcdir
/
$i
to
$destdir
/.new/"
cp
-a
"
$srcdir
"
/
$i
"
$destdir
"
/.new/
done
elif
[
-n
"
$srcurl
"
]
;
then
...
...
@@ -184,10 +189,10 @@ elif [ -n "$srcurl" ]; then
fi
# make sure files are really there before we replace existing
[
-n
"
$verbose
"
]
&&
echo
"Flushing cache..."
v
echo
"Flushing cache..."
sync
[
-n
"
$verbose
"
]
&&
echo
"Replacing existing files..."
v
echo
"Replacing existing files..."
mkdir
-p
"
$destdir
"
/.old
||
die
"Failed to create
$destdir
/.old"
# do we want keep existing syslinux.cfg?
...
...
@@ -197,7 +202,7 @@ if [ -n "$force" ] || ! [ -e "$destdir"/syslinux.cfg ]; then
# update syslinux.cfg unless device is on usb bus
# this is so we can boot from CF's and harddisk
if
!
on_usb_bus
$parent_dev
;
then
[
-n
"
$verbose
"
]
&&
echo
"Updating syslinux.cfg to use
$dest
"
v
echo
"Updating syslinux.cfg to use
$dest
"
sed
-i
-e
"s/usbdisk/
${
dest
##*/
}
/g"
\
"
$destdir
"
/.new/syslinux.cfg
fi
...
...
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