##// END OF EJS Templates
its bin/sh again...
Unknown -
r384:ebd8e6e39c8b
parent child
Show More
@@ -448,13 +448,13 After the image file was successfully created by the `rpi23-gen-image.sh` script
448
448
449 ##### Flashing examples:
449 ##### Flashing examples:
450 ```shell
450 ```shell
451 bmaptool copy ./images/jessie/2017-01-23-rpi3-jessie.img /dev/mmcblk0
451 bmaptool copy ./images/buster/2017-01-23-rpi3-buster.img /dev/mmcblk0
452 dd bs=4M if=./images/jessie/2017-01-23-rpi3-jessie.img of=/dev/mmcblk0
452 dd bs=4M if=./images/buster/2017-01-23-rpi3-buster.img of=/dev/mmcblk0
453 ```
453 ```
454 If you have set `ENABLE_SPLITFS`, copy the `-frmw` image on the microSD card, then the `-root` one on the USB drive:
454 If you have set `ENABLE_SPLITFS`, copy the `-frmw` image on the microSD card, then the `-root` one on the USB drive:
455 ```shell
455 ```shell
456 bmaptool copy ./images/jessie/2017-01-23-rpi3-jessie-frmw.img /dev/mmcblk0
456 bmaptool copy ./images/buster/2017-01-23-rpi3-buster-frmw.img /dev/mmcblk0
457 bmaptool copy ./images/jessie/2017-01-23-rpi3-jessie-root.img /dev/sdc
457 bmaptool copy ./images/buster/2017-01-23-rpi3-buster-root.img /dev/sdc
458 ```
458 ```
459
459
460 ## QEMU emulation
460 ## QEMU emulation
@@ -42,9 +42,9 fi
42
42
43 # Setup firmware boot cmdline
43 # Setup firmware boot cmdline
44 if [ "$ENABLE_SPLITFS" = true ] ; then
44 if [ "$ENABLE_SPLITFS" = true ] ; then
45 CMDLINE="dwc_otg.lpm_enable=0 root=/dev/sda1 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline rootwait console=tty1"
45 CMDLINE="dwc_otg.lpm_enable=0 root=/dev/sda1 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline rootwait console=tty1 init=/bin/systemd"
46 else
46 else
47 CMDLINE="dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline rootwait console=tty1"
47 CMDLINE="dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootflags=commit=100,data=writeback elevator=deadline rootwait console=tty1 init=/bin/systemd"
48 fi
48 fi
49
49
50 # Add encrypted root partition to cmdline.txt
50 # Add encrypted root partition to cmdline.txt
@@ -73,11 +73,6 else
73 CMDLINE="${CMDLINE} net.ifnames=1"
73 CMDLINE="${CMDLINE} net.ifnames=1"
74 fi
74 fi
75
75
76 # Set init to systemd if required by Debian release
77 if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
78 CMDLINE="${CMDLINE} init=/bin/systemd"
79 fi
80
81 # Install firmware boot cmdline
76 # Install firmware boot cmdline
82 echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt"
77 echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt"
83
78
@@ -7,11 +7,11
7
7
8 # Install and setup hostname
8 # Install and setup hostname
9 install_readonly files/network/hostname "${ETC_DIR}/hostname"
9 install_readonly files/network/hostname "${ETC_DIR}/hostname"
10 sed -i "s/^rpi2-jessie/${HOSTNAME}/" "${ETC_DIR}/hostname"
10 sed -i "s/^RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hostname"
11
11
12 # Install and setup hosts
12 # Install and setup hosts
13 install_readonly files/network/hosts "${ETC_DIR}/hosts"
13 install_readonly files/network/hosts "${ETC_DIR}/hosts"
14 sed -i "s/rpi2-jessie/${HOSTNAME}/" "${ETC_DIR}/hosts"
14 sed -i "s/RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hosts"
15
15
16 # Setup hostname entry with static IP
16 # Setup hostname entry with static IP
17 if [ "$NET_ADDRESS" != "" ] ; then
17 if [ "$NET_ADDRESS" != "" ] ; then
@@ -65,13 +65,12 sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/eth.network"
65 sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/wlan.network"
65 sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/wlan.network"
66
66
67 # Move systemd network configuration if required by Debian release
67 # Move systemd network configuration if required by Debian release
68 if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
68 mv -v "${ETC_DIR}/systemd/network/eth.network" "${LIB_DIR}/systemd/network/10-eth.network"
69 mv -v "${ETC_DIR}/systemd/network/eth.network" "${LIB_DIR}/systemd/network/10-eth.network"
69 # If WLAN is enabled copy wlan configuration too
70 if [ "$ENABLE_WIRELESS" = true ] ; then
70 if [ "$ENABLE_WIRELESS" = true ] ; then
71 mv -v "${ETC_DIR}/systemd/network/wlan.network" "${LIB_DIR}/systemd/network/11-wlan.network"
71 mv -v "${ETC_DIR}/systemd/network/wlan.network" "${LIB_DIR}/systemd/network/11-wlan.network"
72 fi
73 rm -fr "${ETC_DIR}/systemd/network"
74 fi
72 fi
73 rm -fr "${ETC_DIR}/systemd/network"
75
74
76 # Enable systemd-networkd service
75 # Enable systemd-networkd service
77 chroot_exec systemctl enable systemd-networkd
76 chroot_exec systemctl enable systemd-networkd
@@ -11,9 +11,7 if [ "$ENABLE_IPTABLES" = true ] ; then
11
11
12 # make sure iptables-legacy is the used alternatives
12 # make sure iptables-legacy is the used alternatives
13 #iptables-save and -restore are slaves of iptables and thus are set accordingly
13 #iptables-save and -restore are slaves of iptables and thus are set accordingly
14 if ! [ "$RELEASE" = jessie ] ; then
14 chroot_exec update-alternatives --verbose --set iptables /usr/sbin/iptables-legacy
15 chroot_exec update-alternatives --verbose --set iptables /usr/sbin/iptables-legacy
16 fi
17
15
18 # Install iptables systemd service
16 # Install iptables systemd service
19 install_readonly files/iptables/iptables.service "${ETC_DIR}/systemd/system/iptables.service"
17 install_readonly files/iptables/iptables.service "${ETC_DIR}/systemd/system/iptables.service"
@@ -28,11 +28,7 if [ "$ENABLE_FBTURBO" = true ] ; then
28 fi
28 fi
29
29
30 # Install Xorg build dependencies
30 # Install Xorg build dependencies
31 if [ "$RELEASE" = "jessie" ] ; then
31 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
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" ] || [ "$RELEASE" = "buster" ] ; 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 fi
36
32
37 # Build and install fbturbo driver inside chroot
33 # Build and install fbturbo driver inside chroot
38 chroot_exec /bin/bash -x <<'EOF'
34 chroot_exec /bin/bash -x <<'EOF'
@@ -46,12 +46,8 if [ "$ENABLE_REDUCE" = true ] ; then
46
46
47 # Replace bash shell by dash shell (experimental)
47 # Replace bash shell by dash shell (experimental)
48 if [ "$REDUCE_BASH" = true ] ; then
48 if [ "$REDUCE_BASH" = true ] ; then
49 if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
49 # Purge bash and update alternatives
50 echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --allow-remove-essential bash
50 echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --allow-remove-essential bash
51 else
52 echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --force-yes bash
53 fi
54
55 chroot_exec update-alternatives --install /bin/bash bash /bin/dash 100
51 chroot_exec update-alternatives --install /bin/bash bash /bin/dash 100
56 fi
52 fi
57
53
@@ -60,11 +56,6 if [ "$ENABLE_REDUCE" = true ] ; then
60 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
56 chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
61 fi
57 fi
62
58
63 # Re-install tools for managing kernel modules
64 if [ "$RELEASE" = "jessie" ] ; then
65 chroot_exec apt-get -qq -y install module-init-tools
66 fi
67
68 # Remove GPU kernels
59 # Remove GPU kernels
69 if [ "$ENABLE_MINGPU" = true ] ; then
60 if [ "$ENABLE_MINGPU" = true ] ; then
70 rm -f "${BOOT_DIR}/start.elf"
61 rm -f "${BOOT_DIR}/start.elf"
@@ -1,1 +1,1
1 rpi2-jessie
1 RaspberryPI
@@ -1,5 +1,5
1 127.0.0.1 localhost
1 127.0.0.1 localhost
2 127.0.1.1 rpi2-jessie
2 127.0.1.1 RaspberryPI
3
3
4 ::1 localhost ip6-localhost ip6-loopback
4 ::1 localhost ip6-localhost ip6-loopback
5 ff02::1 ip6-allnodes
5 ff02::1 ip6-allnodes
@@ -63,12 +63,8 chroot_install_cc() {
63 # Install c/c++ build environment inside the chroot
63 # Install c/c++ build environment inside the chroot
64 if [ -z "${COMPILER_PACKAGES}" ] ; then
64 if [ -z "${COMPILER_PACKAGES}" ] ; then
65 COMPILER_PACKAGES=$(chroot_exec apt-get -s install g++ make bc | grep "^Inst " | awk -v ORS=" " '{ print $2 }')
65 COMPILER_PACKAGES=$(chroot_exec apt-get -s install g++ make bc | grep "^Inst " | awk -v ORS=" " '{ print $2 }')
66
66 # Install COMPILER_PACKAGES in chroot
67 if [ "$RELEASE" = "jessie" ] ; then
67 chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install ${COMPILER_PACKAGES}
68 chroot_exec apt-get -q -y --no-install-recommends install ${COMPILER_PACKAGES}
69 elif [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
70 chroot_exec apt-get -q -y --allow-unauthenticated --no-install-recommends install ${COMPILER_PACKAGES}
71 fi
72 fi
68 fi
73 }
69 }
74
70
@@ -1,4 +1,4
1 #!/bin/bash
1 #!/bin/sh
2 ########################################################################
2 ########################################################################
3 # rpi23-gen-image.sh 2015-2017
3 # rpi23-gen-image.sh 2015-2017
4 #
4 #
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant