Commit 35dd2008 authored by Michael Shigorin's avatar Michael Shigorin

tar2fs: add e2k arch support

Somewhat ARM-like with only the bootloader bits standing out; Elbrus 2000 firmware can read ext2 and boot the kernel directly.
parent 78ac727d
...@@ -31,7 +31,9 @@ INITRD_MODULES= ...@@ -31,7 +31,9 @@ INITRD_MODULES=
BOOTFSTYPE= BOOTFSTYPE=
BOOTPART= BOOTPART=
case "`arch`" in # NB: sudo => no GLOBAL_ will do either; mind qemu-* ARCH="$(arch)" # NB: sudo => no GLOBAL_ will do either; mind qemu-*
case "$ARCH" in
*86*) *86*)
# NB: different storage modules might be needed for non-kvm # NB: different storage modules might be needed for non-kvm
INITRD_MODULES="sd_mod ata_piix ahci virtio-scsi virtio-blk" INITRD_MODULES="sd_mod ata_piix ahci virtio-scsi virtio-blk"
...@@ -44,6 +46,12 @@ arm*) ...@@ -44,6 +46,12 @@ arm*)
BOOTPART="1" BOOTPART="1"
ROOTPART="2" ROOTPART="2"
;; ;;
e2k)
BOOTFSTYPE="ext2" # firmware knows it
BLOCKDEV="/dev/sda" # ...hopefully...
BOOTPART="1"
ROOTPART="2"
;;
esac esac
# figure out the part taken by /boot in the given tarball # figure out the part taken by /boot in the given tarball
...@@ -203,7 +211,15 @@ if [ -n "$BOOTPART" ]; then ...@@ -203,7 +211,15 @@ if [ -n "$BOOTPART" ]; then
fi fi
echo "MODULES_PRELOAD += $INITRD_MODULES $ROOTFSTYPE" >> "$ROOTFS/etc/initrd.mk" echo "MODULES_PRELOAD += $INITRD_MODULES $ROOTFSTYPE" >> "$ROOTFS/etc/initrd.mk"
echo "FEATURES += qemu" >> "$ROOTFS/etc/initrd.mk"
case "$ARCH" in
*86*)
echo "FEATURES += qemu" >> "$ROOTFS/etc/initrd.mk"
;;
e2k)
echo "FEATURES += usb" >> "$ROOTFS/etc/initrd.mk"
;;
esac
# NB: don't stick BOOTFS here, it has slightly different semantics # NB: don't stick BOOTFS here, it has slightly different semantics
pushd $ROOTFS/boot pushd $ROOTFS/boot
...@@ -217,6 +233,11 @@ rm -f .origver ...@@ -217,6 +233,11 @@ rm -f .origver
# ...target device too # ...target device too
sed -i "s,$LOOPROOT,$ROOTDEV," "$ROOTFS/etc/fstab" sed -i "s,$LOOPROOT,$ROOTDEV," "$ROOTFS/etc/fstab"
if [ -f boot.conf ]; then
sed -i -e "s,@ROOTUUID@,$ROOTUUID,g" -e "s,@KVER@,$KVER,g" boot.conf
fi
popd
if [ -x "$ROOTFS"/sbin/lilo ]; then if [ -x "$ROOTFS"/sbin/lilo ]; then
# configure and install bootloader # configure and install bootloader
REGEXP='^.*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$' REGEXP='^.*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment