Modifiying the iPhone Linux rootfs

Discussion in 'Android Chat' started by Cyanidepoison, Nov 29, 2008.

  1. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    I thought some people may want to poke around the filesystem outside of the (slow) terminal on their framebuffered iPhone screen, so I'll share a little bit of knowledge. You may also want to do this to change the contents of a file or something, in our case the hostname.

    So start by downloading the iphonelinux-demo package. You know where to get it.

    Code:
    tar -xzf iphonelinux-demo.tar.gz
    cd iphonelinux-demo
    
    Now that we're in the bit of magic that is the demonstration program directory, mount the rootfs.

    Code:
    modprobe loop #do this if you don't have the loop kernel module loaded
    gzip -d rootfs.arm.ext2.gz
    mkdir rootfs-iphone
    mount -o loop rootfs.arm.ext2 roofs-iphone/ # may need root to do this
    
    So you're in the filesystem. Go to town.

    Code:
    su root
    nano /etc/hostname # I changed the hostname to mahlinux for giggles
    
    Now lets save our changes.

    Code:
    umount rootfs.arm.ext2
    gzip rootfs.arm.ext2
    
    Boot and you're good to go.
  2. darkshadow

    darkshadow Member

    Joined:
    Dec 28, 2007
    Messages:
    151
    Likes Received:
    1
    Device:
    iPod touch
    When unmounting loop-back devices you should use -d to bring it down correctly

    umount -d rootfs-iphone
  3. simonrichards150

    simonrichards150 New Member

    Joined:
    Oct 29, 2007
    Messages:
    2,058
    Likes Received:
    94
    Device:
    iPod touch
  4. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    I didn't know this. I'll go check out the man page on this one!

    Please Register or Log in to view images

  5. eternal404

    eternal404 Member

    Joined:
    Sep 17, 2007
    Messages:
    203
    Likes Received:
    0
    Device:
    iPod touch
    thanks for the tip =)
    I also hex edited my openiboot-ipod.img3 to change the welcome message.
  6. robertomano24

    robertomano24 Member

    Joined:
    Jun 16, 2008
    Messages:
    346
    Likes Received:
    0
    Device:
    4G iPod touch
    im sorry to ask a noobby question, but i cant seem to get past the first box of commands. haha. how do i do this?
  7. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    This isn't meant for random people to do...

    This is for people who want to put a cross-compiled program into the filesystem to use, or to modify configuration files.

    Doing this to say you've done it ISN'T the point.
  8. robertomano24

    robertomano24 Member

    Joined:
    Jun 16, 2008
    Messages:
    346
    Likes Received:
    0
    Device:
    4G iPod touch
    yes i understand that much. that didnt answer my "question" and were in a "forum"
  9. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    I'm not here to help you. You should be able to figure it out.
  10. robertomano24

    robertomano24 Member

    Joined:
    Jun 16, 2008
    Messages:
    346
    Likes Received:
    0
    Device:
    4G iPod touch
    understood.
    sorry im just lazy. okie dokie

Share This Page