WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED: Extensions not loading after TC remaster]  (Read 3824 times)

Offline slo.sleuth

  • Newbie
  • *
  • Posts: 14
[SOLVED: Extensions not loading after TC remaster]
« on: December 16, 2010, 12:34:30 PM »
Good day,

I'm a very new TC user and I am very impressed with the implementation and design, so much so that I would like to adapt it to my purpose: a forensic boot disc which I'll call TinyCore Forensic Edition (out of respect to TC, I want the source of this disk to be known up front).  In short, I want a disc that mounts devices read-only by default and includes forensic recovery tools, some of which I will build and submit to the repository such as afflib, libewf, and sleuthkit.  It is aimed at non-forensics experts, even those with no experience with Linux.

To keep this post from getting too long, I'll avoid the reasoning for my actions (unless asked) and simply discuss what I'm trying to do and what I've already done.

Following the wiki Remastering page, I downloaded the TC 3.3 iso and copied out all the files.  I decompressed tinycore.gz and modified rebuildfstab with the read-only options.  Incidentally, I modified the /boot/isolinux/boot.msg file to reflect the read-only environment and the desktop graphic so that users will know that they do not have TC 3.3 but a variant.  I made no other changes before recompressing tincycore.gz.

Because I performed all this work in Debian, I used genisoimage instead of mkisofs, but used the same flags.  The iso is properly built, boots, and the read-only options are applied.  (However, I seem to have problems with persistence of extensions when saving local, but it could be from lack of experience.)

I plan to distribute the iso to be burned to CD or dd to USB (isohybrid).  I prefer the CD menu system and option select available at boot.  In the case of the USB, I plan to allocate the remaining space to a FAT32 partition for easy transfer of recovered data to other platforms.

Toward that goal, I build the iso with some of the extensions I wanted (dosfstools, ntfs-3g for example) in the /tce/optional directory and built a onboot.lst settings file, but though CD or the partition on the USB containing the /boot and /tce directories is mounted, the extensions are not loaded.  I note that the permissions are root:root which may be the problem.

Am I a going about this in an acceptable way?  Is there a better way?  Is remastering in Debian going to cause me problems I'm not thinking of?

Thanks,
slo.sleuth
« Last Edit: December 17, 2010, 12:48:00 PM by slo.sleuth »

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Remaster guidance sought.
« Reply #1 on: December 16, 2010, 01:09:08 PM »
The OS you use to remaster is not relevant.

Quote
I build the iso with some of the extensions I wanted (dosfstools, ntfs-3g for example) in the /tce/optional directory

You have two choices when remastering:
1) Put extensions into /opt/tce/optional within tinycore.gz (or add another cpio archive in your syslinux.cfg). This means they are loaded into memory on bootup and you can remove the CD/USB device after booting.
2) Put extensions into /tce/optional on the CD/USB drive. The extensions are run from the boot device, but this means that the CD/USB drive must remain in use.

For each extension, make sure you have the .tcz, its .tcz.md5.txt file, and a .dep file if one exists. The tce/onboot.lst file must include a list of extensions to load, one per line.

Quote
I seem to have problems with persistence of extensions when saving local

I don't understand. You put them in /tce/optional but they don't persist? Try to give us a more detailed picture of exactly what your steps were.

Offline slo.sleuth

  • Newbie
  • *
  • Posts: 14
Re: Remaster guidance sought.
« Reply #2 on: December 16, 2010, 01:45:49 PM »
First, thank you for the clarification about the placement of the /tce/optional.  I understand now: 1) inside the cpio archive -- loads to ramdisk; 2) outside archive; runs from storage device.

I'll consider this, but option two is probably my preference, since I am expecting users to primarily boot from a usb device and store recovered data back to the device.  Keeping the ramdisk smaller will provide more process room.

Quote
Quote
I seem to have problems with persistence of extensions when saving local

Quote
I don't understand. You put them in /tce/optional but they don't persist? Try to give us a more detailed picture of exactly what your steps were.

I rebuilt the tinycore.gz cpio archive with the new rebuildfstab and desktop graphic.  No other changes to files in the archive.  I placed the archive back in /boot and added to the iso /tce/onboot.lst and tce/optional.  I placed the extensions, with their md5.txt and .dep file in the /tce/optional I then remastered the iso.  The iso file tree looks like this:

.
├── [drwx------ root     root    ]  boot
│   ├── [-r--r--r-- root     root    ]  bzImage
│   ├── [drwx------ root     root    ]  isolinux
│   │   ├── [-r--r--r-- root     root    ]  boot.cat
│   │   ├── [-r--r--r-- root     root    ]  boot.msg
│   │   ├── [-r--r--r-- root     root    ]  f2
│   │   ├── [-r--r--r-- root     root    ]  f3
│   │   ├── [-r--r--r-- root     root    ]  f4
│   │   ├── [-r--r--r-- root     root    ]  isolinux.bin
│   │   └── [-r--r--r-- root     root    ]  isolinux.cfg
│   └── [-rw-r--r-- jlehr    jlehr   ]  tinycore.gz
└── [drwxr-xr-x root     root    ]  tce
    ├── [-rw-r--r-- root     root    ]  onboot.lst
    └── [drwxr-xr-x root     root    ]  optional
        ├── [-rw-r--r-- root     root    ]  dosfstools-3.tcz
        ├── [-rw-r--r-- root     root    ]  dosfstools-3.tcz.md5.txt
        ├── [-rw-r--r-- root     root    ]  filesystems-2.6.33.3-tinycore.tcz
        ├── [-rw-r--r-- root     root    ]  filesystems-2.6.33.3-tinycore.tcz.dep
        ├── [-rw-r--r-- root     root    ]  filesystems-2.6.33.3-tinycore.tcz.md5.txt
        ├── [-rw-r--r-- root     root    ]  mtd-2.6.33.3-tinycore.tcz
        ├── [-rw-r--r-- root     root    ]  mtd-2.6.33.3-tinycore.tcz.md5.txt
        ├── [-rw-r--r-- root     root    ]  ntfs-3g.tcz
        ├── [-rw-r--r-- root     root    ]  ntfs-3g.tcz.md5.txt
        ├── [-rw-r--r-- root     root    ]  ntfsprogs.tcz
        └── [-rw-r--r-- root     root    ]  ntfsprogs.tcz.md5.txt

On boot, the changes in the archive are present in the running system.  The extensions are not loaded.  Looking carefully at the boot sequence, I note the "message: touch /mnt/hdc/tce/xwbar.lst permission denied" just before the desktop loads.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Remaster guidance sought.
« Reply #3 on: December 16, 2010, 02:11:37 PM »
what is the output of "mount" after booting? What happens when you execute "tce-load -i dosfstools-3.tcz" for example?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Remaster guidance sought.
« Reply #4 on: December 16, 2010, 02:35:04 PM »
Keeping the ramdisk smaller will provide more process room.

No ramdisk, but tmpfs which is using shared mem.

Quote
Looking carefully at the boot sequence, I note the "message: touch /mnt/hdc/tce/xwbar.lst permission denied" just before the desktop loads.

I guess that msg may be related to /mnt/hdc being read-only.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline slo.sleuth

  • Newbie
  • *
  • Posts: 14
Re: Remaster guidance sought.
« Reply #5 on: December 16, 2010, 02:41:58 PM »
what is the output of "mount" after booting? What happens when you execute "tce-load -i dosfstools-3.tcz" for example?

I'm currently running in a VM.  mount shows the cd (/dev/hdc) mounted rw, but mnt/hdc/tce/ is owned by root.  tce-load -i dosfstools-3 and tce-load -i dosfstools-3.tcz result in "dosfstools-3.tcz not found!"

See attached image.
« Last Edit: December 16, 2010, 02:48:37 PM by slo.sleuth »

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Remaster guidance sought.
« Reply #6 on: December 16, 2010, 03:21:09 PM »
What do you get with cat /opt/.tce_dir  ?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Remaster guidance sought.
« Reply #7 on: December 16, 2010, 03:28:25 PM »
what is the output of "mount" after booting? What happens when you execute "tce-load -i dosfstools-3.tcz" for example?

I'm currently running in a VM.  mount shows the cd (/dev/hdc) mounted rw

Not according to screenie.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline slo.sleuth

  • Newbie
  • *
  • Posts: 14
Re: Remaster guidance sought.
« Reply #8 on: December 16, 2010, 03:37:20 PM »
What do you get with cat /opt/.tce_dir  ?

/mnt/hdc/tce



I'm currently running in a VM.  mount shows the cd (/dev/hdc) mounted rw

Not according to screenie.

Yeah, my mistake, sorry.  To be expected from an iso, though.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Remaster guidance sought.
« Reply #9 on: December 16, 2010, 04:20:45 PM »
It is a permissions problem. I can duplicate it rather easily. When mounted, /mnt/hdc has 700 permissions and is owned by 400:401. I think that is because I used cygwin mkisofs though.

Adding "-gid 50 -uid 1001" OR "-r" to my mkisofs parameters fixes the problem. I propose adding "-r" to the wiki remastering page.

I withdraw my earlier comment that the distro doesn't matter. Maybe not directly, but it affects the permissions of the files in your iso.
« Last Edit: December 16, 2010, 04:25:50 PM by danielibarnes »

Offline slo.sleuth

  • Newbie
  • *
  • Posts: 14
[SOLVED: Extensions not loading after TC remaster]
« Reply #10 on: December 16, 2010, 04:32:12 PM »
It is a permissions problem. I can duplicate it rather easily. When mounted, /mnt/hdc has 700 permissions and is owned by 400:401. I think that is because I used cygwin mkisofs though.

Adding "-gid 50 -uid 1001" OR "-r" to my mkisofs parameters fixes the problem. I propose adding "-r" to the wiki remastering page.

Confirmed!  Adding -r corrected the permissions problems.  I had a feeling the Debian environment was the culprit, but I couldn't put my finger on why.  

Thank you D.

I think I should change the topic to [SOLVED: Extensions not loading after TC remaster] since this thread is focused on that issue.  Any objections?
« Last Edit: December 16, 2010, 04:47:26 PM by slo.sleuth »