[acrn-configuration tool] make scenario shared file error cp error

Fixed the error that the "'chmod +x ./build/acrn_release_deb/DEBIAN/preinst'"
command and "sed -i \'s/\r//\' ./build/acrn_release_deb/DEBIAN/preinst" command
are still executed when there is no "./build/acrn_release_deb/DEBIAN/preinst"
file after build.

Tracked-On: projectacrn#7383
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
This commit is contained in:
Ziheng Li 2022-04-27 19:36:38 +08:00 committed by acrnsi-robot
parent 373dac68ef
commit 92c9252f4c

View File

@ -127,8 +127,9 @@ def create_acrn_deb(board, scenario, version, build_dir):
run_command('chmod +x ./build/acrn_release_deb/etc/grub.d/100_ACRN', cur_dir)
run_command('chmod +x ./build/acrn_release_deb/DEBIAN/postinst', cur_dir)
run_command('sed -i \'s/\r//\' ./build/acrn_release_deb/DEBIAN/postinst', cur_dir)
run_command('chmod +x ./build/acrn_release_deb/DEBIAN/preinst', cur_dir)
run_command('sed -i \'s/\r//\' ./build/acrn_release_deb/DEBIAN/preinst', cur_dir)
if os.path.exists('./build/acrn_release_deb/DEBIAN/preinst'):
run_command('chmod +x ./build/acrn_release_deb/DEBIAN/preinst', cur_dir)
run_command('sed -i \'s/\r//\' ./build/acrn_release_deb/DEBIAN/preinst', cur_dir)
ret = run_command('dpkg -b acrn_release_deb acrn-%s-%s-%s.deb' % (board, scenario, version), build_dir)
if ret != 0: