SliTaz SliTaz Forum

You are not logged in.

#1 2016-09-30 17:46:05

RufusL
Member
Registered: 2016-09-30
Posts: 4

tazlito - how to add files to a custom liveCD?

Hi,

I'm trying to generate a custom liveCD.

I am able to download a flavor (like justx) and add packages to it. But how do I add files to it?

I would like, for example, a desktop icon.

I tried making a dir to /home/slitaz/5.0/distro/rootfs/home/tux/Desktop/myfile, but that file doesn't end up in my custom liveCD, after I run tazlito gen-distro.

I also would like to know how to run a custom command, like pcmanfm -d. I tried adding a script to /home/slitaz/5.0/distro/rootfs/etc/init.d/ but it seems it was not executed (the test command was a touch command - no file was created).

Similar attempt was made to /home/slitaz/5.0/distro/rootcd

Thanks.

Offline

#2 2016-09-30 21:55:57

Genesis
Member
Registered: 2014-07-03
Posts: 109

Re: tazlito - how to add files to a custom liveCD?

Hi RufusL!

I use this command to generate a Live CD as a ISO file that can be burned onto a CD:

[c]# tazlito writeiso lzma[/c]

I use to download the rolling version of SliTaz, burn a CD and boot the computer using the standard CD. After the system boots up, modify anything you want (install packs, add personal files, wallpapers, etc.) and then use #tazlito writeiso

After that, your personal LiveCD is at /home/slitaz/distro/slitaz.iso

To run a custom command, you should create a symlink to your command pointing to /usr/bin:

[c]# ln -s <complete path of your command> /usr/bin[/c]

Hope this helps.

Have a nice day!

Offline

#3 2016-10-01 01:24:32

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: tazlito - how to add files to a custom liveCD?

Mkdir -p the absolute file path from root to the custom file your adding in the addfiles folder.

[c]mkdir -p addfiles/home/tux/Desktop[/c]

[c]cp custom.desktop addfiles/home/tux/Desktop[/c]

If your replacing an existing file such as slitaz-background.jpg give the custom file the same name so it overwrites.

To modify the root tree directly extract the iso:

[c]tazlito extract-distro <name.iso>[/c]

Make the changes.

Generate the iso from the modified root tree:

[c]tazlito gen-initiso <new.name.iso>[/c]

Scripts must have correct permissions.

To auto-run on boot the script name has to be added to /etc/rcS.conf RUN_SCRIPTS=

Offline

#4 2016-10-01 19:25:38

RufusL
Member
Registered: 2016-09-30
Posts: 4

Re: tazlito - how to add files to a custom liveCD?

@Genesis:

That didn't work. I downloaded slitaz-rolling, started in VirtualBox, then installed Firefox and tried your command. The generated ISO had only 18MB (slitaz-rolling has 45MB).

When I tried booting, I got a kernel panic saying:

RAMDISK: Couldn't find valid RAM disk image starting at 0.

VFS: Cannot open root device "null" or unknown-block(0,0)

@mojo:\

I'll try that and come back here. So, regarding files, the only difference is I should copy them to addfiles, not rootfs or rootcd?

About the scripts, I should create that variable inside /etc/init.d/rcS, like RUN_SCRIPTS=script1.sh,script2.sh? Can you give me an example?

Offline

#5 2016-10-01 20:44:55

RufusL
Member
Registered: 2016-09-30
Posts: 4

Re: tazlito - how to add files to a custom liveCD?

I copied to addfiles/home/tux and it was not created in my liveCD sad

Offline

#6 2016-10-01 23:07:40

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: tazlito - how to add files to a custom liveCD?

It's been a few years,I should have read tazlito script.

http://hg.slitaz.org/tazlito/file/6a5f1eda8d1b/tazlito

I forgot the rootfs folder:

[c]mkdir -p addfiles/rootfs/home/tux/Desktop[/c]

[c]cp custom.desktop addfiles/rootfs/home/tux/Desktop[/c]

# Copy all files from $ADDFILES/rootfs to the rootfs.

        if [ -d "$ADDFILES/rootfs" ] ; then

            action 'Copying addfiles content to the rootfs...'

            cp -a $ADDFILES/rootfs/* $ROOTFS

            status

        fi

If you had a reason to add a file to rootcd:

[c]mkdir -p addfiles/rootcd/<your.file.here>[/c]

The slitaz flavors only have README and index.html

The iso has to be loop mounted to see the contents of rootcd.

# Copy all files from $ADDFILES/rootcd to the rootcd.

        if [ -d "$ADDFILES/rootcd" ] ; then

            action 'Copying addfiles content to the rootcd...'

            cp -a $ADDFILES/rootcd/* $ROOTCD

            status

        fi

Offline

#7 2016-10-02 14:04:57

Genesis
Member
Registered: 2014-07-03
Posts: 109

Re: tazlito - how to add files to a custom liveCD?

@RufusL:

You didn't mention that you are using Virtualbox. My procedure works if you boot your PC using a real SliTaz LiveCD. (It'll work entirely on RAM and won't affect your hard drive.)

Maybe it's the cause of that error message you got...

I think mojo's procedure is the most suitable to your case.

Offline

#8 2016-10-03 17:58:58

RufusL
Member
Registered: 2016-09-30
Posts: 4

Re: tazlito - how to add files to a custom liveCD?

What am I doing wrong?

[c]

sudo su

# tazlito get-flavor justx && tazlito extract-flavor justx

# cd /home/slitaz/5.0/distro/addfiles/rootfs

# mkdir -p home/tux

# touch home/tux/some-file

# cd /home/tux

# tazlito gen-distro distro-packages.list # This filename can be incorrect because I shutted down before taking note, but it was the correct name.

(Chose no to repack packages from rootfs)

[/c]

I can't login with the generated ISO. I always get "Failed to execute login command" instead of the automatic login I was getting before. With justx or any other flavour.

Offline

#9 2019-02-15 15:55:02

benchonaut
Member
Registered: 2019-02-15
Posts: 2

Re: tazlito - how to add files to a custom liveCD?

@RufusL

Sounds strange , but when you create one file in the user home directory, you kill it completely ( i tried around with overlay initramfs) ..  '

the tux home is generated at boot if its empty , and all the login stuff is also generated at boot ( if not fully present on disk already)

Offline

#10 2019-02-15 17:48:32

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: tazlito - how to add files to a custom liveCD?

Note you can use iso2exe:

See /usr/share/boot/README.custom and/or http://doc.slitaz.org/en:guides:bootguide

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]