2

Using ssh from BusyBox, I cannot remove symlinks: after rebooting the device, symlinks re-appear. ls -la shows that symlinks have been removed, but after rebooting device they re-appear again.

Those symlinks already existed beforehand, created at installing the firmware.

$ rm uw_cert.cer

I tried to remove uw_cert.cer and uw_key_prv.bin, but it reappears after reboot. The other files can be removed without problem.

<root@fwre:/nvram/1/security> ls -la
total 5
drwxr-xr-x    3 root     0                0 Jan  1 00:00 .
drwxr-xr-x    5 root     0                0 Jan  1 00:05 ..
-rwxrwxrwx    1 root     0              905 Jan  1 00:06 cm_cert.cer
drwxr-xr-x    2 root     0                0 Jan  1 00:00 download
lrwxrwxrwx    1 root     0               25 Jan  1 00:00 uw_cert.cer -> /nvram/fw/bpi/uw_cert.cer
lrwxrwxrwx    1 root     0               28 Jan  1 00:00 uw_key_prv.bin -> /nvram/fw/bpi/uw_key_prv.bin
-rwxrwxrwx    1 root     0             1052 Jan  1 00:06 mfg_cert.cer
-rwxrwxrwx    1 root     0              140 Jan  1 00:02 mfg_key_pub.bin
lrwxrwxrwx    1 root     0               37 Jan  1 00:00 root_pub_key.bin -> /etc/docsis/security/root_pub_key.bin

mount output:

<root@fware:/var/tmp> mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
ramfs on /var type ramfs (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock4 on /nvram type jffs2 (rw)

EDIT:

df /nvram/1/security
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mtdblock4             320       256        64  80% /nvram

cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro 0 0
proc /proc proc rw 0 0
ramfs /var ramfs rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /dev tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
/dev/mtdblock4 /nvram jffs2 rw 0 0
2
  • What is the output of df /nvram/1/security and of cat /proc/mounts? Aug 7, 2014 at 21:25
  • Edit: output for df /nvram/1/security and cat /proc/mounts.
    – Lexx Luxx
    Aug 9, 2014 at 1:00

1 Answer 1

4

the filesystem you are trying to remove symlink from is probably an initramfs which is loaded on ram at boot, so the one you are modifying is the ram copy of the initial ram disk, which is discarded at shutdown.

If you want to modify the ramdisk file, you need additional information. Which bootloader are you using? From which device? Can you access the kernel file and the ramdisk? Which kernel command line do you have? (use cat /proc/cmdline to discover)?

I found this page that explains how to put a ramdisk image on a u-boot device. However I couldn't find a way to download the original ramdisk to your computer, so that you can edit.

Please be careful that if you provide an invalid ramdisk your system could become unbootable. I don't know much about that specific architecture, so I can't suggest you a proven safe strategy. You would have your best chances if you ask another question about how to modify the initial ramdisk for a U-boot embedded modem (in this question you asked about symlinks so people who know about u-boot would probably overlook this completely)

9
  • That or some other RAM based config. e.g. ESXi creates a lot of the file system at boot from config files.
    – ericx
    Aug 7, 2014 at 0:08
  • Linux embedded, and U-Boot 1.2.0, modem device. Hardware configuration sample. Access via serial console and Busybox SSH shell. I have no source code itself.
    – Lexx Luxx
    Aug 7, 2014 at 0:40
  • That's strange, I think that all settings are stored in NVRAM. There is 7 MTD partitions, one of them is "nvram". Also, I haven't heard that anyone ever had a problem to remove those files from NVRAM. I don't think that this device have such major hardware changes.
    – Lexx Luxx
    Aug 7, 2014 at 1:04
  • so you think it may not be related to the root file system being a ramdisk? What does mount command says?
    – pqnet
    Aug 7, 2014 at 1:06
  • I managed to deal with this problem: this is actually firmware feature, these file names are predefined, firmware does not allow to remove or rename them.
    – Lexx Luxx
    Aug 7, 2014 at 20:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .