Update and fix raspberry-pi1.sh

This commit is contained in:
Arszilla
2022-08-22 23:02:27 +03:00
parent 8759e7ad58
commit f3c08d0ae7

View File

@@ -9,8 +9,10 @@
# Hardware model # Hardware model
hw_model=${hw_model:-"raspberry-pi1"} hw_model=${hw_model:-"raspberry-pi1"}
# Architecture # Architecture
architecture=${architecture:-"armel"} architecture=${architecture:-"armel"}
# Desktop manager (xfce, gnome, i3, kde, lxde, mate, e17 or none) # Desktop manager (xfce, gnome, i3, kde, lxde, mate, e17 or none)
desktop=${desktop:-"xfce"} desktop=${desktop:-"xfce"}
@@ -22,7 +24,7 @@ basic_network
add_interface eth0 add_interface eth0
# Third stage # Third stage
cat <<EOF >> "${work_dir}"/third-stage cat <<EOF >>"${work_dir}"/third-stage
status_stage3 'Copy rpi services' status_stage3 'Copy rpi services'
cp -p /bsp/services/rpi/*.service /etc/systemd/system/ cp -p /bsp/services/rpi/*.service /etc/systemd/system/
@@ -72,21 +74,28 @@ parted -s -a minimal "${image_dir}/${image_name}.img" mkpart primary "$fstype" "
# Set the partition variables # Set the partition variables
make_loop make_loop
# Create file systems # Create file systems
mkfs_partitions mkfs_partitions
# Make fstab. # Make fstab.
make_fstab make_fstab
# Configure Raspberry Pi firmware (set config.txt to 64-bit) # Configure Raspberry Pi firmware (set config.txt to 64-bit)
include rpi_firmware include rpi_firmware
# Create the dirs for the partitions and mount them # Create the dirs for the partitions and mount them
status "Create the dirs for the partitions and mount them" status "Create the dirs for the partitions and mount them"
mkdir -p "${base_dir}"/root/ mkdir -p "${base_dir}"/root/
if [[ $fstype == ext4 ]]; then if [[ $fstype == ext4 ]]; then
mount -t ext4 -o noatime,data=writeback,barrier=0 "${rootp}" "${base_dir}"/root mount -t ext4 -o noatime,data=writeback,barrier=0 "${rootp}" "${base_dir}"/root
else else
mount "${rootp}" "${base_dir}"/root mount "${rootp}" "${base_dir}"/root
fi fi
mkdir -p "${base_dir}"/root/boot mkdir -p "${base_dir}"/root/boot
mount "${bootp}" "${base_dir}"/root/boot mount "${bootp}" "${base_dir}"/root/boot