Skip to content

Commit

Permalink
fstab: change to UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Jan 22, 2022
1 parent 5007019 commit f804156
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ make_image() {
dd if=/dev/zero of=${build_image_file} bs=1M count=${IMG_SIZE} conv=fsync >/dev/null 2>&1
sync

ROOTFS_UUID=$(uuidgen)
parted -s ${build_image_file} mklabel msdos 2>/dev/null
parted -s ${build_image_file} mkpart primary fat32 $((SKIP_MB))M $((SKIP_MB + BOOT_MB - 1))M 2>/dev/null
parted -s ${build_image_file} mkpart primary ext4 $((SKIP_MB + BOOT_MB))M 100% 2>/dev/null
Expand All @@ -138,7 +139,7 @@ make_image() {
[ ${loop_new} ] || error_msg "losetup ${build_image_file} failed."

mkfs.vfat -n "BOOT" ${loop_new}p1 >/dev/null 2>&1
mkfs.ext4 -F -q -L "ROOTFS" -m 0 ${loop_new}p2 >/dev/null 2>&1
mkfs.ext4 -F -q -U ${ROOTFS_UUID} -L "ROOTFS" -m 0 ${loop_new}p2 >/dev/null 2>&1
sync
}

Expand Down Expand Up @@ -408,12 +409,9 @@ copy_files() {
fi

# Edit the uEnv.txt
if [ ! -f "uEnv.txt" ]; then
error_msg "The uEnv.txt File does not exist"
else
old_fdt_dtb="meson-gxl-s905d-phicomm-n1.dtb"
sed -i "s/${old_fdt_dtb}/${FDTFILE}/g" uEnv.txt
fi
[ -f "uEnv.txt" ] || error_msg "The uEnv.txt File does not exist."
sed -i "s|LABEL=ROOTFS|UUID=${ROOTFS_UUID}|g" uEnv.txt
sed -i "s|meson.*.dtb|${FDTFILE}|g" uEnv.txt

# For s912-t95z-plus /boot/extlinux/extlinux.conf
[ "${FDTFILE}" == "meson-gxm-t95z-plus.dtb" ] && cp -rf ${configfiles_path}/patches/boot/s912-t95z-plus/* .
Expand Down Expand Up @@ -454,6 +452,10 @@ copy_files() {
# renaming/disabling related files
mv -f etc/udev/rules.d/hdmi.rules etc/udev/rules.d/hdmi.rules.bak 2>/dev/null

# Edit the etc/fstab
[ -f "etc/fstab" ] || error_msg "The etc/fstab File does not exist."
sed -i "s|LABEL=ROOTFS|UUID=${ROOTFS_UUID}|g" etc/fstab

# Add custom firmware information
echo "VERSION_CODENAME='${release_codename}'" >>${ophub_release_file} 2>/dev/null
echo "FDTFILE='${FDTFILE}'" >>${ophub_release_file} 2>/dev/null
Expand Down

0 comments on commit f804156

Please sign in to comment.