WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: confused if copy2fs.flg unmounts mmcblk0p2 automatically  (Read 1644 times)

Offline xpector

  • Newbie
  • *
  • Posts: 16
confused if copy2fs.flg unmounts mmcblk0p2 automatically
« on: August 30, 2017, 08:14:55 AM »
Béla wrote: http://forum.tinycorelinux.net/index.php?topic=20808.0#subject_129912
"Create a file copy2fs.flg in /mnt/mmcblk0p2/tce. If it exists extensions will be copied to RAM and mmcblk0p2 unmounted"

Sounds like unmount should happen automatically? It didn't in my case. Should I do it actively in /opt/bootlocal.sh?

Code: [Select]
tc@box:~$ cat /proc/mounts
tmpfs / tmpfs rw,relatime,size=399980k 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/mmcblk0p2 /mnt/mmcblk0p2 ext4 rw,relatime,data=ordered 0 0
/dev/loop0 /tmp/tcloop/mc squashfs ro,relatime 0 0
/dev/loop1 /tmp/tcloop/openssh squashfs ro,relatime 0 0
/dev/loop2 /tmp/tcloop/glib2 squashfs ro,relatime 0 0
/dev/loop3 /tmp/tcloop/libssh2 squashfs ro,relatime 0 0
/dev/loop4 /tmp/tcloop/ncurses squashfs ro,relatime 0 0
/dev/loop5 /tmp/tcloop/libedit squashfs ro,relatime 0 0
/dev/loop6 /tmp/tcloop/openssl squashfs ro,relatime 0 0
/dev/loop7 /tmp/tcloop/gamin squashfs ro,relatime 0 0
/dev/loop8 /tmp/tcloop/libelf squashfs ro,relatime 0 0
/dev/loop9 /tmp/tcloop/pcre squashfs ro,relatime 0 0
/dev/loop10 /tmp/tcloop/libgcrypt squashfs ro,relatime 0 0
/dev/loop11 /tmp/tcloop/ca-certificates squashfs ro,relatime 0 0
/dev/loop12 /tmp/tcloop/bzip2-lib squashfs ro,relatime 0 0
/dev/loop13 /tmp/tcloop/gcc_libs squashfs ro,relatime 0 0
/dev/loop14 /tmp/tcloop/libgpg-error squashfs ro,relatime 0 0

tc@box:~$ >/mnt/mmcblk0p2/tce/copy2fs.flg

tc@box:~$ ls /mnt/mmcblk0p2/tce/
copy2fs.flg  mydata.tgz   onboot.lst   ondemand/    optional/

tc@box:~$ sudo reboot

tc@box:~$ ls /mnt/mmcblk0p2/tce/
copy2fs.flg  mydata.tgz   onboot.lst   ondemand/    optional/

tc@box:~$ cat /proc/mounts
tmpfs / tmpfs rw,relatime,size=399980k 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/mmcblk0p2 /mnt/mmcblk0p2 ext4 rw,relatime,data=ordered 0 0
^^^^^^^^^^ still there   

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: confused if copy2fs.flg unmounts mmcblk0p2 automatically
« Reply #1 on: August 30, 2017, 10:31:17 AM »
I suspect he meant "and mmcblk0p2 can be unmounted", at least on x86 you need to do it in bootlocal.
The only barriers that can stop you are the ones you create yourself.

Offline cochon

  • Newbie
  • *
  • Posts: 16
Re: confused if copy2fs.flg unmounts mmcblk0p2 automatically
« Reply #2 on: August 30, 2017, 11:47:09 AM »
And as I discovered only today, if you plan to load any more extensions over the network, remember to remap the [now broken] symlink /etc/sysconfig/tcedir to point to /tmp/tce otherwise tce-load just fails silently.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: confused if copy2fs.flg unmounts mmcblk0p2 automatically
« Reply #3 on: August 31, 2017, 01:44:57 AM »
which version of piCore are you using?

I just installed piCore-9.0.3 and could download/load additional extensions without problems.

Offline cochon

  • Newbie
  • *
  • Posts: 16
Re: confused if copy2fs.flg unmounts mmcblk0p2 automatically
« Reply #4 on: August 31, 2017, 02:52:18 AM »
My bad, I was in part replying to the previous post about doing it in bootlocal.sh on x86, in my case it was x86(8.0) not Pi. But that said tce-load does do '[ -d "$TCEDIR" ] || exit 1' so I'd assume it fails on all platforms once you've unmounted the device tcedir points to.

I've just noted though that in the code there's a '-t tcedir' option not mentioned in the usage text which seems a more reliable way of scripting subsequent RAM based loads once the boot media has been removed, without having to fix the symlink.

I'm new to TCL even on x86, but do have an unused RasPi 1 without an SD card. This topic has kind of piqued my interest generally, I think I'll order a new memory card and give piCore a whirl too.