← Back to team overview

torios-dev team mailing list archive

Re: location of tarball in persistent live ToriOS

 

On 11/16/2016 04:57 AM, Nio Wiklund wrote:
> Hi Israel and the ToriOS developers,
>
> I re-discovered a bug, which is independent of guidus. It has been
> around for a long time also with mkusb (without fixing).
>
> The persistent live system of ToriOS 1.0 has a different directory
> structure for booting compared to the live system, and the tarball is
> not where the OBI-installer expects it to be. It can be found and
> selected, and used. I did that in order to create the installed ToriOS
> system, where I tested that guidus works.
>
> In a normal persistent live system:
>
> /lib/live/mount/persistence/sda4/live/tarballs/
>
> In a persistent live system with ramdrive, boot option 'toram':
>
> /lib/live/mount/medium/live/tarballs/
>
> -o-
>
> I remember that you asked me, Israel, a long time ago, why I located
> the tarball outside the root partition (and located it hardcoded into
> the drive). I said that we could avoid 'double passed through
> compression', which is good, but it does cause trouble in the
> persistent live system.
>
> a. Do you think we should move the tarball into the root partition
> (and the squashfs package)? It would remove this problem.
>
> b. Or do you think I should fix it with mkusb/dus?
>
> c. Or do you think it is a minor issue, and we should focus on other
> and more urgent problems? (In other words, do you think anybody except
> me has tried to make a persistent live drive with ToriOS, and if
> someone has, did that person intend to use that system to install
> ToriOS?)
>
> Best regards
> Nio
Here is the fix I made to the current code.

checkTarballs(){
  # fancy dance-y check for tarballs to fix mkusb persistence
  DIR="$1"
  for i in "${DIR}"/*.tar.[gx]z
  do
   TARGET="$i"
   if [[ -f "$TARGET" ]]
   then
     bash -c "echo $TARGET > $selected"
     tarpath="${i%/*}"
     export tarpath
     echo "YES"
     break
   fi
  done
}
## Test to see if the tarball in 'selected' exists first
selectedtest=$(cat "${selected}")
if [[ ! -f "${selectedtest}" ]]
then
## if it doesn't pick the last one listed so there is some reasonable
choice available
  checkTarballs "$tarpath"
  selectedtest=$(cat "${selected}")
  if [[ -f "$selectedtest" ]]
  then
    dialogMESSAGE="$HadtofindatarballOBIfound $target"
# write tarball name
  else
    thisAns=""
    for i in /lib/live/mount/persistence/sd*
    do
      thisAns=$(checkTarballs "$i/live/tarballs")
      [[ -n $thisAns ]] && break
    done
    selectedtest=$(cat "${selected}")
    [[ ! -f "${selectedtest}" ]]&&  checkTarballs
/lib/live/mount/medium/live/tarballs/
  fi
fi

AFAIK this *should* work fine...

-- 
Regards



References