├── 10-odroid.rules ├── Makefile ├── amlogic.service ├── blacklist-spi.conf ├── boot.ini ├── boot.ini.default ├── bootini-persistence.pl ├── c2_init.sh ├── description-pak └── postinstall-pak /10-odroid.rules: -------------------------------------------------------------------------------- 1 | # Mali Rules 2 | KERNEL=="mali",SUBSYSTEM=="misc",MODE="0777" 3 | KERNEL=="ump",SUBSYSTEM=="ump",MODE="0777" 4 | 5 | # Misc video rules 6 | KERNEL=="event*", SUBSYSTEM=="input", MODE="0777" 7 | KERNEL=="CEC", MODE="0777" 8 | KERNEL=="am*", MODE="0666" 9 | 10 | # Automatic Disk Scheduler 11 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0",ATTR{queue/scheduler}="noop" 12 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1",ATTR{queue/scheduler}="deadline" 13 | ACTION=="add|change", KERNEL=="mmcblk[0-9]", ATTR{queue/rotational}=="0",ATTR{queue/scheduler}="noop" 14 | 15 | # GPIO Mem 16 | SUBSYSTEM=="meson-gpiomem", GROUP="sys", MODE="0660" 17 | 18 | # CEC Compat 19 | KERNEL=="cec", SYMLINK+="aocec" 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | mkdir -p /usr/share/bootini 3 | install boot.ini /usr/share/bootini 4 | install boot.ini.default /usr/share/bootini 5 | install bootini-persistence.pl /usr/share/bootini 6 | rm -fr /usr/bin/bootini 7 | ln -s /usr/share/bootini/bootini-persistence.pl /usr/bin/bootini 8 | install c2_init.sh /etc/initramfs-tools/scripts/local-top 9 | install 10-odroid.rules /etc/udev/rules.d 10 | install blacklist-spi.conf /etc/modprobe.d 11 | -------------------------------------------------------------------------------- /amlogic.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="ODROID-C2 Amlogic Display Configuration" 3 | 4 | DefaultDependencies=no 5 | Requires=sysinit.target 6 | After=sysinit.target 7 | 8 | [Service] 9 | Type=oneshot 10 | ExecStart=/usr/bin/c2_init.sh 11 | 12 | [Install] 13 | WantedBy=basic.target 14 | WantedBy=sysinit.target 15 | -------------------------------------------------------------------------------- /blacklist-spi.conf: -------------------------------------------------------------------------------- 1 | blacklist spidev 2 | blacklist spi_gpio 3 | blacklist spi_bitbang 4 | -------------------------------------------------------------------------------- /boot.ini: -------------------------------------------------------------------------------- 1 | ODROIDC2-UBOOT-CONFIG 2 | 3 | ######################################################################## 4 | # Changes made to this are overwritten every time there's a new upgrade 5 | # To make your changes permanent change it on 6 | # boot.ini.default 7 | # After changing it on boot.ini.default run the bootini command to 8 | # rewrite this file with your personal permanent settings. 9 | # Documentation: http://odroid.com/dokuwiki/doku.php?id=en:c2_persistent_bootini 10 | ######################################################################## 11 | 12 | # Possible screen resolutions 13 | # Uncomment only a single Line! The line with setenv written. 14 | # At least one mode must be selected. 15 | 16 | # Custom modeline! 17 | # To use custom modeline you need to disable all the below resolutions 18 | # and setup your own! 19 | # For more information check our wiki: 20 | # http://odroid.com/dokuwiki/doku.php?id=en:c2_hdmi_autosetting 21 | # Example below: 22 | # setenv m "custombuilt" 23 | # setenv modeline "1920,1200,154000,74040,60,1920,1968,2000,2080,1200,1202,1208,1235,1,0,1" 24 | 25 | # Auto Detection of Monitor settings based on your Screen information 26 | # See: http://odroid.com/dokuwiki/doku.php?id=en:c2_auto_detect_display 27 | setenv display_autodetect "true" 28 | 29 | # 480 Lines (720x480) 30 | # setenv m "480i60hz" # Interlaced 60Hz 31 | # setenv m "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz 32 | # setenv m "480p60hz" # 480 Progressive 60Hz 33 | # setenv m "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz 34 | 35 | # 576 Lines (720x576) 36 | # setenv m "576i50hz" # Interlaced 50Hz 37 | # setenv m "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz 38 | # setenv m "576p50hz" # Progressive 50Hz 39 | # setenv m "576p_rpt" # Progressive for Rear Projection Televisions 50Hz 40 | 41 | # 720 Lines (1280x720) 42 | # setenv m "720p50hz" # 50Hz 43 | # setenv m "720p60hz" # 60Hz 44 | 45 | # 1080 Lines (1920x1080) 46 | # setenv m "1080i60hz" # Interlaced 60Hz 47 | setenv m "1080p60hz" # Progressive 60Hz 48 | # setenv m "1080i50hz" # Interlaced 50Hz 49 | # setenv m "1080p50hz" # Progressive 50Hz 50 | # setenv m "1080p24hz" # Progressive 24Hz 51 | 52 | # 4K (3840x2160) 53 | # setenv m "2160p30hz" # Progressive 30Hz 54 | # setenv m "2160p25hz" # Progressive 25Hz 55 | # setenv m "2160p24hz" # Progressive 24Hz 56 | # setenv m "smpte24hz" # Progressive 24Hz SMPTE 57 | # setenv m "2160p50hz" # Progressive 50Hz 58 | # setenv m "2160p60hz" # Progressive 60Hz 59 | # setenv m "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) 60 | # setenv m "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) 61 | 62 | ### VESA modes ### 63 | # setenv m "640x480p60hz" 64 | # setenv m "800x480p60hz" 65 | # setenv m "480x320p60hz" 66 | # setenv m "480x800p60hz" 67 | # setenv m "800x600p60hz" 68 | # setenv m "1024x600p60hz" 69 | # setenv m "1024x768p60hz" 70 | # setenv m "1280x800p60hz" 71 | # setenv m "1280x1024p60hz" 72 | # setenv m "1360x768p60hz" 73 | # setenv m "1440x900p60hz" 74 | # setenv m "1600x900p60hz" 75 | # setenv m "1680x1050p60hz" 76 | # setenv m "1600x1200p60hz" 77 | # setenv m "1920x1200p60hz" 78 | # setenv m "2560x1080p60hz" 79 | # setenv m "2560x1440p60hz" 80 | # setenv m "2560x1600p60hz" 81 | # setenv m "3440x1440p60hz" 82 | 83 | # HDMI BPP Mode 84 | setenv m_bpp "32" 85 | # setenv m_bpp "24" 86 | # setenv m_bpp "16" 87 | 88 | # HDMI DVI/VGA modes 89 | # By default its set to HDMI, if needed change below. 90 | # Uncomment only a single Line. 91 | # setenv vout "dvi" 92 | # setenv vout "vga" 93 | 94 | # HDMI HotPlug Detection control 95 | # Allows you to force HDMI thinking that the cable is connected. 96 | # true = HDMI will believe that cable is always connected 97 | # false = will let board/monitor negotiate the connection status 98 | setenv hpd "true" 99 | # setenv hpd "false" 100 | 101 | # Monitor output 102 | # Controls if HDMI PHY should output anything to the monitor 103 | setenv monitor_onoff "false" # true or false 104 | 105 | # Server Mode (aka. No Graphics) 106 | # Setting nographics to 1 will disable all video subsystem 107 | # This mode is ideal of server type usage. (Saves ~300Mb of RAM) 108 | setenv nographics "0" 109 | 110 | # Meson Timer 111 | # 1 - Meson Timer 112 | # 0 - Arch Timer 113 | # Using meson_timer improves the video playback however it breaks KVM (virtualization). 114 | # Using arch timer allows KVM/Virtualization to work however you'll experience poor video 115 | setenv mesontimer "1" 116 | 117 | # UHS (Ultra High Speed) MicroSD mode enable/disable 118 | setenv disableuhs "false" 119 | 120 | # MicroSD Card Detection enable/disable 121 | # Force the MMC controlled to believe that a card is connected. 122 | setenv mmc_removable "true" 123 | 124 | # USB Multi WebCam tweak 125 | # Only enable this if you use it. 126 | setenv usbmulticam "false" 127 | 128 | # Disable/Enable ODROID-VU7 Touchscreen 129 | setenv disable_vu7 "false" 130 | 131 | # Default Console Device Setting 132 | setenv condev "console=ttyS0,115200n8 console=tty0" # on both 133 | 134 | # CPU Frequency / Cores control 135 | ########################################### 136 | ### WARNING!!! WARNING!!! WARNING!!! 137 | # Before changing anything here please read the wiki entry: 138 | # http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq 139 | # 140 | # MAX CPU's 141 | # setenv maxcpus "1" 142 | # setenv maxcpus "2" 143 | # setenv maxcpus "3" 144 | setenv maxcpus "4" 145 | 146 | # MAX Frequency 147 | # setenv max_freq "2016" # 2.016GHz 148 | # setenv max_freq "1944" # 1.944GHz 149 | # setenv max_freq "1944" # 1.944GHz 150 | # setenv max_freq "1920" # 1.920GHz 151 | # setenv max_freq "1896" # 1.896GHz 152 | # setenv max_freq "1752" # 1.752GHz 153 | # setenv max_freq "1680" # 1.680GHz 154 | # setenv max_freq "1656" # 1.656GHz 155 | setenv max_freq "1536" # 1.536GHz 156 | 157 | 158 | 159 | ########################################### 160 | 161 | # Boot Arguments 162 | if test "${display_autodetect}" = "true"; then usb pwren; hdmitx edid; fi 163 | if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi 164 | if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi 165 | 166 | setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro ${condev} no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam} ${hid_quirks}" 167 | 168 | # Booting 169 | 170 | setenv loadaddr "0x11000000" 171 | setenv dtb_loadaddr "0x1000000" 172 | setenv initrd_loadaddr "0x13000000" 173 | 174 | fatload mmc 0:1 ${initrd_loadaddr} uInitrd 175 | fatload mmc 0:1 ${loadaddr} Image 176 | fatload mmc 0:1 ${dtb_loadaddr} meson64_odroidc2.dtb 177 | fdt addr ${dtb_loadaddr} 178 | 179 | if test "${mesontimer}" = "0"; then fdt rm /meson_timer; fdt rm /cpus/cpu@0/timer; fdt rm /cpus/cpu@1/timer; fdt rm /cpus/cpu@2/timer; fdt rm /cpus/cpu@3/timer; fi 180 | if test "${mesontimer}" = "1"; then fdt rm /timer; fi 181 | 182 | if test "${nographics}" = "1"; then fdt rm /reserved-memory; fdt rm /aocec; fi 183 | if test "${nographics}" = "1"; then fdt rm /meson-fb; fdt rm /amhdmitx; fdt rm /picdec; fdt rm /ppmgr; fi 184 | if test "${nographics}" = "1"; then fdt rm /meson-vout; fdt rm /mesonstream; fdt rm /meson-fb; fi 185 | if test "${nographics}" = "1"; then fdt rm /deinterlace; fdt rm /codec_mm; fi 186 | 187 | booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr} 188 | -------------------------------------------------------------------------------- /boot.ini.default: -------------------------------------------------------------------------------- 1 | [general] 2 | #This configuration is parsed by the bootini-persistence script 3 | #uncomment the section you want to override in boot.ini and set the desired value 4 | 5 | #################### 6 | # C2 configuration # 7 | #################### 8 | 9 | #C2 resolution 10 | #m=1080p60hz 11 | 12 | #C2 BPP Mode 13 | #m_bpp=32 14 | 15 | #C2 HDMI/DVI/VGA mode 16 | #vout=dvi 17 | 18 | #C2 HDMI HotPlug Detection control 19 | #hpd=true 20 | 21 | #C2 Console 22 | #condev=console=ttyS0,115200n8 console=tty0 23 | 24 | #C2 Meson timer 25 | #mesontimer=1 26 | 27 | #C2 nographics 28 | #nographics=0 29 | 30 | #C2 monitor output 31 | #monitor_onoff=false 32 | 33 | #C2 maxcpus 34 | #maxcpus=4 35 | 36 | #C2 Max frequency 37 | #max_freq=1536 38 | 39 | #C2 bootargs 40 | #bootargs=root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro ${condev} no_console_suspend hdmimode=${m} ${comde} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} 41 | 42 | #disableuhs 43 | #disableuhs=false 44 | 45 | #mmc_removable 46 | #mmc_removable=true 47 | -------------------------------------------------------------------------------- /bootini-persistence.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use strict; 3 | use warnings; 4 | use File::Copy; 5 | use Data::Dumper; 6 | 7 | #contributed by mad_ady 8 | 9 | #configuration 10 | my $mediaboot = '/media/boot'; 11 | my $bootini = 'boot.ini'; 12 | my $config = 'boot.ini.default'; 13 | 14 | logger( "info", "Applying user preferences for boot.ini" ); 15 | 16 | #read the config file with the user's settings and apply them one by one 17 | 18 | my %ini; 19 | if ( -f "$mediaboot/$config" ) { 20 | open CONFIG, "$mediaboot/$config" or die "Unable to read $mediaboot/$config. $!"; 21 | while () { 22 | my $line = $_; 23 | if ( $line =~ /^\s*([^=]+)=(.*)/ ) { 24 | my $setting = $1; 25 | my $value = $2; 26 | 27 | #ignore commented out settings 28 | next if ( $setting =~ /#/ ); 29 | 30 | #trim whitespaces from settings and value 31 | $setting =~ s/^\s+|\s+$//g; 32 | $value =~ s/^\s+|\s+$//g; 33 | 34 | #save the config 35 | $ini{$setting} = $value; 36 | } 37 | } 38 | } 39 | else { 40 | logger( "error", "Missing persistent configuration file - $mediaboot/$config. Will not touch $bootini" ); 41 | exit; 42 | } 43 | #print Dumper( \%ini ); 44 | 45 | #load boot.ini into an array and perform changes on it in memory 46 | my @boot; 47 | my @newboot; 48 | my $changed = 0; 49 | open BOOT, "$mediaboot/$bootini" or die $!; 50 | @boot = ; 51 | close BOOT; 52 | logger( "debug", "$bootini has " . ( scalar @boot ) . " lines" ); 53 | 54 | #do a preliminary lookup inside boot.ini to find which variables we need to set, but are commented out 55 | my %current; 56 | foreach my $line (@boot) { 57 | foreach my $section ( sort keys %ini ) { 58 | if ( $line =~ /^\s*setenv\s*$section\s*\"([^\"]+)\".*/ ) { 59 | 60 | #this setting is set, we can edit this line 61 | $current{$section}{'isSet'} = 1; 62 | } 63 | if ( $line =~ /^\s*\#\s*setenv\s*$section\s*\"([^\"]+)\".*/ ) { 64 | 65 | #this setting is not set 66 | $current{$section}{'isNotSet'} = 1; 67 | } 68 | } 69 | } 70 | 71 | #iterate through all the lines in boot.ini and see if the current line matches 72 | #save all changes to a new array, because we append lines 73 | 74 | for ( my $i = 0 ; $i < scalar(@boot) ; $i++ ) { 75 | my $found = 0; 76 | 77 | #look for any of the settings left to set 78 | foreach my $section ( sort keys %ini ) { 79 | 80 | #try to match the setting as if it was set 81 | if ( defined $current{$section}{'isSet'} ) { 82 | if ( $boot[$i] =~ /^\s*setenv\s*$section\s*\"([^\"]+)\".*/ ) { 83 | my $old = $1; 84 | my $extra = $2; 85 | 86 | #check if the value is the same as the default 87 | if ( $ini{$section} eq $old ) { 88 | logger( "info", "$section is already set to $old. No change necessary" ); 89 | 90 | #forget about this setting 91 | delete( $ini{$section} ); 92 | $found = 1; 93 | push @newboot, $boot[$i]; 94 | } 95 | else { 96 | logger( "info", "Setting $section from $old to $ini{$section}" ); 97 | $found = 1; 98 | 99 | #setting a variable means: 100 | #1. comment out the current line 101 | push @newboot, "#" . $boot[$i]; 102 | 103 | #2. insert a new line with the new value 104 | push @newboot, "setenv $section \"$ini{$section}\""; 105 | 106 | #forget about this setting 107 | delete( $ini{$section} ); 108 | } 109 | } 110 | } 111 | else { 112 | #it's not set by default 113 | 114 | if ( $boot[$i] =~ /^\s*\#+\s*setenv\s*$section\s*\"([^\"]+)\".*/ ) { 115 | my $old = $1; 116 | my $extra = $2; 117 | 118 | #since it was commented out, we will output an uncommented line. No need to check the old value 119 | logger( "info", "$section enabled and set to $ini{$section}" ); 120 | $found = 1; 121 | 122 | #1. push the current line (commented already) 123 | push @newboot, $boot[$i]; 124 | 125 | #2. push the new config option 126 | push @newboot, "setenv $section \"$ini{$section}\""; 127 | 128 | #forget about this setting 129 | delete( $ini{$section} ); 130 | } 131 | } 132 | } 133 | if ( !$found ) { 134 | 135 | #the line doesn't match any config option. Let it through 136 | push @newboot, $boot[$i]; 137 | } 138 | } 139 | 140 | #sanity check 141 | if ( scalar(@newboot) > 5 ) { 142 | 143 | #write the new boot.ini back to disk 144 | open BOOT, ">$mediaboot/$bootini" or die $!; 145 | foreach my $line (@newboot) { 146 | $line =~ s/\r|\n//g; #trim newlines 147 | print BOOT "$line\n"; 148 | } 149 | close BOOT; 150 | logger( "info", "Writing $bootini finished. Written " . ( scalar(@newboot) ) . " lines" ); 151 | } 152 | else { 153 | logger( "fatal", "$bootini is incomplete. Not writing to disk" ); 154 | } 155 | 156 | sub logger { 157 | my $severity = shift; 158 | my $message = shift; 159 | 160 | print `logger -s -t $0 -p "$severity" '$message'`; 161 | } 162 | 163 | -------------------------------------------------------------------------------- /c2_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for x in $(cat /proc/cmdline); do 4 | case ${x} in 5 | m_bpp=*) export bpp=${x#*=} ;; 6 | hdmimode=*) export mode=${x#*=} ;; 7 | modeline=*) export modeline=${x#*=} ;; 8 | esac 9 | done 10 | 11 | HPD_STATE=/sys/class/amhdmitx/amhdmitx0/hpd_state 12 | DISP_CAP=/sys/class/amhdmitx/amhdmitx0/disp_cap 13 | DISP_MODE=/sys/class/display/mode 14 | 15 | # if setenv nographics "1" in boot.ini then this needs to fail 16 | if [ ! -f $DISP_MODE ]; then 17 | exit 0 18 | fi 19 | 20 | echo $mode > $DISP_MODE 21 | 22 | common_display_setup() { 23 | M="0 0 $(($X - 1)) $(($Y - 1))" 24 | Y_VIRT=$(($Y * 2)) 25 | fbset -fb /dev/fb0 -g $X $Y $X $Y_VIRT $bpp 26 | echo $mode > /sys/class/display/mode 27 | echo 0 > /sys/class/graphics/fb0/free_scale 28 | echo 1 > /sys/class/graphics/fb0/freescale_mode 29 | echo $M > /sys/class/graphics/fb0/free_scale_axis 30 | echo $M > /sys/class/graphics/fb0/window_axis 31 | 32 | echo 0 > /sys/class/graphics/fb1/free_scale 33 | echo 1 > /sys/class/graphics/fb1/freescale_mode 34 | } 35 | 36 | case $mode in 37 | custombuilt*) 38 | export X=`echo $modeline | cut -f1 -d","` 39 | export Y=`echo $modeline | cut -f2 -d","` 40 | ;; 41 | 480x320*) 42 | export X=480 43 | export Y=320 44 | ;; 45 | 480x800*) 46 | export X=480 47 | export Y=800 48 | ;; 49 | 480i*|480p*) 50 | export X=720 51 | export Y=480 52 | ;; 53 | 576*) 54 | export X=720 55 | export Y=576 56 | ;; 57 | 720p*) 58 | export X=1280 59 | export Y=720 60 | ;; 61 | 1080*) 62 | export X=1920 63 | export Y=1080 64 | ;; 65 | 2160p*) 66 | export X=3840 67 | export Y=2160 68 | ;; 69 | smpte24hz*) 70 | export X=3840 71 | export Y=2160 72 | ;; 73 | 640x480p60hz*) 74 | export X=640 75 | export Y=480 76 | ;; 77 | 800x480p60hz*) 78 | export X=800 79 | export Y=480 80 | ;; 81 | 800x600p60hz*) 82 | export X=800 83 | export Y=600 84 | ;; 85 | 1024x600p60hz*) 86 | export X=1024 87 | export Y=600 88 | ;; 89 | 1024x768p60hz*) 90 | export X=1024 91 | export Y=768 92 | ;; 93 | 1280x800p60hz*) 94 | export X=1280 95 | export Y=800 96 | ;; 97 | 1280x1024p60hz*) 98 | export X=1280 99 | export Y=1024 100 | ;; 101 | 1360x768p60hz*) 102 | export X=1360 103 | export Y=768 104 | ;; 105 | 1440x900p60hz*) 106 | export X=1440 107 | export Y=900 108 | ;; 109 | 1600x900p60hz*) 110 | export X=1600 111 | export Y=900 112 | ;; 113 | 1680x1050p60hz*) 114 | export X=1680 115 | export Y=1050 116 | ;; 117 | 1600x1200p60hz*) 118 | export X=1600 119 | export Y=1200 120 | ;; 121 | 1920x1200p60hz*) 122 | export X=1920 123 | export Y=1200 124 | ;; 125 | 2560x1080p60hz*) 126 | export X=2560 127 | export Y=1080 128 | ;; 129 | 2560x1440p60hz*) 130 | export X=2560 131 | export Y=1440 132 | ;; 133 | 2560x1600p60hz*) 134 | export X=2560 135 | export Y=1600 136 | ;; 137 | 3440x1440p60hz*) 138 | export X=3440 139 | export Y=1440 140 | ;; 141 | esac 142 | 143 | common_display_setup 144 | 145 | # Console unblack 146 | case $mode in 147 | *cvbs*|480i*|576i*|1080i*) 148 | echo 0 > /sys/class/graphics/fb0/blank 149 | echo 1 > /sys/class/graphics/fb1/blank 150 | ;; 151 | *) 152 | echo 0 > /sys/class/graphics/fb0/blank 153 | echo 0 > /sys/class/graphics/fb1/blank 154 | ;; 155 | esac 156 | -------------------------------------------------------------------------------- /description-pak: -------------------------------------------------------------------------------- 1 | boot.ini and display.sh for ODROID-C2 2 | 3 | 4 | Provides boot.ini with resolution setup and other bootloader configurations 5 | as well the display.sh file needed to address the onboot resolution. 6 | -------------------------------------------------------------------------------- /postinstall-pak: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run OS File updates 4 | 5 | cp /media/boot/boot.ini /media/boot/boot.ini.old 6 | cp /usr/share/bootini/boot.ini /media/boot/boot.ini 7 | 8 | #copy the default settings file if it doesn't exist 9 | if [ ! -f "/media/boot/boot.ini.default" ]; then 10 | cp /usr/share/bootini/boot.ini.default /media/boot/boot.ini.default 11 | fi 12 | 13 | #copy over user's custom settings (if any) from boot.ini.default 14 | /usr/share/bootini/bootini-persistence.pl 2>&1 | tee /tmp/bootini-persistence.txt 15 | 16 | /usr/sbin/update-initramfs -c -k `uname -r` 17 | mkimage -A arm64 -O linux -T ramdisk -C none -a 0 -e 0 -n "uInitrd" -d /boot/initrd.img-`uname -r` /boot/uInitrd-`uname -r` 18 | cp /boot/uInitrd-`uname -r` /media/boot/uInitrd 19 | 20 | echo "A new boot.ini is installed." 21 | echo "Any changes to boot.ini is lost, such as display configuration" 22 | echo "Persistent custom settings from /media/boot/boot.ini.default have been restored" 23 | echo "For reference your old boot.ini is saved to /media/boot/boot.ini.old" 24 | 25 | dialog --msgbox "A new boot.ini is installed. 26 | Any changes to boot.ini is lost, such as display configuration 27 | Persistent custom settings from /media/boot/boot.ini.default have been restored 28 | For reference your old boot.ini is saved to /media/boot/boot.ini.old" 0 0 29 | 30 | usermod -a -G sys odroid || true 31 | --------------------------------------------------------------------------------