ps2homebrew / hdl-dump

Install games in HDLoader format to APA-formatted hard drive
122 stars 25 forks source link

add CMD_MKPART #51

Open bignaux opened 2 years ago

bignaux commented 2 years ago

Pull Request checklist

Note: these are not necessarily requirements

Pull Request description

I try to find a way to make ps2 linux from maximus32 easy and error prone install thanks to hdl_dump #49

few lines on the current process, next we need inject_raw cmd. But we have to find solution to avoid editing fstab and loader configuration.

https://www.psx-place.com/threads/ps2linux-version-3-8-a-new-update-from-maximus32.11382/
sudo kpartx -a ps2linux3.8_v0.1.img

vmlinux-v3.8.gz seems to wait for GPT table, enumerate /dev/sda , i can't boot from it. vmlinux-v2.6.35.gz 2 enumerate from APA part name, so no need to edit file in fs and can be used with hdl_dump. Only PS2_LINUX_ID "__linux." prefixed partition are visible from Linux , no content check, but seems to show PP one. Perhaps it would be better to check the partition type instead of name, to allow usage of PP partition, starting by "PP." ie "PP.Blackrhino" (so rely on other element, like in partition superblock, UUID, LABEL ...).

hdl_dump mkpart /dev/sdb __linux.1 ext2 1920M
hdl_dump mkpart /dev/sdb __linux.2 swap 124M
hdl_dump toc /dev/sdb --dm | sudo dmsetup create --concise
mkfs.ext2 -I 128 /dev/disk/by-id/dm-name-sdb-__linux.1
mkswap  /dev/disk/by-id/dm-name-sdb-__linux.2
losetup -f  __linux.1
mkdir -p orig dest
sudo mount /dev/loop1 orig
sudo mount /dev/disk/by-id/dm-name-sdb-__linux.1 dest
sudo rsync -aAXv orig/ dest/
sudo vim dest/etc/fstab
sudo umount orig/ dest/
losetup -d /dev/loop1
dmsetup remove_all
bignaux commented 2 years ago

poke @rickgaiser

bignaux commented 2 years ago

Thanks @rickgaiser for your help. All my work is systematically thrown away.

rickgaiser commented 2 years ago

I've never used hdl-dump, and I don't understand what you're asking of me. What's the question? Why are you specifically asking it to me?