Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Booting an Unsquashed Filesystem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Xenon-linux
n00b
n00b


Joined: 06 Jan 2020
Posts: 2

PostPosted: Mon Jan 06, 2020 12:50 pm    Post subject: Booting an Unsquashed Filesystem Reply with quote

Hello all,

As a hobby project, I am trying to flavor Gentoo targeted for the Xbox 360 Xenon platform. This has been done before though many years ago at this point. I’ve successfully cross compiled a Linux 4.x kernel targeting the Xenon processor as a first step.

Since there is a working albeit vastly outdated live CD image targeting the Xenon CPU, I would like to upgrade it and use the resulting filesystem as a base for my project. My question, is it possible that I can unsuqash the old working live image to a storage device, point the kernel to load the Gentoo system’s init image, and be able to boot that filesystem? Are there modifications that would need to be made to the Gentoo system post-unsquash to allow booting this unsquashed filesystem?

Any insight would be appreciated!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Mon Jan 06, 2020 1:16 pm    Post subject: Reply with quote

Xenon-linux,

Welcome to Gentoo.

A squashfs root is read only. Its designed to be used with an overlay filesystem to make it appear read write.
You can mount the squashfs as a loopback filesystem, as you would an ISO image. After that, you can do what you like with its contents except change them.

You may or may not be able to boot the xbox kernel and userland natively on a PC as it may not have the required hardware support.
If the xbox CPU is different from the PC CPU you may get illegal instruction exceptions.

You should be able to put your kernel into the existing LiveCD and make a new LiveCD.
Replace the kernel in /boot
Replace the kernel modules in /lib/modules (You will need to change the squashfs)
Update the boot loader so it points to your new kernel.
Make a new LiveCD and try it in your xbox.
You might want rewritable media for testing with :)

I suspect you can make a whole new LiveCD with catalyst.
Talk to the experts in #gentoo-releng on freenode. If the existing LiveCD was made that way, they way have all the old spec files that you start from.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Xenon-linux
n00b
n00b


Joined: 06 Jan 2020
Posts: 2

PostPosted: Mon Jan 06, 2020 5:51 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Xenon-linux,

Welcome to Gentoo.

A squashfs root is read only. Its designed to be used with an overlay filesystem to make it appear read write.
You can mount the squashfs as a loopback filesystem, as you would an ISO image. After that, you can do what you like with its contents except change them.

You may or may not be able to boot the xbox kernel and userland natively on a PC as it may not have the required hardware support.
If the xbox CPU is different from the PC CPU you may get illegal instruction exceptions.

You should be able to put your kernel into the existing LiveCD and make a new LiveCD.
Replace the kernel in /boot
Replace the kernel modules in /lib/modules (You will need to change the squashfs)
Update the boot loader so it points to your new kernel.
Make a new LiveCD and try it in your xbox.
You might want rewritable media for testing with :)

I suspect you can make a whole new LiveCD with catalyst.
Talk to the experts in #gentoo-releng on freenode. If the existing LiveCD was made that way, they way have all the old spec files that you start from.


Hi Neddy,

Thank you for your reply and insight!

I understand the mechanics of squashfs. However my end goal is to have a fully usable system installed to a disc. If I were to unsquash the old image, giving me the entire system hierarchy contained therein, to a USB hard disk would that be bootable? I’m restricted to kboot, executed by a custom boot loader for the 360 (Xenon Linux Loader), but I can pass kernel command lines. I can give kboot the root device (usb hard disk), the location of my kernel, the initrd/ramfs file, etc.

If not, I agree that the best course of action would be to use the method you mentioned to effectively use the old livecd to bootstrap a new one. Since the 360 architecture is powerp64 big endian, I would have to boot the old livecd on the console, ssh into my development machine, unsquash a copy of the old livecd’s image from there and modify/upgrade the system. I suppose from there I could follow standard Gentoo installation procedures, install to my usb disk, then pass kboot the parameters mentioned earlier. I am trying to skip the step of creating a new live image if possible.

Thanks again!!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Mon Jan 06, 2020 6:10 pm    Post subject: Reply with quote

Xenon-linux,

It wouldn't just boot. On the liveCD, the squashfs is loopback mounted as root. Its a file system in a file.

You can dig the initscript and kernel command line out of the liveCD so see how its done.

If you copy the content of the squsahfs to a read write filesystem on USB it may boot.
You would need to change the kernel command line and maybe the init script too.

What about a qemu-static chroot on a PC?
None of the xbox peripheral hardware would be emulated but you could chroot and execute the code.
It all depends how good the QEMU emulation is for big endian PPC.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Tue Jan 07, 2020 3:10 pm    Post subject: Reply with quote

I recently did the same thing with my PS3 with is a CELL ppc64 arch. I used crossdev to get a toolchain going and then built the whole system with cross-emerge. It was surprisingly easy.

But if you want to save the old image, if you can mount it, you can save it. You just mount it, and then tar it. Thats it. Unmount, untar. Job done.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum