-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1171 from jsmeix/remove_needless_bash_from_chroot…
…_calls_issue862 Removed needless login shell from chroot calls where possible
- Loading branch information
Showing
8 changed files
with
187 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 22 additions & 24 deletions
46
usr/share/rear/finalize/Linux-ppc64/200_install_yaboot.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
|
||
# skip if yaboot conf is not found | ||
if test ! -f $TARGET_FS_ROOT/etc/yaboot.conf; then | ||
return | ||
fi | ||
test -f $TARGET_FS_ROOT/etc/yaboot.conf || return | ||
|
||
# Reinstall yaboot boot loader | ||
LogPrint "Installing PPC PReP Boot partition." | ||
|
||
# Find PPC PReP Boot partitions | ||
part=$( awk -F '=' '/^boot=/ {print $2}' $TARGET_FS_ROOT/etc/yaboot.conf ) | ||
|
||
if [ -n "$part" ]; then | ||
LogPrint "Boot partion found: $part" | ||
chroot $TARGET_FS_ROOT /bin/bash --login -c "/sbin/mkofboot -b $part --filesystem raw -f" | ||
bootdev=$( echo $part | sed -e 's/[0-9]*$//' ) | ||
LogPrint "Boot device is $bootdev." | ||
bootlist -m normal $bootdev | ||
NOBOOTLOADER= | ||
if test "$part" ; then | ||
LogPrint "Boot partion found: $part" | ||
# Run mkofboot directly in chroot without a login shell in between, see https://github.com/rear/rear/issues/862 | ||
chroot $TARGET_FS_ROOT /sbin/mkofboot -b $part --filesystem raw -f | ||
bootdev=$( echo $part | sed -e 's/[0-9]*$//' ) | ||
LogPrint "Boot device is $bootdev." | ||
bootlist -m normal $bootdev | ||
NOBOOTLOADER= | ||
else | ||
bootparts=$( sfdisk -l 2>&1 | awk '/PPC PReP Boot/ {print $1}' ) | ||
LogPrint "Boot partitions found: $bootparts." | ||
for part in $bootparts | ||
do | ||
LogPrint "Initializing boot partition $part." | ||
chroot $TARGET_FS_ROOT /bin/bash --login -c "/sbin/mkofboot -b $part --filesystem raw -f" | ||
done | ||
bootdev=$( for part in $bootparts | ||
do | ||
echo $part | sed -e 's/[0-9]*$//' | ||
done | sort | uniq ) | ||
LogPrint "Boot device list is $bootdev." | ||
bootlist -m normal $bootdev | ||
NOBOOTLOADER= | ||
bootparts=$( sfdisk -l 2>&1 | awk '/PPC PReP Boot/ {print $1}' ) | ||
LogPrint "Boot partitions found: $bootparts." | ||
for part in $bootparts ; do | ||
LogPrint "Initializing boot partition $part." | ||
# Run mkofboot directly in chroot without a login shell in between, see https://github.com/rear/rear/issues/862 | ||
chroot $TARGET_FS_ROOT /sbin/mkofboot -b $part --filesystem raw -f | ||
done | ||
bootdev=$( for part in $bootparts ; do echo $part | sed -e 's/[0-9]*$//' ; done | sort | uniq ) | ||
LogPrint "Boot device list is $bootdev." | ||
bootlist -m normal $bootdev | ||
NOBOOTLOADER= | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 0 additions & 76 deletions
76
usr/share/rear/finalize/Linux-ppc64le/220_install_grub2.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Linux-ppc64/220_install_grub2.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.