Tiny Core Linux
General TC => Tiny Core on Virtual Machines => Topic started by: tdarst on October 01, 2025, 01:10:13 PM
-
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!
-
Hi, tdarst.
Sometimes I make a custom.gz for easier maintainance.
Just edit the boot config with somthing like.
INITRD core.gz,custom.gz
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.
-
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:
# 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
What polikuo suggests is probably simpler:
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
Note: Do not edit Linux files using Windows.
Update the boot loader to include custom.gz after core.gz.
-
sounds a bit like termux
https://f-droid.org/packages/com.termux/
-
am assuming OP OT reference to "v86" refers to:
https://github.com/copy/v86
-
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:
# 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
What polikuo suggests is probably simpler:
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
Note: Do not edit Linux files using Windows.
Update the boot loader to include custom.gz after core.gz.
Cool, this is really helpful, thanks for the guidance! I have so far tried method one here. Sorry to bother you for more info but what method do you use to re-pack the iso file? I had a method that was working and I'm not sure if there's something that I'm now doing differently that I'm not realizing, but I'm getting errors now when booting into the re-made iso file about not being able to find /proc/cmdline and mount: you must be root, even if I haven't changed anything after un-packing the iso.
For information my command I'm using is:
mkisofs -l -J -R -V "CoreCustom" \
-b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-o CoreCustom.iso ~/isop/ison/
-
am assuming OP OT reference to "v86" refers to:
https://github.com/copy/v86
This is what I'm referring to.
-
Hi tdarst
I've never needed to make an ISO, but I did some digging
and found this:
mkisofs -pad -l -r -J -V Core -no-emul-boot -boot-load-size 4 \
-boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
-hide-rr-moved -o iso/"$RELEASE".iso master
Also, if you named the initrd core_modified.gz, you also need to
update isolinux/isolinux.cfg to reflect that change:
display boot.msg
default microcore
label microcore
kernel /boot/vmlinuz
initrd /boot/core_modified.gz
append loglevel=3
label mc
kernel /boot/vmlinuz
append initrd=/boot/core_modified.gz loglevel=3
implicit 0
prompt 1
timeout 300
F1 boot.msg
F2 f2
F3 f3
F4 f4