Help - Search - Members - Calendar
Full Version: Root On Sd
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > Angstrom & OpenZaurus
malcolmxavier
Ok so I wen through the steps on the OpenZaurus HowTo page. Several times in various iterations with no avail. I put comments in the /sbin/init file to try and pinpoint where the problem may lie. But I am not confused because everything should be working...

I'll add a snippet of the code and where is succeeded and where it fails...

CODE
######################################
#  Only a snippet from the full /etc/init script
######################################

echo "Pivoting Root..." >> /dev/tty0
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/block/sharp_mmcsd_m.o

######################################
echo "Success with insmod" >> /dev/tty0 #got here!        
######################################

    if [ -z "$IMAGE" ]
    then
          IMAGE='/dev/mmcda1'
   /bin/mount -o remount,rw /
    else
         /bin/mount -t ext2 -o defaults,sync,noatime /dev/mmcda1 /media/card
    fi
       
    /sbin/losetup /dev/loop0 $IMAGE
    /bin/mount -t ext2 /dev/loop0 /media/image

######################################
echo "Saw the mount" >> dev/tty0   ## This also seems to succeed!!
######################################

    if [ -f /media/image/sbin/init ]
    then

######################################
echo "found init" >> /dev/tty0         ## Never gets here and goes straight to Failure
######################################

    if(/sbin/pivot_root /media/image /media/image/media/realroot)
    then

######################################
echo " Successful" >> /dev/tty0
######################################
         /bin/mount -t ext2 -o move /media/realroot/media/card /media/card
         exec /sbin/init $1
    fi
fi
       
echo " Failed!" >> /dev/tty0
exec /sbin/init.org $1        


I know that /media/image/sbin/init exists because after opie boots I mount the opie.img under image and I can see it. I have a feeling that it's not really mounting, but I don't understand why.

Could it be that my /ect/rcS.d/S39sd doesn't come soomer? I really am shooting in the dark here.

Please help!
CoreDump
QUOTE(malcolmxavier @ Jun 9 2005, 06:15 PM)
Ok so I wen through the steps on the OpenZaurus HowTo page. Several times in various iterations with no avail.  I put comments in the /sbin/init file to try and pinpoint where the problem may lie.  But I am not confused because everything should be working...

[...]

I know that /media/image/sbin/init exists because after opie boots I mount the opie.img under image and I can see it.  I have a feeling that it's not really mounting, but I don't understand why.

Could it be that my /ect/rcS.d/S39sd doesn't come soomer?  I really am shooting in the dark here. 


/etc/init.d/sd is not used at all. Not the one in flash and not the one inside your image.
rboot loads the driver and mounts the card.

Anyways, debugging a custom /sbin/init can be a _real_ pain. I'd dump the content of "mount" into the console right after rboot tried to mount the SD card. If it does (which is unlikely by the looks of it) you can narrow your problem down. If it doesn I'd hack up a custom /sbin/init which drops into a shell right after booting the kernel.

Then I'd enter each command manually and see where it borks.
Did I mention that debugging /sbin/init can be a real pain? smile.gif

FUBAR'ed permissions can be the cause for many problems. I'd run chown -R root.root on all files inside the image just to be on the safe side.

This little snipplet of wisdom cost me 3 days of my life....
malcolmxavier
QUOTE(CoreDump @ Jun 9 2005, 01:55 PM)
This little snipplet of wisdom cost me 3 days of my life....
*



Well since it took you 3 days of your life and I just don't have that much time on my hands I bagged it for now in favor of your most excellent altboot program. It worked great, I tried all of your self made loop-roms and they all worked except I couldn't get my WiFi (Ambicom) working with any of them, so I built my own. One question (maybe this is better posed on the other thread, but does the size of the self build ROM come into play with the speed. I built one on my SD card that is 250M (yeah a little excessive, but I never want to run out of space) and it seems a tad slower than your 71M Opie-GPE combo. It is liveable, but I was just curious.

Thanks for the advice!
CoreDump
QUOTE(malcolmxavier @ Jun 10 2005, 12:41 AM)
Well since it took you 3 days of your life and I just don't have that much time on my hands I bagged it for now in favor of your most excellent altboot program. It worked great, I tried all of your self made loop-roms and they all worked except I couldn't get my WiFi (Ambicom) working with any of them, so I built my own.

One question (maybe this is better posed on the other thread, but does the size of the self build ROM come into play with the speed. I built one on my SD card that is 250M (yeah a little excessive, but I never want to run out of space) and it seems a tad slower than your 71M Opie-GPE combo.  It is liveable, but I was just curious.


Um dunno why that would be but it is possible. I don't have enough space on any of my cards to do some tests but will try to keep it in mind.

QUOTE
Thanks for the advice!
*


You are welcome smile.gif
niv
Another question if I may:
can I create the image on a Vfat formated SD?
CoreDump
QUOTE(niv @ Aug 14 2005, 09:53 PM)
Another question if I may:
can I create the image on a Vfat formated SD?
*


Yes wink.gif
niv
more simple answers:
1. do you have a opie.img file ready for download?
2. is there a GPE.img ready for DL?
3. when I did: dd of=opie.img if=/dev/zero bs=1024 count=150000 on a 512Mb SD I got: out of space.
I df and see root is 100% full

what to do?

zaurus 5500,3.5.3
Niv
Greg2
QUOTE(niv @ Aug 16 2005, 06:55 AM)
more simple answers:
1. do you have a opie.img file ready for download?
2. is there a GPE.img ready for DL?

CoreDump had an oz3.5.3-opie-gpe-ext2loop image that worked very well in both gui's... but it dosen't appear to be available on his server now. You could ask him if he would put it up for you... it's 16.5MBs gzipped (70MBs extracted).
QUOTE
3. when I did: dd of=opie.img if=/dev/zero bs=1024 count=150000 on a 512Mb SD I got: out of space.
I df and see root is 100% full

Your trying to create a 147.9289940828402 MB file.
Try count=148480 for a 145 MB file or something like that. smile.gif

Greg
niv
problem was that my current path was /
I think the guide needs to say - you need to be at /media/card to do the dd command.

any chance to copy it to the wiki - and revise?
where to put it in the wiki?
CoreDump
Why so comlicated?

bs=1M count=$SIZE_IN_MEGABYTES
niv
ok, I ran install_init.sh and I now see that I did'nt need it - cause hentges roms has it already :-/

do I still need to run copy_files.sh <location> ?
CODE
#!/bin/sh

if [ $# -eq 0 ]
then
    echo "Usage: $0 <DESTINATION>"
    exit
fi

NEWROOT=$1

# if you want to link the home folder comment in the next line this will
# speed up writes to your home folder because it is on internal memory,
# however you are now dependent on internal memory.  This was more of an
# issue for pre-3.5.1 releases as 3.5.1 runs much faster.
#HOMELINK="yes"

# add folders here that you want to create on the new file system instead of copying
CREATELIST="/var /proc"


# you shouldn't need to modify below here

for FOLDER in /*
do
    # these are the exceptions
    if [ "$FOLDER" = "/dev" ]
    then
 # for /dev we need to move the ramdisk out of the way and copy the files in the actual folder
 echo "Copying $FOLDER"
 mkdir /dev.tmp
 mount -o move /dev /dev.tmp
 cp -a /dev /$NEWROOT/
 mount -o move /dev.tmp /dev
 rmdir /dev.tmp

    elif [ "$FOLDER" = "/home" ]
    then
 # /home can be either linked or copied
 if [ "$HOMELINK" = "yes" ]
 then
     echo "Linking $FOLDER"
     ln -s /media/realroot/"$FOLDER" /$NEWROOT/"$FOLDER"
 else
     echo "Copying $FOLDER"
     cp -a "$FOLDER" /$NEWROOT/
 fi

    elif [ "$FOLDER" = "/media" ]
    then
 # the media folder is a special case because we want to create the folder and
 # its immediate subfolders, but not more than that
 echo "Creating $FOLDER"
 mkdir /$NEWROOT/"$FOLDER"
 
 for MFOLDER in "$FOLDER"/*
 do
     echo "Creating $MFOLDER"
     mkdir /$NEWROOT/"$MFOLDER"
 done    

    elif [ "$FOLDER" = "/mnt" ]
    then
 # we create the /mnt folder, test for links, copy them, and then create folders
 echo "Creating $FOLDER"
 mkdir /$NEWROOT/"$FOLDER"
 
 for MFOLDER in "$FOLDER"/*
 do
     # copy the links
     if [ -L "$MFOLDER" ]
     then
   echo "Copying $MFOLDER"
   cp -a "$MFOLDER" /"$NEWROOT"/"$FOLDER"
     else
   echo "Creating $MFOLDER"
   mkdir /$NEWROOT/"$MFOLDER"
     fi
 done    

    else
 # check to see if this folder is in our create list
 for CFOLDER in $CREATELIST
 do
     if [ "$CFOLDER" = "$FOLDER" ]
     then  
   echo "Creating $FOLDER"
   mkdir /$NEWROOT/"$FOLDER"
     fi
 done

 # if it has not been created (i.e. it is not
 # in the create list) than copy it
 if [ ! -e "/$NEWROOT/$FOLDER" ]
 then
     echo "Copying $FOLDER"
     cp -a "$FOLDER" /$NEWROOT/
 fi
    fi
done
     
if [ -f /$NEWROOT/sbin/init.org ]
then
    echo "Cleaning up"
    mv /$NEWROOT/sbin/init.org /$NEWROOT/sbin/init
    rm /$NEWROOT/etc/rboot.conf
fi
niv
BUG: if I say no at: Do you want to search for cardfs image now? - it asks for target over and over

I created an image on a fat SD. mounted it and tried to run carsfs. I can't have it install to /mnt/image

I think I must mkfs.ext2 /dev/mmcda1 , then run cardfs,
make the image on the CF and move all to there.

right?
CoreDump
QUOTE(niv @ Aug 16 2005, 05:56 PM)
BUG: if I say no at: Do you want to search for cardfs image now? - it asks for target over and over

I created an image on a fat SD. mounted it and tried to run carsfs. I can't have it install to /mnt/image

I think I must mkfs.ext2 /dev/mmcda1 , then run cardfs,
make the image on the CF and move all to there.

right?
*


I'll check for that bug.
The installer parses /etc/ipkg.conf and checks for destinations beside "dest root"
As a workaround you could enter a destination pointing to the mountpoint of your image file.

I'll think about adding a "Custom Destination" menu entry.
niv
you mean:
umount /dev/mmcda1
mount -t ext2 /dev/loop0 /media/cf ?
CoreDump
QUOTE(niv @ Aug 16 2005, 08:33 PM)
you mean:
umount /dev/mmcda1
mount -t ext2 /dev/loop0 /media/cf ?
*


Mounting the loop-image to /media/cf would work, too.
I was however suggesting to edit /etc/ipkg.conf and add the mountpoint of your loop-image as a "dest".

Your solution is quicker though smile.gif
niv
Thanks mate,
I am looking into /altboot-menu/15-bootSD - the scriot that will cause the filesystem to be loaded from the image file.
the only place I see the command that will mount the image is:

CODE
/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT >/dev/null 2>&1 && echo ok  >/dev/tty0|| die "/bin/mount -t auto -o defaults,noatime $SD_DEVICE $SD_MOUNTPOINT failed"


1. dont I need first to:
CODE
 losetup /dev/loop0 /media/card/opie.img


before loading the image?

2. how do I set the $SD_DEVICE $SD_MOUNTPOINT values to point to /media/card/opie.img ?

Thanks,
Niv
CoreDump
Ahem, I'm a little bit confused now.

Do you try to boot a loop-image from SD or do you want to install cardfs into an already booted loop-image?
niv
already got the image file done :-)
I now seek to boot the image as root
choosing boot SD didnt work
CoreDump
Please read http://www.hentges.net/misc/openzaurus/docs/altboot.shtml and make sure the naming and path are correct.

If that doesn't work, could you try with the latest release from http://hentges.net/tmp/altboot/ ?
niv
kindly spare a few min to help a lost soul.

Tabula rasa :
*. format the SD -> FAT on PC using a usb reader.
*. copied cardfs-opie-collie-openzaurus_oz3.5.3-opie1.2.0-r1.bin to the SD
*. Flashed to the apropriate ROM.
*. Removed all flash cards
* put in a password for the first boot
* answered no all the way utill Opie loads up. clibrated the screen
* logout
* sign in as root
* insert SD to Zaurus
* dd of=/media/card/boot-images/opie353-rootfs.bin if=/dev/zero bs=1024 count=150000
* mkfs.ext2 -F /media/card/boot-images/opie353-rootfs.bin
* losetup /dev/loop0 /media/card/boot-images/opie353-rootfs.bin
* mount -t ext2 /dev/loop0 /media/cf
* cardfsinstall.sh . OK to search. 1 to install to CF (my image)

I now need to copy my root to the image I made - right?

tried the copy_files.sh from http://openzaurus.org/wordpress/howto/root-on-sd/

I now put reboot

After rebooting I ask for 3) boot from SD

It reports that /dev/loop0 "was not cleanly unmounted" (but I did reboot!)
then it checks..
then *** booting rootfs image ***
pivoting root .../etc/altboot-menu/15-bootSD: 259: echo: not found
/etc/altboot-menu/15-bootSD: 259: .bin.busybox: not found
/etc/altboot-menu/15-bootSD: 259: .bin.busybox: not found
exec: 259: /usr/sbin/chroot: not found

and it is stuck
CoreDump
I've never used the root-on-sd scripts, sorry.
Copying the rootfs is quite easy:

- mount the image somewhere
- "cp -a" all directories, except /dev, /media, /var and /proc to the image
- mkdir image/media image/proc image/dev image/var

That should be it.
FWIW, the lastet altboot from http://hentges.net/tmp/altboot/ includes a script in the Advanced folder which does what you want. It has not been tested, though (my SD card died half-way through heh)

Installing this ipk requires you to ipkg "remove hentges-utils-altboot -force-depends"
on Hentges ROMs.
niv
YES (sorry I am so new to this)
It works,
10x core for your help (it does seem obios now ....)

Small note to any1 how may use the method I described. seems I need to manually do:
$ umount /dev/loop0

before rebooting to root from SD

reboot doesnt do that - and I get a warning that I didnt unmount proparly..

Well now I am thinking that we should offer this image in the reposotery.
I mean most ppl would find it easy , just to copy this file to a FAT SD and boot with your rom.
abm_y4k
Hi Coredump,

Can you make a hentges rom(3.5.4) for my C3100? I wanna give hentges rom a try and also I like to due boot feature.


Thanks,
CoreDump
QUOTE(abm_y4k @ Aug 30 2005, 09:45 PM)
Hi Coredump,

Can you make a hentges rom(3.5.4) for my C3100? I wanna give hentges rom a try and also I like to due boot feature.


Thanks,
*


Altboot has not been ported to C3100, yet. No altboot, no dual boot smile.gif

In any case, I'm currently maintaining 3 machines for Hentges ROM (Collie, Poodle, Akita). A forth would be a little to much for one person, sorry.

I'm sure someone with a little time on their hands can configure altboot for the C3100.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.