usbmode how does it work differently?

Programming issues and discussion
Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

usbmode how does it work differently?

Postby Scooby » 12 Dec 2013, 19:39

from livekitlib

Code: Select all

        echo "Activating changes.fs4 in usbmode"
        if [ ! -d "$BUNDLES/changes.fs4" ]; then
          mkdir -p "$BUNDLES/changes.fs4"
        fi
        mount -o loop "$1/changes.fs4" "$BUNDLES/changes.fs4"
        rmdir "$BUNDLES/changes.fs4/lost+found" 2>/dev/null
      fi


from rc.shutdown

Code: Select all

  if grep -q usbmode /proc/cmdline; then
    if [ -d "/mnt/live/memory/bundles/changes.fs4" ]; then
      mount -n -o remount,add:1:/mnt/live/memory/bundles/changes.fst
  fi 


I understand that usbmode is for flash memory to reduce saves/writes for
prolongig life of disk but how does it work? were is save made?

simargl
Site Admin
Posts: 466
Joined: 16 May 2013, 10:54
Contact:

Re: usbmode how does it work differently?

Postby simargl » 12 Dec 2013, 23:04

With usbmode enabled in menu.lst as bootcode, savefile is mounted from init in initramfs, then added to aufs from rc.sysinit, and changes are saved from script /usr/bin/save-session. That script is executed every time on reboot/poweroff (from rc.shutdown), and it is used to save session just in two cases: if save file is made during that session, or bootcode usbmode is used.


Return to “Scripting and Programming”

Who is online

Users browsing this forum: No registered users and 21 guests

cron