Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lx2160a_build
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
Boxiang Sun
lx2160a_build
Commits
63bbd52b
Commit
63bbd52b
authored
Jun 14, 2023
by
Josua Mayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runme: dynamically adapt image size according to generated rootfs
parent
cc5bb433
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
runme.sh
runme.sh
+17
-7
No files found.
runme.sh
View file @
63bbd52b
...
...
@@ -681,6 +681,7 @@ if [ -z "$ROOTFS" ] || [ ! -f "$ROOTDIR/images/tmp/$ROOTFS.ext4" ]; then
echo
"Internal Error: No rootfs was generated!"
exit
1
fi
ROOTFS_SIZE
=
$(
stat
-c
"%s"
$ROOTDIR
/images/tmp/
$ROOTFS
.ext4
)
echo
"Building DPDK"
...
...
@@ -742,21 +743,28 @@ e2ln images/tmp/$ROOTFS.ext4:/usr/bin/ls-main /usr/bin/ls-addsw
e2ln images/tmp/
$ROOTFS
.ext4:/usr/bin/ls-main /usr/bin/ls-listmac
e2ln images/tmp/
$ROOTFS
.ext4:/usr/bin/ls-main /usr/bin/ls-listni
truncate
-s
420M
$ROOTDIR
/images/tmp/
$ROOTFS
.img
parted
--script
$ROOTDIR
/images/tmp/
$ROOTFS
.img mklabel msdos mkpart primary 64MiB 417MiB
truncate
-s
64M
$ROOTDIR
/images/tmp/
$ROOTFS
.img
truncate
-s
+
$ROOTFS_SIZE
$ROOTDIR
/images/tmp/
$ROOTFS
.img
parted
--script
$ROOTDIR
/images/tmp/
$ROOTFS
.img mklabel msdos mkpart primary 64MiB
$((
64
*
1024
*
1024
+
ROOTFS_SIZE-1
))
B
# Generate the above partuuid 3030303030 which is the 4 characters of '0' in ascii
echo
"0000"
|
dd
of
=
$ROOTDIR
/images/tmp/
$ROOTFS
.img
bs
=
1
seek
=
440
conv
=
notrunc
dd
if
=
$ROOTDIR
/images/tmp/
$ROOTFS
.ext4
of
=
$ROOTDIR
/images/tmp/
$ROOTFS
.img
bs
=
1M
seek
=
64
conv
=
notrunc
echo
"Assembling Boot Image"
cd
$ROOTDIR
/
truncate
-s
49M
$ROOTDIR
/images/tmp/boot.part
truncate
-s
+64M
$ROOTDIR
/images/tmp/boot.part
truncate
-s
+
$ROOTFS_SIZE
$ROOTDIR
/images/tmp/boot.part
mkfs.ext4
-b
4096
-F
$ROOTDIR
/images/tmp/boot.part
BOOTPART_SIZE
=
$(
stat
-c
"%s"
$ROOTDIR
/images/tmp/boot.part
)
IMG
=
lx2160acex7_
${
SPEED
}
_
${
SERDES
}
-
${
REPO_PREFIX
}
.img
rm
-rf
$ROOTDIR
/images/
${
IMG
}
truncate
-s
528M
$ROOTDIR
/images/
${
IMG
}
#dd if=/dev/zero of=$ROOTDIR/images/${IMG} bs=1M count=1
parted
--script
$ROOTDIR
/images/
${
IMG
}
mklabel msdos mkpart primary 64MiB 527MiB
truncate
-s
463M
$ROOTDIR
/images/tmp/boot.part
mkfs.ext4
-b
4096
-F
$ROOTDIR
/images/tmp/boot.part
truncate
-s
64M
$ROOTDIR
/images/
${
IMG
}
truncate
-s
+
$BOOTPART_SIZE
$ROOTDIR
/images/
${
IMG
}
parted
--script
$ROOTDIR
/images/
${
IMG
}
mklabel msdos mkpart primary 64MiB
$((
64
*
1024
*
1024
+
BOOTPART_SIZE-1
))
B
\r
m
-rf
$ROOTDIR
/images/tmp/xspi_header.img
truncate
-s
128K
$ROOTDIR
/images/tmp/xspi_header.img
dd
if
=
$ROOTDIR
/build/atf/build/lx2160acex7/
${
ATF_BUILD
}
/
${
BL2
}
.pbl
of
=
$ROOTDIR
/images/tmp/xspi_header.img
bs
=
512
conv
=
notrunc
...
...
@@ -826,3 +834,5 @@ dd if=$ROOTDIR/build/atf/build/lx2160acex7/${ATF_BUILD}/${BL2}.pbl of=images/${I
dd
if
=
images/
${
IMG
}
of
=
$ROOTDIR
/images/tmp/
$ROOTFS
.img
bs
=
512
seek
=
1
skip
=
1
count
=
131071
conv
=
notrunc
e2cp
-G
0
-O
0
$ROOTDIR
/images/tmp/
$ROOTFS
.img
$ROOTDIR
/images/tmp/boot.part:/
dd
if
=
$ROOTDIR
/images/tmp/boot.part
of
=
$ROOTDIR
/images/
${
IMG
}
bs
=
1M
seek
=
64
echo
"Generated images/
${
IMG
}
"
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