WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Remastering MC 9 with bootcodes  (Read 1120 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Remastering MC 9 with bootcodes
« on: May 03, 2018, 08:37:15 PM »
Hi all,

My procedure for remastering a standard mc 3.8.4 boot cd isn't working for mc9

Last time I did this (And it was many years ago) I followed the following procedure.

- boot in virutalbox vm with mc iso

- format virtual hard drive space in virtual machine (work space ex: /mnt/sda1/temp)

- use tce-load to install mkisofs-tools.tcz and syslinux.tcz

- attach usb flash drive with qremaster file and mc iso, and copy to /mnt/sda1/temp

- cd to /mnt/sda1/temp (where my iso and qremaster are)

- run following command
Code: [Select]
sudo sh qremaster -t 50 -H syslog= waitusb=8 nodhcp= noautologin= showapps= noutc= tz=EST-10 cron= mc3.8.4.iso output.iso
- Copy output.iso to usb flash drive

- power down this virtual machine

- test output.iso with my boot codes in another vm that has is setup with some apps.

I simply observe the boot up process, it should show me time is set to zone 10. It should show apps at bootup, it should not autologin.

So I'm doing this same old technique for mc 9 and its not working.

Can anyone provide some suggestions or helpful comments ?
Live long and prosper.

Offline polikuo

  • Sr. Member
  • ****
  • Posts: 352
Re: Remastering MC 9 with bootcodes
« Reply #1 on: May 03, 2018, 09:05:05 PM »
- use tce-load to install mkisofs-tools.tcz and syslinux.tcz
...
So I'm doing this same old technique for mc 9 and its not working.

My guess is most likely due to the update of the syslinux.tcz
It had broken the "tc-install" extension before.
See this post

Quote
Since version 5.00, some c32 modules need additional files (libraries) so to work correctly.
Syslinux Wiki
Isolinux Wiki

You'll need ldlinux.c32 which is most likely referring to /usr/local/share/syslinux/ldlinux.c32 on TC.

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: Remastering MC 9 with bootcodes
« Reply #2 on: May 03, 2018, 09:18:57 PM »
Just in case my post is a bit unclear

qremaster is not generating any errors, it is producing output.iso

when I boot from output.iso none of my integrated boot codes are evident.

Live long and prosper.

Offline polikuo

  • Sr. Member
  • ****
  • Posts: 352
Re: Remastering MC 9 with bootcodes
« Reply #3 on: May 04, 2018, 12:42:00 AM »
A quick search with the keyword "qremaster" leads me here and here.

The tcz extensions for newer TC (TC9) are stored in /mnt/disk/tce/optional.

Neither /opt/tce nor /tmp/builtin.

Is your copy of "qremaster" patched ?

You should ask the author @danielibarnes, send him a PM.

Or you could do the remastering manually, that gives you the best flexibility.  :)

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: Remastering MC 9 with bootcodes
« Reply #4 on: May 04, 2018, 07:15:37 AM »
tcz extensions are stored in /mnt/disk/tce/optional on mc 3.8.4 as well.

I'm not trying to integrate tcz's into my boot cd.

I actually use a /mnt/disk/tce folder on my system to store tcz's and settings as per usual.

I just want to integrate "bootcodes" into my boot cd so I don't have to manually enter them each time the server has to reboot for any reason.

I can contact the author of qremaster and see how I go there.

Can you suggest a resource to study to learn how to remaster manually ?

Thanks :)
Live long and prosper.

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5964
Re: Remastering MC 9 with bootcodes
« Reply #5 on: May 04, 2018, 07:44:37 AM »
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

Offline polikuo

  • Sr. Member
  • ****
  • Posts: 352
Re: Remastering MC 9 with bootcodes
« Reply #6 on: May 04, 2018, 08:22:35 AM »
There are many ways in remastering, which generally involves in

Unpacking initrd
Code: [Select]
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

Adding files (make sure the permissions are OK)
Code: [Select]
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

Repacking initrd
Code: [Select]
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

Modifying the ISO files
Code: [Select]
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

Creating ISO file
Code: [Select]
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/

Verifying the ISO
Code: [Select]
qemu-system-x86_64 -m 512 -cdrom /tmp/output.iso

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: Remastering MC 9 with bootcodes
« Reply #7 on: May 07, 2018, 09:31:34 PM »
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: [Select]
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
Save and exit vi

I ran your example to repackage the iso exactly and it works just fine.
Code: [Select]
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/

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
« Last Edit: May 08, 2018, 05:39:46 AM by Rich »
Live long and prosper.

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: Remastering MC 9 with bootcodes
« Reply #8 on: May 07, 2018, 11:26:16 PM »
Ops,

line from my previous post reads

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

It should of said

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

Offline polikuo

  • Sr. Member
  • ****
  • Posts: 352
Re: Remastering MC 9 with bootcodes
« Reply #9 on: May 08, 2018, 01:44:01 AM »
copy Core-9.0.iso to usb flash drive
...
copied output.iso to local fs

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.

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

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

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5964
Re: Remastering MC 9 with bootcodes
« Reply #10 on: May 08, 2018, 05:40:56 AM »
Hi remus
Ops,

line from my previous post reads

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

It should of said

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

Fixed.

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: Remastering MC 9 with bootcodes
« Reply #11 on: May 09, 2018, 08:08:54 PM »
Hi remus
Ops,

line from my previous post reads

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

It should of said

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

Fixed.

Thanks Rich :)

Seems the ability to modify expired before I noticed my low quality keyboard input
Live long and prosper.