Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: onelife on July 29, 2017, 09:03:10 AM
-
Greetings All,
I'm wondering if there is an conclusion on how a tcz should / could be updated without a reboot of the system?
The tcz I have in question is 100% "my own files" and would not have dependencies as such. It's actually a java application that I simply want to be able to update and remount without a reboot.
I see you can do commands such as :
sudo unmount -d /tmp/tcloop/package_name
But I see this doesn't actually take the loaded files off the mounted system?
I also see a few guys have made a tcz-reload / tcz-unload script but not sure if these are safe on Picore as 2 I tried didn't work and made the system unstable.
Any suggestions are awesome as I'd like to think this is possible and certainly like todo it the best way possible.
Many Thanks
Dean
-
If you loaded it as symlinks (mount mode), having the old symlinks there doesn't hurt anything, as long as the new extension is named the same.
-
Thank you for that confirmation :)
So would the idea of doing :
sudo umount -d /tmp/tcloop/package_name
and then :
sudo mount /mnt/mmcblk0p2/tce/optional/package_name /tmp/tcloop/
Work all in order and would cause the remount to over right the files that are left behind from the umount?
The package paths etc are all identical, I simply update the package_name.tcz and would like to re-load this without a reboot.
It was originally mounted as part of TC boot / start process if that makes any difference?
Is that thinking then right?
THANK YOU! :)
-
Yes, that works fine. However, if the update added new files, you'd need to remove the installed marker (rm /usr/local/tce.installed/package_name) and use tce-load instead of mount.
-
Hi onelife
Yes, that works fine. However, if the update added new files, you'd need to remove the installed marker (rm /usr/local/tce.installed/package_name) and use tce-load instead of mount.
If you do that and have a PROGRAM.desktop file with an icon listed, you'll first want to remove the three lines referring to your
program in /usr/local/tce.icons or you'll start seeing multiple icons on the wbar. I also used to remove the popup menu entry
under /home/tc/.wmx/Applications ,though I don't recall if that was necessary or me just being thorough.
When I was dealing with this I added commands to do the cleanup to the beginning of my build script.
-
Yep, lots of complications for a full unload. I assumed there was no icon or other bindings.
-
Hi again all,
Seems I'm coming across a possible issue with this unmount and reload of tcz.
The issue however, only seems to be happening on older versions of TC.
On a system running TC version 6 the same unmount / load process that works on TC 8 doesn't work.
I get a "error" like this and I can't see what is causing it.
snb@snb:~$ sudo ./update_skynetwork/com/reboot.sh
umount: /tmp/tcloop/studio: filesystem was unmounted, but mount(8) failed: Invalid argument
/etc/sysconfig/tcedir/optional/studio.tcz: OK
The system doesn't reload the new tcz and uses the old although seems to load OK it says.
Any ideas?
THANK YOU!
-
snb@snb:~$ sudo ./update_skynetwork/com/reboot.sh
umount: /tmp/tcloop/studio: filesystem was unmounted, but mount(8) failed: Invalid argument
/etc/sysconfig/tcedir/optional/studio.tcz: OK
...
Any ideas?
What's the content of that script ?
-
Sorry, should have posted that too. It's basically this part :
sudo umount -d /tmp/tcloop/studio
sleep 1
sudo rm -f "/usr/local/tce.installed/studio"
sleep 1
sudo -u snb tce-load -i studio
sleep 1
$UPDATE/com/start.sh &
The start.sh script then starts our application etc.
Thank you!
-
sudo umount -d /tmp/tcloop/studio
Busybox umount does not have "-d" option
tc@box:~$ umount --help
BusyBox v1.26.2 (2017-05-05 04:20:53 UTC) multi-call binary.
Usage: umount [OPTIONS] FILESYSTEM|DIRECTORY
Unmount file systems
-a Unmount all file systems
-r Try to remount devices as read-only if mount is busy
-l Lazy umount (detach filesystem)
-f Force umount (i.e., unreachable NFS server)
-D Don't free loop device even if it has been used
sudo -u snb tce-load -i studio
I'd do
su tc -c 'tce-load -i studio'
because this is what I get
tc@ox~$ sudo -u tc tce-load
Sorry, user tc is not allowed to execute '/usr/bin/tce-load' as tc on box.
-
Hi onelife
On a system running TC version 6 the same unmount / load process that works on TC 8 doesn't work.
Do you have util-linux.tcz installed? A Google search on that error turned up a umount bug in versions 2.25.1 and possibly
2.26 of util-linux.tcz. See if this works any better:
sudo rm -f "/usr/local/tce.installed/studio"
sync
sudo busybox umount -d /tmp/tcloop/studio
sync
sudo -u snb tce-load -i studio
sleep 1
$UPDATE/com/start.sh &
-
Hi polikuo
sudo umount -d /tmp/tcloop/studio
Busybox umount does not have "-d" option
tc@box:~$ umount --help
BusyBox v1.26.2 (2017-05-05 04:20:53 UTC) multi-call binary.
Usage: umount [OPTIONS] FILESYSTEM|DIRECTORY
Unmount file systems
-a Unmount all file systems
-r Try to remount devices as read-only if mount is busy
-l Lazy umount (detach filesystem)
-f Force umount (i.e., unreachable NFS server)
-D Don't free loop device even if it has been used
Actually, previous versions did have that option:
tc@box:~$ busybox umount --help
BusyBox v1.19.3 (2011-10-30 01:47:29 UTC) multi-call binary.
Usage: umount [OPTIONS] FILESYSTEM|DIRECTORY
Unmount file systems
-a Unmount all file systems
-r Try to remount devices as read-only if mount is busy
-l Lazy umount (detach filesystem)
-f Force umount (i.e., unreachable NFS server)
-d Free loop device if it has been used
tc@box:~$
-
Actually, previous versions did have that option:
Interesting ...
That explains why onelife's script performs differently between the two.
-
Hi again,
Thank you so much for your help - However, interesting, busybox doesn't seem to have umount?
snb@snb:~$ sudo busybox umount -d /tmp/tcloop/studio
umount: applet not found
And according to busybox
snb@snb:~$ busybox
BusyBox v1.22.1 (2014-07-18 16:45:21 UTC) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.
Usage: busybox [function [arguments]...]
or: busybox --list[-full]
or: busybox --install [-s] [DIR]
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, [[, addgroup, adduser, adjtimex, ar, arp, arping, ash, awk, basename, bunzip2, bzcat, bzip2, cal, cat, chgrp, chmod, chown, chpasswd, chroot, chrt, chvt,
cksum, clear, cmp, comm, cp, cpio, crond, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, df, diff, dirname, dmesg, dnsdomainname, dos2unix, du,
dumpkmap, dumpleases, echo, egrep, eject, env, ether-wake, expr, false, fbset, fdflush, fdformat, fdisk, fgconsole, fgrep, find, flock, fold, free, freeramdisk,
fsck, fstrim, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig, inetd, init,
insmod, install, ipcalc, ipcrm, ipcs, kill, killall, killall5, klogd, last, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, logname, logread,
losetup, ls, lsmod, lsof, md5sum, mesg, microcom, mkdir, mkfifo, mknod, mkswap, mktemp, modinfo, modprobe, more, mv, nameif, nbd-client, nc, netstat, nice,
nohup, nslookup, ntpd, od, openvt, patch, pgrep, pidof, pivot_root, pkill, poweroff, printenv, printf, ps, pwd, rdate, readlink, realpath, reboot, renice,
reset, resize, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, script, sed, seq, setarch, setconsole, setkeycodes, setsid, sh, sha1sum, sleep, sort, split,
start-stop-daemon, strings, stty, sulogin, sum, swapoff, swapon, switch_root, sync, sysctl, syslogd, tail, tar, taskset, tee, telnet, test, tftp, tftpd, time,
timeout, top, touch, tr, true, tty, udhcpc, udhcpd, udpsvd, uname, uncompress, uniq, unix2dos, unxz, unzip, uptime, usleep, vconfig, vi, watch, wc, wget, which,
who, whoami, xargs, xz, xzcat, yes, zcat
Or am I missing something?
-
Yes, busybox.suid
-
SUCCESS :)
So this seems to finally do the trick on TC 6, 7 and 8
sudo rm -f "/usr/local/tce.installed/studio"
sync
sleep 1
sudo busybox.suid umount -d /tmp/tcloop/studio
sleep 1
sync
sudo -u snb tce-load -i studio
sleep 1
$UPDATE/com/start.sh &
Thank you so much for your help - Really appreciated!