summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-11-17 20:43:59 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2010-11-17 20:43:59 +0100
commit4934009fea220a1935c0b40241c90e9a0782097f (patch)
tree4376f6e228d7636ec96372ffc3fc137f78cdd16b /scripts
parent53d22bb88e82c1d8dd19db418ca12c664e341ba4 (diff)
optimize build for hardware profile (x86/x86_64), optimize chroot installer script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-chroot.sh113
-rwxr-xr-xscripts/install.sh2
2 files changed, 52 insertions, 63 deletions
diff --git a/scripts/install-chroot.sh b/scripts/install-chroot.sh
index cab2e6d7f..23adeb17b 100755
--- a/scripts/install-chroot.sh
+++ b/scripts/install-chroot.sh
@@ -45,15 +45,19 @@ else
fi
cfgfs=1
-rb532=0
-while getopts "nr" option
+console=0
+serial=0
+while getopts "nrcs" option
do
case $option in
n)
cfgfs=0
;;
- r)
- rb532=1
+ s)
+ serial=1
+ ;;
+ c)
+ console=1
;;
*)
printf "Option not recognized\n"
@@ -78,18 +82,6 @@ else
printf "$2 is not a file, Exiting\n"
exit 1
fi
- if [ $rb532 -eq 1 ];then
- if [ -z $3 ];then
- printf "Please give the kernel as third parameter\n"
- exit 2
- fi
- if [ -f $3 ];then
- printf "Installing $3 on $1\n"
- else
- printf "$3 is not a file, Exiting\n"
- exit 1
- fi
- fi
if [ -b $1 ];then
printf "Using $1 as CF/USB disk for installation\n"
printf "This will destroy all data on $1, are you sure?\n"
@@ -141,29 +133,9 @@ case $2 in
;;
esac
-if [ $rb532 -ne 0 ];then
- printf "Create partition and filesystem for rb532\n"
- rootpart=${1}2
- $parted -s $1 mklabel msdos
- sleep 2
- maxsize=$(env LC_ALL=C $parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
- rootsize=$(($maxsize-2))
-
- $parted -s $1 unit cyl mkpart primary ext2 0 1
- $parted -s $1 unit cyl mkpart primary ext2 1 $rootsize
- $parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
- $parted -s $1 set 1 boot on
- $sfdisk --change-id $1 1 27
- $sfdisk --change-id $1 3 88
- sleep 2
- $mke2fs ${1}2
- sync
- dd if=$3 of=${1}1 bs=2048
- sync
-else
- rootpart=${1}1
- if [ $cfgfs -eq 0 ];then
- printf "Create partition and filesystem without cfgfs\n"
+rootpart=${1}1
+if [ $cfgfs -eq 0 ];then
+ printf "Create partition and filesystem without cfgfs\n"
$sfdisk $1 << EOF
,,L
;
@@ -171,20 +143,19 @@ $sfdisk $1 << EOF
;
y
EOF
- $mke2fs ${rootpart}
- else
- printf "Create partition and filesystem with cfgfs\n"
- $parted -s $1 mklabel msdos
- sleep 2
- maxsize=$(env LC_ALL=C $parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
- rootsize=$(($maxsize-2))
-
- $parted -s $1 unit cyl mkpart primary ext2 0 $rootsize
- $parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
- $parted -s $1 set 1 boot on
- $sfdisk --change-id $1 2 88
- $mke2fs ${1}1
- fi
+ $mke2fs ${rootpart}
+else
+ printf "Create partition and filesystem with cfgfs\n"
+ $parted -s $1 mklabel msdos
+ sleep 2
+ maxsize=$(env LC_ALL=C $parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
+ rootsize=$(($maxsize-2))
+
+ $parted -s $1 unit cyl mkpart primary ext2 0 $rootsize
+ $parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
+ $parted -s $1 set 1 boot on
+ $sfdisk --change-id $1 2 88
+ $mke2fs ${1}1
fi
if [ $? -eq 0 ];then
@@ -211,12 +182,13 @@ printf "Fixing permissions\n"
chmod 1777 $tmp/tmp
chmod 4755 $tmp/bin/busybox
-if [ $rb532 -eq 0 ];then
- printf "Installing GRUB bootloader\n"
- mkdir -p $tmp/boot/grub
- mount -o bind /dev $tmp/dev
- chroot $tmp mount -t proc /proc /proc
- chroot $tmp mount -t sysfs /sys /sys
+printf "Installing GRUB bootloader\n"
+mkdir -p $tmp/boot/grub
+mount -o bind /dev $tmp/dev
+chroot $tmp mount -t proc /proc /proc
+chroot $tmp mount -t sysfs /sys /sys
+
+if [ $serial -eq 1 ];then
cat << EOF > $tmp/boot/grub/grub.cfg
set default=0
set timeout=1
@@ -230,12 +202,27 @@ menuentry "GNU/Linux (OpenADK)" {
linux /boot/vmlinuz-adk ro init=/init console=ttyS0,$speed console=tty0 panic=10
}
EOF
- chroot $tmp grub-install $1
- umount $tmp/proc
- umount $tmp/sys
- umount $tmp/dev
fi
+if [ $console -eq 1 ];then
+cat << EOF > $tmp/boot/grub/grub.cfg
+set default=0
+set timeout=1
+terminal_output console
+terminal_input console
+
+menuentry "GNU/Linux (OpenADK)" {
+ insmod ext2
+ set root=(hd0,1)
+ linux /boot/vmlinuz-adk ro init=/init console=tty0 panic=10
+}
+EOF
+fi
+
+chroot $tmp grub-install $1
+umount $tmp/proc
+umount $tmp/sys
+umount $tmp/dev
umount $tmp
printf "Successfully installed.\n"
diff --git a/scripts/install.sh b/scripts/install.sh
index 3e07a7181..98a93bdb5 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -21,6 +21,8 @@ fi
cfgfs=1
quiet=0
+console=0
+serial=0
while getopts "nq" option
do
case $option in