Tiny Core Linux

dCore Import Debian Packages to Mountable SCE extensions => dCore X86 => Topic started by: dicorer on April 05, 2015, 03:46:33 PM

Title: sce-import can't customize sce
Post by: dicorer on April 05, 2015, 03:46:33 PM
Hi good day, I have a problem, I'm trying to create a customized sce file for dCore, with _ONLY_ the deb packages I want.

I have 50 .deb packages in the right position, (/tce/import/debs) and the Index file (/tce/ubuntu_utopic_main_i386_Packages) all ok, and my_file with the 50 packages names inside.
Then I run the command:
sce-import -r -p -l my_file
Then it asks if I want the list from my_file, yes.
Then start gathering dependencies.
Then it finishes and asks me to see the packages.
I expect to see _ONLY_ the packages I wrote in my_file.
Instead it shows me my packages, plus, all the dependencies too!
I do NOT want those dependencies!
I spent hours in cleaning and cutting out exactly those dependencies away, because I don't need them!
I want to create a .sce, built _ONLY_ of the 50 .deb packages I wrote in my_file - no dependencies!

How can I do that? Thanks :)
Title: Re: sce-import can't customize sce
Post by: Jason W on April 06, 2015, 04:29:25 AM
Hi

I am not sure a 'no dependencies' option would be of general use but perhaps a script to create a directory of .debs into an SCE would.  The original deb2tcz took a deb and made it to an extension, it would be doable to have a script that would allow a set of debs to be made into an sce.   I will ponder it some more.
Title: Re: sce-import can't customize sce
Post by: dicorer on April 06, 2015, 04:50:15 AM
So your answer is: not possible - right?

The list of debs used is already into the sce, look at /usr/local/sce.
Instead, I indeed would strongly suggest a new "no-dependencies" option, for the "non-general" users.
I spent lots of time in optimizing those debs, specially so to remove the useless ones dragged up by dependencies... now it all seems just a waste of time
..ps.. also it seems me pretty useless (and counter-producing) sce-import still connecting to the repositories of Tinycore and Ubuntu, when using the option "-p".
Since we have already all needed debs and the Index file, correctly there, localy in place
Title: Re: sce-import can't customize sce
Post by: Jason W on April 06, 2015, 06:35:00 AM
I said I would ponder it.   And it would not be much to add a no dependencies option, I see where that could be useful for special deployments.

But may I suggest what really is counter productive is in only your second post to this forum call the current system "useless" and basically accuse me of wasting your time.  If you review the forum and git changelog, you will see that almost every suggestion that has been brought up has been implemented unless there is a technical reason otherwise. 
Title: Re: sce-import can't customize sce
Post by: dicorer on April 06, 2015, 08:50:18 AM
I don't think the system is useless, I would never spend time on it if it were!
I mainly complain about all those dependency debs, which I worked hours of analysis to select and get rid of.

Nevermind.
Where can I dl the source code package for sce-import ? I'll do that mod myself,  thanks :)
Title: Re: sce-import can't customize sce
Post by: Jason W on April 06, 2015, 09:11:21 AM
Ok, I understand.  Aare you speaking of a custom Index or Packages file that has the md5 and other info of the local debs?  In that case a -p option combined with the non-dependency option would be what I think you are looking for.  It should only be a few lines of code for a non-dep option.  If that sounds like what you need I can put up a release candidate.  If not, let me know the specifics.

Thanks  :-)
Title: Re: sce-import can't customize sce
Post by: Jason W on April 06, 2015, 11:41:42 AM
http://git.tinycorelinux.net/index.cgi?url=dCore-scripts.git/tree/usr/bin

is where the scripts are.  Line 228 in deb2sce is where the code change would be.  Something like changing:

Code: [Select]
if [ -s /tmp/.targetfile ]; then
echo "Gathering dependency info.."
for I in `echo "$TARGET" && cat /tmp/.targetfile`; do
debGetDeps "$I" > /dev/null 2>&1
done &
/usr/bin/rotdash $!
else
echo "Gathering dependency info.."
debGetDeps "$TARGET" > /dev/null 2>&1 &
/usr/bin/rotdash $!
fi

to

Code: [Select]
if [ ! -f /tmp/.nodeps ]; then
    if [ -s /tmp/.targetfile ]; then
    echo "Gathering dependency info.."
            for I in `echo "$TARGET" && cat /tmp/.targetfile`; do
debGetDeps "$I" > /dev/null 2>&1
    done &
    /usr/bin/rotdash $!
    else
    echo "Gathering dependency info.."
    debGetDeps "$TARGET" > /dev/null 2>&1 &
    /usr/bin/rotdash $!
    fi
fi

/tmp/.nodeps would be created by the nodeps flag.
Title: Re: sce-import can't customize sce
Post by: dicorer on April 06, 2015, 11:53:53 AM
what you told, gave me a nice idea, a custom Index! :)
So I hacked the Index file: that ~12Mb file, I run a simple regex replace, and removed all lines starting with "Depends: ".
That way I got rid of _ALL_ dependencies rightaway.
Then I run sce-import with -l and -p, and that did the trick, it built the new sce only with the 50 debs I said... plus 2 debs.

I said "plus 2", because still a new issue came out (maybe a bug?), somehow 2 more packages called "coreutils" and "crda" were always added to the list.
For my needs, "coreutils" is useless because bb already does that job (in dCore), and "crda" is some stuffs not related to my applications.

Also, yes I confirm, if I unplug the net, sce-import -p still asks for inet connection, even if all debs and Index files are already there offline (adding some kind of "offline" capability to this tool could be nice)
Title: Re: sce-import can't customize sce
Post by: Jason W on April 06, 2015, 12:13:18 PM
Ok, I will look into an offline capability.
Title: Re: sce-import can't customize sce
Post by: dicorer on April 06, 2015, 12:56:25 PM
I'm checking the git you pointed me to, can I ask a question?
why sce-import can't be run as root?
Actually, I already mod my dCore box, to run all as root (I don't need any security)
It's pretty uncomfortable every time, login as tc just to run sce-import, and then exit to root again...
So, I would like to remove that "checknotroot"...

Also, I'm checking out the possibility to add another new option, such as "no-frills".
So that I can remove already at pack time, all those infesting directories I love so much /usr/share/doc, /usr/share/info, /usr/share/man, /usr/share/bug... do you know any more of such directories to remove?
Title: Re: sce-import can't customize sce
Post by: Jason W on April 06, 2015, 05:05:39 PM
Hi dicorer

Running as root is not supported in Core or dCore, and the utilities are meant to run as user by design.

/usr/share/doc
/usr/share/man
/usr/share/menu
/usr/share/lintian

are now removed by default.  /usr/share/bug and /usr/share/info could be removed too.  Of course, the -k "keepdoc" option allows keeping them which is available.
Title: Re: sce-import can't customize sce
Post by: dicorer on April 07, 2015, 01:20:55 AM
in all other distros I played before, direct login as root is also not supported, simply for security reasons - I don't need security.
My question was, what are the technical issues if I remove checknotroot from sce-import+related scripts?

yes, I see it now, the -k option.
It is not reported in the internal help (line 18) nor in the online instructions (http://distro.ibiblio.org/tinycorelinux/dCore/x86/README/)
Anyway, I identified more directories, which I removed, safely for me.

Also I patched sce-import for no-dependencies and no-frills - now it all works perfectly! :)

debGetDeps line ~33, insert:
Code: [Select]
[ -f /root/.myscemod ] && return deb2sce line ~429, insert:
Code: [Select]
if [ -f /root/.myscemod ]; then
rm -r "$TARGET"/usr/share/info
rm -r "$TARGET"/usr/share/bug
rm -r "$TARGET"/usr/share/locale
rm -r "$TARGET"/usr/share/doc-base
rm -r "$TARGET"/usr/share/info
rm -r "$TARGET"/usr/share/perl5
rm -r "$TARGET"/usr/share/perl
rm -r "$TARGET"/usr/share/zoneinfo
fi

I have to confess, I like dCore project more than TinyCore, all my efforts were worth and fruitful.
I might have a bunch of improvements to suggest, to give a definite "spirit" to dCore....
First of all, I would suggest an update of the help/instructions, that will save some efforts to the next dev :)
Title: Re: sce-import can't customize sce
Post by: curaga on April 07, 2015, 01:29:41 AM
Well, if you always run as root, wrong permissions/owner won't be an issue, so you should be able to remove the check. No warranty.
Title: Re: sce-import can't customize sce
Post by: Jason W on April 07, 2015, 06:01:11 AM
dicorer,
Your needs sound pretty specific and I am glad you have got things to work for you.  I am happy to help find solutions, but these changes are probably best left as an individual modification.

And there is documentation I need to catch up on.  Documentation usually lags behind development. 


Title: Re: sce-import can't customize sce
Post by: dicorer on April 07, 2015, 07:09:51 AM
sorry I didn't understand that, please what would be those "pretty specific" needs?
sure I'm going to make few mods, I need a lightweight distro, and dCore now seems getting handy :)

Title: Re: sce-import can't customize sce
Post by: Jason W on April 07, 2015, 08:04:39 AM
Meaning the modifications are specific to your individual case. 
Title: Re: sce-import can't customize sce
Post by: dicorer on April 07, 2015, 09:05:49 AM
okkey...anyway,would you be interested in knowing my opinion?
Title: Re: sce-import can't customize sce
Post by: Jason W on April 07, 2015, 10:05:05 AM
Sure
Title: Re: sce-import can't customize sce
Post by: dicorer on April 07, 2015, 12:01:18 PM
the only reason why I wrote here is because I was thinking the -p option was actually the no-dependencies option, couldn't make it work and needed help.
Clearly I got it all wrong.
But see, it took simply 1 line more in the script to make it happen :)
I made few tests, and I'm pretty happy with it.
If I see now dCore without the no-dependencies option, I would just give it up.
So I want to thank you and all devs here for bringing up dCore project, and if you need any help or new ideas, just ping me ;)