diff --git a/image_builder/scripts/change_boot_part.sh b/image_builder/scripts/change_boot_part.sh deleted file mode 100755 index 1980090f..00000000 --- a/image_builder/scripts/change_boot_part.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -e - -echo_stamp() { - # TEMPLATE: echo_stamp - # TYPE: SUCCESS, ERROR, INFO - - # More info there https://www.shellhacks.com/ru/bash-colors/ - - TEXT="$(date) | $1" - TEXT="\e[1m$TEXT\e[0m" # BOLD - - case "$2" in - SUCCESS) - TEXT="\e[32m${TEXT}\e[0m";; # GREEN - ERROR) - TEXT="\e[31m${TEXT}\e[0m";; # RED - *) - TEXT="\e[34m${TEXT}\e[0m";; # BLUE - esac - echo -e ${TEXT} -} - -echo_stamp "#1 Change boot partition" - -sed -i 's/root=[^ ]*/root=\/dev\/mmcblk0p2/' /boot/cmdline.txt -sed -i 's/.* \/boot vfat defaults 0 2$/\/dev\/mmcblk0p1 \/boot vfat defaults 0 2/' /etc/fstab -sed -i 's/.* \/ ext4 defaults,noatime 0 1$/\/dev\/mmcblk0p2 \/ ext4 defaults,noatime 0 1/' /etc/fstab - -echo_stamp "End of change boot partition" diff --git a/image_builder/scripts/init_image.sh b/image_builder/scripts/init_image.sh index c3580308..aedf97b3 100755 --- a/image_builder/scripts/init_image.sh +++ b/image_builder/scripts/init_image.sh @@ -52,4 +52,10 @@ echo_stamp "#3 Write magic script to /etc/rc.local" MAGIC_SCRIPT="sudo /root/init_rpi.sh; sudo sed -i '/sudo \\\/root\\\/init_rpi.sh/d' /etc/rc.local && sudo reboot" sed -i "19a${MAGIC_SCRIPT}" /etc/rc.local -echo_stamp "#4 End initialisation of image" +# It needs for autosizer.sh & maybe that is correct +echo_stamp "#4 Change boot partition" +sed -i 's/root=[^ ]*/root=\/dev\/mmcblk0p2/' /boot/cmdline.txt +sed -i 's/.* \/boot vfat defaults 0 2$/\/dev\/mmcblk0p1 \/boot vfat defaults 0 2/' /etc/fstab +sed -i 's/.* \/ ext4 defaults,noatime 0 1$/\/dev\/mmcblk0p2 \/ ext4 defaults,noatime 0 1/' /etc/fstab + +echo_stamp "#5 End of init image"