Skip to content

Commit bace55a

Browse files
authored
Merge pull request #162 from jareware/raspbian-bullseye
Raspbian Bullseye
2 parents 799e1b3 + 1d13602 commit bace55a

6 files changed

+181
-61
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ Note: You can user `${SERIAL}` to get Pi's serial number into URL.
4444
### Automatic WiFi setup
4545

4646
1. After flashing remount your SD card.
47-
2. Create a wpa_supplicant.conf in your SD cards boot folder
47+
2. Create a `wpa_supplicant.conf` in your SD cards boot folder
4848
3. Copy the [sample wpa_supplicant.conf](#sample-wpasupplicantconf) file into the boot folder on the SD card.
4949
4. Replace `WiFi-SSID` and `WiFi-PASSWORD` with your WiFi configuration.
50-
5. *Optional*: Set the country code to your country code e.g. DE.
50+
5. Optional: Set the country code to your country code e.g. `DE`.
5151

5252
#### Sample wpa_supplicant.conf
5353
```
@@ -56,15 +56,15 @@ update_config=1
5656
country=US
5757
5858
network={
59-
ssid="WiFi-SSID"
60-
psk="WiFi-PASSWORD"
61-
key_mgmt=WPA-PSK
59+
ssid="WiFi-SSID"
60+
psk="WiFi-PASSWORD"
61+
key_mgmt=WPA-PSK
6262
}
6363
```
6464

6565
## Hardware
6666

67-
Works with [Raspberry Pi versions 1, 2 & 3](https://www.raspberrypi.org/products/). The 3 series is recommended, as it's the most powerful, and comes with built-in WiFi (though both [official](https://www.raspberrypi.org/products/raspberry-pi-usb-wifi-dongle/) and [off-the-shelf](https://elinux.org/RPi_USB_Wi-Fi_Adapters) USB WiFi dongles can work equally well).
67+
Works with [all Raspberry Pi versions](https://www.raspberrypi.org/products/). Versions 3 and 4 are recommended, though, since the smaller ones can be a bit underpowered for rendering complex dashboards. The 3 and 4 also come with built-in WiFi, which is convenient (though both [official](https://www.raspberrypi.org/products/raspberry-pi-usb-wifi-dongle/) and [off-the-shelf](https://elinux.org/RPi_USB_Wi-Fi_Adapters) USB WiFi dongles can work equally well).
6868

6969
Make sure you have a [compatible 4+ GB SD card](http://elinux.org/RPi_SD_cards). In general, any Class 10 card will work, as they're fast enough and of high enough quality.
7070

docs/first-boot.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ Finally, further tweaks can be made by changing the [Chromium command line switc
5050

5151
Adding these options will allow you to mix secure (i.e. HTTPS) origins with insecure ones (you need to specifically white-list them). Sometimes you need stuff like this to pull together all the bits and pieces of your dashboard from different origins. We're not saying you should. But you can.
5252

53+
## Controlling the kiosk remotely
54+
55+
Sometimes you need to do basic remote adjustments, like changing the URL that's displayed.
56+
57+
- If you need a lot of flexibility, [you can install VNC](https://github.com/futurice/chilipie-kiosk/issues/38#issuecomment-442031274) to get a full remote desktop
58+
- If you just need to set the URL, you can SSH over (not enabled by default; see above), and e.g. [run something like](https://github.com/futurice/chilipie-kiosk/issues/71#issuecomment-522035239): `export DISPLAY=:0; xdotool key F11 sleep 1 key ctrl+l sleep 1 type 'https://google.com'; xdotool sleep 1 key KP_Enter; xdotool key F11`. Very crude. Very effective.
59+
5360
## Username and password
5461

5562
If you need to login to a shell, the default username and password are `pi` and `raspberry`, as is tradition for Raspberry Pi. The `pi` user also has `sudo` access.
@@ -69,13 +76,15 @@ Press `Ctrl + Alt + F3` to get to a virtual terminal, and use your favorite edit
6976

7077
Save the file, and `sudo reboot`.
7178

79+
Note that on the Pi 4, you'll need to disable the `dtoverlay=vc4-fkms-v3d` line in `/boot/config.txt` for this to work. But then that [may cause other issues](https://www.reddit.com/r/raspberry_pi/comments/dw1376/dtoverlayvc4fkmsv3d_causes_display_to_shift_right/). This is hopefully fixed in a future Raspbian release.
80+
7281
Exotic screens may require a bit more fiddling. See issues [#41](https://github.com/futurice/chilipie-kiosk/issues/41) and [#58](https://github.com/futurice/chilipie-kiosk/issues/58) for ideas.
7382

7483
## Replacing the boot graphics
7584

7685
The image that's displayed while the kiosk is starting can be changed by just replacing `~/background.png`.
7786

78-
To change the default chilipie-kiosk boot graphics to a nice doge, for example, try `wget -O background.png bit.ly/2w1P4Il`.
87+
To change the default chilipie-kiosk boot graphics to a [nice Windoge one](https://mcdn.wallpapersafari.com/medium/93/77/8xKLeg.png), for example, try `wget -O background.png https://bit.ly/2Q4GF1t`.
7988

8089
## Increasing boot show delay
8190

docs/image-setup.sh

+135-49
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,77 @@
11
#!/bin/bash
22

3-
MOUNTED_BOOT_VOLUME="boot" # i.e. under which name is the SD card mounted under /Volumes on macOS
4-
BOOT_CMDLINE_TXT="/Volumes/$MOUNTED_BOOT_VOLUME/cmdline.txt"
5-
BOOT_CONFIG_TXT="/Volumes/$MOUNTED_BOOT_VOLUME/config.txt"
3+
# exit on error; treat unset variables as errors; exit on errors in piped commands
4+
set -euo pipefail
5+
6+
# Ensure we operate from consistent pwd for the rest of the script
7+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # Figure out the ABSOLUTE PATH of this script without relying on the realpath command, which may not always be available
8+
cd "$DIR"
9+
10+
if [ "$OSTYPE" == "linux-gnu" ]; then
11+
MOUNTED_BOOT_VOLUME="/media/$(whoami)/boot" # i.e. under which name is the SD card mounted under /media in Linux (Ubuntu)
12+
elif [[ "$OSTYPE" == darwin* ]]; then
13+
MOUNTED_BOOT_VOLUME="/Volumes/boot" # i.e. under which name is the SD card mounted under /Volumes on macOS
14+
else
15+
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
16+
fi
17+
18+
BOOT_CMDLINE_TXT="$MOUNTED_BOOT_VOLUME/cmdline.txt"
19+
BOOT_CONFIG_TXT="$MOUNTED_BOOT_VOLUME/config.txt"
620
SD_SIZE_REAL=2500 # this is in MB
721
SD_SIZE_SAFE=2800 # this is in MB
822
SD_SIZE_ZERO=3200 # this is in MB
9-
PUBKEY="$(cat ~/.ssh/id_rsa.pub)"
23+
SSH_PUBKEY="$(cat ~/.ssh/id_rsa.pub)"
24+
SSH_CONNECT_TIMEOUT=30
25+
LOCALE="en_US.UTF-8 UTF-8" # or e.g. "fi_FI.UTF-8 UTF-8" for Finland
26+
LANGUAGE="en_US.UTF-8" # should match above
1027
KEYBOARD="us" # or e.g. "fi" for Finnish
1128
TIMEZONE="Etc/UTC" # or e.g. "Europe/Helsinki"; see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
1229

30+
function echo-bold {
31+
echo -e "$(tput -Txterm-256color bold)$1$(tput -Txterm-256color sgr 0)" # https://unix.stackexchange.com/a/269085; the -T arg accounts for $ENV not being set
32+
}
1333
function working {
14-
echo -e "\n $1"
34+
echo-bold "\n[WORKING] $1"
1535
}
1636
function question {
17-
echo -e "\n🛑 $1"
37+
echo-bold "\n[QUESTION] $1"
1838
}
1939
function ssh {
20-
/usr/bin/ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 "pi@$IP" "$1"
40+
/usr/bin/ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout="$SSH_CONNECT_TIMEOUT" "pi@$IP" "$1"
2141
}
2242
function scp {
2343
/usr/bin/scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$@" "pi@$IP:/home/pi"
2444
}
45+
function figureOutSdCard {
46+
if [ "$OSTYPE" == "linux-gnu" ]; then
47+
lsblk --fs
48+
DISK="/dev/$(lsblk -l | grep "$MOUNTED_BOOT_VOLUME" | sed 's/[0-9].*//')"
49+
DISK_SAMPLE="/dev/sda"
50+
elif [[ "$OSTYPE" == darwin* ]]; then
51+
diskutil list
52+
DISK="$(diskutil list | grep /dev/ | grep external | grep physical | cut -d ' ' -f 1 | head -n 1)"
53+
DISK_SAMPLE="/dev/disk2"
54+
else
55+
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
56+
fi
57+
}
58+
function unmountSdCard {
59+
if [ "$OSTYPE" == "linux-gnu" ]; then
60+
for part in $(lsblk --list "$DISK" | grep part | sed 's/ .*//'); do
61+
udisksctl unmount -b "/dev/$part"
62+
done
63+
elif [[ "$OSTYPE" == darwin* ]]; then
64+
diskutil unmountDisk "$DISK"
65+
else
66+
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
67+
fi
68+
}
2569

26-
question "Enter version (e.g. \"1.2.3\") being built:"
70+
question "Enter version (e.g. \"1.2.3\") being built"
71+
echo "Omit the \"v\" prefix, it'll be added where needed"
72+
echo "For alpha/beta builds, use a \"-betaN\" suffic"
73+
echo "For RC builds, DO NOT use any suffix, as then the same image can't be promoted to stable without rebuilding"
74+
echo "Enter version:"
2775
read TAG
2876

2977
working "Updating version file"
@@ -40,28 +88,38 @@ cp ../docs/first-boot.md md-input
4088
./node_modules/.bin/html-inline -i md-output/first-boot.html > ../home/first-boot.html
4189
rm -rf md-input md-output
4290

43-
question "Mount the SD card (press enter when ready)"
91+
question "Physically mount the SD card to this machine "
92+
echo "(press enter when ready)"
4493
read
4594

4695
working "Figuring out SD card device"
47-
diskutil list
48-
DISK="$(diskutil list | grep /dev/ | grep external | grep physical | cut -d ' ' -f 1 | head -n 1)"
96+
figureOutSdCard
4997

50-
question "Based on the above, SD card determined to be \"$DISK\" (should be e.g. \"/dev/disk2\"), press enter to continue"
98+
question "Based on the above, SD card determined to be \"$DISK\""
99+
echo "Should be e.g. \"$DISK_SAMPLE\""
100+
echo "(press enter to confirm)"
51101
read
52102

53103
working "Safely unmounting the card"
54-
diskutil unmountDisk "$DISK"
104+
unmountSdCard
55105

56-
working "Writing the card full of zeros (for security and compressibility reasons)"
106+
working "Writing the card full of zeros"
107+
# ...for security and compressibility reasons
57108
echo "This may take a long time"
58109
echo "You may be prompted for your password by sudo"
59-
sudo dd bs=1m count="$SD_SIZE_ZERO" if=/dev/zero of="$DISK"
110+
if [ "$OSTYPE" == "linux-gnu" ]; then
111+
sudo dd bs=1M count="$SD_SIZE_ZERO" if=/dev/zero of="$DISK" status=progress
112+
elif [[ "$OSTYPE" == darwin* ]]; then
113+
sudo dd bs=1m count="$SD_SIZE_ZERO" if=/dev/zero of="$DISK"
114+
else
115+
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
116+
fi
60117

61-
question "Prepare baseline Raspbian:"
62-
echo "* Flash Raspbian Lite with Etcher"
118+
question "Prepare baseline Raspberry Pi OS Lite:"
119+
echo "* Flash the OS with Raspberry Pi Imager"
63120
echo "* Eject the SD card"
64121
echo "* Mount the card back"
122+
echo "* Wait for your OS to mount it"
65123
echo "(press enter when ready)"
66124
read
67125

@@ -76,10 +134,10 @@ mv temp "$BOOT_CMDLINE_TXT"
76134

77135
working "Enabling SSH for first boot"
78136
# https://www.raspberrypi.org/documentation/remote-access/ssh/
79-
touch "/Volumes/$MOUNTED_BOOT_VOLUME/ssh"
137+
touch "$MOUNTED_BOOT_VOLUME/ssh"
80138

81139
working "Safely unmounting the card"
82-
diskutil unmountDisk "$DISK"
140+
unmountSdCard
83141

84142
question "Do initial Pi setup:"
85143
echo "* Eject the card"
@@ -91,63 +149,79 @@ read IP
91149

92150
working "Installing temporary SSH pubkey"
93151
echo -e "Password hint: \"raspberry\""
94-
ssh "mkdir .ssh && echo '$PUBKEY' > .ssh/authorized_keys"
152+
ssh "mkdir .ssh && echo '$SSH_PUBKEY' > .ssh/authorized_keys"
95153

96154
working "Figuring out partition start"
97155
ssh "echo -e 'p\nq\n' | sudo fdisk /dev/mmcblk0 | grep /dev/mmcblk0p2 | tr -s ' ' | cut -d ' ' -f 2" > temp
98156
START="$(cat temp)"
99157
rm temp
100158

101-
question "Partition start determined to be \"$START\" (should be e.g. \"98304\"), press enter to continue"
159+
question "Partition start determined to be \"$START\""
160+
echo "Should be e.g. \"98304\""
161+
echo "(press enter to confirm)"
102162
read
103163

104-
working "Resizing the root partition on the Pi"
164+
working "Resizing the root partition"
105165
ssh "echo -e 'd\n2\nn\np\n2\n$START\n+${SD_SIZE_REAL}M\ny\nw\n' | sudo fdisk /dev/mmcblk0"
106166

167+
working "Setting locale"
168+
# We want to do this as early as possible, so perl et al won't complain about misconfigured locales for the rest of the image prep
169+
ssh "echo $LOCALE | sudo tee /etc/locale.gen"
170+
ssh "sudo locale-gen"
171+
ssh "echo -e \"LANGUAGE=$LANGUAGE\nLC_ALL=$LANGUAGE\" | sudo tee /etc/environment"
172+
107173
working "Setting hostname"
108174
# We want to do this right before reboot, so we don't get a lot of unnecessary complaints about "sudo: unable to resolve host chilipie-kiosk" (https://askubuntu.com/a/59517)
109175
ssh "sudo hostnamectl set-hostname chilipie-kiosk"
110-
ssh "sudo sed -i 's/raspberrypi/chilipie-kiosk/g' /etc/hosts"
176+
ssh "sudo perl -i -p0e 's/raspberrypi/chilipie-kiosk/g' /etc/hosts" # "perl" is more cross-platform than "sed -i"
177+
178+
# From now on, some ssh commands will exit non-0, which should be fine
179+
set +e
111180

112181
working "Rebooting the Pi"
113182
ssh "sudo reboot"
114183

115184
echo "Waiting for host to come back up..."
116-
until ssh "echo OK"
185+
until SSH_CONNECT_TIMEOUT=5 ssh "echo OK"
117186
do
118187
sleep 1
119188
done
120189

121190
working "Finishing the root partition resize"
122191
ssh "df -h . && sudo resize2fs /dev/mmcblk0p2 && df -h ."
123192

193+
# From raspi-config: https://github.com/RPi-Distro/raspi-config/blob/d98686647ced7c0c0490dc123432834735d1c13d/raspi-config#L1313-L1321
194+
# See also: https://github.com/futurice/chilipie-kiosk/issues/61#issuecomment-524622522
124195
working "Enabling auto-login to CLI"
125-
# From: https://github.com/RPi-Distro/raspi-config/blob/985548d7ca00cab11eccbb734b63750761c1f08a/raspi-config#L955
126-
SUDO_USER=pi
127196
ssh "sudo systemctl set-default multi-user.target"
128-
ssh "sudo sed /etc/systemd/system/autologin@.service -i -e \"s#^ExecStart=-/sbin/agetty --autologin [^[:space:]]*#ExecStart=-/sbin/agetty --autologin $SUDO_USER#\""
129-
# Set auto-login for TTY's 1-3
130-
ssh "sudo ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty1.service"
131-
ssh "sudo ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty2.service"
132-
ssh "sudo ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty3.service"
197+
ssh "sudo ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service"
198+
ssh "sudo ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty2.service"
199+
ssh "sudo ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty3.service"
200+
ssh "sudo mkdir -p /etc/systemd/system/getty@tty1.service.d"
201+
ssh "sudo mkdir -p /etc/systemd/system/getty@tty2.service.d"
202+
ssh "sudo mkdir -p /etc/systemd/system/getty@tty3.service.d"
203+
ssh "echo -e '[Service]\nExecStart=\nExecStart=-/sbin/agetty --autologin pi --noclear %I \$TERM\n' | sudo tee /etc/systemd/system/getty@tty1.service.d/autologin.conf"
204+
ssh "echo -e '[Service]\nExecStart=\nExecStart=-/sbin/agetty --autologin pi --noclear %I \$TERM\n' | sudo tee /etc/systemd/system/getty@tty2.service.d/autologin.conf"
205+
ssh "echo -e '[Service]\nExecStart=\nExecStart=-/sbin/agetty --autologin pi --noclear %I \$TERM\n' | sudo tee /etc/systemd/system/getty@tty3.service.d/autologin.conf"
133206

134207
working "Setting timezone"
135208
ssh "(echo '$TIMEZONE' | sudo tee /etc/timezone) && sudo dpkg-reconfigure --frontend noninteractive tzdata"
136209

137210
working "Setting keyboard layout"
138211
ssh "(echo -e 'XKBMODEL="pc105"\nXKBLAYOUT="$KEYBOARD"\nXKBVARIANT=""\nXKBOPTIONS=""\nBACKSPACE="guess"\n' | sudo tee /etc/default/keyboard) && sudo dpkg-reconfigure --frontend noninteractive keyboard-configuration"
139212

140-
working "Shortening message-of-the-day for logins"
141-
ssh "sudo rm /etc/profile.d/sshpwd.sh"
142-
ssh "echo | sudo tee /etc/motd"
213+
working "Silencing console logins" # this is to avoid a brief flash of the console login before X comes up
214+
ssh "sudo rm /etc/profile.d/sshpwd.sh /etc/profile.d/wifi-check.sh" # remove warnings about default password and WiFi country (https://raspberrypi.stackexchange.com/a/105234)
215+
ssh "touch .hushlogin" # https://scribles.net/silent-boot-on-raspbian-stretch-in-console-mode/
216+
ssh "sudo perl -i -p0e 's#--autologin pi#--skip-login --noissue --login-options \"-f pi\"#g' /etc/systemd/system/getty@tty1.service.d/autologin.conf" # "perl" is more cross-platform than "sed -i"
143217

144218
working "Installing packages"
145-
ssh "sudo apt-get update && sudo apt-get install -y vim matchbox-window-manager unclutter mailutils nitrogen jq chromium-browser xserver-xorg xinit rpd-plym-splash xdotool cec-utils"
219+
ssh "sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y vim matchbox-window-manager unclutter mailutils nitrogen jq chromium-browser xserver-xorg xinit rpd-plym-splash xdotool rng-tools xinput-calibrator cec-utils"
146220
# We install mailutils just so that you can check "mail" for cronjob output
147221

148222
working "Setting home directory default content"
149223
ssh "rm -rfv /home/pi/*"
150-
scp $(find ../home -type file)
224+
scp $(find ../home -type f)
151225

152226
working "Setting splash screen background"
153227
ssh "sudo rm /usr/share/plymouth/themes/pix/splash.png && sudo ln -s /home/pi/background.png /usr/share/plymouth/themes/pix/splash.png"
@@ -161,6 +235,10 @@ ssh "sudo reboot"
161235
question "Once the Pi has rebooted into Chromium:"
162236
echo "* Tell Chromium we don't want to sign in"
163237
echo "* Configure Chromium to start \"where you left off\""
238+
echo " * F11 to exit full screen"
239+
echo " * Alt + F, then S to go to Settings"
240+
echo " * Type \"continue\" to filter the options"
241+
echo " * Tab to select \"Continue where you left off\""
164242
echo "* Navigate to \"file:///home/pi/first-boot.html\""
165243
echo "(press enter when ready)"
166244
read
@@ -174,26 +252,28 @@ ssh "chromium-browser --version | cut -d ' ' -f 1-2" > temp
174252
VERSION_CHROMIUM="$(cat temp)"
175253
rm temp
176254

177-
working "Removing SSH host keys & enable regeneration"
178-
ssh "sudo rm -f -v /etc/ssh/ssh_host_*_key* && sudo systemctl enable regenerate_ssh_host_keys"
255+
working "Disabling SSH access & restoring safe defaults & shutting down"
256+
tempFile="$(ssh mktemp)" # need to do this via a temp file on the host, otherwise disabling SSH while using SSH ends up being problematic
257+
ssh "chmod a+x $tempFile"
258+
ssh "echo 'rm -f /etc/ssh/ssh_host_*_key*; systemctl enable regenerate_ssh_host_keys; rm .ssh/authorized_keys; systemctl disable ssh; poweroff' > $tempFile"
259+
ssh "sudo nohup $tempFile"
179260

180-
working "Removing temporary SSH pubkey, disabling SSH & shutting down"
181-
ssh "(echo > .ssh/authorized_keys) && sudo systemctl disable ssh && sudo shutdown -h now"
182-
183-
question "Eject the SD card from the Pi, and mount it back to this computer (press enter when ready)"
261+
question "Eject the SD card from the Pi, and mount it back to this computer"
262+
echo "(press enter when ready)"
184263
read
185264

186-
working "Figuring out SD card device"
187265
# We do this again now just to be safe
188-
diskutil list
189-
DISK="$(diskutil list | grep /dev/ | grep external | grep physical | cut -d ' ' -f 1 | head -n 1)"
266+
working "Figuring out SD card device"
267+
figureOutSdCard
190268

191-
question "Based on the above, SD card determined to be \"$DISK\" (should be e.g. \"/dev/disk2\"), press enter to continue"
269+
question "Based on the above, SD card determined to be \"$DISK\""
270+
echo "Should be e.g. \"$DISK_SAMPLE\""
271+
echo "(press enter to confirm)"
192272
read
193273

194274
working "Making boot quieter (part 1)" # https://scribles.net/customizing-boot-up-screen-on-raspberry-pi/
195275
echo "Updating: $BOOT_CONFIG_TXT"
196-
sed -i "" "s/#disable_overscan=1/disable_overscan=1/g" "$BOOT_CONFIG_TXT"
276+
perl -i -p0e "s/#disable_overscan=1/disable_overscan=1/g" "$BOOT_CONFIG_TXT" # "perl" is more cross-platform than "sed -i"
197277
echo -e "\ndisable_splash=1" >> "$BOOT_CONFIG_TXT"
198278

199279
working "Making boot quieter (part 2)" # https://scribles.net/customizing-boot-up-screen-on-raspberry-pi/
@@ -206,13 +286,19 @@ cat "$BOOT_CMDLINE_TXT" \
206286
mv temp "$BOOT_CMDLINE_TXT"
207287

208288
working "Safely unmounting the card"
209-
diskutil unmountDisk "$DISK"
289+
unmountSdCard
210290

211291
working "Dumping the image from the card"
212292
cd ..
213293
echo "This may take a long time"
214294
echo "You may be prompted for your password by sudo"
215-
sudo dd bs=1m count="$SD_SIZE_SAFE" if="$DISK" of="chilipie-kiosk-$TAG.img"
295+
if [ "$OSTYPE" == "linux-gnu" ]; then
296+
sudo dd bs=1M count="$SD_SIZE_ZERO" if="$DISK" of="chilipie-kiosk-$TAG.img" status=progress
297+
elif [[ "$OSTYPE" == darwin* ]]; then
298+
sudo dd bs=1m count="$SD_SIZE_ZERO" if="$DISK" of="chilipie-kiosk-$TAG.img"
299+
else
300+
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
301+
fi
216302

217303
working "Compressing image"
218304
COPYFILE_DISABLE=1 tar -zcvf chilipie-kiosk-$TAG.img.tar.gz chilipie-kiosk-$TAG.img

home/.chilipie-kiosk-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
2.1.0
1+
3.0.0
22

33
https://github.com/futurice/chilipie-kiosk

0 commit comments

Comments
 (0)