Recently I had to write a program to shred a live disk. This was a security requirement for our devices. However, while testing the program, I found that this always failed. It was possible to overwrite whole of the disk except for a single sector. I knew that some process is using this part of the disk and that is the reason I was not able to write to it. I did an lsof for the device when the write operation was going on. There were certain process having files opened from that device. However, even after killing them, my program was not successful in writing the entire disk. Later, I even figured out that the programs with open files were not causing any real problem! But, then what was blocking the overwrite?
Now, we have decided to reboot the machine and do this operation before boot up. However, my doubt stayed till today. It is only today that I came to know about the real culprit. It is none other than the kernel. When a FS is mounted, the disk is opened by kernel. As long as it is mounted, kernel holds this open fd. As mount would have exited long back, so, one will never see this being caused by mount!
My blog on Linux and programming. Covers Linux, VoIP, C, mysql, php and everything else that I come across while tinkering with my Linux boxes.
Sunday, August 15, 2010
Friday, July 30, 2010
Looking for Linux kernel and C programmers (jobs)
Ok, we have been paining our HR for a while for this. But, day by day I am losing my confidence on getting any good resumes from them. We are looking for people with C and Linux internal skills. We have three openings. The first one is for Linux system programmers. The second one is for a device driver expert (PCIex, PCI, USB...). Last but not least, we are also looking for someone good at Linux (and optionally VxWorks) BSP. Knowledge of uboot will be an added advantage. If there is someone who is good at all these you are very much welcome. Also, it goes without saying that you should be very good at C.
If you have some extra Java or C++ skills, its going to be and added plus point. But, they are strictly optional. Btw, though we are mostly known for our memory chips and mobile phones, this opening is for our printer division. If you are interested, please send in your to suseelan at gmail.com
Google Cloud printing
Today we had a demo of Google cloud print. There were two teams which participated in the cloud demo. The first one made a client for the printer. It was an inbuilt client and we had our first "Web enabled" printer. We could submit a job at Google cloud service and the printer will fetch it and print. The interesting part was that it was done on the legacy printer.
The second one was an adobe AIR application that we developed and we in fact developed two application. We developed a proxy where one can register the legacy printers to cloud and an application which will allow a user to submit a print job to cloud. We demoed both the applications to our management.
There is one more application that we developed. This allows a user to e-mail a document to an address and the document will get printed on a given printer. The beauty of this application is that the printer does not have to be web enabled. The application works from a PC and does the job of submitting the print jobs to printer
Btw, I just noticed this; I was posting from chrome browser and when I tried to enter the tags, it was automatically selecting some tags for me. I tried to tag it with print and when I put a coma there, it changed the tag to suggested "Serial printer" tag (must be from my old tag cloud). Same way, it was replacing the "Cloud" with cloud computing etc. Had to put fight to make it understand that I am a superior intelligent being ;)
Sunday, June 20, 2010
How (not) to get chrome OS running in vmware
This weekend, I was just trying out Google's Chromium OS. The build went fine, all credits to Gentoo. But, the script to make a vmware image out of it failed miserably. After a lot of debugging I realised that a post install script is getting called which is causing all these issues. Now, what does the post install do?
/postinst messes up with your disk! Thank god that I realised this and I did not have something called /dev/sda12. Whatever be the the reason, they should have at least warned the users that image_to_vmare.sh script will try to mess up with the disk. Since I was pretty sure that I am interested in a vmware image, and no disk need to be involved here, I simply commented out that and proceed.
Once the image was formed, it was not booting in VMWare. Then I downloaded a openfiler vmware image and mounted chromeos disk as secondary. After a bit of tweaking with the grub configuration file (/boot/extlinux.conf), I was able to see something on the screen. I did the following things for this.
1. Marked /dev/sdb12 as a bootable partition using cgpt
2. Removed quiet and console options from kernel command line
3. Changed from USB boot to hdd boot
4. Changed the root device to /dev/sda3 and changed the ro option to rw
Now, comes the second pain. The X won't startup. I still haven't got it solved. But, I can currently run chrome. Lets see what I did for that.
1. Create a back-door entry by editing /etc/init/tty2.conf
1.1 Ask agetty to use /bin/bash as login program
2. Create a small shell script in / and pass the path to it as user name
(These were again done by mounting the disk on another working vmware appliance)
3. Create a /etc/init/network.conf for bringing up the wired network (Yep, that also did not work. Added a modprobe, ifconfig and route to do this)
Booted the machine and after ui.conf failed, I switched to tty2. Just gave my script path as login name and I got a shell. Now, I was able to start the X server. Created a new config file using X -configure and copied it to /etc/X11/xorg.conf. After this, I put the following line to ~/.xinitrc
echo /opt/google/chrome/chrome > ~/.xinitrc
Now, I typed in xinit and I have the chrome running!
There were many other painful stuff that I had to go through from yesterday morning till today 11AM to get this stuff working. But, I am still not happy. I want the UI to come up auto magically and let me login to google. I can see the reboot speed is really fast. I say reboot and the its done in 2-3 seconds! But, I really want to see the time taken by the actual UI to come up. If I get this working, I will post it here.
Currently, chrome allows me to browse the web like it does on a normal browser. Only change I could see was the presence of network icons on the top right corner. Also, if I directly type in http://google.com, it crashes. It seems like it is looking for some key manager and does not find it. At times, I can see it cribbing about CrOS library not getting loaded. Anyway, I only spent a day on this. Rest, next week :)
/postinst messes up with your disk! Thank god that I realised this and I did not have something called /dev/sda12. Whatever be the the reason, they should have at least warned the users that image_to_vmare.sh script will try to mess up with the disk. Since I was pretty sure that I am interested in a vmware image, and no disk need to be involved here, I simply commented out that and proceed.
Once the image was formed, it was not booting in VMWare. Then I downloaded a openfiler vmware image and mounted chromeos disk as secondary. After a bit of tweaking with the grub configuration file (/boot/extlinux.conf), I was able to see something on the screen. I did the following things for this.
1. Marked /dev/sdb12 as a bootable partition using cgpt
2. Removed quiet and console options from kernel command line
3. Changed from USB boot to hdd boot
4. Changed the root device to /dev/sda3 and changed the ro option to rw
Now, comes the second pain. The X won't startup. I still haven't got it solved. But, I can currently run chrome. Lets see what I did for that.
1. Create a back-door entry by editing /etc/init/tty2.conf
1.1 Ask agetty to use /bin/bash as login program
2. Create a small shell script in / and pass the path to it as user name
(These were again done by mounting the disk on another working vmware appliance)
3. Create a /etc/init/network.conf for bringing up the wired network (Yep, that also did not work. Added a modprobe, ifconfig and route to do this)
Booted the machine and after ui.conf failed, I switched to tty2. Just gave my script path as login name and I got a shell. Now, I was able to start the X server. Created a new config file using X -configure and copied it to /etc/X11/xorg.conf. After this, I put the following line to ~/.xinitrc
echo /opt/google/chrome/chrome > ~/.xinitrc
Now, I typed in xinit and I have the chrome running!
There were many other painful stuff that I had to go through from yesterday morning till today 11AM to get this stuff working. But, I am still not happy. I want the UI to come up auto magically and let me login to google. I can see the reboot speed is really fast. I say reboot and the its done in 2-3 seconds! But, I really want to see the time taken by the actual UI to come up. If I get this working, I will post it here.
Currently, chrome allows me to browse the web like it does on a normal browser. Only change I could see was the presence of network icons on the top right corner. Also, if I directly type in http://google.com, it crashes. It seems like it is looking for some key manager and does not find it. At times, I can see it cribbing about CrOS library not getting loaded. Anyway, I only spent a day on this. Rest, next week :)
Sunday, June 13, 2010
FreeMind
Well, I just read about this in LFY today and wanted to try it. Seems like its a cool tool. I made a introductory Linux presentation (meant for our Java developers) in this. May be it is not a real strong use case. But, Freemind sure did help me organize things a bit. The software has got some nice folding and re-arranging options which I liked.
You can find FreeMind at http://freemind.sourceforge.net/wiki/index.php/Main_Page
I am also uploading the stuff that I made (exported to jpeg) using this.
You can find FreeMind at http://freemind.sourceforge.net/wiki/index.php/Main_Page
I am also uploading the stuff that I made (exported to jpeg) using this.
Subscribe to:
Posts (Atom)