|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +diff --git a/br-ext/board/qemu/post-build.sh b/br-ext/board/qemu/post-build.sh |
| 19 | +index 5b4f8b5..fe65f11 100755 |
| 20 | +--- a/br-ext/board/qemu/post-build.sh |
| 21 | ++++ b/br-ext/board/qemu/post-build.sh |
| 22 | +@@ -7,6 +7,7 @@ TARGETDIR="$1" |
| 23 | + VIRTFS_AUTOMOUNT="$2" |
| 24 | + VIRTFS_MOUNTPOINT="$3" |
| 25 | + PSS_AUTOMOUNT="$4" |
| 26 | ++ENABLE_SSH="$5" |
| 27 | + |
| 28 | + if [[ -z $TARGET_DIR ]]; then |
| 29 | + echo "TARGET_DIR missing" |
| 30 | +@@ -28,6 +29,11 @@ if [[ -z $PSS_AUTOMOUNT ]]; then |
| 31 | + exit 1 |
| 32 | + fi |
| 33 | + |
| 34 | ++if [[ -z $ENABLE_SSH ]]; then |
| 35 | ++ echo "ENABLE_SSH missing" |
| 36 | ++ exit 1 |
| 37 | ++fi |
| 38 | ++ |
| 39 | + |
| 40 | + if [[ $VIRTFS_AUTOMOUNT == "y" ]]; then |
| 41 | + grep host "$TARGETDIR"/etc/fstab > /dev/null || \ |
| 42 | +@@ -41,3 +47,10 @@ if [[ $PSS_AUTOMOUNT == "y" ]]; then |
| 43 | + echo "secure /var/lib/tee 9p trans=virtio,version=9p2000.L,msize=65536,rw 0 0" >> "$TARGET_DIR"/etc/fstab |
| 44 | + echo "[+] persistent secure storage mount added to fstab" |
| 45 | + fi |
| 46 | ++ |
| 47 | ++ |
| 48 | ++if [[ $ENABLE_SSH == "y" ]]; then |
| 49 | ++ sed -i -e 's/#PermitEmptyPasswords no/PermitEmptyPasswords yes/' "$TARGET_DIR"/etc/ssh/sshd_config |
| 50 | ++ sed -i -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' "$TARGET_DIR"/etc/ssh/sshd_config |
| 51 | ++ echo "[+] ssh server allow root with no password" |
| 52 | ++fi |
| 53 | +diff --git a/qemu_v8.mk b/qemu_v8.mk |
| 54 | +index 9c36c8a..8d553d3 100644 |
| 55 | +--- a/qemu_v8.mk |
| 56 | ++++ b/qemu_v8.mk |
| 57 | +@@ -7,6 +7,7 @@ COMPILE_NS_USER ?= 64 |
| 58 | + override COMPILE_NS_KERNEL := 64 |
| 59 | + COMPILE_S_USER ?= 64 |
| 60 | + COMPILE_S_KERNEL ?= 64 |
| 61 | ++ENABLE_SSH ?= y |
| 62 | + |
| 63 | + ################################################################################ |
| 64 | + # If you change this, you MUST run `make arm-tf-clean` first before rebuilding |
| 65 | +@@ -15,7 +16,11 @@ TF_A_TRUSTED_BOARD_BOOT ?= n |
| 66 | + |
| 67 | + BR2_ROOTFS_OVERLAY = $(ROOT)/build/br-ext/board/qemu/overlay |
| 68 | + BR2_ROOTFS_POST_BUILD_SCRIPT = $(ROOT)/build/br-ext/board/qemu/post-build.sh |
| 69 | +-BR2_ROOTFS_POST_SCRIPT_ARGS = "$(QEMU_VIRTFS_AUTOMOUNT) $(QEMU_VIRTFS_MOUNTPOINT) $(QEMU_PSS_AUTOMOUNT)" |
| 70 | ++BR2_ROOTFS_POST_SCRIPT_ARGS = "$(QEMU_VIRTFS_AUTOMOUNT) $(QEMU_VIRTFS_MOUNTPOINT) $(QEMU_PSS_AUTOMOUNT) $(ENABLE_SSH)" |
| 71 | ++ifeq ($(ENABLE_SSH),y) |
| 72 | ++BR2_PACKAGE_OPENSSH ?= y |
| 73 | ++BR2_SYSTEM_DHCP ?= eth0 |
| 74 | ++endif |
| 75 | + |
| 76 | + PLAT_QEMU ?= virt |
| 77 | + ifeq ($(PLAT_QEMU),virt) |
0 commit comments