@@ -59,6 +59,8 @@ final_action=reboot
59
59
hwrng_support=1
60
60
enable_watchdog=0
61
61
quiet_boot=0
62
+ cleanup=0
63
+ cleanup_logfiles=0
62
64
spi_enable=0
63
65
i2c_enable=0
64
66
i2c_baudrate=
83
85
mount " ${bootpartition} " /boot
84
86
fail_boot_mounted=true
85
87
fi
86
- cp -- ${LOGFILE} /boot/raspberrypi-ua-netinst/error-" $( date +%Y%m%dT%H%M%S) " .log
88
+ cp " ${LOGFILE} " " /boot/raspberrypi-ua-netinst/error-$( date +%Y%m%dT%H%M%S) .log"
87
89
sync
88
90
89
91
# if we mounted /boot in the fail command, unmount it.
@@ -350,7 +352,7 @@ echo "OK"
350
352
351
353
# copy boot data to safety
352
354
echo -n " Copying boot files... "
353
- cp -r -- /boot/* /bootfs/ || fail
355
+ cp -r /boot/* /bootfs/ || fail
354
356
echo " OK"
355
357
356
358
# Read installer-config.txt
@@ -876,6 +878,8 @@ echo " rootfs_install_mount_options = ${rootfs_install_mount_options}"
876
878
echo " rootfs_mount_options = ${rootfs_mount_options} "
877
879
echo " final_action = ${final_action} "
878
880
echo " quiet_boot = ${quiet_boot} "
881
+ echo " cleanup = ${cleanup} "
882
+ echo " cleanup_logfiles = ${cleanup_logfiles} "
879
883
echo " spi_enable = ${spi_enable} "
880
884
echo " i2c_enable = ${i2c_enable} "
881
885
echo " i2c_baudrate = ${i2c_baudrate} "
@@ -1034,7 +1038,7 @@ echo "OK"
1034
1038
1035
1039
echo -n " Copying /boot files in... "
1036
1040
mount " ${bootpartition} " /boot || fail
1037
- cp -r -- /bootfs/* /boot || fail
1041
+ cp -r /bootfs/* /boot || fail
1038
1042
sync
1039
1043
umount /boot || fail
1040
1044
echo " OK"
@@ -1763,12 +1767,22 @@ echo -n "Installation finished at $(date --date="@${ENDTIME}" --utc)"
1763
1767
echo " and took $(( DURATION/ 60 )) min $(( DURATION% 60 )) sec (${DURATION} seconds)"
1764
1768
1765
1769
# copy logfile to standard log directory
1766
- sleep 1
1767
- cp -- " ${LOGFILE} " /rootfs/var/log/raspberrypi-ua-netinst.log
1768
- chmod 0640 /rootfs/var/log/raspberrypi-ua-netinst.log
1770
+ if [ " ${cleanup_logfiles} " = " 1" ]; then
1771
+ rm -f /rootfs/boot/raspberrypi-ua-netinst/error-* .log
1772
+ else
1773
+ sleep 1
1774
+ cp " ${LOGFILE} " /rootfs/var/log/raspberrypi-ua-netinst.log
1775
+ chmod 0640 /rootfs/var/log/raspberrypi-ua-netinst.log
1776
+ fi
1769
1777
1770
- echo -n " Unmounting filesystems... "
1778
+ # Cleanup installer files
1779
+ if [ " ${cleanup} " = " 1" ]; then
1780
+ echo -n " Removing installer files... "
1781
+ rm -rf /rootfs/boot/raspberrypi-ua-netinst/
1782
+ echo " OK"
1783
+ fi
1771
1784
1785
+ echo -n " Unmounting filesystems... "
1772
1786
umount /rootfs/boot
1773
1787
umount /rootfs
1774
1788
echo " OK"
0 commit comments