[FS#3798] flashing the install image leaves overlay filesystem in undefined state
OpenWrt Bugs
openwrt-bugs at lists.openwrt.org
Tue May 11 21:49:55 PDT 2021
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#3798 - flashing the install image leaves overlay filesystem in undefined state
User who did this - Shivaram Lingamneni (slingamn)
----------
Thanks! I was able to reproduce this with the squashfs factory image:
* https://downloads.openwrt.org/releases/21.02.0-rc1/targets/bcm27xx/bcm2709/openwrt-21.02.0-rc1-bcm27xx-bcm2709-rpi-2-squashfs-factory.img.gz
* SHA256SUM f07d683424fa1e7d642cd0a6a3136d0e56119dc44f8c1c83826961731064723f
using the following steps:
1. Download and flash the image to a SD card
2. Boot the device from the SD card, set a root password, ssh in
3. Create files on the overlayfs, e.g.
root at OpenWrt:~# df -Th
Filesystem Type Size Used Available Use% Mounted on
/dev/root squashfs 5.3M 5.3M 0 100% /rom
tmpfs tmpfs 431.4M 212.0K 431.2M 0% /tmp
/dev/loop0 ext4 91.7M 1.5M 83.2M 2% /overlay
overlayfs:/overlay overlay 91.7M 1.5M 83.2M 2% /
/dev/mmcblk0p1 vfat 63.9M 26.1M 37.7M 41% /boot
tmpfs tmpfs 512.0K 0 512.0K 0% /dev
root at OpenWrt:~# touch /etc/openwrt_issue_fs_3798
root at OpenWrt:~# touch /usr/bin/openwrt_issue_fs_3798
root at OpenWrt:~# find /overlay/upper/ | grep 3798
/overlay/upper/usr/bin/openwrt_issue_fs_3798
/overlay/upper/etc/openwrt_issue_fs_3798
root at OpenWrt:~# find /overlay/upper/ | grep 3798 | xargs ls -lai
49 -rw-r--r-- 1 root root 0 Apr 18 10:14 /overlay/upper/etc/openwrt_issue_fs_3798
52 -rw-r--r-- 1 root root 0 Apr 18 10:14 /overlay/upper/usr/bin/openwrt_issue_fs_3798
4. `poweroff` the device
5. Reflash the SD card with the factory image, reinsert, boot up again
6. Root password remains set; files remain in place:
root at OpenWrt:~# find /overlay/upper/ | grep 3798 | xargs ls -lai
49 -rw-r--r-- 1 root root 0 Apr 18 10:14 /overlay/upper/etc/openwrt_issue_fs_3798
52 -rw-r--r-- 1 root root 0 Apr 18 10:14 /overlay/upper/usr/bin/openwrt_issue_fs_3798
What I said about the superblock is at best informed speculation :-) What I'm seeing is that the squashfs image (decompressed) is only 80881906 bytes long, but the total length of the partition table is 360447 sectors, i.e., 184548864 bytes. So there's data referenced in the partitions that is not overwritten by a factory flash. My belief is that the ext4 superblock of /overlay/upper is in this area.
----------
More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3798#comment9636
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
More information about the openwrt-bugs
mailing list