Skip to content

Commit 3f93dd9

Browse files
committed
fix(updater): mount the boot partition with the kernel's own charset
A vfat mount that names iocharset= or codepage= is refused outright on a kernel that has no NLS table for it: the Armbian current-sunxi64 kernel of the Orange Pi Zero 3 has no nls_ascii, so the board mounted its boot partition at boot - init.sh names no charset - and failed in the updater with "IO charset ascii not found", i.e. exit code 92. The names on that partition are ASCII, so the kernel's default is right on every target. All three mounts that shared the option string are kept in step, the commented-out fstab line included. Signed-off-by: Simon Walz <contact@simonwalz.de>
1 parent a0a62b2 commit 3f93dd9

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎image-factory/mount_image.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ mkdir -p "${TARGET_ROOT}"
8484
mount -t btrfs -o subvol=@os "${TARGET_ROOT_PARTITION}" "${TARGET_ROOT}"
8585

8686
mkdir -p "${TARGET_BOOT}"
87-
mount -t vfat -o "rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro" "${TARGET_BOOT_PARTITION}" "${TARGET_BOOT}"
87+
# Same charset reasoning as updater/docker_environment.sh: name none, so the
88+
# mount works on whatever kernel this runs against.
89+
mount -t vfat -o "rw,relatime,fmask=0022,dmask=0022,shortname=mixed,errors=remount-ro" "${TARGET_BOOT_PARTITION}" "${TARGET_BOOT}"
8890

8991
/bin/bash
9092

‎updater/docker_environment.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ mount -t btrfs -o subvol=@os "${TARGET_ROOT_PARTITION}" "${TARGET_ROOT}" \
4646
mkdir -p "${DOCKER_DIR}"
4747

4848
mkdir -p "${TARGET_BOOT}"
49-
mount -t vfat -o "rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro" "${TARGET_BOOT_PARTITION}" "${TARGET_BOOT}" \
49+
# The charset is the kernel's own. A vfat mount that names one the running
50+
# kernel has no NLS table for is refused outright ("IO charset ... not found"),
51+
# and which tables a kernel carries is not something this script can know: the
52+
# Armbian sunxi64 kernel of the Orange Pi Zero 3 has no nls_ascii. The boot
53+
# partition holds ASCII names only, so nothing here depends on the choice.
54+
mount -t vfat -o "rw,relatime,fmask=0022,dmask=0022,shortname=mixed,errors=remount-ro" "${TARGET_BOOT_PARTITION}" "${TARGET_BOOT}" \
5055
|| raise 92 "Could not mount boot partition"
5156

5257

‎updater/perform_update.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ LABEL=system / btrfs rw,relatime,discard=async,space_cache=v2,subvol=${CONTAI
173173
LABEL=system /data btrfs rw,relatime,discard=async,space_cache=v2,subvol=@data 0 0
174174
175175
# /dev/sda2
176-
#LABEL=boot /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
176+
#LABEL=boot /boot vfat rw,relatime,fmask=0022,dmask=0022,shortname=mixed,errors=remount-ro 0 2
177177
EOF
178178

179179
cp /etc/fstab "${CONTAINER_ROOTFS_FS}/etc/fstab" \

0 commit comments

Comments
 (0)