Skip to content

Commit e405a18

Browse files
committed
Fix simpleimage producing empty BOOT
1 parent a1c6db6 commit e405a18

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

simpleimage/make_simpleimage.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ cleanup() {
6868
}
6969
trap cleanup EXIT
7070

71-
if [ -n "$kernel_tarball" -a "$kernel_tarball" != "-" ]; then
72-
echo "Using Kernel from $kernel_tarball ..."
73-
tar -C $temp -xJf "$kernel_tarball"
74-
kernel=$temp/boot
75-
mv $temp/boot/uEnv.txt.in $temp/boot/uEnv.txt
76-
fi
77-
7871
boot0_position=8 # KiB
7972
uboot_position=19096 # KiB
8073
part_position=20480 # KiB
@@ -90,7 +83,12 @@ dd if=/dev/zero bs=1M count=${boot_size} of=${out}1
9083
mkfs.vfat -n BOOT ${out}1
9184

9285
# Add boot support if there
93-
if [ -e "${kernel}/pine64/Image" -a -e "${kernel}/pine64/sun50i-a64-pine64-plus.dtb" ]; then
86+
if [ -n "$kernel_tarball" ]; then
87+
echo "Using Kernel from $kernel_tarball ..."
88+
tar -C $temp -xJf "$kernel_tarball"
89+
mv $temp/boot/uEnv.txt.in $temp/boot/uEnv.txt
90+
mcopy -sm -i ${out}1 ${temp}/boot/* ::
91+
elif [ -e "${kernel}/pine64/Image" -a -e "${kernel}/pine64/sun50i-a64-pine64-plus.dtb" ]; then
9492
mcopy -sm -i ${out}1 ${kernel}/pine64 ::
9593
mcopy -m -i ${out}1 ${kernel}/initrd.img :: || true
9694
mcopy -m -i ${out}1 ${kernel}/uEnv.txt :: || true

0 commit comments

Comments
 (0)