LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 05-24-2011, 08:52 AM   #1
junmuz
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Rep: Reputation: 0
Files are lost over reboot


Hi,

I am using Linux over AMCC PPC440EPx board. The Busybox image is a ram disk image that is loaded over the board.

During the booting up process, the device image is uncompressed and loaded into the ram but whatever changes that I have made are not saved to the compressed image. Instead all the settings are reset to default over reboot.

Can anyone suggest a solution to this problem?
 
Old 05-24-2011, 09:09 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Of course your changes are lost. You are making the changes to the uncompressed system in RAM, not to the image. Read out the image, decompress it, make your changes, compress the new image and write it back.
 
1 members found this post helpful.
Old 05-24-2011, 09:21 AM   #3
junmuz
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Original Poster
Rep: Reputation: 0
But the question is that how the changes will be retained. Is there any particular bash command to do so?
 
Old 05-24-2011, 09:54 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
No, you have to do it the way I told you. Unpack the image on a different computer, make the changes you want to the unpacked files, repack them and write the new image to you embedded board.
 
Old 05-24-2011, 09:57 AM   #5
junmuz
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Apart from it, is there a way to make changes on the embedded platform?
 
Old 05-24-2011, 10:02 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
If you can mount a partition or have enough space in RAM to unpack the iomage you can make the changes there, generate a new image and write it back.
 
Old 05-29-2011, 11:31 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Is the original media from which the RAM disk is loaded accessible as a writable filesystem? Often on embedded systems, the bootloader fetches the kernel and initrd from a form of flash that can only be updated using something like a jtag interface. In such a case as that, you cannot store the changes back to non-volatile memory. It may also be the case that you have a small amount of writable non-volatile memory that can be used to store runtime data. In this case, you would have to modify your application so that it deliberately uses this kind of store. Your application might periodically write a configuration file or binary blob to the non-volatile media, and on boot, re-read the saved configuration to an appropriate place.
Is something like compact flash, SD card, or USB mass storage an option for you?
--- rod.
 
Old 06-06-2011, 10:30 PM   #8
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
Just like theNbomr stated, if you can access the block device file where the ramdisk is written (usually flash memory), then you can change the whole ramdisk by using dd to write to that location. But you should know beforehand the address and allocated size of the ramdisk so you won't overwrite the other partition on that block device.

If you want to save some files that can be retained in your device, write them on a different writable partition that you mounted during bootup.

Regards,
archieval
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why is the files lost when I reboot linux on VMware JimOrJoe Linux - Newbie 11 06-03-2016 05:45 PM
keyboard lost after first reboot jerrybasham Slackware - Installation 4 07-21-2006 07:47 PM
fstab changes lost after reboot benn333 MEPIS 8 09-21-2005 03:04 PM
Lost mouse after reboot+lost modem BACTRATE Mandriva 3 04-07-2005 06:45 AM
lost hd upon reboot gehwokka Linux - Hardware 4 06-04-2003 02:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration