-
Notifications
You must be signed in to change notification settings - Fork 457
スクリプトによるRaspberry Pi設定の自動化 #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dtoverlayがkernel5.16未満にも関わらず記述されていた場合に削除するよう変更
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューしました。
コメントの確認をお願いいたします。
下記の環境でサンプルが動作することを確認しました。
|
今回のPRの変更内容に関係するかは不明ですが、 ubuntu@ubuntu:~/RaspberryPiMouse/utils$ ./build_install.bash
build_install_header_from_apt_raspi4.bash
make -C /usr/src/linux-headers-6.8.0-1010-raspi M=/home/ubuntu/RaspberryPiMouse/src/drivers V=0 clean
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-1010-raspi'
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-1010-raspi'
make -C /usr/src/linux-headers-6.8.0-1010-raspi M=/home/ubuntu/RaspberryPiMouse/src/drivers V=0 modules
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-1010-raspi'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: aarch64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
You are using: gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
CC [M] /home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.o
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1140:6: warning: no previous prototype for ‘update_signed_count’ [-Wmissing-prototypes]
1140 | void update_signed_count(struct rtcnt_device_info *dev_info, int rtcnt_count)
| ^~~~~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1176:6: warning: no previous prototype for ‘reset_signed_count’ [-Wmissing-prototypes]
1176 | void reset_signed_count(struct rtcnt_device_info *dev_info, int rtcnt_count)
| ^~~~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c: In function ‘mcp3204_get_value’:
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1907:14: warning: unused variable ‘str’ [-Wunused-variable]
1907 | char str[128];
| ^~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c: At top level:
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:2387:5: warning: no previous prototype for ‘dev_init_module’ [-Wmissing-prototypes]
2387 | int dev_init_module(void)
| ^~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:2544:6: warning: no previous prototype for ‘dev_cleanup_module’ [-Wmissing-prototypes]
2544 | void dev_cleanup_module(void)
| ^~~~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:1954:13: warning: ‘spi_remove_device’ defined but not used [-Wunused-function]
1954 | static void spi_remove_device(struct spi_master *master, unsigned int cs)
| ^~~~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:335:26: warning: ‘mcp3204_driver’ defined but not used [-Wunused-variable]
335 | static struct spi_driver mcp3204_driver = {
| ^~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:95:12: warning: ‘spi_chip_select’ defined but not used [-Wunused-variable]
95 | static int spi_chip_select = 0;
| ^~~~~~~~~~~~~~~
/home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.c:94:12: warning: ‘spi_bus_num’ defined but not used [-Wunused-variable]
94 | static int spi_bus_num = 0;
| ^~~~~~~~~~~
MODPOST /home/ubuntu/RaspberryPiMouse/src/drivers/Module.symvers
CC [M] /home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.mod.o
LD [M] /home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.ko
BTF [M] /home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.ko
Skipping BTF generation for /home/ubuntu/RaspberryPiMouse/src/drivers/rtmouse.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-1010-raspi' |
README上のCI結果のバッジの修正をお願いしたいです。 修正前↓
修正後↓
|
修正しました。 |
Co-authored-by: YusukeKato <YusukeKato@users.noreply.github.com>
- 変数"KERNEL_VERSION_INT"と関数"KERNEL_VERSION_INT()"が同名だったため、関数を"GET_KERNEL_VERSION_INT()"に理ネーム - 関数"GET_KERNEL_VERSION_INT() "を現在のカーネルバージョン取得より前に定義し、自身のカーネルバージョンを整数値に変換する際に使用するよう変更
動作としては問題ないです。今回は直さなくても良いかなというのが私の意見です。 これらのwarningはデバイスツリーによる動作(カーネル5.16以上)のとき、SPIのマスターをサーチする処理にイレギュラーな方法を用いて大きな分岐が起こっていることに起因します。これらのwarningを消すためにはたくさんのカーネルバージョン分岐を設ける必要があるため、コードの可読性を更に下げ、修正にも時間がかかってしまいます。これらのwarningを直す手間を、純粋なデバイスツリーでの動作するコードへのリファクタリングに回したほうが良いのではないかと考えています。 ですが、確かに開発に慣れていない人がビルド時に大量に出るwarningを見ると不安になると思うので修正するというのも全然ありだとは思っています。 |
- 今回から全ての設定がスクリプトによって自動で書き換わるため、先頭でのみこれにふれるように変更 - 32-bit OSはUbuntu 22.04でも存在するため、Raspberry Pi OSのスコープから外した
warningの件、承知しました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMです!
What does this implement/fix?
デバイスドライバをビルドする前に必要な設定(ソースファイルのダウンロードとインストール)を自動で行うスクリプトを追加します。
従来の
/boot/firmware/config.txt
を手動で修正していた手順を、本PRで追加するスクリプトで行うため、カーネルヘッダーのインストール以外はRaspberry Pi OS
とUbuntu Server
の両方で手順が統一されます。Does this close any currently open issues?
しません。
How has this been tested?
環境
Raspberry Pi 3Bと4Bに対してそれぞれ以下の環境全てを用意しテストし、サンプルプログラム全ての動作を確認しました。
手順
$ sudo apt update $ sudo apt upgrade $ git clone -b feature/setting-configs https://github.com/rt-net/RaspberryPiMouse.git $ cd RaspberryPiMouse/utils $ ./set_configs.bash
$ cd RaspberryPiMouse/utils $ ./build_install.bash
$ cd ../SampleProgram $ bash step1.sh // ... $ bash step6.sh
Any other comments?
今回の変更に合わせ、Raspberry Pi Mouseのチュートリアル内のソースファイルのダウンロードとインストールを修正する必要があります。
Checklists