Support Raspberry Pi OS
This commit is contained in:
parent
0af822981b
commit
09bb7ec1a0
|
|
@ -7,7 +7,7 @@ MODULES_BLACKLIST_LEGACY="bcmdhd"
|
|||
KERNEL_TARGET="legacy"
|
||||
BOOT_LOGO="desktop"
|
||||
BOOT_SUPPORT_SPI="yes"
|
||||
DISTRIB_TYPE_LEGACY="focal jammy bullseye"
|
||||
DISTRIB_TYPE_LEGACY="focal jammy bullseye raspi"
|
||||
BOOTFS_TYPE="fat"
|
||||
IMAGE_PARTITION_TABLE="gpt"
|
||||
BOOT_FDT_FILE="rockchip/rk3566-orangepi-3b.dtb"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ MODULES_BLACKLIST_LEGACY="bcmdhd"
|
|||
KERNEL_TARGET="legacy"
|
||||
BOOT_LOGO="desktop"
|
||||
BOOT_SUPPORT_SPI="yes"
|
||||
DISTRIB_TYPE_LEGACY="focal jammy bullseye"
|
||||
DISTRIB_TYPE_LEGACY="focal jammy bullseye raspi"
|
||||
BOOTFS_TYPE="fat"
|
||||
IMAGE_PARTITION_TABLE="gpt"
|
||||
BOOT_FDT_FILE="rockchip/rk3566-orangepi-cm4.dtb"
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
main
|
||||
|
|
@ -0,0 +1 @@
|
|||
locales
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
raspberrypi-archive-keyring
|
||||
raspi-config
|
||||
netbase
|
||||
libraspberrypi-bin
|
||||
libraspberrypi0
|
||||
systemd-timesyncd
|
||||
ssh
|
||||
less
|
||||
fbset
|
||||
sudo
|
||||
psmisc
|
||||
strace
|
||||
ed
|
||||
ncdu
|
||||
crda
|
||||
console-setup
|
||||
keyboard-configuration
|
||||
debconf-utils
|
||||
parted
|
||||
build-essential
|
||||
manpages-dev
|
||||
bash-completion
|
||||
gdb
|
||||
pkg-config
|
||||
python-is-python3
|
||||
python3-rpi.gpio
|
||||
v4l-utils
|
||||
python3-gpiozero
|
||||
avahi-daemon
|
||||
lua5.1
|
||||
luajit
|
||||
hardlink
|
||||
ca-certificates
|
||||
curl
|
||||
fake-hwclock
|
||||
nfs-common
|
||||
usbutils
|
||||
libraspberrypi-dev
|
||||
libraspberrypi-doc
|
||||
libfreetype6-dev
|
||||
dosfstools
|
||||
dphys-swapfile
|
||||
raspberrypi-sys-mods
|
||||
pi-bluetooth
|
||||
apt-listchanges
|
||||
usb-modeswitch
|
||||
libpam-chksshpwd
|
||||
rpi-update
|
||||
libmtp-runtime
|
||||
rsync
|
||||
htop
|
||||
man-db
|
||||
policykit-1
|
||||
ssh-import-id
|
||||
rng-tools
|
||||
ethtool
|
||||
ntfs-3g
|
||||
pciutils
|
||||
rpi-eeprom
|
||||
raspinfo
|
||||
udisks2
|
||||
unzip
|
||||
zip
|
||||
p7zip-full
|
||||
file
|
||||
kms++-utils
|
||||
cifs-utils
|
||||
libcamera-apps-lite
|
||||
mkvtoolnix
|
||||
python3-picamera2
|
||||
wpasupplicant
|
||||
wireless-tools
|
||||
firmware-atheros
|
||||
firmware-brcm80211
|
||||
firmware-libertas
|
||||
firmware-misc-nonfree
|
||||
firmware-realtek
|
||||
raspberrypi-net-mods
|
||||
dhcpcd5
|
||||
network-manager
|
||||
net-tools
|
||||
|
|
@ -0,0 +1 @@
|
|||
u-boot-tools
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
gstreamer1.0-x
|
||||
gstreamer1.0-plugins-base
|
||||
gstreamer1.0-plugins-good
|
||||
gstreamer1.0-plugins-bad
|
||||
gstreamer1.0-alsa
|
||||
gstreamer1.0-libav
|
||||
qpdfview
|
||||
gtk2-engines
|
||||
alsa-utils
|
||||
desktop-base
|
||||
git
|
||||
policykit-1
|
||||
gvfs
|
||||
rfkill
|
||||
chromium-browser
|
||||
rpi-chromium-mods
|
||||
libwidevinecdm0
|
||||
gldriver-test
|
||||
fonts-droid-fallback
|
||||
fonts-liberation2
|
||||
obconf
|
||||
arandr
|
||||
libcamera-tools
|
||||
libcamera-apps
|
||||
python3-pyqt5
|
||||
python3-opengl
|
||||
python3-pygame
|
||||
python3-tk thonny
|
||||
python3-pgzero
|
||||
python3-serial
|
||||
debian-reference-en
|
||||
dillo
|
||||
raspberrypi-net-mods
|
||||
raspberrypi-ui-mods
|
||||
python3-pip
|
||||
python3-numpy
|
||||
pypy
|
||||
alacarte
|
||||
rc-gui
|
||||
sense-hat
|
||||
tree
|
||||
libgl1-mesa-dri
|
||||
libgles1
|
||||
libgles2-mesa
|
||||
xcompmgr
|
||||
geany
|
||||
piclone
|
||||
pigpio
|
||||
python3-pigpio
|
||||
raspi-gpio
|
||||
python3-rpi.gpio
|
||||
python3-spidev
|
||||
python3-twython
|
||||
python3-smbus
|
||||
python3-flask
|
||||
pprompt
|
||||
piwiz
|
||||
rp-prefapps
|
||||
ffmpeg
|
||||
vlc
|
||||
rpi-imager
|
||||
rpi-wayland
|
||||
pi-package
|
||||
realvnc-vnc-server
|
||||
python3-automationhat
|
||||
python3-blinkt
|
||||
python3-cap1xxx
|
||||
python3-drumhat
|
||||
python3-envirophat
|
||||
python3-explorerhat
|
||||
python3-fourletterphat
|
||||
python3-microdotphat
|
||||
python3-mote
|
||||
python3-motephat
|
||||
python3-phatbeat
|
||||
python3-pianohat
|
||||
python3-piglow
|
||||
python3-rainbowhat
|
||||
python3-scrollphat
|
||||
python3-scrollphathd
|
||||
python3-sn3218
|
||||
python3-skywriter
|
||||
python3-touchphat
|
||||
python3-buttonshim
|
||||
python3-unicornhathd
|
||||
python3-pantilthat
|
||||
hunspell-en-gb
|
||||
hyphen-en-gb
|
||||
wamerican
|
||||
wbritish
|
||||
cups
|
||||
system-config-printer
|
||||
|
|
@ -0,0 +1 @@
|
|||
supported
|
||||
|
|
@ -0,0 +1 @@
|
|||
Raspberry Pi OS
|
||||
|
|
@ -0,0 +1 @@
|
|||
supported
|
||||
|
|
@ -226,7 +226,7 @@ rk356x_gpu_vpu_tweaks()
|
|||
|
||||
if [[ ${BOARD} =~ orangepicm4|orangepi3b && ${SELECTED_CONFIGURATION} == desktop && ${DESKTOP_ENVIRONMENT} == xfce && ${RELEASE} == bullseye ]]; then
|
||||
|
||||
rk356x_deb+=("rk356x_packages/common/libmali/libmali-bifrost-g52-g13p0-x11-gbm_1.9-1_arm64.deb") ##
|
||||
rk356x_deb+=("rk356x_packages/common/libmali/libmali-bifrost-g52-g13p0-x11-gbm_1.9-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/common/rga2/librga2_2.2.0-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/common/rga2/librga-dev_2.2.0-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/common/rkaiq/camera_engine_rkaiq_rk3568_arm64.deb")
|
||||
|
|
@ -346,3 +346,104 @@ rk356x_gpu_vpu_tweaks()
|
|||
|
||||
fi
|
||||
}
|
||||
|
||||
rk356x_gpu_vpu_tweaks_for_raspios()
|
||||
{
|
||||
if [[ ${BOARD} =~ orangepicm4|orangepi3b && ${SELECTED_CONFIGURATION} == desktop && ${RELEASE} == raspi ]]; then
|
||||
|
||||
rk356x_deb+=("rk356x_packages/common/libmali/libmali-bifrost-g52-g13p0-x11-gbm_1.9-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/common/rga2/librga2_2.2.0-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/common/rga2/librga-dev_2.2.0-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/common/rkaiq/camera_engine_rkaiq_rk3568_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/common/rktoolkit/rktoolkit_1.0.0-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/mpp/librockchip-mpp1_1.5.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/mpp/librockchip-mpp-dev_1.5.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/mpp/librockchip-vpu0_1.5.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/mpp/rockchip-mpp-demos_1.5.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/xserver-raspios/xserver-common_1.20.11-1+rpt3+deb11u6_all.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/xserver-raspios/xserver-xorg-dev_1.20.11-1+rpt3+deb11u6_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/xserver-raspios/xserver-xorg-core_1.20.11-1+rpt3+deb11u6_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/xserver-raspios/xserver-xorg-legacy_1.20.11-1+rpt3+deb11u6_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/xserver-raspios/xwayland_1.20.11-1+rpt3+deb11u6_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-rkmpp/gstreamer1.0-rockchip1_1.14-4_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gstreamer/gir1.2-gstreamer-1.0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gstreamer/gstreamer1.0-tools_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gstreamer/libgstreamer1.0-0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gstreamer/libgstreamer1.0-dev_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/gir1.2-gst-plugins-base-1.0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/gstreamer1.0-alsa_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/gstreamer1.0-gl_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/gstreamer1.0-plugins-base_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/gstreamer1.0-plugins-base-apps_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/gstreamer1.0-x_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/libgstreamer-gl1.0-0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/libgstreamer-plugins-base1.0-0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-base1.0/libgstreamer-plugins-base1.0-dev_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/libgstreamer-plugins-bad1.0-0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/gir1.2-gst-plugins-bad-1.0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/libgstreamer-opencv1.0-0_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/gstreamer1.0-opencv_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/gstreamer1.0-plugins-bad_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/gstreamer1.0-plugins-bad-apps_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/gstreamer1.0-wpe_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-bad1.0/libgstreamer-plugins-bad1.0-dev_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-good1.0/gstreamer1.0-gtk3_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-good1.0/gstreamer1.0-plugins-good_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-good1.0/gstreamer1.0-pulseaudio_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-plugins-ugly1.0/gstreamer1.0-plugins-ugly_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/gst-libav1.0/gstreamer1.0-plugins-ugly_1.18.5-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libdvbv5-0_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/dvb-tools_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/ir-keytable_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libdvbv5-dev_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libdvbv5-doc_1.20.0-2_all.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libv4l-0_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libv4l2rds0_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libv4lconvert0_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libv4l-dev_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/libv4l-rkmpp_1.5.1-1.1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libv4l/v4l-utils_1.20.0-2_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/chromium/chromium-x11_91.0.4472.164_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libdrm-cursor/libdrm-cursor_1.4.1-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/libdrm-cursor/libdrm-cursor-dev_1.4.1-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/glmark2/glmark2-data_2022.06~git.3f1104d-1_all.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/glmark2/glmark2-es2-drm_2022.06~git.3f1104d-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/glmark2/glmark2-es2-x11_2022.06~git.3f1104d-1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavutil56_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavutil-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libpostproc55_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libpostproc-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libswresample3_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libswresample-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libswscale5_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libswscale-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavcodec58_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavcodec-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavformat58_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavformat-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavresample4_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavresample-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavfilter7_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavfilter-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavdevice58_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/libavdevice-dev_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/ffmpeg/ffmpeg_4.3.5-0+deb11u1_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/mpv/libmpv1_0.32.0-3_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/mpv/libmpv-dev_0.32.0-3_arm64.deb")
|
||||
rk356x_deb+=("rk356x_packages/bullseye/mpv/mpv_0.32.0-3_arm64.deb")
|
||||
|
||||
for deb in ${rk356x_deb[@]}
|
||||
do
|
||||
dpkg_install_deb_chroot "$EXTER/cache/sources/${deb}"
|
||||
done
|
||||
|
||||
chroot $SDCARD /bin/bash -c "sed -i '5aexport LD_PRELOAD=libdrm-cursor.so.1' /usr/bin/X"
|
||||
|
||||
# The chromium using fixed pathes for libv4l2.so
|
||||
chroot $SDCARD /bin/bash -c "ln -rsf /usr/lib/*/libv4l2.so /usr/lib/"
|
||||
chroot $SDCARD /bin/bash -c "[ -e /usr/lib/aarch64-linux-gnu/ ] && ln -Tsf lib /usr/lib64"
|
||||
|
||||
chroot $SDCARD /bin/bash -c "cd /usr/lib/aarch64-linux-gnu/dri/;cp kms_swrast_dri.so swrast_dri.so rockchip_dri.so /"
|
||||
chroot $SDCARD /bin/bash -c "rm /usr/lib/aarch64-linux-gnu/dri/*.so;mv /*.so /usr/lib/aarch64-linux-gnu/dri/"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
*/SKIP
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
if [ ! -x "${ROOTFS_DIR}/usr/bin/qemu-arm-static" ]; then
|
||||
cp /usr/bin/qemu-arm-static "${ROOTFS_DIR}/usr/bin/"
|
||||
fi
|
||||
|
||||
if [ -e "${ROOTFS_DIR}/etc/ld.so.preload" ]; then
|
||||
mv "${ROOTFS_DIR}/etc/ld.so.preload" "${ROOTFS_DIR}/etc/ld.so.preload.disabled"
|
||||
fi
|
||||
|
|
@ -0,0 +1 @@
|
|||
userconf-pi
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
if [[ "${DISABLE_FIRST_BOOT_USER_RENAME}" == "0" ]]; then
|
||||
on_chroot <<- EOF
|
||||
SUDO_USER="${FIRST_USER_NAME}" rename-user -f -s
|
||||
EOF
|
||||
else
|
||||
rm -f "${ROOTFS_DIR}/etc/xdg/autostart/piwiz.desktop"
|
||||
fi
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache"
|
||||
find "${ROOTFS_DIR}/var/lib/apt/lists/" -type f -delete
|
||||
on_chroot << EOF
|
||||
apt-get update
|
||||
apt-get -y dist-upgrade
|
||||
apt-get clean
|
||||
EOF
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
install -m 644 files/resolv.conf "${ROOTFS_DIR}/etc/"
|
||||
|
|
@ -0,0 +1 @@
|
|||
nameserver 8.8.8.8
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#if [ "${NO_PRERUN_QCOW2}" = "0" ]; then
|
||||
#
|
||||
# IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
#
|
||||
# IMGID="$(dd if="${IMG_FILE}" skip=440 bs=1 count=4 2>/dev/null | xxd -e | cut -f 2 -d' ')"
|
||||
#
|
||||
# BOOT_PARTUUID="${IMGID}-01"
|
||||
# ROOT_PARTUUID="${IMGID}-02"
|
||||
#
|
||||
# sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"
|
||||
# sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/etc/fstab"
|
||||
#
|
||||
# sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${ROOTFS_DIR}/boot/cmdline.txt"
|
||||
#
|
||||
#fi
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
#INFO_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.info"
|
||||
|
||||
on_chroot << EOF
|
||||
if [ -x /etc/init.d/fake-hwclock ]; then
|
||||
/etc/init.d/fake-hwclock stop
|
||||
fi
|
||||
if hash hardlink 2>/dev/null; then
|
||||
hardlink -t /usr/share/doc
|
||||
fi
|
||||
EOF
|
||||
|
||||
if [ -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config" ]; then
|
||||
chmod 700 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config"
|
||||
fi
|
||||
|
||||
rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static"
|
||||
|
||||
if [ "${USE_QEMU}" != "1" ]; then
|
||||
if [ -e "${ROOTFS_DIR}/etc/ld.so.preload.disabled" ]; then
|
||||
mv "${ROOTFS_DIR}/etc/ld.so.preload.disabled" "${ROOTFS_DIR}/etc/ld.so.preload"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f "${ROOTFS_DIR}/etc/network/interfaces.dpkg-old"
|
||||
|
||||
rm -f "${ROOTFS_DIR}/etc/apt/sources.list~"
|
||||
rm -f "${ROOTFS_DIR}/etc/apt/trusted.gpg~"
|
||||
|
||||
rm -f "${ROOTFS_DIR}/etc/passwd-"
|
||||
rm -f "${ROOTFS_DIR}/etc/group-"
|
||||
rm -f "${ROOTFS_DIR}/etc/shadow-"
|
||||
rm -f "${ROOTFS_DIR}/etc/gshadow-"
|
||||
rm -f "${ROOTFS_DIR}/etc/subuid-"
|
||||
rm -f "${ROOTFS_DIR}/etc/subgid-"
|
||||
|
||||
rm -f "${ROOTFS_DIR}"/var/cache/debconf/*-old
|
||||
rm -f "${ROOTFS_DIR}"/var/lib/dpkg/*-old
|
||||
|
||||
rm -f "${ROOTFS_DIR}"/usr/share/icons/*/icon-theme.cache
|
||||
|
||||
rm -f "${ROOTFS_DIR}/var/lib/dbus/machine-id"
|
||||
|
||||
true > "${ROOTFS_DIR}/etc/machine-id"
|
||||
|
||||
ln -nsf /proc/mounts "${ROOTFS_DIR}/etc/mtab"
|
||||
|
||||
find "${ROOTFS_DIR}/var/log/" -type f -exec cp /dev/null {} \;
|
||||
|
||||
rm -f "${ROOTFS_DIR}/root/.vnc/private.key"
|
||||
rm -f "${ROOTFS_DIR}/etc/vnc/updateid"
|
||||
|
||||
#update_issue "$(basename "${EXPORT_DIR}")"
|
||||
#install -m 644 "${ROOTFS_DIR}/etc/rpi-issue" "${ROOTFS_DIR}/boot/issue.txt"
|
||||
#
|
||||
#cp "$ROOTFS_DIR/etc/rpi-issue" "$INFO_FILE"
|
||||
|
||||
|
||||
#{
|
||||
# if [ -f "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" ]; then
|
||||
# firmware=$(zgrep "firmware as of" \
|
||||
# "$ROOTFS_DIR/usr/share/doc/raspberrypi-kernel/changelog.Debian.gz" | \
|
||||
# head -n1 | sed -n 's|.* \([^ ]*\)$|\1|p')
|
||||
# printf "\nFirmware: https://github.com/raspberrypi/firmware/tree/%s\n" "$firmware"
|
||||
#
|
||||
# kernel="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/git_hash")"
|
||||
# printf "Kernel: https://github.com/raspberrypi/linux/tree/%s\n" "$kernel"
|
||||
#
|
||||
# uname="$(curl -s -L "https://github.com/raspberrypi/firmware/raw/$firmware/extra/uname_string7")"
|
||||
# printf "Uname string: %s\n" "$uname"
|
||||
# fi
|
||||
#
|
||||
# printf "\nPackages:\n"
|
||||
# dpkg -l --root "$ROOTFS_DIR"
|
||||
#} >> "$INFO_FILE"
|
||||
|
||||
#mkdir -p "${DEPLOY_DIR}"
|
||||
#
|
||||
#rm -f "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.*"
|
||||
#rm -f "${DEPLOY_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
#
|
||||
#mv "$INFO_FILE" "$DEPLOY_DIR/"
|
||||
#
|
||||
#if [ "${USE_QCOW2}" = "0" ] && [ "${NO_PRERUN_QCOW2}" = "0" ]; then
|
||||
# ROOT_DEV="$(mount | grep "${ROOTFS_DIR} " | cut -f1 -d' ')"
|
||||
#
|
||||
# unmount "${ROOTFS_DIR}"
|
||||
# zerofree "${ROOT_DEV}"
|
||||
#
|
||||
# unmount_image "${IMG_FILE}"
|
||||
#else
|
||||
# unload_qimage
|
||||
# make_bootable_image "${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.qcow2" "$IMG_FILE"
|
||||
#fi
|
||||
#
|
||||
#case "${DEPLOY_COMPRESSION}" in
|
||||
#zip)
|
||||
# pushd "${STAGE_WORK_DIR}" > /dev/null
|
||||
# zip -"${COMPRESSION_LEVEL}" \
|
||||
# "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.zip" "$(basename "${IMG_FILE}")"
|
||||
# popd > /dev/null
|
||||
# ;;
|
||||
#gz)
|
||||
# pigz --force -"${COMPRESSION_LEVEL}" "$IMG_FILE" --stdout > \
|
||||
# "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.img.gz"
|
||||
# ;;
|
||||
#xz)
|
||||
# xz --compress --force --threads 0 --memlimit-compress=50% -"${COMPRESSION_LEVEL}" \
|
||||
# --stdout "$IMG_FILE" > "${DEPLOY_DIR}/${ARCHIVE_FILENAME}${IMG_SUFFIX}.img.xz"
|
||||
# ;;
|
||||
#none | *)
|
||||
# cp "$IMG_FILE" "$DEPLOY_DIR/"
|
||||
#;;
|
||||
#esac
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#if [ "${NO_PRERUN_QCOW2}" = "0" ]; then
|
||||
# IMG_FILE="${STAGE_WORK_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||
#
|
||||
# unmount_image "${IMG_FILE}"
|
||||
#
|
||||
# rm -f "${IMG_FILE}"
|
||||
#
|
||||
# rm -rf "${ROOTFS_DIR}"
|
||||
# mkdir -p "${ROOTFS_DIR}"
|
||||
#
|
||||
# BOOT_SIZE="$((256 * 1024 * 1024))"
|
||||
# ROOT_SIZE=$(du --apparent-size -s "${EXPORT_ROOTFS_DIR}" --exclude var/cache/apt/archives --exclude boot --block-size=1 | cut -f 1)
|
||||
#
|
||||
# # All partition sizes and starts will be aligned to this size
|
||||
# ALIGN="$((4 * 1024 * 1024))"
|
||||
# # Add this much space to the calculated file size. This allows for
|
||||
# # some overhead (since actual space usage is usually rounded up to the
|
||||
# # filesystem block size) and gives some free space on the resulting
|
||||
# # image.
|
||||
# ROOT_MARGIN="$(echo "($ROOT_SIZE * 0.2 + 200 * 1024 * 1024) / 1" | bc)"
|
||||
#
|
||||
# BOOT_PART_START=$((ALIGN))
|
||||
# BOOT_PART_SIZE=$(((BOOT_SIZE + ALIGN - 1) / ALIGN * ALIGN))
|
||||
# ROOT_PART_START=$((BOOT_PART_START + BOOT_PART_SIZE))
|
||||
# ROOT_PART_SIZE=$(((ROOT_SIZE + ROOT_MARGIN + ALIGN - 1) / ALIGN * ALIGN))
|
||||
# IMG_SIZE=$((BOOT_PART_START + BOOT_PART_SIZE + ROOT_PART_SIZE))
|
||||
#
|
||||
# truncate -s "${IMG_SIZE}" "${IMG_FILE}"
|
||||
#
|
||||
# parted --script "${IMG_FILE}" mklabel msdos
|
||||
# parted --script "${IMG_FILE}" unit B mkpart primary fat32 "${BOOT_PART_START}" "$((BOOT_PART_START + BOOT_PART_SIZE - 1))"
|
||||
# parted --script "${IMG_FILE}" unit B mkpart primary ext4 "${ROOT_PART_START}" "$((ROOT_PART_START + ROOT_PART_SIZE - 1))"
|
||||
#
|
||||
# echo "Creating loop device..."
|
||||
# cnt=0
|
||||
# until LOOP_DEV="$(losetup --show --find --partscan "$IMG_FILE")"; do
|
||||
# if [ $cnt -lt 5 ]; then
|
||||
# cnt=$((cnt + 1))
|
||||
# echo "Error in losetup. Retrying..."
|
||||
# sleep 5
|
||||
# else
|
||||
# echo "ERROR: losetup failed; exiting"
|
||||
# exit 1
|
||||
# fi
|
||||
# done
|
||||
#
|
||||
# BOOT_DEV="${LOOP_DEV}p1"
|
||||
# ROOT_DEV="${LOOP_DEV}p2"
|
||||
#
|
||||
# ROOT_FEATURES="^huge_file"
|
||||
# for FEATURE in 64bit; do
|
||||
# if grep -q "$FEATURE" /etc/mke2fs.conf; then
|
||||
# ROOT_FEATURES="^$FEATURE,$ROOT_FEATURES"
|
||||
# fi
|
||||
# done
|
||||
# mkdosfs -n bootfs -F 32 -s 4 -v "$BOOT_DEV" > /dev/null
|
||||
# mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null
|
||||
#
|
||||
# mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4
|
||||
# mkdir -p "${ROOTFS_DIR}/boot"
|
||||
# mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot" -t vfat
|
||||
#
|
||||
# rsync -aHAXx --exclude /var/cache/apt/archives --exclude /boot "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
|
||||
# rsync -rtx "${EXPORT_ROOTFS_DIR}/boot/" "${ROOTFS_DIR}/boot/"
|
||||
#fi
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#sed "s/# SKEL=.*/SKEL=\/etc\/skel/" -i "${ROOTFS_DIR}/etc/default/useradd"
|
||||
#
|
||||
#install -d "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d"
|
||||
#install -m 644 files/ttyoutput.conf "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/"
|
||||
#
|
||||
#on_chroot << EOF
|
||||
#systemctl enable regenerate_ssh_host_keys
|
||||
#EOF
|
||||
|
||||
install -m 644 files/hciattach_opi "${ROOTFS_DIR}/usr/bin/"
|
||||
|
||||
Binary file not shown.
106
external/packages/raspi/orangepi/common/files/orangepi-hardware-optimization
vendored
Executable file
106
external/packages/raspi/orangepi/common/files/orangepi-hardware-optimization
vendored
Executable file
|
|
@ -0,0 +1,106 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /etc/orangepi-release
|
||||
|
||||
prepare_board() {
|
||||
|
||||
case ${BOARD} in
|
||||
|
||||
orangepi5|orangepi5b|orangepi5plus|orangepitab|orangepi900)
|
||||
|
||||
[[ $BOARD =~ orangepi5|orangepi5b ]] && echo host > /sys/kernel/debug/usb/fc000000.usb/mode
|
||||
if [[ -c /dev/mpp_service ]]; then
|
||||
chmod 0666 /dev/mpp_service
|
||||
|
||||
{
|
||||
echo "type=dec"
|
||||
echo "codecs=VP8:VP9:H.264:H.265:AV1"
|
||||
echo "max-width=7680"
|
||||
echo "max-height=4320"
|
||||
} > /dev/video-dec0
|
||||
|
||||
# Create dummy video node for chromium V4L2 VDA/VEA with rkmpp plugin
|
||||
echo enc > /dev/video-enc0
|
||||
chmod 0660 /dev/video-*
|
||||
chown root:video /dev/video-*
|
||||
fi
|
||||
bt_status=$(cat /proc/device-tree/wireless-bluetooth/status)
|
||||
wifi_chip=$(cat /proc/device-tree/wireless-wlan/wifi_chip_type)
|
||||
if [[ ${wifi_chip} == "ap6275p" && ${bt_status} == "okay" ]]; then
|
||||
rfkill unblock all
|
||||
brcm_patchram_plus --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 \
|
||||
--baudrate 1500000 --patchram /lib/firmware/ap6275p/BCM4362A2.hcd /dev/ttyS9 &
|
||||
fi
|
||||
;;
|
||||
orangepicm4|orangepi3b)
|
||||
if [[ -c /dev/mpp_service ]]; then
|
||||
chmod 666 /dev/mpp_service
|
||||
|
||||
# Create dummy video node for chromium V4L2 VDA/VEA with rkmpp plugin
|
||||
echo dec > /dev/video-dec0
|
||||
echo enc > /dev/video-enc0
|
||||
chmod 660 /dev/video-*
|
||||
chown root.video /dev/video-*
|
||||
fi
|
||||
|
||||
for p in $(modetest|grep "^Planes:" -A 9999|grep -o "^[0-9]*");
|
||||
do
|
||||
modetest -M rockchip -aw $p:ASYNC_COMMIT:1 &>/dev/null
|
||||
done
|
||||
|
||||
amixer -c 0 cset name='Playback Path' HP > /dev/null 2>&1
|
||||
amixer -c 0 cset name='Capture MIC Path' 'Main Mic' > /dev/null 2>&1
|
||||
|
||||
rfkill unblock all
|
||||
/usr/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd &
|
||||
#rfkill unblock all
|
||||
#brcm_patchram_plus --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 \
|
||||
# --baudrate 1500000 --patchram /lib/firmware/cyw43455/BCM4345C0.hcd /dev/ttyS1 &
|
||||
;;
|
||||
orangepizero2|orangepizero2-lts|orangepizero2-b|orangepizero3|orangepir1b|orangepizero2w)
|
||||
kv=$(uname -r)
|
||||
if [[ $BOARD == orangepir1b ]]; then
|
||||
|
||||
#for 100m interface
|
||||
interface_100m="eth1"
|
||||
echo netdev > /sys/class/leds/100m_act/trigger
|
||||
echo "${interface_100m}" > /sys/class/leds/100m_act/device_name
|
||||
echo 1 > /sys/class/leds/100m_act/tx
|
||||
echo 1 > /sys/class/leds/100m_act/rx
|
||||
|
||||
echo netdev > /sys/class/leds/100m_link/trigger
|
||||
echo ${interface_100m} > /sys/class/leds/100m_link/device_name
|
||||
echo 1 > /sys/class/leds/100m_link/link
|
||||
|
||||
echo netdev > /sys/class/leds/lan_led/trigger
|
||||
echo ${interface_100m} > /sys/class/leds/lan_led/device_name
|
||||
echo 1 > /sys/class/leds/lan_led/link
|
||||
echo 1 > /sys/class/leds/lan_led/tx
|
||||
echo 1 > /sys/class/leds/lan_led/rx
|
||||
|
||||
#for 1000m interface
|
||||
interface_1000m="eth0"
|
||||
echo netdev > /sys/class/leds/wan_led/trigger
|
||||
echo ${interface_1000m} > /sys/class/leds/wan_led/device_name
|
||||
echo 1 > /sys/class/leds/wan_led/link
|
||||
echo 1 > /sys/class/leds/wan_led/tx
|
||||
echo 1 > /sys/class/leds/wan_led/rx
|
||||
|
||||
fi
|
||||
|
||||
if [[ ${kv} == 4.9* ]]; then
|
||||
aplay /usr/share/sounds/alsa/audio.wav -D hw:2,0 > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
rfkill unblock all
|
||||
/usr/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd &
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case $1 in
|
||||
*start*)
|
||||
# hardware preparation
|
||||
prepare_board &
|
||||
;;
|
||||
esac
|
||||
19
external/packages/raspi/orangepi/common/files/orangepi-hardware-optimize.service
vendored
Executable file
19
external/packages/raspi/orangepi/common/files/orangepi-hardware-optimize.service
vendored
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
# Orange Pi hardware optimization service
|
||||
# Apply optimisations
|
||||
# This service may block the boot process for up to 2 minutes
|
||||
|
||||
[Unit]
|
||||
Description=Orange Pi hardware optimization
|
||||
Before=basic.target
|
||||
After=sysinit.target local-fs.target orangepi-hardware-monitor.target
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/lib/orangepi/orangepi-hardware-optimization start
|
||||
ExecStop=/usr/lib/orangepi/orangepi-hardware-optimization stop
|
||||
RemainAfterExit=yes
|
||||
TimeoutStartSec=2min
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
log (){
|
||||
date +"[%T] $*" | tee -a "${LOG_FILE}"
|
||||
}
|
||||
export -f log
|
||||
|
||||
bootstrap(){
|
||||
local BOOTSTRAP_CMD=debootstrap
|
||||
local BOOTSTRAP_ARGS=()
|
||||
|
||||
export http_proxy=${APT_PROXY}
|
||||
|
||||
BOOTSTRAP_ARGS+=(--arch arm64)
|
||||
BOOTSTRAP_ARGS+=(--include gnupg)
|
||||
BOOTSTRAP_ARGS+=(--components "main,contrib,non-free")
|
||||
#BOOTSTRAP_ARGS+=(--keyring "${STAGE_DIR}/files/raspberrypi.gpg")
|
||||
BOOTSTRAP_ARGS+=(--exclude=info)
|
||||
BOOTSTRAP_ARGS+=(--include=ca-certificates)
|
||||
BOOTSTRAP_ARGS+=("$@")
|
||||
printf -v BOOTSTRAP_STR '%q ' "${BOOTSTRAP_ARGS[@]}"
|
||||
|
||||
capsh $CAPSH_ARG -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
|
||||
|
||||
if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then
|
||||
cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}"
|
||||
log "bootstrap failed: please check ${STAGE_WORK_DIR}/debootstrap.log"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
export -f bootstrap
|
||||
|
||||
copy_previous(){
|
||||
if [ ! -d "${PREV_ROOTFS_DIR}" ]; then
|
||||
echo "Previous stage rootfs not found"
|
||||
false
|
||||
fi
|
||||
mkdir -p "${ROOTFS_DIR}"
|
||||
rsync -aHAXx --exclude var/cache/apt/archives "${PREV_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
|
||||
}
|
||||
export -f copy_previous
|
||||
|
||||
unmount(){
|
||||
if [ -z "$1" ]; then
|
||||
DIR=$PWD
|
||||
else
|
||||
DIR=$1
|
||||
fi
|
||||
|
||||
while mount | grep -q "$DIR"; do
|
||||
local LOCS
|
||||
LOCS=$(mount | grep "$DIR" | cut -f 3 -d ' ' | sort -r)
|
||||
for loc in $LOCS; do
|
||||
umount "$loc"
|
||||
done
|
||||
done
|
||||
}
|
||||
export -f unmount
|
||||
|
||||
unmount_image(){
|
||||
sync
|
||||
sleep 1
|
||||
LOOP_DEVICE=$(losetup --list | grep "$1" | cut -f1 -d' ')
|
||||
if [ -n "$LOOP_DEVICE" ]; then
|
||||
for part in "$LOOP_DEVICE"p*; do
|
||||
if DIR=$(findmnt -n -o target -S "$part"); then
|
||||
unmount "$DIR"
|
||||
fi
|
||||
done
|
||||
losetup -d "$LOOP_DEVICE"
|
||||
fi
|
||||
}
|
||||
export -f unmount_image
|
||||
|
||||
on_chroot() {
|
||||
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/proc)"; then
|
||||
mount -t proc proc "${ROOTFS_DIR}/proc"
|
||||
fi
|
||||
|
||||
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/dev)"; then
|
||||
mount --bind /dev "${ROOTFS_DIR}/dev"
|
||||
fi
|
||||
|
||||
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/dev/pts)"; then
|
||||
mount --bind /dev/pts "${ROOTFS_DIR}/dev/pts"
|
||||
fi
|
||||
|
||||
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/sys)"; then
|
||||
mount --bind /sys "${ROOTFS_DIR}/sys"
|
||||
fi
|
||||
|
||||
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/run)"; then
|
||||
mount -t tmpfs tmpfs "${ROOTFS_DIR}/run"
|
||||
fi
|
||||
|
||||
if ! mount | grep -q "$(realpath "${ROOTFS_DIR}"/tmp)"; then
|
||||
mount -t tmpfs tmpfs "${ROOTFS_DIR}/tmp"
|
||||
fi
|
||||
|
||||
capsh $CAPSH_ARG "--chroot=${ROOTFS_DIR}/" -- -e "$@"
|
||||
}
|
||||
export -f on_chroot
|
||||
|
||||
update_issue() {
|
||||
echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue"
|
||||
}
|
||||
export -f update_issue
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
# dependencies_check
|
||||
# $@ Dependency files to check
|
||||
#
|
||||
# Each dependency is in the form of a tool to test for, optionally followed by
|
||||
# a : and the name of a package if the package on a Debian-ish system is not
|
||||
# named for the tool (i.e., qemu-user-static).
|
||||
dependencies_check()
|
||||
{
|
||||
local depfile deps missing
|
||||
|
||||
for depfile in "$@"; do
|
||||
if [[ -e "$depfile" ]]; then
|
||||
deps="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${BASE_DIR}/depends")"
|
||||
|
||||
fi
|
||||
for dep in $deps; do
|
||||
if ! hash "${dep%:*}" 2>/dev/null; then
|
||||
missing="${missing:+$missing }${dep#*:}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [[ "$missing" ]]; then
|
||||
echo "Required dependencies not installed"
|
||||
echo
|
||||
echo "This can be resolved on Debian/Raspbian systems by installing:"
|
||||
echo "$missing"
|
||||
false
|
||||
fi
|
||||
|
||||
# If we're building on a native arm platform, we don't need to check for
|
||||
# binfmt_misc or require it to be loaded.
|
||||
|
||||
binfmt_misc_required=1
|
||||
|
||||
case $(uname -m) in
|
||||
aarch64)
|
||||
binfmt_misc_required=0
|
||||
;;
|
||||
arm*)
|
||||
binfmt_misc_required=0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "${binfmt_misc_required}" == "1" ]]; then
|
||||
if ! grep -q "/proc/sys/fs/binfmt_misc" /proc/mounts; then
|
||||
echo "Module binfmt_misc not loaded in host"
|
||||
echo "Please run:"
|
||||
echo " sudo modprobe binfmt_misc"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
#!/bin/bash
|
||||
|
||||
# QCOW2 Routines
|
||||
|
||||
export CURRENT_IMAGE
|
||||
export CURRENT_MOUNTPOINT
|
||||
|
||||
export NBD_DEV
|
||||
export MAP_BOOT_DEV
|
||||
export MAP_ROOT_DEV
|
||||
|
||||
# set in build.sh
|
||||
# should be fairly enough for the beginning
|
||||
# overwrite here by uncommenting following lines
|
||||
# BASE_QCOW2_SIZE=12G
|
||||
|
||||
# find and initialize free block device nodes
|
||||
init_nbd() {
|
||||
modprobe nbd max_part=16
|
||||
if [ -z "${NBD_DEV}" ]; then
|
||||
for x in /sys/class/block/nbd* ; do
|
||||
S=`cat $x/size`
|
||||
if [ "$S" == "0" ] ; then
|
||||
NBD_DEV=/dev/$(basename $x)
|
||||
MAP_BOOT_DEV=/dev/mapper/$(basename $x)p1
|
||||
MAP_ROOT_DEV=/dev/mapper/$(basename $x)p2
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
export -f init_nbd
|
||||
|
||||
# connect image to block device
|
||||
connect_blkdev() {
|
||||
init_nbd
|
||||
qemu-nbd --discard=unmap -c $NBD_DEV "$1"
|
||||
sync
|
||||
kpartx -as $NBD_DEV
|
||||
sync
|
||||
CURRENT_IMAGE="$1"
|
||||
}
|
||||
export -f connect_blkdev
|
||||
|
||||
# disconnect image from block device
|
||||
disconnect_blkdev() {
|
||||
kpartx -d $NBD_DEV
|
||||
qemu-nbd -d $NBD_DEV
|
||||
NBD_DEV=
|
||||
MAP_BOOT_DEV=
|
||||
MAP_ROOT_DEV=
|
||||
CURRENT_IMAGE=
|
||||
}
|
||||
export -f disconnect_blkdev
|
||||
|
||||
# mount qcow2 image: mount_image <image file> <mountpoint>
|
||||
mount_qimage() {
|
||||
connect_blkdev "$1"
|
||||
mount -v -t ext4 $MAP_ROOT_DEV "$2"
|
||||
mkdir -p "${ROOTFS_DIR}/boot"
|
||||
mount -v -t vfat $MAP_BOOT_DEV "$2/boot"
|
||||
CURRENT_MOUNTPOINT="$2"
|
||||
}
|
||||
export -f mount_qimage
|
||||
|
||||
# umount qcow2 image: umount_image <current mountpoint>
|
||||
umount_qimage() {
|
||||
sync
|
||||
#umount "$1/boot"
|
||||
while mount | grep -q "$1"; do
|
||||
local LOCS
|
||||
LOCS=$(mount | grep "$1" | cut -f 3 -d ' ' | sort -r)
|
||||
for loc in $LOCS; do
|
||||
echo "$loc"
|
||||
while mountpoint -q "$loc" && ! umount "$loc"; do
|
||||
sleep 0.1
|
||||
done
|
||||
done
|
||||
done
|
||||
CURRENT_MOUNTPOINT=
|
||||
disconnect_blkdev
|
||||
}
|
||||
export -f umount_qimage
|
||||
|
||||
# create base image / backing image / mount image
|
||||
load_qimage() {
|
||||
if [ -z "${CURRENT_MOUNTPOINT}" ]; then
|
||||
if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
mkdir -p "${ROOTFS_DIR}";
|
||||
fi
|
||||
|
||||
if [ "${CLEAN}" = "1" ] && [ -f "${WORK_DIR}/image-${STAGE}.qcow2" ]; then
|
||||
rm -f "${WORK_DIR}/image-${STAGE}.qcow2";
|
||||
fi
|
||||
|
||||
if [ ! -f "${WORK_DIR}/image-${STAGE}.qcow2" ]; then
|
||||
pushd ${WORK_DIR} > /dev/null
|
||||
init_nbd
|
||||
if [ -z "${PREV_STAGE}" ]; then
|
||||
echo "Creating base image: image-${STAGE}.qcow2"
|
||||
# -o preallocation=falloc
|
||||
qemu-img create -f qcow2 image-${STAGE}.qcow2 $BASE_QCOW2_SIZE
|
||||
sync
|
||||
qemu-nbd --discard=unmap -c $NBD_DEV image-${STAGE}.qcow2
|
||||
sync
|
||||
sfdisk $NBD_DEV << EOF
|
||||
4MiB,250MiB,c,*
|
||||
254MiB,,83;
|
||||
EOF
|
||||
sync
|
||||
kpartx -as $NBD_DEV
|
||||
mkdosfs -n boot -F 32 -s 4 -v $MAP_BOOT_DEV
|
||||
mkfs.ext4 -L rootfs -O "^huge_file,^64bit" $MAP_ROOT_DEV
|
||||
sync
|
||||
else
|
||||
if [ ! -f "${WORK_DIR}/image-${PREV_STAGE}.qcow2" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
echo "Creating backing image: image-${STAGE}.qcow2 <- ${WORK_DIR}/image-${PREV_STAGE}.qcow2"
|
||||
qemu-img create -f qcow2 \
|
||||
-o backing_file=${WORK_DIR}/image-${PREV_STAGE}.qcow2 \
|
||||
${WORK_DIR}/image-${STAGE}.qcow2
|
||||
sync
|
||||
qemu-nbd --discard=unmap -c $NBD_DEV image-${STAGE}.qcow2
|
||||
sync
|
||||
kpartx -as $NBD_DEV
|
||||
fi
|
||||
|
||||
mount -v -t ext4 $MAP_ROOT_DEV "${ROOTFS_DIR}"
|
||||
mkdir -p "${ROOTFS_DIR}/boot"
|
||||
mount -v -t vfat $MAP_BOOT_DEV "${ROOTFS_DIR}/boot"
|
||||
CURRENT_IMAGE=${WORK_DIR}/image-${STAGE}.qcow2
|
||||
CURRENT_MOUNTPOINT=${ROOTFS_DIR}
|
||||
popd > /dev/null
|
||||
else
|
||||
mount_qimage "${WORK_DIR}/image-${STAGE}.qcow2" "${ROOTFS_DIR}"
|
||||
fi
|
||||
echo "Current image in use: ${CURRENT_IMAGE} (MP: ${CURRENT_MOUNTPOINT})"
|
||||
fi
|
||||
}
|
||||
export -f load_qimage
|
||||
|
||||
# umount current image and refresh mount point env var
|
||||
unload_qimage() {
|
||||
if [ ! -z "${CURRENT_MOUNTPOINT}" ]; then
|
||||
fstrim -v "${CURRENT_MOUNTPOINT}" || true
|
||||
umount_qimage "${CURRENT_MOUNTPOINT}"
|
||||
fi
|
||||
}
|
||||
export -f unload_qimage
|
||||
|
||||
# based on: https://github.com/SirLagz/RaspberryPi-ImgAutoSizer
|
||||
# helper function for make_bootable_image, do not call directly
|
||||
function resize_qcow2() {
|
||||
if [ -z "$CALL_FROM_MBI" ]; then
|
||||
echo "resize_qcow2: cannot be called directly, use make_bootable_image instead"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# ROOT_MARGIN=$((800*1024*1024))
|
||||
ROOT_MARGIN=$((1*1024*1024))
|
||||
PARTED_OUT=`parted -s -m "$NBD_DEV" unit B print`
|
||||
PART_NO=`echo "$PARTED_OUT" | grep ext4 | awk -F: ' { print $1 } '`
|
||||
PART_START=`echo "$PARTED_OUT" | grep ext4 | awk -F: ' { print substr($2,1,length($2)-1) } '`
|
||||
|
||||
e2fsck -y -f $MAP_ROOT_DEV || true
|
||||
|
||||
DATA_SIZE=`resize2fs -P $MAP_ROOT_DEV | awk -F': ' ' { print $2 } '`
|
||||
BLOCK_SIZE=$(dumpe2fs -h $MAP_ROOT_DEV | grep 'Block size' | awk -F': ' ' { print $2 }')
|
||||
BLOCK_SIZE=${BLOCK_SIZE// /}
|
||||
|
||||
let DATA_SIZE=$DATA_SIZE+$ROOT_MARGIN/$BLOCK_SIZE
|
||||
resize2fs -p $MAP_ROOT_DEV $DATA_SIZE
|
||||
sleep 1
|
||||
|
||||
let PART_NEW_SIZE=$DATA_SIZE*$BLOCK_SIZE
|
||||
let PART_NEW_END=$PART_START+$PART_NEW_SIZE
|
||||
ACT1=`parted -s "$NBD_DEV" rm 2`
|
||||
ACT2=`parted -s "$NBD_DEV" unit B mkpart primary $PART_START $PART_NEW_END`
|
||||
NEW_IMG_SIZE=`parted -s -m "$NBD_DEV" unit B print free | tail -1 | awk -F: ' { print substr($2,1,length($2)-1) } '`
|
||||
}
|
||||
export -f resize_qcow2
|
||||
|
||||
# create raw img from qcow2: make_bootable_image <in.qcow2> <out.img>
|
||||
function make_bootable_image() {
|
||||
|
||||
EXPORT_QCOW2="$1"
|
||||
EXPORT_IMAGE="$2"
|
||||
|
||||
echo "Connect block device to source qcow2"
|
||||
connect_blkdev "${EXPORT_QCOW2}"
|
||||
|
||||
echo "Resize fs and partition"
|
||||
CALL_FROM_MBI=1
|
||||
resize_qcow2
|
||||
sync
|
||||
CALL_FROM_MBI=
|
||||
|
||||
echo "Disconnect block device"
|
||||
disconnect_blkdev
|
||||
|
||||
if [ -z "$NEW_IMG_SIZE" ]; then
|
||||
echo "NEW_IMG_SIZE could not be calculated, cannot process image. Exit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Shrinking qcow2 image"
|
||||
qemu-img resize --shrink "${EXPORT_QCOW2}" $NEW_IMG_SIZE
|
||||
sync
|
||||
|
||||
echo "Convert qcow2 to raw image"
|
||||
qemu-img convert -f qcow2 -O raw "${EXPORT_QCOW2}" "${EXPORT_IMAGE}"
|
||||
sync
|
||||
|
||||
echo "Get PARTUUIDs from image"
|
||||
IMGID="$(blkid -o value -s PTUUID "${EXPORT_IMAGE}")"
|
||||
|
||||
BOOT_PARTUUID="${IMGID}-01"
|
||||
echo "Boot: $BOOT_PARTUUID"
|
||||
ROOT_PARTUUID="${IMGID}-02"
|
||||
echo "Root: $ROOT_PARTUUID"
|
||||
|
||||
echo "Mount image"
|
||||
MOUNTROOT=${WORK_DIR}/tmpimage
|
||||
mkdir -p $MOUNTROOT
|
||||
|
||||
MOUNTPT=$MOUNTROOT
|
||||
PARTITION=2
|
||||
mount "${EXPORT_IMAGE}" "$MOUNTPT" -o loop,offset=$[ `/sbin/sfdisk -d "${EXPORT_IMAGE}" | grep "start=" | head -n $PARTITION | tail -n1 | sed 's/.*start=[ ]*//' | sed 's/,.*//'` * 512 ],sizelimit=$[ `/sbin/sfdisk -d "${EXPORT_IMAGE}" | grep "start=" | head -n $PARTITION | tail -n1 | sed 's/.*size=[ ]*//' | sed 's/,.*//'` * 512 ] || exit 1
|
||||
|
||||
MOUNTPT=$MOUNTROOT/boot
|
||||
PARTITION=1
|
||||
mount "${EXPORT_IMAGE}" "$MOUNTPT" -o loop,offset=$[ `/sbin/sfdisk -d "${EXPORT_IMAGE}" | grep "start=" | head -n $PARTITION | tail -n1 | sed 's/.*start=[ ]*//' | sed 's/,.*//'` * 512 ],sizelimit=$[ `/sbin/sfdisk -d "${EXPORT_IMAGE}" | grep "start=" | head -n $PARTITION | tail -n1 | sed 's/.*size=[ ]*//' | sed 's/,.*//'` * 512 ] || exit 1
|
||||
|
||||
if [ ! -d "${MOUNTROOT}/root" ]; then
|
||||
echo "Image damaged or not mounted. Exit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Setup PARTUUIDs"
|
||||
if [ ! -z "$BOOT_PARTUUID" ] && [ ! -z "$ROOT_PARTUUID" ]; then
|
||||
echo "Set UUIDs to make it bootable"
|
||||
sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" "${MOUNTROOT}/etc/fstab"
|
||||
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${MOUNTROOT}/etc/fstab"
|
||||
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" "${MOUNTROOT}/boot/cmdline.txt"
|
||||
fi
|
||||
|
||||
echo "Umount image"
|
||||
sync
|
||||
umount "${MOUNTROOT}/boot" || exit 1
|
||||
umount "${MOUNTROOT}" || exit 1
|
||||
|
||||
echo "Remove qcow2 export image"
|
||||
rm -f "${EXPORT_QCOW2}"
|
||||
}
|
||||
export -f make_bootable_image
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Deletes comments and collapses whitespace in ##-packages files
|
||||
|
||||
# Append (N)ext line to buffer
|
||||
# if (!)not ($)buffer is EOF, (b)ranch to (:)label loop
|
||||
:loop
|
||||
N
|
||||
$ !b loop
|
||||
|
||||
# Buffer is "line1\nline2\n...lineN", del comments and collapse whitespace
|
||||
s/#[^\n]*//g
|
||||
s/[[:space:]]\{1,\}/ /g
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
|
||||
install -m 644 files/sources.list "${ROOTFS_DIR}/etc/apt/"
|
||||
install -m 644 files/raspi.list "${ROOTFS_DIR}/etc/apt/sources.list.d/"
|
||||
sed -i "s/RELEASE/bullseye/g" "${ROOTFS_DIR}/etc/apt/sources.list"
|
||||
sed -i "s/RELEASE/bullseye/g" "${ROOTFS_DIR}/etc/apt/sources.list.d/raspi.list"
|
||||
|
||||
if [ -n "$APT_PROXY" ]; then
|
||||
install -m 644 files/51cache "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache"
|
||||
sed "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache" -i -e "s|APT_PROXY|${APT_PROXY}|"
|
||||
else
|
||||
rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache"
|
||||
fi
|
||||
|
||||
cat files/raspberrypi.gpg.key | gpg --dearmor > "${ROOTFS_DIR}/raspberrypi-archive-stable.gpg"
|
||||
install -m 644 "${ROOTFS_DIR}/raspberrypi-archive-stable.gpg" "${ROOTFS_DIR}/etc/apt/trusted.gpg.d/"
|
||||
rm "${ROOTFS_DIR}/raspberrypi-archive-stable.gpg"
|
||||
|
||||
on_chroot << EOF
|
||||
dpkg --add-architecture armhf
|
||||
apt-get update
|
||||
apt-get dist-upgrade -y
|
||||
EOF
|
||||
|
|
@ -0,0 +1 @@
|
|||
raspberrypi-archive-keyring
|
||||
|
|
@ -0,0 +1 @@
|
|||
Acquire::http { Proxy "APT_PROXY"; };
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.12 (GNU/Linux)
|
||||
|
||||
mQENBE/d7o8BCACrwqQacGJfn3tnMzGui6mv2lLxYbsOuy/+U4rqMmGEuo3h9m92
|
||||
30E2EtypsoWczkBretzLUCFv+VUOxaA6sV9+puTqYGhhQZFuKUWcG7orf7QbZRuu
|
||||
TxsEUepW5lg7MExmAu1JJzqM0kMQX8fVyWVDkjchZ/is4q3BPOUCJbUJOsE+kK/6
|
||||
8kW6nWdhwSAjfDh06bA5wvoXNjYoDdnSZyVdcYCPEJXEg5jfF/+nmiFKMZBraHwn
|
||||
eQsepr7rBXxNcEvDlSOPal11fg90KXpy7Umre1UcAZYJdQeWcHu7X5uoJx/MG5J8
|
||||
ic6CwYmDaShIFa92f8qmFcna05+lppk76fsnABEBAAG0IFJhc3BiZXJyeSBQaSBB
|
||||
cmNoaXZlIFNpZ25pbmcgS2V5iQE4BBMBAgAiBQJP3e6PAhsDBgsJCAcDAgYVCAIJ
|
||||
CgsEFgIDAQIeAQIXgAAKCRCCsSmSf6MwPk6vB/9pePB3IukU9WC9Bammh3mpQTvL
|
||||
OifbkzHkmAYxzjfK6D2I8pT0xMxy949+ThzJ7uL60p6T/32ED9DR3LHIMXZvKtuc
|
||||
mQnSiNDX03E2p7lIP/htoxW2hDP2n8cdlNdt0M9IjaWBppsbO7IrDppG2B1aRLni
|
||||
uD7v8bHRL2mKTtIDLX42Enl8aLAkJYgNWpZyPkDyOqamjijarIWjGEPCkaURF7g4
|
||||
d44HvYhpbLMOrz1m6N5Bzoa5+nq3lmifeiWKxioFXU+Hy5bhtAM6ljVb59hbD2ra
|
||||
X4+3LXC9oox2flmQnyqwoyfZqVgSQa0B41qEQo8t1bz6Q1Ti7fbMLThmbRHiuQEN
|
||||
BE/d7o8BCADNlVtBZU63fm79SjHh5AEKFs0C3kwa0mOhp9oas/haDggmhiXdzeD3
|
||||
49JWz9ZTx+vlTq0s+I+nIR1a+q+GL+hxYt4HhxoA6vlDMegVfvZKzqTX9Nr2VqQa
|
||||
S4Kz3W5ULv81tw3WowK6i0L7pqDmvDqgm73mMbbxfHD0SyTt8+fk7qX6Ag2pZ4a9
|
||||
ZdJGxvASkh0McGpbYJhk1WYD+eh4fqH3IaeJi6xtNoRdc5YXuzILnp+KaJyPE5CR
|
||||
qUY5JibOD3qR7zDjP0ueP93jLqmoKltCdN5+yYEExtSwz5lXniiYOJp8LWFCgv5h
|
||||
m8aYXkcJS1xVV9Ltno23YvX5edw9QY4hABEBAAGJAR8EGAECAAkFAk/d7o8CGwwA
|
||||
CgkQgrEpkn+jMD5Figf/dIC1qtDMTbu5IsI5uZPX63xydaExQNYf98cq5H2fWF6O
|
||||
yVR7ERzA2w33hI0yZQrqO6pU9SRnHRxCFvGv6y+mXXXMRcmjZG7GiD6tQWeN/3wb
|
||||
EbAn5cg6CJ/Lk/BI4iRRfBX07LbYULCohlGkwBOkRo10T+Ld4vCCnBftCh5x2OtZ
|
||||
TOWRULxP36y2PLGVNF+q9pho98qx+RIxvpofQM/842ZycjPJvzgVQsW4LT91KYAE
|
||||
4TVf6JjwUM6HZDoiNcX6d7zOhNfQihXTsniZZ6rky287htsWVDNkqOi5T3oTxWUo
|
||||
m++/7s3K3L0zWopdhMVcgg6Nt9gcjzqN1c0gy55L/g==
|
||||
=mNSj
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ RELEASE main
|
||||
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
|
||||
#deb-src http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ RELEASE main
|
||||
|
||||
#deb http://archive.raspberrypi.org/debian/ RELEASE main
|
||||
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
|
||||
#deb-src http://archive.raspberrypi.org/debian/ RELEASE main
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
deb http://mirrors.ustc.edu.cn/debian RELEASE main contrib non-free
|
||||
deb http://mirrors.ustc.edu.cn/debian-security RELEASE-security main contrib non-free
|
||||
deb http://mirrors.ustc.edu.cn/debian/ RELEASE-updates main contrib non-free
|
||||
# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
|
||||
#deb-src http://mirrors.ustc.edu.cn/debian RELEASE main contrib non-free
|
||||
#deb-src http://mirrors.ustc.edu.cn/debian-security RELEASE-security main contrib non-free
|
||||
#deb-src http://mirrors.ustc.edu.cn/debian RELEASE-updates main contrib non-free
|
||||
|
||||
#deb http://deb.debian.org/debian RELEASE main contrib non-free
|
||||
#deb http://security.debian.org/debian-security RELEASE-security main contrib non-free
|
||||
#deb http://deb.debian.org/debian RELEASE-updates main contrib non-free
|
||||
## Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
|
||||
##deb-src http://deb.debian.org/debian RELEASE main contrib non-free
|
||||
##deb-src http://security.debian.org/debian-security RELEASE-security main contrib non-free
|
||||
##deb-src http://deb.debian.org/debian RELEASE-updates main contrib non-free
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
locales
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
raspberrypi-bootloader
|
||||
raspberrypi-kernel
|
||||
u-boot-tools
|
||||
initramfs-tools
|
||||
Binary file not shown.
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
if [ "$RELEASE" != "raspi" ]; then
|
||||
echo "WARNING: RELEASE does not match the intended option for this branch."
|
||||
echo " Please check the relevant README.md section."
|
||||
fi
|
||||
|
||||
#if [ ! -d "${ROOTFS_DIR}" ] || [ "${USE_QCOW2}" = "1" ]; then
|
||||
# bootstrap ${RELEASE} "${ROOTFS_DIR}" https://mirrors.ustc.edu.cn/debian/
|
||||
# #bootstrap ${RELEASE} "${ROOTFS_DIR}" http://deb.debian.org/debian/
|
||||
#fi
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#install -m 644 files/cmdline.txt "${ROOTFS_DIR}/boot/"
|
||||
#install -m 644 files/config.txt "${ROOTFS_DIR}/boot/"
|
||||
|
|
@ -0,0 +1 @@
|
|||
console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 fsck.repair=yes rootwait
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
# For more options and information see
|
||||
# http://rpf.io/configtxt
|
||||
# Some settings may impact device functionality. See link above for details
|
||||
|
||||
# uncomment if you get no picture on HDMI for a default "safe" mode
|
||||
#hdmi_safe=1
|
||||
|
||||
# uncomment the following to adjust overscan. Use positive numbers if console
|
||||
# goes off screen, and negative if there is too much border
|
||||
#overscan_left=16
|
||||
#overscan_right=16
|
||||
#overscan_top=16
|
||||
#overscan_bottom=16
|
||||
|
||||
# uncomment to force a console size. By default it will be display's size minus
|
||||
# overscan.
|
||||
#framebuffer_width=1280
|
||||
#framebuffer_height=720
|
||||
|
||||
# uncomment if hdmi display is not detected and composite is being output
|
||||
#hdmi_force_hotplug=1
|
||||
|
||||
# uncomment to force a specific HDMI mode (this will force VGA)
|
||||
#hdmi_group=1
|
||||
#hdmi_mode=1
|
||||
|
||||
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
|
||||
# DMT (computer monitor) modes
|
||||
#hdmi_drive=2
|
||||
|
||||
# uncomment to increase signal to HDMI, if you have interference, blanking, or
|
||||
# no display
|
||||
#config_hdmi_boost=4
|
||||
|
||||
# uncomment for composite PAL
|
||||
#sdtv_mode=2
|
||||
|
||||
#uncomment to overclock the arm. 700 MHz is the default.
|
||||
#arm_freq=800
|
||||
|
||||
# Uncomment some or all of these to enable the optional hardware interfaces
|
||||
#dtparam=i2c_arm=on
|
||||
#dtparam=i2s=on
|
||||
#dtparam=spi=on
|
||||
|
||||
# Uncomment this to enable infrared communication.
|
||||
#dtoverlay=gpio-ir,gpio_pin=17
|
||||
#dtoverlay=gpio-ir-tx,gpio_pin=18
|
||||
|
||||
# Additional overlays and parameters are documented /boot/overlays/README
|
||||
|
||||
# Enable audio (loads snd_bcm2835)
|
||||
dtparam=audio=on
|
||||
|
||||
# Automatically load overlays for detected cameras
|
||||
camera_auto_detect=1
|
||||
|
||||
# Automatically load overlays for detected DSI displays
|
||||
display_auto_detect=1
|
||||
|
||||
# Enable DRM VC4 V3D driver
|
||||
dtoverlay=vc4-kms-v3d
|
||||
max_framebuffers=2
|
||||
|
||||
# Run in 64-bit mode
|
||||
arm_64bit=1
|
||||
|
||||
# Disable compensation for displays with overscan
|
||||
disable_overscan=1
|
||||
|
||||
[cm4]
|
||||
# Enable host mode on the 2711 built-in XHCI USB controller.
|
||||
# This line should be removed if the legacy DWC2 controller is required
|
||||
# (e.g. for USB device mode) or if USB support is not required.
|
||||
otg_mode=1
|
||||
|
||||
[all]
|
||||
|
||||
[pi4]
|
||||
# Run as fast as firmware / board allows
|
||||
arm_boost=1
|
||||
|
||||
[all]
|
||||
|
|
@ -0,0 +1 @@
|
|||
/home/test/orangepi-build/output/raspi/01-sys-tweaks-pc
|
||||
|
|
@ -0,0 +1 @@
|
|||
raspi-config
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
--- a/rootfs/etc/skel/.bashrc
|
||||
+++ b/rootfs/etc/skel/.bashrc
|
||||
@@ -43,7 +43,7 @@
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
-#force_color_prompt=yes
|
||||
+force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
@@ -57,7 +57,7 @@
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
@@ -79,9 +79,9 @@
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
- #alias grep='grep --color=auto'
|
||||
- #alias fgrep='fgrep --color=auto'
|
||||
- #alias egrep='egrep --color=auto'
|
||||
+ alias grep='grep --color=auto'
|
||||
+ alias fgrep='fgrep --color=auto'
|
||||
+ alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
|
|
@ -0,0 +1 @@
|
|||
01-bashrc.diff
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# 00-patches
|
||||
|
||||
## 01-bashrc.diff
|
||||
install -v -m 644 files/.bashrc "${ROOTFS_DIR}/etc/skel/"
|
||||
|
||||
# 00-patches
|
||||
|
||||
install -d "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d"
|
||||
install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf"
|
||||
install -v -m 644 files/fstab "${ROOTFS_DIR}/etc/fstab"
|
||||
|
||||
on_chroot << EOF
|
||||
if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then
|
||||
adduser --disabled-password --gecos "" ${FIRST_USER_NAME}
|
||||
fi
|
||||
|
||||
if [ -n "${FIRST_USER_PASS}" ]; then
|
||||
echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd
|
||||
fi
|
||||
echo "root:root" | chpasswd
|
||||
EOF
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||
# for examples
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color|*-256color) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# some more ls aliases
|
||||
#alias ll='ls -l'
|
||||
#alias la='ls -A'
|
||||
#alias l='ls -CF'
|
||||
|
||||
# Alias definitions.
|
||||
# You may want to put all your additions into a separate file like
|
||||
# ~/.bash_aliases, instead of adding them here directly.
|
||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
proc /proc proc defaults 0 0
|
||||
BOOTDEV /boot vfat defaults 0 2
|
||||
ROOTDEV / ext4 defaults,noatime 0 1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[Service]
|
||||
TTYVTDisallocate=no
|
||||
|
|
@ -0,0 +1 @@
|
|||
netbase
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
echo "${TARGET_HOSTNAME}" > "${ROOTFS_DIR}/etc/hostname"
|
||||
echo "127.0.1.1 ${TARGET_HOSTNAME}" >> "${ROOTFS_DIR}/etc/hosts"
|
||||
|
||||
on_chroot << EOF
|
||||
SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_net_names 1
|
||||
EOF
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
libraspberrypi-bin libraspberrypi0
|
||||
systemd-timesyncd
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
# copy_previous
|
||||
#fi
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,35 @@
|
|||
ssh less fbset sudo psmisc strace ed ncdu crda
|
||||
console-setup keyboard-configuration debconf-utils parted
|
||||
build-essential manpages-dev bash-completion gdb pkg-config
|
||||
python-is-python3
|
||||
python3-rpi.gpio v4l-utils
|
||||
python3-gpiozero
|
||||
avahi-daemon
|
||||
lua5.1
|
||||
luajit
|
||||
hardlink ca-certificates curl
|
||||
fake-hwclock nfs-common usbutils
|
||||
libraspberrypi-dev libraspberrypi-doc libfreetype6-dev
|
||||
dosfstools
|
||||
dphys-swapfile
|
||||
raspberrypi-sys-mods
|
||||
pi-bluetooth
|
||||
apt-listchanges
|
||||
usb-modeswitch
|
||||
libpam-chksshpwd
|
||||
rpi-update
|
||||
libmtp-runtime
|
||||
rsync
|
||||
htop
|
||||
man-db
|
||||
policykit-1
|
||||
ssh-import-id
|
||||
rng-tools
|
||||
ethtool
|
||||
ntfs-3g
|
||||
pciutils
|
||||
raspinfo
|
||||
udisks2
|
||||
unzip zip p7zip-full
|
||||
file
|
||||
kms++-utils
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
cifs-utils
|
||||
libcamera-apps-lite
|
||||
mkvtoolnix
|
||||
python3-picamera2
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
Index: jessie-stage2/rootfs/etc/default/useradd
|
||||
===================================================================
|
||||
--- jessie-stage2.orig/rootfs/etc/default/useradd
|
||||
+++ jessie-stage2/rootfs/etc/default/useradd
|
||||
@@ -5,7 +5,7 @@
|
||||
# Similar to DHSELL in adduser. However, we use "sh" here because
|
||||
# useradd is a low level utility and should be as general
|
||||
# as possible
|
||||
-SHELL=/bin/sh
|
||||
+SHELL=/bin/bash
|
||||
#
|
||||
# The default group for users
|
||||
# 100=users on Debian systems
|
||||
@@ -29,7 +29,7 @@ SHELL=/bin/sh
|
||||
# The SKEL variable specifies the directory containing "skeletal" user
|
||||
# files; in other words, files such as a sample .profile that will be
|
||||
# copied to the new user's home directory when it is created.
|
||||
-# SKEL=/etc/skel
|
||||
+SKEL=/etc/skel
|
||||
#
|
||||
# Defines whether the mail spool should be created while
|
||||
# creating the account
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
Index: jessie-stage2/rootfs/etc/dphys-swapfile
|
||||
===================================================================
|
||||
--- jessie-stage2.orig/rootfs/etc/dphys-swapfile
|
||||
+++ jessie-stage2/rootfs/etc/dphys-swapfile
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
# set size to absolute value, leaving empty (default) then uses computed value
|
||||
# you most likely don't want this, unless you have an special disk situation
|
||||
-#CONF_SWAPSIZE=
|
||||
+CONF_SWAPSIZE=100
|
||||
|
||||
# set size to computed value, this times RAM size, dynamically adapts,
|
||||
# guarantees that there is enough swap without wasting disk space on excess
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
Index: jessie-stage2/rootfs/etc/inputrc
|
||||
===================================================================
|
||||
--- jessie-stage2.orig/rootfs/etc/inputrc
|
||||
+++ jessie-stage2/rootfs/etc/inputrc
|
||||
@@ -65,3 +65,7 @@ $endif
|
||||
# "\e[F": end-of-line
|
||||
|
||||
$endif
|
||||
+
|
||||
+# mappings for up and down arrows search history
|
||||
+# "\e[B": history-search-forward
|
||||
+# "\e[A": history-search-backward
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
Index: jessie-stage2/rootfs/etc/login.defs
|
||||
===================================================================
|
||||
--- jessie-stage2.orig/rootfs/etc/login.defs
|
||||
+++ jessie-stage2/rootfs/etc/login.defs
|
||||
@@ -100,7 +100,7 @@ HUSHLOGIN_FILE .hushlogin
|
||||
#
|
||||
# (they are minimal, add the rest in the shell startup files)
|
||||
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
-ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
|
||||
+ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
|
||||
|
||||
#
|
||||
# Terminal permissions
|
||||
Index: jessie-stage2/rootfs/etc/profile
|
||||
===================================================================
|
||||
--- jessie-stage2.orig/rootfs/etc/profile
|
||||
+++ jessie-stage2/rootfs/etc/profile
|
||||
@@ -4,7 +4,7 @@
|
||||
if [ "`id -u`" -eq 0 ]; then
|
||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
else
|
||||
- PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
|
||||
+ PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
|
||||
fi
|
||||
export PATH
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
--- stage2.orig/rootfs/boot/cmdline.txt
|
||||
+++ stage2/rootfs/boot/cmdline.txt
|
||||
@@ -1 +1 @@
|
||||
-console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 fsck.repair=yes rootwait
|
||||
+console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 fsck.repair=yes rootwait quiet init=/usr/lib/raspberrypi-sys-mods/firstboot
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#01-useradd.diff
|
||||
#02-swap.diff
|
||||
#04-inputrc.diff
|
||||
#05-path.diff
|
||||
#07-resize-init.diff
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# 00-patches
|
||||
|
||||
## 01-useradd.diff
|
||||
sed "s/^SHELL=.*/SHELL=\/bin\/bash/" -i "${ROOTFS_DIR}/etc/default/useradd"
|
||||
sed "s/# SKEL=.*/SKEL=\/etc\/skel/" -i "${ROOTFS_DIR}/etc/default/useradd"
|
||||
|
||||
## 02-swap.diff
|
||||
sed "s/#CONF_SWAPSIZE=.*/CONF_SWAPSIZE=100/" -i "${ROOTFS_DIR}/etc/dphys-swapfile"
|
||||
|
||||
## 04-inputrc.diff
|
||||
echo ' ' >> "${ROOTFS_DIR}/etc/inputrc"
|
||||
echo '# mappings for up and down arrows search history' >> "${ROOTFS_DIR}/etc/inputrc"
|
||||
echo '# "\e[B": history-search-forward' >> "${ROOTFS_DIR}/etc/inputrc"
|
||||
echo '# "\e[A": history-search-backward' >> "${ROOTFS_DIR}/etc/inputrc"
|
||||
|
||||
## 05-path.diff
|
||||
install -m 644 files/login.defs "${ROOTFS_DIR}/etc/"
|
||||
install -m 644 files/profile "${ROOTFS_DIR}/etc/"
|
||||
|
||||
## 07-resize-init.diff
|
||||
|
||||
# 00-patches
|
||||
|
||||
install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/"
|
||||
|
||||
install -d "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d"
|
||||
install -m 644 files/ttyoutput.conf "${ROOTFS_DIR}/etc/systemd/system/rc-local.service.d/"
|
||||
|
||||
install -m 644 files/50raspi "${ROOTFS_DIR}/etc/apt/apt.conf.d/"
|
||||
|
||||
install -m 644 files/console-setup "${ROOTFS_DIR}/etc/default/"
|
||||
|
||||
install -m 755 files/rc.local "${ROOTFS_DIR}/etc/"
|
||||
|
||||
if [ -n "${PUBKEY_SSH_FIRST_USER}" ]; then
|
||||
install -v -m 0700 -o 1000 -g 1000 -d "${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh
|
||||
echo "${PUBKEY_SSH_FIRST_USER}" >"${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh/authorized_keys
|
||||
chown 1000:1000 "${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh/authorized_keys
|
||||
chmod 0600 "${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh/authorized_keys
|
||||
fi
|
||||
|
||||
if [ "${PUBKEY_ONLY_SSH}" = "1" ]; then
|
||||
sed -i -Ee 's/^#?[[:blank:]]*PubkeyAuthentication[[:blank:]]*no[[:blank:]]*$/PubkeyAuthentication yes/
|
||||
s/^#?[[:blank:]]*PasswordAuthentication[[:blank:]]*yes[[:blank:]]*$/PasswordAuthentication no/' "${ROOTFS_DIR}"/etc/ssh/sshd_config
|
||||
fi
|
||||
|
||||
on_chroot << EOF
|
||||
systemctl disable hwclock.sh
|
||||
systemctl disable nfs-common
|
||||
systemctl disable rpcbind
|
||||
if [ "${ENABLE_SSH}" == "1" ]; then
|
||||
systemctl enable ssh
|
||||
else
|
||||
systemctl disable ssh
|
||||
fi
|
||||
systemctl enable regenerate_ssh_host_keys
|
||||
EOF
|
||||
|
||||
if [ "${USE_QEMU}" = "1" ]; then
|
||||
echo "enter QEMU mode"
|
||||
install -m 644 files/90-qemu.rules "${ROOTFS_DIR}/etc/udev/rules.d/"
|
||||
on_chroot << EOF
|
||||
systemctl disable resize2fs_once
|
||||
EOF
|
||||
echo "leaving QEMU mode"
|
||||
else
|
||||
on_chroot << EOF
|
||||
systemctl enable resize2fs_once
|
||||
EOF
|
||||
fi
|
||||
|
||||
on_chroot <<EOF
|
||||
for GRP in input spi i2c gpio; do
|
||||
groupadd -f -r "\$GRP"
|
||||
done
|
||||
for GRP in adm dialout cdrom audio users sudo video games plugdev input gpio spi i2c netdev render; do
|
||||
adduser $FIRST_USER_NAME \$GRP
|
||||
done
|
||||
EOF
|
||||
|
||||
if [ -f "${ROOTFS_DIR}/etc/sudoers.d/010_pi-nopasswd" ]; then
|
||||
sed -i "s/^pi /$FIRST_USER_NAME /" "${ROOTFS_DIR}/etc/sudoers.d/010_pi-nopasswd"
|
||||
fi
|
||||
|
||||
on_chroot << EOF
|
||||
setupcon --force --save-only -v
|
||||
EOF
|
||||
|
||||
on_chroot << EOF
|
||||
usermod --pass='*' root
|
||||
EOF
|
||||
|
||||
rm -f "${ROOTFS_DIR}/etc/ssh/"ssh_host_*_key*
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# never use pdiffs. Current implementation is very slow on low-powered devices
|
||||
Acquire::PDiffs "0";
|
||||
|
||||
# download up to 5 pdiffs:
|
||||
#Acquire::PDiffs::FileLimit "5";
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
KERNEL=="sda", SYMLINK+="mmcblk0"
|
||||
KERNEL=="sda?", SYMLINK+="mmcblk0p%n"
|
||||
KERNEL=="sda2", SYMLINK+="root"
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# CONFIGURATION FILE FOR SETUPCON
|
||||
|
||||
# Consult the console-setup(5) manual page.
|
||||
|
||||
ACTIVE_CONSOLES="/dev/tty[1-6]"
|
||||
|
||||
CHARMAP="UTF-8"
|
||||
|
||||
CODESET="guess"
|
||||
FONTFACE=""
|
||||
FONTSIZE=""
|
||||
|
||||
VIDEOMODE=
|
||||
|
||||
# The following is an example how to use a braille font
|
||||
# FONT='lat9w-08.psf.gz brl-8x8.psf'
|
||||
|
|
@ -0,0 +1,340 @@
|
|||
#
|
||||
# /etc/login.defs - Configuration control definitions for the login package.
|
||||
#
|
||||
# Three items must be defined: MAIL_DIR, ENV_SUPATH, and ENV_PATH.
|
||||
# If unspecified, some arbitrary (and possibly incorrect) value will
|
||||
# be assumed. All other items are optional - if not specified then
|
||||
# the described action or option will be inhibited.
|
||||
#
|
||||
# Comment lines (lines beginning with "#") and blank lines are ignored.
|
||||
#
|
||||
# Modified for Linux. --marekm
|
||||
|
||||
# REQUIRED for useradd/userdel/usermod
|
||||
# Directory where mailboxes reside, _or_ name of file, relative to the
|
||||
# home directory. If you _do_ define MAIL_DIR and MAIL_FILE,
|
||||
# MAIL_DIR takes precedence.
|
||||
#
|
||||
# Essentially:
|
||||
# - MAIL_DIR defines the location of users mail spool files
|
||||
# (for mbox use) by appending the username to MAIL_DIR as defined
|
||||
# below.
|
||||
# - MAIL_FILE defines the location of the users mail spool files as the
|
||||
# fully-qualified filename obtained by prepending the user home
|
||||
# directory before $MAIL_FILE
|
||||
#
|
||||
# NOTE: This is no more used for setting up users MAIL environment variable
|
||||
# which is, starting from shadow 4.0.12-1 in Debian, entirely the
|
||||
# job of the pam_mail PAM modules
|
||||
# See default PAM configuration files provided for
|
||||
# login, su, etc.
|
||||
#
|
||||
# This is a temporary situation: setting these variables will soon
|
||||
# move to /etc/default/useradd and the variables will then be
|
||||
# no more supported
|
||||
MAIL_DIR /var/mail
|
||||
#MAIL_FILE .mail
|
||||
|
||||
#
|
||||
# Enable logging and display of /var/log/faillog login failure info.
|
||||
# This option conflicts with the pam_tally PAM module.
|
||||
#
|
||||
FAILLOG_ENAB yes
|
||||
|
||||
#
|
||||
# Enable display of unknown usernames when login failures are recorded.
|
||||
#
|
||||
# WARNING: Unknown usernames may become world readable.
|
||||
# See #290803 and #298773 for details about how this could become a security
|
||||
# concern
|
||||
LOG_UNKFAIL_ENAB no
|
||||
|
||||
#
|
||||
# Enable logging of successful logins
|
||||
#
|
||||
LOG_OK_LOGINS no
|
||||
|
||||
#
|
||||
# Enable "syslog" logging of su activity - in addition to sulog file logging.
|
||||
# SYSLOG_SG_ENAB does the same for newgrp and sg.
|
||||
#
|
||||
SYSLOG_SU_ENAB yes
|
||||
SYSLOG_SG_ENAB yes
|
||||
|
||||
#
|
||||
# If defined, all su activity is logged to this file.
|
||||
#
|
||||
#SULOG_FILE /var/log/sulog
|
||||
|
||||
#
|
||||
# If defined, file which maps tty line to TERM environment parameter.
|
||||
# Each line of the file is in a format something like "vt100 tty01".
|
||||
#
|
||||
#TTYTYPE_FILE /etc/ttytype
|
||||
|
||||
#
|
||||
# If defined, login failures will be logged here in a utmp format
|
||||
# last, when invoked as lastb, will read /var/log/btmp, so...
|
||||
#
|
||||
FTMP_FILE /var/log/btmp
|
||||
|
||||
#
|
||||
# If defined, the command name to display when running "su -". For
|
||||
# example, if this is defined as "su" then a "ps" will display the
|
||||
# command is "-su". If not defined, then "ps" would display the
|
||||
# name of the shell actually being run, e.g. something like "-sh".
|
||||
#
|
||||
SU_NAME su
|
||||
|
||||
#
|
||||
# If defined, file which inhibits all the usual chatter during the login
|
||||
# sequence. If a full pathname, then hushed mode will be enabled if the
|
||||
# user's name or shell are found in the file. If not a full pathname, then
|
||||
# hushed mode will be enabled if the file exists in the user's home directory.
|
||||
#
|
||||
HUSHLOGIN_FILE .hushlogin
|
||||
#HUSHLOGIN_FILE /etc/hushlogins
|
||||
|
||||
#
|
||||
# *REQUIRED* The default PATH settings, for superuser and normal users.
|
||||
#
|
||||
# (they are minimal, add the rest in the shell startup files)
|
||||
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
|
||||
|
||||
#
|
||||
# Terminal permissions
|
||||
#
|
||||
# TTYGROUP Login tty will be assigned this group ownership.
|
||||
# TTYPERM Login tty will be set to this permission.
|
||||
#
|
||||
# If you have a "write" program which is "setgid" to a special group
|
||||
# which owns the terminals, define TTYGROUP to the group number and
|
||||
# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign
|
||||
# TTYPERM to either 622 or 600.
|
||||
#
|
||||
# In Debian /usr/bin/bsd-write or similar programs are setgid tty
|
||||
# However, the default and recommended value for TTYPERM is still 0600
|
||||
# to not allow anyone to write to anyone else console or terminal
|
||||
|
||||
# Users can still allow other people to write them by issuing
|
||||
# the "mesg y" command.
|
||||
|
||||
TTYGROUP tty
|
||||
TTYPERM 0600
|
||||
|
||||
#
|
||||
# Login configuration initializations:
|
||||
#
|
||||
# ERASECHAR Terminal ERASE character ('\010' = backspace).
|
||||
# KILLCHAR Terminal KILL character ('\025' = CTRL/U).
|
||||
# UMASK Default "umask" value.
|
||||
#
|
||||
# The ERASECHAR and KILLCHAR are used only on System V machines.
|
||||
#
|
||||
# UMASK is the default umask value for pam_umask and is used by
|
||||
# useradd and newusers to set the mode of the new home directories.
|
||||
# 022 is the "historical" value in Debian for UMASK
|
||||
# 027, or even 077, could be considered better for privacy
|
||||
# There is no One True Answer here : each sysadmin must make up his/her
|
||||
# mind.
|
||||
#
|
||||
# If USERGROUPS_ENAB is set to "yes", that will modify this UMASK default value
|
||||
# for private user groups, i. e. the uid is the same as gid, and username is
|
||||
# the same as the primary group name: for these, the user permissions will be
|
||||
# used as group permissions, e. g. 022 will become 002.
|
||||
#
|
||||
# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
|
||||
#
|
||||
ERASECHAR 0177
|
||||
KILLCHAR 025
|
||||
UMASK 022
|
||||
|
||||
#
|
||||
# Password aging controls:
|
||||
#
|
||||
# PASS_MAX_DAYS Maximum number of days a password may be used.
|
||||
# PASS_MIN_DAYS Minimum number of days allowed between password changes.
|
||||
# PASS_WARN_AGE Number of days warning given before a password expires.
|
||||
#
|
||||
PASS_MAX_DAYS 99999
|
||||
PASS_MIN_DAYS 0
|
||||
PASS_WARN_AGE 7
|
||||
|
||||
#
|
||||
# Min/max values for automatic uid selection in useradd
|
||||
#
|
||||
UID_MIN 1000
|
||||
UID_MAX 60000
|
||||
# System accounts
|
||||
#SYS_UID_MIN 100
|
||||
#SYS_UID_MAX 999
|
||||
|
||||
#
|
||||
# Min/max values for automatic gid selection in groupadd
|
||||
#
|
||||
GID_MIN 1000
|
||||
GID_MAX 60000
|
||||
# System accounts
|
||||
#SYS_GID_MIN 100
|
||||
#SYS_GID_MAX 999
|
||||
|
||||
#
|
||||
# Max number of login retries if password is bad. This will most likely be
|
||||
# overriden by PAM, since the default pam_unix module has it's own built
|
||||
# in of 3 retries. However, this is a safe fallback in case you are using
|
||||
# an authentication module that does not enforce PAM_MAXTRIES.
|
||||
#
|
||||
LOGIN_RETRIES 5
|
||||
|
||||
#
|
||||
# Max time in seconds for login
|
||||
#
|
||||
LOGIN_TIMEOUT 60
|
||||
|
||||
#
|
||||
# Which fields may be changed by regular users using chfn - use
|
||||
# any combination of letters "frwh" (full name, room number, work
|
||||
# phone, home phone). If not defined, no changes are allowed.
|
||||
# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
|
||||
#
|
||||
CHFN_RESTRICT rwh
|
||||
|
||||
#
|
||||
# Should login be allowed if we can't cd to the home directory?
|
||||
# Default in no.
|
||||
#
|
||||
DEFAULT_HOME yes
|
||||
|
||||
#
|
||||
# If defined, this command is run when removing a user.
|
||||
# It should remove any at/cron/print jobs etc. owned by
|
||||
# the user to be removed (passed as the first argument).
|
||||
#
|
||||
#USERDEL_CMD /usr/sbin/userdel_local
|
||||
|
||||
#
|
||||
# If set to yes, userdel will remove the user's group if it contains no
|
||||
# more members, and useradd will create by default a group with the name
|
||||
# of the user.
|
||||
#
|
||||
# Other former uses of this variable such as setting the umask when
|
||||
# user==primary group are not used in PAM environments, such as Debian
|
||||
#
|
||||
USERGROUPS_ENAB yes
|
||||
|
||||
#
|
||||
# Instead of the real user shell, the program specified by this parameter
|
||||
# will be launched, although its visible name (argv[0]) will be the shell's.
|
||||
# The program may do whatever it wants (logging, additional authentification,
|
||||
# banner, ...) before running the actual shell.
|
||||
#
|
||||
# FAKE_SHELL /bin/fakeshell
|
||||
|
||||
#
|
||||
# If defined, either full pathname of a file containing device names or
|
||||
# a ":" delimited list of device names. Root logins will be allowed only
|
||||
# upon these devices.
|
||||
#
|
||||
# This variable is used by login and su.
|
||||
#
|
||||
#CONSOLE /etc/consoles
|
||||
#CONSOLE console:tty01:tty02:tty03:tty04
|
||||
|
||||
#
|
||||
# List of groups to add to the user's supplementary group set
|
||||
# when logging in on the console (as determined by the CONSOLE
|
||||
# setting). Default is none.
|
||||
#
|
||||
# Use with caution - it is possible for users to gain permanent
|
||||
# access to these groups, even when not logged in on the console.
|
||||
# How to do it is left as an exercise for the reader...
|
||||
#
|
||||
# This variable is used by login and su.
|
||||
#
|
||||
#CONSOLE_GROUPS floppy:audio:cdrom
|
||||
|
||||
#
|
||||
# If set to "yes", new passwords will be encrypted using the MD5-based
|
||||
# algorithm compatible with the one used by recent releases of FreeBSD.
|
||||
# It supports passwords of unlimited length and longer salt strings.
|
||||
# Set to "no" if you need to copy encrypted passwords to other systems
|
||||
# which don't understand the new algorithm. Default is "no".
|
||||
#
|
||||
# This variable is deprecated. You should use ENCRYPT_METHOD.
|
||||
#
|
||||
#MD5_CRYPT_ENAB no
|
||||
|
||||
#
|
||||
# If set to MD5 , MD5-based algorithm will be used for encrypting password
|
||||
# If set to SHA256, SHA256-based algorithm will be used for encrypting password
|
||||
# If set to SHA512, SHA512-based algorithm will be used for encrypting password
|
||||
# If set to DES, DES-based algorithm will be used for encrypting password (default)
|
||||
# Overrides the MD5_CRYPT_ENAB option
|
||||
#
|
||||
# Note: It is recommended to use a value consistent with
|
||||
# the PAM modules configuration.
|
||||
#
|
||||
ENCRYPT_METHOD SHA512
|
||||
|
||||
#
|
||||
# Only used if ENCRYPT_METHOD is set to SHA256 or SHA512.
|
||||
#
|
||||
# Define the number of SHA rounds.
|
||||
# With a lot of rounds, it is more difficult to brute forcing the password.
|
||||
# But note also that it more CPU resources will be needed to authenticate
|
||||
# users.
|
||||
#
|
||||
# If not specified, the libc will choose the default number of rounds (5000).
|
||||
# The values must be inside the 1000-999999999 range.
|
||||
# If only one of the MIN or MAX values is set, then this value will be used.
|
||||
# If MIN > MAX, the highest value will be used.
|
||||
#
|
||||
# SHA_CRYPT_MIN_ROUNDS 5000
|
||||
# SHA_CRYPT_MAX_ROUNDS 5000
|
||||
|
||||
################# OBSOLETED BY PAM ##############
|
||||
# #
|
||||
# These options are now handled by PAM. Please #
|
||||
# edit the appropriate file in /etc/pam.d/ to #
|
||||
# enable the equivelants of them.
|
||||
#
|
||||
###############
|
||||
|
||||
#MOTD_FILE
|
||||
#DIALUPS_CHECK_ENAB
|
||||
#LASTLOG_ENAB
|
||||
#MAIL_CHECK_ENAB
|
||||
#OBSCURE_CHECKS_ENAB
|
||||
#PORTTIME_CHECKS_ENAB
|
||||
#SU_WHEEL_ONLY
|
||||
#CRACKLIB_DICTPATH
|
||||
#PASS_CHANGE_TRIES
|
||||
#PASS_ALWAYS_WARN
|
||||
#ENVIRON_FILE
|
||||
#NOLOGINS_FILE
|
||||
#ISSUE_FILE
|
||||
#PASS_MIN_LEN
|
||||
#PASS_MAX_LEN
|
||||
#ULIMIT
|
||||
#ENV_HZ
|
||||
#CHFN_AUTH
|
||||
#CHSH_AUTH
|
||||
#FAIL_DELAY
|
||||
|
||||
################# OBSOLETED #######################
|
||||
# #
|
||||
# These options are no more handled by shadow. #
|
||||
# #
|
||||
# Shadow utilities will display a warning if they #
|
||||
# still appear. #
|
||||
# #
|
||||
###################################################
|
||||
|
||||
# CLOSE_SESSIONS
|
||||
# LOGIN_STRING
|
||||
# NO_PASSWORD_CONSOLE
|
||||
# QMAIL_DIR
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
|
||||
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
else
|
||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
|
||||
fi
|
||||
export PATH
|
||||
|
||||
if [ "${PS1-}" ]; then
|
||||
if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
|
||||
# The file bash.bashrc already sets the default PS1.
|
||||
# PS1='\h:\w\$ '
|
||||
if [ -f /etc/bash.bashrc ]; then
|
||||
. /etc/bash.bashrc
|
||||
fi
|
||||
else
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
PS1='# '
|
||||
else
|
||||
PS1='$ '
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d /etc/profile.d ]; then
|
||||
for i in /etc/profile.d/*.sh; do
|
||||
if [ -r $i ]; then
|
||||
. $i
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
fi
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will "exit 0" on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
# Print the IP address
|
||||
_IP=$(hostname -I) || true
|
||||
if [ "$_IP" ]; then
|
||||
printf "My IP address is %s\n" "$_IP"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: resize2fs_once
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start: 3
|
||||
# Default-Stop:
|
||||
# Short-Description: Resize the root filesystem to fill partition
|
||||
# Description:
|
||||
### END INIT INFO
|
||||
. /lib/lsb/init-functions
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting resize2fs_once"
|
||||
ROOT_DEV=$(findmnt / -o source -n) &&
|
||||
resize2fs $ROOT_DEV &&
|
||||
update-rc.d resize2fs_once remove &&
|
||||
rm /etc/init.d/resize2fs_once &&
|
||||
log_end_msg $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 start" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[Service]
|
||||
StandardOutput=tty
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek
|
||||
raspberrypi-net-mods
|
||||
dhcpcd5
|
||||
network-manager
|
||||
net-tools
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant"
|
||||
install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/"
|
||||
|
||||
on_chroot << EOF
|
||||
SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_wait 0
|
||||
SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_netconf 1
|
||||
EOF
|
||||
|
||||
if [ -v WPA_COUNTRY ]; then
|
||||
on_chroot <<- EOF
|
||||
SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_wifi_country "${WPA_COUNTRY}"
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ -v WPA_ESSID ] && [ -v WPA_PASSWORD ]; then
|
||||
on_chroot <<EOF
|
||||
set -o pipefail
|
||||
wpa_passphrase "${WPA_ESSID}" "${WPA_PASSWORD}" | tee -a "/etc/wpa_supplicant/wpa_supplicant.conf"
|
||||
EOF
|
||||
elif [ -v WPA_ESSID ]; then
|
||||
cat >> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf" << EOL
|
||||
|
||||
network={
|
||||
ssid="${WPA_ESSID}"
|
||||
key_mgmt=NONE
|
||||
}
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Disable wifi on 5GHz models if WPA_COUNTRY is not set
|
||||
mkdir -p "${ROOTFS_DIR}/var/lib/systemd/rfkill/"
|
||||
if [ -n "$WPA_COUNTRY" ]; then
|
||||
echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan"
|
||||
echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan"
|
||||
else
|
||||
echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan"
|
||||
echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan"
|
||||
fi
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
|
||||
update_config=1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# Do you accept the Wolfram - Raspberry Pi® Bundle License Agreement?
|
||||
wolfram-engine shared/accepted-wolfram-eula boolean true
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
echo "${TIMEZONE_DEFAULT}" > "${ROOTFS_DIR}/etc/timezone"
|
||||
rm "${ROOTFS_DIR}/etc/localtime"
|
||||
|
||||
on_chroot << EOF
|
||||
dpkg-reconfigure -f noninteractive tzdata
|
||||
EOF
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
# copy_previous
|
||||
#fi
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# Adobe Flash Player. Copyright 1996-2015. Adobe Systems Incorporated. All Rights Reserved.
|
||||
rpi-chromium-mods rpi-chromium-mods/adobe note
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
|
||||
qpdfview gtk2-engines alsa-utils
|
||||
desktop-base
|
||||
git
|
||||
policykit-1
|
||||
gvfs
|
||||
rfkill
|
||||
#chromium-browser rpi-chromium-mods libwidevinecdm0
|
||||
gldriver-test
|
||||
fonts-droid-fallback
|
||||
fonts-liberation2
|
||||
obconf
|
||||
arandr
|
||||
libcamera-tools
|
||||
libcamera-apps
|
||||
python3-pyqt5
|
||||
python3-opengl
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
xserver-xorg xinit
|
||||
mousepad
|
||||
lxde lxtask menu-xdg
|
||||
zenity xdg-utils
|
||||
gvfs-backends gvfs-fuse
|
||||
lightdm gnome-themes-standard gnome-icon-theme
|
||||
gnome-keyring
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
on_chroot << EOF
|
||||
apt-mark auto python3-pyqt5 python3-opengl
|
||||
EOF
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
on_chroot << EOF
|
||||
SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_wait 1
|
||||
EOF
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
# copy_previous
|
||||
#fi
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# Enable realtime process priority?
|
||||
jackd2 jackd/tweak_rt_limits boolean true
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
python3-pygame
|
||||
python3-tk thonny
|
||||
python3-pgzero
|
||||
python3-serial
|
||||
debian-reference-en dillo
|
||||
raspberrypi-net-mods raspberrypi-ui-mods
|
||||
python3-pip
|
||||
python3-numpy
|
||||
pypy
|
||||
alacarte rc-gui sense-hat
|
||||
tree
|
||||
libgl1-mesa-dri libgles1 libgles2-mesa xcompmgr
|
||||
geany
|
||||
piclone
|
||||
pigpio python3-pigpio raspi-gpio python3-rpi.gpio
|
||||
python3-spidev
|
||||
python3-twython
|
||||
python3-smbus
|
||||
python3-flask
|
||||
pprompt
|
||||
piwiz
|
||||
rp-prefapps
|
||||
ffmpeg
|
||||
vlc
|
||||
rpi-imager
|
||||
#rpi-wayland
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
pi-package
|
||||
realvnc-vnc-server
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
python3-automationhat
|
||||
python3-blinkt
|
||||
python3-cap1xxx
|
||||
python3-drumhat
|
||||
python3-envirophat
|
||||
python3-explorerhat
|
||||
python3-fourletterphat
|
||||
python3-microdotphat
|
||||
python3-mote
|
||||
python3-motephat
|
||||
python3-phatbeat
|
||||
python3-pianohat
|
||||
python3-piglow
|
||||
python3-rainbowhat
|
||||
python3-scrollphat
|
||||
python3-scrollphathd
|
||||
python3-sn3218
|
||||
python3-skywriter
|
||||
python3-touchphat
|
||||
python3-buttonshim
|
||||
python3-unicornhathd
|
||||
python3-pantilthat
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
hunspell-en-gb
|
||||
hyphen-en-gb
|
||||
wamerican
|
||||
wbritish
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
on_chroot << EOF
|
||||
SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_behaviour B4
|
||||
EOF
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#Alacarte fixes
|
||||
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local"
|
||||
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local/share"
|
||||
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local/share/applications"
|
||||
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local/share/desktop-directories"
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
BOOKSHELF_URL="https://magpi.raspberrypi.org/bookshelf.xml"
|
||||
GUIDE_URL="$(curl -s "$BOOKSHELF_URL" | awk -F '[<>]' "/<TITLE>Raspberry Pi Beginner's Guide 4th Edition<\/TITLE>/ {f=1; next} f==1 && /PDF/ {print \$3; exit}")"
|
||||
OUTPUT="$(basename "$GUIDE_URL" | cut -f1 -d'?')"
|
||||
|
||||
if [ ! -f "files/$OUTPUT" ]; then
|
||||
rm files/*.pdf -f
|
||||
curl -s "$GUIDE_URL" -o "files/$OUTPUT"
|
||||
fi
|
||||
|
||||
file "files/$OUTPUT" | grep -q "PDF document"
|
||||
|
||||
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Bookshelf"
|
||||
install -v -o 1000 -g 1000 -m 644 "files/$OUTPUT" "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Bookshelf/"
|
||||
|
|
@ -0,0 +1 @@
|
|||
*.pdf
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
on_chroot << EOF
|
||||
raspi-config nonint do_xcompmgr 0
|
||||
EOF
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
cups
|
||||
system-config-printer
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
on_chroot <<EOF
|
||||
adduser "$FIRST_USER_NAME" lpadmin
|
||||
EOF
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
xserver-xorg-dev
|
||||
libgstreamer1.0-dev
|
||||
libgstreamer-plugins-base1.0-dev
|
||||
libgstreamer-opencv1.0-0
|
||||
gstreamer1.0-opencv
|
||||
gstreamer1.0-wpe
|
||||
libgstreamer-plugins-bad1.0-dev
|
||||
gstreamer1.0-plugins-ugly
|
||||
libre2-9
|
||||
libmpv1
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
#if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
# copy_previous
|
||||
#fi
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
mu-editor
|
||||
#sonic-pi
|
||||
#scratch nuscratch scratch3
|
||||
smartsim
|
||||
|
||||
python3-sense-emu sense-emu-tools python-sense-emu-doc
|
||||
|
||||
wolfram-engine
|
||||
claws-mail
|
||||
greenfoot-unbundled bluej-unbundled
|
||||
realvnc-vnc-viewer
|
||||
|
||||
code-the-classics
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue