Work in progress
I just recently started going through my notes... I had quite some attempts and problems with spells (dependencies, some fixes for install root; special new architecture stuff). A good idea to be prepared for troubles is reading the LinuxFromScratch book.
Before finishing this, I have to check what parts of the spell hacking I did are still needed with current (test!) grimoire. I had to fix interdependencies of basesystem spells and the occasional INSTALL (to work with INSTALL_ROOT).
Another common issue are missing system accounts; generally stuff that the ISO provides without comment. Much of that could be fixed in current grimoire (at least will be soon, when I have revised my notes), some stuff needs manual care. System accounts are notorious since during the first chroot cast phase, the host account database is being modified (as it is needed for subsequent chown to really work).
On entering chroot, account database will be empty!
Note: There is an attempt to freshen up the grimoire account code to be more sane and perhaps handle this situation, too.
Introduction
This is an attempt to remember and describe what I did to get Sourcemage installed on my Alpha box. This may be interesting to you, too - not because it is an Alpha box but because I needed to install without Sourcemage ISO or chroot tarball. That left installation of another Linux Distribution (Gentoo) and building a new Sourcemage one from within this system as the most easy route.
I call this method
Possession
It is about the process of Sourcemage taking possession of a box; entering with the help of some host and then breaking free to take over control.
The steps:
- Installation of Host system with toolchain
- Installation of sorcery
- Configuration of sorcery
- Cast minimal spell set for having a chroot (baresystem)
- Entering the chroot and rebuild / build the rest of basesystem
- Make it bootable
Installation of Host system with toolchain
You need something to start with installed on the system you want to be possessed. I'm not talking about cross-compiling; I talk about having a working (current) linux environment on the very same box you want to have your SMGL system on or one with compatible architecture if you want to prepare the root filesystem and copy it over later.
You need
GNU toolchain: gcc, glibc with headers
bash (sorcery really wants that;-)
installwatch if you want to be able to dispel stuff in the early phase
gnupg if you want to verify downloaded sources
It could prevent trouble to ensure that you have a system on a comparable level of freshness with Sourcemage. I don't know where the border line is there, but I used the current gentoo at the time and already had stuff failing to run with installed libs after having been dynamically linked to host ones (readline/ncurses - duh!).
Installation of sorcery
Get sorcery tarball, extract, run
./install
to install the sorcery scripts in your host system. That itself should not do any harm.
Configuration of sorcery
...to install to some directory (partition), unless you want to infect and rebuild the system in itself Also setting up LDFLAGS and CPPFLAGS to search in INSTALL_ROOT and for static linking... more on that later when I figured out what was the final working approach.
This is in fact the tricky part;-)
Cast minimal spell set for having a chroot (baresystem)
scribe add test
Should give you a grimoire for sorcery to work with...
I prepared a stripped basesystem spell (called baresystem) that omits stuff that is needed for a basic system but that is not needed for entering the chroot and (re)building, with following DEPENDS:
depends bash && depends binutils && depends bzip2 && depends coreutils && depends cpio && depends dialog && depends diffutils && depends file && depends findutils && depends gawk && depends gcc && depends glibc && depends gnupg && depends grep && depends gzip && depends installwatch && depends less && depends make && depends nano && depends ncurses && depends patch && depends procps && depends readline && depends sed && depends shadow && depends smgl-archspecs && depends smgl-fhs && depends tar && depends texinfo && depends unzip && depends util-linux && depends wget && depends zlib
That's not too different from current basesystem and omissions coud be dealt with by fixing spells... but anyway, it maybe a good idea to separate a basic build system out of basesystem. For now, just be warned that spells not on this list may have issues with being casted into some $INSTALL_ROOT (from non-SMGL system).
Problems that occur are mostly because of
installation to other place than /
some spells run programs in INSTALL/FINAL that doesn't operate install target area (p.ex. ncurses)
dynamic library paths... static linking should avoid this
spells not creating groups/users they need
p.ex. init.d needed addition of kmem, tty, lp, ppp, disk, floppy, audio
some spells are fixed, some may need to be fixed (soon?)
Entering the chroot and rebuild / build the rest of basesystem
Prepare chroot with (bind) mouting /dev, /proc, /sys ...
make sure etc/resolv.conf is working for sources download or provide all needed tarballs in var/spool/sorcery
create /etc/passwd at least with line for root (?)
consider copying the very same grimoire
install sorcery
configure sorcery without $INSTALL_ROOT and custom flags for that
...
cast basesystem
Note: You may choose erase the installed spell database / not having it stored in the chroot in the first place to make sure everything is built (again), otherwise I'd do a sorcery rebuild.
In an ideal world spells would create all the accounts they need and would create files like /etc/ld.so.conf and /etc/modules ... not sure how far we are there yet. I should make it sure;-) Just make sure you checked the basic sanity of your system (in /etc, mainly).
Oh, and you may have the subconscious desire to compile/install a kernel - feel free to follow it;-)
That would be
cast linux
with the spell or just downloading/extracting a linux source tarball and configuring/building yourself.
Make it bootable
Don't forget your /etc/fstab!
well,
cast <bootloader>
and configure/install it. When you want that kind of install you probably know how to install a bootloader;-)
