Skip to content

Commit f1d93be

Browse files
authored
Merge pull request #74 from basak-qcom/fix-password-change-required
Fix password change required
2 parents f8bd3a0 + 76f2c74 commit f1d93be

File tree

13 files changed

+205
-27
lines changed

13 files changed

+205
-27
lines changed

.github/workflows/build-daily.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ on:
99

1010
# implicitely set all other permissions to none
1111
permissions:
12-
checks: write # test.yml
13-
contents: read # debos.yml test.yml
14-
packages: read # test.yml
15-
pull-requests: write # test.yml
12+
checks: write # lava-test.yml
13+
contents: read # debos.yml lava-test.yml
14+
packages: read # lava-test.yml
15+
pull-requests: write # lava-test.yml
1616

1717
jobs:
1818
build-daily:
@@ -23,7 +23,7 @@ jobs:
2323
test-daily:
2424
# don't run cron from forks of the main repository or from other branches
2525
if: github.repository == 'qualcomm-linux/qcom-deb-images' && github.ref == 'refs/heads/main'
26-
uses: ./.github/workflows/test.yml
26+
uses: ./.github/workflows/lava-test.yml
2727
needs: build-daily
2828
secrets: inherit
2929
with:

.github/workflows/build-on-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55

66
# implicitely set all other permissions to none
77
permissions:
8-
checks: write # test.yml
9-
contents: read # debos.yml lava-schema-check.yml test.yml
10-
packages: read # test.yml
11-
pull-requests: write # test.yml
8+
checks: write # lava-test.yml
9+
contents: read # debos.yml lava-schema-check.yml lava-test.yml
10+
packages: read # lava-test.yml
11+
pull-requests: write # lava-test.yml
1212

1313
jobs:
1414
event-file:

.github/workflows/build-on-push.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ on:
66

77
# implicitely set all other permissions to none
88
permissions:
9-
checks: write # test.yml
10-
contents: read # debos.yml lava-schema-check.yml test.yml
11-
packages: read # test.yml
12-
pull-requests: write # test.yml
9+
checks: write # lava-test.yml
10+
contents: read # debos.yml lava-schema-check.yml lava-test.yml
11+
packages: read # lava-test.yml
12+
pull-requests: write # lava-test.yml
1313

1414
jobs:
1515
build-daily:
1616
uses: ./.github/workflows/debos.yml
1717
schema-check:
1818
uses: ./.github/workflows/lava-schema-check.yml
1919
test:
20-
uses: ./.github/workflows/test.yml
20+
uses: ./.github/workflows/lava-test.yml
2121
needs: [build-daily, schema-check]
2222
secrets: inherit
2323
with:

.github/workflows/debos.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
run: cp -av "/fileserver-downloads/qcom-deb-images/u-boot-rb1-latest/rb1-boot.img" .
6262

6363
# mtools is needed for the flash recipe
64-
- name: Install debos and dependencies of the recipes
65-
run: apt -y install debos mtools
64+
- name: Install debos and dependencies of the recipes and local tests
65+
run: apt -y install debos make mtools python3-pexpect python3-pytest qemu-efi-aarch64 qemu-system-arm
6666

6767
- name: Setup local APT repo
6868
run: |
@@ -210,3 +210,12 @@ jobs:
210210
with:
211211
name: build_url
212212
path: build_url
213+
- name: Invoke test runner
214+
run: |
215+
# This is currently a clone of Makefile's "test" target to avoid any
216+
# unexpected interactions with triggering depending build targets.
217+
# The plan is to move this entire workflow to use make targets
218+
# instead but all at once. See #74 and #159.
219+
220+
# rootfs/ is a build artifact, so should not be scanned for tests
221+
py.test-3 --ignore=rootfs
File renamed without changes.

.github/workflows/test-pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ on:
1010

1111
# implicitely set all other permissions to none
1212
permissions:
13-
checks: write # test.yml EnricoMi/publish-unit-test-result-action
14-
contents: read # test.yml actions/checkout
15-
packages: read # test.yml actions/download-artifact
16-
# test.yml EnricoMi/publish-unit-test-result-action
13+
checks: write # lava-test.yml EnricoMi/publish-unit-test-result-action
14+
contents: read # lava-test.yml actions/checkout
15+
packages: read # lava-test.yml actions/download-artifact
16+
# lava-test.yml EnricoMi/publish-unit-test-result-action
1717
# thollander/actions-comment-pull-request
1818
pull-requests: write
1919

@@ -59,7 +59,7 @@ jobs:
5959
echo "url=${BUILD_URL}" >> $GITHUB_OUTPUT
6060
6161
test:
62-
uses: ./.github/workflows/test.yml
62+
uses: ./.github/workflows/lava-test.yml
6363
secrets: inherit
6464
needs: retrieve-build-url
6565
with:

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ all: disk-ufs.img.gz disk-sdcard.img.gz
1717
rootfs.tar.gz: debos-recipes/qualcomm-linux-debian-rootfs.yaml
1818
$(DEBOS) $<
1919

20-
disk-ufs.img.gz: debos-recipes/qualcomm-linux-debian-image.yaml rootfs.tar.gz
20+
disk-ufs.img disk-ufs.img.gz: debos-recipes/qualcomm-linux-debian-image.yaml rootfs.tar.gz
2121
$(DEBOS) $<
2222

2323
disk-sdcard.img.gz: debos-recipes/qualcomm-linux-debian-image.yaml rootfs.tar.gz
2424
$(DEBOS) -t imagetype:sdcard $<
2525

26-
.PHONY: all
26+
test: disk-ufs.img
27+
# rootfs/ is a build artifact, so should not be scanned for tests
28+
py.test-3 --ignore=rootfs
29+
30+
.PHONY: all test

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,76 @@ NB: It's also possible to run qdl from the host while the baord is not connected
182182

183183
Want to join in the development? Changes welcome! See [CONTRIBUTING.md file](CONTRIBUTING.md) for step by step instructions.
184184

185+
### Test an image locally with qemu
186+
187+
You can boot an image locally with qemu as follows:
188+
189+
1. Install dependencies. `qemu-system-arm` is required together with
190+
an aarch64 build of UEFI. On Debian and Ubuntu, this is provided by the
191+
`qemu-system-arm` package which recommends `qemu-efi-aarch64`:
192+
```bash
193+
sudo apt install qemu-system-arm qemu-efi-aarch64
194+
```
195+
196+
1. As above under "Usage", build the disk image from the root filesystem
197+
tarball if you haven't done this already:
198+
```bash
199+
debos debos-recipes/qualcomm-linux-debian-image.yaml
200+
```
201+
202+
1. Run qemu as follows:
203+
```bash
204+
# SCSI is required to present a device with a matching 4096 sector size
205+
# inside the VM
206+
qemu-system-aarch64 -cpu cortex-a57 -m 2048 -M virt -nographic \
207+
-device virtio-scsi-pci,id=scsi1 \
208+
-device scsi-hd,bus=scsi1.0,drive=disk1,physical_block_size=4096,logical_block_size=4096 \
209+
-drive if=none,file=disk-ufs.img,format=raw,id=disk1 \
210+
-bios /usr/share/AAVMF/AAVMF_CODE.fd
211+
```
212+
213+
#### Copy on write
214+
215+
Instead of modifying `file-ufs.img`, you can arrange copy-on-write, for example
216+
to reproduce the same first boot multiple times:
217+
218+
1. Prepare a qcow file to contain the writes, backed by `disk-ufs.img`:
219+
```bash
220+
qemu-img create -b disk-ufs.img -f qcow -F raw disk1.qcow
221+
```
222+
223+
1. Run qemu as follows:
224+
```bash
225+
qemu-system-aarch64 -cpu cortex-a57 -m 2048 -M virt -nographic \
226+
-device virtio-scsi-pci,id=scsi1 \
227+
-device scsi-hd,bus=scsi1.0,drive=disk1,physical_block_size=4096,logical_block_size=4096 \
228+
-drive if=none,file=disk1.img,format=qcow,id=disk1 \
229+
-bios /usr/share/AAVMF/AAVMF_CODE.fd
230+
```
231+
232+
#### Direct kernel boot
233+
234+
For debugging purposes, it is sometimes useful to boot the kernel directly, for
235+
example to confirm that an issue in the image lies in the bootloader
236+
installation. You can do this as follows:
237+
238+
1. Extract the rootfs:
239+
```bash
240+
mkdir rootfs
241+
tar xzC rootfs -f rootfs.tar.gz
242+
```
243+
244+
2. Run qemu against the kernel and initrd present inside the rootfs directly:
245+
```bash
246+
qemu-system-aarch64 -cpu cortex-a57 -m 2048 -M virt -nographic \
247+
-device virtio-scsi-pci,id=scsi1 \
248+
-device scsi-hd,bus=scsi1.0,drive=disk1,physical_block_size=4096,logical_block_size=4096 \
249+
-drive if=none,file=disk-ufs.img,format=raw,id=disk1 \
250+
-kernel rootfs/boot/vmlinuz-*
251+
-initrd rootfs/boot/initrd.img-*
252+
-append root=/dev/sda2
253+
```
254+
185255
## Reporting Issues
186256
187257
We'd love to hear if you run into issues or have ideas for improvements. [Report an Issue on GitHub](../../issues) to discuss, and try to include as much information as possible on your specific environment.

ci/lava/qcs6490-rb3gen2-core-kit/boot.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ actions:
3737
password_prompt: 'Password'
3838
password: debian
3939
login_commands:
40+
- "debian"
41+
- "new password"
42+
- "new password"
4043
- sudo su
4144
method: minimal
4245
prompts:
4346
- root@debian
4447
- debian@debian
48+
- "Current password"
49+
- "New password"
50+
- "Retype new password"
4551
timeout:
4652
minutes: 3
4753
- test:

ci/lava/qrb2210-rb1/boot.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ actions:
3838
password_prompt: 'Password'
3939
password: debian
4040
login_commands:
41+
- "debian"
42+
- "new password"
43+
- "new password"
4144
- sudo su
4245
method: minimal
4346
prompts:
4447
- root@debian
4548
- debian@debian
49+
- "Current password"
50+
- "New password"
51+
- "Retype new password"
4652
timeout:
4753
minutes: 3
4854
- test:

0 commit comments

Comments
 (0)