rogeliodh
New Head-Fier
- Joined
- Sep 12, 2014
- Posts
- 8
- Likes
- 13
DISCLAIMER: Following this procedure could brick your X1ii and probably void your warranty. So do it at your own risk.
Hi everybody:
I've been playing a little with the Fiio X1ii FW since I got it (mid november)
It is really simple to create your own firmware.
I'm on a Linux (ubuntu 16.10) machine, so my instructions are for that.
For packing I'm using mkyaffs2 from yaffs2utils 0.2.9_20120815
(latest.tar.gz from
https://code.google.com/archive/p/yaffs2utils/downloads).
For unpacking, unyaffs2 from yaffs2utils is not working, so I'm using ubuntu's unyaffs 0.9.6-1 (apt-get install unyaffs)
So, to install dependencies:
Then create a folder with Fiio's FW and mkyaffs2:
Now, proceed to unpack the FW:
Now, you can browse the filesystem in myfw/fifo_rootfs, modify it as you wish and repack it:
And that's it, you can flash ~/x1ii/X1II.repacked.fw as usual (rename it to X1II.fw and copy it to sdcard).
I have two scripts to pack and repack the fw. You can find them in:
x1ii_fw_unpack.sh: https://gist.github.com/rogeliodh/2134fc19152e36ba7ffd34b3136d3635
x1ii_fw_pack.sh: https://gist.github.com/rogeliodh/b9585bab3153aa031cc0030f4d7b8c38
You have to put them next to mkyaffs2 (in ~/x1ii).
My first/only modification has been to edit ~/x1ii/myfw/fifo_rootfs/etc/udev/scripts/mmc.sh to run at boot a shell script stored in sdcard with:
You can find the replacement mmc.sh in https://gist.github.com/rogeliodh/0d2b7850b801bb619f59c99af139fac1
And putting some custom commands in custom.sh in the sdcard. You can see my custom.sh in https://gist.github.com/rogeliodh/5d70a6cf2a9db99828b3a393340821d3
I'm sharing this information so we can create custom FW from now on. I don't have enough time to play with this, but I can help anybody who wants to.
UPDATE: I've just tried running all this under "Windows Subsystem for Linux" on a Windows 10 machine (follow http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/) and it works partially. The problem is that when running unyaffs it can't create some special files (device files /dev/null for example), so the regenerated FW will be missing those essential files and, surely, the custom FW won't work properly. So, you can use "Windows Subsystem for Linux" to play a little but not to create the FW (at least not for now).
Hi everybody:
I've been playing a little with the Fiio X1ii FW since I got it (mid november)
It is really simple to create your own firmware.
I'm on a Linux (ubuntu 16.10) machine, so my instructions are for that.
For packing I'm using mkyaffs2 from yaffs2utils 0.2.9_20120815
(latest.tar.gz from
https://code.google.com/archive/p/yaffs2utils/downloads).
For unpacking, unyaffs2 from yaffs2utils is not working, so I'm using ubuntu's unyaffs 0.9.6-1 (apt-get install unyaffs)
So, to install dependencies:
sudo apt-get install build-essential
sudo apt-get install unyaffs
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/yaffs2utils/latest.tar.gz
tar zxvf latest.tar.gz
cd latest
make
Then create a folder with Fiio's FW and mkyaffs2:
mkdir ~/x1ii
cp mkyaffs2 ~/x1ii
cd ~/x1ii
wget "https://www.dropbox.com/s/81dwz6k5apflq0i/X1_2nd_gen_FW1.5.6_X1II.fw?dl=1" -O X1II.fw
Now, proceed to unpack the FW:
mkdir -p myfw
tar zxvf X1II.fw -C myfw
sudo unyaffs myfw/fifo_rootfs.yaffs2 myfw/fifo_rootfs
Now, you can browse the filesystem in myfw/fifo_rootfs, modify it as you wish and repack it:
cd ~/x1ii/myfw
sudo ../mkyaffs2 fifo_rootfs fifo_rootfs.yaffs2
echo -n `md5sum fifo_rootfs.yaffs2 | cut -c1-32` > fifo_rootfs.yaffs2.md5
tar zcvf ../X1II.repacked.fw fifo_uimage fifo_uimage.md5 fifo_uimageesmt fifo_uimageesmt.md5 fifo_rootfs.yaffs2 fifo_rootfs.yaffs2.md5
And that's it, you can flash ~/x1ii/X1II.repacked.fw as usual (rename it to X1II.fw and copy it to sdcard).
I have two scripts to pack and repack the fw. You can find them in:
x1ii_fw_unpack.sh: https://gist.github.com/rogeliodh/2134fc19152e36ba7ffd34b3136d3635
x1ii_fw_pack.sh: https://gist.github.com/rogeliodh/b9585bab3153aa031cc0030f4d7b8c38
You have to put them next to mkyaffs2 (in ~/x1ii).
My first/only modification has been to edit ~/x1ii/myfw/fifo_rootfs/etc/udev/scripts/mmc.sh to run at boot a shell script stored in sdcard with:
--- mmc.sh 2016-11-28 19:16:06.000000000 -0600
+++ /home/rogelio/x1ii/mmc.sh 2017-01-20 08:29:18.548904641 -0600
@@ -13,6 +13,7 @@
then
ntfs-3g /dev/$1 /mnt/mmc
fi
+ sh /mnt/mmc/custom.sh &
elif [ "$ACTION" == "remove" ]
then
rm /tmp/mmc_add -f
You can find the replacement mmc.sh in https://gist.github.com/rogeliodh/0d2b7850b801bb619f59c99af139fac1
And putting some custom commands in custom.sh in the sdcard. You can see my custom.sh in https://gist.github.com/rogeliodh/5d70a6cf2a9db99828b3a393340821d3
I'm sharing this information so we can create custom FW from now on. I don't have enough time to play with this, but I can help anybody who wants to.
UPDATE: I've just tried running all this under "Windows Subsystem for Linux" on a Windows 10 machine (follow http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/) and it works partially. The problem is that when running unyaffs it can't create some special files (device files /dev/null for example), so the regenerated FW will be missing those essential files and, surely, the custom FW won't work properly. So, you can use "Windows Subsystem for Linux" to play a little but not to create the FW (at least not for now).