diff --git a/image_builder/README.md b/image_builder/README.md index 350d183a..57a5dab2 100644 --- a/image_builder/README.md +++ b/image_builder/README.md @@ -6,7 +6,19 @@ sudo apt-get install unzip zip git python-pip jq curl sudo pip install YaDiskClient ``` 2. Mount HDD -> TODO +```bash +nano /etc/fstab +``` +``` +proc /proc proc defaults 0 0 +PARTUUID=37665771-01 /boot vfat defaults 0 2 +PARTUUID=37665771-02 / ext4 defaults,noatime 0 1 +# a swapfile is not a swap partition, no line here +# use dphys-swapfile swap[on|off] for that +/dev/sdb1 none swap sw 0 0 +/dev/sdb2 /mnt/hdd_system ext4 defaults,acl 0 0 +/dev/sdb3 /mnt/hdd_builder ext4 defaults,acl 0 0 +``` 3. Enable swap on HDD > TODO: diff --git a/image_builder/build.Jenkinsfile b/image_builder/build.Jenkinsfile index 2865e130..bf4d6797 100644 --- a/image_builder/build.Jenkinsfile +++ b/image_builder/build.Jenkinsfile @@ -14,7 +14,7 @@ pipeline { string(name: 'GWBT_URL', defaultValue: 'https://github.com/CopterExpress/clever.git') // Experimental function - booleanParam(name: 'SHRINK', defaultValue: false, description: 'SHRINK IMAGE') + booleanParam(name: 'SHRINK', defaultValue: true, description: 'SHRINK IMAGE') booleanParam(name: 'DISCOVER_ROS_PACKAGES', defaultValue: false, description: 'DISCOVER ROS PACKAGES') } environment { @@ -81,9 +81,13 @@ pipeline { } // TODO: Add finalising step, transfer mirror removal from ros.sh stage('Shrink image') { + environment { + EXECUTE_FILE = 'image_builder/scripts/change_boot_part.sh' + } when { expression { return params.SHRINK } } steps { sh "$WORKSPACE/image_builder/autosizer.sh ${params.BUILD_DIR}/${params.IMAGE_NAME}" + sh "$WORKSPACE/image_builder/image_config.sh execute ${params.BUILD_DIR}/${params.IMAGE_NAME} ${params.MOUNT_POINT} $WORKSPACE/$EXECUTE_FILE" } } } diff --git a/image_builder/scripts/change_boot_part.sh b/image_builder/scripts/change_boot_part.sh new file mode 100755 index 00000000..bca48d7a --- /dev/null +++ b/image_builder/scripts/change_boot_part.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +echo -e "\033[0;31m\033[1m$(date) | #1 Change boot partition\033[0m\033[0m" + +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 -e "\033[0;31m\033[1m$(date) | End of change boot partition\033[0m\033[0m" diff --git a/image_builder/scripts/ros_install.sh b/image_builder/scripts/ros_install.sh index 28407139..5245f57e 100755 --- a/image_builder/scripts/ros_install.sh +++ b/image_builder/scripts/ros_install.sh @@ -15,7 +15,7 @@ echo -e "\033[0;31m\033[1m$(date) | #1 Installing dirmngr & add key to apt-key\0 # Install a tool that apt-key uses to add ROS repository key # http://wpblogger.su/tags/apt/ -apt-get install --no-install-recommends -y dirmngr +apt-get install --no-install-recommends -y dirmngr=2.1.18-8~deb9u2 # setup keys apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 @@ -31,11 +31,11 @@ apt-get update echo -e "\033[0;31m\033[1m$(date) | #3 Installing wget, unzip, python-rosdep, python-rosinstall-generator, python-wstool, python-rosinstall, build-essential, cmake\033[0m\033[0m" apt-get install --no-install-recommends -y \ - python-rosdep \ - python-rosinstall-generator \ - python-wstool \ - python-rosinstall \ - build-essential + python-rosdep=0.12.2-1 \ + python-rosinstall-generator=0.1.14-1 \ + python-wstool=0.1.17-1 \ + python-rosinstall=0.7.8-1 \ + build-essential=12.3 echo -e "\033[0;31m\033[1m$(date) | #4 rosdep init && rosdep update\033[0m\033[0m" diff --git a/image_builder/scripts/software_install.sh b/image_builder/scripts/software_install.sh index ec2ec5cc..30b3d036 100755 --- a/image_builder/scripts/software_install.sh +++ b/image_builder/scripts/software_install.sh @@ -10,22 +10,22 @@ echo -e "\033[0;31m\033[1m$(date) | #1 Software installing\033[0m\033[0m" # TODO: Use dnsmasq instead of isc-dhcp-server apt-get install --no-install-recommends -y \ - unzip \ - zip \ - ipython \ - screen \ - byobu \ - nmap \ - lsof \ - git \ - dnsmasq \ - tmux \ - vim \ - ipython3 \ - cmake \ - python-pip \ - python3-pip \ - libjpeg8-dev + unzip=6.0-21 \ + zip=3.0-11 \ + ipython=5.1.0-3 \ + ipython3=5.1.0-3 \ + screen=4.5.0-6 \ + byobu=5.112-1 \ + nmap=7.40-1 \ + lsof=4.89+dfsg-0.1 \ + git=1:2.11.0-3+deb9u3 \ + dnsmasq=2.76-5+rpt1+deb9u1 \ + tmux=2.3-4 \ + vim=2:8.0.0197-4+deb9u1 \ + cmake=3.7.2-1 \ + python-pip=9.0.1-2+rpt2 \ + python3-pip=9.0.1-2+rpt2 \ + libjpeg8-dev=8d1-2 echo -e "\033[0;31m\033[1m$(date) | #2 Adding mjpg-streamer at /home/pi\033[0m\033[0m" # https://github.com/jacksonliam/mjpg-streamer