My K1 now has an SD card in it with a file called "armv4l_rootfs.ext3". My RUNME.sh script mounts that file at "/mnt/us/mnt/armv4l_rootfs". It contains a copy of the file trees for both the K1 FW 1.2 rootfs image AND for the aboriginal linux armv4l toolchain image.
My RUNME.sh script mounted it, and (amongst other things) did a "gcc -v" from within it, so that we can verify that gcc runs on my (unmodified) K1. There are no changes to the kindle filesystem (other than /mnt/us and the SD card on /mnt/mmc).
Here are the logged results of this test:
PHP Code:
#> cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev sockfs
nodev usbfs
nodev usbdevfs
nodev pipefs
nodev tmpfs
nodev devpts
ext3
ext2
squashfs
nodev ramfs
msdos
vfat
nodev devfs
nodev mqueue
rfs
#> mount -o loop,noatime,nodiratime -t ext3 /mnt/mmc/img/armv4l_rootfs.ext3 /mnt/mmc/mnt/armv4l_rootfs
#> mount
devfs on /dev type devfs (rw)
/dev/bml0/6 on / type squashfs (ro)
/dev/stl0/8 on /opt type ext3 (rw,sync,noatime,nodiratime)
/proc on /proc type proc (rw,nodiratime)
sysfs on /sys type sysfs (rw)
devfs on /dev type devfs (rw)
/dev/stl0/9 on /mnt/us type vfat (rw,noatime,nodiratime,fmask=0022,dmask=0022)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw)
/dev/bml0/7 on /mnt/dc type squashfs (ro)
/dev/mmc/blk0/part1 on /mnt/mmc type vfat (rw,sync,dirsync,noatime,nodiratime,fmask=0022,dmask=0022)
/dev/loop/0 on /mnt/mmc/mnt/armv4l_rootfs type ext3 (rw,noatime,nodiratime)
#> ls -al /mnt/mmc/mnt/armv4l_rootfs
drwxr-xr-x 16 root root 1024 May 26 2016 .
drwxr-xr-x 5 root root 32768 May 26 10:52 ..
drwxrwx--- 2 root 999 1024 May 8 07:33 bin
drwxrwx--- 3 root 999 1024 May 8 07:43 dev
-rwxrwx--- 1 root 999 7 Jan 29 2009 etc
drwxrwx--- 2 root 999 1024 Jan 29 2009 home
-rwxr-xr-x 1 root root 428 Jan 11 19:28 init
drwxrwx--- 2 root 999 1024 Jan 29 2009 initrd
drwxrwx--- 2 root 999 1024 May 8 07:43 lib
-rwxrwx--- 1 root 999 11 Jan 29 2009 linuxrc
drwx------ 2 root root 12288 May 26 2016 lost+found
drwxrwx--- 5 root 999 1024 May 8 07:43 mnt
drwxrwx--- 2 root 999 1024 Jan 29 2009 opt
drwxrwx--- 2 root 999 1024 Jan 29 2009 proc
drwxrwx--- 2 root 999 1024 May 8 07:43 sbin
drwxrwx--- 2 root 999 1024 Jan 29 2009 sys
drwxrwx--- 2 root 999 1024 Jan 29 2009 tmp
drwxrwx--- 17 root 999 1024 May 8 07:43 usr
drwxrwx--- 2 root 999 1024 May 8 07:43 var
#> /mnt/mmc/mnt/armv4l_rootfs/usr/bin/gcc -v
Using built-in specs.
Target: armv4l-unknown-linux
Configured with: /home/landley/aboriginal/aboriginal/build/temp-armv4l/gcc-core/configure --target=armv4l-unknown-linux --prefix=/home/landley/aboriginal/aboriginal/build/native-compiler-armv4l/usr --disable-multilib --disable-nls --enable-c99 --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --program-prefix= --enable-threads=posix --enable-shared --build=x86_64-walrus-linux --host=armv4l-unknown-linux --with-float=soft
Thread model: posix
gcc version 4.2.1
#> umount /mnt/mmc/mnt/armv4l_rootfs
#> sync
#> mount
devfs on /dev type devfs (rw)
/dev/bml0/6 on / type squashfs (ro)
/dev/stl0/8 on /opt type ext3 (rw,sync,noatime,nodiratime)
/proc on /proc type proc (rw,nodiratime)
sysfs on /sys type sysfs (rw)
devfs on /dev type devfs (rw)
/dev/stl0/9 on /mnt/us type vfat (rw,noatime,nodiratime,fmask=0022,dmask=0022)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw)
/dev/bml0/7 on /mnt/dc type squashfs (ro)
/dev/mmc/blk0/part1 on /mnt/mmc type vfat (rw,sync,dirsync,noatime,nodiratime,fmask=0022,dmask=0022)
As you may recall, I mentioned a need for a small delay after unmounting but before exiting. As seen above, I replaced that with a "
sync", which has been working fine so far... In fact, I wonder if I can avoid that by adding "sync" to the mount command, as you can see (in the "
mount" output) is the default setting for the /opt partition and for the SD card (which also uses "dirsync").
I might need an older version of gcc to compile kernel modules on/for my K1. Thankfully, landley.net has an archive full of old versions of aboriginal linux (and iits predecessor "firmware linux"). Surely at least ONE of them must have a similar gcc to what lab126 is using. Though it might be easier to just build the toolchain supplied in the FW 1.2 GPL source code from amazon, eh?
Anyway, another baby step towards building usbnetworking into my K1...
EDIT: The reason I placed a copy of the K1 root filesystem into my ext3 image is so that I can eventually "pivotroot" to it (replacing the root filesystem for ALL processes, not just my "chroot" shell). This way I can modify a much larger COPY of the K1 filesystem, with global effect, without fear of bricking my device. I will need a script added to rcS.d, which mounts and pivotroots ONLY if the SD card is installed and configured properly. If any problems, reboot WITHOUT the SD card, and all is well. That is what I used to do on my OpenWRT routers. Oh... and BTW, my 5v MAX232 chips ran JUST FINE at 3.3v (but these days we use USB serial adapter cables instead)...