Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 295756 Details for
Bug 424591
(mkinitrd) implement NBD handling
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
NBD patch from earlier
commit-4afc111 (text/plain), 3.43 KB, created by
Warren Togami
on 2008-02-25 01:18:07 UTC
(
hide
)
Description:
NBD patch from earlier
Filename:
MIME Type:
Creator:
Warren Togami
Created:
2008-02-25 01:18:07 UTC
Size:
3.43 KB
patch
obsolete
>commit 4afc11140442495211b25cab64c80371704f3440 >Author: Warren Togami <wtogami@redhat.com> >Date: Fri Dec 7 11:52:20 2007 -0500 > > Handle NBD squashfs read-only root (faster alternative to NFS root boot) > >diff --git a/mkinitrd b/mkinitrd >index 0dbda78..ed34862 100755 >--- a/mkinitrd >+++ b/mkinitrd >@@ -82,6 +82,8 @@ rc=0 > dynamic="" > nolvm="" > nodmraid="" >+nbdtype="" >+nbdport="" > > IMAGESIZE=8000 > PRESCSIMODS="sd_mod" >@@ -822,6 +824,22 @@ handlenfs() { > addnetdev $netdev > } > >+handlenbd() { >+ inst /usr/sbin/nbd-client "$MNTIMAGE" /sbin/nbd-client >+ # TODO: Auto-detection of type so we don't assume filesystem type >+ [ -z "$nbdtype" ] && nbdtype=squashfs >+ nbdport=${1#*:} >+ >+ remote=${1%%:*} >+ remoteip=$(host $remote | awk '/ address / { print $4 ; exit 0; }') >+ # assume, if it didn't resolve, that it's an IP >+ [ -z "$remoteip" ] && remoteip=$remote >+ # If we already have a net device, don't try to add another >+ [ -n "$net_list" ] && return >+ netdev=`/sbin/ip route get to $remoteip |sed 's|.*dev \(.*\).*|\1|g' |awk '{ print $1; exit }'` >+ addnetdev $netdev >+} >+ > while [ $# -gt 0 ]; do > case $1 in > --fstab*) >@@ -1006,6 +1024,14 @@ while [ $# -gt 0 ]; do > shift > fi > ;; >+ --nbdtype*) >+ if [ "$1" != "${1##--nbdtype=}" ]; then >+ nbdtype="${1##--nbdtype=}" >+ else >+ nbdtype="$2" >+ shift >+ fi >+ ;; > --help) > usage -n > ;; >@@ -1113,6 +1139,8 @@ if [ "x$PROBE" == "xyes" ]; then > physdev="" > if [ "$rootfs" == "nfs" -a "x$net_list" == "x" ]; then > handlenfs $rootdev >+ elif [ "$rootfs" == "nbd" -a "x$net_list" == "x" ]; then >+ handlenbd $rootdev > # check if it's root by label > elif [ "$rootdev" != "${rootdev##LABEL=}" -o \ > "$rootdev" != "${rootdev##UUID=}" ]; then >@@ -1127,7 +1155,8 @@ if [ "x$PROBE" == "xyes" ]; then > else > rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/') > fi >- if [ "$rootfs" != "nfs" ]; then >+ # No LVM for network root >+ if [ "$rootfs" != "nfs" ] && [ "$rootfs" != "nbd" ]; then > if [ -n "$physdev" -a "$physdev" != "$rootdev" ]; then > handlelvordev "$physdev" > fi >@@ -1206,6 +1235,11 @@ if [ -n "${loopfs}" ] || [[ "$rootopts" =~ "loop" ]]; then > fi > fi > >+if [ "$rootfs" == "nbd" ]; then >+ findmodule nbd >+ findmodule squashfs >+fi >+ > # If we use LVM or dm-based raid, include dm-mod > # XXX: dm not really supported yet. > testdm="" >@@ -1654,10 +1688,17 @@ if [ -n "$loopfs" ]; then > emit "losetup /dev/loop0 /tmpmount/$looppath" > fi > >-emit "echo Creating root device." >-# mkrootdev does "echo /dev/root /sysroot ext3 defaults,ro 0 0 >/etc/fstab" >-emit "mkrootdev -t $rootfs -o $rootopts $rootdev" >-rootdev=/dev/root >+if [ "$rootfs" == "nbd" ]; then >+ [ -z "$remoteip" ] && handlenbd $rootdev >+ emit "/sbin/nbd-client $remoteip $nbdport /dev/nbd0" >+ emit "echo Creating root device." >+ emit "echo /dev/nbd0 /sysroot squashfs ro 0 0 > /etc/fstab" >+else >+ emit "echo Creating root device." >+ # mkrootdev does "echo /dev/root /sysroot ext3 defaults,ro 0 0 >/etc/fstab" >+ emit "mkrootdev -t $rootfs -o $rootopts $rootdev" >+ rootdev=/dev/root >+fi > > emit "echo Mounting root filesystem." > emit "mount /sysroot"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 424591
: 295756