'분류 전체보기'에 해당되는 글 55건

  1. 2024.08.13 gcc linking error due to library option location
  2. 2024.02.11 Windows 10: 보안 업데이트 설치시 0x80070643 오류 발생 - recovery location is null 2
  3. 2023.11.16 NXP i.mx.8 v4.14.98-2.3.3 에서 debug symbol 추가할 때, linux-imx compile error
  4. 2022.07.18 i.mx yocto project using kernel v4.14.98
  5. 2022.07.18 Logitech G102 LED off
  6. 2022.07.05 Tera Term 을 사용하면서, log 화일 이름 설정
  7. 2022.02.15 i.mx8 yocto linux 에서 MAC 주소를 설정하는 방법 1 (uboot)
  8. 2021.12.04 SecureCRT를 사용한 ubuntu 20.04 ssh 접속 오류 (key exchange) 2
  9. 2021.05.28 Notepad++ 도 black theme를...
  10. 2021.05.24 UltraEdit v16.30 에서 Color Scheme 변경
2024. 8. 13. 17:21

gcc linking error due to library option location

gcc 로 compile 하는데, library option을 앞에 주면 오류가 나고, 뒤에 주면 오류가 나지 않는다?

$ gcc -lm -o test test.c nml.c nml_util.c    
/tmp/cc4KiP0A.o: In function `nml_mat_col_l2norm':
nml.c:(.text+0x3165): undefined reference to `sqrt'
/tmp/cc4KiP0A.o: In function `nml_mat_l2norm':
nml.c:(.text+0x3257): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status

$ gcc -o test test.c nml.c nml_util.c -lm

어떤 문법의 오류가 있는지, gcc v7 에서의 오류인지, 찾아볼 시간이 없어서,,, 기록만 남긴다.

linking 할 때 사용하는 것이라서, 뒤에 었이야 하나?

2024. 2. 11. 13:31

Windows 10: 보안 업데이트 설치시 0x80070643 오류 발생 - recovery location is null

Windows update 도중에 오류가 발생하고 복구가 되지 않았다.

https://sihloh4me.tistory.com/540

그래서, 여러가지 해 보았지만, 해결되지 않았다.

그런데, 마지막에 recovery partition 관련 작업을 할 때, enable 이 되지 않는 문제가 있다.

자세히 보니,

 
C:\>reagentc /disable
REAGENTC.EXE: Windows RE is already disabled.
 
C:\>reagentc /info
Windows Recovery Environment (Windows RE) and system reset configuration
Information:
 
Windows RE status: Disabled
Windows RE location:
Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
Recovery image location:
Recovery image index: 0
Custom image location:
Custom image index: 0
 
REAGENTC.EXE: Operation Successful.
 
 
C:\>reagentc /enable
REAGENTC.EXE: The Windows RE image was not found.
 

 Windows RE location 필드에 아무것도 없었다.

이 부분을 설정하기 위해서는, winre.wim 파일을 R:\Recovery\WindowsRE\ 폴더에 넣은 상태로

Reagentc.exe /SetReImage [옵션] 명령을 해야 한다.

이 과정을 설명하면,

 1.     설치 ISO 에서 winre.wim 파일을 추출한다.

1.1. ISO 파일에서 install.wim 꺼내기

나의 경우에는 install.wim 이 아니고, sources\install.esd 파일로 존재함

(이유는 여러 배포반이 함께 있었기 때문인 듯 하며, 이 중에서 index 3 의 파일 (Windows 10 pro 버전)을 사용함)

 
D:\sources>dism /get-wiminfo /wimfile:d:install.esd
 
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
 
Details for image : d:install.esd
 
Index : 1
Name : Windows 10 Home
Description : Windows 10 Home
Size : 14,729,357,679 bytes
 
Index : 2
Name : Windows 10 Education
Description : Windows 10 Education
Size : 14,980,305,482 bytes
 
Index : 3
Name : Windows 10 Pro
Description : Windows 10 Pro
Size : 14,977,567,093 bytes
 
The operation completed successfully.
 
D:\sources>dism /export-image /sourceimagefile:d:install.esd /sourceindex:3 /destinationimagefile:f:\tmp\win\install.wim /compress:fast /checkintegrity
 
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
 
Exporting image
[==========================100.0%==========================]
The operation completed successfully.
 
D:\sources>dism /get-wiminfo /wimfile:f:\tmp\win\install.wim
 
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
 
Details for image : f:\tmp\win\install.wim
 
Index : 1
Name : Windows 10 Pro
Description : Windows 10 Pro
Size : 14,977,567,093 bytes
 
The operation completed successfully.
 

1.2. “install.wim” 파일 mount

 
D:\sources>dism /mount-image /imagefile:f:\tmp\win\install.wim /mountdir:f:\mnt /index:1 /optimize /checkintegrity
 
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
 
Mounting image
[==========================100.0%==========================]
The operation completed successfully.
 
D:\sources>dir f:\mnt
Volume in drive F is -------
 Volume Serial Number is XXXX-XXXX
 
 Directory of f:\mnt
 
2019-12-08  00:06    <DIR>          .
2019-12-07  18:14    <DIR>          PerfLogs
2019-12-08  00:00    <DIR>          Program Files
2021-04-09  22:58    <DIR>          Program Files (x86)
2019-12-07  18:31    <DIR>          Users
2021-04-09  22:58    <DIR>          Windows
               0 File(s)              0 bytes
               6 Dir(s)  1,040,429,035,520 bytes free
 

1.3. “winre.wim” 파일 복사 (임시폴더에)

C:\> mkdir c:\tmp
C:\> copy f:\mnt\windows\system32\recovery\winre.wim c:\tmp
 

1.4. “install.wim” 파일 unmount (옵션은 /discard 혹은 /commit 아무거나)

 
D:\sources>dism /unmount-image /mountdir:"f:\mnt" /discard
 
Deployment Image Servicing and Management tool
Version: 10.0.19041.1
 
Unmounting image
[==========================100.0%==========================]
The operation completed successfully.
 
D:\sources>
 

참고: https://sprout13.tistory.com/54

2.     “winre.wim” 파일을 Recovery partition에 복사한다.

 
C:\> reagentc.exe /Disable /target C:\windows
C:\> md R:\Recovery\WindowsRE
C:\> attrib -h -r -s R:\*.* /s /d
C:\> attrib -h -r -s R:\Recovery\WindowsRE\*.* /s /d
C:\> copy c:\tmp\winre.wim R:\Recovery\WindowsRE\
 

3.     “/SetReImage” 를 한다.

 
C:\> reagentc.exe /SetReImage /path R:\Recovery\WindowsRE /Target C:\Windows
 
C:\> reagentc.exe /enable
C:\> reagentc.exe /enable /target C:\windows
C:\> reagentc.exe /info /target C:\windows
 

이제 Windows RE location 필드가 설정되어 있다.

reboot 한 후, windows update를 하니 정상적으로 완료되었다.

그럼.

2023. 11. 16. 21:01

NXP i.mx.8 v4.14.98-2.3.3 에서 debug symbol 추가할 때, linux-imx compile error

https://developer.ridgerun.com/wiki/index.php/Preparing_Yocto_Development_Environment_for_Debugging

 

Preparing Yocto Development Environment for Debugging

From RidgeRun Developer Wiki Description Setting up an environment with the appropriate tools can help developers in the process of debugging and overall analyzing a system's behavior. Yocto supports several debugging capabilities which are aimed to produc

developer.ridgerun.com

https://stackoverflow.com/questions/62941898/yocto-generate-debug-symbol-of-all-the-included-packages

 

Yocto - generate debug symbol of all the included packages

I am trying to build debug symbols to be used with gdb when needed. To build debug symbols, added below in the target image target-image.inc file. IMAGE_GEN_DEBUGFS = "1" ...

stackoverflow.com

를 참고하여, image에 debug symbol을 추가할 때,

|   CC      drivers/acpi/ec.o
| In file included from /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/include/linux/kernel.h:15:0,
|                  from /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/drivers/acpi/ec.c:32:
| /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/drivers/acpi/ec.c:1998:38: error: passing argument 1 of '__check_old_set_param' from incompatible pointer type [-Werror=incompatible-pointer-types]
|  module_param_call(ec_event_clearing, param_set_event_clearing, param_get_event_clearing,
|                                       ^
| /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/include/linux/build_bug.h:30:56: note: in definition of macro 'BUILD_BUG_ON_ZERO'
|  #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
|                                                         ^
| /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/include/linux/moduleparam.h:228:6: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
|       VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
|       ^~~~~~~~~~~~~~~~~~~~~~~~
| /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/include/linux/moduleparam.h:234:2: note: in expansion of macro '__module_param_call'
|   __module_param_call(MODULE_PARAM_PREFIX,   \
|   ^~~~~~~~~~~~~~~~~~~
| /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/drivers/acpi/ec.c:1998:1: note: in expansion of macro 'module_param_call'
|  module_param_call(ec_event_clearing, param_set_event_clearing, param_get_event_clearing,
|  ^~~~~~~~~~~~~~~~~
| In file included from /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/include/linux/module.h:18:0,
|                  from /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/drivers/acpi/ec.c:33:
| /data/nxp/i.mx.8/4.14.98-2.3.3/ap.4/tmp/work-shared/imx8mmevk/kernel-source/include/linux/moduleparam.h:240:1: note: expected 'int (*)(const char *, struct kernel_param *)' but argument is of type 'int (*)(const char *, const struct kernel_param *)'
|  __check_old_set_param(int (*oldset)(const char *, struct kernel_param *))
|  ^~~~~~~~~~~~~~~~~~~~~
...

이렇게 오류가 발생하였다. 찾아 보니,,

linux-imx 컴파일 도중에 발생한 것으로, linux kernel 의 include/linux/moduleparam.h 화일에서 line 236 에 문제가 있다. 다음과 같이 [ perm, ] 으로 변경하면 문제가 해결된다.

오류 메시지를 정확하게 바라보고 이해했더라면, 쉽게 찾았을 수 있었을 텐데, 계속 구글에 물어 보고, 다른 것만 찾다가 2일의 시간을 낭비했다.

설명이 두서없지만, 혹시나 도움이 되기를 바라며,

 

2022. 7. 18. 16:11

i.mx yocto project using kernel v4.14.98

yocto project를 사용하여 rootfs 을 만들고 있다.

사정상 kernel version을 낮추어야 하여, 새로 repository를 만들려고 시도하는데,

$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-sumo -m imx-4.14.98-2.3.3.xml

(v4.14.98-2.3.3 이 최신)

이렇게 오류가 발생한다.

해결책은,

$ git config --global url."https://".insteadOf git://
$ repo sync
Fetching: 100% (9/9), done in 31.414s
Garbage collecting: 100% (9/9), done in 0.029s
Checking out: 100% (9/9), done in 0.882s
repo sync has finished successfully.

이것이었습니다. 잊지 않기 위해 기록합니다.

https://stackoverflow.com/questions/15669091/bower-install-using-only-https

 

2022. 7. 18. 09:40

Logitech G102 LED off

마우스 모양이나, 그립감 등이 좋아서, 사용하고 있는데, LED가 default 로 켜져 있는 것이 몹시 거슬려서,

그 동안 g-hub를 설치해서 사용했는데...

간단하게,  Onboard Memory Manager 를 사용하여 변경할 수 있다.

https://support.logi.com/hc/ko/articles/360059641133

 

Onboard Memory Manager

Onboard Memory Manager More

support.logi.com

사용한지 1년이나 되었는데... 이제서야...

 

2022. 7. 5. 09:43

Tera Term 을 사용하면서, log 화일 이름 설정

Tera Term 은 open source terminal tool로 꽤나 쓸만하다.

여러 포트를 사용하여 시험하다 보니, logging 을 하는데, 포트에 따른 log file을 자동으로 설정할 수 있다.

Setup --> Additional Setings...

창에서 "default log file name(strftime format)" 이름을

&h&p %Y-%m-%d %H_%M_%S.log

이렇게 설정하면 된다.

아래의 Auto start logging을 [v] 하면, port 가 열릴 떄 자동으로 생성된다.

설정하고 나니 편하구만.

2022. 2. 15. 11:49

i.mx8 yocto linux 에서 MAC 주소를 설정하는 방법 1 (uboot)

워낙 간단한 것이라서 설명할 것도 없겠지만, h/w적으로 MAC rom 이 없거나, u-boot에서 MAC을 설정해 놓지 않으면,

보통 kernel에서 random 하게 MAC 주소를 만들어서 ethernet device를 구동하게 된다.

이렇게 되면, DHCP를 할 때, 매번 IP 주소가 변경되어, 여간 불편한 것이 아니다.

 

이를 피하려면, u-boot 에 MAC 주소를 설정하면 된다. 설정 방법은,

u-boot> setenv ethaddr "nn:nn:nn:nn:nn:nn"

u-boot> saveenv

이렇게 ethaddr를 설정하면, 커널에서 uboot 의 ethaddr 을 읽어서 ethernet device를 구동한다.

커널에서는 임의의 명령으로 다시 변경할 수도 있다.

간단한 것인데도, 찾으려면 수고스러움이 있어서 정리해서 올린다.

 

혹시 다른 사항이 필요하면, 여기를 보는 것도 좋겠다. (kernel 구성 관련)

https://community.nxp.com/t5/i-MX-Processors/How-to-disable-random-MAC-address-generation-in-Kernel/td-p/802685

 

How to disable random MAC address generation in Kernel

Hi, We want to disable random MAC address generation for Ethernet in i.MX6 BSP in our release build so that IEEE allotted MAC number is programmed without fail during product manufacturing. Usually MAC address is programmed in U-boot environment variable "

community.nxp.com

 

2021. 12. 4. 20:07

SecureCRT를 사용한 ubuntu 20.04 ssh 접속 오류 (key exchange)

세상 참 빠르게 바뀌고 있다.

Ubuntu 20.04를 설치하고, Local 에서만 작업하다, 어느날 ssh를 접속해야 할 필요가 생겼다.

Putty로는 잘 되는데, SecureCRT v7.1.3을 사용하여 접속하려니,

Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256

이런 오류가 발생하였다.

SSH7 로 바뀌면서 SSH6의 key 교환 방식을 disable 시켰다고 한다. (보안상의 이유)

우선은 간단하게 다시 enable 시키려면,

# vi /etc/ssh/sshd_config

맨 아래에 두줄을 추가한 후 

# for SSH6 key exchange
KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc

sshd 서비스를 재 가동

# systemctl restart sshd

이제 다시 ssh 접속이 가능하다.

나는 local 에서만 사용할 것이라서.... 보안상 이유를 무시하고 사용한다.

참고하시길.

첨언:

https://www.howtoforge.com/community/threads/enable-diffie-hellman-group1-sha1-on-jessie.70764/#post-337033

를 보면, 아예 이전의 Key 알고리즘이 없어서 그런 것이니, 등록하고, Key를 만들면 문제가 해결된다고 한다.

# vi /etc/ssh/sshd_config

아래 두 줄을 추가하고,

KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
Ciphers 3des-cbc,blowfish-cbc,aes128-cbc,aes128-ctr,aes256-ctr

저장한 후, key를 만들고, sshd 서비스를 재시작하라고 한다. 누구 해보신 분 추가 설명 요망.

# ssh-keygen -A

# systemctl restart sshd

.끝.

2021. 5. 28. 21:39

Notepad++ 도 black theme를...

하루 종일 컴퓨터 앞에 앉아서 작업을 하니, 밝은 화면이 많이 싫다.

이제는 Notepadd++도  black으로...

찾아보니, VS2015 dark 테마가 있다. 약간 수정하여 올린다.

VS2015-Dark-modified-by-cg.xml
0.09MB

2021. 5. 24. 10:20

UltraEdit v16.30 에서 Color Scheme 변경

드디어 관련 정보를 찾았다.

http://forums.ultraedit.com/new-color-scheme-tango-dark-t6393.html

 

New Color Scheme (Tango Dark)

I've made a loose port of Tango Dark, which was originally done for gedit, and authored by Paolo Maggi. You'll need to edit your "Uedit32.INI" file...

forums.ultraedit.com

너무 오래된 것이라서...

Windows 10 에서는 "Uedit32.INI" 화일의 위치가

C:\Documents and Settings\[user_name]\AddData\Roaming\IDMComp\UltraEdit\

이었다.

바꾸기 전의 설정은

[User Color Schemes]
0=User Scheme 1;0;16777215;16777215;14120960;16711680;16640196;13882323;16777215;8750469;15724785;0;16777215;0;16776960;16777215;0;0;12632256;0;16119285;0;16119285;0;65280;0;255;13882323;16777215

인데, [User Color Schemes] 아래에 다음의 것을 추가하고,

1=Tango  Dark;13621203;3552302;15527662;8751752;13621203;5461845;8081525;0;13621203;0;13621203;3552302;0;164;0;1776151;0;8751752;0;1776151
2=Tango Dark Alt;13621203;3552302;15527662;8751752;13621203;2631458;8081525;0;13621203;0;13621203;3552302;0;164;0;1776151;0;5461845;0;1776151

UltraEdit 를 다시 실행하고, set color로 변경했는데.... 화면이 제대로 보이질 않는다.

언의의 highlightening 기능 때문이다.

wordfiles\c_cplusplus.uew 에서

/Colors = 0,8421376,8421376,8421504,255,
/Colors Back = 16777215,16777215,16777215,16777215,16777215,
/Colors Auto Back = 1,1,1,1,1,
/Font Style = 0,0,0,0,0,

이렇게 되어 있는 것을

/Colors = 13621203,8751752,8751752,54509,13621203,7256553,13606770,3465866,2697711,4108284,31221,1146305,13621203,
/Colors Back = 3552302,3552302,3552302,3552302,3552302,3552302,3552302,3552302,3552302,3552302,3552302,3552302,3552302,
/Colors Auto Back = 1,1,1,1,1,1,1,1,1,1,1,1,1,
/Font Style = 0,0,0,0,0,1,0,0,0,0,0,0,0,

으로 변경하고,,,,

음 그래도 화면이 마음에 들지 않음...

수정하여 최종 변경 한 것은,

UEdit32.ini

[User Color Schemes]
0=Tango Dark;13621203;3552302;15527662;8751752;13621203;5461845;8081525;0;13621203;0;13621203;3552302;0;164;0;1776151;0;8751752;0;1776151;0;16119285;0;65280;0;255;13882323;16777215
1=Tango Dark Alt;13621203;3552302;15527662;8751752;13621203;2631458;8081525;0;13621203;0;13621203;3552302;0;164;0;1776151;0;5461845;0;1776151;0;16119285;0;65280;0;255;13882323;16777215
2=User Scheme 1;0;16777215;16777215;14120960;16711680;16640196;13882323;16777215;8750469;15724785;0;16777215;0;16776960;16777215;0;0;12632256;0;16119285;0;16119285;0;65280;0;255;13882323;16777215

이다.

뭐 그런데로...

 

keyword , [] 의 색이 마음에 들지 않아서,

wordfiles\c_cplusplus.uew 에서

/C1"Keywords" STYLE_KEYWORD Colors = 16711680 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0

/C5"Braces, comma, semicolon" Colors = 4210816 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0

/C1"Keywords" STYLE_KEYWORD Colors = 16777088 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0

/C5"Braces, comma, semicolon" Colors = 16711935 Colors Back = 16777215 Colors Auto Back = 1 Font Style = 0

로 수정하니, 조금 마음에 드는 군요... 하하.

Color 코드를 변경할 때, 순서는  (b * 65536 + g * 256 + r) 입니다.

UEdit32.ini
0.02MB
c_cplusplus.uew
0.00MB