General TC > Tiny Core on Virtual Machines
Booting Core with custom files on top of the standard files
tdarst:
Hi, I'm not a super experienced Linux user by any stretch and I'm new to this community, so bear with me please.
I am working on utilizing Core with something called V86 to deliver users a working Linux terminal in their browser but I would like to be able to create variations of the ISO file to automatically boot into different scenarios.
Since the user will get a fresh boot every time they access the pages hosting this terminal I was trying to edit the core.gz file, specifically this part
^@^@^@070701030B8027000081ED00000000000000320000000168D5627C00000033000000080000000200000000000000000000001100000000opt/bootlocal.sh^@^@#!/bin/sh
# put other system startup commands here
mkdir /testdir
with /testdir as my check to see if I was successfuland then zip it back up and re-create the ISO. However when I re-create the ISO and boot back into it in the browser, bootlocal.sh just shows
#!/bin/sh
# put other system startup commands here
So I'm guessing that I am editing the wrong thing. But I feel kind of lost and was hoping somebody could help point me in the right direction.
Thanks!
polikuo:
Hi, tdarst.
Sometimes I make a custom.gz for easier maintainance.
Just edit the boot config with somthing like.
--- Code: ---INITRD core.gz,custom.gz
--- End code ---
That's syslinux, you'll need to look up syntax for grub2.
The files in the later gz should be able to overwrite the earlier ones.
Rich:
Hi tdarst
Welcome to the forum.
You can't edit core.gz directly. You need to unpack it, edit the file
of interest, then repack it:
--- Code: ---# Pack/unpack core.gz
# To unpack
tc@E310:~$ mkdir tempdir
tc@E310:~$ cd tempdir
tc@E310:~/tempdir$ zcat /path/to/existing/core.gz | sudo cpio -i
# Make changes to ~/tempdir/opt/bootlocal.sh
# To repack
tc@E310:~$ cd ~/tempdir
tc@E310:~/tempdir$ sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/core_modified.gz
# Point the boot loader to core_modified.gz instead of core.gz
--- End code ---
What polikuo suggests is probably simpler:
--- Code: ---tc@E310:~$ mkdir -p tempdir/opt
tc@E310:~$ cd tempdir/opt
tc@E310:~$ touch bootlocal.sh
tc@E310:~$ chown tc:staff bootlocal.sh
tc@E310:~$ chmod 775 bootlocal.sh
# Edit ~/tempdir/opt/bootlocal.sh so it contains the contents you want
# To pack
tc@E310:~$ cd ~/tempdir
tc@E310:~/tempdir$ sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/custom.gz
--- End code ---
Note: Do not edit Linux files using Windows.
Update the boot loader to include custom.gz after core.gz.
gadget42:
sounds a bit like termux
https://f-droid.org/packages/com.termux/
gadget42:
am assuming OP OT reference to "v86" refers to:
https://github.com/copy/v86
Navigation
[0] Message Index
[#] Next page
Go to full version