Add script to format and mount /dev/nvme0n1 in initramfs installation

This commit is contained in:
Anduin Xue
2025-07-21 19:08:07 +00:00
parent 90cd41f214
commit 7164b7cd16

View File

@ -2,6 +2,17 @@ set -e # exit on error
set -o pipefail # exit on pipeline error
set -u # treat unset variable as error
# Automatically update /etc/casper.conf
# Mount /dev/nvme0n1 to /cow
mkdir -p /scripts/casper-premount
echo << EOF > /scripts/casper-premount/10-format.cow
#!/bin/sh
set -euo pipefail
mkfs.ext4 -F -L casper-rw /dev/nvme0n1p1
EOF
chmod +x /scripts/casper-premount/10-format.cow
# Update initramfs
update-initramfs -u -k all
judge "Update /etc/casper.conf"