##// END OF EJS Templates
Merge pull request #3 from g-vidal/rpifegen...
Gérard Vidal -
r157:ad7572f1a187 Fusion
parent child
Show More
@@ -0,0 +1,13
1 ## Templates used at IFÉ ENS de Lyon for Tremplin project
2
3 These templates have been used to create Raspberry Pi images for the project "Climate and meteorolgy springboard for teaching sciences". These images are used as explained in the [blog](http://blog.climatetmeteo.fr/GerardVidal/) (mostly in french).
4
5 The aim was to share with teachers an image providing software resources to use commercial weatherstations or DIY weathersystems made with various sensors. The following images have been built :
6
7 * raspife2-stretch Debian stretch image for raspi 2
8 * raspife3-jessie Debian jessie image for raspi 3
9 * raspife3-stretch Debian stretch image for raspi 3
10 * raspife3W-stretch Debian stretch image for raspi 3 with single IPAddress and weewx service
11 * raspife3-buster Debian buster image for raspi 3
12
13
@@ -0,0 +1,80
1 Configuration file raspife2 Stretch IFÉ 2017/02/24
2 #
3 APT_SERVER=ftp.fr.debian.org
4 APT_INCLUDES="gnupg,gnupg2,firmware-realtek,firmware-linux-nonfree,firmware-linux,tightvncserver,build-essentia$
5 bison,libboost-all-dev,automake,autoconf,autogen,libtool,pkg-config,checkinstall,python3,python3-dev,menulibre,$
6 libnotify-bin,python,python-configobj,python-cheetah,python-imaging,python-serial,python-usb,python-dev,\
7 pcre2-utils,libpcre++-dev,libpcre2-dev,libjpeg-dev,jed,i2c-tools,python-smbus,policykit-1,usbutils,\
8 pmount,python-pip,python3-pip,geany,geany-plugin-py,geany-plugin-markdown,firefox-esr,firefox-esr-l10n-fr,\
9 icedtea-8-plugin,openjdk-8-jdk,openjdk-8-jre,openjdk-8-jre-headless,libqtwebkit-dev,libqt5webkit5-dev,\
10 libudev-dev,libzzip-dev,zlib1g-dev,libcanberra-gtk-module,libnss-myhostname,libfreetype6-dev,libpng16-16,\
11 lxsession,openbox-lxde-session,lxde"
12 #----------------------
13 RPI_MODEL=2
14 RELEASE="stretch"
15 HOSTNAME="raspife2"
16 PASSWORD="***********"
17 USER_PASSWORD="**************"
18 DEFLOCAL="fr_FR.UTF-8"
19 TIMEZONE="Europe/Paris"
20 EXPANDROOT=false
21 #-----------------------
22 XKB_MODEL="pc105"
23 XKB_LAYOUT="fr"
24 XKB_VARIANT="latin9"
25 XKB_OPTIONS=""
26 #------------------------
27 ENABLE_DHCP=true
28 #------------------------
29 ENABLE_CONSOLE=true
30 ENABLE_I2C=true
31 ENABLE_SPI=true
32 ENABLE_IPV6=true
33 ENABLE_SSHD=true
34 ENABLE_NONFREE=true
35 ENABLE_WIRELESS=false
36 ENABLE_RSYSLOG=true
37 ENABLE_SOUND=true
38 ENABLE_HWRANDOM=true
39 ENABLE_MINGPU=true
40 ENABLE_DBUS=true
41 ENABLE_XORG=true
42 ENABLE_WM="lxdm"
43 #------------------------
44 ENABLE_MINBASE=false
45 ENABLE_REDUCE=false
46 ENABLE_UBOOT=false
47 ENABLE_FBTURBO=true
48 ENABLE_IPTABLES=false
49 ENABLE_USER=true
50 USER_NAME=ens-ife
51 ENABLE_ROOT=true
52 ENABLE_HARDNET=true
53 ENABLE_INITRAMFS=true
54 ENABLE_IFNAMES=true
55 #------------------------
56 ENABLE_ROOT_SSH=false
57 SSH_LIMIT_USERS=false
58 SSH_ROOT_PUB_KEY="/home/********/.ssh/authorized_keys"
59 SSH_USER_PUB_KEY="/home/********/.ssh/authorized_keys"
60 #------------------------
61 BUILD_KERNEL=true
62 KERNEL_REDUCE=false
63 KERNEL_HEADERS=true
64 KERNEL_REMOVESRC=true
65 KERNELSRC_CLEAN=true
66 KERNELSRC_CONFIG=true
67 #------------------------
68 REDUCE_APT=false
69 REDUCE_DOC=true
70 REDUCE_MAN=false
71 REDUCE_HWDB=true
72 REDUCE_BASH=false
73 REDUCE_SSHD=false
74 REDUCE_LOCALE=false
75 #-------------------------
76 ENABLE_CRYPTFS=false
77 #-------------------------
78 BASEDIR=/media/********/images/${RELEASE}
79 DATE=date
80 +%Y-%m-%d IMAGE_NAME=${BASEDIR}/${DATE}-rpi${RPI_MODEL}-${RELEASE}
@@ -0,0 +1,4
1 # Configuration template file used by rpi23-gen-image.sh
2 RPI_MODEL=3
3 RELEASE=jessie
4 BUILD_KERNEL=true
@@ -0,0 +1,86
1 # Configuration file raspi3 Stretch IFÉ 2017/04/15
2 #
3 APT_SERVER=ftp.fr.debian.org
4 APT_INCLUDES="gnupg,gnupg2,firmware-linux-nonfree,firmware-linux,xutils-dev,\
5 gettext, tightvncserver,build-essential,git,cmake,libjson-c-dev,unzip,\
6 bison,libboost-all-dev,automake,autoconf,autogen,libtool,libtool-bin,pkg-config,checkinstall,menulibre,libnotify-bin, \
7 python3,python3-dev,python,python-dev,python-configobj,python-cheetah,python-imaging,python-serial,python-usb,\
8 python-tk,python3-tk,python3-scipy,pandoc,python-pypandoc,python3-pypandoc,python-pandocfilters,python3-pandocfilters, \
9 python-geopy,python3-geopy,python-pip,python3-pip, \
10 pcre2-utils,libpcre++-dev,libpcre2-dev,libjpeg-dev,jed,i2c-tools,python-smbus,policykit-1,usbutils,\
11 pmount,geany,geany-plugin-py,geany-plugin-markdown,firefox-esr,firefox-esr-l10n-fr,ntpdate, \
12 texlive,texlive-xetex,nginx-extras,ffmpeg,wicd,wicd-gtk,console-data,keyboard-configuration, \
13 icedtea-8-plugin,openjdk-8-jdk,openjdk-8-jre,openjdk-8-jre-headless,libqtwebkit-dev,libqt5webkit5-dev,\
14 libudev-dev,libzzip-dev,zlib1g-dev,libcanberra-gtk-module,libnss-myhostname,libfreetype6-dev,libpng16-16,\
15 nmap,libltdl-dev,lxsession,openbox-lxde-session,lxde,dbus-user-session,debian-archive-keyring"
16 #----------------------
17 RPI_MODEL=3
18 RELEASE="stretch"
19 HOSTNAME="raspife3"
20 PASSWORD="**********"
21 USER_PASSWORD="**********"
22 DEFLOCAL="fr_FR.UTF-8"
23 TIMEZONE="Europe/Paris"
24 EXPANDROOT=false
25 #-----------------------
26 XKB_MODEL="pc105"
27 XKB_LAYOUT="fr"
28 XKB_VARIANT="latin9"
29 XKB_OPTIONS=""
30 #------------------------
31 ENABLE_DHCP=true
32 #------------------------
33 ENABLE_CONSOLE=false
34 ENABLE_I2C=true
35 ENABLE_SPI=true
36 ENABLE_IPV6=true
37 ENABLE_SSHD=true
38 ENABLE_NONFREE=true
39 ENABLE_WIRELESS=true
40 ENABLE_RSYSLOG=true
41 ENABLE_SOUND=true
42 ENABLE_HWRANDOM=true
43 ENABLE_MINGPU=true
44 ENABLE_DBUS=true
45 ENABLE_XORG=true
46 ENABLE_WM="lxdm"
47 #------------------------
48 ENABLE_MINBASE=false
49 ENABLE_REDUCE=false
50 ENABLE_UBOOT=false
51 ENABLE_FBTURBO=false
52 ENABLE_IPTABLES=false
53 ENABLE_USER=true
54 USER_NAME=ens-ife
55 ENABLE_ROOT=true
56 ENABLE_HARDNET=true
57 ENABLE_INITRAMFS=true
58 ENABLE_IFNAMES=true
59 #------------------------
60 ENABLE_ROOT_SSH=false
61 SSH_LIMIT_USERS=false
62 SSH_ROOT_PUB_KEY="/home/*******/.ssh/authorized_keys"
63 SSH_USER_PUB_KEY="/home/*******/.ssh/authorized_keys"
64 #------------------------
65 BUILD_KERNEL=true
66 KERNEL_REDUCE=false
67 KERNEL_HEADERS=true
68 KERNEL_REMOVESRC=true
69 KERNELSRC_CLEAN=true
70 KERNELSRC_CONFIG=true
71 #------------------------
72 REDUCE_APT=false
73 REDUCE_DOC=true
74 REDUCE_MAN=false
75 REDUCE_HWDB=true
76 REDUCE_BASH=false
77 REDUCE_SSHD=false
78 REDUCE_LOCALE=false
79 #-------------------------
80 ENABLE_CRYPTFS=false
81 #-------------------------
82 BASEDIR=/data/RpiGenImage/Images/${RELEASE}
83 DATE=`date +%Y-%m-%d`
84 IMAGE_NAME=${BASEDIR}/${DATE}-rpi${RPI_MODEL}-${RELEASE}
85
86
@@ -0,0 +1,92
1 # Configuration file raspi3 Stretch IFÉ 2017/04/15
2 #
3 APT_SERVER=ftp.fr.debian.org
4 APT_INCLUDES="debian-archive-keyring,debian-keyring,automake,autoconf,autogen,gawk,gnupg,gnupg2, \
5 build-essential,git,cmake,libjson-c-dev,unzip,\
6 bison,libboost-all-dev,libtool,libtool-bin,pkg-config,checkinstall,libnotify-bin,pandoc, \
7 python3,python3-dev,python,python-dev,python-configobj,python-cheetah, \
8 python-imaging,python-serial,python-usb,python-tk,python3-tk,python3-scipy, \
9 python-pypandoc,python3-pypandoc,python-pandocfilters,python3-pandocfilters, \
10 python-geopy,python3-geopy,python-pip,python3-pip,python-smbus, \
11 libudev-dev,libzzip-dev,zlib1g-dev,libnss-myhostname,libpng16-16,nmap \
12 libltdl-dev,usbutils,pmount,ntpdate,texlive,texlive-xetex,nginx-extras,policykit-1"
13 #firehol"
14 #ffmpeg,console-data,keyboard-configuration,openjdk-8-jdk, \
15 #openjdk-8-jre,openjdk-8-jre-headless,pcre2-utils,libpcre++-dev,libpcre2-dev,libjpeg-dev,i2c-tools, \
16 #libcanberra-gtk-module,libqtwebkit-dev,libqt5webkit5-dev,libfreetype6-dev"
17 #,policykit-1,inetutils-ping,firmware-linux-nonfree,firmware-linux
18 #----------------------
19 RPI_MODEL=3
20 RELEASE="stretch"
21 HOSTNAME="raspwife3"
22 PASSWORD="**************"
23 USER_PASSWORD="*************"
24 DEFLOCAL="fr_FR.UTF-8"
25 TIMEZONE="Europe/Paris"
26 EXPANDROOT=false
27 #-----------------------
28 XKB_MODEL="pc105"
29 XKB_LAYOUT="fr"
30 XKB_VARIANT="latin9"
31 XKB_OPTIONS=""
32 #------------------------
33 ENABLE_DHCP=false
34 NET_ADDRESS="192.168.***.**/**"
35 NET_GATEWAY="192.168.***.1"
36 NET_DNS_1="192.168.***.1"
37 NET_DNS_2="8.8.8.8"
38 #------------------------
39 ENABLE_CONSOLE=false
40 ENABLE_I2C=true
41 ENABLE_SPI=true
42 ENABLE_IPV6=true
43 ENABLE_SSHD=true
44 ENABLE_NONFREE=true
45 ENABLE_WIRELESS=true
46 ENABLE_RSYSLOG=true
47 ENABLE_SOUND=true
48 ENABLE_HWRANDOM=true
49 ENABLE_MINGPU=true
50 ENABLE_DBUS=true
51 ENABLE_XORG=false
52 ENABLE_WM=""
53 #------------------------
54 ENABLE_MINBASE=false
55 ENABLE_REDUCE=false
56 ENABLE_UBOOT=false
57 ENABLE_FBTURBO=false
58 ENABLE_IPTABLES=false
59 ENABLE_USER=true
60 USER_NAME=ens-ife
61 ENABLE_ROOT=true
62 ENABLE_HARDNET=true
63 ENABLE_INITRAMFS=true
64 ENABLE_IFNAMES=true
65 #------------------------
66 ENABLE_ROOT_SSH=false
67 SSH_LIMIT_USERS=false
68 SSH_ROOT_PUB_KEY="/home/********/.ssh/authorized_keys"
69 SSH_USER_PUB_KEY="/home/********/.ssh/authorized_keys"
70 #------------------------
71 BUILD_KERNEL=true
72 KERNEL_REDUCE=false
73 KERNEL_HEADERS=true
74 KERNEL_REMOVESRC=true
75 KERNELSRC_CLEAN=true
76 KERNELSRC_CONFIG=true
77 #------------------------
78 REDUCE_APT=false
79 REDUCE_DOC=true
80 REDUCE_MAN=false
81 REDUCE_HWDB=true
82 REDUCE_BASH=false
83 REDUCE_SSHD=false
84 REDUCE_LOCALE=false
85 #-------------------------
86 ENABLE_CRYPTFS=false
87 #-------------------------
88 BASEDIR=/data/RpiGenImage/Images/${RELEASE}
89 DATE=`date +%Y-%m-%d`
90 IMAGE_NAME=${BASEDIR}/${DATE}-rpiw${RPI_MODEL}-${RELEASE}
91
92
@@ -1,53 +1,48
1 #
1 #
2 # Debootstrap basic system
2 # Debootstrap basic system
3 #
3 #
4
4
5 # Load utility functions
5 # Load utility functions
6 . ./functions.sh
6 . ./functions.sh
7
7
8 VARIANT=""
8 VARIANT=""
9 COMPONENTS="main"
9 COMPONENTS="main"
10 EXCLUDES=""
10 EXCLUDES=""
11
11
12 # Use non-free Debian packages if needed
12 # Use non-free Debian packages if needed
13 if [ "$ENABLE_NONFREE" = true ] ; then
13 if [ "$ENABLE_NONFREE" = true ] ; then
14 COMPONENTS="main,non-free"
14 COMPONENTS="main,non-free"
15 fi
15 fi
16
16
17 # Use minbase bootstrap variant which only includes essential packages
17 # Use minbase bootstrap variant which only includes essential packages
18 if [ "$ENABLE_MINBASE" = true ] ; then
18 if [ "$ENABLE_MINBASE" = true ] ; then
19 VARIANT="--variant=minbase"
19 VARIANT="--variant=minbase"
20 fi
20 fi
21
21
22 # Exclude packages if required by Debian release
22 # Exclude packages if required by Debian release
23 if [ "$RELEASE" = "stretch" ] ; then
23 if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
24 EXCLUDES="--exclude=init,systemd-sysv"
25 fi
26
27 # Exclude packages if required by Debian buster release
28 if [ "$RELEASE" = "buster" ] ; then
29 EXCLUDES="--exclude=init,systemd-sysv"
24 EXCLUDES="--exclude=init,systemd-sysv"
30 fi
25 fi
31
26
32 # Base debootstrap (unpack only)
27 # Base debootstrap (unpack only)
33 http_proxy=${APT_PROXY} debootstrap ${EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian"
28 http_proxy=${APT_PROXY} debootstrap ${EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian"
34
29
35 # Copy qemu emulator binary to chroot modified for changes in _apt management in buster
30 # Copy qemu emulator binary to chroot modified for changes in _apt management in buster
36 #install_exec "${QEMU_BINARY}" "${R}${QEMU_BINARY}"
31 #install_exec "${QEMU_BINARY}" "${R}${QEMU_BINARY}"
37 install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}"
32 install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}"
38
33
39 # Copy debian-archive-keyring.pgp
34 # Copy debian-archive-keyring.pgp
40 mkdir -p "${R}/usr/share/keyrings"
35 mkdir -p "${R}/usr/share/keyrings"
41 install_readonly /usr/share/keyrings/debian-archive-keyring.gpg "${R}/usr/share/keyrings/debian-archive-keyring.gpg"
36 install_readonly /usr/share/keyrings/debian-archive-keyring.gpg "${R}/usr/share/keyrings/debian-archive-keyring.gpg"
42
37
43 # Complete the bootstrapping process
38 # Complete the bootstrapping process
44 chroot_exec /debootstrap/debootstrap --second-stage
39 chroot_exec /debootstrap/debootstrap --second-stage
45
40
46 # Mount required filesystems
41 # Mount required filesystems
47 mount -t proc none "${R}/proc"
42 mount -t proc none "${R}/proc"
48 mount -t sysfs none "${R}/sys"
43 mount -t sysfs none "${R}/sys"
49
44
50 # Mount pseudo terminal slave if supported by Debian release
45 # Mount pseudo terminal slave if supported by Debian release
51 if [ -d "${R}/dev/pts" ] ; then
46 if [ -d "${R}/dev/pts" ] ; then
52 mount --bind /dev/pts "${R}/dev/pts"
47 mount --bind /dev/pts "${R}/dev/pts"
53 fi
48 fi
@@ -1,54 +1,49
1 #
1 #
2 # Build and Setup fbturbo Xorg driver
2 # Build and Setup fbturbo Xorg driver
3 #
3 #
4
4
5 # Load utility functions
5 # Load utility functions
6 . ./functions.sh
6 . ./functions.sh
7
7
8 if [ "$ENABLE_FBTURBO" = true ] ; then
8 if [ "$ENABLE_FBTURBO" = true ] ; then
9 # Install c/c++ build environment inside the chroot
9 # Install c/c++ build environment inside the chroot
10 chroot_install_cc
10 chroot_install_cc
11
11
12 # Copy existing fbturbo sources into chroot directory
12 # Copy existing fbturbo sources into chroot directory
13 if [ -n "$FBTURBOSRC_DIR" ] && [ -d "$FBTURBOSRC_DIR" ] ; then
13 if [ -n "$FBTURBOSRC_DIR" ] && [ -d "$FBTURBOSRC_DIR" ] ; then
14 # Copy local fbturbo sources
14 # Copy local fbturbo sources
15 cp -r "${FBTURBOSRC_DIR}" "${R}/tmp"
15 cp -r "${FBTURBOSRC_DIR}" "${R}/tmp"
16 else
16 else
17 # Create temporary directory for fbturbo sources
17 # Create temporary directory for fbturbo sources
18 temp_dir=$(sudo -u nobody mktemp -d)
18 temp_dir=$(sudo -u nobody mktemp -d)
19
19
20 # Fetch fbturbo sources
20 # Fetch fbturbo sources
21 sudo -u nobody git -C "${temp_dir}" clone "${FBTURBO_URL}"
21 sudo -u nobody git -C "${temp_dir}" clone "${FBTURBO_URL}"
22
22
23 # Move downloaded fbturbo sources
23 # Move downloaded fbturbo sources
24 mv "${temp_dir}/xf86-video-fbturbo" "${R}/tmp/"
24 mv "${temp_dir}/xf86-video-fbturbo" "${R}/tmp/"
25
25
26 # Remove temporary directory for fbturbo sources
26 # Remove temporary directory for fbturbo sources
27 rm -fr "${temp_dir}"
27 rm -fr "${temp_dir}"
28 fi
28 fi
29
29
30 # Install Xorg build dependencies
30 # Install Xorg build dependencies
31 if [ "$RELEASE" = "jessie" ] ; then
31 if [ "$RELEASE" = "jessie" ] || [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
32 chroot_exec apt-get -q -y --no-install-recommends install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev
33 elif [ "$RELEASE" = "stretch" ] ; then
34 chroot_exec apt-get -q -y --no-install-recommends --allow-unauthenticated install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev
35 # removed --allow-unauthenticated as recommended after amendment on _apt privileges
36 elif [ "$RELEASE" = "buster" ] ; then
37 chroot_exec apt-get -q -y --no-install-recommends install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev
32 chroot_exec apt-get -q -y --no-install-recommends install xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev
38 fi
33 fi
39
34
40 # Build and install fbturbo driver inside chroot
35 # Build and install fbturbo driver inside chroot
41 chroot_exec /bin/bash -x <<'EOF'
36 chroot_exec /bin/bash -x <<'EOF'
42 cd /tmp/xf86-video-fbturbo
37 cd /tmp/xf86-video-fbturbo
43 autoreconf -vi
38 autoreconf -vi
44 ./configure --prefix=/usr
39 ./configure --prefix=/usr
45 make
40 make
46 make install
41 make install
47 EOF
42 EOF
48
43
49 # Install fbturbo driver Xorg configuration
44 # Install fbturbo driver Xorg configuration
50 install_readonly files/xorg/99-fbturbo.conf "${R}/usr/share/X11/xorg.conf.d/99-fbturbo.conf"
45 install_readonly files/xorg/99-fbturbo.conf "${R}/usr/share/X11/xorg.conf.d/99-fbturbo.conf"
51
46
52 # Remove Xorg build dependencies
47 # Remove Xorg build dependencies
53 chroot_exec apt-get -qq -y --auto-remove purge xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev
48 chroot_exec apt-get -qq -y --auto-remove purge xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev
54 fi
49 fi
@@ -1,76 +1,74
1 # This file contains utility functions used by rpi23-gen-image.sh
1 # This file contains utility functions used by rpi23-gen-image.sh
2
2
3 cleanup (){
3 cleanup (){
4 set +x
4 set +x
5 set +e
5 set +e
6
6
7 # Identify and kill all processes still using files
7 # Identify and kill all processes still using files
8 echo "killing processes using mount point ..."
8 echo "killing processes using mount point ..."
9 fuser -k "${R}"
9 fuser -k "${R}"
10 sleep 3
10 sleep 3
11 fuser -9 -k -v "${R}"
11 fuser -9 -k -v "${R}"
12
12
13 # Clean up temporary .password file
13 # Clean up temporary .password file
14 if [ -r ".password" ] ; then
14 if [ -r ".password" ] ; then
15 shred -zu .password
15 shred -zu .password
16 fi
16 fi
17
17
18 # Clean up all temporary mount points
18 # Clean up all temporary mount points
19 echo "removing temporary mount points ..."
19 echo "removing temporary mount points ..."
20 umount -l "${R}/proc" 2> /dev/null
20 umount -l "${R}/proc" 2> /dev/null
21 umount -l "${R}/sys" 2> /dev/null
21 umount -l "${R}/sys" 2> /dev/null
22 umount -l "${R}/dev/pts" 2> /dev/null
22 umount -l "${R}/dev/pts" 2> /dev/null
23 umount "$BUILDDIR/mount/boot/firmware" 2> /dev/null
23 umount "$BUILDDIR/mount/boot/firmware" 2> /dev/null
24 umount "$BUILDDIR/mount" 2> /dev/null
24 umount "$BUILDDIR/mount" 2> /dev/null
25 cryptsetup close "${CRYPTFS_MAPPING}" 2> /dev/null
25 cryptsetup close "${CRYPTFS_MAPPING}" 2> /dev/null
26 losetup -d "$ROOT_LOOP" 2> /dev/null
26 losetup -d "$ROOT_LOOP" 2> /dev/null
27 losetup -d "$FRMW_LOOP" 2> /dev/null
27 losetup -d "$FRMW_LOOP" 2> /dev/null
28 trap - 0 1 2 3 6
28 trap - 0 1 2 3 6
29 }
29 }
30
30
31 chroot_exec() {
31 chroot_exec() {
32 # Exec command in chroot
32 # Exec command in chroot
33 LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot ${R} $*
33 LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot ${R} $*
34 }
34 }
35
35
36 install_readonly() {
36 install_readonly() {
37 # Install file with user read-only permissions
37 # Install file with user read-only permissions
38 install -o root -g root -m 644 $*
38 install -o root -g root -m 644 $*
39 }
39 }
40
40
41 install_exec() {
41 install_exec() {
42 # Install file with root exec permissions
42 # Install file with root exec permissions
43 install -o root -g root -m 744 $*
43 install -o root -g root -m 744 $*
44 }
44 }
45
45
46 use_template () {
46 use_template () {
47 # Test if configuration template file exists
47 # Test if configuration template file exists
48 if [ ! -r "./templates/${CONFIG_TEMPLATE}" ] ; then
48 if [ ! -r "./templates/${CONFIG_TEMPLATE}" ] ; then
49 echo "error: configuration template ${CONFIG_TEMPLATE} not found"
49 echo "error: configuration template ${CONFIG_TEMPLATE} not found"
50 exit 1
50 exit 1
51 fi
51 fi
52
52
53 # Load template configuration parameters
53 # Load template configuration parameters
54 . "./templates/${CONFIG_TEMPLATE}"
54 . "./templates/${CONFIG_TEMPLATE}"
55 }
55 }
56
56
57 chroot_install_cc() {
57 chroot_install_cc() {
58 # Install c/c++ build environment inside the chroot
58 # Install c/c++ build environment inside the chroot
59 if [ -z "${COMPILER_PACKAGES}" ] ; then
59 if [ -z "${COMPILER_PACKAGES}" ] ; then
60 COMPILER_PACKAGES=$(chroot_exec apt-get -s install g++ make bc | grep "^Inst " | awk -v ORS=" " '{ print $2 }')
60 COMPILER_PACKAGES=$(chroot_exec apt-get -s install g++ make bc | grep "^Inst " | awk -v ORS=" " '{ print $2 }')
61
61
62 if [ "$RELEASE" = "jessie" ] ; then
62 if [ "$RELEASE" = "jessie" ] || [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
63 chroot_exec apt-get -q -y --no-install-recommends install ${COMPILER_PACKAGES}
63 chroot_exec apt-get -q -y --no-install-recommends install ${COMPILER_PACKAGES}
64 elif [ "$RELEASE" = "stretch" ] ; then
65 chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install ${COMPILER_PACKAGES}
66 fi
64 fi
67 fi
65 fi
68 }
66 }
69
67
70 chroot_remove_cc() {
68 chroot_remove_cc() {
71 # Remove c/c++ build environment from the chroot
69 # Remove c/c++ build environment from the chroot
72 if [ ! -z "${COMPILER_PACKAGES}" ] ; then
70 if [ ! -z "${COMPILER_PACKAGES}" ] ; then
73 chroot_exec apt-get -qq -y --auto-remove purge ${COMPILER_PACKAGES}
71 chroot_exec apt-get -qq -y --auto-remove purge ${COMPILER_PACKAGES}
74 COMPILER_PACKAGES=""
72 COMPILER_PACKAGES=""
75 fi
73 fi
76 }
74 }
1 NO CONTENT: file renamed from templates/rpi3busterIFE to templates/raspife3-buster
NO CONTENT: file renamed from templates/rpi3busterIFE to templates/raspife3-buster
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant