Quote:
Originally Posted by NiLuJe
Just a quick note to point out that (according to the PW's cramfs mount scripts), loop/1 is historically reserved for the SDCard (while loop/0 is the userstore). (And the PW uses a couple of loop devices for cramfs, too).
|
Indeed, on PW loops from 2 to 7 are already used. I've also found mentioning of
/dev/loop/1 in some system scripts (
/usr/sbin/wfm_mount,
/usr/sbin/wfm_erase). So it's safer to create
/dev/loop/8 and use it, as in this changed upstart script:
Quote:
Originally Posted by EternalCyclist
Sorry, I misunderstood you. I also don't know how to mount it directly on Kindle.
But on the connected PC I could mount it directly with the mount command.
- On the other hand, why would someone want to mount the ext3 partition on the PC via usbdrive. I am prefering sshfs.
So: The offset could be written to the partition table. But it is practically no use. I agree.
|
OMG, I've just understood what you've already knew. This new parition will be seen by computer when KT will be connected by USB.
While it generally doesn't bring any harm, sometimes Linux system automounts all paritions on removable device (such as Kindle) and then this parition could be used by heedless user simultaneously from computer side and Kindle side. So there is some value in skipping of creating of new parition (i.e. skipping of making a new record in parition table) and then just using free space after shrinked userstore parition as-is.
Here is diff of
userstore from Kindle Touch 5.1.2 with just shrinking of userstore parition:
Spoiler:
PHP Code:
--- /etc/upstart/userstore
+++ /var/tmp/root/userstore
@@ -29,7 +29,7 @@
PART_START=${_TRACKSIZE}
# try to read back the existing partition size
- PART_SIZE=`sfdisk --force -l ${MNTUS_DEV} | awk '$1 ~ '/${_BASE_MNTUS_DEV}p1/\ '{ print $5 }'`
+ PART_SIZE=`expr 1024 \* 1024 \* 1024 \/ 512`
if [ -z "${PART_SIZE}" ]; then
_CREATE=1
@@ -41,7 +41,7 @@
# create the volume partition
sfdisk -q --force -uS ${MNTUS_DEV} <<EOI
-${PART_START},,b
+${PART_START},${PART_SIZE},b
EOI
# read back the created partition size
@@ -237,8 +237,6 @@
# returned status is that of the called routine
case "$1" in
- start) start_us ;;
- stop) stop_us ;;
- init) init_us ;;
- *) echo "usage: $0 [start|stop|init]" ; exit 1 ;;
+ repartition) init_us "create";;
+ *) echo "usage: $0 repartition" ; exit 1 ;;
esac
And here is command for calculating absolute offset of new free space (in bytes, from start of eMMC device):
Code:
[root@kindle root]# expr 512 \* \( \
> $(sfdisk -uS -l --force /dev/mmcblk0p4 | awk '/mmcblk0p4p1/ {print $3 + 1}') \
> \+ $(cat /sys/class/block/mmcblk0p4/start) \
> \)