WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to create a .tcz file  (Read 15335 times)

Offline alwanbi

  • Newbie
  • *
  • Posts: 4
How to create a .tcz file
« on: October 12, 2014, 09:20:19 PM »
Can someone give me an example document on how to create a .tcz file so I can add software to PiCore?
Perhaps someone has an example they can share?
I am a fairly new Tiny Core user but I see lots of potential for this distro in use with my Raspberry Pi.
My main goal is to get two software packages added to the distro: motion and fswebcam.

Thanks in advance.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to create a .tcz file
« Reply #1 on: October 12, 2014, 09:33:04 PM »
It's in the wiki.

Offline grandma

  • Full Member
  • ***
  • Posts: 213
  • Never forget Grandma Loves You & made that candy4U
    • Back when a 10MB HD was $500 bucks
Re: How to create a .tcz file
« Reply #2 on: June 04, 2016, 10:32:27 AM »
Hi Gerald,

6 years later
after reading that wiki
100 times
I still can't figure it out.

Is it possible
you and I can work together
so I can rewrite that
so anyone can follow it?

I have made a lot of edu material
for folks like the University of Phoenix
Godaddy, Wadsworth/Thomson Learning etc.

and if you can help me do it
BUILD A TCZ
then I am sure I can write a tutorial
anyone can follow.

Is that possible?

Thank you in advance.





~ Luv Grandma
"When children of all nations
play in the sandbox together
all morning-all day-all week, and
one fine sunny day; all year long ...
... then war will become an ancient memory
and Grandma can knit that sweater
you'll hold near to your heart
until long after you're my age.

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10960
Re: How to create a .tcz file
« Reply #3 on: June 04, 2016, 10:43:33 AM »
Have you read the book? I think the "less" chapter is pretty clear.
The only barriers that can stop you are the ones you create yourself.

Offline grandma

  • Full Member
  • ***
  • Posts: 213
  • Never forget Grandma Loves You & made that candy4U
    • Back when a 10MB HD was $500 bucks
Re: How to create a .tcz file
« Reply #4 on: June 04, 2016, 01:41:15 PM »
Hi Curaga,

Not sure what book you mean, and hence, that "chapter" eludes me as well.
My apology. I try to be psychic - my sister drilled that into me,
but it doesn't always work as planned.

What I do know is that to accomplish something
sometimes you just have to spend 100 - 1000 hours
and keep poking around.

So...instead of banging my head on a wall on the Wiki
I went to YOUTUBE - yeah team...
and found a simple video and came up with this.

Hope it helps others...and saves them
the 1000 plus hours I had invested
over the years...
...trying to get a script to run on boot...
...and making their own TCZ.

Both problems appear solved now.

1. A YouTube video taught me enough
to make this script to automate
building a tcz that worked.

#!/bin/sh
tce-load -i squashfs-tools-4.x.tcz
cd /home/tc
# create the file structure that will hold your tcz
# change the name mylittle to the name of your package
# throughout this script
sudo mkdir -p /home/tc/mylittle/usr/local/tce.installed
cd /home/tc/mylittle/usr/local/tce.installed
# a tcc compiled C program that simply shells a system call to run a shell script
cp /mnt/sdb1/tinycutils/mylittle .
# a shell script that simply echos a HELLO message to a log file in the tmp folder
cp /mnt/sdb1/tinycutils/mylittle.sh .
sudo chmod a=rwx *
# probably should just be rx...but...
cd /home/tc
sudo echo hi >mylittle.tcz
sudo rm mylittle.tcz
# pack it all up
mksquashfs mylittle/ mylittle.tcz
# dump it in optional with other tczs
cd /mnt/sda1/tce/optional
cp /home/tc/mylittle.tcz .
# Then add it to onboot.lst
# ALL DONE

2. BEFORE running this you will need
a simple C program
and a simple shell script.
Folks probably don't need the
C program, but this worked fine.

mylittle.c was

#include <stdio.h>
#include <stdlib.h>
/* #################################### */
main(int argc, char** argv)
{
system("sh /usr/local/tce.installed/mylittle.sh");
exit(0);
}

and mylittle.sh shell script was simply:

#!/bin/sh
sudo echo HELLO >/tmp/mylittle.log

3. If you want the shell script to do
something else (like load extensions,
do a backup, find a file or open a browser)
simply add more instructions.

ALL DONE

Hope this helps.

~ Luv Grandma
"When children of all nations
play in the sandbox together
all morning-all day-all week, and
one fine sunny day; all year long ...
... then war will become an ancient memory
and Grandma can knit that sweater
you'll hold near to your heart
until long after you're my age.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 673
Re: How to create a .tcz file
« Reply #5 on: June 04, 2016, 01:48:13 PM »
I think he think of this book.

http://tinycorelinux.net/corebook.pdf

Offline grandma

  • Full Member
  • ***
  • Posts: 213
  • Never forget Grandma Loves You & made that candy4U
    • Back when a 10MB HD was $500 bucks
Re: How to create a .tcz file
« Reply #6 on: June 05, 2016, 02:45:24 AM »
waaaaaaaaaay kewl
friggn awwwwwwwwesome
~ Luv Grandma
"When children of all nations
play in the sandbox together
all morning-all day-all week, and
one fine sunny day; all year long ...
... then war will become an ancient memory
and Grandma can knit that sweater
you'll hold near to your heart
until long after you're my age.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: How to create a .tcz file
« Reply #7 on: June 05, 2016, 10:12:13 AM »
Hi grandma

the section of the wiki that discusses how to make an extension is here http://wiki.tinycorelinux.net/wiki:creating_extensions

This section takes you through the complete creation starting from compiling the app to submitting the extension. 

the actual section which relates to squashing of extension is only a few descriptive lines because in fairness that part is straight forward and only one command is required to accomplish that task.

to see how an extension is created I found it is better to deconstruct a similar extension to use as a guide then once you've prepared the new extension with required structure simply squash it up.
Commands to deconstruct an extension and squash the new extension are:
Code: [Select]
tce-load -i squashfs.tcz
sudo unsquashfs -d extension_name extension_name.tcz
mksquashfs new_extension new_extension.tcz


If you're concerned that you may not have applied the correct permissions to files contained within the new extension please use the audit extension " submitqc ";  use
Code: [Select]
submitqc  --fix   from the specific directory containing only the tcz you wish to fix,  or
Code: [Select]
submitqc just to check.

« Last Edit: June 05, 2016, 10:21:40 AM by coreplayer2 »