Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
TzuHuanTai committed Jan 26, 2025
1 parent 1c97cfe commit 9edd45a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/qemu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ jobs:
sudo mkdir boot
sudo mount -o loop,offset=4194304 rpi-os.img boot
ls boot/
cp boot/kernel8.img kernel8.img
cp boot/bcm2710-rpi-3-b-plus.dtb bcm2710-rpi-3-b-plus.dtb
sudo touch /boot/ssh
echo 'pi:$6$uQd.Z0f45vuTlnIM$fH2KnG/2zM/c7oQNYKf/VOhqPlkR82IFNIjmDWftvrmw/K1XPLNJVMvWgmqq0iMjn9dd7gfJAl2tM5e8vgiu8/' | sudo tee boot/userconf > /dev/null
cp boot/bcm2710-rpi-3-b-plus.dtb custom.dtb
dtmerge custom.dtb merged.dtb - uart0=on
mv merged.dtb custom.dtb
dtmerge custom.dtb merged.dtb boot/overlays/disable-bt.dtbo
mv merged.dtb custom.dtb
sudo touch boot/ssh
echo 'pi:$6$uQd.Z0f45vuTlnIM$fH2KnG/2zM/c7oQNYKf/VOhqPlkR82IFNIjmDWftvrmw/K1XPLNJVMvWgmqq0iMjn9dd7gfJAl2tM5e8vgiu8/' | sudo tee boot/userconf.txt > /dev/null
echo -e "\ndtoverlay=disable-bt\ndtparam=uart0=on" | sudo tee -a boot/config.txt > /dev/null
sudo umount boot
Expand All @@ -41,7 +47,7 @@ jobs:
-cpu cortex-a72 \
-smp 4 -m 1G \
-kernel kernel8.img \
-dtb bcm2710-rpi-3-b-plus.dtb \
-dtb custom.dtb \
-drive "file=rpi-os.img,format=raw,index=0,if=sd" \
-append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" \
-device usb-net,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22 \
Expand All @@ -55,13 +61,11 @@ jobs:
sleep 5
done
echo "QEMU is ready!"
- name: Start SSH inside Raspberry Pi OS
run: |
sshpass -p "raspberry" ssh -p 5555 pi@localhost "ls"
sshpass -p "raspberry" ssh -p 5555 pi@localhost "ls /"
- name: Build project inside Raspberry Pi OS
run: |
sshpass -p "raspberry" ssh -p 5555 pi@localhost "sudo apt update && sudo apt install -y cmake build-essential"
sshpass -p "raspberry" scp -r . pi@localhost:~/project
sshpass -p "raspberry" ssh -p 5555 pi@localhost "ls ~/project"
sshpass -p "raspberry" ssh -p 5555 pi@localhost "cd project && mkdir build && cd build && cmake .. && make -j$(nproc)"

0 comments on commit 9edd45a

Please sign in to comment.