@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Debootstrap basic system |
|
4 | 3 | # |
@@ -8,7 +7,6 | |||
|
8 | 7 | |
|
9 | 8 | VARIANT="" |
|
10 | 9 | COMPONENTS="main" |
|
11 | EXCLUDES="" | |
|
12 | 10 | |
|
13 | 11 | # Use non-free Debian packages if needed |
|
14 | 12 | if [ "$ENABLE_NONFREE" = true ] ; then |
@@ -20,13 +18,8 if [ "$ENABLE_MINBASE" = true ] ; then | |||
|
20 | 18 | VARIANT="--variant=minbase" |
|
21 | 19 | fi |
|
22 | 20 | |
|
23 | # Exclude packages if required by Debian release | |
|
24 | if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then | |
|
25 | EXCLUDES="--exclude=init,systemd-sysv" | |
|
26 | fi | |
|
27 | ||
|
28 | 21 | # Base debootstrap (unpack only) |
|
29 | http_proxy=${APT_PROXY} debootstrap ${EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}" | |
|
22 | http_proxy=${APT_PROXY} debootstrap "${APT_EXCLUDES}" --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}" | |
|
30 | 23 | |
|
31 | 24 | # Copy qemu emulator binary to chroot |
|
32 | 25 | install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}" |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Setup APT repositories |
|
4 | 3 | # |
@@ -21,11 +20,6 else | |||
|
21 | 20 | echo "No precompiled kernel repositories were added" |
|
22 | 21 | fi |
|
23 | 22 | |
|
24 | #ipinfo=$(curl ipinfo.io | grep country ) | |
|
25 | #grep -o '\"[^"]*\"' $ipinfo | tr -d '"' | |
|
26 | #grep -Po '"country":.*?[^\\]",' $(curl ipinfo.io | grep country ) | |
|
27 | #sed -i "s,http:,https:,g" "${ETC_DIR}/apt/sources.list" | |
|
28 | ||
|
29 | 23 | # Upgrade package index and update all installed packages and changed dependencies |
|
30 | 24 | chroot_exec apt-get -qq -y update |
|
31 | 25 | chroot_exec apt-get -qq -y -u dist-upgrade |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Setup Locales and keyboard settings |
|
4 | 3 | # |
@@ -11,7 +10,6 echo "${TIMEZONE}" > "${ETC_DIR}/timezone" | |||
|
11 | 10 | chroot_exec dpkg-reconfigure -f noninteractive tzdata |
|
12 | 11 | |
|
13 | 12 | # Install and setup default locale and keyboard configuration |
|
14 | ||
|
15 | 13 | if [ "$(echo "$APT_INCLUDES" | grep ",locales")" ] ; then |
|
16 | 14 | # Set locale choice in debconf db, even though dpkg-reconfigure ignores and overwrites them due to some bug |
|
17 | 15 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684134 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685957 |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Build and Setup RPi2/3 Kernel |
|
4 | 3 | # |
@@ -109,7 +108,7 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
109 | 108 | echo "CONFIG_CRYPTO_XTS=y" |
|
110 | 109 | echo "CONFIG_CRYPTO_SHA512=y" |
|
111 | 110 | echo "CONFIG_CRYPTO_MANAGER=y" |
|
112 |
} >> |
|
|
111 | } >> ${KERNEL_DIR}/.config | |
|
113 | 112 | fi |
|
114 | 113 | fi |
|
115 | 114 | |
@@ -241,7 +240,8 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
241 | 240 | chroot_exec ln -sf /usr/src/linux "/lib/modules/${KERNEL_VERSION}/source" |
|
242 | 241 | fi |
|
243 | 242 | fi |
|
244 | elif [ "$BUILD_KERNEL" = false ] ; then | |
|
243 | ||
|
244 | else # BUILD_KERNEL=false | |
|
245 | 245 | echo " Install precompiled kernel..." |
|
246 | 246 | echo "error: not implemented" |
|
247 | 247 | # Check if kernel installation was successful |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Setup fstab and initramfs |
|
4 | 3 | # |
@@ -63,4 +62,3 if [ "$BUILD_KERNEL" = true ] && [ "$ENABLE_INITRAMFS" = true ] ; then | |||
|
63 | 62 | chroot_exec mkinitramfs -o "/boot/firmware/initramfs-${KERNEL_VERSION}" "${KERNEL_VERSION}" |
|
64 | 63 | fi |
|
65 | 64 | fi |
|
66 |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Setup RPi2/3 config and cmdline |
|
4 | 3 | # |
@@ -122,7 +121,7 install_readonly files/modules/rpi2.conf "${R}/lib/modules-load.d/rpi2.conf" | |||
|
122 | 121 | |
|
123 | 122 | # Load hardware random module at boot |
|
124 | 123 | if [ "$ENABLE_HWRANDOM" = true ] && [ "$BUILD_KERNEL" = false ] ; then |
|
125 |
|
|
|
124 | sed -i "s/^# bcm2708_rng/bcm2708_rng/" "${R}/lib/modules-load.d/rpi2.conf" | |
|
126 | 125 | fi |
|
127 | 126 | |
|
128 | 127 | # Load sound module at boot |
@@ -159,4 +158,3 install_readonly files/modules/raspi-blacklist.conf "${ETC_DIR}/modprobe.d/raspi | |||
|
159 | 158 | |
|
160 | 159 | # Install sysctl.d configuration files |
|
161 | 160 | install_readonly files/sysctl.d/81-rpi-vm.conf "${ETC_DIR}/sysctl.d/81-rpi-vm.conf" |
|
162 |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Setup Firewall |
|
4 | 3 | # |
@@ -10,6 +9,8 if [ "$ENABLE_IPTABLES" = true ] ; then | |||
|
10 | 9 | # Create iptables configuration directory |
|
11 | 10 | mkdir -p "${ETC_DIR}/iptables" |
|
12 | 11 | |
|
12 | # make sure iptables-legacy is the used alternatives | |
|
13 | #iptables-save and -restore are slaves of iptables and thus are set accordingly | |
|
13 | 14 | if ! [ "$RELEASE" = jessie ] ; then |
|
14 | 15 | chroot_exec update-alternatives --verbose --set iptables /usr/sbin/iptables-legacy |
|
15 | 16 | fi |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Setup users and security settings |
|
4 | 3 | # |
@@ -12,8 +11,8 ENCRYPTED_USER_PASSWORD=$(mkpasswd -m sha-512 "${USER_PASSWORD}") | |||
|
12 | 11 | |
|
13 | 12 | # Setup default user |
|
14 | 13 | if [ "$ENABLE_USER" = true ] ; then |
|
15 |
chroot_exec adduser --gecos |
|
|
16 |
chroot_exec usermod -a -G sudo -p "${ENCRYPTED_USER_PASSWORD}" |
|
|
14 | chroot_exec adduser --gecos $USER_NAME --add_extra_groups --disabled-password $USER_NAME | |
|
15 | chroot_exec usermod -a -G sudo -p "${ENCRYPTED_USER_PASSWORD}" $USER_NAME | |
|
17 | 16 | fi |
|
18 | 17 | |
|
19 | 18 | # Setup root password or not |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Setup SSH settings and public keys |
|
4 | 3 | # |
@@ -114,4 +113,4 if [ "$ENABLE_SSHD" = true ] ; then | |||
|
114 | 113 | if [ "$ENABLE_REDUCE" = true ] && [ "$REDUCE_SSHD" = true ] ; then |
|
115 | 114 | sed "s|^DROPBEAR_EXTRA_ARGS=.*|DROPBEAR_EXTRA_ARGS=\"${DROPBEAR_ARGS}\"|g" "${ETC_DIR}/default/dropbear" |
|
116 | 115 | fi |
|
117 |
fi |
|
|
116 | fi No newline at end of file |
@@ -1,4 +1,3 | |||
|
1 | #!/bin/bash | |
|
2 | 1 |
|
|
3 | 2 | # Build and Setup U-Boot |
|
4 | 3 | # |
@@ -40,6 +39,7 if [ "$ENABLE_UBOOT" = true ] ; then | |||
|
40 | 39 | install_readonly "${R}/tmp/u-boot/u-boot.bin" "${BOOT_DIR}/u-boot.bin" |
|
41 | 40 | printf "\n# boot u-boot kernel\nkernel=u-boot.bin\n" >> "${BOOT_DIR}/config.txt" |
|
42 | 41 | |
|
42 | # Install and setup U-Boot command file | |
|
43 | 43 | install_readonly files/boot/uboot.mkimage "${BOOT_DIR}/uboot.mkimage" |
|
44 | 44 | printf "# Set the kernel boot command line\nsetenv bootargs \"earlyprintk ${CMDLINE}\"\n\n$(cat ${BOOT_DIR}/uboot.mkimage)" > "${BOOT_DIR}/uboot.mkimage" |
|
45 | 45 | |
@@ -58,9 +58,9 if [ "$ENABLE_UBOOT" = true ] ; then | |||
|
58 | 58 | sed -i '/.*initramfs.*/d' "${BOOT_DIR}/uboot.mkimage" |
|
59 | 59 | |
|
60 | 60 | if [ "$BUILD_KERNEL" = false ] ; then |
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
61 | # Remove dtbfile from U-Boot mkfile | |
|
62 | sed -i '/.*dtbfile.*/d' "${BOOT_DIR}/uboot.mkimage" | |
|
63 | printf "\nbootz \${kernel_addr_r}" >> "${BOOT_DIR}/uboot.mkimage" | |
|
64 | 64 | else |
|
65 | 65 | printf "\nbootz \${kernel_addr_r} - \${fdt_addr_r}" >> "${BOOT_DIR}/uboot.mkimage" |
|
66 | 66 | fi |
@@ -80,14 +80,14 if [ "$ENABLE_UBOOT" = true ] ; then | |||
|
80 | 80 | sed -i "s|mmc|usb|g" "${BOOT_DIR}/uboot.mkimage" |
|
81 | 81 | fi |
|
82 | 82 | |
|
83 | # Set mkfile to use the correct dtb file | |
|
84 | sed -i "s/^\(setenv dtbfile \).*/\1${DTB_FILE}/" "${BOOT_DIR}/uboot.mkimage" | |
|
85 | ||
|
83 | 86 | # Set mkfile to use the correct mach id |
|
84 | 87 | if [ "$ENABLE_QEMU" = true ] ; then |
|
85 | 88 | sed -i "s/^\(setenv machid \).*/\10x000008e0/" "${BOOT_DIR}/uboot.mkimage" |
|
86 | 89 | fi |
|
87 | 90 | |
|
88 | # Set mkfile to use the correct dtb file | |
|
89 | sed -i "s/^\(setenv dtbfile \).*/\1${DTB_FILE}/" "${BOOT_DIR}/uboot.mkimage" | |
|
90 | ||
|
91 | 91 | # Set mkfile to use kernel image |
|
92 | 92 | sed -i "s/^\(fatload mmc 0:1 \${kernel_addr_r} \).*/\1${KERNEL_IMAGE}/" "${BOOT_DIR}/uboot.mkimage" |
|
93 | 93 |
@@ -49,136 +49,137 export RELEASE=${RELEASE:=buster} | |||
|
49 | 49 | export KERNEL_BRANCH=${KERNEL_BRANCH:=""} |
|
50 | 50 | |
|
51 | 51 | # URLs |
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 | export FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git} | |
|
56 |
|
|
|
57 | export VIDEOCORE_URL=${VIDEOCORE_URL=https://github.com/raspberrypi/userland} | |
|
58 | ||
|
59 | # Firmware directory: Blank if download from github | |
|
60 | export RPI_FIRMWARE_DIR=${RPI_FIRMWARE_DIR:=""} | |
|
52 | KERNEL_URL=${KERNEL_URL:=https://github.com/raspberrypi/linux} | |
|
53 | FIRMWARE_URL=${FIRMWARE_URL:=https://github.com/raspberrypi/firmware/raw/master/boot} | |
|
54 | WLAN_FIRMWARE_URL=${WLAN_FIRMWARE_URL:=https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm} | |
|
55 | COLLABORA_URL=${COLLABORA_URL:=https://repositories.collabora.co.uk/debian} | |
|
56 | FBTURBO_URL=${FBTURBO_URL:=https://github.com/ssvb/xf86-video-fbturbo.git} | |
|
57 | UBOOT_URL=${UBOOT_URL:=https://git.denx.de/u-boot.git} | |
|
58 | VIDEOCORE_URL=${VIDEOCORE_URL=https://github.com/raspberrypi/userland} | |
|
61 | 59 | |
|
62 | 60 | # Build directories |
|
63 |
|
|
|
64 |
|
|
|
61 | BASEDIR=${BASEDIR:=$(pwd)/images/${RELEASE}} | |
|
62 | BUILDDIR="${BASEDIR}/build" | |
|
65 | 63 | |
|
66 | 64 | # Prepare date string for default image file name |
|
67 | 65 | DATE="$(date +%Y-%m-%d)" |
|
68 | 66 | if [ -z "$KERNEL_BRANCH" ] ; then |
|
69 |
|
|
|
67 | IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-CURRENT-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}} | |
|
70 | 68 | else |
|
71 |
|
|
|
69 | IMAGE_NAME=${IMAGE_NAME:=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}} | |
|
72 | 70 | fi |
|
73 | 71 | |
|
74 | 72 | # Chroot directories |
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
73 | R="${BUILDDIR}/chroot" | |
|
74 | ETC_DIR="${R}/etc" | |
|
75 | LIB_DIR="${R}/lib" | |
|
76 | BOOT_DIR="${R}/boot/firmware" | |
|
77 | KERNEL_DIR="${R}/usr/src/linux" | |
|
78 | WLAN_FIRMWARE_DIR="${R}/lib/firmware/brcm" | |
|
81 | 79 | |
|
80 | # Firmware directory: Blank if download from github | |
|
81 | RPI_FIRMWARE_DIR=${RPI_FIRMWARE_DIR:=""} | |
|
82 | 82 | # General settings |
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
83 | SET_ARCH=${SET_ARCH:=32} | |
|
84 | HOSTNAME=${HOSTNAME:=rpi${RPI_MODEL}-${RELEASE}} | |
|
85 | PASSWORD=${PASSWORD:=raspberry} | |
|
86 | USER_PASSWORD=${USER_PASSWORD:=raspberry} | |
|
87 | DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"} | |
|
88 | TIMEZONE=${TIMEZONE:="Europe/Berlin"} | |
|
89 | EXPANDROOT=${EXPANDROOT:=true} | |
|
90 | 90 | |
|
91 | 91 | # Keyboard settings |
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
|
92 | XKB_MODEL=${XKB_MODEL:=""} | |
|
93 | XKB_LAYOUT=${XKB_LAYOUT:=""} | |
|
94 | XKB_VARIANT=${XKB_VARIANT:=""} | |
|
95 | XKB_OPTIONS=${XKB_OPTIONS:=""} | |
|
96 | 96 | |
|
97 | 97 | # Network settings (DHCP) |
|
98 |
|
|
|
98 | ENABLE_DHCP=${ENABLE_DHCP:=true} | |
|
99 | 99 | |
|
100 | 100 | # Network settings (static) |
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
101 | NET_ADDRESS=${NET_ADDRESS:=""} | |
|
102 | NET_GATEWAY=${NET_GATEWAY:=""} | |
|
103 | NET_DNS_1=${NET_DNS_1:=""} | |
|
104 | NET_DNS_2=${NET_DNS_2:=""} | |
|
105 | NET_DNS_DOMAINS=${NET_DNS_DOMAINS:=""} | |
|
106 | NET_NTP_1=${NET_NTP_1:=""} | |
|
107 | NET_NTP_2=${NET_NTP_2:=""} | |
|
108 | 108 | |
|
109 | 109 | # APT settings |
|
110 |
|
|
|
111 |
|
|
|
110 | APT_PROXY=${APT_PROXY:=""} | |
|
111 | APT_SERVER=${APT_SERVER:="ftp.debian.org"} | |
|
112 | 112 | |
|
113 | 113 | # Feature settings |
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
|
131 |
|
|
|
114 | ENABLE_CONSOLE=${ENABLE_CONSOLE:=true} | |
|
115 | ENABLE_I2C=${ENABLE_I2C:=false} | |
|
116 | ENABLE_SPI=${ENABLE_SPI:=false} | |
|
117 | ENABLE_IPV6=${ENABLE_IPV6:=true} | |
|
118 | ENABLE_SSHD=${ENABLE_SSHD:=true} | |
|
119 | ENABLE_NONFREE=${ENABLE_NONFREE:=false} | |
|
120 | ENABLE_WIRELESS=${ENABLE_WIRELESS:=false} | |
|
121 | ENABLE_SOUND=${ENABLE_SOUND:=true} | |
|
122 | ENABLE_DBUS=${ENABLE_DBUS:=true} | |
|
123 | ENABLE_HWRANDOM=${ENABLE_HWRANDOM:=true} | |
|
124 | ENABLE_MINGPU=${ENABLE_MINGPU:=false} | |
|
125 | ENABLE_XORG=${ENABLE_XORG:=false} | |
|
126 | ENABLE_WM=${ENABLE_WM:=""} | |
|
127 | ENABLE_RSYSLOG=${ENABLE_RSYSLOG:=true} | |
|
128 | ENABLE_USER=${ENABLE_USER:=true} | |
|
129 | USER_NAME=${USER_NAME:="pi"} | |
|
130 | ENABLE_ROOT=${ENABLE_ROOT:=false} | |
|
131 | ENABLE_QEMU=${ENABLE_QEMU:=false} | |
|
132 | ENABLE_SYSVINIT=${ENABLE_SYSVINIT:=false} | |
|
132 | 133 | |
|
133 | 134 | # SSH settings |
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
|
|
|
138 |
|
|
|
135 | SSH_ENABLE_ROOT=${SSH_ENABLE_ROOT:=false} | |
|
136 | SSH_DISABLE_PASSWORD_AUTH=${SSH_DISABLE_PASSWORD_AUTH:=false} | |
|
137 | SSH_LIMIT_USERS=${SSH_LIMIT_USERS:=false} | |
|
138 | SSH_ROOT_PUB_KEY=${SSH_ROOT_PUB_KEY:=""} | |
|
139 | SSH_USER_PUB_KEY=${SSH_USER_PUB_KEY:=""} | |
|
139 | 140 | |
|
140 | 141 | # Advanced settings |
|
141 |
|
|
|
142 |
|
|
|
143 |
|
|
|
144 |
|
|
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
|
|
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
|
142 | ENABLE_MINBASE=${ENABLE_MINBASE:=false} | |
|
143 | ENABLE_REDUCE=${ENABLE_REDUCE:=false} | |
|
144 | ENABLE_UBOOT=${ENABLE_UBOOT:=false} | |
|
145 | UBOOTSRC_DIR=${UBOOTSRC_DIR:=""} | |
|
146 | ENABLE_UBOOTUSB=${ENABLE_UBOOTUSB=false} | |
|
147 | ENABLE_FBTURBO=${ENABLE_FBTURBO:=false} | |
|
148 | ENABLE_VIDEOCORE=${ENABLE_VIDEOCORE:=true} | |
|
149 | VIDEOCORESRC_DIR=${VIDEOCORESRC_DIR:=""} | |
|
150 | FBTURBOSRC_DIR=${FBTURBOSRC_DIR:=""} | |
|
151 | ENABLE_HARDNET=${ENABLE_HARDNET:=false} | |
|
152 | ENABLE_IPTABLES=${ENABLE_IPTABLES:=false} | |
|
153 | ENABLE_SPLITFS=${ENABLE_SPLITFS:=false} | |
|
154 | ENABLE_INITRAMFS=${ENABLE_INITRAMFS:=false} | |
|
155 | ENABLE_IFNAMES=${ENABLE_IFNAMES:=true} | |
|
156 | DISABLE_UNDERVOLT_WARNINGS=${DISABLE_UNDERVOLT_WARNINGS:=} | |
|
156 | 157 | |
|
157 | 158 | # Kernel compilation settings |
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
|
159 | BUILD_KERNEL=${BUILD_KERNEL:=true} | |
|
160 | KERNEL_REDUCE=${KERNEL_REDUCE:=false} | |
|
161 | KERNEL_THREADS=${KERNEL_THREADS:=1} | |
|
162 | KERNEL_HEADERS=${KERNEL_HEADERS:=true} | |
|
163 | KERNEL_MENUCONFIG=${KERNEL_MENUCONFIG:=false} | |
|
164 | KERNEL_REMOVESRC=${KERNEL_REMOVESRC:=true} | |
|
165 | KERNEL_OLDDEFCONFIG=${KERNEL_OLDDEFCONFIG:=false} | |
|
166 | KERNEL_CCACHE=${KERNEL_CCACHE:=false} | |
|
166 | 167 | |
|
167 | 168 | # Kernel compilation from source directory settings |
|
168 |
|
|
|
169 |
|
|
|
170 |
|
|
|
171 |
|
|
|
169 | KERNELSRC_DIR=${KERNELSRC_DIR:=""} | |
|
170 | KERNELSRC_CLEAN=${KERNELSRC_CLEAN:=false} | |
|
171 | KERNELSRC_CONFIG=${KERNELSRC_CONFIG:=true} | |
|
172 | KERNELSRC_PREBUILT=${KERNELSRC_PREBUILT:=false} | |
|
172 | 173 | |
|
173 | 174 | # Reduce disk usage settings |
|
174 |
|
|
|
175 |
|
|
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
|
175 | REDUCE_APT=${REDUCE_APT:=true} | |
|
176 | REDUCE_DOC=${REDUCE_DOC:=true} | |
|
177 | REDUCE_MAN=${REDUCE_MAN:=true} | |
|
178 | REDUCE_VIM=${REDUCE_VIM:=false} | |
|
179 | REDUCE_BASH=${REDUCE_BASH:=false} | |
|
180 | REDUCE_HWDB=${REDUCE_HWDB:=true} | |
|
181 | REDUCE_SSHD=${REDUCE_SSHD:=true} | |
|
182 | REDUCE_LOCALE=${REDUCE_LOCALE:=true} | |
|
182 | 183 | |
|
183 | 184 | # Encrypted filesystem settings |
|
184 | 185 | ENABLE_CRYPTFS=${ENABLE_CRYPTFS:=false} |
@@ -191,16 +192,20 CRYPTFS_XTSKEYSIZE=${CRYPTFS_XTSKEYSIZE:=512} | |||
|
191 | 192 | CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""} |
|
192 | 193 | |
|
193 | 194 | # Packages required in the chroot build environment |
|
194 |
|
|
|
195 | APT_INCLUDES=${APT_INCLUDES:=""} | |
|
195 | 196 | APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup" |
|
196 | 197 | |
|
197 | 198 | # Packages required for bootstrapping |
|
198 |
|
|
|
199 |
|
|
|
199 | REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo netselect-apt" | |
|
200 | MISSING_PACKAGES="" | |
|
200 | 201 | |
|
201 | 202 | # Packages installed for c/c++ build environment in chroot (keep empty) |
|
202 |
|
|
|
203 | COMPILER_PACKAGES="" | |
|
203 | 204 | |
|
205 | #ipinfo=$(curl ipinfo.io | grep country ) | |
|
206 | #grep -o '\"[^"]*\"' $ipinfo | tr -d '"' | |
|
207 | #grep -Po '"country":.*?[^\\]",' $(curl ipinfo.io | grep country ) | |
|
208 | #sed -i "s,http:,https:,g" "${ETC_DIR}/apt/sources.list" | |
|
204 | 209 | #autconfigure best apt server to not spam ftp.debian.org |
|
205 | 210 | #rm files/apt/sources.list |
|
206 | 211 | #netselect-apt does not know buster yet |
@@ -219,6 +224,8 if [ "$ENABLE_NONFREE" = true ] ; then | |||
|
219 | 224 | else |
|
220 | 225 | netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --outfile "$(pwd)/files/apt/sources.list" -d "$RLS" |
|
221 | 226 | fi |
|
227 | ||
|
228 | #sed and cut the result string so we can use it as APT_SERVER | |
|
222 | 229 | APT_SERVER=$(grep -m 1 http files/apt/sources.list | sed "s|http://| |g" | cut -d ' ' -f 3) |
|
223 | 230 | APT_SERVER=${APT_SERVER::-1} |
|
224 | 231 | |
@@ -395,7 +402,7 fi | |||
|
395 | 402 | |
|
396 | 403 | # Check if all required packages are installed on the build system |
|
397 | 404 | for package in $REQUIRED_PACKAGES ; do |
|
398 |
if [ "$(dpkg-query -W -f='${Status}' |
|
|
405 | if [ "$(dpkg-query -W -f='${Status}' $package)" != "install ok installed" ] ; then | |
|
399 | 406 | MISSING_PACKAGES="${MISSING_PACKAGES} $package" |
|
400 | 407 | fi |
|
401 | 408 | done |
@@ -476,6 +483,8 if [ "$(df --output=avail "${BUILDDIR}" | sed "1d")" -le "524288" ] ; then | |||
|
476 | 483 | exit 1 |
|
477 | 484 | fi |
|
478 | 485 | |
|
486 | set -x | |
|
487 | ||
|
479 | 488 | # Call "cleanup" function on various signals and errors |
|
480 | 489 | trap cleanup 0 1 2 3 6 |
|
481 | 490 | |
@@ -556,11 +565,19 if [ "$KERNEL_REDUCE" = true ] ; then | |||
|
556 | 565 | KERNELSRC_CONFIG=false |
|
557 | 566 | fi |
|
558 | 567 | |
|
559 | set -x | |
|
568 | # Configure qemu compatible kernel | |
|
569 | if [ "$ENABLE_QEMU" = true ] ; then | |
|
570 | DTB_FILE=vexpress-v2p-ca15_a7.dtb | |
|
571 | UBOOT_CONFIG=vexpress_ca15_tc2_defconfig | |
|
572 | KERNEL_DEFCONFIG="vexpress_defconfig" | |
|
573 | if [ "$KERNEL_MENUCONFIG" = false ] ; then | |
|
574 | KERNEL_OLDDEFCONFIG=true | |
|
575 | fi | |
|
576 | fi | |
|
560 | 577 | |
|
561 | 578 | # Execute bootstrap scripts |
|
562 | 579 | for SCRIPT in bootstrap.d/*.sh; do |
|
563 |
head -n |
|
|
580 | head -n 3 "$SCRIPT" | |
|
564 | 581 | . "$SCRIPT" |
|
565 | 582 | done |
|
566 | 583 | |
@@ -620,14 +637,6 rm -f "${R}/vmlinuz" | |||
|
620 | 637 | rm -f "${R}${QEMU_BINARY}" |
|
621 | 638 | |
|
622 | 639 | if [ "$ENABLE_QEMU" = true ] ; then |
|
623 | # Configure qemu compatible kernel | |
|
624 | DTB_FILE=vexpress-v2p-ca15_a7.dtb | |
|
625 | UBOOT_CONFIG=vexpress_ca15_tc2_defconfig | |
|
626 | KERNEL_DEFCONFIG="vexpress_defconfig" | |
|
627 | if [ "$KERNEL_MENUCONFIG" = false ] ; then | |
|
628 | KERNEL_OLDDEFCONFIG=true | |
|
629 | fi | |
|
630 | ||
|
631 | 640 | # Setup QEMU directory |
|
632 | 641 | mkdir "${BASEDIR}/qemu" |
|
633 | 642 | |
@@ -700,12 +709,12 if [ "$ENABLE_SPLITFS" = true ] ; then | |||
|
700 | 709 | |
|
701 | 710 | # Write firmware/boot partition tables |
|
702 | 711 | sfdisk -q -L -uS -f "$IMAGE_NAME-frmw.img" 2> /dev/null <<EOM |
|
703 |
|
|
|
712 | ${TABLE_SECTORS},${FRMW_SECTORS},c,* | |
|
704 | 713 | EOM |
|
705 | 714 | |
|
706 | 715 | # Write root partition table |
|
707 | 716 | sfdisk -q -L -uS -f "$IMAGE_NAME-root.img" 2> /dev/null <<EOM |
|
708 |
|
|
|
717 | ${TABLE_SECTORS},${ROOT_SECTORS},83 | |
|
709 | 718 | EOM |
|
710 | 719 | |
|
711 | 720 | # Setup temporary loop devices |
@@ -717,8 +726,8 else # ENABLE_SPLITFS=false | |||
|
717 | 726 | |
|
718 | 727 | # Write partition table |
|
719 | 728 | sfdisk -q -L -uS -f "$IMAGE_NAME.img" 2> /dev/null <<EOM |
|
720 |
|
|
|
721 |
|
|
|
729 | ${TABLE_SECTORS},${FRMW_SECTORS},c,* | |
|
730 | ${ROOT_OFFSET},${ROOT_SECTORS},83 | |
|
722 | 731 | EOM |
|
723 | 732 | |
|
724 | 733 | # Setup temporary loop devices |
@@ -733,7 +742,7 if [ "$ENABLE_CRYPTFS" = true ] ; then | |||
|
733 | 742 | # Setup password keyfile |
|
734 | 743 | touch .password |
|
735 | 744 | chmod 600 .password |
|
736 |
echo -n |
|
|
745 | echo -n ${CRYPTFS_PASSWORD} > .password | |
|
737 | 746 | |
|
738 | 747 | # Initialize encrypted partition |
|
739 | 748 | echo "YES" | cryptsetup luksFormat "${ROOT_LOOP}" -c "${CRYPTFS_CIPHER}" -s "${CRYPTFS_XTSKEYSIZE}" .password |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant