Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
02670b75
Commit
02670b75
authored
Dec 17, 2008
by
Ryan Jackson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Busybox's sed command supports in-place edits but not backups (-i.orig),
so backup the file first, then run sed.
parent
92831215
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
tmcd/linux/slicefix
tmcd/linux/slicefix
+10
-5
No files found.
tmcd/linux/slicefix
View file @
02670b75
...
...
@@ -408,13 +408,15 @@ dofreebsd() {
if
[
$changedisk
-eq
1
]
;
then
echo
" updating /etc/fstab"
sed
-i
.orig
-e
"s;^/dev/[a-zA-Z][a-zA-Z]*[0-9][0-9]*s[0-9][0-9]*;/dev/
${
freebsd_disk
}
s
${
part
}
;"
/mnt/etc/fstab
||
{
cp
-fp
/mnt/etc/fstab /mnt/etc/fstab.orig
sed
-i
-e
"s;^/dev/[a-zA-Z][a-zA-Z]*[0-9][0-9]*s[0-9][0-9]*;/dev/
${
freebsd_disk
}
s
${
part
}
;"
/mnt/etc/fstab
||
{
echo
"Failed to update /etc/fstab"
umount
$rootdev
return
1
}
echo
" updating /etc/dumpdates"
sed
-i
.orig
-e
"s;^/dev/[a-zA-Z][a-zA-Z]*[0-9][0-9]*s[0-9][0-9]*;/dev/
${
freebsd_disk
}
s
${
part
}
;"
/mnt/etc/dumpdates
||
{
cp
-fp
/mnt/etc/dumpdates /mnt/etc/dumpdates.orig
sed
-i
-e
"s;^/dev/[a-zA-Z][a-zA-Z]*[0-9][0-9]*s[0-9][0-9]*;/dev/
${
freebsd_disk
}
s
${
part
}
;"
/mnt/etc/dumpdates
||
{
echo
"Failed to update /etc/dumpdates"
umount
$rootdev
return
1
...
...
@@ -433,7 +435,8 @@ dofreebsd() {
on
=
"en"
fi
echo
"
${
on
}
abling ACPI"
sed
-i
.orig
-e
"/[Aa][Cc][Pp][Ii]/d"
/mnt/boot/loader.conf
||
{
cp
-fp
/mnt/boot/loader.conf /mnt/boot/loader.conf.orig
sed
-i
-e
"/[Aa][Cc][Pp][Ii]/d"
/mnt/boot/loader.conf
||
{
echo
"Failed to update /boot/loader.conf"
umount
$rootdev
return
1
...
...
@@ -461,7 +464,8 @@ EOF2
on
=
"en"
fi
echo
"
${
on
}
abling ASF"
sed
-i
.orig
-e
"/[Aa][Ss][Ff]/d"
/mnt/boot/loader.conf
||
{
cp
-fp
/mnt/boot/loader.conf /mnt/boot/loader.conf.orig
sed
-i
-e
"/[Aa][Ss][Ff]/d"
/mnt/boot/loader.conf
||
{
echo
"Failed to update /boot/loader.conf"
umount
$rootdev
return
1
...
...
@@ -595,7 +599,8 @@ dolinux() {
# grub's notion of root disk since the flash device will be "hd0".
# It appears that we do NOT have to update Linux's drive mapping.
#
sed
-i
''
-e
"s;root (hd[0-9],[0-9]);root (hd
${
gdisk
}
,
${
gpart
}
);"
$gconf
||
{
cp
-pf
/mnt/
$fgconf
/mnt/
$fgconf
.orig
sed
-i
-e
"s;root (hd[0-9],[0-9]);root (hd
${
gdisk
}
,
${
gpart
}
);"
$gconf
||
{
echo
"Failed to update root in
$fgconf
"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment