Difference between revisions of "Talk:UBoot-Installer"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (/etc/init.d/uboot_installer)
m (/etc/init.d/uboot_installer)
 
(3 intermediate revisions by 2 users not shown)
Line 17: Line 17:
 
<pre>
 
<pre>
 
# !/bin/sh  
 
# !/bin/sh  
+
#
 
# mount the hdd-partitions  
 
# mount the hdd-partitions  
 +
 
/usr/sbin/mount_disk  
 
/usr/sbin/mount_disk  
 +
 
   
 
   
 
# check if hdd really was successfully mounted  
 
# check if hdd really was successfully mounted  
 
# if yes proceed, if no stop  
 
# if yes proceed, if no stop  
  
mount | grep /mnt/hda1 > /dev/null || exit 1
+
ERROR="0"
mount | grep /mnt/hda3 > /dev/null || exit 1
+
mount | grep /mnt/hda1 > /dev/null || ERROR="1"
 +
mount | grep /mnt/hda3 > /dev/null || ERROR="1"
 +
  if [ "$ERROR" == "1" ] ; then
 +
      echo "FATAL: HDD not mounted!"
 +
      exit 1
 +
  fi
 +
 
 +
 
  
 
# check which box this script is running on  
 
# check which box this script is running on  
>> just 4 safety - the firmware updater itself takes care about that
+
 
   
+
ls  /dev/fl* > /dev/null && FLAVOR="ls1"
# check if a valid all-flash-file is available at the correct position on the hdd.
+
ls /dev/mtdblock* > /dev/null && FLAVOR="hg"
>> TO BE DONE
+
 
   
 
   
 +
 +
# check if a valid all-flash-file is available at the correct position on the hdd.
 +
# it should check for /mnt/hda1/full_flash_image.bin...this file will be inside the
 +
# bundled image.dat...at /
 +
 +
  if ! ls  /mnt/hda1/dev/full_flash_image.bin ; then
 +
      echo "FATAL: The all-flash-file is not valid! "
 +
      exit 1
 +
  fi
 +
 +
 
# flash the all-flash-file to the complete flash-device  
 
# flash the all-flash-file to the complete flash-device  
>> TO BE DONE  
+
>>TO BE DONE  
 
   
 
   
 
# maybe do some post-flashing checks before rebooting automatically and do not reboot if   
 
# maybe do some post-flashing checks before rebooting automatically and do not reboot if   
 
# anything goes wrong so debugging + fixing it via telnet is possible  
 
# anything goes wrong so debugging + fixing it via telnet is possible  
>> TO BE DONE  
+
>> TO BE DONE
 
   
 
   
 
# automatically reboot  
 
# automatically reboot  
 +
 
reboot
 
reboot
 
</pre>
 
</pre>

Latest revision as of 02:45, 15 November 2006

/usr/sbin/mount_disk

#! /bin/sh 
 
  echo -n "Mounting system (/dev/hda1) + data partition (/dev/hda3)" 
  echo -n "of the internal HDD to /mnt/" 
 
  mkdir /mnt/hda1 
  mkdir /mnt/hda3 
 
  mount -t vfat,ext3,ext2 /dev/hda1 /mnt/hda1 
  mount -t vfat,ext3,ext2 /dev/hda3 /mnt/hda3 
 
exit 0 

/etc/init.d/uboot_installer

# !/bin/sh 
#
# mount the hdd-partitions 

/usr/sbin/mount_disk 

 
# check if hdd really was successfully mounted 
# if yes proceed, if no stop 

ERROR="0"
mount | grep /mnt/hda1 > /dev/null || ERROR="1"
mount | grep /mnt/hda3 > /dev/null || ERROR="1"
   if [ "$ERROR" == "1" ] ; then
      echo "FATAL: HDD not mounted!"
      exit 1
   fi



# check which box this script is running on 

ls  /dev/fl* > /dev/null && FLAVOR="ls1"
ls  /dev/mtdblock* > /dev/null && FLAVOR="hg"
 

# check if a valid all-flash-file is available at the correct position on the hdd.
# it should check for /mnt/hda1/full_flash_image.bin...this file will be inside the
# bundled image.dat...at /

   if ! ls  /mnt/hda1/dev/full_flash_image.bin ; then
      echo "FATAL: The all-flash-file is not valid! "
      exit 1
   fi


# flash the all-flash-file to the complete flash-device 
>>TO BE DONE 
 
# maybe do some post-flashing checks before rebooting automatically and do not reboot if   
# anything goes wrong so debugging + fixing it via telnet is possible 
>> TO BE DONE
 
# automatically reboot 

reboot