]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
rust kern?
authorseantywork <seantywork@gmail.com>
Wed, 17 Dec 2025 09:24:03 +0000 (09:24 +0000)
committerseantywork <seantywork@gmail.com>
Wed, 17 Dec 2025 09:24:03 +0000 (09:24 +0000)
0xetc/0xrs/ksample/Makefile [new file with mode: 0644]
0xetc/0xrs/ksample/rust_out_of_tree.rs [new file with mode: 0644]
README.md

diff --git a/0xetc/0xrs/ksample/Makefile b/0xetc/0xrs/ksample/Makefile
new file mode 100644 (file)
index 0000000..b46f6bc
--- /dev/null
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-m := rust_out_of_tree.o
+KDIR ?= /lib/modules/`uname -r`/build
+
+default:
+       $(MAKE) -C $(KDIR) M=$$PWD
+
+modules_install: default
+       $(MAKE) -C $(KDIR) M=$$PWD modules_install
+
+clean:
+       $(MAKE) -C $(KDIR) M=$$PWD clean
\ No newline at end of file
diff --git a/0xetc/0xrs/ksample/rust_out_of_tree.rs b/0xetc/0xrs/ksample/rust_out_of_tree.rs
new file mode 100644 (file)
index 0000000..3443cd8
--- /dev/null
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0
+
+//! Rust out-of-tree sample
+
+use kernel::prelude::*;
+
+module! {
+    type: RustOutOfTree,
+    name: "rust_out_of_tree",
+    authors: ["Rust for Linux Contributors"],
+    description: "Rust out-of-tree sample",
+    license: "GPL",
+}
+
+struct RustOutOfTree {
+    numbers: KVec<i32>,
+}
+
+impl kernel::Module for RustOutOfTree {
+    fn init(_module: &'static ThisModule) -> Result<Self> {
+        pr_info!("Rust out-of-tree sample (init)\n");
+
+        let mut numbers = KVec::new();
+        numbers.push(72, GFP_KERNEL)?;
+        numbers.push(108, GFP_KERNEL)?;
+        numbers.push(200, GFP_KERNEL)?;
+
+        Ok(RustOutOfTree { numbers })
+    }
+}
+
+impl Drop for RustOutOfTree {
+    fn drop(&mut self) {
+        pr_info!("My numbers are {:?}\n", self.numbers);
+        pr_info!("Rust out-of-tree sample (exit)\n");
+    }
+}
\ No newline at end of file
index c2ed8da98e87f801dbde154b1bde34f3480c05f2..3afbe31bf50618ab5485c1d98f776090a7d762e4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -998,6 +998,10 @@ git commit
 
 git push -f <forked_origin> <forked_origin_branch>
 
+# git push create set to public
+
+git push -o repo.private=false -u origin main
+
 # then PR
 
 # squash commits
@@ -1373,6 +1377,21 @@ sudo systemctl restart nginx
  
 
 
+```
+# CERTBOT
+
+```shell
+# install
+sudo apt update 
+sudo apt install python3 python3-dev python3-venv libaugeas-dev gcc
+sudo python3 -m venv /opt/certbot/
+sudo /opt/certbot/bin/pip install --upgrade pip
+sudo /opt/certbot/bin/pip install certbot
+sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
+
+# chal
+sudo certbot certonly --standalone --preferred-challenges http -d hack.feebdaed.xyz -d hack.feebdaed.xyz
+
 ```
 
 
@@ -13470,6 +13489,9 @@ export PATH="$PATH:$HOME/.cargo/bin"
 
 source .profile
 
+# update
+rustup update stable
+
 ```
 
 # SCRCPY ANDROID SCREEN MIRRORING