WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: dCore .sce combination  (Read 6583 times)

Offline A Guy

  • Newbie
  • *
  • Posts: 25
dCore .sce combination
« on: July 23, 2019, 11:08:25 AM »
I found a script for combining .sce files into a single file. This, to me, has the benefit of saving space by allowing shared dependencies to not show up twice , even though I imagine the actual ram disk doesn't store both.

The problem is that after I ran the script, the resultant .sce file wouldn't load. At least not automatically.

Am I looking at this wrong?
Tony M.
Embedded Software and BIOS Engineer

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: dCore .sce combination
« Reply #1 on: July 23, 2019, 05:30:00 PM »
Hi A Guy.  SCEs can't be combined by copying the contents from two or more of them into one directory and then creating an SCE out of that directory.  For one, the startup scripts of individual packages in an SCE use the location of the mounted SCE as /tmp/tcloop/APPNAME, and that name gets translated to /tmp/tcloop/firefox in the case of firefox.sce when it is im ported.  Combining two or more SCE's contents messes that part up.   

What one can do is create a list file of the packages that are to be imported.  If you have smplayer and xmms as two SCEs, create a list file named, say, multimedia1 with the below contents:

Code: [Select]
smplayer
xmms

Then run the below command in the same directory as the file multimedia1:

sce-import -l multimedia1

If the two SCEs that are to be combined are already made from list files, then just combine the contents of the two list files into one and import that. 

My main desktop SCE contains 54 package entries, I like to use just one big SCE with the exception of things I am currently working on and update frequently. 

Offline A Guy

  • Newbie
  • *
  • Posts: 25
Re: dCore .sce combination
« Reply #2 on: July 23, 2019, 06:27:05 PM »
Oh , that is useful too. So the import operation will combine them at download time.
I thought the merge script would be the way to do it (and would be handy since I already downloaded the individual packages).

That sounds like a good way to go then.

Thanks for the reply.

I am trying to setting up a PXE development and testing environment. The key is to create drivers and binary software on one environment and then a smaller (quicker) testing environment will run on the test computer.

I have most of it working but being able to combine sets of modules will help a lot.
Again, thanks.
Tony M.
Embedded Software and BIOS Engineer

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: dCore .sce combination
« Reply #3 on: July 23, 2019, 07:19:23 PM »
Any .deb or dCore specific packages that have already been downloaded will be used during sce-import and new ones will not be downloaded unless they have been updated in Debian/Ubuntu or in dCore if the tce directory is on persistent storage.   

Offline A Guy

  • Newbie
  • *
  • Posts: 25
Re: dCore .sce combination
« Reply #4 on: July 24, 2019, 05:23:20 AM »
Ok, that leads into my question.
I have saved individual .sce modules on a local server. These consist of ".sce", ".sce.md5.txt", and ".sce.debinx" file groups.

If I were to copy these locally to the /tmp/tce/sce directory and then specify a list of the modules , including the ones I copied into this directly to this directly , the sce-import program would be able to combine them into one sce package, without downloading them?

Are there additional steps , like modifying a "currently loaded .sce" listing file?

Thanks for this information so far. I had a core.gz of 80 megabytes drop to 40 megabytes , and I included one more package.
Tony M.
Embedded Software and BIOS Engineer

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: dCore .sce combination
« Reply #5 on: July 24, 2019, 07:02:05 PM »
Hi Tony.

I had posted a script that did this kind of thing in 2013 I now looked up, below:

http://forum.tinycorelinux.net/index.php/topic,16199.msg95963.html#msg95963

But that was in the early days when the SCE was simple, so much has changed since then, As in SCEs depending on other SCEs, and the /tmp/tcloop/APPNAME in the startup scripts which depends on the name that the SCE was imorted with to name two.  Also the info under /usr/local/sce that is specific to that SCE.

So there is no simple way to merge several SCEs into one without using sce-import to import a list of packages and use the downloaded .debs or dCore specific packages that are already downloaded to a TCE directory on permanent storage.  If the TCE directory is in RAM, then re-downloading the .deb or dCore files has to happen.

Thanks for your interest in dCore, and I wish there was a way to combine already made SCEs into one at this point.  It's not that it can't happen, but it would at least be involved. 
 

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: dCore .sce combination
« Reply #6 on: July 25, 2019, 06:00:55 PM »
I found that combining SCEs is still possible, but the resulting  combined one will be overlooked by sce-update and should not used as a dependency for other SCEs.  I have created a 336MB desktop SCE that I created out of the following SCEs already existing and then rebooted, and now I am running an xfce4 session with only that combined SCE installed:

Code: [Select]
clonezilla.sce
dCore-usbinstall.sce
gimp.sce
kernel-all-4.19.10-tinycore64.sce
nouveau-4.19.10-tinycore64.sce
xfce4.sce
xorg-all.sce
xscreensaver.sce

I copied those SCEs to a directory, and in that directory did the below:

Code: [Select]
mkdir 1
mkdir pkg

mount clonezilla.sce 1
cp -af 1/* pkg/
umount 1

mount dCore-usbinstall.sce 1
cp -af 1/* pkg/
umount 1

..  and so on for all those SCEs.

Then I did:

Code: [Select]
sed -i 's:/tmp/tcloop/clonezilla:/tmp/tcloop/desktop:g' pkg/usr/local/tce.installed/*
sed -i 's:/tmp/tcloop/dCore-usbinstall:/tmp/tcloop/desktop:g' pkg/usr/local/tce.installed/*

.. and so on for all the names of those SCEs.

Then to remove entries in /usr/local/sce that are no longer valid for sce-update or using the resulting SCE as a dependency for a new SCE:

Code: [Select]
sudo rm -r pkg/usr/local/sce/*
Then I made an SCE out of that pkg/ directory:

Code: [Select]
mksquashfs pkg/ desktop.sce -noappend
m5sum desktop.sce > desktop.sce.md5.txt

I moved this resulting SCE to my /etc/sysconfig/tcedir/sce directory and listed that as the only SCE in my sceboot.lst in my TCE directory, and all works as expected. 

I could script this, but for now if you would test the instructions I would appreciate it. 

    [EDIT]: Added code tags.  Rich
« Last Edit: July 25, 2019, 07:23:38 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: dCore .sce combination
« Reply #7 on: July 25, 2019, 07:25:04 PM »
Hi Jason W
Please use code tags when posting commands. :P

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: dCore .sce combination
« Reply #8 on: July 25, 2019, 07:47:23 PM »
Good point, will do.   :)

Offline A Guy

  • Newbie
  • *
  • Posts: 25
Re: dCore .sce combination
« Reply #9 on: July 26, 2019, 06:29:34 AM »
Jason W
Maybe you could attach these notes to the original thread so that your newer ideas can be linked with the original concept.

The tool obviously is useful , in my case , for combining many previously downloaded .sce modules and squishing them together in various ways before deployment in /tmp/builtin (maybe not the best way to do it, but it is working for me).
Tony M.
Embedded Software and BIOS Engineer