WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Using base bootcode - how to start X?  (Read 3591 times)

Offline jrm7262

  • Newbie
  • *
  • Posts: 22
Using base bootcode - how to start X?
« on: January 25, 2011, 03:04:08 AM »
Hi All,

           Is it possible to start X when booting microcore with the base bootcode?

My understanding is that when booting with base bootcode the whole of the tce directory is ignored, so Xlibs.gz and Xprogs.gz are never seen.
I then mount the device containing my tce directory but tce-load doesn't appear to recognise .gz files.
So, how can I load Xlib and Xprogs? And will this then allow me to startx?

(X works fine when booting without the base bootcode, so I'm assuming all necessary files are present and correct)

Kindest regards
James



Offline hiro

  • Hero Member
  • *****
  • Posts: 1217
Re: Using base bootcode - how to start X?
« Reply #1 on: January 25, 2011, 04:05:07 AM »
Try vi `which tce-setup` and search for process_gz, it takes your tce dir as a parameter.

What it does is this for each .gz file:
cd /
zcat "$FILE" | cpio -iu -H newc

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Using base bootcode - how to start X?
« Reply #2 on: January 25, 2011, 05:44:45 AM »
You can specify the path of additional cpio archives as boot parameters, e.g. something along the lines of:
Code: [Select]
initrd=/boot/microcore.gz,/tce/Xlibs.gz,/tce/Xprogs.gz
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline jrm7262

  • Newbie
  • *
  • Posts: 22
Re: Using base bootcode - how to start X?
« Reply #3 on: January 25, 2011, 11:41:31 AM »
Thank you Hiro and Tinypoodle for the replies.

Method 2 (specifying additional cpio archives as boot parameters) Works and allows me to start X but isn't quite what I'm trying to achieve. That is boot the smallest possible resource using system and then load programs/resources as and when needed. So I can work from the command line and squeeze maximum performance out of my old eeepc-2g, and then use the framebuffer, X and anything else only when required.

Method 1 (using vi/zcat) Sorry I'm not sure what you mean with vi 'which tce-setup'
If I use tce-setup /mnt/sda1/tce/Xlibs.gz (and Xprogs.gz) then this lets me run X.
What am I trying to achieve with vi in this instance?

The interesting thing is that method 2 uses less of the tmpfs than a normal boot and method 1 uses more. Whereas I would have thought method 1 should use the least amount of resources.

My normal boot uses  ------------------- 19Mb of tmpfs
A base boot uses        -------------------  9mb
A method 2 boot uses ------------------- 16mb
A base boot then using method 2 uses - 23Mb

Kindest regards
James

Offline jrm7262

  • Newbie
  • *
  • Posts: 22
Re: Using base bootcode - how to start X?
« Reply #4 on: January 25, 2011, 11:45:42 AM »
edit

A base boot then using method 1 uses - 23Mb

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Using base bootcode - how to start X?
« Reply #5 on: January 25, 2011, 11:58:02 AM »
Immediately before each measuring do:
Code: [Select]
sudo cache-clearto drop cache, otherwise any numbers are meaningless   ;)

Regarding framebuffer under TC, not sure if booting without and later switching to framebuffer would be possible.
Or have you found a way to do so?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Using base bootcode - how to start X?
« Reply #6 on: January 25, 2011, 01:58:26 PM »
tinypoodle: In reply#2 he would still have to use the base bootcode to prevent the TCE
directory from being loaded too.
jrm7262: I think hiro was just pointing to the mechanism used in that script file to extract
the gz contents. By running the script you might be doing alot more than just extracting X.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Using base bootcode - how to start X?
« Reply #7 on: January 25, 2011, 03:27:33 PM »
Just to be clear, the command sequence in reply #1 (as extracted from 'tce-setup') needs to be run as 'root'.

And as a further nitpick I'd use zcat "$FILE" | sudo cpio -idmu Since AFAIK '-H newc' is only required when creating a cpio-archive and the '-d' and '-m' options are my "personal default" for cpio-archive extraction to ensure that directories are getting created and the modification timestamps are kept intact.