Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guido Gunther
image-builder
Commits
718b52e6
Commit
718b52e6
authored
Jun 13, 2019
by
Angus Ainslie (Purism)
Browse files
Different pureos boards can use the same uboot type.
Signed-off-by:
Angus Ainslie (Purism)
<
angus@akkea.ca
>
parent
948e9cb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
build-image
View file @
718b52e6
...
...
@@ -107,6 +107,7 @@ pureos_board=imx6
build_type
=
latest
NULL
=
uboot_bin
=
uboot_type
=
build_tarball
=
want_qcow2
=
want_boot_image
=
...
...
@@ -205,6 +206,7 @@ set -x
sudo
pureos_board
=
"
${
pureos_board
}
"
\
distro
=
"
${
distro
}
"
\
packages
=
"
${
packages
}
${
board_packages
}
"
\
uboot_type
=
"
${
uboot_type
}
"
\
patched
=
"
${
patched
}
"
\
http_proxy
=
"
${
http_apt_proxy
:-${
http_proxy
:-}}
"
\
https_proxy
=
"
${
https_apt_proxy
:-${
https_proxy
:-}}
"
\
...
...
@@ -239,11 +241,11 @@ if [ "${arch}" == "arm64" ]; then
if
[
"
${
want_boot_image
}
"
==
1
]
;
then
# Copy the boot image as a separate file
bootimg
=
"
${
pureos_board
}
-boot.img"
cp
"files/uboot-
${
uboot_type
}
/
${
pureos_board
}
-boot.img"
"
${
bootimg
}
"
cp
"files/uboot-
${
uboot_type
}
/
${
uboot_type
}
-boot.img"
"
${
bootimg
}
"
else
# Merge boot image inside the main image
loop
=
$(
setup_loop
"
${
mainimg
}
"
)
sudo dd
if
=
"files/uboot-
${
uboot_type
}
/
${
pureos_board
}
-boot.img"
of
=
"
${
loop
}
"
bs
=
1024
seek
=
2
sudo dd
if
=
"files/uboot-
${
uboot_type
}
/
${
uboot_type
}
-boot.img"
of
=
"
${
loop
}
"
bs
=
1024
seek
=
2
sudo
losetup
-d
"
${
loop
}
"
fi
fi
...
...
root.sh
View file @
718b52e6
...
...
@@ -19,6 +19,7 @@
:
"
${
kernel_deb
:-}
"
:
"
${
patched
:-}
"
:
"
${
qemu
:-}
"
:
"
${
uboot_type
:-}
"
# distro and basedir set by calling script
basedir
=
"
$1
"
...
...
@@ -33,6 +34,11 @@ for env_var in distro pureos_board packages; do
fi
done
if
[
"
${
pureos_board
}
"
!=
"qemu-x86_64"
]
&&
[
-z
"
${
uboot_type
}
"
]
;
then
echo
"Must pass in uboot_type via the environment"
1>&2
exit
1
fi
set
-e
set
-u
set
-x
...
...
@@ -81,10 +87,10 @@ function setup_kernel()
function
setup_uboot
()
{
sed
-e
"s/##DTBNAME##/
${
fdt_file
}
/"
"data/boot-
${
pureos_board
}
.txt.in"
>
"
${
basedir
}
/boot/boot_emmc.txt"
sed
-e
"s/##DTBNAME##/
${
fdt_file
}
/"
"data/boot-
${
uboot_type
}
.txt.in"
>
"
${
basedir
}
/boot/boot_emmc.txt"
sed
-e
"s/##RFSPART##/0/"
-i
"
${
basedir
}
/boot/boot_emmc.txt"
mkimage
-A
arm
-T
script
-O
linux
-d
"
${
basedir
}
/boot/boot_emmc.txt"
"
${
basedir
}
/boot/boot_emmc.scr"
sed
-e
"s/##DTBNAME##/
${
fdt_file
}
/"
"data/boot-
${
pureos_board
}
.txt.in"
>
"
${
basedir
}
/boot/boot_sd.txt"
sed
-e
"s/##DTBNAME##/
${
fdt_file
}
/"
"data/boot-
${
uboot_type
}
.txt.in"
>
"
${
basedir
}
/boot/boot_sd.txt"
sed
-e
"s/##RFSPART##/1/"
-i
"
${
basedir
}
/boot/boot_sd.txt"
mkimage
-A
arm
-T
script
-O
linux
-d
"
${
basedir
}
/boot/boot_sd.txt"
"
${
basedir
}
/boot/boot_sd.scr"
if
[
"
${
pureos_board
}
"
==
"imx6"
]
;
then
...
...
@@ -95,7 +101,7 @@ function setup_uboot()
ln
-fs
boot_sd.scr
"
${
basedir
}
/boot/boot.scr"
fi
[
!
-d
"files/uboot-
${
pureos_board
}
"
]
||
cp
-a
"files/uboot-
${
pureos_board
}
/"
*
"
${
basedir
}
/boot/"
[
!
-d
"files/uboot-
${
uboot_type
}
"
]
||
cp
-a
"files/uboot-
${
uboot_type
}
/"
*
"
${
basedir
}
/boot/"
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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