Re: [Thinstation-general] Modifying the initrd file
Brought to you by:
doncuppjr
|
From: Reimers, R. L (TOG) <rlr...@Th...> - 2007-11-01 19:44:31
|
I got it figured out. I can now modify a Thin Station initrd, save it out, and have it auto-download. A bit of the PITA, but does what I needed it to do. This has to be done inside of a Linux client, which I was not very familiar with. If you don't know Linux - work with it - learn - I certainly had to, and did learn a lot. Steps: Download a Thinstation-2.3..tar.gz - a recent version Install, or unpack it - then copy the mksquashfs executable from utils/tools to /bin Copy initrd to your local drive. (I copied to /home) Create a couple of folders, such as /home/init and /home/init2. Mount the initrd file system: mount /home/initrd /home/init -o loop=3D/dev/loop0 -t squashfs =20 Copy the files from the mounted initrd: cp -R /home/init/ /home/init2=20 You may need to chown the files in /home/init2 to enable you to work on them: chown -hR logonID /home/init2 Unmount the initrd: umount /home/init/ You may now work with, modify the files in the /home/init2 folder to the way you want. The following assumes you are working in the /home/init2 folder. I added a file to etc/init.d that runs a file located at /tmp/mnt/disc/disc0/part1, which gets installed there during the ThinStation update process. I then added a link to that file in /etc/rc5.d from a prompt. I was cd to etc/rc5.d, entered: ln -s ../init.d/linaout S25linaout - the file I added was called linaout. You also have to change your "added" file (etc/init.d/linaout) to executable: chmod a+x ./linaout Now, you need to change the version number that will be in the new initrd: Edit etc/thinstation.defaults - change HDUPDATE version info to a higer number (at bottom of file)=20 FYI - with the new Time Zone information - this is the setting for Central time: TIME_ZOME=3D"CST6CDT,M3.2.0,M11.1.0" - sets for the new daylight time. When done with the mods you want, you need to recreate the initrd. I found it works for me to copy the folder structure to /boot/initrd-tree - cp -R /home/init2/ /boot/initrd-tree - as su or root. Now to create the initrd - mksquashfs /boot/initrd-tree ./initrd -noappend Copy the initrd to a network location, to the TFTP server - follow directions for updating the image.=20 This worked well for me - I "may" have missed a trailing "/", or something, I am not perfect. Play with it, test - if it works for you - great - if not - ? YMMV Randy -----Original Message----- From: TrevorB [mailto:tre...@us...]=20 Sent: Friday, October 12, 2007 6:12 PM To: Reimers, Randy L (TOG) Cc: thi...@li... Subject: Re: [Thinstation-general] Modifying the initrd file On Fri, 2007-10-12 at 17:10 -0500, Reimers, Randy L (TOG) wrote: > I'm trying to modify the initrd file. Using Ubuntu Linux, I can mount > the file system as read-only, but not save any changes. I use=20 > syslinux to run it from the hard drive - this works beautifully, runs=20 > a Citrix session - no complaints on this part. Now, I need to run an=20 > Asset management program on each computer, so we know that the=20 > computers are in use, and some other information. I am running=20 > version 2.1.3 > =20 > How do I modify the files and scripts, within initrd, then save the=20 > changes as a new initrd? Thinstation TS-O-Matic and the local build system (which runs on Ubuntu) generate the initrd, based on your build.conf file, from pre-compile components in a build tree (this is a construct, NOT a compile, so no compilers needed). You can't hack the scripts or add additional executeables via TS-O-Matic, but you can with a local build.=20 Download Thinstation-2.2.1rc3.tar.gz from sourceforge (follow the download links from the Thinstation home page or http://sourceforge.net/project/showfiles.php?group_id=3D80408) > I copy the file to the Ubuntu drive, at a prompt I enter:=20 >=20 > Mount /home/rreimers/initrd /home/reimers/init -o loop=3D/dev/loop0 -t = > squashfs >=20 > I then have access to the inside files at /home/rreimers/init, I need=20 > to change to modify access. How? >=20 > =20 >=20 > I need to add a new binary to the initrd - it is an asset finder from=20 > Alloy-Software, called lina. I need to mount a TFTP site, then run=20 > lina, put the resulting file onto the TFTP server. This TFTP server=20 > is the same one that Thin Station is connecting to for configuration=20 > files. Can someone help me with the script, and make it auto-run each > time the computer starts? I can run lina at the Linux prompt, and=20 > copy it to the tftp server, just need to get it all together, and=20 > automate the process. Create a package for lina. You could look at packages/template as the standard example, but in your case the package should be very simple. cd packages mkdir lina cd lina echo 'base' > dependencies mkdir bin cp <path-to-lina-executable> bin/. mkdir etc cd etc mkdir init.d mkdir rcd.0 put your script into init.d as lina.init cd rcd.0 ln -s S11lina ../init.d/lina.init Add a line into your build.conf 'package lina' and build (if you don't know how - read the FAQ). Good Luck Trevor B >=20 > =20 >=20 > Thank you >=20 > Randy >=20 >=20 > ---------------------------------------------------------------------- > --- This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/=20 > _______________________________________________ Thinstation-general mailing list Thi...@li... https://lists.sourceforge.net/lists/listinfo/thinstation-general |