Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
build-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
certo
build-system
Commits
70604528
Commit
70604528
authored
Mar 19, 2019
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added common build-image target
parent
65d27c90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
common.xml
common.xml
+83
-0
No files found.
common.xml
View file @
70604528
...
...
@@ -354,6 +354,8 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
SECONDARY="${SECONDARY}"
export LC_ALL PATH SECONDARY HOSTTYPE
mount -o remount,rw /
mkdir /build
mount /dev/${SECONDARY}1 /build
make -C /build/packages/linux boot-${BOARD}
...
...
@@ -407,6 +409,87 @@ rm /lib/systemd/system/build
</exec>
</target>
<target
name=
"build-image"
>
<antcall
target=
"mount"
/>
<antcall
target=
"setup-build"
/>
<antcall
target=
"unmount"
/>
<antcall
target=
"make-secondary"
/>
<antcall
target=
"mount-secondary"
/>
<antcall
target=
"fill-secondary"
/>
<antcall
target=
"unmount"
/>
<antcall
target=
"run-system-with-secondary-${BOARD}"
/>
<antcall
target=
"check-build-success"
/>
</target>
<target
name=
"setup-build"
>
<delete
file=
"${sysdir}/.success"
/>
<echo
file=
"${sysdir}/lib/systemd/system/machine-id.service"
>
[Unit]
Description=Setup /etc/machine-id
Before=systemd-networkd.service
After=local-fs.target
[Service]
Type=oneshot
StandardOutput=tty
ExecStart=/bin/systemd-machine-id-setup
[Install]
WantedBy=rescue.target
</echo>
<echo
file=
"${sysdir}/lib/systemd/system/build.service"
>
[Unit]
Description=Build ${ant.project.name}
After=network-online.target
Wants=systemd-networkd.service
Wants=systemd-resolved.service
[Service]
Type=oneshot
StandardOutput=tty
ExecStart=/lib/systemd/system/build
ExecStartPost=/sbin/poweroff
[Install]
WantedBy=rescue.target
</echo>
<echo
file=
"${sysdir}/lib/systemd/system/build"
>
#!/bin/sh
LC_ALL=POSIX
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PROJECT_NAME="${ant.project.name}"
ID="${ID}"
PRETTY_NAME="${PRETTY_NAME}"
HOSTNAME="${HOSTNAME}"
VERSION="${VERSION}"
BUILD_ID=${BUILD_ID}
ARTIFACT_NAME=${ARTIFACT_NAME}
DEVICE_TYPE=${DEVICE_TYPE}
CONSOLE="${CONSOLE}"
ROOT_DEVICE="${ROOT_DEVICE}"
DISK="${DISK}"
SECONDARY="${SECONDARY}"
export LC_ALL PATH PROJECT_NAME ID PRETTY_NAME HOSTNAME VERSION BUILD_ID ARTIFACT_NAME DEVICE_TYPE CONSOLE ROOT_DEVICE DISK SECONDARY HOSTTYPE
mount -o remount,rw /
mkdir /build
mount /dev/${SECONDARY}1 /build
make -C /build/packages
if [ $? -eq 0 ]; then
umount /dev/${SECONDARY}1
rm -rf /build
fi
rm -rf /etc/systemd/system/rescue.target.wants
rm /lib/systemd/system/machine-id.service
rm /lib/systemd/system/build.service
rm /lib/systemd/system/build
</echo>
<chmod
file=
"${sysdir}/lib/systemd/system/build"
perm=
"755"
/>
<mkdir
dir=
"${sysdir}/etc/systemd/system/rescue.target.wants"
/>
<exec
executable=
"ln"
failonerror=
"true"
>
<arg
line=
"-s /lib/systemd/system/build.service ${sysdir}/etc/systemd/system/rescue.target.wants/build.service"
/>
</exec>
</target>
<target
name=
"check-build-success"
>
<antcall
target=
"mount"
/>
<available
file=
"${sysdir}/.success"
property=
"success"
/>
...
...
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