##// END OF EJS Templates
vidal -
r775:6cd6af4bd9a0 Fusion master
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
@@ -1,8 +1,6
1 1 # rpi23-gen-image
2 2 ## Introduction
3
4 `rpi23-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for Raspberry Pi 2 (RPi2), Raspberry Pi 3 (RPi3) and Raspberry Pi 4 (RPi4) computers. The script at this time supports the bootstrapping of the Debian (armhf) releases `jessie`, `stretch`, `buster` and 'bullseye'. Raspberry Pi 3 images are generated for 32-bit mode only. Raspberry Pi 3 and Raspberry Pi 4 64-bit images can be generated using custom configuration parameters (```templates/rpi3-stretch-arm64-4.11.y```).
5
3 `rpi23-gen-image.sh` is an advanced Debian Linux bootstrapping shell script for generating Debian OS images for all Raspberry Pi computers. The script at this time supports the bootstrapping of the Debian (armhf/armel) releases `stretch` and `buster`. Raspberry Pi 0/1/2/3/4 images are generated for 32-bit mode only. Raspberry Pi 3 supports 64-bit images that can be generated using custom configuration parameters (```templates/rpi3-stretch-arm64-4.14.y```).
6 4
7 5 ## Build dependencies
8 6 The following list of Debian packages must be installed on the build system because they are essentially required for the bootstrapping process. The script will check if all required packages are installed and missing packages will be installed automatically if confirmed by the user.
@@ -17,10 +17,10 install_readonly files/apt/sources.list "${ETC_DIR}/apt/sources.list"
17 17 # Use specified APT server and release
18 18 sed -i "s/\/ftp.debian.org\//\/${APT_SERVER}\//" "${ETC_DIR}/apt/sources.list"
19 19
20 #Fix for changing path for security updates in testing
21 if [ "$RELEASE" = "testing" ] ; then
22 sed -i "s,buster\\/updates,testing-security," "${ETC_DIR}/apt/sources.list"
23 sed -i "s/ buster/ ${RELEASE}/" "${ETC_DIR}/apt/sources.list"
20 #Fix for changing path for security updates in oldstable / buster
21 if [ "$RELEASE" = "oldstable" ] || [ "$RELEASE" = "buster " ] ; then
22 sed -i "s:bullseye-security:${RELEASE}\\/updates:" "${ETC_DIR}/apt/sources.list"
23 sed -i "s:security.debian.org/debian-security:security.debian.org:" "${ETC_DIR}/apt/sources.list"
24 24 fi
25 25
26 26 if [ "$ENABLE_NONFREE" = "true" ] ; then
@@ -29,7 +29,7 fi
29 29
30 30 if [ -z "$RELEASE" ] ; then
31 31 # Change release in sources list
32 sed -i "s/ buster/ ${RELEASE}/" "${ETC_DIR}/apt/sources.list"
32 sed -i "s/ bullseye/ ${RELEASE}/" "${ETC_DIR}/apt/sources.list"
33 33 fi
34 34
35 35 # Upgrade package index and update all installed packages and changed dependencies
@@ -13,6 +13,9 sed -i "s/^RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hostname"
13 13 install_readonly files/network/hosts "${ETC_DIR}/hosts"
14 14 sed -i "s/RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hosts"
15 15
16 # Ensure /etc/systemd/network directory is available
17 mkdir -p "${ETC_DIR}/systemd/network"
18
16 19 # Setup hostname entry with static IP
17 20 if [ "$NET_ETH_ADDRESS" != "" ] ; then
18 21 NET_IP=$(echo "${NET_ETH_ADDRESS}" | cut -f 1 -d'/')
@@ -68,6 +71,7 fi
68 71
69 72
70 73 if [ "$ENABLE_WIRELESS" = true ] ; then
74 mkdir -p "${ETC_DIR}/wpa_supplicant"
71 75 if [ "$ENABLE_WIFI_DHCP" = true ] ; then
72 76 # Enable DHCP configuration for interface eth0
73 77 sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan0.network"
@@ -94,19 +98,18 if [ "$ENABLE_WIRELESS" = true ] ; then
94 98 fi
95 99 fi
96 100
97 if [ -z "$NET_WIFI_SSID" ] && [ -z "$NET_WIFI_PSK" ] ; then
98 printf "
101 if [ ! -z "$NET_WIFI_SSID" ] && [ ! -z "$NET_WIFI_PSK" ] ; then
102 chroot_exec printf "
99 103 ctrl_interface=/run/wpa_supplicant
100 ctrl_interface_group=wheel
101 104 update_config=1
102 105 eapol_version=1
103 106 ap_scan=1
104 107 fast_reauth=1
105 108
106 " > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
109 " > "${ETC_DIR}/wpa_supplicant/wpa_supplicant-wlan0.conf"
107 110
108 111 #Configure WPA_supplicant
109 chroot_exec wpa_passphrase "$NET_SSID" "$NET_WPAPSK" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
112 chroot_exec wpa_passphrase "$NET_WIFI_SSID" "$NET_WIFI_PSK" >> "${ETC_DIR}/wpa_supplicant/wpa_supplicant-wlan0.conf"
110 113
111 114 chroot_exec systemctl enable wpa_supplicant.service
112 115 chroot_exec systemctl enable wpa_supplicant@wlan0.service
@@ -75,7 +75,11 if [ "$ENABLE_REDUCE" = true ] ; then
75 75
76 76 # Remove sound utils and libraries
77 77 if [ "$ENABLE_SOUND" = false ] ; then
78 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
78 if [ "$ENABLE_BLUETOOTH" = false ] ; then
79 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
80 else
81 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0
82 fi
79 83 fi
80 84
81 85 # Remove GPU kernels
@@ -91,6 +95,9 if [ "$ENABLE_REDUCE" = true ] ; then
91 95 rm -f "${R}/boot/vmlinuz-*"
92 96 rm -f "${R}/boot/initrd.img-*"
93 97 fi
98
99 #Reduce BOOT
100 #Only necessary files for my gen pi
94 101
95 102 # Clean APT list of repositories
96 103 rm -fr "${R}/var/lib/apt/lists/*"
@@ -1,8 +1,8
1 deb http://ftp.debian.org/debian buster main contrib
2 #deb-src http://ftp.debian.org/debian buster main contrib
1 deb http://debian.proxad.net/debian/ bullseye main contrib
2 #deb-src http://ftp.debian.org/debian bullseye main contrib
3 3
4 deb http://ftp.debian.org/debian/ buster-updates main contrib
5 #deb-src http://ftp.debian.org/debian/ buster-updates main contrib
4 deb http://debian.proxad.net/debian/ bullseye-updates main contrib
5 #deb-src http://ftp.debian.org/debian/ bullseye-updates main contrib
6 6
7 deb http://security.debian.org/ buster/updates main contrib
8 #deb-src http://security.debian.org/ buster/updates main contrib
7 deb http://security.debian.org/debian-security bullseye-security main contrib
8 #deb-src http://security.debian.org/ bullseye/updates main contrib
@@ -76,9 +76,9 chroot_install_cc() {
76 76 COMPILER_PACKAGES=$(chroot_exec apt-get -s install g++ make bc | grep "^Inst " | awk -v ORS=" " '{ print $2 }')
77 77
78 78
79 if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] || [ "$RELEASE" = "bullseye" ] ; then
79 if [ "$RELEASE" = "bookworm" ] || [ "$RELEASE" = "buster" ] || [ "$RELEASE" = "bullseye" ] ; then
80 80 chroot_exec apt-get -q -y --no-install-recommends install ${COMPILER_PACKAGES}
81 elif [ "$RELEASE" = "buster" ] || [ "$RELEASE" = "bullseye" ] ; then
81 elif [ "$RELEASE" = "buster" ] || [ "$RELEASE" = "bullseye" ] || [ "$RELEASE" = "bookworm" ]; then
82 82 chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install ${COMPILER_PACKAGES}
83 83 fi
84 84
@@ -1,8 +1,8
1 #!/bin/sh
1 #!/bin/bash
2 2 ########################################################################
3 3 # rpi23-gen-image.sh 2015-2017
4 4 #
5 # Advanced Debian "buster" and "bullseye" bootstrap script for Raspberry Pi
5 # Advanced Debian "bullseye" and "bookworm" bootstrap script for Raspberry Pi
6 6 #
7 7 # This program is free software; you can redistribute it and/or
8 8 # modify it under the terms of the GNU General Public License
@@ -39,14 +39,15 set -e
39 39 echo -n -e "\n#\n# RPi 0/1/2/3/4 Bootstrap Settings\n#\n"
40 40 set -x
41 41
42 # Raspberry Pi model configuration
42 # Raspberry Pi model configuration defaults to 3P
43 43 RPI_MODEL=${RPI_MODEL:=3P}
44 44
45 # Debian release
46 RELEASE=${RELEASE:=buster}
47 if [ $RELEASE = "bullseye" ] ; then
45 # Debian release defaults to bullseye
46 RELEASE=${RELEASE:=bullseye}
47 if [ "$RELEASE" = "bookworm" ] ; then
48 48 RELEASE=testing
49 49 fi
50 echo "Debian release value used : " $RELEASE
50 51
51 52 # Kernel Branch
52 53 KERNEL_BRANCH=${KERNEL_BRANCH:=""}
@@ -54,7 +55,8 KERNEL_BRANCH=${KERNEL_BRANCH:=""}
54 55 # URLs
55 56 KERNEL_URL=${KERNEL_URL:=https://github.com/raspberrypi/linux}
56 57 FIRMWARE_URL=${FIRMWARE_URL:=https://github.com/raspberrypi/firmware/raw/master/boot}
57 WLAN_FIRMWARE_URL=${WLAN_FIRMWARE_URL:=https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm}
58 #WLAN_FIRMWARE_URL=${WLAN_FIRMWARE_URL:=https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm}
59 WLAN_FIRMWARE_URL=${WLAN_FIRMWARE_URL:=https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/bullseye/debian/config/brcm80211/brcm}
58 60 FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git}
59 61 UBOOT_URL=${UBOOT_URL:=https://git.denx.de/u-boot.git}
60 62 VIDEOCORE_URL=${VIDEOCORE_URL:=https://github.com/raspberrypi/userland}
@@ -806,7 +808,7 CHROOT_SIZE=$(expr "$(du -s "${R}" | awk '{ print $1 }')")
806 808
807 809 # Calculate the amount of needed 512 Byte sectors
808 810 TABLE_SECTORS=$(expr 1 \* 1024 \* 1024 \/ 512)
809 FRMW_SECTORS=$(expr 64 \* 1024 \* 1024 \/ 512)
811 FRMW_SECTORS=$(expr 128 \* 1024 \* 1024 \/ 512)
810 812 ROOT_OFFSET=$(expr "${TABLE_SECTORS}" + "${FRMW_SECTORS}")
811 813
812 814 # The root partition is EXT4
@@ -834,8 +836,8 EOM
834 836 ${TABLE_SECTORS},${ROOT_SECTORS},83
835 837 EOM
836 838
837 ## Setup temporary loop devices
838 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME"-frmw.img)"
839 # Setup temporary loop devices
840 FRMW_LOOP="$(losetup -o 1M --sizelimit 128M -f --show "$IMAGE_NAME"-frmw.img)"
839 841 ROOT_LOOP="$(losetup -o 1M -f --show "$IMAGE_NAME"-root.img)"
840 842 # ENABLE_SPLITFS=false
841 843 else
@@ -849,8 +851,8 ${ROOT_OFFSET},${ROOT_SECTORS},83
849 851 EOM
850 852
851 853 # Setup temporary loop devices
852 FRMW_LOOP="$(losetup -o 1M --sizelimit 64M -f --show "$IMAGE_NAME".img)"
853 ROOT_LOOP="$(losetup -o 65M -f --show "$IMAGE_NAME".img)"
854 FRMW_LOOP="$(losetup -o 1M --sizelimit 128M -f --show "$IMAGE_NAME".img)"
855 ROOT_LOOP="$(losetup -o 129M -f --show "$IMAGE_NAME".img)"
854 856 fi
855 857
856 858 if [ "$ENABLE_CRYPTFS" = true ] ; then
@@ -13,7 +13,7 python3-netcdf4 python-netcdf4 python-libxml2 libxslt1-dev python-libxslt1 \
13 13 libxml2 libjavascriptcoregtk-4.0-dev \
14 14 libffi-dev screen sqlite3 libsqlite3-dev liblua5.3-dev doxygen libftdi-dev \
15 15 libconfuse-dev libcereal-dev libopenblas-dev libnetcdf-dev libhdf5-dev \
16 git lxdm pcmanfm-qt libffi-dev tightvncserver \
16 git lxdm pcmanfm-qt libffi-dev ffmpeg \
17 17 libssl-dev python-openssl python3-openssl libcrypto++-dev \
18 18 mate-backgrounds gnome-backgrounds \
19 19 fcgiwrap automake libtool libboost1.67-dev \
@@ -22,6 +22,7 tigervnc-standalone-server tigervnc-common \
22 22 docker.io openvswitch-switch wireshark imagemagick tk tcllib util-linux \
23 23 xfonts-base fonts-liberation gsfonts libxfont-dev libfontenc-dev \
24 24 ttf-mscorefonts-installer xfonts-100dpi xfonts-75dpi xfonts-base \
25 autogen automake libtool libboost-system-dev libboost-thread-dev \
25 26 xfonts-utils"
26 27 #-------------------------------
27 28 #--- General System Settings ---
@@ -13,15 +13,16 python3-netcdf4 python-netcdf4 python-libxml2 libxslt1-dev python-libxslt1 \
13 13 libxml2 libjavascriptcoregtk-4.0-dev \
14 14 libffi-dev screen sqlite3 libsqlite3-dev liblua5.3-dev doxygen libftdi-dev \
15 15 libconfuse-dev libcereal-dev libopenblas-dev libnetcdf-dev libhdf5-dev \
16 git lxdm pcmanfm-qt libffi-dev tightvncserver \
16 git lxdm pcmanfm-qt libffi-dev ffmpeg \
17 17 libssl-dev python-openssl python3-openssl libcrypto++-dev \
18 mate-backgrounds gnome-backgrounds \
18 mate-backgrounds gnome-backgrounds libjson-c-dev \
19 19 fcgiwrap automake libtool libboost1.67-dev \
20 20 php-fpm libfcgi-dev php7.3-mysql icedtea-netx \
21 21 tigervnc-standalone-server tigervnc-common \
22 22 docker.io openvswitch-switch wireshark imagemagick tk tcllib util-linux \
23 23 xfonts-base fonts-liberation gsfonts libxfont-dev libfontenc-dev \
24 24 ttf-mscorefonts-installer xfonts-100dpi xfonts-75dpi xfonts-base \
25 autogen automake libtool libboost-system-dev libboost-thread-dev \
25 26 xfonts-utils"
26 27 #-------------------------------
27 28 #--- General System Settings ---
@@ -13,7 +13,7 python3-netcdf4 python-netcdf4 python-libxml2 libxslt1-dev python-libxslt1 \
13 13 libxml2 libjavascriptcoregtk-4.0-dev \
14 14 libffi-dev screen sqlite3 libsqlite3-dev liblua5.3-dev doxygen libftdi-dev \
15 15 libconfuse-dev libcereal-dev libopenblas-dev libnetcdf-dev libhdf5-dev \
16 git lxdm pcmanfm-qt libffi-dev tightvncserver \
16 git lxdm pcmanfm-qt libffi-dev ffmpeg \
17 17 libssl-dev python-openssl python3-openssl libcrypto++-dev \
18 18 mate-backgrounds gnome-backgrounds \
19 19 fcgiwrap automake libtool libboost1.67-dev \
@@ -22,12 +22,13 tigervnc-standalone-server tigervnc-common \
22 22 docker.io openvswitch-switch wireshark imagemagick tk tcllib util-linux \
23 23 xfonts-base fonts-liberation gsfonts libxfont-dev libfontenc-dev \
24 24 ttf-mscorefonts-installer xfonts-100dpi xfonts-75dpi xfonts-base \
25 autogen automake libtool libboost-system-dev libboost-thread-dev \
25 26 xfonts-utils"
26 27 #-------------------------------
27 28 #--- General System Settings ---
28 29 #-------------------------------
29 SET_ARCH=32
30 30 RPI_MODEL=4
31 SET_ARCH=32
31 32 RELEASE="buster"
32 33 HOSTNAME="raspife4"
33 34 DEFLOCAL="fr_FR.UTF-8"
@@ -107,7 +108,7 SSH_USER_PUB_KEY="/home/vidal/.ssh/authorized_keys"
107 108 #--- Kernel settings ---
108 109 #-----------------------
109 110 BUILD_KERNEL=true
110 KERNEL_BRANCH=rpi-4.19.y
111 KERNEL_BRANCH=rpi-5.4.y
111 112 KERNEL_REDUCE=false
112 113 KERNEL_HEADERS=true
113 114 KERNEL_MENUCONFIG=false
1 NO CONTENT: file was removed, binary diff hidden
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant