Skip to content

Commit

Permalink
chore: add NanoPi R6S disk layout
Browse files Browse the repository at this point in the history
Add manjaro
  • Loading branch information
initdc committed Jan 10, 2023
1 parent 675559a commit 370b756
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 2 deletions.
12 changes: 10 additions & 2 deletions copy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,16 @@ def copy_par(src, dest, copy_map = nil)
/boot/uEnv.txt
]

# copy_kernel "/home/ubuntu/vscode/rootfs-tools/vf-de", "origin", v_extra
r_extra = %w[
/lib/firmware/
/lib/modules/
]

r_map = {
"2": "8",
}
# copy_kernel "/media/ubuntu/rootfs", "origin", r_extra, true
# copy_kernel "/home/ubuntu/vscode/rootfs-tools/origin", "rootfs"

copy_par "/dev/loop6", "/dev/sdc"
copy_par "/dev/loop14", "/dev/loop15", r_map
end
10 changes: 10 additions & 0 deletions vendor-resources/friendlyelec-r6s/mjr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
label: gpt
label-id: 837CB2D9-B9E9-4232-9967-880913144D47
device: cache/Manjaro-ARM-gnome-generic-22.12.img
unit: sectors
first-lba: 34
last-lba: 14815198
sector-size: 512

cache/Manjaro-ARM-gnome-generic-22.12.img1 : start= 2048, size= 997376, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=069CB19B-E0B2-4CB8-A53F-37FCE9C6EAE7, name="primary"
cache/Manjaro-ARM-gnome-generic-22.12.img2 : start= 999424, size= 13813760, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=1B17A334-53C8-4A52-A9A9-38542BA1A14B, name="primary"
17 changes: 17 additions & 0 deletions vendor-resources/friendlyelec-r6s/r6s
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# rootfs 8G on 32G SD card
label: gpt
label-id: 73987B6B-4974-4C94-A3E8-58AB2EB7A946
device: /dev/sdc
unit: sectors
first-lba: 34
last-lba: 61067230

/dev/sdc1 : start= 16384, size= 8192, type=F808D051-1602-4DCD-9452-F9637FEFC49A, uuid=B750E44E-833F-4A30-C38C-B117241D84D4, name="uboot"
/dev/sdc2 : start= 24576, size= 8192, type=C6D08308-E418-4124-8890-F8411E3D8D87, uuid=A1C81622-7741-47AD-B846-C6972488D396, name="misc"
/dev/sdc3 : start= 32768, size= 8192, type=2A583E58-486A-4BD4-ACE4-8D5454E97F5C, uuid=43784A32-A03D-4ADE-92C6-EDE64FF9B794, name="dtbo"
/dev/sdc4 : start= 40960, size= 32768, type=6115F139-4F47-4BAF-8D23-B6957EAEE4B3, uuid=000B305F-484A-4582-9090-4AD0099D47BD, name="resource"
/dev/sdc5 : start= 73728, size= 81920, type=A83FBA16-D354-45C5-8B44-3EC50832D363, uuid=24EEB649-277F-4C11-FFEB-D9F20027A83B, name="kernel"
/dev/sdc6 : start= 155648, size= 65536, type=500E2214-B72D-4CC3-D7C1-8419260130F5, uuid=1CAC805F-726A-495A-FD35-821355A6E7E8, name="boot"
/dev/sdc7 : start= 221184, size= 65536, type=E099DA71-5450-44EA-AA9F-1B771C582805, uuid=2BFEE623-D83C-426A-AB80-21732C9BB7D3, name="recovery"
/dev/sdc8 : start= 286720, size= 15728640, type=AF12D156-5D5B-4EE3-B415-8D492CA12EA9, uuid=B2AF085D-A675-48C6-C437-F6D557FF4744, name="rootfs"
/dev/sdc9 : start= 16015360, size= 45051870, type=8EB9EE49-E963-4BB6-FD75-F30618DF9DCD, uuid=2D9E7B61-1B31-47E7-EE0D-8CEC26D42EF6, name="userdata"
16 changes: 16 additions & 0 deletions vendor-resources/friendlyelec-r6s/r6s-img
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
label: gpt
label-id: 73987B6B-4974-4C94-A3E8-58AB2EB7A946
device: rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img
unit: sectors
first-lba: 34
last-lba: 15234340

rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img1 : start= 16384, size= 8192, type=F808D051-1602-4DCD-9452-F9637FEFC49A, uuid=B750E44E-833F-4A30-C38C-B117241D84D4, name="uboot"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img2 : start= 24576, size= 8192, type=C6D08308-E418-4124-8890-F8411E3D8D87, uuid=A1C81622-7741-47AD-B846-C6972488D396, name="misc"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img3 : start= 32768, size= 8192, type=2A583E58-486A-4BD4-ACE4-8D5454E97F5C, uuid=43784A32-A03D-4ADE-92C6-EDE64FF9B794, name="dtbo"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img4 : start= 40960, size= 32768, type=6115F139-4F47-4BAF-8D23-B6957EAEE4B3, uuid=000B305F-484A-4582-9090-4AD0099D47BD, name="resource"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img5 : start= 73728, size= 81920, type=A83FBA16-D354-45C5-8B44-3EC50832D363, uuid=24EEB649-277F-4C11-FFEB-D9F20027A83B, name="kernel"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img6 : start= 155648, size= 65536, type=500E2214-B72D-4CC3-D7C1-8419260130F5, uuid=1CAC805F-726A-495A-FD35-821355A6E7E8, name="boot"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img7 : start= 221184, size= 65536, type=E099DA71-5450-44EA-AA9F-1B771C582805, uuid=2BFEE623-D83C-426A-AB80-21732C9BB7D3, name="recovery"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img8 : start= 286720, size= 7864320, type=AF12D156-5D5B-4EE3-B415-8D492CA12EA9, uuid=B2AF085D-A675-48C6-C437-F6D557FF4744, name="rootfs"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img9 : start= 8151040, size= 7083301, type=8EB9EE49-E963-4BB6-FD75-F30618DF9DCD, uuid=2D9E7B61-1B31-47E7-EE0D-8CEC26D42EF6, name="userdata"
17 changes: 17 additions & 0 deletions vendor-resources/friendlyelec-r6s/r6s-mjr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# rootfs 7G
label: gpt
label-id: 73987B6B-4974-4C94-A3E8-58AB2EB7A946
device: rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img
unit: sectors
first-lba: 34
last-lba: 15234340

rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img1 : start= 16384, size= 8192, type=F808D051-1602-4DCD-9452-F9637FEFC49A, uuid=B750E44E-833F-4A30-C38C-B117241D84D4, name="uboot"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img2 : start= 24576, size= 8192, type=C6D08308-E418-4124-8890-F8411E3D8D87, uuid=A1C81622-7741-47AD-B846-C6972488D396, name="misc"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img3 : start= 32768, size= 8192, type=2A583E58-486A-4BD4-ACE4-8D5454E97F5C, uuid=43784A32-A03D-4ADE-92C6-EDE64FF9B794, name="dtbo"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img4 : start= 40960, size= 32768, type=6115F139-4F47-4BAF-8D23-B6957EAEE4B3, uuid=000B305F-484A-4582-9090-4AD0099D47BD, name="resource"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img5 : start= 73728, size= 81920, type=A83FBA16-D354-45C5-8B44-3EC50832D363, uuid=24EEB649-277F-4C11-FFEB-D9F20027A83B, name="kernel"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img6 : start= 155648, size= 65536, type=500E2214-B72D-4CC3-D7C1-8419260130F5, uuid=1CAC805F-726A-495A-FD35-821355A6E7E8, name="boot"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img7 : start= 221184, size= 65536, type=E099DA71-5450-44EA-AA9F-1B771C582805, uuid=2BFEE623-D83C-426A-AB80-21732C9BB7D3, name="recovery"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img8 : start= 286720, size= 13813760, type=AF12D156-5D5B-4EE3-B415-8D492CA12EA9, uuid=B2AF085D-A675-48C6-C437-F6D557FF4744, name="rootfs"
rk3588-sd-ubuntu-jammy-desktop-5.10-arm64-20221213.img9 : start= 14100480, size= 1133860, type=8EB9EE49-E963-4BB6-FD75-F30618DF9DCD, uuid=2D9E7B61-1B31-47E7-EE0D-8CEC26D42EF6, name="userdata"
42 changes: 42 additions & 0 deletions vendor-resources/friendlyelec-r6s/root/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

set -e

add_ubuntu() {
useradd -G sudo -d /home/ubuntu -m -s /bin/bash ubuntu
echo "ubuntu:ubuntu" | chpasswd
echo "root:root" | chpasswd
}

add_lang_pack() {
apt-get install -y language-pack-en-base
apt-get install -y dialog apt-utils
}

install_software() {
apt-get install -y dnsutils file htop ifupdown iputils-ping lshw lsof nano net-tools network-manager openssh-server rfkill tree u-boot-tools wget wireless-tools wpasupplicant
}

set_sshd_config() {
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
}

main() {
export DEBIAN_FRONTEND="noninteractive"

# apt-get update

# add_lang_pack
# install_software
# set_sshd_config
# rm -rf /var/lib/apt/*

add_ubuntu
# systemctl enable [email protected]

unset DEBIAN_FRONTEND
}

main "$@"
21 changes: 21 additions & 0 deletions vendor-resources/friendlyelec-r6s/root/mjr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

add_user() {
useradd -G sudo -d /home/manjaro -m -s /bin/bash manjaro
echo "manjaro:manjaro" | chpasswd
echo "root:root" | chpasswd
}

set_sshd_config() {
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
}

main() {
add_user
}

main "$@"

0 comments on commit 370b756

Please sign in to comment.