1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problems downloading with opkg

Discussion in 'HD/HDR-FOX T2 Customised Firmware' started by evilherer, Jan 15, 2012.

  1. evilherer

    evilherer New Member

    hi there, hopefully someone can help!

    the custom firmware worked for a while, then I updated it, at which point i've not been able to use the webif. If i telnet onto it I can update some packages but it looks like the lsof.control file is broken and I just can't get past it to reinstall the packages

    humax# opkg install webif
    Installing webif (0.8.12) to root...
    Downloading http://hummypkg.org.uk/hdrfoxt2/base/webif_0.8.12_mipsel.opk.
    package webif suggests installing webif-iphone
    Installing lsof (4.82) to root...
    Downloading http://hummypkg.org.uk/hdrfoxt2/base/lsof_4.82_mipsel.opk.
    Collected errors:
    * wfopen: /mod/var/opkg/info/lsof.control: Permission denied.
    * pkg_parse_from_stream_nomalloc: fgets: Invalid argument.
    * pkg_write_filelist: Failed to open /mod/var/opkg/info/lsof.list: Input/output error.
    * opkg_install_pkg: Failed to extract data files for lsof. Package debris may remain!
    * opkg_install_cmd: Cannot install package webif.

    Also when I view /mod/var/opkg/info/ i can't delete the files

    ?rwxr-xr-t 82 root 5111847 4292280301 Jan 14 2021 cifs.list
    -rwxr-xr-x 1 root root 50 May 13 2011 cifs.postinst
    -rwxr-xr-x 1 root root 49 May 13 2011 cifs.prerm

    ?--xrw--wx 34 root 1704029 1704051 Jan 26 1970 lsof.control
    No matter what I try chmod or chown'ing the files i cannot rm -rf them.

    humax# rm -rf lsof.control
    rm: can't remove 'lsof.control': Operation not permitted
    Beer to anyone who can fix this
    Thanks in advance
  2. xyz321

    xyz321 Well-Known Member

    It looks as if the file system is corrupt. You will need to run a filesystem check to fix the partition. Is this an HD or HDR?
  3. evilherer

    evilherer New Member

    Thanks for the reply - it's the HDR.

    What's the best filesystem check to run?
  4. xyz321

    xyz321 Well-Known Member

    Since it is a problem with the internal disk there is only one way to do this at present (without removing the disk). Running a filesystem check requires a large amount of free RAM so in order to perform this check you will have to go into 'Maintenance mode'. This is only available on the latest version of custom firmware (1.15).

    First make sure there are no schedule recordings due. See ths Wiki page for details of how to get into Maintenance mode but skip the section on partitioning the drive.

    Assuming you have no other disks connected, the internal disk should be /dev/sda (but see the note on the Wiki page).

    The partitions first need to be unmounted with:
    umount /dev/sda1
    umount /dev/sda2
    umount /dev/sda3
    Then, to check the partitions:
    e2fsck /dev/sda1
    e2fsck /dev/sda2
    e2fsck /dev/sda3
    The check on partitions sda1 & sda3 should take a short time (about a minute). The check on sda2 may take about 20-30 minutes for a 500G disk or longer for 1TB.
  5. evilherer

    evilherer New Member

    that worked a treat with the 1.15 software..using the e2fsck repair it found all manner if inode errors, which i selected when asked to repair or not.. then when the humax rebooted.. the webif worked but i had no sound on live tv or recordings.. so i removed the custom firmware, reinstalled the based 1.02.20 software which restored sound, and then reapplied the custom firmware.

    so xyz321, i owe you a beer! thanks very much
  6. xyz321

    xyz321 Well-Known Member

    I think that after rebooting out of maintenance mode, going into standby and restarting should have fixed the sound problems without reinstalling everything. Failing that, a complete power cycle of the both the HDR and TV would be the next thing to try.

    Glad to hear it is fixed though.
  7. Gazbaby

    Gazbaby New Member

    Hi there. I've been getting some similar problems regarding the box freezing and getting no video but still getting audio as a previous forum post has stated.
    I've done the above e2fsck on sda1 and sda3 and it found no errors. The problem I have is running it on /dev/sd2. I've got the 1TB drive and get the following:-

    humax# e2fsck -p -f /dev/sda2

    /dev/sda2: Duplicate or bad block in use!
    /dev/sda2: Multiply-claimed block(s) in inode 7774251: 43851889 43851890 43851891 43851892 43851893 43851894 43851895 43851896 43851897 43851898 43851899 43851900 43851901 43851902 43851903 43851904 43851905 43851906 43851907 43851908 43851909 438519.........(lots of these)
    Then I get:-
    e2fsck: Memory allocation failed while retrying to read bitmaps for /dev/sda2
    e2fsck: aborted

    Having a look around the web this is probably due to the devices small amount of memory.
    Any advice would be great as there is clearly corruption going on yet not enough memory to run e2fsck.
    Having a look atound the web, someone on another similar type of device managed to create a swap file which got around the problem but when I try to create a swap file I get the following:-

    humax# dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
    dd: can't open '/swapfile1': Read-only file system

    However from running free -m is there already a swapfile on the disk?
    humax# free -m
    total used free shared buffers
    Mem: 124984 83700 41284 0 16652
    -/+ buffers: 67048 57936
    Swap: 0 0 0

    Any help would be greatly appreciated.
  8. ratx

    ratx New Member

    There is no swap - I think free just shows you it as a default - you can cat /proc/swaps - nothing there... :(

    Think you need to ask af123 nicely to make a new version of busybox with "swapon" built it - we have "mkswap" but no swapon and you need that to actually swap.

    If I were you I'd hook up the disk to a proper computer and fsck it there unless the recovery mode has more ram to play with?
  9. af123

    af123 Administrator Staff Member

    Recovery mode does give more memory to play with - as much as is possible but it still doesn't seem to be enough to check the Video partition on a 1TB drive.

    To do the check all of the disks need unmounting but I suppose temporary swap would be possible on a separate USB disk if the command was there.

    If it's under warranty he might not want to remove the disk, although I've heard that a hair dryer works wonders on the seal...
  10. xyz321

    xyz321 Well-Known Member

    If the other two partitions pass e2fsk then you could use one of them to host a temporary swap file. This should enable you to check the large partition but swapon would be needed.

    e.g. (assuming an HDR):

    umount /dev/sda3
    e2fsck /dev/sda3
    if [ $? -eq 0 ]; then
      mount /dev/sda3 /mnt/hd3
      dd if=dev/zero of=/mnt/hd3/.swap bs=1M count=1024
      mkswap /mnt/hd3/.swap
      swapon /mnt/hd3/.swap
  11. af123

    af123 Administrator Staff Member

    I've updated the busybox package to include swapon/swapoff, so it should be possible to do what xyz321's has suggested.
    My box is busy for the next 30 minutes but I'll give it a go then and post instructions if nobody else beats me to it.
  12. af123

    af123 Administrator Staff Member

    Here's what I did to check my Video partition (HDR with 1TB drive).

    Update busybox, install virtual disk and trigger maintenance boot:

    humax# opkg update
    humax# opkg upgrade busybox
    humax# opkg install virtual-disk
    humax# touch /mod/boot/maintenance.boot
    humax# reboot
    telnet back in once up

    humax# /mod/sbin/mkfile 512m /mnt/hd3/.swap
    humax# mkswap /mnt/hd3/.swap
    humax# swapon /mnt/hd3/.swap
    humax# umount /dev/sda2
    humax# e2fsck /dev/sda2
    humax# swapoff /mnt/hd3/.swap
    humax# rm /mnt/hd3/.swap
    humax# reboot