55usage ()
66{
77 echo " Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir <directory>]"
8- echo " BuildArch can be: arm(default), arm64, armel, armv6, loongarch64, ppc64le, riscv64, s390x, x64, x86"
8+ echo " BuildArch can be: arm(default), arm64, loongarch64, ppc64le, riscv64, s390x, x64, x86"
99 echo " CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine"
1010 echo " for alpine can be specified with version: alpineX.YY or alpineedge"
1111 echo " for FreeBSD can be: freebsd13, freebsd14"
@@ -139,7 +139,6 @@ __AlpineKeys='
139139616db30d:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpUpyWDWjlUk3smlWeA0\nlIMW+oJ38t92CRLHH3IqRhyECBRW0d0aRGtq7TY8PmxjjvBZrxTNDpJT6KUk4LRm\na6A6IuAI7QnNK8SJqM0DLzlpygd7GJf8ZL9SoHSH+gFsYF67Cpooz/YDqWrlN7Vw\ntO00s0B+eXy+PCXYU7VSfuWFGK8TGEv6HfGMALLjhqMManyvfp8hz3ubN1rK3c8C\nUS/ilRh1qckdbtPvoDPhSbTDmfU1g/EfRSIEXBrIMLg9ka/XB9PvWRrekrppnQzP\nhP9YE3x/wbFc5QqQWiRCYyQl/rgIMOXvIxhkfe8H5n1Et4VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ==
14014066ba20fe:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtfB12w4ZgqsXWZDfUAV/\n6Y4aHUKIu3q4SXrNZ7CXF9nXoAVYrS7NAxJdAodsY3vPCN0g5O8DFXR+390LdOuQ\n+HsGKCc1k5tX5ZXld37EZNTNSbR0k+NKhd9h6X3u6wqPOx7SIKxwAQR8qeeFq4pP\nrt9GAGlxtuYgzIIcKJPwE0dZlcBCg+GnptCUZXp/38BP1eYC+xTXSL6Muq1etYfg\nodXdb7Yl+2h1IHuOwo5rjgY5kpY7GcAs8AjGk3lDD/av60OTYccknH0NCVSmPoXK\nvrxDBOn0LQRNBLcAfnTKgHrzy0Q5h4TNkkyTgxkoQw5ObDk9nnabTxql732yy9BY\ns+hM9+dSFO1HKeVXreYSA2n1ndF18YAvAumzgyqzB7I4pMHXq1kC/8bONMJxwSkS\nYm6CoXKyavp7RqGMyeVpRC7tV+blkrrUml0BwNkxE+XnwDRB3xDV6hqgWe0XrifD\nYTfvd9ScZQP83ip0r4IKlq4GMv/R5shcCRJSkSZ6QSGshH40JYSoiwJf5FHbj9ND\n7do0UAqebWo4yNx63j/wb2ULorW3AClv0BCFSdPsIrCStiGdpgJDBR2P2NZOCob3\nG9uMj+wJD6JJg2nWqNJxkANXX37Qf8plgzssrhrgOvB0fjjS7GYhfkfmZTJ0wPOw\nA8+KzFseBh4UFGgue78KwgkCAwEAAQ==
141141'
142- __Keyring=
143142__KeyringFile=" /usr/share/keyrings/ubuntu-archive-keyring.gpg"
144143__SkipSigCheck=0
145144__SkipEmulation=0
@@ -162,6 +161,10 @@ while :; do
162161 __AlpineArch=armv7
163162 __QEMUArch=arm
164163 ;;
164+ armel)
165+ # this is only used for tizen-build-rootfs.sh
166+ __BuildArch=armel
167+ ;;
165168 arm64)
166169 __BuildArch=arm64
167170 __UbuntuArch=arm64
@@ -172,42 +175,13 @@ while :; do
172175 __OpenBSDArch=arm64
173176 __OpenBSDMachineArch=aarch64
174177 ;;
175- armel)
176- __BuildArch=armel
177- __UbuntuArch=armel
178- __UbuntuRepo=" http://archive.debian.org/debian/"
179- __CodeName=buster
180- __KeyringFile=" /usr/share/keyrings/debian-archive-keyring.gpg"
181- __LLDB_Package=" liblldb-6.0-dev"
182- __UbuntuPackages=" ${__UbuntuPackages// libomp-dev/ } "
183- __UbuntuPackages=" ${__UbuntuPackages// libomp5/ } "
184- __UbuntuSuites=
185- ;;
186- armv6)
187- __BuildArch=armv6
188- __UbuntuArch=armhf
189- __QEMUArch=arm
190- __UbuntuRepo=" http://raspbian.raspberrypi.org/raspbian/"
191- __CodeName=buster
192- __KeyringFile=" /usr/share/keyrings/raspbian-archive-keyring.gpg"
193- __LLDB_Package=" liblldb-6.0-dev"
194- __UbuntuSuites=
195-
196- if [[ -e " $__KeyringFile " ]]; then
197- __Keyring=" --keyring $__KeyringFile "
198- fi
199- ;;
200178 loongarch64)
201179 __BuildArch=loongarch64
202180 __AlpineArch=loongarch64
203181 __QEMUArch=loongarch64
204182 __UbuntuArch=loong64
205183 __UbuntuSuites=unreleased
206184 __LLDB_Package=" liblldb-19-dev"
207-
208- if [[ " $__CodeName " == " sid" ]]; then
209- __UbuntuRepo=" http://ftp.ports.debian.org/debian-ports/"
210- fi
211185 ;;
212186 riscv64)
213187 __BuildArch=riscv64
@@ -223,7 +197,7 @@ while :; do
223197 __AlpineArch=ppc64le
224198 __QEMUArch=ppc64le
225199 __UbuntuArch=ppc64el
226- __UbuntuRepo=" http ://ports.ubuntu.com/ubuntu-ports/"
200+ __UbuntuRepo=" https ://ports.ubuntu.com/ubuntu-ports/"
227201 __UbuntuPackages=" ${__UbuntuPackages// libunwind8-dev/ } "
228202 __UbuntuPackages=" ${__UbuntuPackages// libomp-dev/ } "
229203 __UbuntuPackages=" ${__UbuntuPackages// libomp5/ } "
@@ -234,7 +208,7 @@ while :; do
234208 __AlpineArch=s390x
235209 __QEMUArch=s390x
236210 __UbuntuArch=s390x
237- __UbuntuRepo=" http ://ports.ubuntu.com/ubuntu-ports/"
211+ __UbuntuRepo=" https ://ports.ubuntu.com/ubuntu-ports/"
238212 __UbuntuPackages=" ${__UbuntuPackages// libunwind8-dev/ } "
239213 __UbuntuPackages=" ${__UbuntuPackages// libomp-dev/ } "
240214 __UbuntuPackages=" ${__UbuntuPackages// libomp5/ } "
@@ -250,13 +224,13 @@ while :; do
250224 __OpenBSDMachineArch=amd64
251225 __illumosArch=x86_64
252226 __HaikuArch=x86_64
253- __UbuntuRepo=" http ://archive.ubuntu.com/ubuntu/"
227+ __UbuntuRepo=" https ://archive.ubuntu.com/ubuntu/"
254228 ;;
255229 x86)
256230 __BuildArch=x86
257231 __UbuntuArch=i386
258232 __AlpineArch=x86
259- __UbuntuRepo=" http ://archive.ubuntu.com/ubuntu/"
233+ __UbuntuRepo=" https ://archive.ubuntu.com/ubuntu/"
260234 ;;
261235 lldb* )
262236 version=" $( echo " $lowerI " | tr -d ' [:alpha:]-=' ) "
@@ -316,7 +290,7 @@ while :; do
316290 __KeyringFile=" /usr/share/keyrings/debian-archive-keyring.gpg"
317291
318292 if [[ -z " $__UbuntuRepo " ]]; then
319- __UbuntuRepo=" http ://ftp .debian.org/debian/"
293+ __UbuntuRepo=" https ://archive .debian.org/debian/"
320294 fi
321295 ;;
322296 buster) # Debian 10
@@ -325,23 +299,23 @@ while :; do
325299 __KeyringFile=" /usr/share/keyrings/debian-archive-keyring.gpg"
326300
327301 if [[ -z " $__UbuntuRepo " ]]; then
328- __UbuntuRepo=" http ://archive.debian.org/debian/"
302+ __UbuntuRepo=" https ://archive.debian.org/debian/"
329303 fi
330304 ;;
331305 bullseye) # Debian 11
332306 __CodeName=bullseye
333307 __KeyringFile=" /usr/share/keyrings/debian-archive-keyring.gpg"
334308
335309 if [[ -z " $__UbuntuRepo " ]]; then
336- __UbuntuRepo=" http ://ftp.debian.org/debian/"
310+ __UbuntuRepo=" https ://ftp.debian.org/debian/"
337311 fi
338312 ;;
339313 bookworm) # Debian 12
340314 __CodeName=bookworm
341315 __KeyringFile=" /usr/share/keyrings/debian-archive-keyring.gpg"
342316
343317 if [[ -z " $__UbuntuRepo " ]]; then
344- __UbuntuRepo=" http ://ftp.debian.org/debian/"
318+ __UbuntuRepo=" https ://ftp.debian.org/debian/"
345319 fi
346320 ;;
347321 sid) # Debian sid
@@ -350,25 +324,21 @@ while :; do
350324
351325 # Debian-Ports architectures need different values
352326 case " $__UbuntuArch " in
353- amd64|arm64|armel| armhf|i386|mips64el|ppc64el|riscv64|s390x)
327+ amd64|arm64|armhf|i386|mips64el|ppc64el|riscv64|s390x)
354328 __KeyringFile=" /usr/share/keyrings/debian-archive-keyring.gpg"
355329
356330 if [[ -z " $__UbuntuRepo " ]]; then
357- __UbuntuRepo=" http ://ftp.debian.org/debian/"
331+ __UbuntuRepo=" https ://ftp.debian.org/debian/"
358332 fi
359333 ;;
360334 * )
361335 __KeyringFile=" /usr/share/keyrings/debian-ports-archive-keyring.gpg"
362336
363337 if [[ -z " $__UbuntuRepo " ]]; then
364- __UbuntuRepo=" http ://ftp.ports .debian.org/debian-ports/"
338+ __UbuntuRepo=" https ://ftp.debian.org/debian-ports/"
365339 fi
366340 ;;
367341 esac
368-
369- if [[ -e " $__KeyringFile " ]]; then
370- __Keyring=" --keyring $__KeyringFile "
371- fi
372342 ;;
373343 tizen)
374344 __CodeName=
472442__UbuntuPackages+=" ${__LLDB_Package:- } "
473443
474444if [[ -z " $__UbuntuRepo " ]]; then
475- __UbuntuRepo=" http ://ports.ubuntu.com/"
445+ __UbuntuRepo=" https ://ports.ubuntu.com/"
476446fi
477447
478448if [[ -n " $__LLVM_MajorVersion " ]]; then
@@ -559,24 +529,24 @@ if [[ "$__CodeName" == "alpine" ]]; then
559529 # initialize DB
560530 # shellcheck disable=SC2086
561531 " $__ApkToolsDir /apk.static" \
562- -X " http ://dl-cdn.alpinelinux.org/alpine/$version /main" \
563- -X " http ://dl-cdn.alpinelinux.org/alpine/$version /community" \
532+ -X " https ://dl-cdn.alpinelinux.org/alpine/$version /main" \
533+ -X " https ://dl-cdn.alpinelinux.org/alpine/$version /community" \
564534 -U $__ApkSignatureArg --root " $__RootfsDir " --arch " $__AlpineArch " --initdb add
565535
566536 if [[ " $__AlpineLlvmLibsLookup " == 1 ]]; then
567537 # shellcheck disable=SC2086
568538 __AlpinePackages+=" $( " $__ApkToolsDir /apk.static" \
569- -X " http ://dl-cdn.alpinelinux.org/alpine/$version /main" \
570- -X " http ://dl-cdn.alpinelinux.org/alpine/$version /community" \
539+ -X " https ://dl-cdn.alpinelinux.org/alpine/$version /main" \
540+ -X " https ://dl-cdn.alpinelinux.org/alpine/$version /community" \
571541 -U $__ApkSignatureArg --root " $__RootfsDir " --arch " $__AlpineArch " \
572542 search ' llvm*-libs' | grep -E ' ^llvm' | sort | tail -1 | sed ' s/-[^-]*//2g' ) "
573543 fi
574544
575545 # install all packages in one go
576546 # shellcheck disable=SC2086
577547 " $__ApkToolsDir /apk.static" \
578- -X " http ://dl-cdn.alpinelinux.org/alpine/$version /main" \
579- -X " http ://dl-cdn.alpinelinux.org/alpine/$version /community" \
548+ -X " https ://dl-cdn.alpinelinux.org/alpine/$version /main" \
549+ -X " https ://dl-cdn.alpinelinux.org/alpine/$version /community" \
580550 -U $__ApkSignatureArg --root " $__RootfsDir " --arch " $__AlpineArch " $__NoEmulationArg \
581551 add $__AlpinePackages
582552
@@ -593,7 +563,7 @@ elif [[ "$__CodeName" == "freebsd" ]]; then
593563 curl -SL " https://download.freebsd.org/ftp/releases/${__FreeBSDArch} /${__FreeBSDMachineArch} /${__FreeBSDBase} /base.txz" | tar -C " $__RootfsDir " -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version
594564 fi
595565 echo " ABI = \" FreeBSD:${__FreeBSDABI} :${__FreeBSDMachineArch} \" ; FINGERPRINTS = \" ${__RootfsDir} /usr/share/keys\" ; REPOS_DIR = [\" ${__RootfsDir} /etc/pkg\" ]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > " ${__RootfsDir} " /usr/local/etc/pkg.conf
596- echo " FreeBSD: { url: \" pkg+http ://pkg.FreeBSD.org/\$ {ABI}/quarterly\" , mirror_type: \" srv\" , signature_type: \" fingerprints\" , fingerprints: \" /usr/share/keys/pkg\" , enabled: yes }" > " ${__RootfsDir} " /etc/pkg/FreeBSD.conf
566+ echo " FreeBSD: { url: \" pkg+https ://pkg.FreeBSD.org/\$ {ABI}/quarterly\" , mirror_type: \" srv\" , signature_type: \" fingerprints\" , fingerprints: \" /usr/share/keys/pkg\" , enabled: yes }" > " ${__RootfsDir} " /etc/pkg/FreeBSD.conf
597567 mkdir -p " $__RootfsDir " /tmp
598568 # get and build package manager
599569 if [[ " $__hasWget " == 1 ]]; then
@@ -830,6 +800,14 @@ elif [[ "$__CodeName" == "haiku" ]]; then
830800elif [[ -n " $__CodeName " ]]; then
831801 __Suites=" $__CodeName $( for suite in $__UbuntuSuites ; do echo -n " $__CodeName -$suite " ; done) "
832802
803+ __SigCheckArgs=
804+ if [[ " $__SkipSigCheck " == " 0" ]]; then
805+ if [[ -e " $__KeyringFile " ]]; then
806+ __SigCheckArgs=" --keyring $__KeyringFile "
807+ fi
808+ __SigCheckArgs=" $__SigCheckArgs --force-check-gpg"
809+ fi
810+
833811 if [[ " $__SkipEmulation " == " 1" ]]; then
834812 if [[ -z " $AR " ]]; then
835813 if command -v ar & > /dev/null; then
@@ -845,31 +823,23 @@ elif [[ -n "$__CodeName" ]]; then
845823 PYTHON=${PYTHON_EXECUTABLE:- python3}
846824
847825 # shellcheck disable=SC2086,SC2046
848- echo running " $PYTHON " " $__CrossDir /install-debs.py" --arch " $__UbuntuArch " --mirror " $__UbuntuRepo " --rootfsdir " $__RootfsDir " --artool " $AR " \
826+ echo running " $PYTHON " " $__CrossDir /install-debs.py" $__SigCheckArgs --arch " $__UbuntuArch " --mirror " $__UbuntuRepo " --rootfsdir " $__RootfsDir " --artool " $AR " \
849827 $( for suite in $__Suites ; do echo -n " --suite $suite " ; done) \
850828 $__UbuntuPackages
851829
852830 # shellcheck disable=SC2086,SC2046
853- " $PYTHON " " $__CrossDir /install-debs.py" --arch " $__UbuntuArch " --mirror " $__UbuntuRepo " --rootfsdir " $__RootfsDir " --artool " $AR " \
831+ " $PYTHON " " $__CrossDir /install-debs.py" $__SigCheckArgs --arch " $__UbuntuArch " --mirror " $__UbuntuRepo " --rootfsdir " $__RootfsDir " --artool " $AR " \
854832 $( for suite in $__Suites ; do echo -n " --suite $suite " ; done) \
855833 $__UbuntuPackages
856834
857835 exit 0
858836 fi
859837
860- __UpdateOptions=
861- if [[ " $__SkipSigCheck " == " 0" ]]; then
862- __Keyring=" $__Keyring --force-check-gpg"
863- else
864- __Keyring=
865- __UpdateOptions=" --allow-unauthenticated --allow-insecure-repositories"
866- fi
867-
868838 # shellcheck disable=SC2086
869- echo running debootstrap " --variant=minbase" $__Keyring --arch " $__UbuntuArch " " $__CodeName " " $__RootfsDir " " $__UbuntuRepo "
839+ echo running debootstrap " --variant=minbase" $__SigCheckArgs --arch " $__UbuntuArch " " $__CodeName " " $__RootfsDir " " $__UbuntuRepo "
870840
871841 # shellcheck disable=SC2086
872- if ! debootstrap " --variant=minbase" $__Keyring --arch " $__UbuntuArch " " $__CodeName " " $__RootfsDir " " $__UbuntuRepo " ; then
842+ if ! debootstrap " --variant=minbase" $__SigCheckArgs --arch " $__UbuntuArch " " $__CodeName " " $__RootfsDir " " $__UbuntuRepo " ; then
873843 echo " debootstrap failed! dumping debootstrap.log"
874844 cat " $__RootfsDir /debootstrap/debootstrap.log"
875845 exit 1
@@ -887,6 +857,11 @@ Components: main universe
887857Signed-By: $__KeyringFile
888858EOF
889859
860+ __UpdateOptions=
861+ if [[ " $__SkipSigCheck " == " 1" ]]; then
862+ __UpdateOptions=" --allow-unauthenticated --allow-insecure-repositories"
863+ fi
864+
890865 # shellcheck disable=SC2086
891866 chroot " $__RootfsDir " apt-get update $__UpdateOptions
892867 chroot " $__RootfsDir " apt-get -f -y install
0 commit comments