Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 310751 Details for
Bug 360513
[4.6/4.7] sys-boot/grub-0.97 fails to boot when built w/ >=sys-devel/gcc-4.6.0
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
test script
test.sh (text/plain), 1.85 KB, created by
SpanKY
on 2012-05-04 06:41:05 UTC
(
hide
)
Description:
test script
Filename:
MIME Type:
Creator:
SpanKY
Created:
2012-05-04 06:41:05 UTC
Size:
1.85 KB
patch
obsolete
>#!/bin/bash > >dm="grubtest" >size="6000000000" # units of 512 bytes >p1_size="+2T" >p2_size="+100M" > >case $1 in >create|destroy|auto) ;; >*) echo "Usage: $0 <auto [sizes]|create|destroy <dir>>"; exit 1;; >esac > >set -e > >create() { >loop=`losetup -f` >tmpdir=`mktemp -d -u` > >cat <<-EOF >Settings: >loop: $loop >tmpdir: $tmpdir >dmsetup: $dm >disk size: $(( size * 512 )) bytes >first partition size: $p1_size >second partition size: $p2_size > >hit enter to goooooo >EOF >read > >mkdir $tmpdir >pushd $tmpdir >/dev/null >echo ${loop} > loop >dd if=/dev/zero count=1 seek=$(( size - 1 )) obs=512 of=img >ls -lh img >losetup -v ${loop} img >devinfo=$(stat -c %t:%T ${loop}) >echo "0 ${size} linear ${devinfo} 0" | dmsetup create $dm > >p1="n\n\n\n${p1_size}\n\n" >p2="n\n\n\n${p2_size}\n\n" >fin="p\nw\ny\n" >gdisk /dev/mapper/$dm <<<"$(printf %b "$p1$p2$fin")" > >kpartx -a /dev/mapper/$dm > >mke2fs /dev/mapper/${dm}2 >mkdir mnt >mount /dev/mapper/${dm}2 mnt >mkdir -p mnt/boot >rsync -a /boot/grub/ mnt/boot/grub/ >echo "(hd0) /dev/mapper/${dm}" > mnt/boot/grub/device.map > >printf 'root (hd0,1)\nsetup (hd0)\n' | grub --batch --device-map=$tmpdir/mnt/boot/grub/device.map > >cat <<-EOF > >############ >Now run: > printf 'root (hd0,1)\nsetup (hd0)\n' | grub --batch --device-map=$tmpdir/mnt/boot/grub/device.map >To cleanup: > $0 destroy $tmpdir >EOF >} > >destroy() { >tmpdir=$1 >if [[ ! -d $tmpdir ]] ; then > echo "Need the tmpdir; $tmpdir does not exist" > exit 1 >fi >pushd $tmpdir >/dev/null >loop=$(<loop) > >if [[ -e mnt ]] ; then > if ! rmdir mnt 2>/dev/null ; then > umount mnt > rmdir mnt > fi >fi > >if [[ -e /dev/mapper/${dm}1 ]] ; then > kpartx -d /dev/mapper/${dm} >fi > >if [[ -e /dev/mapper/$dm ]] ; then > dmsetup remove $dm >fi > >losetup -d ${loop} >rm img loop >cd / >rmdir $tmpdir >} > >auto() { >case $# in >1) p1_size=$1 ;; >2) p1_size=$1 p2_size=$2 ;; >*) ;; >esac >create >d=$PWD >cd / >destroy $d >cat <<EOF > >AUTOMATICALLY CLEANED UP HAVE A NICE DAY >EOF >} > >"$@"
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 Raw
Actions:
View
Attachments on
bug 360513
:
278079
|
294085
|
294087
|
294089
|
298111
|
298113
|
299559
|
300329
| 310751 |
312587
|
313069
|
313099