Skip to content

Commit aafb0bb

Browse files
authored
Merge pull request #9 from lool/misc-cleanups
misc cleanups
2 parents c6470e9 + 366cf33 commit aafb0bb

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ A few options are provided in the debos recipes; for the root filesystem recipe:
4545

4646
For the image recipe:
4747
- dtb: override the firmware provided device tree with one from the linux kernel, e.g. `qcom/qcs6490-rb3gen2.dtb`; default: don't override
48-
- imagetype: either `ufs` (the default) or (`sdcard`); UFS uses 4096 bytes sectors and SD card 512 bytes
49-
- image: set the output disk image filename; default is to suffix it with the imagetype: `disk-ufs.img`
48+
- imagetype: either `ufs` (the default) or (`sdcard`); UFS images are named disk-ufs.img and use 4096 bytes sectors and SD card images are named disk-sdcard.img and use 512 bytes sectors
5049
- imagesize: set the output disk image size; default: `4GiB`
5150

5251
These can be passed as follows:
@@ -72,7 +71,7 @@ The RB3 Gen2 board boots from UFS by default. To flash a disk image to the UFS s
7271
```xml
7372
<?xml version="1.0" ?>
7473
<data>
75-
<program SECTOR_SIZE_IN_BYTES="4096" file_sector_offset="0" filename="disk-4096.img" label="image" num_partition_sectors="0" partofsingleimage="false" physical_partition_number="0" start_sector="0"/>
74+
<program SECTOR_SIZE_IN_BYTES="4096" file_sector_offset="0" filename="disk-ufs.img" label="image" num_partition_sectors="0" partofsingleimage="false" physical_partition_number="0" start_sector="0"/>
7675
</data>
7776
```
7877
1. put the board in "emergency download" mode (EDL) by removing any cable from the USB type-C port, and pressing the `F_DL` button while turning the power on

debos-recipes/qualcomm-linux-debian-image.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{- $dtb := or .dtb "firmware" }}
22
{{- $imagesize := or .imagesize "4GiB" }}
33
{{- $imagetype := or .imagetype "ufs" }}
4-
{{- $image := or .image (printf "disk-%s.img" $imagetype) }}
4+
{{- $image := printf "disk-%s.img" $imagetype }}
55

66
architecture: arm64
77
sectorsize: {{if eq $imagetype "ufs"}} 4096 {{else}} 512 {{end}}
@@ -17,9 +17,9 @@ actions:
1717
description: Use OS device tree override (board specific)
1818
chroot: true
1919
command: |
20-
set -eu
21-
mkdir -p /etc/kernel
22-
echo {{ $dtb }} >/etc/kernel/devicetree
20+
set -eux
21+
mkdir -pv /etc/kernel
22+
echo "{{ $dtb }}" >/etc/kernel/devicetree
2323
{{- end }}
2424

2525
# parttype values are from:
@@ -72,7 +72,7 @@ actions:
7272
description: Create task to grow root filesystem on first boot
7373
chroot: true
7474
command: |
75-
set -eu
75+
set -eux
7676
# for growpart
7777
apt -y install cloud-guest-utils
7878
# extract the dev of the root filesystem from fstab; change UUID=id into
@@ -97,5 +97,5 @@ actions:
9797
9898
- action: run
9999
postprocess: true
100-
command: gzip -f "${ARTIFACTDIR}/{{ $image }}"
100+
command: gzip -v -f "${ARTIFACTDIR}/{{ $image }}"
101101

debos-recipes/qualcomm-linux-debian-rootfs.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ actions:
1818
description: Modernize APT sources
1919
chroot: true
2020
command: |
21-
apt modernize-sources -y
22-
rm /etc/apt/sources.list.bak
21+
set -eux
22+
apt -y modernize-sources
23+
rm -v /etc/apt/sources.list.bak
24+
2325
- action: apt
2426
description: Install foundational packages
2527
recommends: true
@@ -47,14 +49,16 @@ actions:
4749
description: Set hostname to "debian"
4850
chroot: true
4951
command: |
52+
set -eux
5053
echo debian >/etc/hostname
5154
# /etc/hosts is created by netbase
5255
sed -i "1s/^/127.0.1.1 debian\n/" /etc/hosts
56+
5357
- action: run
5458
description: Add a "debian" user, add it to sudoers and various groups
5559
chroot: true
5660
command: |
57-
set -eu
61+
set -eux
5862
# pre-emptively create a sudo group if sudo isn't installed
5963
getent group sudo >/dev/null 2>&1 || groupadd --system sudo
6064
# some of these groups are only needed for desktop scenarios
@@ -64,7 +68,8 @@ actions:
6468
chage --lastday 0 debian
6569
echo debian:debian | chpasswd
6670
# add to sudoers
67-
mkdir --mode 755 --parents /etc/sudoers.d
71+
mkdir -v --mode 755 --parents /etc/sudoers.d
72+
# subshell to override umask
6873
(
6974
umask 226
7075
echo "debian ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/90-debos
@@ -144,7 +149,7 @@ actions:
144149
description: Set default locale
145150
chroot: true
146151
command: |
147-
set -eu
152+
set -eux
148153
if which locale-gen >/dev/null 2>&1; then
149154
echo en_US.UTF-8 UTF-8 >>/etc/locale.gen
150155
locale-gen en_US.UTF-8 UTF-8
@@ -167,7 +172,7 @@ actions:
167172
description: Install Linux kernel from experimental
168173
chroot: true
169174
command: |
170-
set -eu
175+
set -eux
171176
# add experimental APT sources
172177
cat >/etc/apt/sources.list.d/debian-experimental.sources <<EOF
173178
Types: deb
@@ -178,7 +183,7 @@ actions:
178183
EOF
179184
# update and install kernel from experimental
180185
apt update
181-
apt install -y -t experimental linux-image-arm64
186+
apt -y install -t experimental linux-image-arm64
182187
# disable experimental from APT sources
183188
sed -i "1s/^/Enabled: no\n/" \
184189
/etc/apt/sources.list.d/debian-experimental.sources

0 commit comments

Comments
 (0)