General TC > Remasters / Remixes - Unofficial

Remastering MC 9 with bootcodes

<< < (2/3) > >>

Rich:
Hi remus
If all you want to do is modify the boot codes in the ISO, you could always cheat:
http://forum.tinycorelinux.net/index.php/topic,9857.msg53876.html#msg53876

polikuo:
There are many ways in remastering, which generally involves in

Unpacking initrd

--- Code: ---tc@box:~$ sudo mkdir /tmp/extract
tc@box:~$ cd /tmp/extract
tc@box:/tmp/extract$ zcat /path/to/core.gz | sudo cpio -i -H newc -d

--- End code ---

Adding files (make sure the permissions are OK)

--- Code: ---tc@box:/tmp/extract$ sudo unsquashfs -d . -f /etc/sysconfig/tcedir/optional/mylocale.tcz
tc@box:/tmp/extract$ ls -l usr/lib/locale/locale-archive
-rw-r--r--    1 root     root       3702256 Jul 19  2017 usr/lib/locale/locale-archive

--- End code ---

Repacking initrd

--- Code: ---tc@box:/tmp/extract$ sudo su
root@box:/tmp/extract# find | cpio -o -H newc | gzip -9 > /tmp/my_own_core.gz
root@box:/tmp/extract# exit
tc@box:/tmp/extract$ cd /tmp
tc@box:/tmp$ ls -l /tmp/my_own_core.gz
-rw-r--r--    1 root     root      10678758 May  4 22:46 /tmp/my_own_core.gz

--- End code ---

Modifying the ISO files

--- Code: ---tc@box:/tmp$ mkdir /mnt/CD /tmp/cdroot
tc@box:/tmp$ sudo mount /path/to/TC.iso /mnt/CD
tc@box:/tmp$ cp -r /mnt/CD/boot /tmp/cdroot
tc@box:/tmp$ chmod +w /tmp/cdroot/boot/isolinux/isolinux.cfg
tc@box:/tmp$ vi /tmp/cdroot/boot/isolinux/isolinux.cfg
...
        append loglevel=3 lang="zh_TW.utf8"
...
tc@box:/tmp$ sudo cp -f /tmp/my_own_core.gz /tmp/cdroot/boot/corepure64.gz

--- End code ---

Creating ISO file

--- Code: ---sudo mkisofs -l -J -R -no-emul-boot \
-V TC-custom \
-boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.cat -quiet -r \
-o output.iso /tmp/cdroot/

--- End code ---

Verifying the ISO

--- Code: ---qemu-system-x86_64 -m 512 -cdrom /tmp/output.iso

--- End code ---

remus:
Thanks polikuo

Your examples have worked perfectly.

I'll document 'here' exactly what I did to remaster a stock Core-9.0.iso file and integrate a few boots codes.

Setup basic VirtualBox virtual Machine (setting network to 'bridged', setting storage/optical drive to 'Core-9.0.iso')

Boot up vm

copy Core-9.0.iso to usb flash drive

attach usb flash drive to my vm

mount the usb flash drive in vm using $ mount /mnt/sdb1

installed mkisofs-tools
$ tce-load -wi mkisofs-tools

Executed the following commands as per your example


--- Code: ---tc@box:/tmp$ mkdir /mnt/CD /tmp/cdroot
tc@box:/tmp$ sudo mount /mnt/sdb1/Core-9.0.iso /mnt/CD
tc@box:/tmp$ cp -r /mnt/CD/boot /tmp/cdroot
tc@box:/tmp$ chmod +w /tmp/cdroot/boot/isolinux/isolinux.cfg
tc@box:/tmp$ vi /tmp/cdroot/boot/isolinux/isolinux.cfg

...
        append loglevel=3 syslog waitusb=5 nodhcp noautologin showapps noutc tz=EST-10 cron
...
# I also altered the timeout option to make bootup quicker
        timeout 30

--- End code ---
Save and exit vi

I ran your example to repackage the iso exactly and it works just fine.

--- Code: ---sudo mkisofs -l -J -R -no-emul-boot \
-V TC-custom \
-boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin \
-c boot/isolinux/boot.cat -quiet -r \
-o output.iso /tmp/cdroot/
--- End code ---

copied output.iso to usb flash drive
$ cp output.iso /mnt/sdb1
$ sudo umount /mnt/sdb1

ejected the usb flash drive from the vm using virtualbox interface

Windows kindly detected and auto mounted the drive to its fs

copied output.iso to local fs

selected output.iso as a virtual cd for boot up in VirtualBox vm storage settings

booted vm and all boot codes are now integrated to the iso.

Thanks :)

    [EDIT[: Fixed typo. Changed  not  to  now.  Rich

remus:
Ops,

line from my previous post reads


--- Quote ---booted vm and all boot codes are not integrated to the iso.
--- End quote ---

It should of said

booted vm and all boot codes are now integrated to the iso.

polikuo:

--- Quote from: remus on May 08, 2018, 12:31:34 AM ---copy Core-9.0.iso to usb flash drive
...
copied output.iso to local fs

--- End quote ---

To copy files between VMs to the host, I sometimes create an image in VHD format and treat it like a "SHARE disk".

1. create a VHD image with virtualbox
2. format the disk in the VM (I usually go for ext4 or fat32)
3. copy files and close the VM
4. mount the VHD image via windows disk management tool
5. assign letter to the partition
6. move the files elsewhere

I use "Ext2Fsd" to assign the volume letter if the partition contains ext4 file system.


--- Quote from: remus on May 08, 2018, 02:26:16 AM ---booted vm and all boot codes are now integrated to the iso.

--- End quote ---

Good, for a moment I thought it didn't work.  :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version