ts-7000
[Top] [All Lists]

[ts-7000] Re: 7260: Installing Debian distro on an SD Card

To:
Subject: [ts-7000] Re: 7260: Installing Debian distro on an SD Card
From: "jywmpg" <>
Date: Sat, 10 Mar 2007 17:59:06 -0000
Eddie,

Thanks again, but I think there is one little step missing from the
instructions. I gather that, if the dd of the fastboot image changes
the partition on the SD card, one has to reboot before proceeding,
just as if you had altered the partition table using fdisk.  If you
don't, fsck fails because part3 does not exist.

As promised, here is:

How I created an SD Card for the TS-7260, YMMV:

# gain access to the USB Flash Drive
loadUSBModules.sh
mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt/

#
# Setup the SD Card to be boot-pivot-able
#
        
date "+%D, %T - Downloading SD Card Image"
cd /mnt/sts
wget -q
ftp://ftp.embeddedarm.com/ts-arm-linux-cd/binaries/ts-images/fastboot-7300-sdcard-7-6-2006.dd.bz2

date "+%D, %T - Verifing its correctness..."
md5sum fastboot-7300-sdcard-7-6-2006.dd.bz2
date "+%D, %T - Should be: "
echo "a7d42537db49656c646c3123e153d0f3 
fastboot-7300-sdcard-7-6-2006.dd.bz2"

date "+%D, %T - Unzipping the image"
bunzip2 fastboot-7300-sdcard-7-6-2006.dd.bz2

date "+%D, %T - Initializing the SD Card"
dd if=/dev/zero of=/dev/sdcard0/disc0/disc bs=1M count=256
256+0 records in
256+0 records out

date "+%D, %T - Copying image to the SD Card"
dd if=fastboot-7300-sdcard-7-6-2006.dd of=/dev/sdcard0/disc0/disc bs=1M
238+1 records in
238+1 records out

# must reboot here!!!!!!
shutdown -r now

# log back in

# verify the new file system
fsck.ext2 -y /dev/sdcard0/disc0/part3
e2fsck 1.37 (21-Mar-2005)
/dev/sdcard0/disc0/part3: clean, 14718/60000 files, 227014/239104 blocks

# reclaim the remaining space by creating a fourth partition

fdisk /dev/sdcard0/disc0/disc
n
p
954

p
Disk /dev/sdcard0/disc0/disc: 2032 MB, 2032664576 bytes
16 heads, 32 sectors/track, 7754 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

                  Device Boot    Start       End    Blocks   Id  System
/dev/sdcard0/disc0/part1               1           6        1520   da
 Unknown
/dev/sdcard0/disc0/part2               7          10        1024   da
 Unknown
/dev/sdcard0/disc0/part3              20         953      239104   83
 Linux
/dev/sdcard0/disc0/part4             954        7754     1741056   83
 Linux
w

# Reboot and verify partition exists
shutdown -r now

# log back in

fdisk /dev/sdcard0/disc0/disc
p
# Disk /dev/sdcard0/disc0/disc: 2032 MB, 2032664576 bytes
# 16 heads, 32 sectors/track, 7754 cylinders
# Units = cylinders of 512 * 512 = 262144 bytes
# 
#                   Device Boot    Start       End    Blocks   Id  System
# /dev/sdcard0/disc0/part1               1           6        1520  
da  Unknown
# /dev/sdcard0/disc0/part2               7          10        1024  
da  Unknown
# /dev/sdcard0/disc0/part3              20         953      239104  
83  Linux
# /dev/sdcard0/disc0/part4             954        7754     1741056  
83  Linux
# 
# Command (m for help):q


# create a file system on the new fourth partition
mkfs.ext2 /dev/sdcard0/disc0/part4
mke2fs 1.37 (21-Mar-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
217728 inodes, 435264 blocks
21763 blocks (5.00%) reserved for the super user
First data block=0
14 block groups
32768 blocks per group, 32768 fragments per group
15552 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

# mount the new fs on part4 (assumes mount point exists)
mount -t ext2 /dev/sdcard0/disc0/part4 /sdcard_p4
# while we are at it, mount part3, too (assumes mount point exists)
mount -t ext2 /dev/sdcard0/disc0/part3 /sdcard

# demonstrate success
$ df -k
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/root                   29680      8336     21344  28% /
/dev/sdcard0/disc0/part3   231527    219437     12090  95% /sdcard
/dev/sdcard0/disc0/part4  1713680        20   1626608   0% /sdcard_p4

#
#  Setup the new machine to boot from an initrd, then pivot to the SD
Card, partition 3
#

# Load the new kernel and initial ramdisk to RAM 
# assumes tftpd running on dev machine w/ kernel and init ramdisk image

# reboot new machine and issue Control-C within one second of reboot
# if Control-C does not seem to work, make sure flow control is turned
off in your Hyperterminal session

# set up networking in redboot
fconfig

Run script at boot: true
Boot script:
.. fis load vmlinux -b 0x00218000
.. exec -c "console=ttyAM0,115200"

Boot script timeout (100ms resolution): 1
Use BOOTP for network configuration: false
Gateway IP address: 192.168.1.11
Local IP address: $IPADR
Local IP address mask: 255.255.255.0
Default server IP address: $IPADR
Network hardware address [MAC]: 0x00:0xD0:0x69:0x40:0x78:0xCF
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false

# 
# Test the kernel, init ram disk (initrd), and root file system on the
SD card
#
load -r -b 0x00218000 -h 192.168.1.12 zImage-7260_2k-ts11
load -r -b 0x00600000 -h 192.168.1.12 ts7260-sdcard-initrd-1.02.gz
exec -r 0x00600000 -s 448760 -b 0x00218000 -l 685808 -c
"console=ttyAM0,115200 root=/dev/ram0 init=/linuxrc rw"

#
# System should boot Debian with the root file system on part3 of the
SD Card.  IP address may have changed, if DHCP on your router is so
inclined.
# Log back in, setting up accounts as necessary.  Can't telnet in as
root, for instance.
#

# demonstrate successful pivot
$ df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdcard0/disc0/part3
                        231527    219462     12065  95% /

# verify that the part4 is still there
$ mount /dev/sdcard0/disc0/part4 /mnt/
$ df -k

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdcard0/disc0/part3
                        231527    219463     12064  95% /
/dev/sdcard0/disc0/part4
                       1713680        20   1626608   1% /mnt

Q.E.D.

The redboot sequence above is essentially the "Load a kernel and initial
ramdisk to RAM from a TFTP server" from
http://www.seiner.com/ts7000/index.php/Booting%20to%20SDCard

Once you are happy with this kernel, initrd, and distro combination,
move onto the remaining steps, ultimately booting the new combo
automatically via redboot fconfig.

Cheers,

jw


--- In  Eddie Dawydiuk <> wrote:
>
> Hello,
> 
> > Success!  The final step was that I was using an older initrd image
> > (1.01 vs 1.02).  Changing the version resulted in a successful
> > boot/pivot process.
> 
> I should have mentioned I upgraded the initial ramdisk when I made a few
> other changes to the wiki. The new initrd has the updated SD driver
> which supports cards larger than 1GB...
> 
> //Eddie
> 
> > --- In  "jywmpg" <jywmpg@> wrote:
> >>
> >> Eddie,
> >>
> >> Thanks very much!   I followed your instructions, with a couple of
> >> changes*, and got the desired result: Debian on an SD Card.
> >>
> >> Unfortunately, I am still not able to do the boot/pivot using the SD
> > Card.
> >>
> >> Here is the RedBoot sequence I am trying to use (on a 7260 w/ 128 MB
> >> of RAM):
> >>
> >> load -r -b 0x00218000 -h 192.168.1.12 zImage-7260_2k-ts11
> >> load -r -b 0x00600000 -h 192.168.1.12 ts7260-sdcard-initrd-1.01.gz
> >> exec -r 0x00600000 -s 447849 -b 0x00218000 -l 685808 -c
> >> "console=ttyAM0,115200 root=/dev/ram0 init=/linuxrc rw"
> >>
> >> This sequence is from the wiki under subject "Load a kernel and
> >> initial ramdisk to RAM from a TFTP server".
> >>
> >> This results in a kernel panic when the kernel "cannot find an ext2
> >> filesystem on dev sdcard0(254,3)".  pivot_root also complains about
> >> "No such file or directory", then cannot find /bin/mount.
> >>
> >> Any ideas what I am doing wrong?
> >>
> >>
> >> Regards,
> >>
> >> jw
> >>
> >>
> >> *When I tried the instructions, I found that there was no /dev/sda
> >> device defined on the 7260.  So I changed /dev/sda to
> >> /dev/sdcard0/disc0/disc and /dev/sda3 to /dev/sdcard0/disc0/part3.
> >> Hope this was the right thing to do.
> >>
> >>
> >>
> >> For the record, here is a transcript:
> >>
> >> $ dd if=fastboot-7300-sdcard-7-6-2006.dd of=/dev/sdcard0/disc0/disc
> > bs=1M
> >> 238+1 records in
> >> 238+1 records out
> >> $ fsck.ext2 /dev/sdcard0/disc0/part3
> >> e2fsck 1.37 (21-Mar-2005)
> >> /dev/sdcard0/disc0/part3: clean, 14718/60000 files, 227014/239104
blocks
> >> $ mount -t ext2 /dev/sdcard0/disc0/part3 /sdcard
> >> $ df -k
> >> Filesystem           1k-blocks      Used Available Use% Mounted on
> >> /dev/root                29680      8324     21356  28% /
> >> /dev/scsi/host0/bus0/target0/lun0/part1   990432    323584    666848
> >> 33% /mnt
> >> /dev/sdcard0/disc0/part3   231527    219437     12090  95% /sdcard
> >> $ fdisk /dev/sdcard0/disc0/disc
> >>
> >> The number of cylinders for this disk is set to 7754.
> >> There is nothing wrong with that, but this is larger than 1024,
> >> and could in certain setups cause problems with:
> >> 1) software that runs at boot time (e.g., old versions of LILO)
> >> 2) booting and partitioning software from other OSs
> >>    (e.g., DOS FDISK, OS/2 FDISK)
> >>
> >> Command (m for help): p
> >>
> >> Disk /dev/sdcard0/disc0/disc: 2032 MB, 2032664576 bytes
> >> 16 heads, 32 sectors/track, 7754 cylinders
> >> Units = cylinders of 512 * 512 = 262144 bytes
> >>
> >>                   Device Boot    Start       End    Blocks   Id 
System
> >> /dev/sdcard0/disc0/part1               1           6        1520   da
> >>  Unknown
> >> /dev/sdcard0/disc0/part2               7          10        1024   da
> >>  Unknown
> >> /dev/sdcard0/disc0/part3              20         953      239104   83
> >>  Linux
> >>
> >> Command (m for help): q
> >>
> >> $ shutdown -r now
> >>
> >>
> >>
> >>
> >>
> >> --- In  Eddie Dawydiuk <eddie@> wrote:
> >>>
> >>> Hello,
> >>>
> >>>> 1.  I ran the following command:
> >>>>
> >>>> dd if=fastboot-7300-sdcard-7-6-2006.dd of=/dev/sdcard0/disc0/disc
> >> bs=1M
> >>>>
> >>>> Once that completed, I tried to mount part3 as an EXT2 file system,
> >>>> and got a message on the console that no EXT2 file system could be
> >>>> found there.  part1 and part2 were created however, apparently
> >>>> successfully.
> >>>>
> >>>> I then used fdisk to delete and recreate the third partition as
> >>>> described on another wiki page, then tried again to mount part3 and
> >>>> got the same message, that no EXT2 file system could be found
> >>>
> >>> You shouldn't have to do anything other than bunzip2 the dd
image and
> >>> run the dd command above. I tested this and everything seems to be
> >>> working fine.
> >>>
> >>> e.g.
> >>>
> >>> :~$ sudo dd if=/dev/zero of=/dev/sda bs=1M count=256
> >>> 256+0 records in
> >>> 256+0 records out
> >>> 268435456 bytes (268 MB) copied, 74.5137 seconds, 3.6 MB/s
> >>> :~$ wget -q
> >>>
> >>
> >
ftp://ftp.embeddedarm.com/ts-arm-linux-cd/binaries/ts-images/fastboot-7300-sdcard-7-6-2006.dd.bz2
> >>> :~$ md5sum fastboot-7300-sdcard-7-6-2006.dd.bz2
> >>> a7d42537db49656c646c3123e153d0f3 
fastboot-7300-sdcard-7-6-2006.dd.bz2
> >>> :~$ bunzip2 fastboot-7300-sdcard-7-6-2006.dd.bz2
> >>> :~$ sudo dd if=fastboot-7300-sdcard-7-6-2006.dd of=/dev/sda
> >>> bs=1M
> >>> 238+1 records in
> >>> 238+1 records out
> >>> 250085376 bytes (250 MB) copied, 54.372 seconds, 4.6 MB/s
> >>> :~$ fsck.ext2 /dev/sda3
> >>> e2fsck 1.38 (30-Jun-2005)
> >>> /dev/sda3: clean, 14718/60000 files, 227014/239104 blocks
> >>> :~$ sudo mount -t ext2 /dev/sda3 /mnt/sd/
> >>>
> >>> //Eddie
> >>>
> >>>> --- In  Luis Ortega <lortega@> wrote:
> >>>>>
> >>>>> I am following this with keen interest as I also have a TS-7260
> >> with an
> >>>>> SD card and have not been able to boot to it.
> >>>>>
> >>>>> The only differences are that I have a 4 GB SD card (not an issue)
> >>>> and I
> >>>>> used a different image from the same ftp location
> >>>>> (fastboot-7300-sdcard-10-24-2006.dd.bz2). After some
> > maneuvering I am
> >>>>> able to chroot to the file system in partition 3, after booting
> >> to the
> >>>>> image in board flash but I have not been able to boot to it.
> >>>>>
> >>>>> If you manage to boot using the image that Eddie (in the wiki
page)
> >>>>> suggest I will switch to that image. Please let us know if you
> >> succeed.
> >>>>>
> >>>>> Thanks,
> >>>>>
> >>>>>
> >>>>>
> >>>>> jywmpg wrote:
> >>>>>>
> >>>>>> OK, thanks.
> >>>>>>
> >>>>>> Just to make sure I understand, the SD Card dd image for the
> >> 7260 is:
> >>>>>>
> >>>>>> fastboot-7300-sdcard-7-6-2006.dd.bz2
> >>>>>>
> >>>>>> Then, presuming I bunzip2 the dd image, I run the following:
> >>>>>>
> >>>>>> dd if=fastboot-7300-sdcard-7-6-2006.dd of=/dev/sdcard0/disc0/disc
> >>>> bs=1M
> >>>>>>
> >>>>>> Is that correct? The 7300 vs 7260 kind of confuses me.
> >>>>>>
> >>>>>> Thanks for your help
> >>>>>>
> >>>>>> jw
> >>>>>>
> >>>>>> --- In 
<ts-7000%40yahoogroups.com>,
> >>>>>> Eddie Dawydiuk <eddie@> wrote:
> >>>>>>>
> >>>>>>> Hello,
> >>>>>>>
> >>>>>>>> I have a new 7260 and a new SanDisk 2.0GB SD card and would
> >>>> like to
> >>>>>>>> install a clean Debian distribution on the SD card, then set
> > up to
> >>>>>>>> boot and pivot to the SD card.
> >>>>>>>
> >>>>>>> I modified the wiki article to clarify this topic, you should
> >>>> see a link
> >>>>>>> to a dd image at the bottom of the article in the Downloads
> >>>> section. The
> >>>>>>> first paragraph talks about loading Debian on an SD card.
> >>>>>>>
> >>>>>>>> 2. Run mkfs.ext3 to create a file system on part3
> >>>>>>>
> >>>>>>> You'll need a custom kernel if you'd like to use an ext3
> >>>> filesystem as
> >>>>>>> the default shipping kernel from Technologics does not have ext3
> >>>>>>> support.
> >>>>>>>
> >>>>>>> //Eddie
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Yahoo! Groups Links
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/hOt0.A/lOaOAA/yQLSAA/CFFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU