##// END OF EJS Templates
Merge pull request #37 from stevebrandli/enhance...
drtyhlpr -
r87:861073c44ead Fusion
parent child
Show More
@@ -1,5 +1,6
1 1 images
2 2 custom.d
3 packages
3 4 *.swp
4 5 *.bak
5 6 *.log
@@ -144,7 +144,10 Install and enable the hardware accelerated Xorg video driver `fbturbo`. Please
144 144 Enable iptables IPv4/IPv6 firewall. Simplified ruleset: Allow all outgoing connections. Block all incoming connections except to OpenSSH service.
145 145
146 146 ##### `ENABLE_USER`=true
147 Create pi user with password raspberry
147 Create non-root user with password raspberry. Unless overridden with `USER_NAME`=user, username will be `pi`.
148
149 ##### `USER_NAME`=pi
150 Non-root user to create. Ignored if `ENABLE_USER`=false
148 151
149 152 ##### `ENABLE_ROOT`=true
150 153 Set root user password so root login will be enabled
@@ -196,6 +199,9 Run `make bcm2709_defconfig` (and optional `make menuconfig`) to configure the k
196 199 ##### `KERNELSRC_PREBUILT`=false
197 200 With this parameter set to true the script expects the existing kernel sources directory to be already successfully cross-compiled. The parameters `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG` and `KERNEL_MENUCONFIG` are ignored and no kernel compilation tasks are performed.
198 201
202 ##### `FIRMWAREDIR`=""
203 The directory containing a local copy of the firmware from the [RaspberryPi firmware project](https://github.com/raspberrypi/firmware). Default is to download the latest firmware directly from the project.
204
199 205 #### Reduce disk usage:
200 206 The following list of parameters is ignored if `ENABLE_REDUCE`=false.
201 207
@@ -275,6 +281,10 All the required configuration files that will be copied to the generated OS ima
275 281 | `sysctl.d` | Swapping and Network Hardening configuration |
276 282 | `xorg` | fbturbo Xorg driver configuration |
277 283
284 Debian custom packages, i.e. those not in the debian repositories, can be installed by placing them in the `packages` directory. They are installed immediately after packages from the repositories are installed. Any dependencies listed in the custom packages will be downloaded automatically from the repositories. Do not list these custom packages in `APT_INCLUDES`.
285
286 Scripts in the custom.d directory will be executed after all other installation is complete but before the image is created.
287
278 288 ## Logging of the bootstrapping process
279 289 All information related to the bootstrapping process and the commands executed by the `rpi2-gen-image.sh` script can easily be saved into a logfile. The common shell command `script` can be used for this purpose:
280 290
@@ -34,4 +34,13 fi
34 34 # Upgrade package index and update all installed packages and changed dependencies
35 35 chroot_exec apt-get -qq -y update
36 36 chroot_exec apt-get -qq -y -u dist-upgrade
37
38 if [ -d packages ] ; then
39 for package in packages/*.deb ; do
40 cp $package ${R}/tmp
41 chroot_exec dpkg --unpack /tmp/$(basename $package)
42 done
43 fi
44 chroot_exec apt-get -qq -y -f install
45
37 46 chroot_exec apt-get -qq -y check
@@ -131,14 +131,25 if [ "$BUILD_KERNEL" = true ] ; then
131 131 rm -fr "${KERNELDIR}"
132 132 fi
133 133
134 # Install latest boot binaries from raspberry/firmware github
135 wget -q -O "${BOOTDIR}/bootcode.bin" https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
136 wget -q -O "${BOOTDIR}/fixup.dat" https://github.com/raspberrypi/firmware/raw/master/boot/fixup.dat
137 wget -q -O "${BOOTDIR}/fixup_cd.dat" https://github.com/raspberrypi/firmware/raw/master/boot/fixup_cd.dat
138 wget -q -O "${BOOTDIR}/fixup_x.dat" https://github.com/raspberrypi/firmware/raw/master/boot/fixup_x.dat
139 wget -q -O "${BOOTDIR}/start.elf" https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
140 wget -q -O "${BOOTDIR}/start_cd.elf" https://github.com/raspberrypi/firmware/raw/master/boot/start_cd.elf
141 wget -q -O "${BOOTDIR}/start_x.elf" https://github.com/raspberrypi/firmware/raw/master/boot/start_x.elf
134 if [ -n "$FIRMWAREDIR" ] && [ -d "$FIRMWAREDIR" ] ; then
135 # Install boot binaries from local directory
136 cp ${FIRMWAREDIR}/boot/bootcode.bin ${BOOTDIR}/bootcode.bin
137 cp ${FIRMWAREDIR}/boot/fixup.dat ${BOOTDIR}/fixup.dat
138 cp ${FIRMWAREDIR}/boot/fixup_cd.dat ${BOOTDIR}/fixup_cd.dat
139 cp ${FIRMWAREDIR}/boot/fixup_x.dat ${BOOTDIR}/fixup_x.dat
140 cp ${FIRMWAREDIR}/boot/start.elf ${BOOTDIR}/start.elf
141 cp ${FIRMWAREDIR}/boot/start_cd.elf ${BOOTDIR}/start_cd.elf
142 cp ${FIRMWAREDIR}/boot/start_x.elf ${BOOTDIR}/start_x.elf
143 else
144 # Install latest boot binaries from raspberry/firmware github
145 wget -q -O "${BOOTDIR}/bootcode.bin" https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
146 wget -q -O "${BOOTDIR}/fixup.dat" https://github.com/raspberrypi/firmware/raw/master/boot/fixup.dat
147 wget -q -O "${BOOTDIR}/fixup_cd.dat" https://github.com/raspberrypi/firmware/raw/master/boot/fixup_cd.dat
148 wget -q -O "${BOOTDIR}/fixup_x.dat" https://github.com/raspberrypi/firmware/raw/master/boot/fixup_x.dat
149 wget -q -O "${BOOTDIR}/start.elf" https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
150 wget -q -O "${BOOTDIR}/start_cd.elf" https://github.com/raspberrypi/firmware/raw/master/boot/start_cd.elf
151 wget -q -O "${BOOTDIR}/start_x.elf" https://github.com/raspberrypi/firmware/raw/master/boot/start_x.elf
152 fi
142 153
143 154 else # BUILD_KERNEL=false
144 155 # Kernel installation
@@ -70,3 +70,8 if [ "$ENABLE_HARDNET" = true ] ; then
70 70 # Setup resolver warnings about spoofed addresses
71 71 sed -i "s/^# spoof warn/spoof warn/" "${ETCDIR}/host.conf"
72 72 fi
73
74 # Enable time sync
75 if [ "NET_NTP_1" != "" ] ; then
76 chroot_exec systemctl enable systemd-timesyncd.service
77 fi
@@ -10,8 +10,9 ENCRYPTED_PASSWORD=`mkpasswd -m sha-512 "${PASSWORD}"`
10 10
11 11 # Setup default user
12 12 if [ "$ENABLE_USER" = true ] ; then
13 chroot_exec adduser --gecos pi --add_extra_groups --disabled-password pi
14 chroot_exec usermod -a -G sudo -p "${ENCRYPTED_PASSWORD}" pi
13 chroot_exec adduser --gecos $USER_NAME --add_extra_groups \
14 --disabled-password $USER_NAME
15 chroot_exec usermod -a -G sudo -p "${ENCRYPTED_PASSWORD}" $USER_NAME
15 16 fi
16 17
17 18 # Setup root password or not
@@ -57,6 +57,9 ETCDIR="${R}/etc"
57 57 BOOTDIR="${R}/boot/firmware"
58 58 KERNELDIR="${R}/usr/src/linux"
59 59
60 # Firmware directory: Blank if download from github
61 FIRMWAREDIR=${FIRMWAREDIR:=""}
62
60 63 # General settings
61 64 HOSTNAME=${HOSTNAME:=rpi2-${RELEASE}}
62 65 PASSWORD=${PASSWORD:=raspberry}
@@ -98,6 +101,7 ENABLE_XORG=${ENABLE_XORG:=false}
98 101 ENABLE_WM=${ENABLE_WM:=""}
99 102 ENABLE_RSYSLOG=${ENABLE_RSYSLOG:=true}
100 103 ENABLE_USER=${ENABLE_USER:=true}
104 USER_NAME=${USER_NAME:="pi"}
101 105 ENABLE_ROOT=${ENABLE_ROOT:=false}
102 106 ENABLE_ROOT_SSH=${ENABLE_ROOT_SSH:=false}
103 107
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant