Skip to content

ycgkwyc/sunos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sunos system with ipfs

English | 简体中文

✨ 特征

  • 🌈 专为 Web3 应用程序设计的企业级 UI
  • 📦 一组开箱即用的高质量代码
  • 🛡 用 Python 编写
  • ⚙️ 整套设计资源和开发工具
  • 🌍 数十种语言的国际化支持
  • 🎨 每个细节的强大主题定制

🖥 Environment Support

  • Linux
  • ChromeOS & Chromium OS

📦 Installation(Ubuntu20.04 & Debian 11)

Download IPFS

2022/07/28 Kubo v0.14 Latest

wget https://github.com/ipfs/kubo/releases/download/v0.14.0/kubo_v0.14.0_linux-amd64.tar.gz

Extract IPFS

tar xvfz kubo_v0.14.0_linux-amd64.tar.gz

Change Directory Into the IPFS Folder

cd kubo

Install IPFS

sudo ./install.sh

Initalize IPFS

ipfs init

Edit IPFS's Configuration

Changes directory into the folder

cd ~/.ipfs

启动守护进程

ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub

访问localhost:5001/webui

Customize Your Configuration With Nano

Changes directory into the folder

sudo apt-get install nano
nano config

Using Nano to modify the configuration ctrl + x + y

Change IPFS Repo Size

Changes directory into the folder

"StorageMax": "10GB", to "StorageMax": "xxxGB",

Change IPFS Port

Find

"/ip4/0.0.0.0/tcp/4001",
"/ip6/::/tcp/4001"

Replace with

"/ip4/0.0.0.0/tcp/44444",
"/ip6/::/tcp/44444"

Or with the ports you desire.

Prioritize Stored Files Over Cache (with –enable-gc)

From

"Strategy": "all"

To

"Strategy": "pinned"

Select a Different Directory for Storing IPFS's Files

export IPFS_PATH=/edit/this/path/to/ipfsrepo

After Exporting, re-run the init command.

ipfs init

Install Node

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

sudo apt-get install -y nodejs

Install PM2

sudo npm install pm2@latest -g

Start IPFS Daemon

pm2 start "ipfs daemon --enable-gc"

Starts IPFS daemon with garbage collection enabled.

Start IPFS Daemon With Memory Restriction

pm2 start "ipfs daemon --enable-gc" --max-memory-restart 3G

Restarts IPFS daemon if memory usage surpasses 3GB.

Restart IPFS

pm2 status

Gets the process ID.

pm2 restart 0

Use the process ID found with pm2 status that is running IPFS Daemon. (normally 0 if you have no other processes)

PM2 Stop IPFS

pm2 stop 0

Use the process ID found with pm2 status that is running IPFS Daemon. (normally 0 if you have no other processes)

Make IPFS Run At First Boot

pm2 startup

Copy and input the command given.

pm2 save

Saves the current process list enabling each process to run when the computer starts.

ipfs-swarm-key-gen

This program generates swarm.key file for IPFS Private Network feature.

Installation

go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen

Usage

go/bin/ipfs-swarm-key-gen > ~/.ipfs/swarm.key

Change ~/.ipfs/ to different directory if you use custom IPFS_PATH.

crosh进入 Termina

使用Ctrl+Alt+t可以打开打开crosh启动Termina虚拟机进入shell

vmc start termina

(termina) chronos@localhost ~ $

lxc list

列出已经安装的容器:

crosh进入容器的命令行

/tmp $ lxc exec penguin -- bash

crosh查看设备列表

sudo lspci

在编译服务器查看您的磁盘映像,${BOARD}修改为自己的电路板名称

进入编译好的磁盘镜像

(inside) ./mount_gpt_image.sh --board=${BOARD} --safe --most_recent

退出编译好的磁盘镜像(重要)

(inside) ./mount_gpt_image.sh --board=${BOARD} -u

可以单独挂载磁盘镜像编译或者分区解压缩为单独的文件并直接挂载它们 (inside)

cd ~/chromiumos/src/build/images/${BOARD}/latest
./unpack_partitions.sh chromiumos_image.bin
mkdir -p rootfs
sudo mount -o loop,ro part_3 rootfs

这会将 rootfs 从映像环回挂载到 ~/chromiumos/src/build/images/${BOARD}/latest/rootfs 中的chroot位置。 如果您使用构建,"--no-enable-rootfs-verification" 则可以省略 "ro" 选项以将其安装为读写。 如果您构建了 x86 ChromiumOS 映像,您甚至可以尝试 chroot 到该映像中:

(inside) sudo chroot ~/chromiumos/src/build/images/${BOARD}/latest/rootfs

这有点像破解(ChromiumOS rootfs 并不是真正修改服务器主机的 chroot)。完成后不要忘记 exit 这个 chroot。卸载根文件系统:

(inside) sudo umount ~/chromiumos/src/build/images/${BOARD}/latest/rootfs

向现有软件包添加更新补丁

如何修补 Ebuild :https://chromium.googlesource.com/chromiumos/docs/+/main/portage/how_to_patch_an_ebuild.md 它来自 portage 位置在 src/third_party/chromiumos-overlay 需要从当前 ebuild 使用的包的确切版本创建一个补丁文件,如果其他补丁已经在 ebuild 中,在文件最后添加新的补丁,并从已经应用了现有补丁的源构建补丁(要么手动完成,要么设置 FEATURES=noclean 并构建你的补丁临时源)。请注意,补丁顺序很重要,因为 ebuild 期望每个补丁行号在应用前一个补丁后都是准确的。 将您的补丁放在包含 ebuild 文件(例如 third_party/chromiumos-overlay/dev-libs/mypackage/files/mypackage-1.0.0-my-little-patch.patch )的目录的“files”子目录中。 然后,在 prepare()ebuild 部分(如果不存在则创建一个),添加一个 epatch 行:

epatch "${FILESDIR}"/${P}-my-little-patch.patch

About

一键安装sunos到你的x86_64设备

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published