1
0
mirror of https://github.com/lxsang/meta-rpi-diya.git synced 2024-12-26 18:58:20 +01:00

add settings to enable readonly fs

This commit is contained in:
DanyLE 2023-07-10 09:32:40 +02:00
parent 5ab57b8e5d
commit b358e26252
9 changed files with 31 additions and 13 deletions

View File

@ -15,8 +15,7 @@ LAYERSERIES_COMPAT_meta-rpi-diya = "mickledore"
PACKAGE_CLASSES = "package_ipk"
INHERIT += "rm_work"
EXTRA_IMAGE_FEATURES ?= " ssh-server-dropbear "
# disable readonly fs read-only-rootfs
EXTRA_IMAGE_FEATURES ?= " ssh-server-dropbear read-only-rootfs "
# ssh-server-dropbear
DISTRO_FEATURES:append := " vc4-gfx opengl "
# DISTRO_FEATURES:append := " vc4-gfx opengl directfb "

View File

@ -1,2 +1,2 @@
DROPBEAR_EXTRA_ARGS="-w"
DROPBEAR_RSAKEY_DIR=/home/diya/etc/dropbear
DROPBEAR_RSAKEY_DIR=/var/etc/dropbear

View File

@ -0,0 +1,3 @@
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /var/etc/network/wpa_supplicant.conf

View File

@ -1,3 +1,9 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://interfaces"
do_install:append () {
rm ${D}/etc/network/interfaces
install -d ${D}/var/etc/
install -d ${D}/var/etc/network
install -m 0644 ${WORKDIR}/interfaces ${D}/var/etc/network
}

View File

@ -1,2 +1,4 @@
l root root 0644 /etc/network/interfaces /home/diya/etc/network/interfaces
l root root 0644 /etc/dropbear /home/diya/etc/dropbear
d root root 0755 /var/etc/network none
d root root 0755 /var/etc/dropbear none
l root root 0644 /etc/network/interfaces /var/etc/network/interfaces
l root root 0644 /etc/dropbear /var/etc/dropbear

View File

@ -25,9 +25,9 @@ case "$1" in
chown -R diya:diya /home/diya
rm /boot/home_partition_should_be_formated
fi
if [ -e "/boot/install" ];then
cp -rf /boot/install/* /home/diya
rm -rf /boot/install
if [ -e "/boot/wpa_supplicant.conf" ];then
install -m 0644 /boot/wpa_supplicant.conf /var/etc/network
rm /boot/wpa_supplicant.conf
reboot
fi
# display information

View File

@ -1,6 +1,6 @@
#! /bin/sh
line=$(
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk0 | grep /dev/mmcblk0p3
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk0 | grep /dev/mmcblk0p4
p
q
EOF
@ -18,11 +18,11 @@ fi
echo "Expanding the partition"
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk0
d
3
d # delete partition
4 # number 4
n # new partition
p # primary partition
3 # partition number 3
4 # partition number 4
$start_sector
# default - end of disk
p # print the in-memory partition table

View File

@ -0,0 +1,4 @@
do_install:append() {
# grant all permission to sudo group
sed -i 's/^#\s*\(%sudo\s*ALL=(ALL:ALL)\s*ALL\)/\1/' ${D}/${sysconfdir}/sudoers
}

View File

@ -2,7 +2,11 @@
# long-description: Creates a partitioned SD card image for use with
# Raspberry Pi. Boot files are located in the first vfat partition.
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 50
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 32
# read only roofs
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096 --size 150
# modifiable configurations stored in /var/etc
part /var/etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var/etc --ondisk mmcblk0 --fstype=ext4 --label home --align 1024 --size 32
# home partition
part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --ondisk mmcblk0 --fstype=ext4 --label home --align 1024 --size 16
# part /home --ondisk mmcblk0 --fstype=vfat --label music --active --align 1024 --size 16