[REQUEST] Step-by-step procedure in installing PKG files bigger than 4 Gb with HAN

Linux guide by me

1. on linux install apache2 for ubuntu
Code:
sudo apt-get install apache2

2. the default directory for serving files is /var/www/html/ so simply create a symlink there to your large pkg with command
Code:
sudo ln -s /path/to/your/game.pkg /var/www/html/

3. prepare your usb drive by creating a file called package_link.xml file on it paste the following xml into that file and make sure you change pkg_src pkg_src_qa to the local address of the pc you are hosting the pkg with and change content_id attribute to reflect the content id of the pkg you are installing
Code:
<XMBML version="1.0">
 <View id="package_link">
 <Attributes>
 <Table key="pkg_main">
 <Pair key="icon"><String>/dev_flash/vsh/resource/explore/icon/fah-xmb.png</String></Pair>
 <Pair key="title"><String>Direct link to package on PC</String></Pair>
 <Pair key="info"><String>Download and Install a Package from PC via Webserver</String></Pair>
 <Pair key="ingame"><String>disable</String></Pair>
 </Table>
 </Attributes>
 <Items>
<Query
 class="type:x-xmb/folder-pixmap"
 key="pkg_main"
 attr="pkg_main"
 src="#pkg_items"/>
 </Items>
 </View>
 
 <View id="pkg_items">
 <Attributes>
 <Table key="link001">
 <Pair key="info"><String>net_package_install</String></Pair>
 <Pair key="pkg_src"><String>http://192.168.0.100/Large_Package.pkg</String></Pair>
 <Pair key="pkg_src_qa"><String>http://192.168.0.100/Large_Package.pkg</String></Pair>
 <Pair key="content_name"><String>tool_pkg_install_pc</String></Pair>
 <Pair key="content_id"><String>EP0001-CONTENTID_00-0000000000000000</String></Pair>
 <Pair key="prod_pict_path"><String>/dev_flash/vsh/resource/explore/icon/fah-xmb.png</String></Pair>
 </Table>
 </Attributes>
 <Items>
 <Item class="type:x-xmb/xmlnpsignup" key="link001" attr="link001"/>
 </Items>
 </View>
 
</XMBML>

4. plug the usb into the right-most usb port on your ps3 and with HAN enabled go to the package manager in XMB, there should be an option to install package over network now, click it, it will say you need to install software, select yes and it should install the package.

That's it, you might want to stop apache2 service afterward and stop it from automatically starting on bootup everytime just use google to figure that out.

I've made a python script to create the XML and the symbolic link, you just need to put it on the same folder as the .pkg file and the .rap file (the RAP file is used to obtain package id) and execute it. Just one .pkg and one .rap in the folder, or the script won't work properly.

It needs lxml and netify libraries to create the XML and verify the IP, you can install them with PIP.

I can't upload the file here neither put on a download link, so here goes the code. Just copy it and paste it:

Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Author: Gabriel Bastos Vargas
try:
    import lxml.etree
    import lxml.builder
    import netifaces as ni
    import glob
    import os
except:
    print("Error importing modules.")
    print("Have you installed netifaces and lxml? Install them with 'sudo pip install lxml' and 'sudo pip install netifaces'")
# ========= FINDING PKG ========= #
try:
    PKG = glob.glob("*.pkg")[0]
except:
    print("No .pkg files found.")
    exit()
# ============== CREATING SYMBOLIC LINK ============== #
DIR = '/var/www/html'
PKG_PATH = os.path.abspath("./"+PKG)
os.system('sudo ln -s ' + "\'" + PKG_PATH + "\'" + ' ' + DIR)
# ======================================== FINDING PKG ID ======================================== #
try:
    RAP = (glob.glob("*.rap")[0])[:-4]
except:
    ANS = raw_input("No .rap files found, do you want to insert de package ID manually? [Y/n] ")
    if ANS in ('Y','y','yes','YES','yes'):
        RAP = raw_input("Insert the package ID: ")
    else:
        quit()
# ================================ FINDING CONNECTION ================================ #
try:
    # --------------------------- WIRED CONNECTION --------------------------- #
    ni.ifaddresses('enp2s0')
    IP = ni.ifaddresses('enp2s0')[ni.AF_INET][0]['addr']
    ANS = raw_input("Wired connection found, do you want to use it? [Y/n] ")
    if ANS in ('Y','y','yes','YES','yes'):
        print "IP: " + IP
except:
    print "No wired connection available, using Wi-Fi instead."
    try:
        # ------------------------- WI-FI CONNECTION ------------------------- #
        ni.ifaddresses('wlp3s0')
        IP = ni.ifaddresses('wlp3s0')[ni.AF_INET][0]['addr']
        ANS = raw_input("Wi-Fi connection found, do you want to use it? [Y/n] ")
        if ANS in ('Y','y','yes','YES','yes'):
            print "IP: " + IP
        else:
            quit()
    except:
        # ------------------------- CONNECTION ERROR ------------------------- #
        print "No Wi-Fi connection available."
        quit()
# ========= PKG SOURCE AND ID ========= #
PKG_SRC = "http://" + IP + "/" + PKG
PKG_ID = RAP
# =========== XML TAGS =========== #
E = lxml.builder.ElementMaker()
XMBML = E.XMBML
VIEW = E.View
ATTRIBUTES = E.Attributes
TABLE = E.Table
PAIR = E.Pair
STRING = E.String
ITEMS = E.Items
QUERY = E.Query
ITEM = E.Item
# --- HELPER FUNCION --- #
def CLASS(v):
    return {'class': v}
# =================================================== XML BUILDER =================================================== #
the_doc = XMBML(
        VIEW(
            ATTRIBUTES(
                TABLE(
                    PAIR(STRING('/dev_flash/vsh/resource/explore/icon/fah-xmb.png'),key="icon"),
                    PAIR(STRING('Direct link to package on PC'),key="title"),
                    PAIR(STRING('Download and Install a Package from PC via Webserver'),key="info"),
                    PAIR(STRING('disable'),key="ingame"),key='pkg_main'
                )
            ),
            ITEMS(
                QUERY(CLASS("type:x-xmb/folder-pixmap"),key="pkg_main",attr="pkg_main",src="#pkg_items")
            ),id='package_link'
        ),
        VIEW(
            ATTRIBUTES(
                TABLE(
                    PAIR(STRING('net_package_install'),key="info"),
                    PAIR(STRING(PKG_SRC),key="pkg_src"),
                    PAIR(STRING(PKG_SRC),key="pkg_src_qa"),
                    PAIR(STRING('tool_pkg_install_pc'),key="content_name"),
                    PAIR(STRING(PKG_ID),key="content_id"),
                    PAIR(STRING('/dev_flash/vsh/resource/explore/icon/fah-xmb.png'),key="prod_pict_path"),key='link001'
                )
            ),
            ITEMS(
                ITEM(CLASS("type:x-xmb/xmlnpsignup"), key="link001", attr="link001")
            ),id='pkg_items'
        ),version="1.0"
    )
# ======================= WRITING FILE ======================= #
file = open('package_link.xml','w')
file.write(lxml.etree.tostring(the_doc, pretty_print=True))
file.close()
# ====== END ====== #
print("All done.")
 
Last edited:
Back
Top