openmiko / openmiko

Open source firmware for Ingenic T20 based devices such as WyzeCam V2, Xiaomi Xiaofang 1S, iSmartAlarm's Spot+ and others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/config size issues and services/configs not starting properly

jangliss opened this issue · comments

When the demo.bin file is left on the sdcard, it appears to be copied into the file system /dev/mtdblock3 (/config) which is where the overlay files are copied. These overlay files are then used to build out the rest of the system, including wpa_supplicant.conf.

Specs
Wyze Cam v2
openmiko v1.0.0-alpha.1 (a272ff0)

  • Default size for /dev/mtdblock3 is 256K. It is mounted using mount -t jffs2 /dev/mtdblocks3 /config in /usr/bin/general_init.sh
  • Not entirely sure how, but demo.bin ended up in the path /config/overlay even though on the sdcard it's only in the root
  • The file /config/overlay/demo.bin is only 120K of the full /sdcard/demo.bin
  • install command is used to copy files from /sdcard/config to /config by replacing /sdcard off the path
  • This fails if the /config path is full
# find /sdcard/config -type f -exec sh -c 'SOURCE={};TARGET=${SOURCE#/sdcard};install -D $SOURCE $TARGET' \; -print
install: can't create '/config/overlay/etc/hostname': No space left on device
install: can't create '/config/overlay/etc/openmiko.conf': No space left on device
install: can't create '/config/overlay/etc/wpa_supplicant.conf': No space left on device
# df -h
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                 44.6M         0     44.6M   0% /dev
/dev/mmcblk0p1            8.0G     10.7M      8.0G   0% /sdcard
/dev/zram0               46.5M     33.0M     10.1M  77% /
tmpfs                    44.8M      8.0K     44.8M   0% /dev/shm
tmpfs                    44.8M    116.0K     44.7M   0% /tmp
tmpfs                    44.8M     28.0K     44.8M   0% /run
/dev/mmcblk0p1            8.0G     10.7M      8.0G   0% /sdcard
/dev/mtdblock3          256.0K    224.0K     32.0K  88% /config

Because this fails, files such as the wpa_supplicant.conf never make it into /etc and the wifi never becomes reachable and never joins the specified wifi.

I did notice that /etc/init.d/S35wifi looks for /sdcard/wpa_supplicant.conf and copies that to /etc and allows the wifi to start still. I was able to get onto my device by using the file in the root of the sdcard.

# find /sdcard
/sdcard
/sdcard/System Volume Information
/sdcard/System Volume Information/WPSettings.dat
/sdcard/System Volume Information/IndexerVolumeGuid
/sdcard/config
/sdcard/config/overlay
/sdcard/config/overlay/etc
/sdcard/config/overlay/etc/hostname
/sdcard/config/overlay/etc/openmiko.conf
/sdcard/config/overlay/etc/wpa_supplicant.conf
/sdcard/initramfs_output.log
/sdcard/demo.bin
/sdcard/var
/sdcard/var/log
/sdcard/.bzvol
/sdcard/.bzvol/bzscratch
/sdcard/.bzvol/bzscratch/bzcurrentlargefile
/sdcard/wpa_supplicant.conf

# find /config
/config
/config/TZ
/config/.time
/config/.cloudenv
/config/.wifipasswd
/config/.user_config
/config/.time_checkpoint
/config/.camera_encyid
/config/merge_upgrade.sh
/config/openmiko.db
/config/.parameters
/config/IOT_server.txt
/config/InfoBeforeUpgrade
/config/overlay
/config/overlay/etc
/config/overlay/etc/dropbear
/config/overlay/etc/dropbear/dropbear_ecdsa_host_key
/config/overlay/demo.bin
/config/.wifissid
/config/.wifitype
/config/.nasConfig

I have not yet figured out how demo.bin got into /config.