Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: Zlika on January 24, 2017, 10:57:10 AM
-
Hi all,
I try to remaster the piCore image and I have some problems. I already know how to remaster TinyCore, but doing the same with piCore is slightly different and not documented.
* On TinyCore, the simplest way to remaster is to use a separate image with our modifications and boot with two initrd (initrd=/boot/core.gz,/boot/myimg.gz). Is there a way to do something similar with piCore in the config.txt file?
* I then tried to extract the 8.1.5v7.gz file to make changes directly in the image file and repackage the file:
cp /mnt/mmcblk0p1/8.1.5v7.gz /mnt/mmcblk0p2/
cd /mnt/mmcblk0p2/
unzip 8.1.5v7.gz
mkdir src
cd src
cpio -idv < ../8.1.5v7
<!-- Change some files -->
find | cpio -o -H newc | gzip -2 > /mnt/mmcblk0p1/8.1.5v7.gz
I have two questions:
* Even when changing nothing inside the image, the size of the repackaged image is slightly bigger than the original one: how is the original image generated in the first place?
* If I change a file in the opt folder (bootsync.sh, bootlocal.sh, shutdown.sh, tcemirror) the change is not present when I boot (even with no extension loaded). I think these files must be overriden during the boot process but I don't know how: how are we supposed to change bootsync/bootlocal when we remaster?
Thank you for your answers.
-
This is not the correct way to extract the initrd
unzip 8.1.5v7.gz
See http://wiki.tinycorelinux.net/wiki:remastering .
It's valid for piCore as well except for the name of the initrd and I personally don't use advcomp.tcz (advdef).
The files in /opt are probably overwritten by the backup file.
-
For limited bootloaders, you can use the "cat them together" method. Keep the original initrd untouched, and instead of telling the bootloader to use two initrds, tell it to use a combined one.
cat core.gz myimg.gz > combined.gz
-
Hi Zlika
* If I change a file in the opt folder (bootsync.sh, bootlocal.sh, shutdown.sh, tcemirror) the change is not present when I boot (even with no extension loaded). I think these files must be overriden during the boot process but I don't know how: how are we supposed to change bootsync/bootlocal when we remaster?
The directory structure in the initrd is used to set up initial default values of files when booting up. Some of these files may
be overridden depending on which extensions get loaded, what was backed up, and whether you have persistent /home
and/or /opt directories.
-
This is how i do it, and it works.
Extract:
sudo su
mount /mnt/mmcblk0p1/
mkdir /tmp/extract
cd /tmp/extract
zcat /mnt/mmcblk0p1/8.1.5.gz | cpio -i -H newc -d
Compact:
sudo su
mount /mnt/mmcblk0p1/
cd /tmp/extract
find | cpio -o -H newc | gzip -2 > /mnt/mmcblk0p1/8.1.5.gz
-
I just tried with
advdef -z4 8.1.3v7.gz
and it still works.
So advcomp is not the problem.
-
I have no idea if this extension will work for pi but when I was making small changes to the core.gz frequently, I made an extension called core-remaster.tcz. It extracts the original gz file and repacks it after you've made personal modifications. It's easy, no fuss, it's available in the Tc-7 repo and I've been told it works well.
It's worth a try, see core-remaster.tcz.info for details
-
Initrd is created with as below, no tricks:
find | cpio -o -H newc | gzip -9 > initrd.gz
Keep in mind backup which content may modify initrd when restored by the system during startup.
-
coreplayer2,
I could not find core-remaster.tcz in repo... Checked /tinycorelinux/7.x/armv6/tcz and /tinycorelinux/7.x/armv7/tcz . Could you provide more details where it is located?
-
coreplayer2,
I could not find core-remaster.tcz in repo... Checked /tinycorelinux/7.x/armv6/tcz and /tinycorelinux/7.x/armv7/tcz . Could you provide more details where it is located?
In the TC-7 default repo
http://tinycorelinux.net/7.x/x86/tcz/core-remaster.tcz.info (http://tinycorelinux.net/7.x/x86/tcz/core-remaster.tcz.info)
don't forget the deps..
-
Thank you for your answers. My problems with files in opt/ directory was indeed caused by an old backup file :-\