paul- wrote: 
> Well then you are going to have to NFS mount the files on the tftp
> server.   Also would require a ton of updates to our code.... from the
> location and mounting of the tftp boot drive to changing the path of all
> of the code that makes edits to the boot partition.   It's all possible.

This is where I stand. No changes to pCP code, although I think the
pcp-variable DEVICE could be changed to point to the NFS share exporting
the boot partition, and the resize2fs and LMS(?) cgis use hardcoded
references to /dev/mmcblk0p1.

As it is, the interface looks by and large ok, attempts to mount or
dismount /dev/mmcblk0p1 fail, but saving to it works. Of course saving
to tce (ex- mmcblk02) work.

Cmdline.txt has 2 special parameters:
Code:
--------------------
    nfsmount=172.17.71.10:/export/12345abc/TCE 
nfsboot=172.17.71.10:/export/12345abc/BOOT:udp,vers=3,noatime
--------------------

  
- nfsmount is a true TCLinux bootcode, this is processed in
  /etc/init.d/tc-config. This export contains what's in "/dev/mmcblk0p2"
  and gets mounted under /mnt/nfs. It should support the form
  <server>:<export>:<mount options> but the script only looks for some
  special options (noping?) and doesn't apply generic ones, like udp. 
- nfsboot is implemented in bootlocal.sh, in the same fashion as
  tc-config. Except I apply the mount options... This export contains
  what's in "/dev/mmcblk0p1", only for configuration changes, and is
  mounted to /mnt/mmcblk0p1 to let pCP work (almost) normally. On the
  server the export is bind-mounted to /tftp/12345abc to allow booting.
  
Here is bootlocal.sh:
Code:
--------------------
    tc@test:~$ cat /opt/bootlocal.sh 
  #!/bin/sh
  # put other system startup commands here
  
  GREEN="$(echo -e '\033[1;32m')"
  
  echo
  echo "${GREEN}Running bootlocal.sh..."
  #pCPstart------
  /home/tc/www/cgi-bin/do_rebootstuff.sh 2>&1 | tee -a /var/log/pcp_boot.log
  #pCPstop------
  
  # NFS mounting. See http://forum.tinycorelinux.net/index.php?topic=19913.0
  for i in `cat /proc/cmdline`; do            
  case $i in                      
  nfsboot*)                                
  # Allows to update pCP boot config over NFS
  NFSBOOT=${i#*=}
  BOOTMNT="/mnt/mmcblk0p1"
  SERVER=$(echo $NFSBOOT | awk -F: '{ print $1 }')
  DIR=$(echo $NFSBOOT | awk -F: '{ print $2 }')
  OPTS=$(echo $NFSBOOT | awk -F: '{ print $3 }' | tr ',' ' ')
  OPTS=$(echo defaults noauto nolock addr=${SERVER} ${OPTS} | tr ' ' ',')
  echo "Creating directory ${BOOTMNT}"
  sudo mkdir ${BOOTMNT} >/dev/null 2>&1
  # pCP checks in fstab for device /dev/mmcblk itself so mounts fail...
  # echo "Creating /etc/fstab entry for ${BOOTMNT} over NFS"
  # ME="$0"
  # sudo sh -c "cat << EOF >> /etc/fstab
  ## Added by $ME
  #${SERVER}:${DIR} ${BOOTMNT} nfs ${OPTS} 0 0
  #EOF
  #"
  # ... so instead we mount permanently as pCP won't mount/unmount
  # if mounted already.
  echo "Mounting ${SERVER}:${DIR} to ${BOOTMNT}"
  sudo mount -t nfs -o ${OPTS} ${SERVER}:${DIR} ${BOOTMNT}
  ;;
  nfsmount*)
  # Keep pCP happy with a normal-looking SD mount
  NFSMOUNT="/mnt/nfs"
  TCEMNT="/mnt/mmcblk0p2"
  echo "Creating directory ${TCEMNT}"
  sudo mkdir ${TCEMNT} >/dev/null 2>&1
  echo "Adding bind mount for ${TCEMNT}"
  sudo mount -o bind ${NFSMOUNT} ${TCEMNT} >/dev/null 2>&1
  ;;
  esac
  done
--------------------

As you see my 1st intent was to add an entry for /mnt/mmcblk0p1 in fstab
and let pCP do the mount/dismount as usual. However
pcp_mount_mmcblk0p1_nohtml was failing because it looks for
/dev/mmcblk0p1, not /mnt/mmcblk0p1 in /etc/fstab.

I don't know if the bind mount of /mnt/nfs to /mnt/mmcblk0p2 makes any
difference. I thought it wouldn't hurt.

As it is, it's a bit hackish but I think it is operational. There is no
extra network traffic to speak of, once the system has booted. I'd like
to check SQ and sync with a version of pCP/piCore that has recent
firmwares allowing to net boot out-of-the-box. Would 3.20-beta be a
candidate?



3 SB 3 • Libratone Loop, Zipp Mini • iPeng (iPhone + iPad) • LMS 7.9
(linux) with plugins: CD Player, WaveInput, Triode's BBC iPlayer by bpa
• IRBlaster by Gwendesign (Felix) • Server Power Control by Gordon
Harris • Smart Mix, Music Walk With Me, What Was That Tune? by Michael
Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by
Erland Isaksson • AirPlay Bridge by philippe_44 • WeatherTime by Martin
Rehfeld • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.
------------------------------------------------------------------------
epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711
View this thread: http://forums.slimdevices.com/showthread.php?t=106755

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to