Guest User

fixup-mountpoints

a guest
Oct 1st, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 14.32 KB | None | 0 0
  1. #!/bin/sh
  2. # Fix up mount points device node names.
  3. # This is broken pending systemd > 191-2 so hack the generated unit files :(
  4. # See: https://bugzilla.redhat.com/show_bug.cgi?id=859297
  5.  
  6. DEVICE=$1
  7. shift
  8.  
  9. echo "Fixing mount-points for device $DEVICE"
  10.  
  11. case "$DEVICE" in
  12.     "FP2")
  13.         sed -i \
  14.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p13 ' \
  15.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p20 ' \
  16.             -e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p16 ' \
  17.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p14 ' \
  18.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
  19.             -e 's block/platform/msm_sdcc.1/by-name/modemst1 mmcblk0p11 ' \
  20.             -e 's block/platform/msm_sdcc.1/by-name/modemst2 mmcblk0p12 ' \
  21.             -e 's block/platform/msm_sdcc.1/by-name/fsg mmcblk0p17 ' \
  22.             -e 's block/platform/msm_sdcc.1/by-name/fsc mmcblk0p18 ' \
  23.             -e 's block/platform/msm_sdcc.1/by-name/dbi mmcblk0p3 ' \
  24.             -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p15 ' \
  25.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p8 ' \
  26.             "$@"
  27.         ;;
  28.  
  29.     "onyx")
  30.         sed -i \
  31.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p7 ' \
  32.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p27 ' \
  33.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p28 ' \
  34.             -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p15 ' \
  35.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p14 ' \
  36.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
  37.             "$@"
  38.         ;;
  39.  
  40.     "bullhead")
  41.         sed -i \
  42.             -e 's block/platform/soc.0/f9824900.sdhci/by-name/modem mmcblk0p1 ' \
  43.             -e 's block/platform/soc.0/f9824900.sdhci/by-name/persist mmcblk0p24 ' \
  44.             -e 's block/platform/soc.0/f9824900.sdhci/by-name/system mmcblk0p41 ' \
  45.             -e 's block/platform/soc.0/f9824900.sdhci/by-name/userdata mmcblk0p45 ' \
  46.             "$@"
  47.         ;;
  48.  
  49.     "hammerhead")
  50.         sed -i \
  51.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
  52.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p16 ' \
  53.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p25 ' \
  54.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p28 ' \
  55.             "$@"
  56.         ;;
  57.  
  58.     "mako")
  59.         sed -i \
  60.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
  61.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p20 ' \
  62.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p21 ' \
  63.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p23 ' \
  64.             "$@"
  65.         ;;
  66.  
  67.     "grouper")
  68.         sed -i \
  69.             -e 's block/platform/sdhci-tegra.3/by-name/APP mmcblk0p3 ' \
  70.             -e 's block/platform/sdhci-tegra.3/by-name/CAC mmcblk0p4 ' \
  71.             -e 's block/platform/sdhci-tegra.3/by-name/UDA mmcblk0p9 ' \
  72.             -e 's block/platform/sdhci-tegra.3/by-name/MSC mmcblk0p5 ' \
  73.             -e 's block/platform/sdhci-tegra.3/by-name/LNX mmcblk0p2 ' \
  74.             -e 's block/platform/sdhci-tegra.3/by-name/SOS mmcblk0p1 ' \
  75.             "$@"
  76.         ;;
  77.  
  78.     "tilapia")
  79.         sed -i \
  80.             -e 's block/platform/sdhci-tegra.3/by-name/APP mmcblk0p3 ' \
  81.             -e 's block/platform/sdhci-tegra.3/by-name/CAC mmcblk0p5 ' \
  82.             -e 's block/platform/sdhci-tegra.3/by-name/UDA mmcblk0p10 ' \
  83.             -e 's block/platform/sdhci-tegra.3/by-name/MSC mmcblk0p6 ' \
  84.             -e 's block/platform/sdhci-tegra.3/by-name/LNX mmcblk0p2 ' \
  85.             -e 's block/platform/sdhci-tegra.3/by-name/SOS mmcblk0p1 ' \
  86.             "$@"
  87.         ;;
  88.  
  89.     "i9305" | "encore" | "n7000" | "n7100" | "i9300" | "anzu" | \
  90.     "coconut" | "haida" | "hallon" | "iyokan" | "mango" | "phoenix" | \
  91.     "satsuma" | "smultron" | "urushi" | "zeus" | "jenad")
  92.     # Untested for other revisions of Samsung GT-S6500:
  93.     # | "jena" | "trebon")
  94.     sed -i \
  95.         -e 's /block/ / ' \
  96.         "$@"
  97.     ;;
  98.  
  99.     "p3100" | "p3110" | "p3113" | "p5100" | "p5110" | "p5113" | "espressowifi" | "espresso3g")
  100.         sed -i \
  101.             -e 's block/platform/omap/omap_hsmmc.1/by-name/DATAFS mmcblk0p10 ' \
  102.             -e 's block/platform/omap/omap_hsmmc.1/by-name/KERNEL mmcblk0p5 ' \
  103.             -e 's block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS mmcblk0p9 ' \
  104.             -e 's block/platform/omap/omap_hsmmc.1/by-name/EFS mmcblk0p1 ' \
  105.             -e 's block/platform/omap/omap_hsmmc.1/by-name/CACHE mmcblk0p7 ' \
  106.             "$@"
  107.         ;;
  108.  
  109.     "maguro")
  110.         sed -i \
  111.             -e 's block/platform/omap/omap_hsmmc.0/by-name/system mmcblk0p10 ' \
  112.             -e 's block/platform/omap/omap_hsmmc.0/by-name/cache mmcblk0p11 ' \
  113.             -e 's block/platform/omap/omap_hsmmc.0/by-name/userdata mmcblk0p12 ' \
  114.             -e 's block/platform/omap/omap_hsmmc.0/by-name/misc mmcblk0p5 ' \
  115.             -e 's block/platform/omap/omap_hsmmc.0/by-name/boot mmcblk0p7 ' \
  116.             -e 's block/platform/omap/omap_hsmmc.0/by-name/recovery mmcblk0p8 ' \
  117.             -e 's block/platform/omap/omap_hsmmc.0/by-name/sbl mmcblk0p2 ' \
  118.             -e 's block/platform/omap/omap_hsmmc.0/by-name/xloader mmcblk0p1 ' \
  119.             -e 's block/platform/omap/omap_hsmmc.0/by-name/radio mmcblk0p9 ' \
  120.             -e 's block/platform/omap/omap_hsmmc.0/by-name/efs mmcblk0p3 ' \
  121.             "$@"
  122.         ;;
  123.  
  124.     "bacon")
  125.         sed -i \
  126.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
  127.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p15 ' \
  128.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p14 ' \
  129.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p28 ' \
  130.             "$@"
  131.         ;;
  132.     "ace")
  133.        sed -i \
  134.             -e 's block/platform/msm_sdcc.2/by-num/p25 mmcblk0p25 ' \
  135.             -e 's block/platform/msm_sdcc.2/by-num/p26 mmcblk0p26 ' \
  136.             -e 's block/platform/msm_sdcc.2/by-num/p27 mmcblk0p27 ' \
  137.             -e 's block/platform/msm_sdcc.2/by-num/p28 mmcblk0p28 ' \
  138.             "$@"
  139.         ;;
  140.     "flo"|"deb")
  141.         sed -i \
  142.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p4 ' \
  143.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p14 ' \
  144.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p22 ' \
  145.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p30 ' \
  146.             -e 's block/platform/msm_sdcc.1/by-name/radio mmcblk0p1 ' \
  147.             -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p4 ' \
  148.             -e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p25 ' \
  149.             -e 's block/platform/msm_sdcc.1/by-name/misc mmcblk0p24 ' \
  150.             "$@"
  151.         ;;
  152.     "yuga")
  153.         sed -i \
  154.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p17 ' \
  155.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p24 ' \
  156.             -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p25 ' \
  157.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p26 ' \
  158.             -e 's block/platform/msm_sdcc.1/by-name/LTALabel mmcblk1 ' \
  159.             "$@"
  160.         ;;
  161.     "z3c")
  162.     # Also called "aries" | "d5803" in aosp (called z3c in cm12.1)
  163.     # untested for | "sirius" | "amami" | "leo" | "tianchi")
  164.          sed -i \
  165.              -e 's block/platform/msm_sdcc.1/by-name/DDR mmcblk0p17 ' \
  166.              -e 's block/platform/msm_sdcc.1/by-name/FOTAKernel mmcblk0p16 ' \
  167.              -e 's block/platform/msm_sdcc.1/by-name/LTALabel mmcblk0p18 ' \
  168.              -e 's block/platform/msm_sdcc.1/by-name/TA mmcblk0p1 ' \
  169.              -e 's block/platform/msm_sdcc.1/by-name/aboot mmcblk0p5 ' \
  170.              -e 's block/platform/msm_sdcc.1/by-name/alt_aboot mmcblk0p11 ' \
  171.              -e 's block/platform/msm_sdcc.1/by-name/alt_dbi mmcblk0p10 ' \
  172.              -e 's block/platform/msm_sdcc.1/by-name/alt_rpm mmcblk0p12 ' \
  173.              -e 's block/platform/msm_sdcc.1/by-name/alt_s1sbl mmcblk0p9 ' \
  174.              -e 's block/platform/msm_sdcc.1/by-name/alt_sbl1 mmcblk0p8 ' \
  175.              -e 's block/platform/msm_sdcc.1/by-name/alt_tz mmcblk0p13 ' \
  176.              -e 's block/platform/msm_sdcc.1/by-name/apps_log mmcblk0p22 ' \
  177.              -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p14 ' \
  178.              -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p24 ' \
  179.              -e 's block/platform/msm_sdcc.1/by-name/dbi mmcblk0p4 ' \
  180.              -e 's block/platform/msm_sdcc.1/by-name/fsg mmcblk0p21 ' \
  181.              -e 's block/platform/msm_sdcc.1/by-name/modemst1 mmcblk0p19 ' \
  182.              -e 's block/platform/msm_sdcc.1/by-name/modemst2 mmcblk0p20 ' \
  183.              -e 's block/platform/msm_sdcc.1/by-name/ramdump mmcblk0p15 ' \
  184.              -e 's block/platform/msm_sdcc.1/by-name/rpm mmcblk0p6 ' \
  185.              -e 's block/platform/msm_sdcc.1/by-name/s1sbl mmcblk0p3 ' \
  186.              -e 's block/platform/msm_sdcc.1/by-name/sbl1 mmcblk0p2 ' \
  187.              -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p23 ' \
  188.              -e 's block/platform/msm_sdcc.1/by-name/tz mmcblk0p7 ' \
  189.              -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p25 ' \
  190.             "$@"
  191.          ;;
  192.     "kis3")
  193.        sed -i \
  194.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p12 ' \
  195.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p13 ' \
  196.             -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p15 ' \
  197.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p7 ' \
  198.             -e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p16 ' \
  199.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
  200.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p14 ' \
  201.             "$@"
  202.         ;;
  203.     "m7spr")
  204.        sed -i \
  205.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p35 ' \
  206.             -e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p36 ' \
  207.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p37 ' \
  208.             -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p38 ' \
  209.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p39 ' \
  210.             "$@"
  211.         ;;
  212.     "wt88047")
  213.        sed -i \
  214.             -e 's block/bootdevice/by-name/userdata mmcblk0p30 ' \
  215.             -e 's block/bootdevice/by-name/boot mmcblk0p22 ' \
  216.             -e 's block/bootdevice/by-name/system mmcblk0p23 ' \
  217.             -e 's block/bootdevice/by-name/modem mmcblk0p1 ' \
  218.             -e 's block/bootdevice/by-name/modemst1 mmcblk0p13 ' \
  219.             -e 's block/bootdevice/by-name/modemst2 mmcblk0p14 ' \
  220.             -e 's block/bootdevice/by-name/persist mmcblk0p25 ' \
  221.             "$@"
  222.         ;;
  223.     "find5")
  224.        sed -i \
  225.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p1 ' \
  226.             -e 's block/platform/msm_sdcc.1/by-name/persist tmmcblk0p21 ' \
  227.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p19 ' \
  228.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p18 ' \
  229.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p20 ' \
  230.             "$@"
  231.         ;;
  232.     "cancro")
  233.        sed -i \
  234.             -e 's block/platform/msm_sdcc.1/by-name/DDR mmcblk0p4 ' \
  235.             -e 's block/platform/msm_sdcc.1/by-name/aboot mmcblk0p7 ' \
  236.             -e 's block/platform/msm_sdcc.1/by-name/bk1 mmcblk0p8 ' \
  237.             -e 's block/platform/msm_sdcc.1/by-name/bk2 mmcblk0p11 ' \
  238.             -e 's block/platform/msm_sdcc.1/by-name/bk3 mmcblk0p15 ' \
  239.             -e 's block/platform/msm_sdcc.1/by-name/bk4 mmcblk0p17 ' \
  240.             -e 's block/platform/msm_sdcc.1/by-name/bk5 mmcblk0p18 ' \
  241.             -e 's block/platform/msm_sdcc.1/by-name/boot mmcblk0p19 ' \
  242.             -e 's block/platform/msm_sdcc.1/by-name/cache mmcblk0p24 ' \
  243.             -e 's block/platform/msm_sdcc.1/by-name/dbi mmcblk0p6 ' \
  244.             -e 's block/platform/msm_sdcc.1/by-name/fsc mmcblk0p14 ' \
  245.             -e 's block/platform/msm_sdcc.1/by-name/fsg mmcblk0p16 ' \
  246.             -e 's block/platform/msm_sdcc.1/by-name/logo mmcblk0p10 ' \
  247.             -e 's block/platform/msm_sdcc.1/by-name/misc mmcblk0p9 ' \
  248.             -e 's block/platform/msm_sdcc.1/by-name/modem mmcblk0p22 ' \
  249.             -e 's block/platform/msm_sdcc.1/by-name/modemst1 mmcblk0p12 ' \
  250.             -e 's block/platform/msm_sdcc.1/by-name/modemst2 mmcblk0p13 ' \
  251.             -e 's block/platform/msm_sdcc.1/by-name/persist mmcblk0p21 ' \
  252.             -e 's block/platform/msm_sdcc.1/by-name/recovery mmcblk0p20 ' \
  253.             -e 's block/platform/msm_sdcc.1/by-name/rpm mmcblk0p2 ' \
  254.             -e 's block/platform/msm_sdcc.1/by-name/sbl1 mmcblk0p1 ' \
  255.             -e 's block/platform/msm_sdcc.1/by-name/ssd mmcblk0p5 ' \
  256.             -e 's block/platform/msm_sdcc.1/by-name/system mmcblk0p23 ' \
  257.             -e 's block/platform/msm_sdcc.1/by-name/tz mmcblk0p3 ' \
  258.             -e 's block/platform/msm_sdcc.1/by-name/userdata mmcblk0p25 ' \
  259.             "$@"
  260.         ;;
  261.     "gts210ltexx"|"gts210wifi")
  262.        sed -i \
  263.             -e 's block/platform/15540000.dwmmc0/by-name/BOOT mmcblk0p9 ' \
  264.             -e 's block/platform/15540000.dwmmc0/by-name/CACHE mmcblk0p20 ' \
  265.             -e 's block/platform/15540000.dwmmc0/by-name/EFS mmcblk0p3 ' \
  266.             -e 's block/platform/15540000.dwmmc0/by-name/SYSTEM mmcblk0p19 ' \
  267.             -e 's block/platform/15540000.dwmmc0/by-name/USERDATA mmcblk0p22 ' \
  268.             "$@"
  269.         ;;
  270.     "maserati"|"cdma_maserati")
  271.        sed -i \
  272.             -e 's block/boot mmcblk1p14 ' \
  273.             -e 's block/cache loop-cache ' \
  274.             -e 's block/system loop-system ' \
  275.             -e 's block/userdata loop-userdata ' \
  276.             "$@"
  277.         ;;
  278.     *)
  279.     cat <<EOF
  280.  
  281. ****************************************************************
  282. ****************************************************************
  283. ERROR: $DEVICE does not have mountpoint fixup data - see
  284.        SailfishOS HADK for details on how to fix this
  285.        Check: device/$VENDOR/$DEVICE/recovery.fstab
  286. ****************************************************************
  287. ****************************************************************
  288.  
  289. EOF
  290.         exit 1
  291.         ;;
  292. esac
Advertisement
Add Comment
Please, Sign In to add comment