Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: xho95 on March 29, 2017, 02:30:56 AM
-
I have been building a system which checks computer information with in a PXE server-client system for several weeks.
My goal is running my program automatically on tiny core linux immediately after boot time.
I read the Netbooting(http://wiki.tinycorelinux.net/wiki:netbooting (http://wiki.tinycorelinux.net/wiki:netbooting)) article. However, that method uses the tiny core linux as the server side, so I can't use it.
I have built the pxe booting system with Ubuntu 16.04 for server and Tiny Core linux for client, and succeed booting with ISO file of Tiny Core linux.
After then I have tried to change the `bootlocal.sh` file to test the remastering of Tiny Core linux according to the Remastering TC(http://wiki.tinycorelinux.net/wiki:remastering (http://wiki.tinycorelinux.net/wiki:remastering)) article.
However, executing the below command on Ubuntu 16.04 make wrong cpio file in the gz file.
$ sudo find | sudo cpio -o -H newc | gzip -2 > ~/Documents/core.gz
As shown below, the core.cpio file is crashed, so It can't boot with the PXE system.
(http://xho95.github.io/assets/TinyCore/tiny-cpio-error.png)
Below are the commands which I used to make ISO file.
$ sudo mkdir /mnt/temp
$ sudo mount ~/Downloads/Tiny-Origin/TinyCore-current.iso /mnt/temp -o loop,ro
$ cp -a /mnt/temp ~/Documents/temp
$ sudo mv ~/Documents/temp/boot/core.gz ~/Documents/temp
$ sudo umount /mnt/temp
$ sudo mkdir ~/Documents/temp/extract
$ cd ~/Documents/temp/extract
$ zcat ~/Documents/temp/core.gz | sudo cpio -i -H newc -d
$ sudo vi bootlocal.sh
$ sudo geidt bootlocal.sh
echo "hello, world"
$ cd ~/Documents/temp/extract
$ sudo find | sudo cpio -o -H newc | gzip -2 > ~/Documents/core.gz
$ cd ~/Documents
$ advdef -z4 core.gz
$ cd ~/Documents/temp
$ sudo mv ~/Documents/core.gz boot
$ sudo mkdir newiso
$ sudo mv boot newiso
$ sudo mv cde newiso
$ sudo mkisofs -l -J -R -V TC-custom -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -o TC-remastered.iso newiso
$ rm -rf newiso
Are there any mistakes or are there any other solutions?
I needs your help, Thank you.
-
There's no mistakes, Ubuntu is just confusing you with its file name detection. Your core.gz is fine, it just happens to be the same name Ubuntu uses for crash reports.
Also, bootlocal.sh does not run interactively, so you likely won't see that echo. Echo into a file instead.
echo "Hello" > /tmp/test
-
Thank you for your reply.
However, as your reply, Tiny Core linux would be booted well within the PXE system.
But in my case, it doesn't work as shown below.
(https://xho95.github.io/assets/TinyCore/os-not-found.jpg)
I only extracted and re-compressed the Tiny Core linux, but did nothing else.
And core.cpio is the only difference.
(https://xho95.github.io/assets/TinyCore/cpio-correct.png)
Above is the correct one and the below is mine that is crashed.
(https://xho95.github.io/assets/TinyCore/tiny-cpio-error.png)
Anyway, is there other solution that can run my own program or tcz file (?) on the Tiny Core linux without changing core.gz file?
Thank you.
-
Anyway, is there other solution that can run my own program or tcz file (?) on the Tiny Core linux without changing core.gz file?
TC can handle multiple initrds, just create your own .gz and modify the config file.
Assume that you're using syslinux:
DEFAULT tc
LABEL tc
KERNEL /boot/vmlinuz
INITRD /boot/core.gz,/boot/my_own_core.gz
APPEND .....
-
Thank you for your reply.
But as you know, I can't use the syslinux, should use the pxelinux.
And anyway if I will make my own core.gz, it should be compressed by cpio and it will be crushed as like before.
Therefore I want to know the method that use the original core.gz with my tcz program file - my own extension(?). And my tcz program should start immediately after the boot time.
Could you explain the process for it or tell me a link of some useful data?
Thank you.
-
Could you explain the process for it or tell me a link of some useful data?
How I remaster
# make a root directory
mkdir -p /tmp/root/opt
# do some modification
echo 'echo Hello world > /tmp/remaster.txt' > /tmp/root/opt/bootlocal.sh
# chmod, chown
sudo chmod 775 -R /tmp/root/opt
sudo chown root:staff -R /tmp/root/opt
# compress
cd /tmp/root
sudo su
find | cpio -o -H newc | gzip -9 > /tmp/my_own_core.gz
That's it ! :D
I don't run "advdef"
-
Under the unlikely chance that Ubuntu's cpio really is that buggy, do your work under a different OS, such as TC?
-
If you use an NFS directory for your tce directory, you don't need to remaster at all. It works just like a hard/thumb drive.
-
Thank you everybody.
As your suggestion, I made a Tiny Core bootable CD and booted with it.
(https://xho95.github.io/assets/TinyCore/cd-booting.jpg)
If I do all the work on this Tiny Core linux, everything is going to well. OK?
And is it right that I have to work here to develop my program to create a tcz file?
Anyway I'm going to try a few things.
Thank you.