diff options
| -rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install.sh | 45 | ||||
| -rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb | 2 |
2 files changed, 25 insertions, 22 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh index 90978dd36a..01ff82926a 100644 --- a/meta/recipes-core/initrdscripts/files/init-install.sh +++ b/meta/recipes-core/initrdscripts/files/init-install.sh | |||
| @@ -16,7 +16,7 @@ swap_ratio=5 | |||
| 16 | found="no" | 16 | found="no" |
| 17 | 17 | ||
| 18 | echo "Searching for a hard drive..." | 18 | echo "Searching for a hard drive..." |
| 19 | for device in 'hda' 'hdb' 'sda' 'sdb' | 19 | for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1' |
| 20 | do | 20 | do |
| 21 | if [ -e /sys/block/${device}/removable ]; then | 21 | if [ -e /sys/block/${device}/removable ]; then |
| 22 | if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then | 22 | if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then |
| @@ -62,13 +62,7 @@ rm -f /etc/udev/scripts/mount* | |||
| 62 | # | 62 | # |
| 63 | # Unmount anything the automounter had mounted | 63 | # Unmount anything the automounter had mounted |
| 64 | # | 64 | # |
| 65 | umount /dev/${device} 2> /dev/null || /bin/true | 65 | umount /dev/${device}* 2> /dev/null || /bin/true |
| 66 | umount /dev/${device}1 2> /dev/null || /bin/true | ||
| 67 | umount /dev/${device}2 2> /dev/null || /bin/true | ||
| 68 | umount /dev/${device}3 2> /dev/null || /bin/true | ||
| 69 | umount /dev/${device}4 2> /dev/null || /bin/true | ||
| 70 | umount /dev/${device}5 2> /dev/null || /bin/true | ||
| 71 | umount /dev/${device}6 2> /dev/null || /bin/true | ||
| 72 | 66 | ||
| 73 | if [ ! -b /dev/sda ] ; then | 67 | if [ ! -b /dev/sda ] ; then |
| 74 | mknod /dev/sda b 8 0 | 68 | mknod /dev/sda b 8 0 |
| @@ -94,14 +88,23 @@ rootfs_start=$((boot_size + 1)) | |||
| 94 | rootfs_end=$((rootfs_start+rootfs_size)) | 88 | rootfs_end=$((rootfs_start+rootfs_size)) |
| 95 | swap_start=$((rootfs_end+1)) | 89 | swap_start=$((rootfs_end+1)) |
| 96 | 90 | ||
| 97 | bootfs=/dev/${device}1 | 91 | # MMC devices are special in a couple of ways |
| 98 | rootfs=/dev/${device}2 | 92 | # 1) they use a partition prefix character 'p' |
| 99 | swap=/dev/${device}3 | 93 | # 2) they are detected asynchronously (need rootwait) |
| 94 | rootwait="" | ||
| 95 | part_prefix="" | ||
| 96 | if [ ! "${device#mmcblk}" = "${device}" ]; then | ||
| 97 | part_prefix="p" | ||
| 98 | rootwait="rootwait" | ||
| 99 | fi | ||
| 100 | bootfs=/dev/${device}${part_prefix}1 | ||
| 101 | rootfs=/dev/${device}${part_prefix}2 | ||
| 102 | swap=/dev/${device}${part_prefix}3 | ||
| 100 | 103 | ||
| 101 | echo "*****************" | 104 | echo "*****************" |
| 102 | echo "Boot partition size: $boot_size MB (/dev/${device}1)" | 105 | echo "Boot partition size: $boot_size MB ($bootfs)" |
| 103 | echo "Rootfs partition size: $rootfs_size MB (/dev/${device}2)" | 106 | echo "Rootfs partition size: $rootfs_size MB ($rootfs)" |
| 104 | echo "Swap partition size: $swap_size MB (/dev/${device}3)" | 107 | echo "Swap partition size: $swap_size MB ($swap)" |
| 105 | echo "*****************" | 108 | echo "*****************" |
| 106 | echo "Deleting partition table on /dev/${device} ..." | 109 | echo "Deleting partition table on /dev/${device} ..." |
| 107 | dd if=/dev/zero of=/dev/${device} bs=512 count=2 | 110 | dd if=/dev/zero of=/dev/${device} bs=512 count=2 |
| @@ -109,24 +112,24 @@ dd if=/dev/zero of=/dev/${device} bs=512 count=2 | |||
| 109 | echo "Creating new partition table on /dev/${device} ..." | 112 | echo "Creating new partition table on /dev/${device} ..." |
| 110 | parted /dev/${device} mklabel msdos | 113 | parted /dev/${device} mklabel msdos |
| 111 | 114 | ||
| 112 | echo "Creating boot partition on /dev/${device}1" | 115 | echo "Creating boot partition on $bootfs" |
| 113 | parted /dev/${device} mkpart primary 1 $boot_size | 116 | parted /dev/${device} mkpart primary 1 $boot_size |
| 114 | 117 | ||
| 115 | echo "Creating rootfs partition on /dev/${device}2" | 118 | echo "Creating rootfs partition on $rootfs" |
| 116 | parted /dev/${device} mkpart primary $rootfs_start $rootfs_end | 119 | parted /dev/${device} mkpart primary $rootfs_start $rootfs_end |
| 117 | 120 | ||
| 118 | echo "Creating swap partition on /dev/${device}3" | 121 | echo "Creating swap partition on $swap" |
| 119 | parted /dev/${device} mkpart primary $swap_start $disk_size | 122 | parted /dev/${device} mkpart primary $swap_start $disk_size |
| 120 | 123 | ||
| 121 | parted /dev/${device} print | 124 | parted /dev/${device} print |
| 122 | 125 | ||
| 123 | echo "Formatting /dev/${device}1 to ext2..." | 126 | echo "Formatting $bootfs to ext2..." |
| 124 | mkfs.ext3 $bootfs | 127 | mkfs.ext3 $bootfs |
| 125 | 128 | ||
| 126 | echo "Formatting /dev/${device}2 to ext3..." | 129 | echo "Formatting $rootfs to ext3..." |
| 127 | mkfs.ext3 $rootfs | 130 | mkfs.ext3 $rootfs |
| 128 | 131 | ||
| 129 | echo "Formatting swap partition...(/dev/${device}3)" | 132 | echo "Formatting swap partition...($swap)" |
| 130 | mkswap $swap | 133 | mkswap $swap |
| 131 | 134 | ||
| 132 | mkdir /ssd | 135 | mkdir /ssd |
| @@ -150,7 +153,7 @@ fi | |||
| 150 | 153 | ||
| 151 | if [ -f /ssd/etc/grub.d/40_custom ] ; then | 154 | if [ -f /ssd/etc/grub.d/40_custom ] ; then |
| 152 | echo "Preparing custom grub2 menu..." | 155 | echo "Preparing custom grub2 menu..." |
| 153 | sed -i "s@__ROOTFS__@$rootfs@g" /ssd/etc/grub.d/40_custom | 156 | sed -i "s@__ROOTFS__@$rootfs $rootwait@g" /ssd/etc/grub.d/40_custom |
| 154 | sed -i "s/__VIDEO_MODE__/$3/g" /ssd/etc/grub.d/40_custom | 157 | sed -i "s/__VIDEO_MODE__/$3/g" /ssd/etc/grub.d/40_custom |
| 155 | sed -i "s/__VGA_MODE__/$4/g" /ssd/etc/grub.d/40_custom | 158 | sed -i "s/__VGA_MODE__/$4/g" /ssd/etc/grub.d/40_custom |
| 156 | mount $bootfs /bootmnt | 159 | mount $bootfs /bootmnt |
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb index 793a4b799b..ac73ef80aa 100644 --- a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb +++ b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb | |||
| @@ -3,7 +3,7 @@ LICENSE = "MIT" | |||
| 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
| 4 | SRC_URI = "file://init-install.sh" | 4 | SRC_URI = "file://init-install.sh" |
| 5 | 5 | ||
| 6 | PR = "r6" | 6 | PR = "r7" |
| 7 | 7 | ||
| 8 | RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs" | 8 | RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs" |
| 9 | 9 | ||
