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
aports
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
647
Issues
647
List
Boards
Labels
Service Desk
Milestones
Merge Requests
202
Merge Requests
202
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
aports
Commits
99afbc0a
Commit
99afbc0a
authored
Dec 15, 2016
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: add minirootfs release image
parent
fb36c214
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
1 deletion
+78
-1
scripts/genrootfs.sh
scripts/genrootfs.sh
+56
-0
scripts/mkimage.sh
scripts/mkimage.sh
+1
-1
scripts/mkimg.minirootfs.sh
scripts/mkimg.minirootfs.sh
+21
-0
No files found.
scripts/genrootfs.sh
0 → 100755
View file @
99afbc0a
#!/bin/sh -e
cleanup
()
{
rm
-rf
"
$tmp
"
}
tmp
=
"
$(
mktemp
-d
)
"
trap
cleanup EXIT
arch
=
"
$(
apk
--print-arch
)
"
repositories_file
=
/etc/apk/repositories
keys_dir
=
/etc/apk/keys
while
getopts
"a:r:k:o:"
opt
;
do
case
$opt
in
a
)
arch
=
"
$OPTARG
"
;;
r
)
repositories_file
=
"
$OPTARG
"
;;
k
)
keys_dir
=
"
$OPTARG
"
;;
o
)
outfile
=
"
$OPTARG
"
;;
esac
done
shift
$((
$OPTIND
-
1
))
cat
"
$repositories_file
"
if
[
-z
"
$outfile
"
]
;
then
outfile
=
$name
-
$arch
.tar.gz
fi
${
APK
:-
apk
}
add
--keys-dir
"
$keys_dir
"
\
--repositories-file
"
$repositories_file
"
\
--no-script
--no-cache
--root
"
$tmp
"
--initdb
\
"
$@
"
for
link
in
$(
"
$tmp
"
/bin/busybox
--list-full
)
;
do
[
-e
"
$tmp
"
/
$link
]
||
ln
-s
/bin/busybox
"
$tmp
"
/
$link
done
${
APK
:-
apk
}
fetch
--keys-dir
"
$keys_dir
"
\
--repositories-file
"
$repositories_file
"
\
--stdout
alpine-base |
tar
-zx
-C
"
$tmp
"
etc/
branch
=
edge
VERSION_ID
=
$(
awk
-F
=
'$1=="VERSION_ID" {print $2}'
"
$tmp
"
/etc/os-release
)
case
$VERSION_ID
in
*
_alpha
*
|
*
_beta
*
)
branch
=
edge
;;
*
.
*
.
*
)
branch
=
v
${
VERSION_ID
%.*
}
;;
esac
cat
>
"
$tmp
"
/etc/apk/repositories
<<
EOF
http://dl-cdn.alpinelinux.org/alpine/
$branch
/main
http://dl-cdn.alpinelinux.org/alpine/
$branch
/community
EOF
#rm -rf "$tmp"/var/cache/apk/*
tar
--numeric-owner
-c
-C
"
$tmp
"
.
|
gzip
-9n
>
"
$outfile
"
scripts/mkimage.sh
View file @
99afbc0a
...
...
@@ -172,7 +172,7 @@ build_profile() {
if
[
"
$_dirty
"
=
"yes"
-o
!
-e
"
$output_file
"
]
;
then
# Create image
output_format
=
"
${
image_ext
//[
:
\.]/
}
"
[
-n
"
$output_format
"
]
||
output_format
=
"
${
image_ext
//[
:
\.]/
}
"
create_image_
${
output_format
}
||
{
_fail
=
"yes"
;
false
;
}
if
[
"
$_checksum
"
=
"yes"
]
;
then
...
...
scripts/mkimg.minirootfs.sh
0 → 100755
View file @
99afbc0a
section_minirootfs
()
{
return
0
}
create_image_rootfs
()
{
local
_script
=
$(
readlink
-f
"
$scriptdir
/genrootfs.sh"
)
local
output_file
=
"
$(
readlink
-f
${
OUTDIR
:-
.
}
)
/
$output_filename
"
(
cd
"
$OUTDIR
"
;
fakeroot
"
$_script
"
-k
"
$APKROOT
"
/etc/apk/keys
\
-r
"
$APKROOT
"
/etc/apk/repositories
\
-o
"
$output_file
"
\
-a
$ARCH
\
$rootfs_apks
)
}
profile_minirootfs
()
{
image_ext
=
tar.gz
output_format
=
rootfs
arch
=
"x86 x86_64 armhf aarch64"
rootfs_apks
=
"busybox alpine-baselayout alpine-keys apk-tools libc-utils"
}
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