Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
FooDeas committed Aug 15, 2023
2 parents 5dfae25 + d2f5cca commit 37da05d
Show file tree
Hide file tree
Showing 10 changed files with 589 additions and 678 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: bash
sudo: false
install: gem install mdl
install: gem install chef-utils:16.6.14 mdl
script:
- bash -c 'shopt -s globstar; shellcheck **/*.sh'
- mdl --verbose --rules '~MD013, ~MD036' .
1 change: 1 addition & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ To set buildroot options, create a file named `buildroot.conf`, which contains t

- `compress_bz2=1` - create a bz2-compressed image
- `compress_xz=1` - create a xz-compressed image
- `use_sudo=1` - use passwordless-sudo for operations which require root privileges

By default both bzip2 and xz compressed versions of the image will be created and the uncompressed image will deleted, but either or both can be disabled. If both are disabled, the uncompressed image will be left in place.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2018 Andreas Eberlein <[email protected]>
Copyright (c) 2016-2020 Andreas Eberlein <[email protected]>
Copyright (c) 2013 Toni Spets <[email protected]>

Permission to use, copy, modify, and distribute this software for any
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ When an error occurs during install, the logfile is placed in the `raspberrypi-u

## Reinstalling or replacing an existing system

If you want to reinstall with the same settings you did your first install you can just move the original _config.txt_ back and reboot.
If you want to reinstall with the same settings you did your first install you can just copy the original _config.txt_ back and reboot.

Note: If the original installation was performed with `cleanup` set to `1`, then the files necessary for a reinstallation will not be available.

```
mv /boot/raspberrypi-ua-netinst/reinstall/config.txt /boot/config.txt
cp /boot/raspberrypi-ua-netinst/config.txt /boot/config.txt
reboot
```

Expand Down
544 changes: 158 additions & 386 deletions build.sh

Large diffs are not rendered by default.

45 changes: 29 additions & 16 deletions buildroot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
# shellcheck source=./buildroot.conf
# shellcheck disable=SC1091

set -e # exit if any command fails

Expand All @@ -10,10 +12,16 @@ compress_bz2=1
# Controls production of an xz-compressed image
compress_xz=1

# Use 'sudo' for commands which require root privileges
use_sudo=0

# If a configuration file exists, import its settings
if [ -e buildroot.conf ]; then
# shellcheck disable=SC1091
source buildroot.conf
if [ -r buildroot.conf ]; then
source <(tr -d "\015" < buildroot.conf)
fi

if [ "$use_sudo" = "1" ]; then
SUDO=sudo
fi

build_dir=build_dir
Expand All @@ -33,11 +41,12 @@ image=${build_dir}/${imagename}.img

# Prepare
rm -f "${image}"
rm -rf "${build_dir:-build_dir}/mnt/"

# Create image
dd if=/dev/zero of="$image" bs=1M count=128

fdisk "${image}" <<EOF
${SUDO} fdisk "${image}" <<EOF
n
p
1
Expand All @@ -57,20 +66,24 @@ else
fi

if [ "$losetup_lt_2_22" = "true" ]; then
kpartx -as "${image}"
mkfs.vfat /dev/mapper/loop0p1
mount /dev/mapper/loop0p1 /mnt
cp -r ${build_dir}/bootfs/* /mnt/
umount /mnt
kpartx -d "${image}" || true
${SUDO} kpartx -as "${image}"
${SUDO} mkfs.vfat /dev/mapper/loop0p1
mkdir ${build_dir}/mnt
${SUDO} mount /dev/mapper/loop0p1 ${build_dir}/mnt
${SUDO} cp -r ${build_dir}/bootfs/* ${build_dir}/mnt
${SUDO} umount ${build_dir}/mnt
${SUDO} kpartx -d "${image}" || true
rmdir ${build_dir}/mnt
else
losetup --find --partscan "${image}"
${SUDO} losetup --find --partscan "${image}"
LOOP_DEV="$(losetup --associated "${image}" | cut -f1 -d':')"
mkfs.vfat "${LOOP_DEV}p1"
mount "${LOOP_DEV}p1" /mnt
cp -r ${build_dir}/bootfs/* /mnt/
umount /mnt
losetup --detach "${LOOP_DEV}"
${SUDO} mkfs.vfat "${LOOP_DEV}p1"
mkdir ${build_dir}/mnt
${SUDO} mount "${LOOP_DEV}p1" ${build_dir}/mnt
${SUDO} cp -r ${build_dir}/bootfs/* ${build_dir}/mnt
${SUDO} umount ${build_dir}/mnt
${SUDO} losetup --detach "${LOOP_DEV}"
rmdir ${build_dir}/mnt
fi

# Create archives
Expand Down
32 changes: 25 additions & 7 deletions doc/INSTALL_CUSTOM.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,32 @@
| `preset` | `server` | `base`/ `minimal`/ `server` | The current packages that are installed by default are listed below. |
| `packages` | | | Install these additional packages (comma separated and quoted). (e.g. "pi-bluetooth,cifs-utils,curl") |
| `firmware_packages` | `0` | `0`/`1` | Set to "1" to install common firmware packages (Atheros, Broadcom, Libertas, Ralink and Realtek). |
| `mirror` | `http:// mirrordirector.raspbian.org/ raspbian/` | | |
| `mirror` | `http:// mirrordirector.raspbian.org/ raspbian/` or `http:// deb.debian.org/ debian/` | | default value depends on arch |
| `mirror_cache` | | | Set address and port for HTTP apt-cacher or apt-cacher-ng (e.g. "192.168.0.1:3142"). If set, the cacher will be used to cache packages during installation downloaded from the repository set in `mirror` as well as "http://archive.raspberrypi.org/debian". |
| `release` | `buster` | | Raspbian release name |
| `release` | `bullseye` | | Raspbian release name |
| `arch` | `armhf` | | Raspbian architecture: "armhf" = 32-bit (all Raspberry models), "arm64" = 64-bit (only for Model 3 and up, Zero 2) |

### Description: Presets

#### Default configuration (when `use_systemd_services` is unset or set to `0`):

| Preset | Packages |
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `base` | _\<essential\>,apt,kmod_ |
| `base` | _\<essential\>,apt,gnupg,kmod_ |
| `minimal` | _\<base\>,cpufrequtils,fake-hwclock,ifupdown,net-tools,ntp,openssh-server,dosfstools,raspberrypi-sys-mods_ |
| `server` | _\<minimal\>,systemd-sysv,vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,tzdata,less,man-db,logrotate,bash-completion,console-setup,apt-utils,libraspberrypi-bin,raspi-copies-and-fills_ |
| `server` | _\<minimal\>,systemd-sysv,vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,tzdata,less,man-db,logrotate,bash-completion,console-setup,apt-utils,libraspberrypi-bin,raspi-copies-and-fills (raspi-copies-and-fills is not available on arm64)_ |

Note that if the networking configuration is set to use DHCP, `isc-dhcp-client` will also be installed.

#### Advanced configuration (when `use_systemd_services` is set to `1`):

| Preset | Packages |
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `base` | _\<essential\>,apt,kmod_ |
| `minimal` | _\<base\>,cpufrequtils,iproute2,openssh-server,dosfstools,raspberrypi-sys-mods_ |
| `server` | _\<minimal\>,systemd-sysv,vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,tzdata,less,man-db,logrotate,bash-completion,console-setup,apt-utils,libraspberrypi-bin,raspi-copies-and-fills (raspi-copies-and-fills is not available on arm64)_ |

Note that if the networking configuration is set to use DHCP, no additional packages will be installed as `systemd-networkd` provides DHCP client support.

## Device / peripheral

Expand All @@ -41,7 +56,7 @@
| `sound_usb_first` | `0` | `0`/`1` | Set to "1" to define USB audio as default if onboard audio is also enabled. The options `sound_enable=1` and `sound_usb_enable=1` have to be set to take effect. |
| `camera_enable` | `0` | `0`/`1` | Set to "1" to enable the camera module. This enables all camera-related parameters in config.txt. |
| `camera_disable_led` | `0` | `0`/`1` | Disables the camera LED. The option `camera_enable=1` has to be set to take effect. |
| `rtc` | | `ds1307`/ `ds1339`/ `ds3231`/ `mcp7940x`/ `mcp7941x`/ `pcf2127`/ `pcf8523`/ `pcf8563` | Select an RTC if it is connected via I²C. |
| `rtc` | | `ds1307`/ `ds1339`/ `ds3231`/ `mcp7940x`/ `mcp7941x`/ `pcf2127`/ `pcf8523`/ `pcf8563`/ `abx80x` | Select an RTC if it is connected via I²C. |
| `dt_overlays` | | | Enables additional device tree overlays (comma separated and quoted). (e.g. 'dt_overlays="hifiberry-dac,lirc-rpi"') |

## SSH
Expand Down Expand Up @@ -125,9 +140,11 @@
| `disable_splash` | `0` | `0`/`1` | Disables the rainbow splash screen on boot. |
| `cleanup` | `0` | `0`/`1` | Remove installer files after success. To also remove log files, note the option below. |
| `cleanup_logfiles` | `0` | `0`/`1` | Removes installer log files after success. |
| `cmdline` | `"dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 elevator=deadline fsck.repair=yes"` | | |
| `cmdline` | `"console=serial0,115200 console=tty1 fsck.repair=yes"` | | |
| `final_action` | `reboot` | `reboot`/ `poweroff`/ `halt`/ `console` | Action at the end of install. |
| `installer_telnet` | `1` | `0`/`1` | Send installer console output via telnet. |
| `installer_telnet` | `listen` | `none`/`connect`/`listen` | Connect to, or listen for, a telnet connection to send installer console output. |
| `installer_telnet_host` | | | Host name or address to use when `installer_telnet` is set to `connect`. |
| `installer_telnet_port` | '9923' | | Port number to use when `installer_telnet` is set to `connect`. |
| `installer_retries` | `3` | | Number of retries if installation fails. |
| `installer_networktimeout` | `15` | | Timeout in seconds for network interface initialization. |
| `installer_pkg_updateretries` | `3` | | Number of retries if package update fails. |
Expand All @@ -142,3 +159,4 @@
| `disable_predictable_nin` | `1` | `0`/`1` | Disable Predictable Network Interface Names. Set to 0 if you want to use predictable network interface names, which means if you use the same SD card on a different RPi board, your network device might be named differently. This will result in the board having no network connectivity. |
| `drivers_to_load` | | | Loads additional kernel modules at installation (comma separated and quoted). |
| `online_config` | | | URL to extra config that will be executed after installer-config.txt |
| `use_systemd_services` | `0` | `0`/`1` | Use systemd for networking and DNS resolution. |
1 change: 0 additions & 1 deletion res/initramfs/etc/apt/sources.list

This file was deleted.

Loading

0 comments on commit 37da05d

Please sign in to comment.