Files
odroid-stamper/fixups/S90-fstab
Dongjin Kim 3c53b14a21 fixup: tempory create UUID of root file system
'flash-kernel' checks root file system when updating initramfs and put
its root file system device into 'conf/param.conf'. But when running
ODROID-Stamper, the device for the root file system is not present as a
block device, so it is confused and add '/dev/sda2' which is not
correct, this leads boot failure.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I83b832ea411f68e0c0491c0e21684331fad7656e
2024-03-19 19:02:19 +09:00

31 lines
833 B
Bash
Executable File

#!/bin/sh
if [ -f /etc/fstab ]; then
# Remove BOOT/ROOTFS mount points
sed -i "/ \/boot /d" /etc/fstab
sed -i "/ \/ /d" /etc/fstab
# Remove EFI partition not to mount
sed -i "/\/boot\/efi/d" /etc/fstab
# Remove yet another root mount point via 'cloud-img-root'
sed -i "/cloudimg-rootfs/d" /etc/fstab
fi
if [ "x@@DEFAULT_DEV_ROOTFS@@" != "x" ]; then
cat <<__EOF | tee -a /etc/fstab >/dev/null
UUID="@@DEFAULT_DEV_ROOTFS@@" / ext4 rw,relatime,data=ordered 0 0
__EOF
fi
if [ "x@@DEFAULT_DEV_BOOT@@" != "x" ]; then
cat <<__EOF | tee -a /etc/fstab >/dev/null
UUID="@@DEFAULT_DEV_BOOT@@" /boot ext2 rw,relatime,errors=continue 0 0
__EOF
fi
# Temporary create UUID of root file system since 'flash-kernel' checks it
# to add 'root=UUID...' to initramfs.
touch /dev/disk/by-uuid/@@DEFAULT_DEV_ROOTFS@@
update-initramfs -u