The TinyCoreLinux project for the Raspberry Pi is called piCore Linux and suits my requirements very well. So I want to use it. Therefore I need to "remaster" the image file and add further files.
When I download the current release I get a zip archive with the file piCore-7.0.img
which can be directly burned to a SD card and used. Works fine.
But how to remaster the piCore-7.0.img
file, add new files & scripts and create a new image file, ready to be burned to a SD card?
I looked around the web but most tutorials are really dated or deal with ISO images of TinyCoreLinux.
I tried the method suggested here, and in this case fdisk says:
$ fdisk -l piCore-7.0.img
Disk piCore-7.0.img: 47 MB, 47676928 bytes
...
Units = sectors of 1 * 512 = 512 bytes
...
Device Boot Start End Blocks Id System
piCore-7.0.img1 8192 69631 30720 c W95 FAT32 (LBA)
piCore-7.0.img2 69648 93119 11736 83 Linux
Therefore the boot partition should be mountable using mount -v -o offset=4194304 -t vfat piCore-7.0.img tmp/
. But when I try to mount the rootfs using mount -v -o offset=35659776 -t ext4 piCore-7.0.img tmp2/
I get an error:
mount: enabling autoclear loopdev flag
mount: going to use the loop device /dev/loop1
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so