Results 1 to 9 of 9
Hi Guys, i have an activity planned where i need to update the Nic drivers (tg3),i am planning to install the src rpm and then do rpmbuild -bb. What is ...
- 11-09-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 1
Rollback Driver on RHEL
Hi Guys, i have an activity planned where i need to update the Nic drivers (tg3),i am planning to install the src rpm and then do rpmbuild -bb. What is the safest way to rollback if necessary?
- 11-09-2011 #2forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,099
Hello and welcome!
There isn't any rollback option with Linux, but you can make sure you have a copy of any previous packages that you might need on hand before installing any new packages, then reinstall the previous packages if needed, or you can do some type of system backup that you could restore your previous system from if needed. You can do complete system image backups or only incremental backups of files/configs if you wish.
Check this database for some backup options that might work for you, and I'd recommend testing them before counting on them to fulfill your needs:
Backup | Linux App Finder
Drive Imaging | Linux App Finderoz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 11-09-2011 #3Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
In the case of a kernel driver, you can effect a roll-back by simply backing up the file first, then restoring it to its original name when you wish to revert to your original state, e.g.:
You might also wish to do a 'depmod -a' to regenerate your modules.dep file.Code:# back up the original driver/file mv /lib/modules/$(uname -r)/kernel/drivers/net/tg3.ko /lib/modules/$(uname -r)/kernel/drivers/net/tg3.ko.bak # install your updated driver/rpm # remove your updated driver/rpm # restore the original driver/file mv /lib/modules/$(uname -r)/kernel/drivers/net/tg3.ko.bak /lib/modules/$(uname -r)/kernel/drivers/net/tg3.ko
If you ever find that you've clobbered a kernel driver, you can always replace that driver (along with all the others) with this set of commands:
Code:# get the name of the RPM that owns your currently running kernel name=$(rpm -qf --queryformat='%{NAME}' `grubby --default-kernel`) # remove the RPM package from the RPM database, but leave the files themselves in tact # (you need to do this b/c yum will say it is already installed) rpm -e --justdb --nodeps $name # now install the kernel package yum install $(name)
- 11-09-2011 #4
That last is very cool, Atreyu! I never thought of that.
- 11-10-2011 #5Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Yeah, i was very happy when I found that option - can't wait for Yum to get on board.
- 11-10-2011 #6
Yeah, it's kind of weird that they specifically exclude installonly packages like kernels from the yum "reinstall" option.
- 11-10-2011 #7Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Confession: never noticed the reinstall yum option - thanks for pointing it out! when did those sneaky yum bastards slip that one in?
- 11-10-2011 #8
Those bastards originated from Duke University, so they have sneaky in their DNA (I'm a UNC alum). I think reinstall came along in the past couple of years.
BTW, the "queryformat=%{NAME}" in
makes the result ambiguous on systems with more than one kernel version installed, which is the case with most RH/Centos/Fedora systems. It's typically going to yield "kernel" without a version/architecture. rpm is going to report "kernel specifies multiple packages" and fail the db erase, and yum is going to install the latest available kernel, which may not be what you're running. I think you want to leave out the queryformat, which will yield a version-qualified name and the desired result.Code:name=$(rpm -qf --queryformat='%{NAME}' `grubby --default-kernel`)
I actually had an application for this technique this morning, replacing source-compiled Qlogic drivers with the in-kernel ones. Thanks again for the tip.
- 11-10-2011 #9Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Yeah, forgot about that - I've run into that too. What I'd done to get around that was add the VERSION and RELEASE info:
Also, if grubby doesn't work/is not available, you can also do:Code:name=$(rpm -qf --queryformat='%{NAME}-%{VERSION}-%{RELEASE}\n' `grubby --default-kernel`)
Code:name=$(rpm -qf --queryformat='%{NAME}-%{VERSION}-%{RELEASE}\n' `ls /boot/vmlinuz-$(uname -r)`)


Reply With Quote
