View Single Post
Posts: 110 | Thanked: 362 times | Joined on May 2014
#123
Code:
# a look (or Howto) at maemo-leste Running on real hardware (amd64)
# base system is ubuntu 16.04 and we use the latest maemo-leste-1.0-amd64-virtual-20180425.vdi virtualbox image and grub2

# why? hildon needs 3d hardware acceleration which is often not so well supported in a VM
# the leste wiki (https://leste.maemo.org/Virtual_Machine) on this topic is not so well?
# (are the .box images really Virtualbox images, for me it looks more like Vagrant images (sorry, i downloaded the 1GB image 2 times))

# as usual perform all action on your own risk, dont risk your data, you are playing with your disks. Make backups.

# to get disk raw image
vboxmanage clonehd -format RAW maemo-leste-1.0-amd64-virtual-20180425.vdi maemo-leste-1.0-amd64-virtual-20180425.raw

# to get partion image
sudo bash 
losetup -f -P maemo-leste-1.0-amd64-virtual-20180425.raw
cat /dev/loop0p1 > maemo-leste-1.0-amd64-virtual-20180425.imgP

# if you have a free partition (Y) on hdd X slot you can do
# (careful dont overwrite a wrong one!)
cat maemo-leste-1.0-amd64-virtual-20180425.imgP > /dev/sdXpY

# and create an u-boot boot entry in /etc/grub.d/40_custom

menuentry "maemo-leste" {
	 set root='(hdX,msdosY)'         
         linux /boot/vmlinuz-4.9.0-6-amd64 root=/dev/sdXpY ro quit net.ifnames=0
	 initrd /boot/initrd.img-4.9.0-6-amd64
 }

# and
update-grub

# sadly i didnt had a free spot for leste so above is untested.
# if you dont have a free partion you can also boot from the partion image stored on a "data" partion
# but for that you have to modify the initramdisk located in maemo-leste-1.0-amd64-virtual-20180425.imgP/boot/initrd.img-4.9.0-6-amd64

losetup -f -P maemo-leste-1.0-amd64-virtual-20180425.imgP
# assuming we get mapped to /dev/loop0

mkdir /mnt/maemo
mount /dev/loop0 /mnt/maemo/

mkdir /mnt/maemo/root/initrd
cd /mnt/maemo/root/initrd
# decompress initrd
zcat ../../boot/initrd.img-4.9.0-6-amd64 | cpio -i

# replace the function local_mount_root() in /mnt/maemo/root/initrd/scripts/local with an ADJUSTED Version of this
# we need to fix the location to your maemo-leste-1.0-amd64-virtual-20180425.imgP rootfs image
local_mount_root()
{
	local_top
	local_device_setup "${ROOT}" "root file system"
	ROOT="${DEV}"

	# Get the root filesystem type if not set
	if [ -z "${ROOTFSTYPE}" ]; then
		FSTYPE=$(get_fstype "${ROOT}")
	else
		FSTYPE=${ROOTFSTYPE}
	fi

	
	local_premount	

	if [ "${readonly}" = "y" ]; then
		roflag=-r
	else
		roflag=-w
	fi

	# FIXME This has no error checking
	modprobe ${FSTYPE}

	mkdir rootfs_base
	chmod 0777 rootfs_base

	# FIRST ADJUST
	# fix this to the location of your maemo-leste-1.0-amd64-virtual-20180425.imgP filesystem
	# in this case maemo-leste-1.0-amd64-virtual-20180425.imgP ist stored on an ext4  data partiton on /dev/sda10
	mount -w -t ext4 /dev/sda10 /rootfs_base

	# SECOND ADJUST
	# fix this to the right path of your maemo-leste-1.0-amd64-virtual-20180425.imgP filesystem
	# the  path to maemo-leste-1.0-amd64-virtual-20180425.imgP in this case is /antiX/maemo-leste-1.0-amd64-virtual-20180425.imgP
	# (this creates a loop mount for the root filesystem)
	mount -w ${ROOTFLAGS} -t ext4 /rootfs_base/antiX/maemo-leste-1.0-amd64-virtual-20180425.imgP ${rootmnt}

	[ "$quiet" != "y" ] && log_begin_msg "root mounted"

	# checkfs ${ROOT} root "${FSTYPE}"

	# # FIXME This has no error checking
	# # Mount root
	# if [ "${FSTYPE}" != "unknown" ]; then
	# 	mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt}
	# else
	# 	mount ${roflag} ${ROOTFLAGS} ${ROOT} ${rootmnt}
	# fi
}

# compress the initrd image again
cd /mnt/maemo/root/initrd
find . | cpio -o -H newc | gzip -9 > /mnt/maemo/boot/initrdImg.img

# and create an ADJUSTED u-boot boot entry in /etc/grub.d/40_custom
# again fix the device and the path

menuentry "maemo-leste.img" {
         set isofile="/antiX/maemo-leste-1.0-amd64-virtual-20180425.imgP"
         loopback loop (hd0,10)$isofile
	 linux (loop)/boot/vmlinuz-4.9.0-6-amd64 ro quit net.ifnames=0
	 initrd (loop)/boot/initrdImg.img
 }

# and 
update-grub

# Yippy: i managed to boot into maemo-leste on real amd64 hardware

# first impressions:
# nice, lean, cool old school mouse pointer
# a few bugs
# the mouse pointer is invisible in firefox
# i havent found out how to effective navigate the UI with the keyboard (switch desktops, switch windows) (seems it is somehow more optimised for touch ;))
 

The Following 19 Users Say Thank You to pythoneye2 For This Useful Post: