-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-images.sh
executable file
·33 lines (24 loc) · 991 Bytes
/
setup-images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
############################################
# OSSPR2022 #
# #
# Sets up images to boot up QEMU. #
# You should have built the kernel. #
############################################
set -ev
TIZEN='tizen-unified_20201020.1_iot-headless-2parts-armv7l-btrfs-rootfs-rpi.tar.gz'
IMAGEDIR='tizen-image'
TMP="$(mktemp -d)"
if [ ! -f "$TIZEN" ]; then
curl -LO http://download.tizen.org/releases/milestone/tizen/unified/tizen-unified_20201020.1/images/standard/iot-headless-2parts-armv7l-btrfs-rootfs-rpi/tizen-unified_20201020.1_iot-headless-2parts-armv7l-btrfs-rootfs-rpi.tar.gz
fi
rm -rf "$IMAGEDIR"
mkdir -p "$IMAGEDIR"
tar xzvf "$TIZEN" -C "$IMAGEDIR"
sudo mount "$IMAGEDIR/ramdisk.img" "$TMP"
sudo sed -i 's/\/bin\/mount -o remount,ro .//' "$TMP/usr/sbin/init"
sync
sudo umount "$TMP"
sudo ./scripts/mkbootimg_rpi3.sh
cp modules.img boot.img "$IMAGEDIR"
sudo chmod 777 "$IMAGEDIR"/*