diff --git a/.cirun.yml b/.cirun.yml deleted file mode 100644 index 06274c6..0000000 --- a/.cirun.yml +++ /dev/null @@ -1,12 +0,0 @@ -# Self-Hosted Github Action Runners on AWS via Cirun.io -# Reference: https://docs.cirun.io/reference/yaml -runners: - - name: "aws-runner" - cloud: "aws" - region: "us-west-2" - instance_type: "m7a.2xlarge" - # Ubuntu-24.04, 64GB, us-west-2 - machine_image: "ami-02e8110329444ee3b" - preemptible: false - labels: - - "cirun-aws-amd64" diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..3e6ffa1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:latest + +RUN apt-get update && \ + apt-get install -y \ + git ssh make gcc gcc-multilib g++-multilib \ + module-assistant expect g++ gawk texinfo libssl-dev \ + bison flex fakeroot cmake unzip gperf autoconf \ + device-tree-compiler libncurses5-dev pkg-config bc \ + python-is-python3 passwd openssl openssh-server \ + openssh-client vim file cpio rsync + +RUN apt-get install -y sudo + +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..ae094b8 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": "Luckfox Pico Alpine DevContainer", + "build": { + "dockerfile": "Dockerfile", + "context": "." + }, + "containerUser": "ubuntu" +} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ccdad51..4253baf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,16 +21,15 @@ jobs: strategy: matrix: device: [ pico-mini-b, pico-plus, pico-pro-max ] - # runs-on: "cirun-aws-amd64--${{ github.run_id }}" runs-on: ubuntu-latest needs: build-rootfs steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: "recursive" - name: download rootfs - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: rootfs-alpine - name: update apt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..520a2b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +output/ + +*.img +*.tar.gz \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 639e721..63b7bf7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "sdk"] path = sdk - url = https://github.com/soyflourbread/luckfox-pico-sdk.git + url = https://github.com/ohaiibuzzle/luckfox-pico-sdk.git diff --git a/README.md b/README.md index 263fbb4..bed89af 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,13 @@ This system image has RNDIS enabled for all boards. To connect to your Pico through RNDIS, check out [the official guide](https://wiki.luckfox.com/Luckfox-Pico/SSH-Telnet-Login/). -The board's static IP is `172.32.0.93`. +The board's static IP is `172.16.42.1`. Below is a brief guide to connect via RNDIS on Linux: ```bash -ip link # obtain network device name of pico -sudo ip addr add 172.32.0.100/16 dev -ping 172.32.0.93 # it works! +# Step 1: Plug in +ping 172.16.42.1 # Step 2: Get Connected +# Step 3: There's no Step 3. Thanks unudhcpd! ``` ## Customization diff --git a/bootstrap.sh b/bootstrap.sh index 781987a..864628e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,20 +13,14 @@ rc-update add local default apk add agetty # Setting up shell -apk add shadow -apk add bash bash-completion +apk add shadow bash bash-completion --no-cache chsh -s /bin/bash echo -e "luckfox\nluckfox" | passwd apk del -r shadow # Install SSH -apk add openssh -rc-update add sshd default - -# Extra stuff -apk add mtd-utils-ubi -apk add bottom -apk add neofetch +apk add dropbear mtd-utils-ubi bottom fastfetch unudhcpd --no-cache +rc-update add dropbear default # Clear apk cache rm -rf /var/cache/apk/* diff --git a/overlay/etc/init.d/10_usb_gadget b/overlay/etc/init.d/10_usb_gadget index 1ab70ea..94890cf 100755 --- a/overlay/etc/init.d/10_usb_gadget +++ b/overlay/etc/init.d/10_usb_gadget @@ -1,3 +1,11 @@ #!/sbin/openrc-run -command="/usr/bin/usb_gadget start || true" +start() { + /usr/bin/usb_gadget start || true + /usr/bin/unudhcpd -i usb0 -s 172.16.42.1 -c 172.16.42.2 & +} + +stop() { + # dont + true +} \ No newline at end of file diff --git a/overlay/etc/network/interfaces b/overlay/etc/network/interfaces index 2b9e5c1..3388d28 100644 --- a/overlay/etc/network/interfaces +++ b/overlay/etc/network/interfaces @@ -5,6 +5,6 @@ iface eth0 inet dhcp udhcpc_opts -t 1 auto usb0 iface usb0 inet static - address 172.32.0.93 + address 172.16.42.1 netmask 255.255.255.0 - gateway 172.32.0.1 + gateway 172.16.42.2 diff --git a/overlay/etc/ssh/sshd_config.d/20-root.conf b/overlay/etc/ssh/sshd_config.d/20-root.conf deleted file mode 100644 index 6b38776..0000000 --- a/overlay/etc/ssh/sshd_config.d/20-root.conf +++ /dev/null @@ -1,2 +0,0 @@ -PermitRootLogin yes -PasswordAuthentication yes diff --git a/rootfs.sh b/rootfs.sh index 4019943..52e8211 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -27,6 +27,7 @@ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # Create docker docker container rm -f armv7alpine docker run \ + --platform linux/arm/v7 \ --name armv7alpine \ --net host \ --mount type=bind,source=./bootstrap.sh,target=/bootstrap.sh \ @@ -50,9 +51,6 @@ overlay() { rsync -a "$OVERLAY_WORKSPACE/" "$ROOTFS_WORKSPACE_MNT/" rm -rf "$OVERLAY_WORKSPACE" - echo "Include /etc/ssh/sshd_config.d/*.conf" >> \ - "$ROOTFS_WORKSPACE_MNT/etc/ssh/sshd_config" - ln -s "/etc/init.d/00_link_mount" \ "$ROOTFS_WORKSPACE_MNT/etc/runlevels/default/00_link_mount" diff --git a/sdk b/sdk index 8dde6a3..eee6b6a 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 8dde6a3209dffdaedf4c3fe0d5367ee413987951 +Subproject commit eee6b6aee391194b5ddb1e96725d66c9adf3e4b9 diff --git a/system.sh b/system.sh index 7ed64b2..2b7b439 100755 --- a/system.sh +++ b/system.sh @@ -14,11 +14,11 @@ while getopts ":f:d:" opt; do esac done -DEVICE_ID="6" +DEVICE_ID="2" case $DEVICE_NAME in - pico-mini-b) DEVICE_ID="6" ;; - pico-plus) DEVICE_ID="7" ;; - pico-pro-max) DEVICE_ID="8" ;; + pico-mini-b) DEVICE_ID="1" ;; + pico-plus) DEVICE_ID="2" ;; + pico-pro-max) DEVICE_ID="4" ;; *) echo "Invalid device: ${DEVICE_NAME}." exit 1 @@ -29,6 +29,9 @@ rm -rf sdk/sysdrv/custom_rootfs/ mkdir -p sdk/sysdrv/custom_rootfs/ cp "$ROOTFS_NAME" sdk/sysdrv/custom_rootfs/ +# Make dang sure at this point rootfs name only has file name (ala. no paths in there) +ROOTFS_NAME=$(basename "$ROOTFS_NAME") + pushd sdk || exit pushd tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/ || exit @@ -36,7 +39,7 @@ source env_install_toolchain.sh popd || exit rm -rf .BoardConfig.mk -echo "$DEVICE_ID" | ./build.sh lunch +echo -e "$DEVICE_ID\n1\n0" | ./build.sh lunch echo "export RK_CUSTOM_ROOTFS=../sysdrv/custom_rootfs/$ROOTFS_NAME" >> .BoardConfig.mk echo "export RK_BOOTARGS_CMA_SIZE=\"1M\"" >> .BoardConfig.mk