From 08733297dc4495ca2bf6c4516c86e5864d8a297d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= Date: Mon, 15 Apr 2019 15:19:25 +0200 Subject: [PATCH] nano: avoid creating system.img in build flash.sh was creating a system.img when creating the SD card image, avoid that. This also prevents a bug in flash.sh which creates a loop device and does not remove it after finishing. --- build-core.sh | 1 + .../nano/create-jetson-nano-sd-card-image.sh.patch | 9 +++++++++ tarball-parts/nano/flash.sh.patch | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tarball-parts/nano/flash.sh.patch diff --git a/build-core.sh b/build-core.sh index 8b193b8..d6abea3 100755 --- a/build-core.sh +++ b/build-core.sh @@ -82,6 +82,7 @@ if [ "$board" = nano ]; then rm jetson.img cd Linux_for_Tegra patch -p1 < ../../tarball-parts/nano/create-jetson-nano-sd-card-image.sh.patch + patch -p1 < ../../tarball-parts/nano/flash.sh.patch sudo ./create-jetson-nano-sd-card-image.sh -o jetson.img -s 600M -r 200 popd mv "$outdir"/Linux_for_Tegra/jetson.img "$final_tree" diff --git a/tarball-parts/nano/create-jetson-nano-sd-card-image.sh.patch b/tarball-parts/nano/create-jetson-nano-sd-card-image.sh.patch index 4cbf7a9..ddfcafe 100644 --- a/tarball-parts/nano/create-jetson-nano-sd-card-image.sh.patch +++ b/tarball-parts/nano/create-jetson-nano-sd-card-image.sh.patch @@ -10,6 +10,15 @@ fi } trap cleanup EXIT +@@ -148,7 +148,7 @@ + echo "${script_name} - creating signed images" + + # Generate flashcmd.txt for signing images +- BOARDID="3448" FAB="${rev}" "${l4t_dir}/flash.sh" "--no-flash" "p3448-0000-sd" "mmcblk0p1" ++ BOARDID="3448" FAB="${rev}" "${l4t_dir}/flash.sh" "-r" "--no-flash" "p3448-0000-sd" "mmcblk0p1" + + if [ ! -f "${bootloader_dir}/flashcmd.txt" ]; then + echo "ERROR: ${bootloader_dir}/flashcmd.txt not found" > /dev/stderr @@ -169,7 +171,12 @@ { echo "${script_name} - create partitions" diff --git a/tarball-parts/nano/flash.sh.patch b/tarball-parts/nano/flash.sh.patch new file mode 100644 index 0000000..a607589 --- /dev/null +++ b/tarball-parts/nano/flash.sh.patch @@ -0,0 +1,13 @@ +--- a/flash.sh 2019-03-13 08:45:13.000000000 +0100 ++++ b/flash.sh 2019-04-15 14:46:38.445259529 +0200 +@@ -1873,10 +1873,6 @@ + APP_TAG+="-e s/APPFILE/${localsysfile}/ "; + if [ "${skip_systemimg}" != "true" ]; then + echo "Reusing existing ${localsysfile}... "; +- if [ ! -e "${localsysfile}" ]; then +- echo "file does not exist."; +- exit 1; +- fi; + echo "done."; + else + echo "Skip generating ${localsysfile}";